diff options
author | Yuval Mintz <yuvalmin@broadcom.com> | 2012-12-01 23:05:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-02 20:23:00 -0500 |
commit | cd1dfce2ed571bc3d1962987b5c7d2d6e936bb27 (patch) | |
tree | 6cd9adf4bb0a7035652f9dc360da95c27f84afe2 /drivers/net/ethernet | |
parent | 0370cf901dd923ce784efe486c8ba66babad693b (diff) |
bnx2x: fix 'Ethtool -A' when autoneg
When configuring pauses using 'ethtool -A', the requested values have
effect when used together with autoneg (up to this point, when configured
for autoneg, driver ignored requested pause configuration)
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>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 49 |
2 files changed, 28 insertions, 23 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h index ad280740b134..32c3ab72718c 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h | |||
@@ -144,7 +144,7 @@ u32 bnx2x_fw_command(struct bnx2x *bp, u32 command, u32 param); | |||
144 | * @bp: driver handle | 144 | * @bp: driver handle |
145 | * @load_mode: current mode | 145 | * @load_mode: current mode |
146 | */ | 146 | */ |
147 | u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode); | 147 | int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode); |
148 | 148 | ||
149 | /** | 149 | /** |
150 | * bnx2x_link_set - configure hw according to link parameters structure. | 150 | * bnx2x_link_set - configure hw according to link parameters structure. |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index ab65f34bb541..c8ec3fcd2d35 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -2103,22 +2103,25 @@ void bnx2x_calc_fc_adv(struct bnx2x *bp) | |||
2103 | } | 2103 | } |
2104 | } | 2104 | } |
2105 | 2105 | ||
2106 | u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) | 2106 | static void bnx2x_set_requested_fc(struct bnx2x *bp) |
2107 | { | 2107 | { |
2108 | if (!BP_NOMCP(bp)) { | 2108 | /* Initialize link parameters structure variables |
2109 | u8 rc; | 2109 | * It is recommended to turn off RX FC for jumbo frames |
2110 | int cfx_idx = bnx2x_get_link_cfg_idx(bp); | 2110 | * for better performance |
2111 | u16 req_line_speed = bp->link_params.req_line_speed[cfx_idx]; | 2111 | */ |
2112 | /* | 2112 | if (CHIP_IS_E1x(bp) && (bp->dev->mtu > 5000)) |
2113 | * Initialize link parameters structure variables | 2113 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_TX; |
2114 | * It is recommended to turn off RX FC for jumbo frames | 2114 | else |
2115 | * for better performance | 2115 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH; |
2116 | */ | 2116 | } |
2117 | if (CHIP_IS_E1x(bp) && (bp->dev->mtu > 5000)) | ||
2118 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_TX; | ||
2119 | else | ||
2120 | bp->link_params.req_fc_auto_adv = BNX2X_FLOW_CTRL_BOTH; | ||
2121 | 2117 | ||
2118 | int bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) | ||
2119 | { | ||
2120 | int rc, cfx_idx = bnx2x_get_link_cfg_idx(bp); | ||
2121 | u16 req_line_speed = bp->link_params.req_line_speed[cfx_idx]; | ||
2122 | |||
2123 | if (!BP_NOMCP(bp)) { | ||
2124 | bnx2x_set_requested_fc(bp); | ||
2122 | bnx2x_acquire_phy_lock(bp); | 2125 | bnx2x_acquire_phy_lock(bp); |
2123 | 2126 | ||
2124 | if (load_mode == LOAD_DIAG) { | 2127 | if (load_mode == LOAD_DIAG) { |
@@ -2147,11 +2150,11 @@ u8 bnx2x_initial_phy_init(struct bnx2x *bp, int load_mode) | |||
2147 | 2150 | ||
2148 | bnx2x_calc_fc_adv(bp); | 2151 | bnx2x_calc_fc_adv(bp); |
2149 | 2152 | ||
2150 | if (CHIP_REV_IS_SLOW(bp) && bp->link_vars.link_up) { | 2153 | if (bp->link_vars.link_up) { |
2151 | bnx2x_stats_handle(bp, STATS_EVENT_LINK_UP); | 2154 | bnx2x_stats_handle(bp, STATS_EVENT_LINK_UP); |
2152 | bnx2x_link_report(bp); | 2155 | bnx2x_link_report(bp); |
2153 | } else | 2156 | } |
2154 | queue_delayed_work(bnx2x_wq, &bp->period_task, 0); | 2157 | queue_delayed_work(bnx2x_wq, &bp->period_task, 0); |
2155 | bp->link_params.req_line_speed[cfx_idx] = req_line_speed; | 2158 | bp->link_params.req_line_speed[cfx_idx] = req_line_speed; |
2156 | return rc; | 2159 | return rc; |
2157 | } | 2160 | } |
@@ -10315,11 +10318,13 @@ static void __devinit bnx2x_link_settings_requested(struct bnx2x *bp) | |||
10315 | 10318 | ||
10316 | bp->link_params.req_flow_ctrl[idx] = (link_config & | 10319 | bp->link_params.req_flow_ctrl[idx] = (link_config & |
10317 | PORT_FEATURE_FLOW_CONTROL_MASK); | 10320 | PORT_FEATURE_FLOW_CONTROL_MASK); |
10318 | if ((bp->link_params.req_flow_ctrl[idx] == | 10321 | if (bp->link_params.req_flow_ctrl[idx] == |
10319 | BNX2X_FLOW_CTRL_AUTO) && | 10322 | BNX2X_FLOW_CTRL_AUTO) { |
10320 | !(bp->port.supported[idx] & SUPPORTED_Autoneg)) { | 10323 | if (!(bp->port.supported[idx] & SUPPORTED_Autoneg)) |
10321 | bp->link_params.req_flow_ctrl[idx] = | 10324 | bp->link_params.req_flow_ctrl[idx] = |
10322 | BNX2X_FLOW_CTRL_NONE; | 10325 | BNX2X_FLOW_CTRL_NONE; |
10326 | else | ||
10327 | bnx2x_set_requested_fc(bp); | ||
10323 | } | 10328 | } |
10324 | 10329 | ||
10325 | BNX2X_DEV_INFO("req_line_speed %d req_duplex %d req_flow_ctrl 0x%x advertising 0x%x\n", | 10330 | BNX2X_DEV_INFO("req_line_speed %d req_duplex %d req_flow_ctrl 0x%x advertising 0x%x\n", |