diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-08-12 04:23:40 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-13 02:02:52 -0400 |
commit | 0d28e49a2616b927bca5fde0f16dfdfd2a501107 (patch) | |
tree | 037b82ea6ee84503960f91c591558b94cc79da48 /drivers/net/bnx2x_main.c | |
parent | 938cf5416d59769ec2e7ce4eb7967cb3b61242a3 (diff) |
bnx2x: Updating regdump_len at drvinfo
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x_main.c')
-rw-r--r-- | drivers/net/bnx2x_main.c | 69 |
1 files changed, 33 insertions, 36 deletions
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index f1bd0a32cc30..276d8467b8c1 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -8947,50 +8947,15 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
8947 | return 0; | 8947 | return 0; |
8948 | } | 8948 | } |
8949 | 8949 | ||
8950 | #define PHY_FW_VER_LEN 10 | ||
8951 | |||
8952 | static void bnx2x_get_drvinfo(struct net_device *dev, | ||
8953 | struct ethtool_drvinfo *info) | ||
8954 | { | ||
8955 | struct bnx2x *bp = netdev_priv(dev); | ||
8956 | u8 phy_fw_ver[PHY_FW_VER_LEN]; | ||
8957 | |||
8958 | strcpy(info->driver, DRV_MODULE_NAME); | ||
8959 | strcpy(info->version, DRV_MODULE_VERSION); | ||
8960 | |||
8961 | phy_fw_ver[0] = '\0'; | ||
8962 | if (bp->port.pmf) { | ||
8963 | bnx2x_acquire_phy_lock(bp); | ||
8964 | bnx2x_get_ext_phy_fw_version(&bp->link_params, | ||
8965 | (bp->state != BNX2X_STATE_CLOSED), | ||
8966 | phy_fw_ver, PHY_FW_VER_LEN); | ||
8967 | bnx2x_release_phy_lock(bp); | ||
8968 | } | ||
8969 | |||
8970 | snprintf(info->fw_version, 32, "BC:%d.%d.%d%s%s", | ||
8971 | (bp->common.bc_ver & 0xff0000) >> 16, | ||
8972 | (bp->common.bc_ver & 0xff00) >> 8, | ||
8973 | (bp->common.bc_ver & 0xff), | ||
8974 | ((phy_fw_ver[0] != '\0') ? " PHY:" : ""), phy_fw_ver); | ||
8975 | strcpy(info->bus_info, pci_name(bp->pdev)); | ||
8976 | info->n_stats = BNX2X_NUM_STATS; | ||
8977 | info->testinfo_len = BNX2X_NUM_TESTS; | ||
8978 | info->eedump_len = bp->common.flash_size; | ||
8979 | info->regdump_len = 0; | ||
8980 | } | ||
8981 | |||
8982 | #define IS_E1_ONLINE(info) (((info) & RI_E1_ONLINE) == RI_E1_ONLINE) | 8950 | #define IS_E1_ONLINE(info) (((info) & RI_E1_ONLINE) == RI_E1_ONLINE) |
8983 | #define IS_E1H_ONLINE(info) (((info) & RI_E1H_ONLINE) == RI_E1H_ONLINE) | 8951 | #define IS_E1H_ONLINE(info) (((info) & RI_E1H_ONLINE) == RI_E1H_ONLINE) |
8984 | 8952 | ||
8985 | static int bnx2x_get_regs_len(struct net_device *dev) | 8953 | static int bnx2x_get_regs_len(struct net_device *dev) |
8986 | { | 8954 | { |
8987 | static u32 regdump_len; | ||
8988 | struct bnx2x *bp = netdev_priv(dev); | 8955 | struct bnx2x *bp = netdev_priv(dev); |
8956 | int regdump_len = 0; | ||
8989 | int i; | 8957 | int i; |
8990 | 8958 | ||
8991 | if (regdump_len) | ||
8992 | return regdump_len; | ||
8993 | |||
8994 | if (CHIP_IS_E1(bp)) { | 8959 | if (CHIP_IS_E1(bp)) { |
8995 | for (i = 0; i < REGS_COUNT; i++) | 8960 | for (i = 0; i < REGS_COUNT; i++) |
8996 | if (IS_E1_ONLINE(reg_addrs[i].info)) | 8961 | if (IS_E1_ONLINE(reg_addrs[i].info)) |
@@ -9057,6 +9022,38 @@ static void bnx2x_get_regs(struct net_device *dev, | |||
9057 | } | 9022 | } |
9058 | } | 9023 | } |
9059 | 9024 | ||
9025 | #define PHY_FW_VER_LEN 10 | ||
9026 | |||
9027 | static void bnx2x_get_drvinfo(struct net_device *dev, | ||
9028 | struct ethtool_drvinfo *info) | ||
9029 | { | ||
9030 | struct bnx2x *bp = netdev_priv(dev); | ||
9031 | u8 phy_fw_ver[PHY_FW_VER_LEN]; | ||
9032 | |||
9033 | strcpy(info->driver, DRV_MODULE_NAME); | ||
9034 | strcpy(info->version, DRV_MODULE_VERSION); | ||
9035 | |||
9036 | phy_fw_ver[0] = '\0'; | ||
9037 | if (bp->port.pmf) { | ||
9038 | bnx2x_acquire_phy_lock(bp); | ||
9039 | bnx2x_get_ext_phy_fw_version(&bp->link_params, | ||
9040 | (bp->state != BNX2X_STATE_CLOSED), | ||
9041 | phy_fw_ver, PHY_FW_VER_LEN); | ||
9042 | bnx2x_release_phy_lock(bp); | ||
9043 | } | ||
9044 | |||
9045 | snprintf(info->fw_version, 32, "BC:%d.%d.%d%s%s", | ||
9046 | (bp->common.bc_ver & 0xff0000) >> 16, | ||
9047 | (bp->common.bc_ver & 0xff00) >> 8, | ||
9048 | (bp->common.bc_ver & 0xff), | ||
9049 | ((phy_fw_ver[0] != '\0') ? " PHY:" : ""), phy_fw_ver); | ||
9050 | strcpy(info->bus_info, pci_name(bp->pdev)); | ||
9051 | info->n_stats = BNX2X_NUM_STATS; | ||
9052 | info->testinfo_len = BNX2X_NUM_TESTS; | ||
9053 | info->eedump_len = bp->common.flash_size; | ||
9054 | info->regdump_len = bnx2x_get_regs_len(dev); | ||
9055 | } | ||
9056 | |||
9060 | static void bnx2x_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) | 9057 | static void bnx2x_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol) |
9061 | { | 9058 | { |
9062 | struct bnx2x *bp = netdev_priv(dev); | 9059 | struct bnx2x *bp = netdev_priv(dev); |