diff options
-rw-r--r-- | drivers/net/bnx2x_link.c | 108 | ||||
-rw-r--r-- | drivers/net/bnx2x_link.h | 12 | ||||
-rw-r--r-- | drivers/net/bnx2x_main.c | 8 |
3 files changed, 39 insertions, 89 deletions
diff --git a/drivers/net/bnx2x_link.c b/drivers/net/bnx2x_link.c index 74f4d1085a3e..c2b001031e7b 100644 --- a/drivers/net/bnx2x_link.c +++ b/drivers/net/bnx2x_link.c | |||
@@ -1547,10 +1547,7 @@ static u8 bnx2x_ext_phy_resove_fc(struct link_params *params, | |||
1547 | u8 ret = 0; | 1547 | u8 ret = 0; |
1548 | u32 ext_phy_type; | 1548 | u32 ext_phy_type; |
1549 | u8 port = params->port; | 1549 | u8 port = params->port; |
1550 | ext_phy_addr = ((params->ext_phy_config & | 1550 | ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
1551 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
1552 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
1553 | |||
1554 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 1551 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
1555 | /* read twice */ | 1552 | /* read twice */ |
1556 | 1553 | ||
@@ -2011,9 +2008,8 @@ static void bnx2x_ext_phy_reset(struct link_params *params, | |||
2011 | { | 2008 | { |
2012 | struct bnx2x *bp = params->bp; | 2009 | struct bnx2x *bp = params->bp; |
2013 | u32 ext_phy_type; | 2010 | u32 ext_phy_type; |
2014 | u8 ext_phy_addr = ((params->ext_phy_config & | 2011 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
2015 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | 2012 | |
2016 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
2017 | DP(NETIF_MSG_LINK, "Port %x: bnx2x_ext_phy_reset\n", params->port); | 2013 | DP(NETIF_MSG_LINK, "Port %x: bnx2x_ext_phy_reset\n", params->port); |
2018 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 2014 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
2019 | /* The PHY reset is controled by GPIO 1 | 2015 | /* The PHY reset is controled by GPIO 1 |
@@ -2292,9 +2288,7 @@ static void bnx2x_bcm8072_external_rom_boot(struct link_params *params) | |||
2292 | { | 2288 | { |
2293 | struct bnx2x *bp = params->bp; | 2289 | struct bnx2x *bp = params->bp; |
2294 | u8 port = params->port; | 2290 | u8 port = params->port; |
2295 | u8 ext_phy_addr = ((params->ext_phy_config & | 2291 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
2296 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
2297 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
2298 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 2292 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
2299 | 2293 | ||
2300 | /* Need to wait 200ms after reset */ | 2294 | /* Need to wait 200ms after reset */ |
@@ -2342,9 +2336,7 @@ static u8 bnx2x_8073_is_snr_needed(struct link_params *params) | |||
2342 | /* This is only required for 8073A1, version 102 only */ | 2336 | /* This is only required for 8073A1, version 102 only */ |
2343 | 2337 | ||
2344 | struct bnx2x *bp = params->bp; | 2338 | struct bnx2x *bp = params->bp; |
2345 | u8 ext_phy_addr = ((params->ext_phy_config & | 2339 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
2346 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
2347 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
2348 | u16 val; | 2340 | u16 val; |
2349 | 2341 | ||
2350 | /* Read 8073 HW revision*/ | 2342 | /* Read 8073 HW revision*/ |
@@ -2375,9 +2367,7 @@ static u8 bnx2x_8073_is_snr_needed(struct link_params *params) | |||
2375 | static u8 bnx2x_bcm8073_xaui_wa(struct link_params *params) | 2367 | static u8 bnx2x_bcm8073_xaui_wa(struct link_params *params) |
2376 | { | 2368 | { |
2377 | struct bnx2x *bp = params->bp; | 2369 | struct bnx2x *bp = params->bp; |
2378 | u8 ext_phy_addr = ((params->ext_phy_config & | 2370 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
2379 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
2380 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
2381 | u16 val, cnt, cnt1 ; | 2371 | u16 val, cnt, cnt1 ; |
2382 | 2372 | ||
2383 | bnx2x_cl45_read(bp, params->port, | 2373 | bnx2x_cl45_read(bp, params->port, |
@@ -2519,9 +2509,7 @@ static void bnx2x_bcm8726_external_rom_boot(struct link_params *params) | |||
2519 | { | 2509 | { |
2520 | struct bnx2x *bp = params->bp; | 2510 | struct bnx2x *bp = params->bp; |
2521 | u8 port = params->port; | 2511 | u8 port = params->port; |
2522 | u8 ext_phy_addr = ((params->ext_phy_config & | 2512 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
2523 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
2524 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
2525 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 2513 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
2526 | 2514 | ||
2527 | /* Need to wait 100ms after reset */ | 2515 | /* Need to wait 100ms after reset */ |
@@ -2607,9 +2595,7 @@ static u8 bnx2x_8726_read_sfp_module_eeprom(struct link_params *params, | |||
2607 | u16 val = 0; | 2595 | u16 val = 0; |
2608 | u16 i; | 2596 | u16 i; |
2609 | u8 port = params->port; | 2597 | u8 port = params->port; |
2610 | u8 ext_phy_addr = ((params->ext_phy_config & | 2598 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
2611 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
2612 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
2613 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 2599 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
2614 | if (byte_cnt > 16) { | 2600 | if (byte_cnt > 16) { |
2615 | DP(NETIF_MSG_LINK, "Reading from eeprom is" | 2601 | DP(NETIF_MSG_LINK, "Reading from eeprom is" |
@@ -2691,9 +2677,7 @@ static u8 bnx2x_8727_read_sfp_module_eeprom(struct link_params *params, | |||
2691 | struct bnx2x *bp = params->bp; | 2677 | struct bnx2x *bp = params->bp; |
2692 | u16 val, i; | 2678 | u16 val, i; |
2693 | u8 port = params->port; | 2679 | u8 port = params->port; |
2694 | u8 ext_phy_addr = ((params->ext_phy_config & | 2680 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
2695 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
2696 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
2697 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 2681 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
2698 | 2682 | ||
2699 | if (byte_cnt > 16) { | 2683 | if (byte_cnt > 16) { |
@@ -2946,9 +2930,7 @@ static u8 bnx2x_bcm8726_set_limiting_mode(struct link_params *params, | |||
2946 | { | 2930 | { |
2947 | struct bnx2x *bp = params->bp; | 2931 | struct bnx2x *bp = params->bp; |
2948 | u8 port = params->port; | 2932 | u8 port = params->port; |
2949 | u8 ext_phy_addr = ((params->ext_phy_config & | 2933 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
2950 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
2951 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
2952 | u16 cur_limiting_mode; | 2934 | u16 cur_limiting_mode; |
2953 | 2935 | ||
2954 | bnx2x_cl45_read(bp, port, | 2936 | bnx2x_cl45_read(bp, port, |
@@ -3014,9 +2996,7 @@ static u8 bnx2x_bcm8727_set_limiting_mode(struct link_params *params, | |||
3014 | u8 port = params->port; | 2996 | u8 port = params->port; |
3015 | u16 phy_identifier; | 2997 | u16 phy_identifier; |
3016 | u16 rom_ver2_val; | 2998 | u16 rom_ver2_val; |
3017 | u8 ext_phy_addr = ((params->ext_phy_config & | 2999 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
3018 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
3019 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
3020 | 3000 | ||
3021 | bnx2x_cl45_read(bp, port, | 3001 | bnx2x_cl45_read(bp, port, |
3022 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727, | 3002 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8727, |
@@ -3120,9 +3100,7 @@ static u8 bnx2x_sfp_module_detection(struct link_params *params) | |||
3120 | struct bnx2x *bp = params->bp; | 3100 | struct bnx2x *bp = params->bp; |
3121 | u16 edc_mode; | 3101 | u16 edc_mode; |
3122 | u8 rc = 0; | 3102 | u8 rc = 0; |
3123 | u8 ext_phy_addr = ((params->ext_phy_config & | 3103 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
3124 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
3125 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
3126 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 3104 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
3127 | u32 val = REG_RD(bp, params->shmem_base + | 3105 | u32 val = REG_RD(bp, params->shmem_base + |
3128 | offsetof(struct shmem_region, dev_info. | 3106 | offsetof(struct shmem_region, dev_info. |
@@ -3212,9 +3190,8 @@ void bnx2x_handle_module_detect_int(struct link_params *params) | |||
3212 | else | 3190 | else |
3213 | DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n"); | 3191 | DP(NETIF_MSG_LINK, "SFP+ module is not initialized\n"); |
3214 | } else { | 3192 | } else { |
3215 | u8 ext_phy_addr = ((params->ext_phy_config & | 3193 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
3216 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | 3194 | |
3217 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
3218 | u32 ext_phy_type = | 3195 | u32 ext_phy_type = |
3219 | XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 3196 | XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
3220 | u32 val = REG_RD(bp, params->shmem_base + | 3197 | u32 val = REG_RD(bp, params->shmem_base + |
@@ -3238,9 +3215,7 @@ static void bnx2x_bcm807x_force_10G(struct link_params *params) | |||
3238 | { | 3215 | { |
3239 | struct bnx2x *bp = params->bp; | 3216 | struct bnx2x *bp = params->bp; |
3240 | u8 port = params->port; | 3217 | u8 port = params->port; |
3241 | u8 ext_phy_addr = ((params->ext_phy_config & | 3218 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
3242 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
3243 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
3244 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 3219 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
3245 | 3220 | ||
3246 | /* Force KR or KX */ | 3221 | /* Force KR or KX */ |
@@ -3266,9 +3241,7 @@ static void bnx2x_bcm8073_set_xaui_low_power_mode(struct link_params *params) | |||
3266 | struct bnx2x *bp = params->bp; | 3241 | struct bnx2x *bp = params->bp; |
3267 | u8 port = params->port; | 3242 | u8 port = params->port; |
3268 | u16 val; | 3243 | u16 val; |
3269 | u8 ext_phy_addr = ((params->ext_phy_config & | 3244 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
3270 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
3271 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
3272 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 3245 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
3273 | 3246 | ||
3274 | bnx2x_cl45_read(bp, params->port, | 3247 | bnx2x_cl45_read(bp, params->port, |
@@ -3333,9 +3306,7 @@ static void bnx2x_8073_set_pause_cl37(struct link_params *params, | |||
3333 | 3306 | ||
3334 | struct bnx2x *bp = params->bp; | 3307 | struct bnx2x *bp = params->bp; |
3335 | u16 cl37_val; | 3308 | u16 cl37_val; |
3336 | u8 ext_phy_addr = ((params->ext_phy_config & | 3309 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
3337 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
3338 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
3339 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 3310 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
3340 | 3311 | ||
3341 | bnx2x_cl45_read(bp, params->port, | 3312 | bnx2x_cl45_read(bp, params->port, |
@@ -3378,9 +3349,7 @@ static void bnx2x_ext_phy_set_pause(struct link_params *params, | |||
3378 | { | 3349 | { |
3379 | struct bnx2x *bp = params->bp; | 3350 | struct bnx2x *bp = params->bp; |
3380 | u16 val; | 3351 | u16 val; |
3381 | u8 ext_phy_addr = ((params->ext_phy_config & | 3352 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
3382 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
3383 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
3384 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 3353 | u32 ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
3385 | 3354 | ||
3386 | /* read modify write pause advertizing */ | 3355 | /* read modify write pause advertizing */ |
@@ -3617,9 +3586,7 @@ static u8 bnx2x_ext_phy_init(struct link_params *params, struct link_vars *vars) | |||
3617 | u16 val = 0; | 3586 | u16 val = 0; |
3618 | u8 rc = 0; | 3587 | u8 rc = 0; |
3619 | if (vars->phy_flags & PHY_XGXS_FLAG) { | 3588 | if (vars->phy_flags & PHY_XGXS_FLAG) { |
3620 | ext_phy_addr = ((params->ext_phy_config & | 3589 | ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
3621 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
3622 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
3623 | 3590 | ||
3624 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 3591 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
3625 | /* Make sure that the soft reset is off (expect for the 8072: | 3592 | /* Make sure that the soft reset is off (expect for the 8072: |
@@ -4555,9 +4522,7 @@ static void bnx2x_8727_handle_mod_abs(struct link_params *params) | |||
4555 | { | 4522 | { |
4556 | struct bnx2x *bp = params->bp; | 4523 | struct bnx2x *bp = params->bp; |
4557 | u16 mod_abs, rx_alarm_status; | 4524 | u16 mod_abs, rx_alarm_status; |
4558 | u8 ext_phy_addr = ((params->ext_phy_config & | 4525 | u8 ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
4559 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
4560 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
4561 | u32 val = REG_RD(bp, params->shmem_base + | 4526 | u32 val = REG_RD(bp, params->shmem_base + |
4562 | offsetof(struct shmem_region, dev_info. | 4527 | offsetof(struct shmem_region, dev_info. |
4563 | port_feature_config[params->port]. | 4528 | port_feature_config[params->port]. |
@@ -4657,10 +4622,7 @@ static u8 bnx2x_ext_phy_is_link_up(struct link_params *params, | |||
4657 | u8 ext_phy_link_up = 0; | 4622 | u8 ext_phy_link_up = 0; |
4658 | u8 port = params->port; | 4623 | u8 port = params->port; |
4659 | if (vars->phy_flags & PHY_XGXS_FLAG) { | 4624 | if (vars->phy_flags & PHY_XGXS_FLAG) { |
4660 | ext_phy_addr = ((params->ext_phy_config & | 4625 | ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
4661 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
4662 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
4663 | |||
4664 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 4626 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
4665 | switch (ext_phy_type) { | 4627 | switch (ext_phy_type) { |
4666 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT: | 4628 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT: |
@@ -5608,10 +5570,8 @@ static void bnx2x_ext_phy_loopback(struct link_params *params) | |||
5608 | 5570 | ||
5609 | if (params->switch_cfg == SWITCH_CFG_10G) { | 5571 | if (params->switch_cfg == SWITCH_CFG_10G) { |
5610 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); | 5572 | ext_phy_type = XGXS_EXT_PHY_TYPE(params->ext_phy_config); |
5573 | ext_phy_addr = XGXS_EXT_PHY_ADDR(params->ext_phy_config); | ||
5611 | /* CL37 Autoneg Enabled */ | 5574 | /* CL37 Autoneg Enabled */ |
5612 | ext_phy_addr = ((params->ext_phy_config & | ||
5613 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
5614 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
5615 | switch (ext_phy_type) { | 5575 | switch (ext_phy_type) { |
5616 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT: | 5576 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT: |
5617 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN: | 5577 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN: |
@@ -6180,9 +6140,8 @@ u8 bnx2x_link_reset(struct link_params *params, struct link_vars *vars, | |||
6180 | { | 6140 | { |
6181 | 6141 | ||
6182 | /* Disable Transmitter */ | 6142 | /* Disable Transmitter */ |
6183 | u8 ext_phy_addr = ((params->ext_phy_config & | 6143 | u8 ext_phy_addr = |
6184 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | 6144 | XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
6185 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
6186 | if ((val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) == | 6145 | if ((val & PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_MASK) == |
6187 | PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER) | 6146 | PORT_FEAT_CFG_OPT_MDL_ENFRCMNT_DISABLE_TX_LASER) |
6188 | bnx2x_sfp_set_transmitter(bp, port, | 6147 | bnx2x_sfp_set_transmitter(bp, port, |
@@ -6200,9 +6159,8 @@ u8 bnx2x_link_reset(struct link_params *params, struct link_vars *vars, | |||
6200 | break; | 6159 | break; |
6201 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726: | 6160 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8726: |
6202 | { | 6161 | { |
6203 | u8 ext_phy_addr = ((params->ext_phy_config & | 6162 | u8 ext_phy_addr = |
6204 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | 6163 | XGXS_EXT_PHY_ADDR(params->ext_phy_config); |
6205 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
6206 | /* Set soft reset */ | 6164 | /* Set soft reset */ |
6207 | bnx2x_8726_reset_phy(bp, params->port, ext_phy_addr); | 6165 | bnx2x_8726_reset_phy(bp, params->port, ext_phy_addr); |
6208 | break; | 6166 | break; |
@@ -6420,10 +6378,7 @@ static u8 bnx2x_8073_common_init_phy(struct bnx2x *bp, u32 shmem_base) | |||
6420 | NIG_MASK_SERDES0_LINK_STATUS | | 6378 | NIG_MASK_SERDES0_LINK_STATUS | |
6421 | NIG_MASK_MI_INT)); | 6379 | NIG_MASK_MI_INT)); |
6422 | 6380 | ||
6423 | ext_phy_addr[port] = | 6381 | ext_phy_addr[port] = XGXS_EXT_PHY_ADDR(ext_phy_config); |
6424 | ((ext_phy_config & | ||
6425 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
6426 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
6427 | 6382 | ||
6428 | /* Need to take the phy out of low power mode in order | 6383 | /* Need to take the phy out of low power mode in order |
6429 | to write to access its registers */ | 6384 | to write to access its registers */ |
@@ -6549,9 +6504,7 @@ static u8 bnx2x_8727_common_init_phy(struct bnx2x *bp, u32 shmem_base) | |||
6549 | NIG_MASK_SERDES0_LINK_STATUS | | 6504 | NIG_MASK_SERDES0_LINK_STATUS | |
6550 | NIG_MASK_MI_INT)); | 6505 | NIG_MASK_MI_INT)); |
6551 | 6506 | ||
6552 | ext_phy_addr[port] = ((ext_phy_config & | 6507 | ext_phy_addr[port] = XGXS_EXT_PHY_ADDR(ext_phy_config); |
6553 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
6554 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
6555 | 6508 | ||
6556 | /* Reset the phy */ | 6509 | /* Reset the phy */ |
6557 | bnx2x_cl45_write(bp, port, | 6510 | bnx2x_cl45_write(bp, port, |
@@ -6609,10 +6562,7 @@ static u8 bnx2x_8726_common_init_phy(struct bnx2x *bp, u32 shmem_base) | |||
6609 | offsetof(struct shmem_region, | 6562 | offsetof(struct shmem_region, |
6610 | dev_info.port_hw_config[port].external_phy_config)); | 6563 | dev_info.port_hw_config[port].external_phy_config)); |
6611 | 6564 | ||
6612 | ext_phy_addr = | 6565 | ext_phy_addr = XGXS_EXT_PHY_ADDR(ext_phy_config); |
6613 | ((ext_phy_config & | ||
6614 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
6615 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT); | ||
6616 | DP(NETIF_MSG_LINK, "8726_common_init : ext_phy_addr = 0x%x\n", | 6566 | DP(NETIF_MSG_LINK, "8726_common_init : ext_phy_addr = 0x%x\n", |
6617 | ext_phy_addr); | 6567 | ext_phy_addr); |
6618 | 6568 | ||
diff --git a/drivers/net/bnx2x_link.h b/drivers/net/bnx2x_link.h index e0d7eef1ced5..f3e252264e1b 100644 --- a/drivers/net/bnx2x_link.h +++ b/drivers/net/bnx2x_link.h | |||
@@ -88,10 +88,14 @@ struct link_params { | |||
88 | 88 | ||
89 | u32 lane_config; | 89 | u32 lane_config; |
90 | u32 ext_phy_config; | 90 | u32 ext_phy_config; |
91 | #define XGXS_EXT_PHY_TYPE(ext_phy_config) (ext_phy_config & \ | 91 | #define XGXS_EXT_PHY_TYPE(ext_phy_config) \ |
92 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) | 92 | ((ext_phy_config) & PORT_HW_CFG_XGXS_EXT_PHY_TYPE_MASK) |
93 | #define SERDES_EXT_PHY_TYPE(ext_phy_config) (ext_phy_config & \ | 93 | #define XGXS_EXT_PHY_ADDR(ext_phy_config) \ |
94 | PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK) | 94 | (((ext_phy_config) & PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> \ |
95 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT) | ||
96 | #define SERDES_EXT_PHY_TYPE(ext_phy_config) \ | ||
97 | ((ext_phy_config) & PORT_HW_CFG_SERDES_EXT_PHY_TYPE_MASK) | ||
98 | |||
95 | /* Phy register parameter */ | 99 | /* Phy register parameter */ |
96 | u32 chip_id; | 100 | u32 chip_id; |
97 | 101 | ||
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 1e8e7e1efbd6..d22c6b7f7da6 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -8546,9 +8546,7 @@ static void __devinit bnx2x_get_port_hwinfo(struct bnx2x *bp) | |||
8546 | else if ((ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) && | 8546 | else if ((ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_FAILURE) && |
8547 | (ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) | 8547 | (ext_phy_type != PORT_HW_CFG_XGXS_EXT_PHY_TYPE_NOT_CONN)) |
8548 | bp->mdio.prtad = | 8548 | bp->mdio.prtad = |
8549 | (bp->link_params.ext_phy_config & | 8549 | XGXS_EXT_PHY_ADDR(bp->link_params.ext_phy_config); |
8550 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
8551 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT; | ||
8552 | 8550 | ||
8553 | val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_upper); | 8551 | val2 = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_upper); |
8554 | val = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_lower); | 8552 | val = SHMEM_RD(bp, dev_info.port_hw_config[port].mac_lower); |
@@ -9549,9 +9547,7 @@ static int bnx2x_set_eeprom(struct net_device *dev, | |||
9549 | if (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config) == | 9547 | if (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config) == |
9550 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101) { | 9548 | PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101) { |
9551 | u8 ext_phy_addr = | 9549 | u8 ext_phy_addr = |
9552 | (bp->link_params.ext_phy_config & | 9550 | XGXS_EXT_PHY_ADDR(bp->link_params.ext_phy_config); |
9553 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_MASK) >> | ||
9554 | PORT_HW_CFG_XGXS_EXT_PHY_ADDR_SHIFT; | ||
9555 | 9551 | ||
9556 | /* DSP Remove Download Mode */ | 9552 | /* DSP Remove Download Mode */ |
9557 | bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_0, | 9553 | bnx2x_set_gpio(bp, MISC_REGISTERS_GPIO_0, |