diff options
author | Yaniv Rosner <yanivr@broadcom.com> | 2011-01-30 23:22:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-01-31 16:22:42 -0500 |
commit | 6d870c391ec0e4da4fd75df7e6aca7252162c408 (patch) | |
tree | 421c7da7445a009ead6028cbc9baf352b0c02cd1 /drivers/net/bnx2x | |
parent | 65a001bad18eb80f6f953e5e0601132f09bfe197 (diff) |
bnx2x: Add and change some net_dev messages
Add and modify some net dev prints to improve error control
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bnx2x')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_link.c | 41 |
1 files changed, 28 insertions, 13 deletions
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c index 452e262b0c20..187387e86d25 100644 --- a/drivers/net/bnx2x/bnx2x_link.c +++ b/drivers/net/bnx2x/bnx2x_link.c | |||
@@ -1422,6 +1422,7 @@ static u8 bnx2x_cl45_write(struct bnx2x *bp, struct bnx2x_phy *phy, | |||
1422 | } | 1422 | } |
1423 | if (tmp & EMAC_MDIO_COMM_START_BUSY) { | 1423 | if (tmp & EMAC_MDIO_COMM_START_BUSY) { |
1424 | DP(NETIF_MSG_LINK, "write phy register failed\n"); | 1424 | DP(NETIF_MSG_LINK, "write phy register failed\n"); |
1425 | netdev_err(bp->dev, "MDC/MDIO access timeout\n"); | ||
1425 | rc = -EFAULT; | 1426 | rc = -EFAULT; |
1426 | } else { | 1427 | } else { |
1427 | /* data */ | 1428 | /* data */ |
@@ -1442,6 +1443,7 @@ static u8 bnx2x_cl45_write(struct bnx2x *bp, struct bnx2x_phy *phy, | |||
1442 | } | 1443 | } |
1443 | if (tmp & EMAC_MDIO_COMM_START_BUSY) { | 1444 | if (tmp & EMAC_MDIO_COMM_START_BUSY) { |
1444 | DP(NETIF_MSG_LINK, "write phy register failed\n"); | 1445 | DP(NETIF_MSG_LINK, "write phy register failed\n"); |
1446 | netdev_err(bp->dev, "MDC/MDIO access timeout\n"); | ||
1445 | rc = -EFAULT; | 1447 | rc = -EFAULT; |
1446 | } | 1448 | } |
1447 | } | 1449 | } |
@@ -1489,7 +1491,7 @@ static u8 bnx2x_cl45_read(struct bnx2x *bp, struct bnx2x_phy *phy, | |||
1489 | } | 1491 | } |
1490 | if (val & EMAC_MDIO_COMM_START_BUSY) { | 1492 | if (val & EMAC_MDIO_COMM_START_BUSY) { |
1491 | DP(NETIF_MSG_LINK, "read phy register failed\n"); | 1493 | DP(NETIF_MSG_LINK, "read phy register failed\n"); |
1492 | 1494 | netdev_err(bp->dev, "MDC/MDIO access timeout\n"); | |
1493 | *ret_val = 0; | 1495 | *ret_val = 0; |
1494 | rc = -EFAULT; | 1496 | rc = -EFAULT; |
1495 | 1497 | ||
@@ -1512,7 +1514,7 @@ static u8 bnx2x_cl45_read(struct bnx2x *bp, struct bnx2x_phy *phy, | |||
1512 | } | 1514 | } |
1513 | if (val & EMAC_MDIO_COMM_START_BUSY) { | 1515 | if (val & EMAC_MDIO_COMM_START_BUSY) { |
1514 | DP(NETIF_MSG_LINK, "read phy register failed\n"); | 1516 | DP(NETIF_MSG_LINK, "read phy register failed\n"); |
1515 | 1517 | netdev_err(bp->dev, "MDC/MDIO access timeout\n"); | |
1516 | *ret_val = 0; | 1518 | *ret_val = 0; |
1517 | rc = -EFAULT; | 1519 | rc = -EFAULT; |
1518 | } | 1520 | } |
@@ -1827,6 +1829,9 @@ static u8 bnx2x_reset_unicore(struct link_params *params, | |||
1827 | } | 1829 | } |
1828 | } | 1830 | } |
1829 | 1831 | ||
1832 | netdev_err(bp->dev, "Warning: PHY was not initialized," | ||
1833 | " Port %d\n", | ||
1834 | params->port); | ||
1830 | DP(NETIF_MSG_LINK, "BUG! XGXS is still in reset!\n"); | 1835 | DP(NETIF_MSG_LINK, "BUG! XGXS is still in reset!\n"); |
1831 | return -EINVAL; | 1836 | return -EINVAL; |
1832 | 1837 | ||
@@ -2846,7 +2851,8 @@ static u8 bnx2x_init_xgxs(struct bnx2x_phy *phy, | |||
2846 | } | 2851 | } |
2847 | 2852 | ||
2848 | static u16 bnx2x_wait_reset_complete(struct bnx2x *bp, | 2853 | static u16 bnx2x_wait_reset_complete(struct bnx2x *bp, |
2849 | struct bnx2x_phy *phy) | 2854 | struct bnx2x_phy *phy, |
2855 | struct link_params *params) | ||
2850 | { | 2856 | { |
2851 | u16 cnt, ctrl; | 2857 | u16 cnt, ctrl; |
2852 | /* Wait for soft reset to get cleared upto 1 sec */ | 2858 | /* Wait for soft reset to get cleared upto 1 sec */ |
@@ -2857,6 +2863,11 @@ static u16 bnx2x_wait_reset_complete(struct bnx2x *bp, | |||
2857 | break; | 2863 | break; |
2858 | msleep(1); | 2864 | msleep(1); |
2859 | } | 2865 | } |
2866 | |||
2867 | if (cnt == 1000) | ||
2868 | netdev_err(bp->dev, "Warning: PHY was not initialized," | ||
2869 | " Port %d\n", | ||
2870 | params->port); | ||
2860 | DP(NETIF_MSG_LINK, "control reg 0x%x (after %d ms)\n", ctrl, cnt); | 2871 | DP(NETIF_MSG_LINK, "control reg 0x%x (after %d ms)\n", ctrl, cnt); |
2861 | return cnt; | 2872 | return cnt; |
2862 | } | 2873 | } |
@@ -4402,7 +4413,7 @@ static u8 bnx2x_8705_config_init(struct bnx2x_phy *phy, | |||
4402 | /* HW reset */ | 4413 | /* HW reset */ |
4403 | bnx2x_ext_phy_hw_reset(bp, params->port); | 4414 | bnx2x_ext_phy_hw_reset(bp, params->port); |
4404 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0xa040); | 4415 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0xa040); |
4405 | bnx2x_wait_reset_complete(bp, phy); | 4416 | bnx2x_wait_reset_complete(bp, phy, params); |
4406 | 4417 | ||
4407 | bnx2x_cl45_write(bp, phy, | 4418 | bnx2x_cl45_write(bp, phy, |
4408 | MDIO_PMA_DEVAD, MDIO_PMA_REG_MISC_CTRL, 0x8288); | 4419 | MDIO_PMA_DEVAD, MDIO_PMA_REG_MISC_CTRL, 0x8288); |
@@ -4797,9 +4808,9 @@ static u8 bnx2x_verify_sfp_module(struct bnx2x_phy *phy, | |||
4797 | else | 4808 | else |
4798 | vendor_pn[SFP_EEPROM_PART_NO_SIZE] = '\0'; | 4809 | vendor_pn[SFP_EEPROM_PART_NO_SIZE] = '\0'; |
4799 | 4810 | ||
4800 | netdev_info(bp->dev, "Warning: Unqualified SFP+ module detected," | 4811 | netdev_err(bp->dev, "Warning: Unqualified SFP+ module detected," |
4801 | " Port %d from %s part number %s\n", | 4812 | " Port %d from %s part number %s\n", |
4802 | params->port, vendor_name, vendor_pn); | 4813 | params->port, vendor_name, vendor_pn); |
4803 | phy->flags |= FLAGS_SFP_NOT_APPROVED; | 4814 | phy->flags |= FLAGS_SFP_NOT_APPROVED; |
4804 | return -EINVAL; | 4815 | return -EINVAL; |
4805 | } | 4816 | } |
@@ -5142,7 +5153,7 @@ static u8 bnx2x_8706_config_init(struct bnx2x_phy *phy, | |||
5142 | /* HW reset */ | 5153 | /* HW reset */ |
5143 | bnx2x_ext_phy_hw_reset(bp, params->port); | 5154 | bnx2x_ext_phy_hw_reset(bp, params->port); |
5144 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0xa040); | 5155 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 0xa040); |
5145 | bnx2x_wait_reset_complete(bp, phy); | 5156 | bnx2x_wait_reset_complete(bp, phy, params); |
5146 | 5157 | ||
5147 | /* Wait until fw is loaded */ | 5158 | /* Wait until fw is loaded */ |
5148 | for (cnt = 0; cnt < 100; cnt++) { | 5159 | for (cnt = 0; cnt < 100; cnt++) { |
@@ -5305,7 +5316,7 @@ static u8 bnx2x_8726_config_init(struct bnx2x_phy *phy, | |||
5305 | MISC_REGISTERS_GPIO_OUTPUT_HIGH, params->port); | 5316 | MISC_REGISTERS_GPIO_OUTPUT_HIGH, params->port); |
5306 | 5317 | ||
5307 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 1<<15); | 5318 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 1<<15); |
5308 | bnx2x_wait_reset_complete(bp, phy); | 5319 | bnx2x_wait_reset_complete(bp, phy, params); |
5309 | 5320 | ||
5310 | bnx2x_8726_external_rom_boot(phy, params); | 5321 | bnx2x_8726_external_rom_boot(phy, params); |
5311 | 5322 | ||
@@ -5495,7 +5506,7 @@ static u8 bnx2x_8727_config_init(struct bnx2x_phy *phy, | |||
5495 | struct bnx2x *bp = params->bp; | 5506 | struct bnx2x *bp = params->bp; |
5496 | /* Enable PMD link, MOD_ABS_FLT, and 1G link alarm */ | 5507 | /* Enable PMD link, MOD_ABS_FLT, and 1G link alarm */ |
5497 | 5508 | ||
5498 | bnx2x_wait_reset_complete(bp, phy); | 5509 | bnx2x_wait_reset_complete(bp, phy, params); |
5499 | rx_alarm_ctrl_val = (1<<2) | (1<<5) ; | 5510 | rx_alarm_ctrl_val = (1<<2) | (1<<5) ; |
5500 | lasi_ctrl_val = 0x0004; | 5511 | lasi_ctrl_val = 0x0004; |
5501 | 5512 | ||
@@ -6117,7 +6128,7 @@ static u8 bnx2x_8481_config_init(struct bnx2x_phy *phy, | |||
6117 | 6128 | ||
6118 | /* HW reset */ | 6129 | /* HW reset */ |
6119 | bnx2x_ext_phy_hw_reset(bp, params->port); | 6130 | bnx2x_ext_phy_hw_reset(bp, params->port); |
6120 | bnx2x_wait_reset_complete(bp, phy); | 6131 | bnx2x_wait_reset_complete(bp, phy, params); |
6121 | 6132 | ||
6122 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 1<<15); | 6133 | bnx2x_cl45_write(bp, phy, MDIO_PMA_DEVAD, MDIO_PMA_REG_CTRL, 1<<15); |
6123 | return bnx2x_848xx_cmn_config_init(phy, params, vars); | 6134 | return bnx2x_848xx_cmn_config_init(phy, params, vars); |
@@ -6144,7 +6155,7 @@ static u8 bnx2x_848x3_config_init(struct bnx2x_phy *phy, | |||
6144 | bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_3, | 6155 | bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_3, |
6145 | MISC_REGISTERS_GPIO_OUTPUT_HIGH, | 6156 | MISC_REGISTERS_GPIO_OUTPUT_HIGH, |
6146 | port); | 6157 | port); |
6147 | bnx2x_wait_reset_complete(bp, phy); | 6158 | bnx2x_wait_reset_complete(bp, phy, params); |
6148 | /* Wait for GPHY to come out of reset */ | 6159 | /* Wait for GPHY to come out of reset */ |
6149 | msleep(50); | 6160 | msleep(50); |
6150 | /* | 6161 | /* |
@@ -6544,7 +6555,7 @@ static u8 bnx2x_7101_config_init(struct bnx2x_phy *phy, | |||
6544 | MISC_REGISTERS_GPIO_OUTPUT_HIGH, params->port); | 6555 | MISC_REGISTERS_GPIO_OUTPUT_HIGH, params->port); |
6545 | /* HW reset */ | 6556 | /* HW reset */ |
6546 | bnx2x_ext_phy_hw_reset(bp, params->port); | 6557 | bnx2x_ext_phy_hw_reset(bp, params->port); |
6547 | bnx2x_wait_reset_complete(bp, phy); | 6558 | bnx2x_wait_reset_complete(bp, phy, params); |
6548 | 6559 | ||
6549 | bnx2x_cl45_write(bp, phy, | 6560 | bnx2x_cl45_write(bp, phy, |
6550 | MDIO_PMA_DEVAD, MDIO_PMA_REG_LASI_CTRL, 0x1); | 6561 | MDIO_PMA_DEVAD, MDIO_PMA_REG_LASI_CTRL, 0x1); |
@@ -8000,6 +8011,10 @@ static u8 bnx2x_ext_phy_common_init(struct bnx2x *bp, u32 shmem_base_path[], | |||
8000 | break; | 8011 | break; |
8001 | } | 8012 | } |
8002 | 8013 | ||
8014 | if (rc != 0) | ||
8015 | netdev_err(bp->dev, "Warning: PHY was not initialized," | ||
8016 | " Port %d\n", | ||
8017 | 0); | ||
8003 | return rc; | 8018 | return rc; |
8004 | } | 8019 | } |
8005 | 8020 | ||