.flow_ctrl_set = cnxk_nix_flow_ctrl_set,
.dev_set_link_up = cnxk_nix_set_link_up,
.dev_set_link_down = cnxk_nix_set_link_down,
+ .get_module_info = cnxk_nix_get_module_info,
+ .get_module_eeprom = cnxk_nix_get_module_eeprom,
};
static int
struct rte_eth_fc_conf *fc_conf);
int cnxk_nix_set_link_up(struct rte_eth_dev *eth_dev);
int cnxk_nix_set_link_down(struct rte_eth_dev *eth_dev);
+int cnxk_nix_get_module_info(struct rte_eth_dev *eth_dev,
+ struct rte_eth_dev_module_info *modinfo);
+int cnxk_nix_get_module_eeprom(struct rte_eth_dev *eth_dev,
+ struct rte_dev_eeprom_info *info);
int cnxk_nix_configure(struct rte_eth_dev *eth_dev);
int cnxk_nix_tx_queue_setup(struct rte_eth_dev *eth_dev, uint16_t qid,
exit:
return rc;
}
+
+int
+cnxk_nix_get_module_info(struct rte_eth_dev *eth_dev,
+ struct rte_eth_dev_module_info *modinfo)
+{
+ struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
+ struct roc_nix_eeprom_info eeprom_info = {0};
+ struct roc_nix *nix = &dev->nix;
+ int rc;
+
+ rc = roc_nix_eeprom_info_get(nix, &eeprom_info);
+ if (rc)
+ return rc;
+
+ modinfo->type = eeprom_info.sff_id;
+ modinfo->eeprom_len = ROC_NIX_EEPROM_SIZE;
+ return 0;
+}
+
+int
+cnxk_nix_get_module_eeprom(struct rte_eth_dev *eth_dev,
+ struct rte_dev_eeprom_info *info)
+{
+ struct cnxk_eth_dev *dev = cnxk_eth_pmd_priv(eth_dev);
+ struct roc_nix_eeprom_info eeprom_info = {0};
+ struct roc_nix *nix = &dev->nix;
+ int rc = -EINVAL;
+
+ if (!info->data || !info->length ||
+ (info->offset + info->length > ROC_NIX_EEPROM_SIZE))
+ return rc;
+
+ rc = roc_nix_eeprom_info_get(nix, &eeprom_info);
+ if (rc)
+ return rc;
+
+ rte_memcpy(info->data, eeprom_info.buf + info->offset, info->length);
+ return 0;
+}