diff options
author | Yaniv Rosner <yanivr@broadcom.com> | 2011-07-23 23:53:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-07-24 16:11:40 -0400 |
commit | 1cb0c788e03da59f14699530aa031a07a89f0056 (patch) | |
tree | 4e84575a4a0090e7f3a88679e11fdbeb00b0d7bf /drivers/net/bnx2x | |
parent | 09b775e7ec08ae92b8d976b7e34ba7f83b904c97 (diff) |
bnx2x: fix loopback for non 10G link
Also fixes minor formatting in that function.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
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_main.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/net/bnx2x/bnx2x_main.c b/drivers/net/bnx2x/bnx2x_main.c index e1ec1a302474..ad4a55e4f6e8 100644 --- a/drivers/net/bnx2x/bnx2x_main.c +++ b/drivers/net/bnx2x/bnx2x_main.c | |||
@@ -2151,10 +2151,12 @@ u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) | |||
2151 | u8 rc; | 2151 | u8 rc; |
2152 | int cfx_idx = bnx2x_get_link_cfg_idx(bp); | 2152 | int cfx_idx = bnx2x_get_link_cfg_idx(bp); |
2153 | u16 req_line_speed = bp->link_params.req_line_speed[cfx_idx]; | 2153 | u16 req_line_speed = bp->link_params.req_line_speed[cfx_idx]; |
2154 | /* Initialize link parameters structure variables */ | 2154 | /* |
2155 | /* It is recommended to turn off RX FC for jumbo frames | 2155 | * Initialize link parameters structure variables |
2156 | for better performance */ | 2156 | * It is recommended to turn off RX FC for jumbo frames |
2157 | if ((CHIP_IS_E1x(bp)) && (bp->dev->mtu > 5000)) | 2157 | * for better performance |
2158 | */ | ||
2159 | if (CHIP_IS_E1x(bp) && (bp->dev->mtu > 5000)) | ||
2158 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_TX; | 2160 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_TX; |
2159 | else | 2161 | else |
2160 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH; | 2162 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH; |
@@ -2162,8 +2164,18 @@ u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) | |||
2162 | bnx2x_acquire_phy_lock(bp); | 2164 | bnx2x_acquire_phy_lock(bp); |
2163 | 2165 | ||
2164 | if (load_mode == LOAD_DIAG) { | 2166 | if (load_mode == LOAD_DIAG) { |
2165 | bp->link_params.loopback_mode = LOOPBACK_XGXS; | 2167 | struct link_params *lp = &bp->link_params; |
2166 | bp->link_params.req_line_speed[cfx_idx] = SPEED_10000; | 2168 | lp->loopback_mode = LOOPBACK_XGXS; |
2169 | /* do PHY loopback at 10G speed, if possible */ | ||
2170 | if (lp->req_line_speed[cfx_idx] < SPEED_10000) { | ||
2171 | if (lp->speed_cap_mask[cfx_idx] & | ||
2172 | PORT_HW_CFG_SPEED_CAPABILITY_D0_10G) | ||
2173 | lp->req_line_speed[cfx_idx] = | ||
2174 | SPEED_10000; | ||
2175 | else | ||
2176 | lp->req_line_speed[cfx_idx] = | ||
2177 | SPEED_1000; | ||
2178 | } | ||
2167 | } | 2179 | } |
2168 | 2180 | ||
2169 | rc = bnx2x_phy_init(&bp->link_params, &bp->link_vars); | 2181 | rc = bnx2x_phy_init(&bp->link_params, &bp->link_vars); |