qlge: Restore promiscuous setting after reset.
[linux-2.6.git] / drivers / net / qlge / qlge_dbg.c
index 57df835..68a1c9b 100644 (file)
@@ -1,3 +1,5 @@
+#include <linux/slab.h>
+
 #include "qlge.h"
 
 /* Read a NIC register from the alternate function. */
@@ -443,8 +445,8 @@ static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf)
                status = ql_get_mac_addr_reg(qdev,
                                        MAC_ADDR_TYPE_CAM_MAC, i, value);
                if (status) {
-                       QPRINTK(qdev, DRV, ERR,
-                               "Failed read of mac index register.\n");
+                       netif_err(qdev, drv, qdev->ndev,
+                                 "Failed read of mac index register.\n");
                        goto err;
                }
                *buf++ = value[0];      /* lower MAC address */
@@ -455,8 +457,8 @@ static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf)
                status = ql_get_mac_addr_reg(qdev,
                                        MAC_ADDR_TYPE_MULTI_MAC, i, value);
                if (status) {
-                       QPRINTK(qdev, DRV, ERR,
-                               "Failed read of mac index register.\n");
+                       netif_err(qdev, drv, qdev->ndev,
+                                 "Failed read of mac index register.\n");
                        goto err;
                }
                *buf++ = value[0];      /* lower Mcast address */
@@ -479,8 +481,8 @@ static int ql_get_routing_entries(struct ql_adapter *qdev, u32 * buf)
        for (i = 0; i < 16; i++) {
                status = ql_get_routing_reg(qdev, i, &value);
                if (status) {
-                       QPRINTK(qdev, DRV, ERR,
-                               "Failed read of routing index register.\n");
+                       netif_err(qdev, drv, qdev->ndev,
+                                 "Failed read of routing index register.\n");
                        goto err;
                } else {
                        *buf++ = value;
@@ -736,8 +738,7 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
        int i;
 
        if (!mpi_coredump) {
-               QPRINTK(qdev, DRV, ERR,
-                       "No memory available.\n");
+               netif_err(qdev, drv, qdev->ndev, "No memory available.\n");
                return -ENOMEM;
        }
 
@@ -749,8 +750,8 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
 
        status = ql_pause_mpi_risc(qdev);
        if (status) {
-               QPRINTK(qdev, DRV, ERR,
-                       "Failed RISC pause. Status = 0x%.08x\n", status);
+               netif_err(qdev, drv, qdev->ndev,
+                         "Failed RISC pause. Status = 0x%.08x\n", status);
                goto err;
        }
 
@@ -911,9 +912,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
 
        status = ql_get_serdes_regs(qdev, mpi_coredump);
        if (status) {
-               QPRINTK(qdev, DRV, ERR,
-                       "Failed Dump of Serdes Registers. Status = 0x%.08x\n",
-                       status);
+               netif_err(qdev, drv, qdev->ndev,
+                         "Failed Dump of Serdes Registers. Status = 0x%.08x\n",
+                         status);
                goto err;
        }
 
@@ -1177,16 +1178,16 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
        /* clear the pause */
        status = ql_unpause_mpi_risc(qdev);
        if (status) {
-               QPRINTK(qdev, DRV, ERR,
-                       "Failed RISC unpause. Status = 0x%.08x\n", status);
+               netif_err(qdev, drv, qdev->ndev,
+                         "Failed RISC unpause. Status = 0x%.08x\n", status);
                goto err;
        }
 
        /* Reset the RISC so we can dump RAM */
        status = ql_hard_reset_mpi_risc(qdev);
        if (status) {
-               QPRINTK(qdev, DRV, ERR,
-                       "Failed RISC reset. Status = 0x%.08x\n", status);
+               netif_err(qdev, drv, qdev->ndev,
+                         "Failed RISC reset. Status = 0x%.08x\n", status);
                goto err;
        }
 
@@ -1198,8 +1199,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
        status = ql_dump_risc_ram_area(qdev, &mpi_coredump->code_ram[0],
                                        CODE_RAM_ADDR, CODE_RAM_CNT);
        if (status) {
-               QPRINTK(qdev, DRV, ERR,
-                       "Failed Dump of CODE RAM. Status = 0x%.08x\n", status);
+               netif_err(qdev, drv, qdev->ndev,
+                         "Failed Dump of CODE RAM. Status = 0x%.08x\n",
+                         status);
                goto err;
        }
 
@@ -1212,8 +1214,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
        status = ql_dump_risc_ram_area(qdev, &mpi_coredump->memc_ram[0],
                                        MEMC_RAM_ADDR, MEMC_RAM_CNT);
        if (status) {
-               QPRINTK(qdev, DRV, ERR,
-                       "Failed Dump of MEMC RAM. Status = 0x%.08x\n", status);
+               netif_err(qdev, drv, qdev->ndev,
+                         "Failed Dump of MEMC RAM. Status = 0x%.08x\n",
+                         status);
                goto err;
        }
 err:
@@ -1225,21 +1228,19 @@ err:
 static void ql_get_core_dump(struct ql_adapter *qdev)
 {
        if (!ql_own_firmware(qdev)) {
-               QPRINTK(qdev, DRV, ERR, "%s: Don't own firmware!\n",
-                                       qdev->ndev->name);
+               netif_err(qdev, drv, qdev->ndev, "Don't own firmware!\n");
                return;
        }
 
        if (!netif_running(qdev->ndev)) {
-               QPRINTK(qdev, IFUP, ERR,
-                       "Force Coredump can only be done from interface "
-                       "that is up.\n");
+               netif_err(qdev, ifup, qdev->ndev,
+                         "Force Coredump can only be done from interface that is up.\n");
                return;
        }
 
        if (ql_mb_sys_err(qdev)) {
-               QPRINTK(qdev, IFUP, ERR,
-                       "Fail force coredump with ql_mb_sys_err().\n");
+               netif_err(qdev, ifup, qdev->ndev,
+                         "Fail force coredump with ql_mb_sys_err().\n");
                return;
        }
 }
@@ -1334,11 +1335,12 @@ void ql_mpi_core_to_log(struct work_struct *work)
 
        count = sizeof(struct ql_mpi_coredump) / sizeof(u32);
        tmp = (u32 *)qdev->mpi_coredump;
-       QPRINTK(qdev, DRV, DEBUG, "Core is dumping to log file!\n");
+       netif_printk(qdev, drv, KERN_DEBUG, qdev->ndev,
+                    "Core is dumping to log file!\n");
 
        for (i = 0; i < count; i += 8) {
                printk(KERN_ERR "%.08x: %.08x %.08x %.08x %.08x %.08x "
-                       "%.08x %.08x %.08x \n", i,
+                       "%.08x %.08x %.08x\n", i,
                        tmp[i + 0],
                        tmp[i + 1],
                        tmp[i + 2],
@@ -2056,7 +2058,7 @@ void ql_dump_ob_mac_iocb(struct ob_mac_iocb_req *ob_mac_iocb)
               ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_LSO ? "LSO" : "",
               ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_UC ? "UC" : "",
               ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_TC ? "TC" : "");
-       printk(KERN_ERR PFX "flags3          = %s %s %s \n",
+       printk(KERN_ERR PFX "flags3          = %s %s %s\n",
               ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_IC ? "IC" : "",
               ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_DFP ? "DFP" : "",
               ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_V ? "V" : "");