aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge/qlge_dbg.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-07-21 17:44:18 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-21 17:44:18 -0400
commit2037d5aa2551267184284188efdec4742f7218fa (patch)
treeb2ba1e244cbd3e37bb0b9d2b53b6de42728c39ab /drivers/net/qlge/qlge_dbg.c
parentf25c80a4b2bf93c99820f470573626557db35202 (diff)
drivers/net/qlge: Use pr_<level>, shrink text a bit
Add and use a few neatening macros Remove PFX Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt Convert printk(KERN_ERR to pr_err( $ size drivers/net/qlge/built-in.o.* text data bss dec hex filename 116456 2312 25712 144480 23460 drivers/net/qlge/built-in.o.old 114909 2312 25728 142949 22e65 drivers/net/qlge/built-in.o.new Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_dbg.c')
-rw-r--r--drivers/net/qlge/qlge_dbg.c807
1 files changed, 318 insertions, 489 deletions
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c
index 548e9010b20b..4747492935ef 100644
--- a/drivers/net/qlge/qlge_dbg.c
+++ b/drivers/net/qlge/qlge_dbg.c
@@ -1,3 +1,5 @@
1#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2
1#include <linux/slab.h> 3#include <linux/slab.h>
2 4
3#include "qlge.h" 5#include "qlge.h"
@@ -446,7 +448,7 @@ static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf)
446 MAC_ADDR_TYPE_CAM_MAC, i, value); 448 MAC_ADDR_TYPE_CAM_MAC, i, value);
447 if (status) { 449 if (status) {
448 netif_err(qdev, drv, qdev->ndev, 450 netif_err(qdev, drv, qdev->ndev,
449 "Failed read of mac index register.\n"); 451 "Failed read of mac index register\n");
450 goto err; 452 goto err;
451 } 453 }
452 *buf++ = value[0]; /* lower MAC address */ 454 *buf++ = value[0]; /* lower MAC address */
@@ -458,7 +460,7 @@ static int ql_get_cam_entries(struct ql_adapter *qdev, u32 * buf)
458 MAC_ADDR_TYPE_MULTI_MAC, i, value); 460 MAC_ADDR_TYPE_MULTI_MAC, i, value);
459 if (status) { 461 if (status) {
460 netif_err(qdev, drv, qdev->ndev, 462 netif_err(qdev, drv, qdev->ndev,
461 "Failed read of mac index register.\n"); 463 "Failed read of mac index register\n");
462 goto err; 464 goto err;
463 } 465 }
464 *buf++ = value[0]; /* lower Mcast address */ 466 *buf++ = value[0]; /* lower Mcast address */
@@ -482,7 +484,7 @@ static int ql_get_routing_entries(struct ql_adapter *qdev, u32 * buf)
482 status = ql_get_routing_reg(qdev, i, &value); 484 status = ql_get_routing_reg(qdev, i, &value);
483 if (status) { 485 if (status) {
484 netif_err(qdev, drv, qdev->ndev, 486 netif_err(qdev, drv, qdev->ndev,
485 "Failed read of routing index register.\n"); 487 "Failed read of routing index register\n");
486 goto err; 488 goto err;
487 } else { 489 } else {
488 *buf++ = value; 490 *buf++ = value;
@@ -668,7 +670,7 @@ static void ql_get_mac_protocol_registers(struct ql_adapter *qdev, u32 *buf)
668 max_offset = MAC_ADDR_MAX_MGMT_TU_DP_WCOUNT; 670 max_offset = MAC_ADDR_MAX_MGMT_TU_DP_WCOUNT;
669 break; 671 break;
670 default: 672 default:
671 printk(KERN_ERR"Bad type!!! 0x%08x\n", type); 673 pr_err("Bad type!!! 0x%08x\n", type);
672 max_index = 0; 674 max_index = 0;
673 max_offset = 0; 675 max_offset = 0;
674 break; 676 break;
@@ -738,7 +740,7 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
738 int i; 740 int i;
739 741
740 if (!mpi_coredump) { 742 if (!mpi_coredump) {
741 netif_err(qdev, drv, qdev->ndev, "No memory available.\n"); 743 netif_err(qdev, drv, qdev->ndev, "No memory available\n");
742 return -ENOMEM; 744 return -ENOMEM;
743 } 745 }
744 746
@@ -1234,7 +1236,7 @@ static void ql_get_core_dump(struct ql_adapter *qdev)
1234 1236
1235 if (!netif_running(qdev->ndev)) { 1237 if (!netif_running(qdev->ndev)) {
1236 netif_err(qdev, ifup, qdev->ndev, 1238 netif_err(qdev, ifup, qdev->ndev,
1237 "Force Coredump can only be done from interface that is up.\n"); 1239 "Force Coredump can only be done from interface that is up\n");
1238 return; 1240 return;
1239 } 1241 }
1240 ql_queue_fw_error(qdev); 1242 ql_queue_fw_error(qdev);
@@ -1334,7 +1336,7 @@ void ql_mpi_core_to_log(struct work_struct *work)
1334 "Core is dumping to log file!\n"); 1336 "Core is dumping to log file!\n");
1335 1337
1336 for (i = 0; i < count; i += 8) { 1338 for (i = 0; i < count; i += 8) {
1337 printk(KERN_ERR "%.08x: %.08x %.08x %.08x %.08x %.08x " 1339 pr_err("%.08x: %.08x %.08x %.08x %.08x %.08x "
1338 "%.08x %.08x %.08x\n", i, 1340 "%.08x %.08x %.08x\n", i,
1339 tmp[i + 0], 1341 tmp[i + 0],
1340 tmp[i + 1], 1342 tmp[i + 1],
@@ -1356,71 +1358,43 @@ static void ql_dump_intr_states(struct ql_adapter *qdev)
1356 for (i = 0; i < qdev->intr_count; i++) { 1358 for (i = 0; i < qdev->intr_count; i++) {
1357 ql_write32(qdev, INTR_EN, qdev->intr_context[i].intr_read_mask); 1359 ql_write32(qdev, INTR_EN, qdev->intr_context[i].intr_read_mask);
1358 value = ql_read32(qdev, INTR_EN); 1360 value = ql_read32(qdev, INTR_EN);
1359 printk(KERN_ERR PFX 1361 pr_err("%s: Interrupt %d is %s\n",
1360 "%s: Interrupt %d is %s.\n",
1361 qdev->ndev->name, i, 1362 qdev->ndev->name, i,
1362 (value & INTR_EN_EN ? "enabled" : "disabled")); 1363 (value & INTR_EN_EN ? "enabled" : "disabled"));
1363 } 1364 }
1364} 1365}
1365 1366
1367#define DUMP_XGMAC(qdev, reg) \
1368do { \
1369 u32 data; \
1370 ql_read_xgmac_reg(qdev, reg, &data); \
1371 pr_err("%s: %s = 0x%.08x\n", qdev->ndev->name, #reg, data); \
1372} while (0)
1373
1366void ql_dump_xgmac_control_regs(struct ql_adapter *qdev) 1374void ql_dump_xgmac_control_regs(struct ql_adapter *qdev)
1367{ 1375{
1368 u32 data;
1369 if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) { 1376 if (ql_sem_spinlock(qdev, qdev->xg_sem_mask)) {
1370 printk(KERN_ERR "%s: Couldn't get xgmac sem.\n", __func__); 1377 pr_err("%s: Couldn't get xgmac sem\n", __func__);
1371 return; 1378 return;
1372 } 1379 }
1373 ql_read_xgmac_reg(qdev, PAUSE_SRC_LO, &data); 1380 DUMP_XGMAC(qdev, PAUSE_SRC_LO);
1374 printk(KERN_ERR PFX "%s: PAUSE_SRC_LO = 0x%.08x.\n", qdev->ndev->name, 1381 DUMP_XGMAC(qdev, PAUSE_SRC_HI);
1375 data); 1382 DUMP_XGMAC(qdev, GLOBAL_CFG);
1376 ql_read_xgmac_reg(qdev, PAUSE_SRC_HI, &data); 1383 DUMP_XGMAC(qdev, TX_CFG);
1377 printk(KERN_ERR PFX "%s: PAUSE_SRC_HI = 0x%.08x.\n", qdev->ndev->name, 1384 DUMP_XGMAC(qdev, RX_CFG);
1378 data); 1385 DUMP_XGMAC(qdev, FLOW_CTL);
1379 ql_read_xgmac_reg(qdev, GLOBAL_CFG, &data); 1386 DUMP_XGMAC(qdev, PAUSE_OPCODE);
1380 printk(KERN_ERR PFX "%s: GLOBAL_CFG = 0x%.08x.\n", qdev->ndev->name, 1387 DUMP_XGMAC(qdev, PAUSE_TIMER);
1381 data); 1388 DUMP_XGMAC(qdev, PAUSE_FRM_DEST_LO);
1382 ql_read_xgmac_reg(qdev, TX_CFG, &data); 1389 DUMP_XGMAC(qdev, PAUSE_FRM_DEST_HI);
1383 printk(KERN_ERR PFX "%s: TX_CFG = 0x%.08x.\n", qdev->ndev->name, data); 1390 DUMP_XGMAC(qdev, MAC_TX_PARAMS);
1384 ql_read_xgmac_reg(qdev, RX_CFG, &data); 1391 DUMP_XGMAC(qdev, MAC_RX_PARAMS);
1385 printk(KERN_ERR PFX "%s: RX_CFG = 0x%.08x.\n", qdev->ndev->name, data); 1392 DUMP_XGMAC(qdev, MAC_SYS_INT);
1386 ql_read_xgmac_reg(qdev, FLOW_CTL, &data); 1393 DUMP_XGMAC(qdev, MAC_SYS_INT_MASK);
1387 printk(KERN_ERR PFX "%s: FLOW_CTL = 0x%.08x.\n", qdev->ndev->name, 1394 DUMP_XGMAC(qdev, MAC_MGMT_INT);
1388 data); 1395 DUMP_XGMAC(qdev, MAC_MGMT_IN_MASK);
1389 ql_read_xgmac_reg(qdev, PAUSE_OPCODE, &data); 1396 DUMP_XGMAC(qdev, EXT_ARB_MODE);
1390 printk(KERN_ERR PFX "%s: PAUSE_OPCODE = 0x%.08x.\n", qdev->ndev->name,
1391 data);
1392 ql_read_xgmac_reg(qdev, PAUSE_TIMER, &data);
1393 printk(KERN_ERR PFX "%s: PAUSE_TIMER = 0x%.08x.\n", qdev->ndev->name,
1394 data);
1395 ql_read_xgmac_reg(qdev, PAUSE_FRM_DEST_LO, &data);
1396 printk(KERN_ERR PFX "%s: PAUSE_FRM_DEST_LO = 0x%.08x.\n",
1397 qdev->ndev->name, data);
1398 ql_read_xgmac_reg(qdev, PAUSE_FRM_DEST_HI, &data);
1399 printk(KERN_ERR PFX "%s: PAUSE_FRM_DEST_HI = 0x%.08x.\n",
1400 qdev->ndev->name, data);
1401 ql_read_xgmac_reg(qdev, MAC_TX_PARAMS, &data);
1402 printk(KERN_ERR PFX "%s: MAC_TX_PARAMS = 0x%.08x.\n", qdev->ndev->name,
1403 data);
1404 ql_read_xgmac_reg(qdev, MAC_RX_PARAMS, &data);
1405 printk(KERN_ERR PFX "%s: MAC_RX_PARAMS = 0x%.08x.\n", qdev->ndev->name,
1406 data);
1407 ql_read_xgmac_reg(qdev, MAC_SYS_INT, &data);
1408 printk(KERN_ERR PFX "%s: MAC_SYS_INT = 0x%.08x.\n", qdev->ndev->name,
1409 data);
1410 ql_read_xgmac_reg(qdev, MAC_SYS_INT_MASK, &data);
1411 printk(KERN_ERR PFX "%s: MAC_SYS_INT_MASK = 0x%.08x.\n",
1412 qdev->ndev->name, data);
1413 ql_read_xgmac_reg(qdev, MAC_MGMT_INT, &data);
1414 printk(KERN_ERR PFX "%s: MAC_MGMT_INT = 0x%.08x.\n", qdev->ndev->name,
1415 data);
1416 ql_read_xgmac_reg(qdev, MAC_MGMT_IN_MASK, &data);
1417 printk(KERN_ERR PFX "%s: MAC_MGMT_IN_MASK = 0x%.08x.\n",
1418 qdev->ndev->name, data);
1419 ql_read_xgmac_reg(qdev, EXT_ARB_MODE, &data);
1420 printk(KERN_ERR PFX "%s: EXT_ARB_MODE = 0x%.08x.\n", qdev->ndev->name,
1421 data);
1422 ql_sem_unlock(qdev, qdev->xg_sem_mask); 1397 ql_sem_unlock(qdev, qdev->xg_sem_mask);
1423
1424} 1398}
1425 1399
1426static void ql_dump_ets_regs(struct ql_adapter *qdev) 1400static void ql_dump_ets_regs(struct ql_adapter *qdev)
@@ -1437,14 +1411,12 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev)
1437 return; 1411 return;
1438 for (i = 0; i < 4; i++) { 1412 for (i = 0; i < 4; i++) {
1439 if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) { 1413 if (ql_get_mac_addr_reg(qdev, MAC_ADDR_TYPE_CAM_MAC, i, value)) {
1440 printk(KERN_ERR PFX 1414 pr_err("%s: Failed read of mac index register\n",
1441 "%s: Failed read of mac index register.\n",
1442 __func__); 1415 __func__);
1443 return; 1416 return;
1444 } else { 1417 } else {
1445 if (value[0]) 1418 if (value[0])
1446 printk(KERN_ERR PFX 1419 pr_err("%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x\n",
1447 "%s: CAM index %d CAM Lookup Lower = 0x%.08x:%.08x, Output = 0x%.08x.\n",
1448 qdev->ndev->name, i, value[1], value[0], 1420 qdev->ndev->name, i, value[1], value[0],
1449 value[2]); 1421 value[2]);
1450 } 1422 }
@@ -1452,14 +1424,12 @@ static void ql_dump_cam_entries(struct ql_adapter *qdev)
1452 for (i = 0; i < 32; i++) { 1424 for (i = 0; i < 32; i++) {
1453 if (ql_get_mac_addr_reg 1425 if (ql_get_mac_addr_reg
1454 (qdev, MAC_ADDR_TYPE_MULTI_MAC, i, value)) { 1426 (qdev, MAC_ADDR_TYPE_MULTI_MAC, i, value)) {
1455 printk(KERN_ERR PFX 1427 pr_err("%s: Failed read of mac index register\n",
1456 "%s: Failed read of mac index register.\n",
1457 __func__); 1428 __func__);
1458 return; 1429 return;
1459 } else { 1430 } else {
1460 if (value[0]) 1431 if (value[0])
1461 printk(KERN_ERR PFX 1432 pr_err("%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x\n",
1462 "%s: MCAST index %d CAM Lookup Lower = 0x%.08x:%.08x.\n",
1463 qdev->ndev->name, i, value[1], value[0]); 1433 qdev->ndev->name, i, value[1], value[0]);
1464 } 1434 }
1465 } 1435 }
@@ -1476,129 +1446,77 @@ void ql_dump_routing_entries(struct ql_adapter *qdev)
1476 for (i = 0; i < 16; i++) { 1446 for (i = 0; i < 16; i++) {
1477 value = 0; 1447 value = 0;
1478 if (ql_get_routing_reg(qdev, i, &value)) { 1448 if (ql_get_routing_reg(qdev, i, &value)) {
1479 printk(KERN_ERR PFX 1449 pr_err("%s: Failed read of routing index register\n",
1480 "%s: Failed read of routing index register.\n",
1481 __func__); 1450 __func__);
1482 return; 1451 return;
1483 } else { 1452 } else {
1484 if (value) 1453 if (value)
1485 printk(KERN_ERR PFX 1454 pr_err("%s: Routing Mask %d = 0x%.08x\n",
1486 "%s: Routing Mask %d = 0x%.08x.\n",
1487 qdev->ndev->name, i, value); 1455 qdev->ndev->name, i, value);
1488 } 1456 }
1489 } 1457 }
1490 ql_sem_unlock(qdev, SEM_RT_IDX_MASK); 1458 ql_sem_unlock(qdev, SEM_RT_IDX_MASK);
1491} 1459}
1492 1460
1461#define DUMP_REG(qdev, reg) \
1462 pr_err("%-32s= 0x%x\n", #reg, ql_read32(qdev, reg))
1463
1493void ql_dump_regs(struct ql_adapter *qdev) 1464void ql_dump_regs(struct ql_adapter *qdev)
1494{ 1465{
1495 printk(KERN_ERR PFX "reg dump for function #%d.\n", qdev->func); 1466 pr_err("reg dump for function #%d\n", qdev->func);
1496 printk(KERN_ERR PFX "SYS = 0x%x.\n", 1467 DUMP_REG(qdev, SYS);
1497 ql_read32(qdev, SYS)); 1468 DUMP_REG(qdev, RST_FO);
1498 printk(KERN_ERR PFX "RST_FO = 0x%x.\n", 1469 DUMP_REG(qdev, FSC);
1499 ql_read32(qdev, RST_FO)); 1470 DUMP_REG(qdev, CSR);
1500 printk(KERN_ERR PFX "FSC = 0x%x.\n", 1471 DUMP_REG(qdev, ICB_RID);
1501 ql_read32(qdev, FSC)); 1472 DUMP_REG(qdev, ICB_L);
1502 printk(KERN_ERR PFX "CSR = 0x%x.\n", 1473 DUMP_REG(qdev, ICB_H);
1503 ql_read32(qdev, CSR)); 1474 DUMP_REG(qdev, CFG);
1504 printk(KERN_ERR PFX "ICB_RID = 0x%x.\n", 1475 DUMP_REG(qdev, BIOS_ADDR);
1505 ql_read32(qdev, ICB_RID)); 1476 DUMP_REG(qdev, STS);
1506 printk(KERN_ERR PFX "ICB_L = 0x%x.\n", 1477 DUMP_REG(qdev, INTR_EN);
1507 ql_read32(qdev, ICB_L)); 1478 DUMP_REG(qdev, INTR_MASK);
1508 printk(KERN_ERR PFX "ICB_H = 0x%x.\n", 1479 DUMP_REG(qdev, ISR1);
1509 ql_read32(qdev, ICB_H)); 1480 DUMP_REG(qdev, ISR2);
1510 printk(KERN_ERR PFX "CFG = 0x%x.\n", 1481 DUMP_REG(qdev, ISR3);
1511 ql_read32(qdev, CFG)); 1482 DUMP_REG(qdev, ISR4);
1512 printk(KERN_ERR PFX "BIOS_ADDR = 0x%x.\n", 1483 DUMP_REG(qdev, REV_ID);
1513 ql_read32(qdev, BIOS_ADDR)); 1484 DUMP_REG(qdev, FRC_ECC_ERR);
1514 printk(KERN_ERR PFX "STS = 0x%x.\n", 1485 DUMP_REG(qdev, ERR_STS);
1515 ql_read32(qdev, STS)); 1486 DUMP_REG(qdev, RAM_DBG_ADDR);
1516 printk(KERN_ERR PFX "INTR_EN = 0x%x.\n", 1487 DUMP_REG(qdev, RAM_DBG_DATA);
1517 ql_read32(qdev, INTR_EN)); 1488 DUMP_REG(qdev, ECC_ERR_CNT);
1518 printk(KERN_ERR PFX "INTR_MASK = 0x%x.\n", 1489 DUMP_REG(qdev, SEM);
1519 ql_read32(qdev, INTR_MASK)); 1490 DUMP_REG(qdev, GPIO_1);
1520 printk(KERN_ERR PFX "ISR1 = 0x%x.\n", 1491 DUMP_REG(qdev, GPIO_2);
1521 ql_read32(qdev, ISR1)); 1492 DUMP_REG(qdev, GPIO_3);
1522 printk(KERN_ERR PFX "ISR2 = 0x%x.\n", 1493 DUMP_REG(qdev, XGMAC_ADDR);
1523 ql_read32(qdev, ISR2)); 1494 DUMP_REG(qdev, XGMAC_DATA);
1524 printk(KERN_ERR PFX "ISR3 = 0x%x.\n", 1495 DUMP_REG(qdev, NIC_ETS);
1525 ql_read32(qdev, ISR3)); 1496 DUMP_REG(qdev, CNA_ETS);
1526 printk(KERN_ERR PFX "ISR4 = 0x%x.\n", 1497 DUMP_REG(qdev, FLASH_ADDR);
1527 ql_read32(qdev, ISR4)); 1498 DUMP_REG(qdev, FLASH_DATA);
1528 printk(KERN_ERR PFX "REV_ID = 0x%x.\n", 1499 DUMP_REG(qdev, CQ_STOP);
1529 ql_read32(qdev, REV_ID)); 1500 DUMP_REG(qdev, PAGE_TBL_RID);
1530 printk(KERN_ERR PFX "FRC_ECC_ERR = 0x%x.\n", 1501 DUMP_REG(qdev, WQ_PAGE_TBL_LO);
1531 ql_read32(qdev, FRC_ECC_ERR)); 1502 DUMP_REG(qdev, WQ_PAGE_TBL_HI);
1532 printk(KERN_ERR PFX "ERR_STS = 0x%x.\n", 1503 DUMP_REG(qdev, CQ_PAGE_TBL_LO);
1533 ql_read32(qdev, ERR_STS)); 1504 DUMP_REG(qdev, CQ_PAGE_TBL_HI);
1534 printk(KERN_ERR PFX "RAM_DBG_ADDR = 0x%x.\n", 1505 DUMP_REG(qdev, COS_DFLT_CQ1);
1535 ql_read32(qdev, RAM_DBG_ADDR)); 1506 DUMP_REG(qdev, COS_DFLT_CQ2);
1536 printk(KERN_ERR PFX "RAM_DBG_DATA = 0x%x.\n", 1507 DUMP_REG(qdev, SPLT_HDR);
1537 ql_read32(qdev, RAM_DBG_DATA)); 1508 DUMP_REG(qdev, FC_PAUSE_THRES);
1538 printk(KERN_ERR PFX "ECC_ERR_CNT = 0x%x.\n", 1509 DUMP_REG(qdev, NIC_PAUSE_THRES);
1539 ql_read32(qdev, ECC_ERR_CNT)); 1510 DUMP_REG(qdev, FC_ETHERTYPE);
1540 printk(KERN_ERR PFX "SEM = 0x%x.\n", 1511 DUMP_REG(qdev, FC_RCV_CFG);
1541 ql_read32(qdev, SEM)); 1512 DUMP_REG(qdev, NIC_RCV_CFG);
1542 printk(KERN_ERR PFX "GPIO_1 = 0x%x.\n", 1513 DUMP_REG(qdev, FC_COS_TAGS);
1543 ql_read32(qdev, GPIO_1)); 1514 DUMP_REG(qdev, NIC_COS_TAGS);
1544 printk(KERN_ERR PFX "GPIO_2 = 0x%x.\n", 1515 DUMP_REG(qdev, MGMT_RCV_CFG);
1545 ql_read32(qdev, GPIO_2)); 1516 DUMP_REG(qdev, XG_SERDES_ADDR);
1546 printk(KERN_ERR PFX "GPIO_3 = 0x%x.\n", 1517 DUMP_REG(qdev, XG_SERDES_DATA);
1547 ql_read32(qdev, GPIO_3)); 1518 DUMP_REG(qdev, PRB_MX_ADDR);
1548 printk(KERN_ERR PFX "XGMAC_ADDR = 0x%x.\n", 1519 DUMP_REG(qdev, PRB_MX_DATA);
1549 ql_read32(qdev, XGMAC_ADDR));
1550 printk(KERN_ERR PFX "XGMAC_DATA = 0x%x.\n",
1551 ql_read32(qdev, XGMAC_DATA));
1552 printk(KERN_ERR PFX "NIC_ETS = 0x%x.\n",
1553 ql_read32(qdev, NIC_ETS));
1554 printk(KERN_ERR PFX "CNA_ETS = 0x%x.\n",
1555 ql_read32(qdev, CNA_ETS));
1556 printk(KERN_ERR PFX "FLASH_ADDR = 0x%x.\n",
1557 ql_read32(qdev, FLASH_ADDR));
1558 printk(KERN_ERR PFX "FLASH_DATA = 0x%x.\n",
1559 ql_read32(qdev, FLASH_DATA));
1560 printk(KERN_ERR PFX "CQ_STOP = 0x%x.\n",
1561 ql_read32(qdev, CQ_STOP));
1562 printk(KERN_ERR PFX "PAGE_TBL_RID = 0x%x.\n",
1563 ql_read32(qdev, PAGE_TBL_RID));
1564 printk(KERN_ERR PFX "WQ_PAGE_TBL_LO = 0x%x.\n",
1565 ql_read32(qdev, WQ_PAGE_TBL_LO));
1566 printk(KERN_ERR PFX "WQ_PAGE_TBL_HI = 0x%x.\n",
1567 ql_read32(qdev, WQ_PAGE_TBL_HI));
1568 printk(KERN_ERR PFX "CQ_PAGE_TBL_LO = 0x%x.\n",
1569 ql_read32(qdev, CQ_PAGE_TBL_LO));
1570 printk(KERN_ERR PFX "CQ_PAGE_TBL_HI = 0x%x.\n",
1571 ql_read32(qdev, CQ_PAGE_TBL_HI));
1572 printk(KERN_ERR PFX "COS_DFLT_CQ1 = 0x%x.\n",
1573 ql_read32(qdev, COS_DFLT_CQ1));
1574 printk(KERN_ERR PFX "COS_DFLT_CQ2 = 0x%x.\n",
1575 ql_read32(qdev, COS_DFLT_CQ2));
1576 printk(KERN_ERR PFX "SPLT_HDR = 0x%x.\n",
1577 ql_read32(qdev, SPLT_HDR));
1578 printk(KERN_ERR PFX "FC_PAUSE_THRES = 0x%x.\n",
1579 ql_read32(qdev, FC_PAUSE_THRES));
1580 printk(KERN_ERR PFX "NIC_PAUSE_THRES = 0x%x.\n",
1581 ql_read32(qdev, NIC_PAUSE_THRES));
1582 printk(KERN_ERR PFX "FC_ETHERTYPE = 0x%x.\n",
1583 ql_read32(qdev, FC_ETHERTYPE));
1584 printk(KERN_ERR PFX "FC_RCV_CFG = 0x%x.\n",
1585 ql_read32(qdev, FC_RCV_CFG));
1586 printk(KERN_ERR PFX "NIC_RCV_CFG = 0x%x.\n",
1587 ql_read32(qdev, NIC_RCV_CFG));
1588 printk(KERN_ERR PFX "FC_COS_TAGS = 0x%x.\n",
1589 ql_read32(qdev, FC_COS_TAGS));
1590 printk(KERN_ERR PFX "NIC_COS_TAGS = 0x%x.\n",
1591 ql_read32(qdev, NIC_COS_TAGS));
1592 printk(KERN_ERR PFX "MGMT_RCV_CFG = 0x%x.\n",
1593 ql_read32(qdev, MGMT_RCV_CFG));
1594 printk(KERN_ERR PFX "XG_SERDES_ADDR = 0x%x.\n",
1595 ql_read32(qdev, XG_SERDES_ADDR));
1596 printk(KERN_ERR PFX "XG_SERDES_DATA = 0x%x.\n",
1597 ql_read32(qdev, XG_SERDES_DATA));
1598 printk(KERN_ERR PFX "PRB_MX_ADDR = 0x%x.\n",
1599 ql_read32(qdev, PRB_MX_ADDR));
1600 printk(KERN_ERR PFX "PRB_MX_DATA = 0x%x.\n",
1601 ql_read32(qdev, PRB_MX_DATA));
1602 ql_dump_intr_states(qdev); 1520 ql_dump_intr_states(qdev);
1603 ql_dump_xgmac_control_regs(qdev); 1521 ql_dump_xgmac_control_regs(qdev);
1604 ql_dump_ets_regs(qdev); 1522 ql_dump_ets_regs(qdev);
@@ -1608,191 +1526,124 @@ void ql_dump_regs(struct ql_adapter *qdev)
1608#endif 1526#endif
1609 1527
1610#ifdef QL_STAT_DUMP 1528#ifdef QL_STAT_DUMP
1529
1530#define DUMP_STAT(qdev, stat) \
1531 pr_err("%s = %ld\n", #stat, (unsigned long)qdev->nic_stats.stat)
1532
1611void ql_dump_stat(struct ql_adapter *qdev) 1533void ql_dump_stat(struct ql_adapter *qdev)
1612{ 1534{
1613 printk(KERN_ERR "%s: Enter.\n", __func__); 1535 pr_err("%s: Enter\n", __func__);
1614 printk(KERN_ERR "tx_pkts = %ld\n", 1536 DUMP_STAT(qdev, tx_pkts);
1615 (unsigned long)qdev->nic_stats.tx_pkts); 1537 DUMP_STAT(qdev, tx_bytes);
1616 printk(KERN_ERR "tx_bytes = %ld\n", 1538 DUMP_STAT(qdev, tx_mcast_pkts);
1617 (unsigned long)qdev->nic_stats.tx_bytes); 1539 DUMP_STAT(qdev, tx_bcast_pkts);
1618 printk(KERN_ERR "tx_mcast_pkts = %ld.\n", 1540 DUMP_STAT(qdev, tx_ucast_pkts);
1619 (unsigned long)qdev->nic_stats.tx_mcast_pkts); 1541 DUMP_STAT(qdev, tx_ctl_pkts);
1620 printk(KERN_ERR "tx_bcast_pkts = %ld.\n", 1542 DUMP_STAT(qdev, tx_pause_pkts);
1621 (unsigned long)qdev->nic_stats.tx_bcast_pkts); 1543 DUMP_STAT(qdev, tx_64_pkt);
1622 printk(KERN_ERR "tx_ucast_pkts = %ld.\n", 1544 DUMP_STAT(qdev, tx_65_to_127_pkt);
1623 (unsigned long)qdev->nic_stats.tx_ucast_pkts); 1545 DUMP_STAT(qdev, tx_128_to_255_pkt);
1624 printk(KERN_ERR "tx_ctl_pkts = %ld.\n", 1546 DUMP_STAT(qdev, tx_256_511_pkt);
1625 (unsigned long)qdev->nic_stats.tx_ctl_pkts); 1547 DUMP_STAT(qdev, tx_512_to_1023_pkt);
1626 printk(KERN_ERR "tx_pause_pkts = %ld.\n", 1548 DUMP_STAT(qdev, tx_1024_to_1518_pkt);
1627 (unsigned long)qdev->nic_stats.tx_pause_pkts); 1549 DUMP_STAT(qdev, tx_1519_to_max_pkt);
1628 printk(KERN_ERR "tx_64_pkt = %ld.\n", 1550 DUMP_STAT(qdev, tx_undersize_pkt);
1629 (unsigned long)qdev->nic_stats.tx_64_pkt); 1551 DUMP_STAT(qdev, tx_oversize_pkt);
1630 printk(KERN_ERR "tx_65_to_127_pkt = %ld.\n", 1552 DUMP_STAT(qdev, rx_bytes);
1631 (unsigned long)qdev->nic_stats.tx_65_to_127_pkt); 1553 DUMP_STAT(qdev, rx_bytes_ok);
1632 printk(KERN_ERR "tx_128_to_255_pkt = %ld.\n", 1554 DUMP_STAT(qdev, rx_pkts);
1633 (unsigned long)qdev->nic_stats.tx_128_to_255_pkt); 1555 DUMP_STAT(qdev, rx_pkts_ok);
1634 printk(KERN_ERR "tx_256_511_pkt = %ld.\n", 1556 DUMP_STAT(qdev, rx_bcast_pkts);
1635 (unsigned long)qdev->nic_stats.tx_256_511_pkt); 1557 DUMP_STAT(qdev, rx_mcast_pkts);
1636 printk(KERN_ERR "tx_512_to_1023_pkt = %ld.\n", 1558 DUMP_STAT(qdev, rx_ucast_pkts);
1637 (unsigned long)qdev->nic_stats.tx_512_to_1023_pkt); 1559 DUMP_STAT(qdev, rx_undersize_pkts);
1638 printk(KERN_ERR "tx_1024_to_1518_pkt = %ld.\n", 1560 DUMP_STAT(qdev, rx_oversize_pkts);
1639 (unsigned long)qdev->nic_stats.tx_1024_to_1518_pkt); 1561 DUMP_STAT(qdev, rx_jabber_pkts);
1640 printk(KERN_ERR "tx_1519_to_max_pkt = %ld.\n", 1562 DUMP_STAT(qdev, rx_undersize_fcerr_pkts);
1641 (unsigned long)qdev->nic_stats.tx_1519_to_max_pkt); 1563 DUMP_STAT(qdev, rx_drop_events);
1642 printk(KERN_ERR "tx_undersize_pkt = %ld.\n", 1564 DUMP_STAT(qdev, rx_fcerr_pkts);
1643 (unsigned long)qdev->nic_stats.tx_undersize_pkt); 1565 DUMP_STAT(qdev, rx_align_err);
1644 printk(KERN_ERR "tx_oversize_pkt = %ld.\n", 1566 DUMP_STAT(qdev, rx_symbol_err);
1645 (unsigned long)qdev->nic_stats.tx_oversize_pkt); 1567 DUMP_STAT(qdev, rx_mac_err);
1646 printk(KERN_ERR "rx_bytes = %ld.\n", 1568 DUMP_STAT(qdev, rx_ctl_pkts);
1647 (unsigned long)qdev->nic_stats.rx_bytes); 1569 DUMP_STAT(qdev, rx_pause_pkts);
1648 printk(KERN_ERR "rx_bytes_ok = %ld.\n", 1570 DUMP_STAT(qdev, rx_64_pkts);
1649 (unsigned long)qdev->nic_stats.rx_bytes_ok); 1571 DUMP_STAT(qdev, rx_65_to_127_pkts);
1650 printk(KERN_ERR "rx_pkts = %ld.\n", 1572 DUMP_STAT(qdev, rx_128_255_pkts);
1651 (unsigned long)qdev->nic_stats.rx_pkts); 1573 DUMP_STAT(qdev, rx_256_511_pkts);
1652 printk(KERN_ERR "rx_pkts_ok = %ld.\n", 1574 DUMP_STAT(qdev, rx_512_to_1023_pkts);
1653 (unsigned long)qdev->nic_stats.rx_pkts_ok); 1575 DUMP_STAT(qdev, rx_1024_to_1518_pkts);
1654 printk(KERN_ERR "rx_bcast_pkts = %ld.\n", 1576 DUMP_STAT(qdev, rx_1519_to_max_pkts);
1655 (unsigned long)qdev->nic_stats.rx_bcast_pkts); 1577 DUMP_STAT(qdev, rx_len_err_pkts);
1656 printk(KERN_ERR "rx_mcast_pkts = %ld.\n",
1657 (unsigned long)qdev->nic_stats.rx_mcast_pkts);
1658 printk(KERN_ERR "rx_ucast_pkts = %ld.\n",
1659 (unsigned long)qdev->nic_stats.rx_ucast_pkts);
1660 printk(KERN_ERR "rx_undersize_pkts = %ld.\n",
1661 (unsigned long)qdev->nic_stats.rx_undersize_pkts);
1662 printk(KERN_ERR "rx_oversize_pkts = %ld.\n",
1663 (unsigned long)qdev->nic_stats.rx_oversize_pkts);
1664 printk(KERN_ERR "rx_jabber_pkts = %ld.\n",
1665 (unsigned long)qdev->nic_stats.rx_jabber_pkts);
1666 printk(KERN_ERR "rx_undersize_fcerr_pkts = %ld.\n",
1667 (unsigned long)qdev->nic_stats.rx_undersize_fcerr_pkts);
1668 printk(KERN_ERR "rx_drop_events = %ld.\n",
1669 (unsigned long)qdev->nic_stats.rx_drop_events);
1670 printk(KERN_ERR "rx_fcerr_pkts = %ld.\n",
1671 (unsigned long)qdev->nic_stats.rx_fcerr_pkts);
1672 printk(KERN_ERR "rx_align_err = %ld.\n",
1673 (unsigned long)qdev->nic_stats.rx_align_err);
1674 printk(KERN_ERR "rx_symbol_err = %ld.\n",
1675 (unsigned long)qdev->nic_stats.rx_symbol_err);
1676 printk(KERN_ERR "rx_mac_err = %ld.\n",
1677 (unsigned long)qdev->nic_stats.rx_mac_err);
1678 printk(KERN_ERR "rx_ctl_pkts = %ld.\n",
1679 (unsigned long)qdev->nic_stats.rx_ctl_pkts);
1680 printk(KERN_ERR "rx_pause_pkts = %ld.\n",
1681 (unsigned long)qdev->nic_stats.rx_pause_pkts);
1682 printk(KERN_ERR "rx_64_pkts = %ld.\n",
1683 (unsigned long)qdev->nic_stats.rx_64_pkts);
1684 printk(KERN_ERR "rx_65_to_127_pkts = %ld.\n",
1685 (unsigned long)qdev->nic_stats.rx_65_to_127_pkts);
1686 printk(KERN_ERR "rx_128_255_pkts = %ld.\n",
1687 (unsigned long)qdev->nic_stats.rx_128_255_pkts);
1688 printk(KERN_ERR "rx_256_511_pkts = %ld.\n",
1689 (unsigned long)qdev->nic_stats.rx_256_511_pkts);
1690 printk(KERN_ERR "rx_512_to_1023_pkts = %ld.\n",
1691 (unsigned long)qdev->nic_stats.rx_512_to_1023_pkts);
1692 printk(KERN_ERR "rx_1024_to_1518_pkts = %ld.\n",
1693 (unsigned long)qdev->nic_stats.rx_1024_to_1518_pkts);
1694 printk(KERN_ERR "rx_1519_to_max_pkts = %ld.\n",
1695 (unsigned long)qdev->nic_stats.rx_1519_to_max_pkts);
1696 printk(KERN_ERR "rx_len_err_pkts = %ld.\n",
1697 (unsigned long)qdev->nic_stats.rx_len_err_pkts);
1698}; 1578};
1699#endif 1579#endif
1700 1580
1701#ifdef QL_DEV_DUMP 1581#ifdef QL_DEV_DUMP
1582
1583#define DUMP_QDEV_FIELD(qdev, type, field) \
1584 pr_err("qdev->%-24s = " type "\n", #field, qdev->field)
1585#define DUMP_QDEV_DMA_FIELD(qdev, field) \
1586 pr_err("qdev->%-24s = %llx\n", #field, (unsigned long long)qdev->field)
1587#define DUMP_QDEV_ARRAY(qdev, type, array, index, field) \
1588 pr_err("%s[%d].%s = " type "\n", \
1589 #array, index, #field, qdev->array[index].field);
1702void ql_dump_qdev(struct ql_adapter *qdev) 1590void ql_dump_qdev(struct ql_adapter *qdev)
1703{ 1591{
1704 int i; 1592 int i;
1705 printk(KERN_ERR PFX "qdev->flags = %lx.\n", 1593 DUMP_QDEV_FIELD(qdev, "%lx", flags);
1706 qdev->flags); 1594 DUMP_QDEV_FIELD(qdev, "%p", vlgrp);
1707 printk(KERN_ERR PFX "qdev->vlgrp = %p.\n", 1595 DUMP_QDEV_FIELD(qdev, "%p", pdev);
1708 qdev->vlgrp); 1596 DUMP_QDEV_FIELD(qdev, "%p", ndev);
1709 printk(KERN_ERR PFX "qdev->pdev = %p.\n", 1597 DUMP_QDEV_FIELD(qdev, "%d", chip_rev_id);
1710 qdev->pdev); 1598 DUMP_QDEV_FIELD(qdev, "%p", reg_base);
1711 printk(KERN_ERR PFX "qdev->ndev = %p.\n", 1599 DUMP_QDEV_FIELD(qdev, "%p", doorbell_area);
1712 qdev->ndev); 1600 DUMP_QDEV_FIELD(qdev, "%d", doorbell_area_size);
1713 printk(KERN_ERR PFX "qdev->chip_rev_id = %d.\n", 1601 DUMP_QDEV_FIELD(qdev, "%x", msg_enable);
1714 qdev->chip_rev_id); 1602 DUMP_QDEV_FIELD(qdev, "%p", rx_ring_shadow_reg_area);
1715 printk(KERN_ERR PFX "qdev->reg_base = %p.\n", 1603 DUMP_QDEV_DMA_FIELD(qdev, rx_ring_shadow_reg_dma);
1716 qdev->reg_base); 1604 DUMP_QDEV_FIELD(qdev, "%p", tx_ring_shadow_reg_area);
1717 printk(KERN_ERR PFX "qdev->doorbell_area = %p.\n", 1605 DUMP_QDEV_DMA_FIELD(qdev, tx_ring_shadow_reg_dma);
1718 qdev->doorbell_area); 1606 DUMP_QDEV_FIELD(qdev, "%d", intr_count);
1719 printk(KERN_ERR PFX "qdev->doorbell_area_size = %d.\n",
1720 qdev->doorbell_area_size);
1721 printk(KERN_ERR PFX "msg_enable = %x.\n",
1722 qdev->msg_enable);
1723 printk(KERN_ERR PFX "qdev->rx_ring_shadow_reg_area = %p.\n",
1724 qdev->rx_ring_shadow_reg_area);
1725 printk(KERN_ERR PFX "qdev->rx_ring_shadow_reg_dma = %llx.\n",
1726 (unsigned long long) qdev->rx_ring_shadow_reg_dma);
1727 printk(KERN_ERR PFX "qdev->tx_ring_shadow_reg_area = %p.\n",
1728 qdev->tx_ring_shadow_reg_area);
1729 printk(KERN_ERR PFX "qdev->tx_ring_shadow_reg_dma = %llx.\n",
1730 (unsigned long long) qdev->tx_ring_shadow_reg_dma);
1731 printk(KERN_ERR PFX "qdev->intr_count = %d.\n",
1732 qdev->intr_count);
1733 if (qdev->msi_x_entry) 1607 if (qdev->msi_x_entry)
1734 for (i = 0; i < qdev->intr_count; i++) { 1608 for (i = 0; i < qdev->intr_count; i++) {
1735 printk(KERN_ERR PFX 1609 DUMP_QDEV_ARRAY(qdev, "%d", msi_x_entry, i, vector);
1736 "msi_x_entry.[%d]vector = %d.\n", i, 1610 DUMP_QDEV_ARRAY(qdev, "%d", msi_x_entry, i, entry);
1737 qdev->msi_x_entry[i].vector);
1738 printk(KERN_ERR PFX
1739 "msi_x_entry.[%d]entry = %d.\n", i,
1740 qdev->msi_x_entry[i].entry);
1741 } 1611 }
1742 for (i = 0; i < qdev->intr_count; i++) { 1612 for (i = 0; i < qdev->intr_count; i++) {
1743 printk(KERN_ERR PFX 1613 DUMP_QDEV_ARRAY(qdev, "%p", intr_context, i, qdev);
1744 "intr_context[%d].qdev = %p.\n", i, 1614 DUMP_QDEV_ARRAY(qdev, "%d", intr_context, i, intr);
1745 qdev->intr_context[i].qdev); 1615 DUMP_QDEV_ARRAY(qdev, "%d", intr_context, i, hooked);
1746 printk(KERN_ERR PFX 1616 DUMP_QDEV_ARRAY(qdev, "0x%08x", intr_context, i, intr_en_mask);
1747 "intr_context[%d].intr = %d.\n", i, 1617 DUMP_QDEV_ARRAY(qdev, "0x%08x", intr_context, i, intr_dis_mask);
1748 qdev->intr_context[i].intr); 1618 DUMP_QDEV_ARRAY(qdev, "0x%08x", intr_context, i, intr_read_mask);
1749 printk(KERN_ERR PFX
1750 "intr_context[%d].hooked = %d.\n", i,
1751 qdev->intr_context[i].hooked);
1752 printk(KERN_ERR PFX
1753 "intr_context[%d].intr_en_mask = 0x%08x.\n", i,
1754 qdev->intr_context[i].intr_en_mask);
1755 printk(KERN_ERR PFX
1756 "intr_context[%d].intr_dis_mask = 0x%08x.\n", i,
1757 qdev->intr_context[i].intr_dis_mask);
1758 printk(KERN_ERR PFX
1759 "intr_context[%d].intr_read_mask = 0x%08x.\n", i,
1760 qdev->intr_context[i].intr_read_mask);
1761 } 1619 }
1762 printk(KERN_ERR PFX "qdev->tx_ring_count = %d.\n", qdev->tx_ring_count); 1620 DUMP_QDEV_FIELD(qdev, "%d", tx_ring_count);
1763 printk(KERN_ERR PFX "qdev->rx_ring_count = %d.\n", qdev->rx_ring_count); 1621 DUMP_QDEV_FIELD(qdev, "%d", rx_ring_count);
1764 printk(KERN_ERR PFX "qdev->ring_mem_size = %d.\n", qdev->ring_mem_size); 1622 DUMP_QDEV_FIELD(qdev, "%d", ring_mem_size);
1765 printk(KERN_ERR PFX "qdev->ring_mem = %p.\n", qdev->ring_mem); 1623 DUMP_QDEV_FIELD(qdev, "%p", ring_mem);
1766 printk(KERN_ERR PFX "qdev->intr_count = %d.\n", qdev->intr_count); 1624 DUMP_QDEV_FIELD(qdev, "%d", intr_count);
1767 printk(KERN_ERR PFX "qdev->tx_ring = %p.\n", 1625 DUMP_QDEV_FIELD(qdev, "%p", tx_ring);
1768 qdev->tx_ring); 1626 DUMP_QDEV_FIELD(qdev, "%d", rss_ring_count);
1769 printk(KERN_ERR PFX "qdev->rss_ring_count = %d.\n", 1627 DUMP_QDEV_FIELD(qdev, "%p", rx_ring);
1770 qdev->rss_ring_count); 1628 DUMP_QDEV_FIELD(qdev, "%d", default_rx_queue);
1771 printk(KERN_ERR PFX "qdev->rx_ring = %p.\n", qdev->rx_ring); 1629 DUMP_QDEV_FIELD(qdev, "0x%08x", xg_sem_mask);
1772 printk(KERN_ERR PFX "qdev->default_rx_queue = %d.\n", 1630 DUMP_QDEV_FIELD(qdev, "0x%08x", port_link_up);
1773 qdev->default_rx_queue); 1631 DUMP_QDEV_FIELD(qdev, "0x%08x", port_init);
1774 printk(KERN_ERR PFX "qdev->xg_sem_mask = 0x%08x.\n",
1775 qdev->xg_sem_mask);
1776 printk(KERN_ERR PFX "qdev->port_link_up = 0x%08x.\n",
1777 qdev->port_link_up);
1778 printk(KERN_ERR PFX "qdev->port_init = 0x%08x.\n",
1779 qdev->port_init);
1780
1781} 1632}
1782#endif 1633#endif
1783 1634
1784#ifdef QL_CB_DUMP 1635#ifdef QL_CB_DUMP
1785void ql_dump_wqicb(struct wqicb *wqicb) 1636void ql_dump_wqicb(struct wqicb *wqicb)
1786{ 1637{
1787 printk(KERN_ERR PFX "Dumping wqicb stuff...\n"); 1638 pr_err("Dumping wqicb stuff...\n");
1788 printk(KERN_ERR PFX "wqicb->len = 0x%x.\n", le16_to_cpu(wqicb->len)); 1639 pr_err("wqicb->len = 0x%x\n", le16_to_cpu(wqicb->len));
1789 printk(KERN_ERR PFX "wqicb->flags = %x.\n", le16_to_cpu(wqicb->flags)); 1640 pr_err("wqicb->flags = %x\n", le16_to_cpu(wqicb->flags));
1790 printk(KERN_ERR PFX "wqicb->cq_id_rss = %d.\n", 1641 pr_err("wqicb->cq_id_rss = %d\n",
1791 le16_to_cpu(wqicb->cq_id_rss)); 1642 le16_to_cpu(wqicb->cq_id_rss));
1792 printk(KERN_ERR PFX "wqicb->rid = 0x%x.\n", le16_to_cpu(wqicb->rid)); 1643 pr_err("wqicb->rid = 0x%x\n", le16_to_cpu(wqicb->rid));
1793 printk(KERN_ERR PFX "wqicb->wq_addr = 0x%llx.\n", 1644 pr_err("wqicb->wq_addr = 0x%llx\n",
1794 (unsigned long long) le64_to_cpu(wqicb->addr)); 1645 (unsigned long long) le64_to_cpu(wqicb->addr));
1795 printk(KERN_ERR PFX "wqicb->wq_cnsmr_idx_addr = 0x%llx.\n", 1646 pr_err("wqicb->wq_cnsmr_idx_addr = 0x%llx\n",
1796 (unsigned long long) le64_to_cpu(wqicb->cnsmr_idx_addr)); 1647 (unsigned long long) le64_to_cpu(wqicb->cnsmr_idx_addr));
1797} 1648}
1798 1649
@@ -1800,40 +1651,34 @@ void ql_dump_tx_ring(struct tx_ring *tx_ring)
1800{ 1651{
1801 if (tx_ring == NULL) 1652 if (tx_ring == NULL)
1802 return; 1653 return;
1803 printk(KERN_ERR PFX 1654 pr_err("===================== Dumping tx_ring %d ===============\n",
1804 "===================== Dumping tx_ring %d ===============.\n",
1805 tx_ring->wq_id); 1655 tx_ring->wq_id);
1806 printk(KERN_ERR PFX "tx_ring->base = %p.\n", tx_ring->wq_base); 1656 pr_err("tx_ring->base = %p\n", tx_ring->wq_base);
1807 printk(KERN_ERR PFX "tx_ring->base_dma = 0x%llx.\n", 1657 pr_err("tx_ring->base_dma = 0x%llx\n",
1808 (unsigned long long) tx_ring->wq_base_dma); 1658 (unsigned long long) tx_ring->wq_base_dma);
1809 printk(KERN_ERR PFX 1659 pr_err("tx_ring->cnsmr_idx_sh_reg, addr = 0x%p, value = %d\n",
1810 "tx_ring->cnsmr_idx_sh_reg, addr = 0x%p, value = %d.\n",
1811 tx_ring->cnsmr_idx_sh_reg, 1660 tx_ring->cnsmr_idx_sh_reg,
1812 tx_ring->cnsmr_idx_sh_reg 1661 tx_ring->cnsmr_idx_sh_reg
1813 ? ql_read_sh_reg(tx_ring->cnsmr_idx_sh_reg) : 0); 1662 ? ql_read_sh_reg(tx_ring->cnsmr_idx_sh_reg) : 0);
1814 printk(KERN_ERR PFX "tx_ring->size = %d.\n", tx_ring->wq_size); 1663 pr_err("tx_ring->size = %d\n", tx_ring->wq_size);
1815 printk(KERN_ERR PFX "tx_ring->len = %d.\n", tx_ring->wq_len); 1664 pr_err("tx_ring->len = %d\n", tx_ring->wq_len);
1816 printk(KERN_ERR PFX "tx_ring->prod_idx_db_reg = %p.\n", 1665 pr_err("tx_ring->prod_idx_db_reg = %p\n", tx_ring->prod_idx_db_reg);
1817 tx_ring->prod_idx_db_reg); 1666 pr_err("tx_ring->valid_db_reg = %p\n", tx_ring->valid_db_reg);
1818 printk(KERN_ERR PFX "tx_ring->valid_db_reg = %p.\n", 1667 pr_err("tx_ring->prod_idx = %d\n", tx_ring->prod_idx);
1819 tx_ring->valid_db_reg); 1668 pr_err("tx_ring->cq_id = %d\n", tx_ring->cq_id);
1820 printk(KERN_ERR PFX "tx_ring->prod_idx = %d.\n", tx_ring->prod_idx); 1669 pr_err("tx_ring->wq_id = %d\n", tx_ring->wq_id);
1821 printk(KERN_ERR PFX "tx_ring->cq_id = %d.\n", tx_ring->cq_id); 1670 pr_err("tx_ring->q = %p\n", tx_ring->q);
1822 printk(KERN_ERR PFX "tx_ring->wq_id = %d.\n", tx_ring->wq_id); 1671 pr_err("tx_ring->tx_count = %d\n", atomic_read(&tx_ring->tx_count));
1823 printk(KERN_ERR PFX "tx_ring->q = %p.\n", tx_ring->q);
1824 printk(KERN_ERR PFX "tx_ring->tx_count = %d.\n",
1825 atomic_read(&tx_ring->tx_count));
1826} 1672}
1827 1673
1828void ql_dump_ricb(struct ricb *ricb) 1674void ql_dump_ricb(struct ricb *ricb)
1829{ 1675{
1830 int i; 1676 int i;
1831 printk(KERN_ERR PFX 1677 pr_err("===================== Dumping ricb ===============\n");
1832 "===================== Dumping ricb ===============.\n"); 1678 pr_err("Dumping ricb stuff...\n");
1833 printk(KERN_ERR PFX "Dumping ricb stuff...\n");
1834 1679
1835 printk(KERN_ERR PFX "ricb->base_cq = %d.\n", ricb->base_cq & 0x1f); 1680 pr_err("ricb->base_cq = %d\n", ricb->base_cq & 0x1f);
1836 printk(KERN_ERR PFX "ricb->flags = %s%s%s%s%s%s%s%s%s.\n", 1681 pr_err("ricb->flags = %s%s%s%s%s%s%s%s%s\n",
1837 ricb->base_cq & RSS_L4K ? "RSS_L4K " : "", 1682 ricb->base_cq & RSS_L4K ? "RSS_L4K " : "",
1838 ricb->flags & RSS_L6K ? "RSS_L6K " : "", 1683 ricb->flags & RSS_L6K ? "RSS_L6K " : "",
1839 ricb->flags & RSS_LI ? "RSS_LI " : "", 1684 ricb->flags & RSS_LI ? "RSS_LI " : "",
@@ -1843,44 +1688,44 @@ void ql_dump_ricb(struct ricb *ricb)
1843 ricb->flags & RSS_RT4 ? "RSS_RT4 " : "", 1688 ricb->flags & RSS_RT4 ? "RSS_RT4 " : "",
1844 ricb->flags & RSS_RI6 ? "RSS_RI6 " : "", 1689 ricb->flags & RSS_RI6 ? "RSS_RI6 " : "",
1845 ricb->flags & RSS_RT6 ? "RSS_RT6 " : ""); 1690 ricb->flags & RSS_RT6 ? "RSS_RT6 " : "");
1846 printk(KERN_ERR PFX "ricb->mask = 0x%.04x.\n", le16_to_cpu(ricb->mask)); 1691 pr_err("ricb->mask = 0x%.04x\n", le16_to_cpu(ricb->mask));
1847 for (i = 0; i < 16; i++) 1692 for (i = 0; i < 16; i++)
1848 printk(KERN_ERR PFX "ricb->hash_cq_id[%d] = 0x%.08x.\n", i, 1693 pr_err("ricb->hash_cq_id[%d] = 0x%.08x\n", i,
1849 le32_to_cpu(ricb->hash_cq_id[i])); 1694 le32_to_cpu(ricb->hash_cq_id[i]));
1850 for (i = 0; i < 10; i++) 1695 for (i = 0; i < 10; i++)
1851 printk(KERN_ERR PFX "ricb->ipv6_hash_key[%d] = 0x%.08x.\n", i, 1696 pr_err("ricb->ipv6_hash_key[%d] = 0x%.08x\n", i,
1852 le32_to_cpu(ricb->ipv6_hash_key[i])); 1697 le32_to_cpu(ricb->ipv6_hash_key[i]));
1853 for (i = 0; i < 4; i++) 1698 for (i = 0; i < 4; i++)
1854 printk(KERN_ERR PFX "ricb->ipv4_hash_key[%d] = 0x%.08x.\n", i, 1699 pr_err("ricb->ipv4_hash_key[%d] = 0x%.08x\n", i,
1855 le32_to_cpu(ricb->ipv4_hash_key[i])); 1700 le32_to_cpu(ricb->ipv4_hash_key[i]));
1856} 1701}
1857 1702
1858void ql_dump_cqicb(struct cqicb *cqicb) 1703void ql_dump_cqicb(struct cqicb *cqicb)
1859{ 1704{
1860 printk(KERN_ERR PFX "Dumping cqicb stuff...\n"); 1705 pr_err("Dumping cqicb stuff...\n");
1861 1706
1862 printk(KERN_ERR PFX "cqicb->msix_vect = %d.\n", cqicb->msix_vect); 1707 pr_err("cqicb->msix_vect = %d\n", cqicb->msix_vect);
1863 printk(KERN_ERR PFX "cqicb->flags = %x.\n", cqicb->flags); 1708 pr_err("cqicb->flags = %x\n", cqicb->flags);
1864 printk(KERN_ERR PFX "cqicb->len = %d.\n", le16_to_cpu(cqicb->len)); 1709 pr_err("cqicb->len = %d\n", le16_to_cpu(cqicb->len));
1865 printk(KERN_ERR PFX "cqicb->addr = 0x%llx.\n", 1710 pr_err("cqicb->addr = 0x%llx\n",
1866 (unsigned long long) le64_to_cpu(cqicb->addr)); 1711 (unsigned long long) le64_to_cpu(cqicb->addr));
1867 printk(KERN_ERR PFX "cqicb->prod_idx_addr = 0x%llx.\n", 1712 pr_err("cqicb->prod_idx_addr = 0x%llx\n",
1868 (unsigned long long) le64_to_cpu(cqicb->prod_idx_addr)); 1713 (unsigned long long) le64_to_cpu(cqicb->prod_idx_addr));
1869 printk(KERN_ERR PFX "cqicb->pkt_delay = 0x%.04x.\n", 1714 pr_err("cqicb->pkt_delay = 0x%.04x\n",
1870 le16_to_cpu(cqicb->pkt_delay)); 1715 le16_to_cpu(cqicb->pkt_delay));
1871 printk(KERN_ERR PFX "cqicb->irq_delay = 0x%.04x.\n", 1716 pr_err("cqicb->irq_delay = 0x%.04x\n",
1872 le16_to_cpu(cqicb->irq_delay)); 1717 le16_to_cpu(cqicb->irq_delay));
1873 printk(KERN_ERR PFX "cqicb->lbq_addr = 0x%llx.\n", 1718 pr_err("cqicb->lbq_addr = 0x%llx\n",
1874 (unsigned long long) le64_to_cpu(cqicb->lbq_addr)); 1719 (unsigned long long) le64_to_cpu(cqicb->lbq_addr));
1875 printk(KERN_ERR PFX "cqicb->lbq_buf_size = 0x%.04x.\n", 1720 pr_err("cqicb->lbq_buf_size = 0x%.04x\n",
1876 le16_to_cpu(cqicb->lbq_buf_size)); 1721 le16_to_cpu(cqicb->lbq_buf_size));
1877 printk(KERN_ERR PFX "cqicb->lbq_len = 0x%.04x.\n", 1722 pr_err("cqicb->lbq_len = 0x%.04x\n",
1878 le16_to_cpu(cqicb->lbq_len)); 1723 le16_to_cpu(cqicb->lbq_len));
1879 printk(KERN_ERR PFX "cqicb->sbq_addr = 0x%llx.\n", 1724 pr_err("cqicb->sbq_addr = 0x%llx\n",
1880 (unsigned long long) le64_to_cpu(cqicb->sbq_addr)); 1725 (unsigned long long) le64_to_cpu(cqicb->sbq_addr));
1881 printk(KERN_ERR PFX "cqicb->sbq_buf_size = 0x%.04x.\n", 1726 pr_err("cqicb->sbq_buf_size = 0x%.04x\n",
1882 le16_to_cpu(cqicb->sbq_buf_size)); 1727 le16_to_cpu(cqicb->sbq_buf_size));
1883 printk(KERN_ERR PFX "cqicb->sbq_len = 0x%.04x.\n", 1728 pr_err("cqicb->sbq_len = 0x%.04x\n",
1884 le16_to_cpu(cqicb->sbq_len)); 1729 le16_to_cpu(cqicb->sbq_len));
1885} 1730}
1886 1731
@@ -1888,100 +1733,85 @@ void ql_dump_rx_ring(struct rx_ring *rx_ring)
1888{ 1733{
1889 if (rx_ring == NULL) 1734 if (rx_ring == NULL)
1890 return; 1735 return;
1891 printk(KERN_ERR PFX 1736 pr_err("===================== Dumping rx_ring %d ===============\n",
1892 "===================== Dumping rx_ring %d ===============.\n",
1893 rx_ring->cq_id); 1737 rx_ring->cq_id);
1894 printk(KERN_ERR PFX "Dumping rx_ring %d, type = %s%s%s.\n", 1738 pr_err("Dumping rx_ring %d, type = %s%s%s\n",
1895 rx_ring->cq_id, rx_ring->type == DEFAULT_Q ? "DEFAULT" : "", 1739 rx_ring->cq_id, rx_ring->type == DEFAULT_Q ? "DEFAULT" : "",
1896 rx_ring->type == TX_Q ? "OUTBOUND COMPLETIONS" : "", 1740 rx_ring->type == TX_Q ? "OUTBOUND COMPLETIONS" : "",
1897 rx_ring->type == RX_Q ? "INBOUND_COMPLETIONS" : ""); 1741 rx_ring->type == RX_Q ? "INBOUND_COMPLETIONS" : "");
1898 printk(KERN_ERR PFX "rx_ring->cqicb = %p.\n", &rx_ring->cqicb); 1742 pr_err("rx_ring->cqicb = %p\n", &rx_ring->cqicb);
1899 printk(KERN_ERR PFX "rx_ring->cq_base = %p.\n", rx_ring->cq_base); 1743 pr_err("rx_ring->cq_base = %p\n", rx_ring->cq_base);
1900 printk(KERN_ERR PFX "rx_ring->cq_base_dma = %llx.\n", 1744 pr_err("rx_ring->cq_base_dma = %llx\n",
1901 (unsigned long long) rx_ring->cq_base_dma); 1745 (unsigned long long) rx_ring->cq_base_dma);
1902 printk(KERN_ERR PFX "rx_ring->cq_size = %d.\n", rx_ring->cq_size); 1746 pr_err("rx_ring->cq_size = %d\n", rx_ring->cq_size);
1903 printk(KERN_ERR PFX "rx_ring->cq_len = %d.\n", rx_ring->cq_len); 1747 pr_err("rx_ring->cq_len = %d\n", rx_ring->cq_len);
1904 printk(KERN_ERR PFX 1748 pr_err("rx_ring->prod_idx_sh_reg, addr = 0x%p, value = %d\n",
1905 "rx_ring->prod_idx_sh_reg, addr = 0x%p, value = %d.\n",
1906 rx_ring->prod_idx_sh_reg, 1749 rx_ring->prod_idx_sh_reg,
1907 rx_ring->prod_idx_sh_reg 1750 rx_ring->prod_idx_sh_reg
1908 ? ql_read_sh_reg(rx_ring->prod_idx_sh_reg) : 0); 1751 ? ql_read_sh_reg(rx_ring->prod_idx_sh_reg) : 0);
1909 printk(KERN_ERR PFX "rx_ring->prod_idx_sh_reg_dma = %llx.\n", 1752 pr_err("rx_ring->prod_idx_sh_reg_dma = %llx\n",
1910 (unsigned long long) rx_ring->prod_idx_sh_reg_dma); 1753 (unsigned long long) rx_ring->prod_idx_sh_reg_dma);
1911 printk(KERN_ERR PFX "rx_ring->cnsmr_idx_db_reg = %p.\n", 1754 pr_err("rx_ring->cnsmr_idx_db_reg = %p\n",
1912 rx_ring->cnsmr_idx_db_reg); 1755 rx_ring->cnsmr_idx_db_reg);
1913 printk(KERN_ERR PFX "rx_ring->cnsmr_idx = %d.\n", rx_ring->cnsmr_idx); 1756 pr_err("rx_ring->cnsmr_idx = %d\n", rx_ring->cnsmr_idx);
1914 printk(KERN_ERR PFX "rx_ring->curr_entry = %p.\n", rx_ring->curr_entry); 1757 pr_err("rx_ring->curr_entry = %p\n", rx_ring->curr_entry);
1915 printk(KERN_ERR PFX "rx_ring->valid_db_reg = %p.\n", 1758 pr_err("rx_ring->valid_db_reg = %p\n", rx_ring->valid_db_reg);
1916 rx_ring->valid_db_reg);
1917 1759
1918 printk(KERN_ERR PFX "rx_ring->lbq_base = %p.\n", rx_ring->lbq_base); 1760 pr_err("rx_ring->lbq_base = %p\n", rx_ring->lbq_base);
1919 printk(KERN_ERR PFX "rx_ring->lbq_base_dma = %llx.\n", 1761 pr_err("rx_ring->lbq_base_dma = %llx\n",
1920 (unsigned long long) rx_ring->lbq_base_dma); 1762 (unsigned long long) rx_ring->lbq_base_dma);
1921 printk(KERN_ERR PFX "rx_ring->lbq_base_indirect = %p.\n", 1763 pr_err("rx_ring->lbq_base_indirect = %p\n",
1922 rx_ring->lbq_base_indirect); 1764 rx_ring->lbq_base_indirect);
1923 printk(KERN_ERR PFX "rx_ring->lbq_base_indirect_dma = %llx.\n", 1765 pr_err("rx_ring->lbq_base_indirect_dma = %llx\n",
1924 (unsigned long long) rx_ring->lbq_base_indirect_dma); 1766 (unsigned long long) rx_ring->lbq_base_indirect_dma);
1925 printk(KERN_ERR PFX "rx_ring->lbq = %p.\n", rx_ring->lbq); 1767 pr_err("rx_ring->lbq = %p\n", rx_ring->lbq);
1926 printk(KERN_ERR PFX "rx_ring->lbq_len = %d.\n", rx_ring->lbq_len); 1768 pr_err("rx_ring->lbq_len = %d\n", rx_ring->lbq_len);
1927 printk(KERN_ERR PFX "rx_ring->lbq_size = %d.\n", rx_ring->lbq_size); 1769 pr_err("rx_ring->lbq_size = %d\n", rx_ring->lbq_size);
1928 printk(KERN_ERR PFX "rx_ring->lbq_prod_idx_db_reg = %p.\n", 1770 pr_err("rx_ring->lbq_prod_idx_db_reg = %p\n",
1929 rx_ring->lbq_prod_idx_db_reg); 1771 rx_ring->lbq_prod_idx_db_reg);
1930 printk(KERN_ERR PFX "rx_ring->lbq_prod_idx = %d.\n", 1772 pr_err("rx_ring->lbq_prod_idx = %d\n", rx_ring->lbq_prod_idx);
1931 rx_ring->lbq_prod_idx); 1773 pr_err("rx_ring->lbq_curr_idx = %d\n", rx_ring->lbq_curr_idx);
1932 printk(KERN_ERR PFX "rx_ring->lbq_curr_idx = %d.\n", 1774 pr_err("rx_ring->lbq_clean_idx = %d\n", rx_ring->lbq_clean_idx);
1933 rx_ring->lbq_curr_idx); 1775 pr_err("rx_ring->lbq_free_cnt = %d\n", rx_ring->lbq_free_cnt);
1934 printk(KERN_ERR PFX "rx_ring->lbq_clean_idx = %d.\n", 1776 pr_err("rx_ring->lbq_buf_size = %d\n", rx_ring->lbq_buf_size);
1935 rx_ring->lbq_clean_idx); 1777
1936 printk(KERN_ERR PFX "rx_ring->lbq_free_cnt = %d.\n", 1778 pr_err("rx_ring->sbq_base = %p\n", rx_ring->sbq_base);
1937 rx_ring->lbq_free_cnt); 1779 pr_err("rx_ring->sbq_base_dma = %llx\n",
1938 printk(KERN_ERR PFX "rx_ring->lbq_buf_size = %d.\n",
1939 rx_ring->lbq_buf_size);
1940
1941 printk(KERN_ERR PFX "rx_ring->sbq_base = %p.\n", rx_ring->sbq_base);
1942 printk(KERN_ERR PFX "rx_ring->sbq_base_dma = %llx.\n",
1943 (unsigned long long) rx_ring->sbq_base_dma); 1780 (unsigned long long) rx_ring->sbq_base_dma);
1944 printk(KERN_ERR PFX "rx_ring->sbq_base_indirect = %p.\n", 1781 pr_err("rx_ring->sbq_base_indirect = %p\n",
1945 rx_ring->sbq_base_indirect); 1782 rx_ring->sbq_base_indirect);
1946 printk(KERN_ERR PFX "rx_ring->sbq_base_indirect_dma = %llx.\n", 1783 pr_err("rx_ring->sbq_base_indirect_dma = %llx\n",
1947 (unsigned long long) rx_ring->sbq_base_indirect_dma); 1784 (unsigned long long) rx_ring->sbq_base_indirect_dma);
1948 printk(KERN_ERR PFX "rx_ring->sbq = %p.\n", rx_ring->sbq); 1785 pr_err("rx_ring->sbq = %p\n", rx_ring->sbq);
1949 printk(KERN_ERR PFX "rx_ring->sbq_len = %d.\n", rx_ring->sbq_len); 1786 pr_err("rx_ring->sbq_len = %d\n", rx_ring->sbq_len);
1950 printk(KERN_ERR PFX "rx_ring->sbq_size = %d.\n", rx_ring->sbq_size); 1787 pr_err("rx_ring->sbq_size = %d\n", rx_ring->sbq_size);
1951 printk(KERN_ERR PFX "rx_ring->sbq_prod_idx_db_reg addr = %p.\n", 1788 pr_err("rx_ring->sbq_prod_idx_db_reg addr = %p\n",
1952 rx_ring->sbq_prod_idx_db_reg); 1789 rx_ring->sbq_prod_idx_db_reg);
1953 printk(KERN_ERR PFX "rx_ring->sbq_prod_idx = %d.\n", 1790 pr_err("rx_ring->sbq_prod_idx = %d\n", rx_ring->sbq_prod_idx);
1954 rx_ring->sbq_prod_idx); 1791 pr_err("rx_ring->sbq_curr_idx = %d\n", rx_ring->sbq_curr_idx);
1955 printk(KERN_ERR PFX "rx_ring->sbq_curr_idx = %d.\n", 1792 pr_err("rx_ring->sbq_clean_idx = %d\n", rx_ring->sbq_clean_idx);
1956 rx_ring->sbq_curr_idx); 1793 pr_err("rx_ring->sbq_free_cnt = %d\n", rx_ring->sbq_free_cnt);
1957 printk(KERN_ERR PFX "rx_ring->sbq_clean_idx = %d.\n", 1794 pr_err("rx_ring->sbq_buf_size = %d\n", rx_ring->sbq_buf_size);
1958 rx_ring->sbq_clean_idx); 1795 pr_err("rx_ring->cq_id = %d\n", rx_ring->cq_id);
1959 printk(KERN_ERR PFX "rx_ring->sbq_free_cnt = %d.\n", 1796 pr_err("rx_ring->irq = %d\n", rx_ring->irq);
1960 rx_ring->sbq_free_cnt); 1797 pr_err("rx_ring->cpu = %d\n", rx_ring->cpu);
1961 printk(KERN_ERR PFX "rx_ring->sbq_buf_size = %d.\n", 1798 pr_err("rx_ring->qdev = %p\n", rx_ring->qdev);
1962 rx_ring->sbq_buf_size);
1963 printk(KERN_ERR PFX "rx_ring->cq_id = %d.\n", rx_ring->cq_id);
1964 printk(KERN_ERR PFX "rx_ring->irq = %d.\n", rx_ring->irq);
1965 printk(KERN_ERR PFX "rx_ring->cpu = %d.\n", rx_ring->cpu);
1966 printk(KERN_ERR PFX "rx_ring->qdev = %p.\n", rx_ring->qdev);
1967} 1799}
1968 1800
1969void ql_dump_hw_cb(struct ql_adapter *qdev, int size, u32 bit, u16 q_id) 1801void ql_dump_hw_cb(struct ql_adapter *qdev, int size, u32 bit, u16 q_id)
1970{ 1802{
1971 void *ptr; 1803 void *ptr;
1972 1804
1973 printk(KERN_ERR PFX "%s: Enter.\n", __func__); 1805 pr_err("%s: Enter\n", __func__);
1974 1806
1975 ptr = kmalloc(size, GFP_ATOMIC); 1807 ptr = kmalloc(size, GFP_ATOMIC);
1976 if (ptr == NULL) { 1808 if (ptr == NULL) {
1977 printk(KERN_ERR PFX "%s: Couldn't allocate a buffer.\n", 1809 pr_err("%s: Couldn't allocate a buffer\n", __func__);
1978 __func__);
1979 return; 1810 return;
1980 } 1811 }
1981 1812
1982 if (ql_write_cfg(qdev, ptr, size, bit, q_id)) { 1813 if (ql_write_cfg(qdev, ptr, size, bit, q_id)) {
1983 printk(KERN_ERR "%s: Failed to upload control block!\n", 1814 pr_err("%s: Failed to upload control block!\n", __func__);
1984 __func__);
1985 goto fail_it; 1815 goto fail_it;
1986 } 1816 }
1987 switch (bit) { 1817 switch (bit) {
@@ -1995,8 +1825,7 @@ void ql_dump_hw_cb(struct ql_adapter *qdev, int size, u32 bit, u16 q_id)
1995 ql_dump_ricb((struct ricb *)ptr); 1825 ql_dump_ricb((struct ricb *)ptr);
1996 break; 1826 break;
1997 default: 1827 default:
1998 printk(KERN_ERR PFX "%s: Invalid bit value = %x.\n", 1828 pr_err("%s: Invalid bit value = %x\n", __func__, bit);
1999 __func__, bit);
2000 break; 1829 break;
2001 } 1830 }
2002fail_it: 1831fail_it:
@@ -2007,27 +1836,27 @@ fail_it:
2007#ifdef QL_OB_DUMP 1836#ifdef QL_OB_DUMP
2008void ql_dump_tx_desc(struct tx_buf_desc *tbd) 1837void ql_dump_tx_desc(struct tx_buf_desc *tbd)
2009{ 1838{
2010 printk(KERN_ERR PFX "tbd->addr = 0x%llx\n", 1839 pr_err("tbd->addr = 0x%llx\n",
2011 le64_to_cpu((u64) tbd->addr)); 1840 le64_to_cpu((u64) tbd->addr));
2012 printk(KERN_ERR PFX "tbd->len = %d\n", 1841 pr_err("tbd->len = %d\n",
2013 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK)); 1842 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK));
2014 printk(KERN_ERR PFX "tbd->flags = %s %s\n", 1843 pr_err("tbd->flags = %s %s\n",
2015 tbd->len & TX_DESC_C ? "C" : ".", 1844 tbd->len & TX_DESC_C ? "C" : ".",
2016 tbd->len & TX_DESC_E ? "E" : "."); 1845 tbd->len & TX_DESC_E ? "E" : ".");
2017 tbd++; 1846 tbd++;
2018 printk(KERN_ERR PFX "tbd->addr = 0x%llx\n", 1847 pr_err("tbd->addr = 0x%llx\n",
2019 le64_to_cpu((u64) tbd->addr)); 1848 le64_to_cpu((u64) tbd->addr));
2020 printk(KERN_ERR PFX "tbd->len = %d\n", 1849 pr_err("tbd->len = %d\n",
2021 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK)); 1850 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK));
2022 printk(KERN_ERR PFX "tbd->flags = %s %s\n", 1851 pr_err("tbd->flags = %s %s\n",
2023 tbd->len & TX_DESC_C ? "C" : ".", 1852 tbd->len & TX_DESC_C ? "C" : ".",
2024 tbd->len & TX_DESC_E ? "E" : "."); 1853 tbd->len & TX_DESC_E ? "E" : ".");
2025 tbd++; 1854 tbd++;
2026 printk(KERN_ERR PFX "tbd->addr = 0x%llx\n", 1855 pr_err("tbd->addr = 0x%llx\n",
2027 le64_to_cpu((u64) tbd->addr)); 1856 le64_to_cpu((u64) tbd->addr));
2028 printk(KERN_ERR PFX "tbd->len = %d\n", 1857 pr_err("tbd->len = %d\n",
2029 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK)); 1858 le32_to_cpu(tbd->len & TX_DESC_LEN_MASK));
2030 printk(KERN_ERR PFX "tbd->flags = %s %s\n", 1859 pr_err("tbd->flags = %s %s\n",
2031 tbd->len & TX_DESC_C ? "C" : ".", 1860 tbd->len & TX_DESC_C ? "C" : ".",
2032 tbd->len & TX_DESC_E ? "E" : "."); 1861 tbd->len & TX_DESC_E ? "E" : ".");
2033 1862
@@ -2040,38 +1869,38 @@ void ql_dump_ob_mac_iocb(struct ob_mac_iocb_req *ob_mac_iocb)
2040 struct tx_buf_desc *tbd; 1869 struct tx_buf_desc *tbd;
2041 u16 frame_len; 1870 u16 frame_len;
2042 1871
2043 printk(KERN_ERR PFX "%s\n", __func__); 1872 pr_err("%s\n", __func__);
2044 printk(KERN_ERR PFX "opcode = %s\n", 1873 pr_err("opcode = %s\n",
2045 (ob_mac_iocb->opcode == OPCODE_OB_MAC_IOCB) ? "MAC" : "TSO"); 1874 (ob_mac_iocb->opcode == OPCODE_OB_MAC_IOCB) ? "MAC" : "TSO");
2046 printk(KERN_ERR PFX "flags1 = %s %s %s %s %s\n", 1875 pr_err("flags1 = %s %s %s %s %s\n",
2047 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_OI ? "OI" : "", 1876 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_OI ? "OI" : "",
2048 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_I ? "I" : "", 1877 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_I ? "I" : "",
2049 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_D ? "D" : "", 1878 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_D ? "D" : "",
2050 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_IP4 ? "IP4" : "", 1879 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_IP4 ? "IP4" : "",
2051 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_IP6 ? "IP6" : ""); 1880 ob_mac_tso_iocb->flags1 & OB_MAC_TSO_IOCB_IP6 ? "IP6" : "");
2052 printk(KERN_ERR PFX "flags2 = %s %s %s\n", 1881 pr_err("flags2 = %s %s %s\n",
2053 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_LSO ? "LSO" : "", 1882 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_LSO ? "LSO" : "",
2054 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_UC ? "UC" : "", 1883 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_UC ? "UC" : "",
2055 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_TC ? "TC" : ""); 1884 ob_mac_tso_iocb->flags2 & OB_MAC_TSO_IOCB_TC ? "TC" : "");
2056 printk(KERN_ERR PFX "flags3 = %s %s %s\n", 1885 pr_err("flags3 = %s %s %s\n",
2057 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_IC ? "IC" : "", 1886 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_IC ? "IC" : "",
2058 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_DFP ? "DFP" : "", 1887 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_DFP ? "DFP" : "",
2059 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_V ? "V" : ""); 1888 ob_mac_tso_iocb->flags3 & OB_MAC_TSO_IOCB_V ? "V" : "");
2060 printk(KERN_ERR PFX "tid = %x\n", ob_mac_iocb->tid); 1889 pr_err("tid = %x\n", ob_mac_iocb->tid);
2061 printk(KERN_ERR PFX "txq_idx = %d\n", ob_mac_iocb->txq_idx); 1890 pr_err("txq_idx = %d\n", ob_mac_iocb->txq_idx);
2062 printk(KERN_ERR PFX "vlan_tci = %x\n", ob_mac_tso_iocb->vlan_tci); 1891 pr_err("vlan_tci = %x\n", ob_mac_tso_iocb->vlan_tci);
2063 if (ob_mac_iocb->opcode == OPCODE_OB_MAC_TSO_IOCB) { 1892 if (ob_mac_iocb->opcode == OPCODE_OB_MAC_TSO_IOCB) {
2064 printk(KERN_ERR PFX "frame_len = %d\n", 1893 pr_err("frame_len = %d\n",
2065 le32_to_cpu(ob_mac_tso_iocb->frame_len)); 1894 le32_to_cpu(ob_mac_tso_iocb->frame_len));
2066 printk(KERN_ERR PFX "mss = %d\n", 1895 pr_err("mss = %d\n",
2067 le16_to_cpu(ob_mac_tso_iocb->mss)); 1896 le16_to_cpu(ob_mac_tso_iocb->mss));
2068 printk(KERN_ERR PFX "prot_hdr_len = %d\n", 1897 pr_err("prot_hdr_len = %d\n",
2069 le16_to_cpu(ob_mac_tso_iocb->total_hdrs_len)); 1898 le16_to_cpu(ob_mac_tso_iocb->total_hdrs_len));
2070 printk(KERN_ERR PFX "hdr_offset = 0x%.04x\n", 1899 pr_err("hdr_offset = 0x%.04x\n",
2071 le16_to_cpu(ob_mac_tso_iocb->net_trans_offset)); 1900 le16_to_cpu(ob_mac_tso_iocb->net_trans_offset));
2072 frame_len = le32_to_cpu(ob_mac_tso_iocb->frame_len); 1901 frame_len = le32_to_cpu(ob_mac_tso_iocb->frame_len);
2073 } else { 1902 } else {
2074 printk(KERN_ERR PFX "frame_len = %d\n", 1903 pr_err("frame_len = %d\n",
2075 le16_to_cpu(ob_mac_iocb->frame_len)); 1904 le16_to_cpu(ob_mac_iocb->frame_len));
2076 frame_len = le16_to_cpu(ob_mac_iocb->frame_len); 1905 frame_len = le16_to_cpu(ob_mac_iocb->frame_len);
2077 } 1906 }
@@ -2081,9 +1910,9 @@ void ql_dump_ob_mac_iocb(struct ob_mac_iocb_req *ob_mac_iocb)
2081 1910
2082void ql_dump_ob_mac_rsp(struct ob_mac_iocb_rsp *ob_mac_rsp) 1911void ql_dump_ob_mac_rsp(struct ob_mac_iocb_rsp *ob_mac_rsp)
2083{ 1912{
2084 printk(KERN_ERR PFX "%s\n", __func__); 1913 pr_err("%s\n", __func__);
2085 printk(KERN_ERR PFX "opcode = %d\n", ob_mac_rsp->opcode); 1914 pr_err("opcode = %d\n", ob_mac_rsp->opcode);
2086 printk(KERN_ERR PFX "flags = %s %s %s %s %s %s %s\n", 1915 pr_err("flags = %s %s %s %s %s %s %s\n",
2087 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_OI ? "OI" : ".", 1916 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_OI ? "OI" : ".",
2088 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_I ? "I" : ".", 1917 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_I ? "I" : ".",
2089 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_E ? "E" : ".", 1918 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_E ? "E" : ".",
@@ -2091,16 +1920,16 @@ void ql_dump_ob_mac_rsp(struct ob_mac_iocb_rsp *ob_mac_rsp)
2091 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_L ? "L" : ".", 1920 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_L ? "L" : ".",
2092 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_P ? "P" : ".", 1921 ob_mac_rsp->flags1 & OB_MAC_IOCB_RSP_P ? "P" : ".",
2093 ob_mac_rsp->flags2 & OB_MAC_IOCB_RSP_B ? "B" : "."); 1922 ob_mac_rsp->flags2 & OB_MAC_IOCB_RSP_B ? "B" : ".");
2094 printk(KERN_ERR PFX "tid = %x\n", ob_mac_rsp->tid); 1923 pr_err("tid = %x\n", ob_mac_rsp->tid);
2095} 1924}
2096#endif 1925#endif
2097 1926
2098#ifdef QL_IB_DUMP 1927#ifdef QL_IB_DUMP
2099void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp) 1928void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp)
2100{ 1929{
2101 printk(KERN_ERR PFX "%s\n", __func__); 1930 pr_err("%s\n", __func__);
2102 printk(KERN_ERR PFX "opcode = 0x%x\n", ib_mac_rsp->opcode); 1931 pr_err("opcode = 0x%x\n", ib_mac_rsp->opcode);
2103 printk(KERN_ERR PFX "flags1 = %s%s%s%s%s%s\n", 1932 pr_err("flags1 = %s%s%s%s%s%s\n",
2104 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_OI ? "OI " : "", 1933 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_OI ? "OI " : "",
2105 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_I ? "I " : "", 1934 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_I ? "I " : "",
2106 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_TE ? "TE " : "", 1935 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_TE ? "TE " : "",
@@ -2109,7 +1938,7 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp)
2109 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_B ? "B " : ""); 1938 ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_B ? "B " : "");
2110 1939
2111 if (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) 1940 if (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK)
2112 printk(KERN_ERR PFX "%s%s%s Multicast.\n", 1941 pr_err("%s%s%s Multicast\n",
2113 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) == 1942 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) ==
2114 IB_MAC_IOCB_RSP_M_HASH ? "Hash" : "", 1943 IB_MAC_IOCB_RSP_M_HASH ? "Hash" : "",
2115 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) == 1944 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) ==
@@ -2117,7 +1946,7 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp)
2117 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) == 1946 (ib_mac_rsp->flags1 & IB_MAC_IOCB_RSP_M_MASK) ==
2118 IB_MAC_IOCB_RSP_M_PROM ? "Promiscuous" : ""); 1947 IB_MAC_IOCB_RSP_M_PROM ? "Promiscuous" : "");
2119 1948
2120 printk(KERN_ERR PFX "flags2 = %s%s%s%s%s\n", 1949 pr_err("flags2 = %s%s%s%s%s\n",
2121 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_P) ? "P " : "", 1950 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_P) ? "P " : "",
2122 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V) ? "V " : "", 1951 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V) ? "V " : "",
2123 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_U) ? "U " : "", 1952 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_U) ? "U " : "",
@@ -2125,7 +1954,7 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp)
2125 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_FO) ? "FO " : ""); 1954 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_FO) ? "FO " : "");
2126 1955
2127 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) 1956 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK)
2128 printk(KERN_ERR PFX "%s%s%s%s%s error.\n", 1957 pr_err("%s%s%s%s%s error\n",
2129 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) == 1958 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) ==
2130 IB_MAC_IOCB_RSP_ERR_OVERSIZE ? "oversize" : "", 1959 IB_MAC_IOCB_RSP_ERR_OVERSIZE ? "oversize" : "",
2131 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) == 1960 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) ==
@@ -2137,12 +1966,12 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp)
2137 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) == 1966 (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_ERR_MASK) ==
2138 IB_MAC_IOCB_RSP_ERR_CRC ? "CRC" : ""); 1967 IB_MAC_IOCB_RSP_ERR_CRC ? "CRC" : "");
2139 1968
2140 printk(KERN_ERR PFX "flags3 = %s%s.\n", 1969 pr_err("flags3 = %s%s\n",
2141 ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_DS ? "DS " : "", 1970 ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_DS ? "DS " : "",
2142 ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_DL ? "DL " : ""); 1971 ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_DL ? "DL " : "");
2143 1972
2144 if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) 1973 if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK)
2145 printk(KERN_ERR PFX "RSS flags = %s%s%s%s.\n", 1974 pr_err("RSS flags = %s%s%s%s\n",
2146 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) == 1975 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) ==
2147 IB_MAC_IOCB_RSP_M_IPV4) ? "IPv4 RSS" : "", 1976 IB_MAC_IOCB_RSP_M_IPV4) ? "IPv4 RSS" : "",
2148 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) == 1977 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) ==
@@ -2152,26 +1981,26 @@ void ql_dump_ib_mac_rsp(struct ib_mac_iocb_rsp *ib_mac_rsp)
2152 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) == 1981 ((ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) ==
2153 IB_MAC_IOCB_RSP_M_TCP_V6) ? "TCP/IPv6 RSS" : ""); 1982 IB_MAC_IOCB_RSP_M_TCP_V6) ? "TCP/IPv6 RSS" : "");
2154 1983
2155 printk(KERN_ERR PFX "data_len = %d\n", 1984 pr_err("data_len = %d\n",
2156 le32_to_cpu(ib_mac_rsp->data_len)); 1985 le32_to_cpu(ib_mac_rsp->data_len));
2157 printk(KERN_ERR PFX "data_addr = 0x%llx\n", 1986 pr_err("data_addr = 0x%llx\n",
2158 (unsigned long long) le64_to_cpu(ib_mac_rsp->data_addr)); 1987 (unsigned long long) le64_to_cpu(ib_mac_rsp->data_addr));
2159 if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK) 1988 if (ib_mac_rsp->flags3 & IB_MAC_IOCB_RSP_RSS_MASK)
2160 printk(KERN_ERR PFX "rss = %x\n", 1989 pr_err("rss = %x\n",
2161 le32_to_cpu(ib_mac_rsp->rss)); 1990 le32_to_cpu(ib_mac_rsp->rss));
2162 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V) 1991 if (ib_mac_rsp->flags2 & IB_MAC_IOCB_RSP_V)
2163 printk(KERN_ERR PFX "vlan_id = %x\n", 1992 pr_err("vlan_id = %x\n",
2164 le16_to_cpu(ib_mac_rsp->vlan_id)); 1993 le16_to_cpu(ib_mac_rsp->vlan_id));
2165 1994
2166 printk(KERN_ERR PFX "flags4 = %s%s%s.\n", 1995 pr_err("flags4 = %s%s%s\n",
2167 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV ? "HV " : "", 1996 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV ? "HV " : "",
2168 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HS ? "HS " : "", 1997 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HS ? "HS " : "",
2169 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HL ? "HL " : ""); 1998 ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HL ? "HL " : "");
2170 1999
2171 if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) { 2000 if (ib_mac_rsp->flags4 & IB_MAC_IOCB_RSP_HV) {
2172 printk(KERN_ERR PFX "hdr length = %d.\n", 2001 pr_err("hdr length = %d\n",
2173 le32_to_cpu(ib_mac_rsp->hdr_len)); 2002 le32_to_cpu(ib_mac_rsp->hdr_len));
2174 printk(KERN_ERR PFX "hdr addr = 0x%llx.\n", 2003 pr_err("hdr addr = 0x%llx\n",
2175 (unsigned long long) le64_to_cpu(ib_mac_rsp->hdr_addr)); 2004 (unsigned long long) le64_to_cpu(ib_mac_rsp->hdr_addr));
2176 } 2005 }
2177} 2006}