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 @@
#define DRV_VERSION "v1.00.00.23.00.00-01"
#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 */
......
......@@ -443,8 +443,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 +455,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 +479,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 +736,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 +748,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 +910,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 +1176,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 +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],
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 +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],
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 +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)
{
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,7 +1333,8 @@ 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 "
......
......@@ -67,8 +67,8 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev)
status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb),
CFG_LCQ, rx_ring->cq_id);
if (status) {
QPRINTK(qdev, IFUP, ERR,
"Failed to load CQICB.\n");
netif_err(qdev, ifup, qdev->ndev,
"Failed to load CQICB.\n");
goto exit;
}
}
......@@ -89,8 +89,8 @@ static int ql_update_ring_coalescing(struct ql_adapter *qdev)
status = ql_write_cfg(qdev, cqicb, sizeof(*cqicb),
CFG_LCQ, rx_ring->cq_id);
if (status) {
QPRINTK(qdev, IFUP, ERR,
"Failed to load CQICB.\n");
netif_err(qdev, ifup, qdev->ndev,
"Failed to load CQICB.\n");
goto exit;
}
}
......@@ -107,8 +107,8 @@ static void ql_update_stats(struct ql_adapter *qdev)
spin_lock(&qdev->stats_lock);
if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) {
QPRINTK(qdev, DRV, ERR,
"Couldn't get xgmac sem.\n");
netif_err(qdev, drv, qdev->ndev,
"Couldn't get xgmac sem.\n");
goto quit;
}
/*
......@@ -116,8 +116,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
*/
for (i = 0x200; i < 0x280; i += 8) {
if (ql_read_xgmac_reg64(qdev, i, &data)) {
QPRINTK(qdev, DRV, ERR,
"Error reading status register 0x%.04x.\n", i);
netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n",
i);
goto end;
} else
*iter = data;
......@@ -129,8 +130,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
*/
for (i = 0x300; i < 0x3d0; i += 8) {
if (ql_read_xgmac_reg64(qdev, i, &data)) {
QPRINTK(qdev, DRV, ERR,
"Error reading status register 0x%.04x.\n", i);
netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n",
i);
goto end;
} else
*iter = data;
......@@ -142,8 +144,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
*/
for (i = 0x500; i < 0x540; i += 8) {
if (ql_read_xgmac_reg64(qdev, i, &data)) {
QPRINTK(qdev, DRV, ERR,
"Error reading status register 0x%.04x.\n", i);
netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n",
i);
goto end;
} else
*iter = data;
......@@ -155,8 +158,9 @@ static void ql_update_stats(struct ql_adapter *qdev)
*/
for (i = 0x568; i < 0x5a8; i += 8) {
if (ql_read_xgmac_reg64(qdev, i, &data)) {
QPRINTK(qdev, DRV, ERR,
"Error reading status register 0x%.04x.\n", i);
netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n",
i);
goto end;
} else
*iter = data;
......@@ -167,8 +171,8 @@ static void ql_update_stats(struct ql_adapter *qdev)
* Get RX NIC FIFO DROP statistics.
*/
if (ql_read_xgmac_reg64(qdev, 0x5b8, &data)) {
QPRINTK(qdev, DRV, ERR,
"Error reading status register 0x%.04x.\n", i);
netif_err(qdev, drv, qdev->ndev,
"Error reading status register 0x%.04x.\n", i);
goto end;
} else
*iter = data;
......@@ -396,14 +400,13 @@ static int ql_set_wol(struct net_device *ndev, struct ethtool_wolinfo *wol)
return -EINVAL;
qdev->wol = wol->wolopts;
QPRINTK(qdev, DRV, INFO, "Set wol option 0x%x on %s\n",
qdev->wol, ndev->name);
netif_info(qdev, drv, qdev->ndev, "Set wol option 0x%x\n", qdev->wol);
if (!qdev->wol) {
u32 wol = 0;
status = ql_mb_wol_mode(qdev, wol);
QPRINTK(qdev, DRV, ERR, "WOL %s (wol code 0x%x) on %s\n",
(status == 0) ? "cleared sucessfully" : "clear failed",
wol, qdev->ndev->name);
netif_err(qdev, drv, qdev->ndev, "WOL %s (wol code 0x%x)\n",
status == 0 ? "cleared sucessfully" : "clear failed",
wol);
}
return 0;
......@@ -534,8 +537,8 @@ static void ql_self_test(struct net_device *ndev,
}
clear_bit(QL_SELFTEST, &qdev->flags);
} else {
QPRINTK(qdev, DRV, ERR,
"%s: is down, Loopback test will fail.\n", ndev->name);
netif_err(qdev, drv, qdev->ndev,
"is down, Loopback test will fail.\n");
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