diff options
author | Harish Zunjarrao <harish.zunjarrao@qlogic.com> | 2011-08-12 11:51:26 +0200 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-08-27 16:36:43 +0200 |
commit | 5232f801bd0cfb4122e9a28ff942965c3c485fa7 (patch) | |
tree | 1d984822ae92a0cf497897ca8aad56d32a8a8d08 /drivers/scsi/qla4xxx/ql4_mbx.c | |
parent | [SCSI] Fix out of spec CD-ROM problem with media change (diff) | |
download | linux-5232f801bd0cfb4122e9a28ff942965c3c485fa7.tar.xz linux-5232f801bd0cfb4122e9a28ff942965c3c485fa7.zip |
[SCSI] qla4xxx: Added restore factory defaults support using BSG
This command will causes the firmware to update all
configurations to pre-defined factory default settings.
Signed-off-by: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/qla4xxx/ql4_mbx.c')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_mbx.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index e843758da3d4..dfc38aa8740d 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c @@ -1744,3 +1744,29 @@ int qla4xxx_set_nvram(struct scsi_qla_host *ha, dma_addr_t nvram_dma, } return status; } + +int qla4xxx_restore_factory_defaults(struct scsi_qla_host *ha, + uint32_t region, uint32_t field0, + uint32_t field1) +{ + int status = QLA_SUCCESS; + uint32_t mbox_cmd[MBOX_REG_COUNT]; + uint32_t mbox_sts[MBOX_REG_COUNT]; + + memset(&mbox_cmd, 0, sizeof(mbox_cmd)); + memset(&mbox_sts, 0, sizeof(mbox_sts)); + + mbox_cmd[0] = MBOX_CMD_RESTORE_FACTORY_DEFAULTS; + mbox_cmd[3] = region; + mbox_cmd[4] = field0; + mbox_cmd[5] = field1; + + status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, 3, &mbox_cmd[0], + &mbox_sts[0]); + if (status != QLA_SUCCESS) { + DEBUG2(ql4_printk(KERN_ERR, ha, "scsi%ld: %s: failed " + "status %04X\n", ha->host_no, __func__, + mbox_sts[0])); + } + return status; +} |