.timesync_adjust_time = axgbe_timesync_adjust_time,
.timesync_read_time = axgbe_timesync_read_time,
.timesync_write_time = axgbe_timesync_write_time,
+ .fw_version_get = axgbe_dev_fw_version_get,
};
static int axgbe_phy_reset(struct axgbe_port *pdata)
return 0;
}
+int axgbe_dev_fw_version_get(struct rte_eth_dev *eth_dev,
+ char *fw_version, size_t fw_size)
+{
+ struct axgbe_port *pdata;
+ struct axgbe_hw_features *hw_feat;
+ int ret;
+
+ pdata = (struct axgbe_port *)eth_dev->data->dev_private;
+ hw_feat = &pdata->hw_feat;
+
+ if (fw_version == NULL)
+ return -EINVAL;
+
+ ret = snprintf(fw_version, fw_size, "%d.%d.%d",
+ AXGMAC_GET_BITS(hw_feat->version, MAC_VR, USERVER),
+ AXGMAC_GET_BITS(hw_feat->version, MAC_VR, DEVID),
+ AXGMAC_GET_BITS(hw_feat->version, MAC_VR, SNPSVER));
+ if (ret < 0)
+ return -EINVAL;
+
+ ret += 1; /* add the size of '\0' */
+
+ if (fw_size < (size_t)ret)
+ return ret;
+ else
+ return 0;
+}
+
static void axgbe_txq_prepare_tx_stop(struct axgbe_port *pdata,
unsigned int queue)
{
int axgbe_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);
int axgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);
+int axgbe_dev_fw_version_get(struct rte_eth_dev *eth_dev,
+ char *fw_version, size_t fw_size);
+
uint16_t axgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
uint16_t nb_pkts);
uint16_t axgbe_xmit_pkts_vec(void *tx_queue, struct rte_mbuf **tx_pkts,