[SCSI] qla2xxx: Implemeted beacon on/off for ISP82XX.

[jejb: fix up checkpatch.pl errors]
Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
This commit is contained in:
Saurav Kashyap 2011-08-16 11:31:45 -07:00 committed by James Bottomley
parent 08de2844c6
commit 999916dc59
6 changed files with 92 additions and 7 deletions

View file

@ -12,7 +12,7 @@
* | Level | Last Value Used | Holes | * | Level | Last Value Used | Holes |
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------
* | Module Init and Probe | 0x0116 | | * | Module Init and Probe | 0x0116 | |
* | Mailbox commands | 0x1126 | | * | Mailbox commands | 0x1129 | |
* | Device Discovery | 0x2083 | | * | Device Discovery | 0x2083 | |
* | Queue Command and IO tracing | 0x302e | 0x3008 | * | Queue Command and IO tracing | 0x302e | 0x3008 |
* | DPC Thread | 0x401c | | * | DPC Thread | 0x401c | |
@ -22,7 +22,7 @@
* | Task Management | 0x8041 | | * | Task Management | 0x8041 | |
* | AER/EEH | 0x900f | | * | AER/EEH | 0x900f | |
* | Virtual Port | 0xa007 | | * | Virtual Port | 0xa007 | |
* | ISP82XX Specific | 0xb04f | | * | ISP82XX Specific | 0xb051 | |
* | MultiQ | 0xc00b | | * | MultiQ | 0xc00b | |
* | Misc | 0xd00b | | * | Misc | 0xd00b | |
* ---------------------------------------------------------------------- * ----------------------------------------------------------------------

View file

@ -409,6 +409,8 @@ extern void qla2x00_beacon_blink(struct scsi_qla_host *);
extern int qla24xx_beacon_on(struct scsi_qla_host *); extern int qla24xx_beacon_on(struct scsi_qla_host *);
extern int qla24xx_beacon_off(struct scsi_qla_host *); extern int qla24xx_beacon_off(struct scsi_qla_host *);
extern void qla24xx_beacon_blink(struct scsi_qla_host *); extern void qla24xx_beacon_blink(struct scsi_qla_host *);
extern int qla82xx_beacon_on(struct scsi_qla_host *);
extern int qla82xx_beacon_off(struct scsi_qla_host *);
extern uint8_t *qla2x00_read_optrom_data(struct scsi_qla_host *, uint8_t *, extern uint8_t *qla2x00_read_optrom_data(struct scsi_qla_host *, uint8_t *,
uint32_t, uint32_t); uint32_t, uint32_t);
@ -573,6 +575,7 @@ extern int qla82xx_mbx_intr_disable(scsi_qla_host_t *);
extern void qla82xx_start_iocbs(srb_t *); extern void qla82xx_start_iocbs(srb_t *);
extern int qla82xx_fcoe_ctx_reset(scsi_qla_host_t *); extern int qla82xx_fcoe_ctx_reset(scsi_qla_host_t *);
extern void qla82xx_chip_reset_cleanup(scsi_qla_host_t *); extern void qla82xx_chip_reset_cleanup(scsi_qla_host_t *);
extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int);
extern char *qdev_state(uint32_t); extern char *qdev_state(uint32_t);
/* BSG related functions */ /* BSG related functions */

View file

