aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c')
-rw-r--r--drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c47
1 files changed, 21 insertions, 26 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
index 76a80a3b16c1..23a761fb3e29 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
@@ -449,8 +449,9 @@ irqreturn_t qlcnic_83xx_intr(int irq, void *data)
449 449
450 qlcnic_83xx_poll_process_aen(adapter); 450 qlcnic_83xx_poll_process_aen(adapter);
451 451
452 if (ahw->diag_test == QLCNIC_INTERRUPT_TEST) { 452 if (ahw->diag_test) {
453 ahw->diag_cnt++; 453 if (ahw->diag_test == QLCNIC_INTERRUPT_TEST)
454 ahw->diag_cnt++;
454 qlcnic_83xx_enable_legacy_msix_mbx_intr(adapter); 455 qlcnic_83xx_enable_legacy_msix_mbx_intr(adapter);
455 return IRQ_HANDLED; 456 return IRQ_HANDLED;
456 } 457 }
@@ -1347,11 +1348,6 @@ static int qlcnic_83xx_diag_alloc_res(struct net_device *netdev, int test,
1347 } 1348 }
1348 1349
1349 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) { 1350 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) {
1350 /* disable and free mailbox interrupt */
1351 if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) {
1352 qlcnic_83xx_enable_mbx_poll(adapter);
1353 qlcnic_83xx_free_mbx_intr(adapter);
1354 }
1355 adapter->ahw->loopback_state = 0; 1351 adapter->ahw->loopback_state = 0;
1356 adapter->ahw->hw_ops->setup_link_event(adapter, 1); 1352 adapter->ahw->hw_ops->setup_link_event(adapter, 1);
1357 } 1353 }
@@ -1365,33 +1361,20 @@ static void qlcnic_83xx_diag_free_res(struct net_device *netdev,
1365{ 1361{
1366 struct qlcnic_adapter *adapter = netdev_priv(netdev); 1362 struct qlcnic_adapter *adapter = netdev_priv(netdev);
1367 struct qlcnic_host_sds_ring *sds_ring; 1363 struct qlcnic_host_sds_ring *sds_ring;
1368 int ring, err; 1364 int ring;
1369 1365
1370 clear_bit(__QLCNIC_DEV_UP, &adapter->state); 1366 clear_bit(__QLCNIC_DEV_UP, &adapter->state);
1371 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) { 1367 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST) {
1372 for (ring = 0; ring < adapter->drv_sds_rings; ring++) { 1368 for (ring = 0; ring < adapter->drv_sds_rings; ring++) {
1373 sds_ring = &adapter->recv_ctx->sds_rings[ring]; 1369 sds_ring = &adapter->recv_ctx->sds_rings[ring];
1374 qlcnic_83xx_disable_intr(adapter, sds_ring); 1370 if (adapter->flags & QLCNIC_MSIX_ENABLED)
1375 if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) 1371 qlcnic_83xx_disable_intr(adapter, sds_ring);
1376 qlcnic_83xx_enable_mbx_poll(adapter);
1377 } 1372 }
1378 } 1373 }
1379 1374
1380 qlcnic_fw_destroy_ctx(adapter); 1375 qlcnic_fw_destroy_ctx(adapter);
1381 qlcnic_detach(adapter); 1376 qlcnic_detach(adapter);
1382 1377
1383 if (adapter->ahw->diag_test == QLCNIC_LOOPBACK_TEST) {
1384 if (!(adapter->flags & QLCNIC_MSIX_ENABLED)) {
1385 err = qlcnic_83xx_setup_mbx_intr(adapter);
1386 qlcnic_83xx_disable_mbx_poll(adapter);
1387 if (err) {
1388 dev_err(&adapter->pdev->dev,
1389 "%s: failed to setup mbx interrupt\n",
1390 __func__);
1391 goto out;
1392 }
1393 }
1394 }
1395 adapter->ahw->diag_test = 0; 1378 adapter->ahw->diag_test = 0;
1396 adapter->drv_sds_rings = drv_sds_rings; 1379 adapter->drv_sds_rings = drv_sds_rings;
1397 1380
@@ -1401,9 +1384,6 @@ static void qlcnic_83xx_diag_free_res(struct net_device *netdev,
1401 if (netif_running(netdev)) 1384 if (netif_running(netdev))
1402 __qlcnic_up(adapter, netdev); 1385 __qlcnic_up(adapter, netdev);
1403 1386
1404 if (adapter->ahw->diag_test == QLCNIC_INTERRUPT_TEST &&
1405 !(adapter->flags & QLCNIC_MSIX_ENABLED))
1406 qlcnic_83xx_disable_mbx_poll(adapter);
1407out: 1387out:
1408 netif_device_attach(netdev); 1388 netif_device_attach(netdev);
1409} 1389}
@@ -3792,6 +3772,19 @@ static void qlcnic_83xx_decode_mbx_rsp(struct qlcnic_adapter *adapter,
3792 return; 3772 return;
3793} 3773}
3794 3774
3775static inline void qlcnic_dump_mailbox_registers(struct qlcnic_adapter *adapter)
3776{
3777 struct qlcnic_hardware_context *ahw = adapter->ahw;
3778 u32 offset;
3779
3780 offset = QLCRDX(ahw, QLCNIC_DEF_INT_MASK);
3781 dev_info(&adapter->pdev->dev, "Mbx interrupt mask=0x%x, Mbx interrupt enable=0x%x, Host mbx control=0x%x, Fw mbx control=0x%x",
3782 readl(ahw->pci_base0 + offset),
3783 QLCRDX(ahw, QLCNIC_MBX_INTR_ENBL),
3784 QLCRDX(ahw, QLCNIC_HOST_MBX_CTRL),
3785 QLCRDX(ahw, QLCNIC_FW_MBX_CTRL));
3786}
3787
3795static void qlcnic_83xx_mailbox_worker(struct work_struct *work) 3788static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
3796{ 3789{
3797 struct qlcnic_mailbox *mbx = container_of(work, struct qlcnic_mailbox, 3790 struct qlcnic_mailbox *mbx = container_of(work, struct qlcnic_mailbox,
@@ -3836,6 +3829,8 @@ static void qlcnic_83xx_mailbox_worker(struct work_struct *work)
3836 __func__, cmd->cmd_op, cmd->type, ahw->pci_func, 3829 __func__, cmd->cmd_op, cmd->type, ahw->pci_func,
3837 ahw->op_mode); 3830 ahw->op_mode);
3838 clear_bit(QLC_83XX_MBX_READY, &mbx->status); 3831 clear_bit(QLC_83XX_MBX_READY, &mbx->status);
3832 qlcnic_dump_mailbox_registers(adapter);
3833 qlcnic_83xx_get_mbx_data(adapter, cmd);
3839 qlcnic_dump_mbx(adapter, cmd); 3834 qlcnic_dump_mbx(adapter, cmd);
3840 qlcnic_83xx_idc_request_reset(adapter, 3835 qlcnic_83xx_idc_request_reset(adapter,
3841 QLCNIC_FORCE_FW_DUMP_KEY); 3836 QLCNIC_FORCE_FW_DUMP_KEY);