aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlge
diff options
context:
space:
mode:
authorRon Mercer <ron.mercer@qlogic.com>2010-01-15 08:31:34 -0500
committerDavid S. Miller <davem@davemloft.net>2010-01-16 04:01:55 -0500
commitd5c1da56afb8a6b232393fb3fdef4909389d05fe (patch)
tree93da1e713ba6b43150da47fc75306ddeb0f440dc /drivers/net/qlge
parenta2f982328427157eaa819c02986a65b9b168733a (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')
-rw-r--r--drivers/net/qlge/qlge.h3
-rw-r--r--drivers/net/qlge/qlge_dbg.c25
-rw-r--r--drivers/net/qlge/qlge_main.c11
-rw-r--r--drivers/net/qlge/qlge_mpi.c16
4 files changed, 53 insertions, 2 deletions
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h
index 05feb03e9da..9169c4cf413 100644
--- a/drivers/net/qlge/qlge.h
+++ b/drivers/net/qlge/qlge.h
@@ -2004,6 +2004,7 @@ enum {
2004 QL_CAM_RT_SET = 8, 2004 QL_CAM_RT_SET = 8,
2005 QL_SELFTEST = 9, 2005 QL_SELFTEST = 9,
2006 QL_LB_LINK_UP = 10, 2006 QL_LB_LINK_UP = 10,
2007 QL_FRC_COREDUMP = 11,
2007}; 2008};
2008 2009
2009/* link_status bit definitions */ 2010/* link_status bit definitions */
@@ -2230,6 +2231,7 @@ int ql_dump_risc_ram_area(struct ql_adapter *qdev, void *buf,
2230 u32 ram_addr, int word_count); 2231 u32 ram_addr, int word_count);
2231int ql_core_dump(struct ql_adapter *qdev, 2232int ql_core_dump(struct ql_adapter *qdev,
2232 struct ql_mpi_coredump *mpi_coredump); 2233 struct ql_mpi_coredump *mpi_coredump);
2234int ql_mb_sys_err(struct ql_adapter *qdev);
2233int ql_mb_about_fw(struct ql_adapter *qdev); 2235int ql_mb_about_fw(struct ql_adapter *qdev);
2234int ql_wol(struct ql_adapter *qdev); 2236int ql_wol(struct ql_adapter *qdev);
2235int ql_mb_wol_set_magic(struct ql_adapter *qdev, u32 enable_wol); 2237int ql_mb_wol_set_magic(struct ql_adapter *qdev, u32 enable_wol);
@@ -2246,6 +2248,7 @@ void ql_gen_reg_dump(struct ql_adapter *qdev,
2246 struct ql_reg_dump *mpi_coredump); 2248 struct ql_reg_dump *mpi_coredump);
2247netdev_tx_t ql_lb_send(struct sk_buff *skb, struct net_device *ndev); 2249netdev_tx_t ql_lb_send(struct sk_buff *skb, struct net_device *ndev);
2248void ql_check_lb_frame(struct ql_adapter *, struct sk_buff *); 2250void ql_check_lb_frame(struct ql_adapter *, struct sk_buff *);
2251int ql_own_firmware(struct ql_adapter *qdev);
2249int ql_clean_lb_rx_ring(struct rx_ring *rx_ring, int budget); 2252int ql_clean_lb_rx_ring(struct rx_ring *rx_ring, int budget);
2250 2253
2251#if 1 2254#if 1
diff --git a/drivers/net/qlge/qlge_dbg.c b/drivers/net/qlge/qlge_dbg.c
index ec4349a254c..57df835147e 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
1225static 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
1225void ql_gen_reg_dump(struct ql_adapter *qdev, 1247void 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 */
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c
index e58892304e1..95fb63dcd9e 100644
--- a/drivers/net/qlge/qlge_main.c
+++ b/drivers/net/qlge/qlge_main.c
@@ -77,8 +77,13 @@ static int qlge_mpi_coredump;
77module_param(qlge_mpi_coredump, int, 0); 77module_param(qlge_mpi_coredump, int, 0);
78MODULE_PARM_DESC(qlge_mpi_coredump, 78MODULE_PARM_DESC(qlge_mpi_coredump,
79 "Option to enable MPI firmware dump. " 79 "Option to enable MPI firmware dump. "
80 "Default is OFF - Do Not allocate memory. " 80 "Default is OFF - Do Not allocate memory. ");
81 "Do not perform firmware coredump."); 81
82static int qlge_force_coredump;
83module_param(qlge_force_coredump, int, 0);
84MODULE_PARM_DESC(qlge_force_coredump,
85 "Option to allow force of firmware core dump. "
86 "Default is OFF - Do not allow.");
82 87
83static DEFINE_PCI_DEVICE_TABLE(qlge_pci_tbl) = { 88static DEFINE_PCI_DEVICE_TABLE(qlge_pci_tbl) = {
84 {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QLGE_DEVICE_ID_8012)}, 89 {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QLGE_DEVICE_ID_8012)},
@@ -4496,6 +4501,8 @@ static int __devinit ql_init_device(struct pci_dev *pdev,
4496 err = -ENOMEM; 4501 err = -ENOMEM;
4497 goto err_out; 4502 goto err_out;
4498 } 4503 }
4504 if (qlge_force_coredump)
4505 set_bit(QL_FRC_COREDUMP, &qdev->flags);
4499 } 4506 }
4500 /* make sure the EEPROM is good */ 4507 /* make sure the EEPROM is good */
4501 err = qdev->nic_ops->get_flash(qdev); 4508 err = qdev->nic_ops->get_flash(qdev);
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c
index 3304eb7df58..e2c846f17fc 100644
--- a/drivers/net/qlge/qlge_mpi.c
+++ b/drivers/net/qlge/qlge_mpi.c
@@ -607,6 +607,22 @@ end:
607 return status; 607 return status;
608} 608}
609 609
610int ql_mb_sys_err(struct ql_adapter *qdev)
611{
612 struct mbox_params mbc;
613 struct mbox_params *mbcp = &mbc;
614 int status;
615
616 memset(mbcp, 0, sizeof(struct mbox_params));
617
618 mbcp->in_count = 1;
619 mbcp->out_count = 0;
620
621 mbcp->mbox_in[0] = MB_CMD_MAKE_SYS_ERR;
622
623 status = ql_mailbox_command(qdev, mbcp);
624 return status;
625}
610 626
611/* Get MPI firmware version. This will be used for 627/* Get MPI firmware version. This will be used for
612 * driver banner and for ethtool info. 628 * driver banner and for ethtool info.