diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2010-01-15 08:31:31 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-16 04:01:53 -0500 |
commit | 24bb55b480f16f4cd8d64c2d46e28f0c82df0409 (patch) | |
tree | d7a23d547eff359ed76df23888bede0ebf4dbc88 /drivers | |
parent | 2c1f73c3ddfd526750b003bc49a255641ac1f0ca (diff) |
qlge: Add alternate function's reg dump to fw dump.
Get the 2nd (other) nic function register values.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/qlge/qlge_dbg.c | 30 |
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. */ | ||
4 | static 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, ®_val); | ||
16 | if (status != 0) | ||
17 | return 0xffffffff; | ||
18 | |||
19 | return reg_val; | ||
20 | } | ||
3 | 21 | ||
4 | static int ql_get_ets_regs(struct ql_adapter *qdev, u32 * buf) | 22 | static 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, |