aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h1
-rw-r--r--drivers/scsi/qla2xxx/qla_gbl.h3
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c29
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c14
4 files changed, 41 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index b7f82b757cbc..b455c31405e4 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -631,6 +631,7 @@ typedef struct {
631#define MBC_WRITE_RAM_WORD_EXTENDED 0xd /* Write RAM word extended */ 631#define MBC_WRITE_RAM_WORD_EXTENDED 0xd /* Write RAM word extended */
632#define MBC_READ_RAM_EXTENDED 0xf /* Read RAM extended. */ 632#define MBC_READ_RAM_EXTENDED 0xf /* Read RAM extended. */
633#define MBC_IOCB_COMMAND 0x12 /* Execute IOCB command. */ 633#define MBC_IOCB_COMMAND 0x12 /* Execute IOCB command. */
634#define MBC_STOP_FIRMWARE 0x14 /* Stop firmware. */
634#define MBC_ABORT_COMMAND 0x15 /* Abort IOCB command. */ 635#define MBC_ABORT_COMMAND 0x15 /* Abort IOCB command. */
635#define MBC_ABORT_DEVICE 0x16 /* Abort device (ID/LUN). */ 636#define MBC_ABORT_DEVICE 0x16 /* Abort device (ID/LUN). */
636#define MBC_ABORT_TARGET 0x17 /* Abort target (ID). */ 637#define MBC_ABORT_TARGET 0x17 /* Abort target (ID). */
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 95fb0c4941aa..1ed32e7b5472 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -213,6 +213,9 @@ qla2x00_get_serdes_params(scsi_qla_host_t *, uint16_t *, uint16_t *,
213extern int 213extern int
214qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t); 214qla2x00_set_serdes_params(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t);
215 215
216extern int
217qla2x00_stop_firmware(scsi_qla_host_t *);
218
216/* 219/*
217 * Global Function Prototypes in qla_isr.c source file. 220 * Global Function Prototypes in qla_isr.c source file.
218 */ 221 */
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 953156faafdb..13e1c9047079 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -2427,3 +2427,32 @@ qla2x00_set_serdes_params(scsi_qla_host_t *ha, uint16_t sw_em_1g,
2427 2427
2428 return rval; 2428 return rval;
2429} 2429}
2430
2431int
2432qla2x00_stop_firmware(scsi_qla_host_t *ha)
2433{
2434 int rval;
2435 mbx_cmd_t mc;
2436 mbx_cmd_t *mcp = &mc;
2437
2438 if (!IS_QLA24XX(ha) && !IS_QLA25XX(ha))
2439 return QLA_FUNCTION_FAILED;
2440
2441 DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
2442
2443 mcp->mb[0] = MBC_STOP_FIRMWARE;
2444 mcp->out_mb = MBX_0;
2445 mcp->in_mb = MBX_0;
2446 mcp->tov = 5;
2447 mcp->flags = 0;
2448 rval = qla2x00_mailbox_command(ha, mcp);
2449
2450 if (rval != QLA_SUCCESS) {
2451 DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__,
2452 ha->host_no, rval));
2453 } else {
2454 DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no));
2455 }
2456
2457 return rval;
2458}
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index af9b4e77cbff..8982978c42fd 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -79,7 +79,7 @@ module_param(ql2xloginretrycount, int, S_IRUGO|S_IRUSR);
79MODULE_PARM_DESC(ql2xloginretrycount, 79MODULE_PARM_DESC(ql2xloginretrycount,
80 "Specify an alternate value for the NVRAM login retry count."); 80 "Specify an alternate value for the NVRAM login retry count.");
81 81
82int ql2xfwloadbin; 82int ql2xfwloadbin=1;
83module_param(ql2xfwloadbin, int, S_IRUGO|S_IRUSR); 83module_param(ql2xfwloadbin, int, S_IRUGO|S_IRUSR);
84MODULE_PARM_DESC(ql2xfwloadbin, 84MODULE_PARM_DESC(ql2xfwloadbin,
85 "Load ISP2xxx firmware image via hotplug."); 85 "Load ISP2xxx firmware image via hotplug.");
@@ -1626,10 +1626,6 @@ qla2x00_free_device(scsi_qla_host_t *ha)
1626 if (!IS_QLA2100(ha) && !IS_QLA2200(ha)) 1626 if (!IS_QLA2100(ha) && !IS_QLA2200(ha))
1627 qla2x00_cancel_io_descriptors(ha); 1627 qla2x00_cancel_io_descriptors(ha);
1628 1628
1629 /* turn-off interrupts on the card */
1630 if (ha->interrupts_on)
1631 ha->isp_ops.disable_intrs(ha);
1632
1633 /* Disable timer */ 1629 /* Disable timer */
1634 if (ha->timer_active) 1630 if (ha->timer_active)
1635 qla2x00_stop_timer(ha); 1631 qla2x00_stop_timer(ha);
@@ -1649,8 +1645,14 @@ qla2x00_free_device(scsi_qla_host_t *ha)
1649 } 1645 }
1650 } 1646 }
1651 1647
1652 qla2x00_mem_free(ha); 1648 /* Stop currently executing firmware. */
1649 qla2x00_stop_firmware(ha);
1653 1650
1651 /* turn-off interrupts on the card */
1652 if (ha->interrupts_on)
1653 ha->isp_ops.disable_intrs(ha);
1654
1655 qla2x00_mem_free(ha);
1654 1656
1655 ha->flags.online = 0; 1657 ha->flags.online = 0;
1656 1658