aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMintz Yuval <yuvalmin@broadcom.com>2012-02-14 21:10:32 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-15 15:30:50 -0500
commita1e785e02bb53573443c7e58a444cef1a049f6ce (patch)
treebd326fdd3205dcceb67e01ef21eccf8eeed7bfa4
parent04f2d51313938d004983652ea6162d4940d83a04 (diff)
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: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c10
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c4
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h4
3 files changed, 6 insertions, 12 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
index c18dc1d14a1d..7e57fa40d2e3 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c
@@ -806,14 +806,8 @@ static void bnx2x_get_drvinfo(struct net_device *dev,
806 strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version)); 806 strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
807 807
808 phy_fw_ver[0] = '\0'; 808 phy_fw_ver[0] = '\0';
809 if (bp->port.pmf) { 809 bnx2x_get_ext_phy_fw_version(&bp->link_params,
810 bnx2x_acquire_phy_lock(bp); 810 phy_fw_ver, PHY_FW_VER_LEN);
811 bnx2x_get_ext_phy_fw_version(&bp->link_params,
812 (bp->state != BNX2X_STATE_CLOSED),
813 phy_fw_ver, PHY_FW_VER_LEN);
814 bnx2x_release_phy_lock(bp);
815 }
816
817 strlcpy(info->fw_version, bp->fw_ver, sizeof(info->fw_version)); 811 strlcpy(info->fw_version, bp->fw_ver, sizeof(info->fw_version));
818 snprintf(info->fw_version + strlen(bp->fw_ver), 32 - strlen(bp->fw_ver), 812 snprintf(info->fw_version + strlen(bp->fw_ver), 32 - strlen(bp->fw_ver),
819 "bc %d.%d.%d%s%s", 813 "bc %d.%d.%d%s%s",
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 57fe056bc5e0..beb4cdbdb6e1 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -6042,8 +6042,8 @@ static int bnx2x_null_format_ver(u32 spirom_ver, u8 *str, u16 *len)
6042 return 0; 6042 return 0;
6043} 6043}
6044 6044
6045int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded, 6045int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 *version,
6046 u8 *version, u16 len) 6046 u16 len)
6047{ 6047{
6048 struct bnx2x *bp; 6048 struct bnx2x *bp;
6049 u32 spirom_ver = 0; 6049 u32 spirom_ver = 0;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
index 9cc7bafb3dfe..7ba557a610da 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
@@ -337,8 +337,8 @@ int bnx2x_phy_write(struct link_params *params, u8 phy_addr,
337void bnx2x_link_status_update(struct link_params *input, 337void bnx2x_link_status_update(struct link_params *input,
338 struct link_vars *output); 338 struct link_vars *output);
339/* returns string representing the fw_version of the external phy */ 339/* returns string representing the fw_version of the external phy */
340int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 driver_loaded, 340int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 *version,
341 u8 *version, u16 len); 341 u16 len);
342 342
343/* Set/Unset the led 343/* Set/Unset the led
344 Basically, the CLC takes care of the led for the link, but in case one needs 344 Basically, the CLC takes care of the led for the link, but in case one needs