@ -4275,3 +4275,41 @@ qla82xx_md_get_template(scsi_qla_host_t *vha)
ql_dbg(ql_dbg_mbx, vha, 0x1126, "Done %s.\n", __func__); ql_dbg(ql_dbg_mbx, vha, 0x1126, "Done %s.\n", __func__);
return rval; return rval;
} }
int
qla82xx_mbx_beacon_ctl(scsi_qla_host_t *vha, int enable)
{
int rval;
struct qla_hw_data *ha = vha->hw;
mbx_cmd_t mc;
mbx_cmd_t *mcp = &mc;
if (!IS_QLA82XX(ha))
return QLA_FUNCTION_FAILED;
ql_dbg(ql_dbg_mbx, vha, 0x1127,
"Entered %s.\n", __func__);
memset(mcp, 0, sizeof(mbx_cmd_t));
mcp->mb[0] = MBC_SET_LED_CONFIG;
if (enable)
mcp->mb[7] = 0xE;
else
mcp->mb[7] = 0xD;
mcp->out_mb = MBX_7|MBX_0;
mcp->in_mb = MBX_0;
mcp->tov = 30;
mcp->flags = 0;
rval = qla2x00_mailbox_command(vha, mcp);
if (rval != QLA_SUCCESS) {
ql_dbg(ql_dbg_mbx, vha, 0x1128,
"Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]);
} else {
ql_dbg(ql_dbg_mbx, vha, 0x1129,
"Done %s.\n", __func__);
}
return rval;
}

View file

@ -4874,3 +4874,43 @@ qla82xx_md_prep(scsi_qla_host_t *vha)
} }
} }
} }
int
qla82xx_beacon_on(struct scsi_qla_host *vha)
{
int rval;
struct qla_hw_data *ha = vha->hw;
qla82xx_idc_lock(ha);
rval = qla82xx_mbx_beacon_ctl(vha, 1);
if (rval) {
ql_log(ql_log_warn, vha, 0xb050,
"mbx set led config failed in %s\n", __func__);
goto exit;
}
ha->beacon_blink_led = 1;
exit:
qla82xx_idc_unlock(ha);
return rval;
}
int
qla82xx_beacon_off(struct scsi_qla_host *vha)
{
int rval;
struct qla_hw_data *ha = vha->hw;
qla82xx_idc_lock(ha);
rval = qla82xx_mbx_beacon_ctl(vha, 0);
if (rval) {
ql_log(ql_log_warn, vha, 0xb051,
"mbx set led config failed in %s\n", __func__);
goto exit;
}
ha->beacon_blink_led = 0;
exit:
qla82xx_idc_unlock(ha);
return rval;
}

View file

@ -888,6 +888,7 @@ struct ct6_dsd {
}; };
#define MBC_TOGGLE_INTERRUPT 0x10 #define MBC_TOGGLE_INTERRUPT 0x10
#define MBC_SET_LED_CONFIG 0x125
/* Flash offset */ /* Flash offset */
#define FLT_REG_BOOTLOAD_82XX 0x72 #define FLT_REG_BOOTLOAD_82XX 0x72

View file

@ -1762,9 +1762,9 @@ static struct isp_operations qla82xx_isp_ops = {
.read_nvram = qla24xx_read_nvram_data, .read_nvram = qla24xx_read_nvram_data,
.write_nvram = qla24xx_write_nvram_data, .write_nvram = qla24xx_write_nvram_data,
.fw_dump = qla24xx_fw_dump, .fw_dump = qla24xx_fw_dump,
.beacon_on = qla24xx_beacon_on, .beacon_on = qla82xx_beacon_on,
.beacon_off = qla24xx_beacon_off, .beacon_off = qla82xx_beacon_off,
.beacon_blink = qla24xx_beacon_blink, .beacon_blink = NULL,
.read_optrom = qla82xx_read_optrom_data, .read_optrom = qla82xx_read_optrom_data,
.write_optrom = qla82xx_write_optrom_data, .write_optrom = qla82xx_write_optrom_data,
.get_flash_version = qla24xx_get_flash_version, .get_flash_version = qla24xx_get_flash_version,
@ -3917,8 +3917,11 @@ qla2x00_timer(scsi_qla_host_t *vha)
/* Check if beacon LED needs to be blinked for physical host only */ /* Check if beacon LED needs to be blinked for physical host only */
if (!vha->vp_idx && (ha->beacon_blink_led == 1)) { if (!vha->vp_idx && (ha->beacon_blink_led == 1)) {
set_bit(BEACON_BLINK_NEEDED, &vha->dpc_flags); /* There is no beacon_blink function for ISP82xx */
start_dpc++; if (!IS_QLA82XX(ha)) {
set_bit(BEACON_BLINK_NEEDED, &vha->dpc_flags);
start_dpc++;
}
} }
/* Process any deferred work. */ /* Process any deferred work. */