bxe: we have an unload. It's called 'reboot'
authorRon Minnich <rminnich@gmail.com>
Sat, 17 Jan 2015 08:16:41 +0000 (00:16 -0800)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 3 Feb 2015 15:12:29 +0000 (10:12 -0500)
Signed-off-by: Ron Minnich <rminnich@gmail.com>
kern/drivers/net/bxe/bxe.c

index 5f4f415..4a21e69 100644 (file)
@@ -15979,75 +15979,6 @@ bxe_prev_unload_uncommon(struct bxe_adapter *sc)
     return (rc);
 }
 
-static int
-bxe_prev_unload(struct bxe_adapter *sc)
-{
-    int time_counter = 10;
-    uint32_t fw, hw_lock_reg, hw_lock_val;
-    uint32_t rc = 0;
-
-    /*
-     * Clear HW from errors which may have resulted from an interrupted
-     * DMAE transaction.
-     */
-    bxe_prev_interrupted_dmae(sc);
-
-    /* Release previously held locks */
-    hw_lock_reg =
-        (SC_FUNC(sc) <= 5) ?
-            (MISC_REG_DRIVER_CONTROL_1 + SC_FUNC(sc) * 8) :
-            (MISC_REG_DRIVER_CONTROL_7 + (SC_FUNC(sc) - 6) * 8);
-
-    hw_lock_val = (REG_RD(sc, hw_lock_reg));
-    if (hw_lock_val) {
-        if (hw_lock_val & HW_LOCK_RESOURCE_NVRAM) {
-            BLOGD(sc, DBG_LOAD, "Releasing previously held NVRAM lock\n");
-            REG_WR(sc, MCP_REG_MCPR_NVM_SW_ARB,
-                   (MCPR_NVM_SW_ARB_ARB_REQ_CLR1 << SC_PORT(sc)));
-        }
-        BLOGD(sc, DBG_LOAD, "Releasing previously held HW lock\n");
-        REG_WR(sc, hw_lock_reg, 0xffffffff);
-    } else {
-        BLOGD(sc, DBG_LOAD, "No need to release HW/NVRAM locks\n");
-    }
-
-    if (MCPR_ACCESS_LOCK_LOCK & REG_RD(sc, MCP_REG_MCPR_ACCESS_LOCK)) {
-        BLOGD(sc, DBG_LOAD, "Releasing previously held ALR\n");
-        REG_WR(sc, MCP_REG_MCPR_ACCESS_LOCK, 0);
-    }
-
-    do {
-        /* Lock MCP using an unload request */
-        fw = bxe_fw_command(sc, DRV_MSG_CODE_UNLOAD_REQ_WOL_DIS, 0);
-        if (!fw) {
-            BLOGE(sc, "MCP response failure, aborting\n");
-            rc = -1;
-            break;
-        }
-
-        if (fw == FW_MSG_CODE_DRV_UNLOAD_COMMON) {
-            rc = bxe_prev_unload_common(sc);
-            break;
-        }
-
-        /* non-common reply from MCP night require looping */
-        rc = bxe_prev_unload_uncommon(sc);
-#warning "bxe_prev_wait_needed?"
-       //        if (rc != BXE_PREV_WAIT_NEEDED) {
-       //            break;
-       //        }
-
-        udelay(20000);
-    } while (--time_counter);
-
-    if (!time_counter || rc) {
-        BLOGE(sc, "Failed to unload previous driver!\n");
-        rc = -1;
-    }
-
-    return (rc);
-}
-
 void
 bxe_dcbx_set_state(struct bxe_adapter *sc,
                    uint8_t          dcb_on,