Commit ae9540f7 authored by Joe Perches's avatar Joe Perches Committed by David S. Miller

drivers/net/qlge: Use netif_printk helpers

Convert QPRINTK macros to netif_<level> equivalents.
Expands and standardizes the logging message output.
Removes __func__ from most logging messages.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f8502ce4
...@@ -19,14 +19,6 @@ ...@@ -19,14 +19,6 @@
#define DRV_VERSION "v1.00.00.23.00.00-01" #define DRV_VERSION "v1.00.00.23.00.00-01"
#define PFX "qlge: " #define PFX "qlge: "
#define QPRINTK(qdev, nlevel, klevel, fmt, args...) \
do { \
if (!((qdev)->msg_enable & NETIF_MSG_##nlevel)) \
; \
else \
dev_printk(KERN_##klevel, &((qdev)->pdev->dev), \
"%s: " fmt, __func__, ##args); \
} while (0)
#define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */ #define WQ_ADDR_ALIGN 0x3 /* 4 byte alignment */
......
...@@ -443,8 +443,8 @@ static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf) ...@@ -443,8 +443,8 @@ static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf)
status = ql_get_mac_addr_reg(qdev, status = ql_get_mac_addr_reg(qdev,
MAC_ADDR_TYPE_CAM_MAC, i, value); MAC_ADDR_TYPE_CAM_MAC, i, value);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed read of mac index register.\n"); "Failed read of mac index register.\n");
goto err; goto err;
} }
*buf++ = value[0]; /* lower MAC address */ *buf++ = value[0]; /* lower MAC address */
...@@ -455,8 +455,8 @@ static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf) ...@@ -455,8 +455,8 @@ static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf)
status = ql_get_mac_addr_reg(qdev, status = ql_get_mac_addr_reg(qdev,
MAC_ADDR_TYPE_MULTI_MAC, i, value); MAC_ADDR_TYPE_MULTI_MAC, i, value);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed read of mac index register.\n"); "Failed read of mac index register.\n");
goto err; goto err;
} }
*buf++ = value[0]; /* lower Mcast address */ *buf++ = value[0]; /* lower Mcast address */
...@@ -479,8 +479,8 @@ static int ql_get_routing_entries(struct ql_adapter *qdev, u32 * buf) ...@@ -479,8 +479,8 @@ static int ql_get_routing_entries(struct ql_adapter *qdev, u32 * buf)
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
status = ql_get_routing_reg(qdev, i, &value); status = ql_get_routing_reg(qdev, i, &value);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed read of routing index register.\n"); "Failed read of routing index register.\n");
goto err; goto err;
} else { } else {
*buf++ = value; *buf++ = value;
...@@ -736,8 +736,7 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) ...@@ -736,8 +736,7 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
int i; int i;
if (!mpi_coredump) { if (!mpi_coredump) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev, "No memory available.\n");
"No memory available.\n");
return -ENOMEM; return -ENOMEM;
} }
...@@ -749,8 +748,8 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) ...@@ -749,8 +748,8 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
status = ql_pause_mpi_risc(qdev); status = ql_pause_mpi_risc(qdev);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed RISC pause. Status = 0x%.08x\n", status); "Failed RISC pause. Status = 0x%.08x\n", status);
goto err; goto err;
} }
...@@ -911,9 +910,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) ...@@ -911,9 +910,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
status = ql_get_serdes_regs(qdev, mpi_coredump); status = ql_get_serdes_regs(qdev, mpi_coredump);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed Dump of Serdes Registers. Status = 0x%.08x\n", "Failed Dump of Serdes Registers. Status = 0x%.08x\n",
status); status);
goto err; goto err;
} }
...@@ -1177,16 +1176,16 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) ...@@ -1177,16 +1176,16 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
/* clear the pause */ /* clear the pause */
status = ql_unpause_mpi_risc(qdev); status = ql_unpause_mpi_risc(qdev);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed RISC unpause. Status = 0x%.08x\n", status); "Failed RISC unpause. Status = 0x%.08x\n", status);
goto err; goto err;
} }
/* Reset the RISC so we can dump RAM */ /* Reset the RISC so we can dump RAM */
status = ql_hard_reset_mpi_risc(qdev); status = ql_hard_reset_mpi_risc(qdev);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed RISC reset. Status = 0x%.08x\n", status); "Failed RISC reset. Status = 0x%.08x\n", status);
goto err; goto err;
} }
...@@ -1198,8 +1197,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) ...@@ -1198,8 +1197,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], status = ql_dump_risc_ram_area(qdev, &mpi_coredump->code_ram[0],
CODE_RAM_ADDR, CODE_RAM_CNT); CODE_RAM_ADDR, CODE_RAM_CNT);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed Dump of CODE RAM. Status = 0x%.08x\n", status); "Failed Dump of CODE RAM. Status = 0x%.08x\n",
status);
goto err; goto err;
} }
...@@ -1212,8 +1212,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) ...@@ -1212,8 +1212,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], status = ql_dump_risc_ram_area(qdev, &mpi_coredump->memc_ram[0],
MEMC_RAM_ADDR, MEMC_RAM_CNT); MEMC_RAM_ADDR, MEMC_RAM_CNT);
if (status) { if (status) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Failed Dump of MEMC RAM. Status = 0x%.08x\n", status); "Failed Dump of MEMC RAM. Status = 0x%.08x\n",
status);
goto err; goto err;
} }
err: err:
...@@ -1225,21 +1226,19 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) ...@@ -1225,21 +1226,19 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
static void ql_get_core_dump(struct ql_adapter *qdev) static void ql_get_core_dump(struct ql_adapter *qdev)
{ {
if (!ql_own_firmware(qdev)) { if (!ql_own_firmware(qdev)) {
QPRINTK(qdev, DRV, ERR, "%s: Don't own firmware!\n", netif_err(qdev, drv, qdev->ndev, "Don't own firmware!\n");
qdev->ndev->name);
return; return;
} }
if (!netif_running(qdev->ndev)) { if (!netif_running(qdev->ndev)) {
QPRINTK(qdev, IFUP, ERR, netif_err(qdev, ifup, qdev->ndev,
"Force Coredump can only be done from interface " "Force Coredump can only be done from interface that is up.\n");
"that is up.\n");
return; return;
} }
if (ql_mb_sys_err(qdev)) { if (ql_mb_sys_err(qdev)) {
QPRINTK(qdev, IFUP, ERR, netif_err(qdev, ifup, qdev->ndev,
"Fail force coredump with ql_mb_sys_err().\n"); "Fail force coredump with ql_mb_sys_err().\n");
return; return;
} }
} }
...@@ -1334,7 +1333,8 @@ void ql_mpi_core_to_log(struct work_struct *work) ...@@ -1334,7 +1333,8 @@ void ql_mpi_core_to_log(struct work_struct *work)
count = sizeof(struct ql_mpi_coredump) / sizeof(u32); count = sizeof(struct ql_mpi_coredump) / sizeof(u32);
tmp = (u32 *)qdev->mpi_coredump; 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) { for (i = 0; i < count; i += 8) {
printk(KERN_ERR "%.08x: %.08x %.08x %.08x %.08x %.08x " printk(KERN_ERR "%.08x: %.08x %.08x %.08x %.08x %.08x "
......
...@@ -67,8 +67,8 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev) ...@@ -67,8 +67,8 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev)
status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb), status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb),
CFG_LCQ, rx_ring->cq_id); CFG_LCQ, rx_ring->cq_id);
if (status) { if (status) {
QPRINTK(qdev, IFUP, ERR, netif_err(qdev, ifup, qdev->ndev,
"Failed to load CQICB.\n"); "Failed to load CQICB.\n");
goto exit; goto exit;
} }
} }
...@@ -89,8 +89,8 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev) ...@@ -89,8 +89,8 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev)
status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb), status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb),
CFG_LCQ, rx_ring->cq_id); CFG_LCQ, rx_ring->cq_id);
if (status) { if (status) {
QPRINTK(qdev, IFUP, ERR, netif_err(qdev, ifup, qdev->ndev,
"Failed to load CQICB.\n"); "Failed to load CQICB.\n");
goto exit; goto exit;
} }
} }
...@@ -107,8 +107,8 @@ static void ql_update_stats(struct ql_adapter *qdev) ...@@ -107,8 +107,8 @@ static void ql_update_stats(struct ql_adapter *qdev)
spin_lock(&qdev->stats_lock); spin_lock(&qdev->stats_lock);
if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) { if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Couldn't get xgmac sem.\n"); "Couldn't get xgmac sem.\n");
goto quit; goto quit;
} }
/* /*
...@@ -116,8 +116,9 @@ static void ql_update_stats(struct ql_adapter *qdev) ...@@ -116,8 +116,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
*/ */
for (i = 0x200; i < 0x280; i += 8) { for (i = 0x200; i < 0x280; i += 8) {
if (ql_read_xgmac_reg64(qdev, i, &data)) { if (ql_read_xgmac_reg64(qdev, i, &data)) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n", i); "Error reading status register 0x%.04x.\n",
i);
goto end; goto end;
} else } else
*iter = data; *iter = data;
...@@ -129,8 +130,9 @@ static void ql_update_stats(struct ql_adapter *qdev) ...@@ -129,8 +130,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
*/ */
for (i = 0x300; i < 0x3d0; i += 8) { for (i = 0x300; i < 0x3d0; i += 8) {
if (ql_read_xgmac_reg64(qdev, i, &data)) { if (ql_read_xgmac_reg64(qdev, i, &data)) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n", i); "Error reading status register 0x%.04x.\n",
i);
goto end; goto end;
} else } else
*iter = data; *iter = data;
...@@ -142,8 +144,9 @@ static void ql_update_stats(struct ql_adapter *qdev) ...@@ -142,8 +144,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
*/ */
for (i = 0x500; i < 0x540; i += 8) { for (i = 0x500; i < 0x540; i += 8) {
if (ql_read_xgmac_reg64(qdev, i, &data)) { if (ql_read_xgmac_reg64(qdev, i, &data)) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n", i); "Error reading status register 0x%.04x.\n",
i);
goto end; goto end;
} else } else
*iter = data; *iter = data;
...@@ -155,8 +158,9 @@ static void ql_update_stats(struct ql_adapter *qdev) ...@@ -155,8 +158,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
*/ */
for (i = 0x568; i < 0x5a8; i += 8) { for (i = 0x568; i < 0x5a8; i += 8) {
if (ql_read_xgmac_reg64(qdev, i, &data)) { if (ql_read_xgmac_reg64(qdev, i, &data)) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n", i); "Error reading status register 0x%.04x.\n",
i);
goto end; goto end;
} else } else
*iter = data; *iter = data;
...@@ -167,8 +171,8 @@ static void ql_update_stats(struct ql_adapter *qdev) ...@@ -167,8 +171,8 @@ static void ql_update_stats(struct ql_adapter *qdev)
* Get RX NIC FIFO DROP statistics. * Get RX NIC FIFO DROP statistics.
*/ */
if (ql_read_xgmac_reg64(qdev, 0x5b8, &data)) { if (ql_read_xgmac_reg64(qdev, 0x5b8, &data)) {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n", i); "Error reading status register 0x%.04x.\n", i);
goto end; goto end;
} else } else
*iter = data; *iter = data;
...@@ -396,14 +400,13 @@ static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol) ...@@ -396,14 +400,13 @@ static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
return -EINVAL; return -EINVAL;
qdev->wol = wol->wolopts; qdev->wol = wol->wolopts;
QPRINTK(qdev, DRV, INFO, "Set wol option 0x%x on %s\n", netif_info(qdev, drv, qdev->ndev, "Set wol option 0x%x\n", qdev->wol);
qdev->wol, ndev->name);
if (!qdev->wol) { if (!qdev->wol) {
u32 wol = 0; u32 wol = 0;
status = ql_mb_wol_mode(qdev, wol); status = ql_mb_wol_mode(qdev, wol);
QPRINTK(qdev, DRV, ERR, "WOL %s (wol code 0x%x) on %s\n", netif_err(qdev, drv, qdev->ndev, "WOL %s (wol code 0x%x)\n",
(status == 0) ? "cleared sucessfully" : "clear failed", status == 0 ? "cleared sucessfully" : "clear failed",
wol, qdev->ndev->name); wol);
} }
return 0; return 0;
...@@ -534,8 +537,8 @@ static void ql_self_test(struct net_device *ndev, ...@@ -534,8 +537,8 @@ static void ql_self_test(struct net_device *ndev,
} }
clear_bit(QL_SELFTEST, &qdev->flags); clear_bit(QL_SELFTEST, &qdev->flags);
} else { } else {
QPRINTK(qdev, DRV, ERR, netif_err(qdev, drv, qdev->ndev,
"%s: is down, Loopback test will fail.\n", ndev->name); "is down, Loopback test will fail.\n");
eth_test->flags |= ETH_TEST_FL_FAILED; eth_test->flags |= ETH_TEST_FL_FAILED;
} }
} }
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment