Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 999916dc authored by Saurav Kashyap's avatar Saurav Kashyap Committed by James Bottomley
Browse files

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



[jejb: fix up checkpatch.pl errors]
Signed-off-by: default avatarSaurav Kashyap <saurav.kashyap@qlogic.com>
Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 08de2844
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@
 * |             Level            |   Last Value Used  |     Holes	|
 * ----------------------------------------------------------------------
 * | Module Init and Probe        |       0x0116       |  		|
 * | Mailbox commands             |       0x1126       |		|
 * | Mailbox commands             |       0x1129       |		|
 * | Device Discovery             |       0x2083       |		|
 * | Queue Command and IO tracing |       0x302e       |     0x3008     |
 * | DPC Thread                   |       0x401c       |		|
@@ -22,7 +22,7 @@
 * | Task Management              |       0x8041       |    		|
 * | AER/EEH                      |       0x900f       |		|
 * | Virtual Port                 |       0xa007       |		|
 * | ISP82XX Specific             |       0xb04f       |    		|
 * | ISP82XX Specific             |       0xb051       |    		|
 * | MultiQ                       |       0xc00b       |		|
 * | Misc                         |       0xd00b       |		|
 * ----------------------------------------------------------------------
+3 −0
Original line number Diff line number Diff line
@@ -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_off(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 *,
    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 int qla82xx_fcoe_ctx_reset(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);

/* BSG related functions */
+38 −0
Original line number Diff line number Diff line
@@ -4275,3 +4275,41 @@ qla82xx_md_get_template(scsi_qla_host_t *vha)
		ql_dbg(ql_dbg_mbx, vha, 0x1126, "Done %s.\n", __func__);
	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;
}
+40 −0
Original line number Diff line number Diff line
@@ -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;
}
+1 −0
Original line number Diff line number Diff line
@@ -888,6 +888,7 @@ struct ct6_dsd {
};

#define MBC_TOGGLE_INTERRUPT	0x10
#define MBC_SET_LED_CONFIG	0x125

/* Flash  offset */
#define FLT_REG_BOOTLOAD_82XX	0x72
Loading