aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/qlge/qlge_dbg.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c
index 833cfd7a22c1..181281390129 100644
--- a/drivers/net/qlge/qlge_dbg.c
+++ b/drivers/net/qlge/qlge_dbg.c
@@ -1,5 +1,23 @@
1#include "qlge.h" 1#include "qlge.h"
2 2
3/* Read a NIC register from the alternate function. */
4static u32 ql_read_other_func_reg(struct ql_adapter *qdev,
5 u32 reg)
6{
7 u32 register_to_read;
8 u32 reg_val;
9 unsigned int status = 0;
10
11 register_to_read = MPI_NIC_REG_BLOCK
12 | MPI_NIC_READ
13 | (qdev->alt_func << MPI_NIC_FUNCTION_SHIFT)
14 | reg;
15 status = ql_read_mpi_reg(qdev, register_to_read, &reg_val);
16 if (status != 0)
17 return 0xffffffff;
18
19 return reg_val;
20}
3 21
4static int ql_get_ets_regs(struct ql_adapter *qdev, u32 * buf) 22static int ql_get_ets_regs(struct ql_adapter *qdev, u32 * buf)
5{ 23{
@@ -371,16 +389,28 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump)
371 sizeof(struct mpi_coredump_segment_header) + 389 sizeof(struct mpi_coredump_segment_header) +
372 sizeof(mpi_coredump->nic_regs), "NIC1 Registers"); 390 sizeof(mpi_coredump->nic_regs), "NIC1 Registers");
373 391
392 ql_build_coredump_seg_header(&mpi_coredump->nic2_regs_seg_hdr,
393 NIC2_CONTROL_SEG_NUM,
394 sizeof(struct mpi_coredump_segment_header) +
395 sizeof(mpi_coredump->nic2_regs), "NIC2 Registers");
396
374 if (qdev->func & 1) { 397 if (qdev->func & 1) {
375 /* Odd means our function is NIC 2 */ 398 /* Odd means our function is NIC 2 */
376 for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) 399 for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++)
377 mpi_coredump->nic2_regs[i] = 400 mpi_coredump->nic2_regs[i] =
378 ql_read32(qdev, i * sizeof(u32)); 401 ql_read32(qdev, i * sizeof(u32));
402
403 for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++)
404 mpi_coredump->nic_regs[i] =
405 ql_read_other_func_reg(qdev, (i * sizeof(u32)) / 4);
379 } else { 406 } else {
380 /* Even means our function is NIC 1 */ 407 /* Even means our function is NIC 1 */
381 for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) 408 for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++)
382 mpi_coredump->nic_regs[i] = 409 mpi_coredump->nic_regs[i] =
383 ql_read32(qdev, i * sizeof(u32)); 410 ql_read32(qdev, i * sizeof(u32));
411 for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++)
412 mpi_coredump->nic2_regs[i] =
413 ql_read_other_func_reg(qdev, (i * sizeof(u32)) / 4);
384 } 414 }
385 415
386 ql_build_coredump_seg_header(&mpi_coredump->core_regs_seg_hdr, 416 ql_build_coredump_seg_header(&mpi_coredump->core_regs_seg_hdr,