aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c')
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index e11485ca037..f7ed122f407 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -2166,7 +2166,6 @@ void bnx2x_link_set(struct bnx2x *bp)
2166{ 2166{
2167 if (!BP_NOMCP(bp)) { 2167 if (!BP_NOMCP(bp)) {
2168 bnx2x_acquire_phy_lock(bp); 2168 bnx2x_acquire_phy_lock(bp);
2169 bnx2x_link_reset(&bp->link_params, &bp->link_vars, 1);
2170 bnx2x_phy_init(&bp->link_params, &bp->link_vars); 2169 bnx2x_phy_init(&bp->link_params, &bp->link_vars);
2171 bnx2x_release_phy_lock(bp); 2170 bnx2x_release_phy_lock(bp);
2172 2171
@@ -2179,12 +2178,19 @@ static void bnx2x__link_reset(struct bnx2x *bp)
2179{ 2178{
2180 if (!BP_NOMCP(bp)) { 2179 if (!BP_NOMCP(bp)) {
2181 bnx2x_acquire_phy_lock(bp); 2180 bnx2x_acquire_phy_lock(bp);
2182 bnx2x_link_reset(&bp->link_params, &bp->link_vars, 1); 2181 bnx2x_lfa_reset(&bp->link_params, &bp->link_vars);
2183 bnx2x_release_phy_lock(bp); 2182 bnx2x_release_phy_lock(bp);
2184 } else 2183 } else
2185 BNX2X_ERR("Bootcode is missing - can not reset link\n"); 2184 BNX2X_ERR("Bootcode is missing - can not reset link\n");
2186} 2185}
2187 2186
2187void bnx2x_force_link_reset(struct bnx2x *bp)
2188{
2189 bnx2x_acquire_phy_lock(bp);
2190 bnx2x_link_reset(&bp->link_params, &bp->link_vars, 1);
2191 bnx2x_release_phy_lock(bp);
2192}
2193
2188u8 bnx2x_link_test(struct bnx2x *bp, u8 is_serdes) 2194u8 bnx2x_link_test(struct bnx2x *bp, u8 is_serdes)
2189{ 2195{
2190 u8 rc = 0; 2196 u8 rc = 0;
@@ -6751,7 +6757,6 @@ static int bnx2x_init_hw_port(struct bnx2x *bp)
6751 u32 low, high; 6757 u32 low, high;
6752 u32 val; 6758 u32 val;
6753 6759
6754 bnx2x__link_reset(bp);
6755 6760
6756 DP(NETIF_MSG_HW, "starting port init port %d\n", port); 6761 DP(NETIF_MSG_HW, "starting port init port %d\n", port);
6757 6762
@@ -8244,12 +8249,15 @@ u32 bnx2x_send_unload_req(struct bnx2x *bp, int unload_mode)
8244 * bnx2x_send_unload_done - send UNLOAD_DONE command to the MCP. 8249 * bnx2x_send_unload_done - send UNLOAD_DONE command to the MCP.
8245 * 8250 *
8246 * @bp: driver handle 8251 * @bp: driver handle
8252 * @keep_link: true iff link should be kept up
8247 */ 8253 */
8248void bnx2x_send_unload_done(struct bnx2x *bp) 8254void bnx2x_send_unload_done(struct bnx2x *bp, bool keep_link)
8249{ 8255{
8256 u32 reset_param = keep_link ? DRV_MSG_CODE_UNLOAD_SKIP_LINK_RESET : 0;
8257
8250 /* Report UNLOAD_DONE to MCP */ 8258 /* Report UNLOAD_DONE to MCP */
8251 if (!BP_NOMCP(bp)) 8259 if (!BP_NOMCP(bp))
8252 bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0); 8260 bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, reset_param);
8253} 8261}
8254 8262
8255static int bnx2x_func_wait_started(struct bnx2x *bp) 8263static int bnx2x_func_wait_started(struct bnx2x *bp)
@@ -8318,7 +8326,7 @@ static int bnx2x_func_wait_started(struct bnx2x *bp)
8318 return 0; 8326 return 0;
8319} 8327}
8320 8328
8321void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode) 8329void bnx2x_chip_cleanup(struct bnx2x *bp, int unload_mode, bool keep_link)
8322{ 8330{
8323 int port = BP_PORT(bp); 8331 int port = BP_PORT(bp);
8324 int i, rc = 0; 8332 int i, rc = 0;
@@ -8440,7 +8448,7 @@ unload_error:
8440 8448
8441 8449
8442 /* Report UNLOAD_DONE to MCP */ 8450 /* Report UNLOAD_DONE to MCP */
8443 bnx2x_send_unload_done(bp); 8451 bnx2x_send_unload_done(bp, keep_link);
8444} 8452}
8445 8453
8446void bnx2x_disable_close_the_gate(struct bnx2x *bp) 8454void bnx2x_disable_close_the_gate(struct bnx2x *bp)
@@ -8852,7 +8860,8 @@ int bnx2x_leader_reset(struct bnx2x *bp)
8852 * driver is owner of the HW 8860 * driver is owner of the HW
8853 */ 8861 */
8854 if (!global && !BP_NOMCP(bp)) { 8862 if (!global && !BP_NOMCP(bp)) {
8855 load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ, 0); 8863 load_code = bnx2x_fw_command(bp, DRV_MSG_CODE_LOAD_REQ,
8864 DRV_MSG_CODE_LOAD_REQ_WITH_LFA);
8856 if (!load_code) { 8865 if (!load_code) {
8857 BNX2X_ERR("MCP response failure, aborting\n"); 8866 BNX2X_ERR("MCP response failure, aborting\n");
8858 rc = -EAGAIN; 8867 rc = -EAGAIN;
@@ -8958,7 +8967,7 @@ static void bnx2x_parity_recover(struct bnx2x *bp)
8958 8967
8959 /* Stop the driver */ 8968 /* Stop the driver */
8960 /* If interface has been removed - break */ 8969 /* If interface has been removed - break */
8961 if (bnx2x_nic_unload(bp, UNLOAD_RECOVERY)) 8970 if (bnx2x_nic_unload(bp, UNLOAD_RECOVERY, false))
8962 return; 8971 return;
8963 8972
8964 bp->recovery_state = BNX2X_RECOVERY_WAIT; 8973 bp->recovery_state = BNX2X_RECOVERY_WAIT;
@@ -9124,7 +9133,7 @@ static void bnx2x_sp_rtnl_task(struct work_struct *work)
9124 bp->sp_rtnl_state = 0; 9133 bp->sp_rtnl_state = 0;
9125 smp_mb(); 9134 smp_mb();
9126 9135
9127 bnx2x_nic_unload(bp, UNLOAD_NORMAL); 9136 bnx2x_nic_unload(bp, UNLOAD_NORMAL, true);
9128 bnx2x_nic_load(bp, LOAD_NORMAL); 9137 bnx2x_nic_load(bp, LOAD_NORMAL);
9129 9138
9130 goto sp_rtnl_exit; 9139 goto sp_rtnl_exit;
@@ -9310,7 +9319,8 @@ static void __devinit bnx2x_prev_unload_undi_inc(struct bnx2x *bp, u8 port,
9310 9319
9311static int __devinit bnx2x_prev_mcp_done(struct bnx2x *bp) 9320static int __devinit bnx2x_prev_mcp_done(struct bnx2x *bp)
9312{ 9321{
9313 u32 rc = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE, 0); 9322 u32 rc = bnx2x_fw_command(bp, DRV_MSG_CODE_UNLOAD_DONE,
9323 DRV_MSG_CODE_UNLOAD_SKIP_LINK_RESET);
9314 if (!rc) { 9324 if (!rc) {
9315 BNX2X_ERR("MCP response failure, aborting\n"); 9325 BNX2X_ERR("MCP response failure, aborting\n");
9316 return -EBUSY; 9326 return -EBUSY;
@@ -11000,7 +11010,7 @@ static int bnx2x_close(struct net_device *dev)
11000 struct bnx2x *bp = netdev_priv(dev); 11010 struct bnx2x *bp = netdev_priv(dev);
11001 11011
11002 /* Unload the driver, release IRQs */ 11012 /* Unload the driver, release IRQs */
11003 bnx2x_nic_unload(bp, UNLOAD_CLOSE); 11013 bnx2x_nic_unload(bp, UNLOAD_CLOSE, false);
11004 11014
11005 /* Power off */ 11015 /* Power off */
11006 bnx2x_set_power_state(bp, PCI_D3hot); 11016 bnx2x_set_power_state(bp, PCI_D3hot);