Commit a1e785e0 authored by Mintz Yuval's avatar Mintz Yuval Committed by David S. Miller

bnx2x: allow all functions to display the phy FW version

The phy FW version is stored in regular memory, no MDC-MDIO access or
any special locks are required to read it in the current implementation.
Signed-off-by: default avatarYuval Mintz <yuvalmin@broadcom.com>
Signed-off-by: default avatarEilon Greenstein <eilong@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 04f2d513
...@@ -806,14 +806,8 @@ static void bnx2x_get_drvinfo(struct net_device *dev, ...@@ -806,14 +806,8 @@ static void bnx2x_get_drvinfo(struct net_device *dev,
strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version)); strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
phy_fw_ver[0] = '\0'; phy_fw_ver[0] = '\0';
if (bp->port.pmf) { bnx2x_get_ext_phy_fw_version(&bp->link_params,
bnx2x_acquire_phy_lock(bp); phy_fw_ver, PHY_FW_VER_LEN);
bnx2x_get_ext_phy_fw_version(&bp->link_params,
(bp->state != BNX2X_STATE_CLOSED),
phy_fw_ver, PHY_FW_VER_LEN);
bnx2x_release_phy_lock(bp);
}
strlcpy(info->fw_version, bp->fw_ver, sizeof(info->fw_version)); strlcpy(info->fw_version, bp->fw_ver, sizeof(info->fw_version));
snprintf(info->fw_version + strlen(bp->fw_ver), 32 - strlen(bp->fw_ver), snprintf(info->fw_version + strlen(bp->fw_ver), 32 - strlen(bp->fw_ver),
"bc %d.%d.%d%s%s", "bc %d.%d.%d%s%s",
......
...@@ -6042,8 +6042,8 @@ static int bnx2x_null_format_ver(u32 spirom_ver, u8 *str, u16 *len) ...@@ -6042,8 +6042,8 @@ static int bnx2x_null_format_ver(u32 spirom_ver, u8 *str, u16 *len)
return 0; return 0;
} }
int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded, int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 *version,
u8 *version, u16 len) u16 len)
{ {
struct bnx2x *bp; struct bnx2x *bp;
u32 spirom_ver = 0; u32 spirom_ver = 0;
......
...@@ -337,8 +337,8 @@ int bnx2x_phy_write(struct link_params *params, u8 phy_addr, ...@@ -337,8 +337,8 @@ int bnx2x_phy_write(struct link_params *params, u8 phy_addr,
void bnx2x_link_status_update(struct link_params *input, void bnx2x_link_status_update(struct link_params *input,
struct link_vars *output); struct link_vars *output);
/* returns string representing the fw_version of the external phy */ /* returns string representing the fw_version of the external phy */
int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded, int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 *version,
u8 *version, u16 len); u16 len);
/* Set/Unset the led /* Set/Unset the led
Basically, the CLC takes care of the led for the link, but in case one needs Basically, the CLC takes care of the led for the link, but in case one needs
......
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