summaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge/qlge_dbg.c
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2010-01-15 13:31:34 +0000
committerDavid S. Miller <davem@davemloft.net>2010-01-16 01:01:55 -0800
commitd5c1da56afb8a6b232393fb3fdef4909389d05fe (patch)
tree93da1e713ba6b43150da47fc75306ddeb0f440dc /drivers/net/qlge/qlge_dbg.c
parenta2f982328427157eaa819c02986a65b9b168733a (diff)
downloadlinux-d5c1da56afb8a6b232393fb3fdef4909389d05fe.tar.gz
linux-d5c1da56afb8a6b232393fb3fdef4909389d05fe.tar.bz2
linux-d5c1da56afb8a6b232393fb3fdef4909389d05fe.zip
qlge: Add module param to force firmware core dump.
Default setting is 'off', don't allow force firmware 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/qlge_dbg.c')
-rw-r--r--drivers/net/qlge/qlge_dbg.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c
index ec4349a254cc..57df835147eb 100644
--- a/drivers/net/qlge/qlge_dbg.c
+++ b/drivers/net/qlge/qlge_dbg.c
@@ -1222,6 +1222,28 @@ err:
}
+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);
+ return;
+ }
+
+ if (!netif_running(qdev->ndev)) {
+ QPRINTK(qdev, IFUP, ERR,
+ "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");
+ return;
+ }
+}
+
void ql_gen_reg_dump(struct ql_adapter *qdev,
struct ql_reg_dump *mpi_coredump)
{
@@ -1297,6 +1319,9 @@ void ql_gen_reg_dump(struct ql_adapter *qdev,
status = ql_get_ets_regs(qdev, &mpi_coredump->ets[0]);
if (status)
return;
+
+ if (test_bit(QL_FRC_COREDUMP, &qdev->flags))
+ ql_get_core_dump(qdev);
}
/* Coredump to messages log file using separate worker thread */