diff options
author | Vikas Chaudhary <vikas.chaudhary@qlogic.com> | 2013-11-22 05:28:17 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-12-19 23:56:25 -0500 |
commit | df86f771578209599acc871a03f02346c8d7885b (patch) | |
tree | 1532bc2abf8f6479a5bd34238ba917bc0a144c69 /drivers/scsi/qla4xxx/ql4_mbx.c | |
parent | 2da11ad218b1a30f46b4c8fdfa39aff6584c370b (diff) |
[SCSI] qla4xxx: Added support for Diagnostics MBOX command
Added support for Diagnostics MBOX command via BSG Vendor HST_VENDOR
interface. This command provides various tests for validating hardware
functionality.
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 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index 351793c0e18f..9ae8ca3b69f9 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c | |||
@@ -2416,3 +2416,46 @@ exit_config_acb: | |||
2416 | rval == QLA_SUCCESS ? "SUCCEEDED" : "FAILED")); | 2416 | rval == QLA_SUCCESS ? "SUCCEEDED" : "FAILED")); |
2417 | return rval; | 2417 | return rval; |
2418 | } | 2418 | } |
2419 | |||
2420 | int qla4_83xx_get_port_config(struct scsi_qla_host *ha, uint32_t *config) | ||
2421 | { | ||
2422 | uint32_t mbox_cmd[MBOX_REG_COUNT]; | ||
2423 | uint32_t mbox_sts[MBOX_REG_COUNT]; | ||
2424 | int status; | ||
2425 | |||
2426 | memset(&mbox_cmd, 0, sizeof(mbox_cmd)); | ||
2427 | memset(&mbox_sts, 0, sizeof(mbox_sts)); | ||
2428 | |||
2429 | mbox_cmd[0] = MBOX_CMD_GET_PORT_CONFIG; | ||
2430 | |||
2431 | status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT, | ||
2432 | mbox_cmd, mbox_sts); | ||
2433 | if (status == QLA_SUCCESS) | ||
2434 | *config = mbox_sts[1]; | ||
2435 | else | ||
2436 | ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", __func__, | ||
2437 | mbox_sts[0]); | ||
2438 | |||
2439 | return status; | ||
2440 | } | ||
2441 | |||
2442 | int qla4_83xx_set_port_config(struct scsi_qla_host *ha, uint32_t *config) | ||
2443 | { | ||
2444 | uint32_t mbox_cmd[MBOX_REG_COUNT]; | ||
2445 | uint32_t mbox_sts[MBOX_REG_COUNT]; | ||
2446 | int status; | ||
2447 | |||
2448 | memset(&mbox_cmd, 0, sizeof(mbox_cmd)); | ||
2449 | memset(&mbox_sts, 0, sizeof(mbox_sts)); | ||
2450 | |||
2451 | mbox_cmd[0] = MBOX_CMD_SET_PORT_CONFIG; | ||
2452 | mbox_cmd[1] = *config; | ||
2453 | |||
2454 | status = qla4xxx_mailbox_command(ha, MBOX_REG_COUNT, MBOX_REG_COUNT, | ||
2455 | mbox_cmd, mbox_sts); | ||
2456 | if (status != QLA_SUCCESS) | ||
2457 | ql4_printk(KERN_ERR, ha, "%s: failed status %04X\n", __func__, | ||
2458 | mbox_sts[0]); | ||
2459 | |||
2460 | return status; | ||
2461 | } | ||