diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2010-01-15 08:31:34 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-01-16 04:01:55 -0500 |
commit | d5c1da56afb8a6b232393fb3fdef4909389d05fe (patch) | |
tree | 93da1e713ba6b43150da47fc75306ddeb0f440dc /drivers/net/qlge/qlge_dbg.c | |
parent | a2f982328427157eaa819c02986a65b9b168733a (diff) |
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.c | 25 |
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: | |||
1222 | 1222 | ||
1223 | } | 1223 | } |
1224 | 1224 | ||
1225 | static void ql_get_core_dump(struct ql_adapter *qdev) | ||
1226 | { | ||
1227 | if (!ql_own_firmware(qdev)) { | ||
1228 | QPRINTK(qdev, DRV, ERR, "%s: Don't own firmware!\n", | ||
1229 | qdev->ndev->name); | ||
1230 | return; | ||
1231 | } | ||
1232 | |||
1233 | if (!netif_running(qdev->ndev)) { | ||
1234 | QPRINTK(qdev, IFUP, ERR, | ||
1235 | "Force Coredump can only be done from interface " | ||
1236 | "that is up.\n"); | ||
1237 | return; | ||
1238 | } | ||
1239 | |||
1240 | if (ql_mb_sys_err(qdev)) { | ||
1241 | QPRINTK(qdev, IFUP, ERR, | ||
1242 | "Fail force coredump with ql_mb_sys_err().\n"); | ||
1243 | return; | ||
1244 | } | ||
1245 | } | ||
1246 | |||
1225 | void ql_gen_reg_dump(struct ql_adapter *qdev, | 1247 | void ql_gen_reg_dump(struct ql_adapter *qdev, |
1226 | struct ql_reg_dump *mpi_coredump) | 1248 | struct ql_reg_dump *mpi_coredump) |
1227 | { | 1249 | { |
@@ -1297,6 +1319,9 @@ void ql_gen_reg_dump(struct ql_adapter *qdev, | |||
1297 | status = ql_get_ets_regs(qdev, &mpi_coredump->ets[0]); | 1319 | status = ql_get_ets_regs(qdev, &mpi_coredump->ets[0]); |
1298 | if (status) | 1320 | if (status) |
1299 | return; | 1321 | return; |
1322 | |||
1323 | if (test_bit(QL_FRC_COREDUMP, &qdev->flags)) | ||
1324 | ql_get_core_dump(qdev); | ||
1300 | } | 1325 | } |
1301 | 1326 | ||
1302 | /* Coredump to messages log file using separate worker thread */ | 1327 | /* Coredump to messages log file using separate worker thread */ |