diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2010-01-15 08:31:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-16 04:01:55 -0500 |
commit | a2f982328427157eaa819c02986a65b9b168733a (patch) | |
tree | 8d857ab1ab2ca325575d6ef06dab28f804b9a882 /drivers/net/qlge | |
parent | a48c86fdb1253f36167bab1fc30a51211d49a901 (diff) |
qlge: Add xgmac reg blocks to firwmare dump.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge')
-rw-r--r-- | drivers/net/qlge/qlge_dbg.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c index 87e50d9c3350..ec4349a254cc 100644 --- a/drivers/net/qlge/qlge_dbg.c +++ b/drivers/net/qlge/qlge_dbg.c | |||
@@ -331,6 +331,76 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, | |||
331 | return 0; | 331 | return 0; |
332 | } | 332 | } |
333 | 333 | ||
334 | static int ql_read_other_func_xgmac_reg(struct ql_adapter *qdev, u32 reg, | ||
335 | u32 *data) | ||
336 | { | ||
337 | int status = 0; | ||
338 | |||
339 | /* wait for reg to come ready */ | ||
340 | status = ql_wait_other_func_reg_rdy(qdev, XGMAC_ADDR / 4, | ||
341 | XGMAC_ADDR_RDY, XGMAC_ADDR_XME); | ||
342 | if (status) | ||
343 | goto exit; | ||
344 | |||
345 | /* set up for reg read */ | ||
346 | ql_write_other_func_reg(qdev, XGMAC_ADDR / 4, reg | XGMAC_ADDR_R); | ||
347 | |||
348 | /* wait for reg to come ready */ | ||
349 | status = ql_wait_other_func_reg_rdy(qdev, XGMAC_ADDR / 4, | ||
350 | XGMAC_ADDR_RDY, XGMAC_ADDR_XME); | ||
351 | if (status) | ||
352 | goto exit; | ||
353 | |||
354 | /* get the data */ | ||
355 | *data = ql_read_other_func_reg(qdev, XGMAC_DATA / 4); | ||
356 | exit: | ||
357 | return status; | ||
358 | } | ||
359 | |||
360 | /* Read the 400 xgmac control/statistics registers | ||
361 | * skipping unused locations. | ||
362 | */ | ||
363 | static int ql_get_xgmac_regs(struct ql_adapter *qdev, u32 * buf, | ||
364 | unsigned int other_function) | ||
365 | { | ||
366 | int status = 0; | ||
367 | int i; | ||
368 | |||
369 | for (i = PAUSE_SRC_LO; i < XGMAC_REGISTER_END; i += 4, buf++) { | ||
370 | /* We're reading 400 xgmac registers, but we filter out | ||
371 | * serveral locations that are non-responsive to reads. | ||
372 | */ | ||
373 | if ((i == 0x00000114) || | ||
374 | (i == 0x00000118) || | ||
375 | (i == 0x0000013c) || | ||
376 | (i == 0x00000140) || | ||
377 | (i > 0x00000150 && i < 0x000001fc) || | ||
378 | (i > 0x00000278 && i < 0x000002a0) || | ||
379 | (i > 0x000002c0 && i < 0x000002cf) || | ||
380 | (i > 0x000002dc && i < 0x000002f0) || | ||
381 | (i > 0x000003c8 && i < 0x00000400) || | ||
382 | (i > 0x00000400 && i < 0x00000410) || | ||
383 | (i > 0x00000410 && i < 0x00000420) || | ||
384 | (i > 0x00000420 && i < 0x00000430) || | ||
385 | (i > 0x00000430 && i < 0x00000440) || | ||
386 | (i > 0x00000440 && i < 0x00000450) || | ||
387 | (i > 0x00000450 && i < 0x00000500) || | ||
388 | (i > 0x0000054c && i < 0x00000568) || | ||
389 | (i > 0x000005c8 && i < 0x00000600)) { | ||
390 | if (other_function) | ||
391 | status = | ||
392 | ql_read_other_func_xgmac_reg(qdev, i, buf); | ||
393 | else | ||
394 | status = ql_read_xgmac_reg(qdev, i, buf); | ||
395 | |||
396 | if (status) | ||
397 | *buf = 0xdeadbeef; | ||
398 | break; | ||
399 | } | ||
400 | } | ||
401 | return status; | ||
402 | } | ||
403 | |||
334 | static int ql_get_ets_regs(struct ql_adapter *qdev, u32 * buf) | 404 | static int ql_get_ets_regs(struct ql_adapter *qdev, u32 * buf) |
335 | { | 405 | { |
336 | int status = 0; | 406 | int status = 0; |
@@ -706,6 +776,17 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) | |||
706 | sizeof(struct mpi_coredump_segment_header) + | 776 | sizeof(struct mpi_coredump_segment_header) + |
707 | sizeof(mpi_coredump->nic2_regs), "NIC2 Registers"); | 777 | sizeof(mpi_coredump->nic2_regs), "NIC2 Registers"); |
708 | 778 | ||
779 | /* Get XGMac registers. (Segment 18, Rev C. step 21) */ | ||
780 | ql_build_coredump_seg_header(&mpi_coredump->xgmac1_seg_hdr, | ||
781 | NIC1_XGMAC_SEG_NUM, | ||
782 | sizeof(struct mpi_coredump_segment_header) + | ||
783 | sizeof(mpi_coredump->xgmac1), "NIC1 XGMac Registers"); | ||
784 | |||
785 | ql_build_coredump_seg_header(&mpi_coredump->xgmac2_seg_hdr, | ||
786 | NIC2_XGMAC_SEG_NUM, | ||
787 | sizeof(struct mpi_coredump_segment_header) + | ||
788 | sizeof(mpi_coredump->xgmac2), "NIC2 XGMac Registers"); | ||
789 | |||
709 | if (qdev->func & 1) { | 790 | if (qdev->func & 1) { |
710 | /* Odd means our function is NIC 2 */ | 791 | /* Odd means our function is NIC 2 */ |
711 | for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) | 792 | for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) |
@@ -715,6 +796,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) | |||
715 | for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) | 796 | for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) |
716 | mpi_coredump->nic_regs[i] = | 797 | mpi_coredump->nic_regs[i] = |
717 | ql_read_other_func_reg(qdev, (i * sizeof(u32)) / 4); | 798 | ql_read_other_func_reg(qdev, (i * sizeof(u32)) / 4); |
799 | |||
800 | ql_get_xgmac_regs(qdev, &mpi_coredump->xgmac2[0], 0); | ||
801 | ql_get_xgmac_regs(qdev, &mpi_coredump->xgmac1[0], 1); | ||
718 | } else { | 802 | } else { |
719 | /* Even means our function is NIC 1 */ | 803 | /* Even means our function is NIC 1 */ |
720 | for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) | 804 | for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) |
@@ -723,6 +807,9 @@ int ql_core_dump(struct ql_adapter *qdev, struct ql_mpi_coredump *mpi_coredump) | |||
723 | for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) | 807 | for (i = 0; i < NIC_REGS_DUMP_WORD_COUNT; i++) |
724 | mpi_coredump->nic2_regs[i] = | 808 | mpi_coredump->nic2_regs[i] = |
725 | ql_read_other_func_reg(qdev, (i * sizeof(u32)) / 4); | 809 | ql_read_other_func_reg(qdev, (i * sizeof(u32)) / 4); |
810 | |||
811 | ql_get_xgmac_regs(qdev, &mpi_coredump->xgmac1[0], 0); | ||
812 | ql_get_xgmac_regs(qdev, &mpi_coredump->xgmac2[0], 1); | ||
726 | } | 813 | } |
727 | 814 | ||
728 | /* Rev C. Step 20a */ | 815 | /* Rev C. Step 20a */ |