Commit af5875bd authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

be2net: Add EEPROM dump feature for Lancer

Implemented eeprom dump using ethtool feature for Lancer.
Signed-off-by: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent de49bd5a
...@@ -1167,6 +1167,8 @@ struct lancer_cmd_resp_write_object { ...@@ -1167,6 +1167,8 @@ struct lancer_cmd_resp_write_object {
#define LANCER_READ_FILE_EOF_MASK 0x80000000 #define LANCER_READ_FILE_EOF_MASK 0x80000000
#define LANCER_FW_DUMP_FILE "/dbg/dump.bin" #define LANCER_FW_DUMP_FILE "/dbg/dump.bin"
#define LANCER_VPD_PF_FILE "/vpd/ntr_pf.vpd"
#define LANCER_VPD_VF_FILE "/vpd/ntr_vf.vpd"
struct lancer_cmd_req_read_object { struct lancer_cmd_req_read_object {
struct be_cmd_req_hdr hdr; struct be_cmd_req_hdr hdr;
......
...@@ -727,7 +727,17 @@ be_do_flash(struct net_device *netdev, struct ethtool_flash *efl) ...@@ -727,7 +727,17 @@ be_do_flash(struct net_device *netdev, struct ethtool_flash *efl)
static int static int
be_get_eeprom_len(struct net_device *netdev) be_get_eeprom_len(struct net_device *netdev)
{ {
struct be_adapter *adapter = netdev_priv(netdev);
if (lancer_chip(adapter)) {
if (be_physfn(adapter))
return lancer_cmd_get_file_len(adapter,
LANCER_VPD_PF_FILE);
else
return lancer_cmd_get_file_len(adapter,
LANCER_VPD_VF_FILE);
} else {
return BE_READ_SEEPROM_LEN; return BE_READ_SEEPROM_LEN;
}
} }
static int static int
...@@ -742,6 +752,15 @@ be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom, ...@@ -742,6 +752,15 @@ be_read_eeprom(struct net_device *netdev, struct ethtool_eeprom *eeprom,
if (!eeprom->len) if (!eeprom->len)
return -EINVAL; return -EINVAL;
if (lancer_chip(adapter)) {
if (be_physfn(adapter))
return lancer_cmd_read_file(adapter, LANCER_VPD_PF_FILE,
eeprom->len, data);
else
return lancer_cmd_read_file(adapter, LANCER_VPD_VF_FILE,
eeprom->len, data);
}
eeprom->magic = BE_VENDOR_ID | (adapter->pdev->device<<16); eeprom->magic = BE_VENDOR_ID | (adapter->pdev->device<<16);
memset(&eeprom_cmd, 0, sizeof(struct be_dma_mem)); memset(&eeprom_cmd, 0, sizeof(struct be_dma_mem));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment