Commit 0143d8b7 authored by Chad Dupuis's avatar Chad Dupuis Committed by James Bottomley

[SCSI] qla2xxx: Implement beacon support for ISP83xx.

Signed-off-by: default avatarGiridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: default avatarChad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 370d550e
...@@ -1662,6 +1662,23 @@ qla24xx_beacon_blink(struct scsi_qla_host *vha) ...@@ -1662,6 +1662,23 @@ qla24xx_beacon_blink(struct scsi_qla_host *vha)
spin_unlock_irqrestore(&ha->hardware_lock, flags); spin_unlock_irqrestore(&ha->hardware_lock, flags);
} }
static uint32_t
qla83xx_select_led_port(struct qla_hw_data *ha)
{
uint32_t led_select_value = 0;
if (!IS_QLA83XX(ha))
goto out;
if (ha->flags.port0)
led_select_value = QLA83XX_LED_PORT0;
else
led_select_value = QLA83XX_LED_PORT1;
out:
return led_select_value;
}
void void
qla83xx_beacon_blink(struct scsi_qla_host *vha) qla83xx_beacon_blink(struct scsi_qla_host *vha)
{ {
...@@ -1669,22 +1686,34 @@ qla83xx_beacon_blink(struct scsi_qla_host *vha) ...@@ -1669,22 +1686,34 @@ qla83xx_beacon_blink(struct scsi_qla_host *vha)
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
uint16_t led_cfg[6]; uint16_t led_cfg[6];
uint16_t orig_led_cfg[6]; uint16_t orig_led_cfg[6];
uint32_t led_10_value, led_43_value;
if (!IS_QLA83XX(ha) && !IS_QLA81XX(ha)) if (!IS_QLA83XX(ha) && !IS_QLA81XX(ha))
return; return;
if (IS_QLA2031(ha) && ha->beacon_blink_led) { if (!ha->beacon_blink_led)
if (ha->flags.port0) return;
led_select_value = QLA83XX_LED_PORT0;
else if (IS_QLA2031(ha)) {
led_select_value = QLA83XX_LED_PORT1; led_select_value = qla83xx_select_led_port(ha);
qla83xx_wr_reg(vha, led_select_value, 0x40002000); qla83xx_wr_reg(vha, led_select_value, 0x40002000);
qla83xx_wr_reg(vha, led_select_value + 4, 0x40002000); qla83xx_wr_reg(vha, led_select_value + 4, 0x40002000);
msleep(1000); msleep(1000);
qla83xx_wr_reg(vha, led_select_value, 0x40004000); qla83xx_wr_reg(vha, led_select_value, 0x40004000);
qla83xx_wr_reg(vha, led_select_value + 4, 0x40004000); qla83xx_wr_reg(vha, led_select_value + 4, 0x40004000);
} else if ((IS_QLA8031(ha) || IS_QLA81XX(ha)) && ha->beacon_blink_led) { } else if (IS_QLA8031(ha)) {
led_select_value = qla83xx_select_led_port(ha);
qla83xx_rd_reg(vha, led_select_value, &led_10_value);
qla83xx_rd_reg(vha, led_select_value + 0x10, &led_43_value);
qla83xx_wr_reg(vha, led_select_value, 0x01f44000);
msleep(500);
qla83xx_wr_reg(vha, led_select_value, 0x400001f4);
msleep(1000);
qla83xx_wr_reg(vha, led_select_value, led_10_value);
qla83xx_wr_reg(vha, led_select_value + 0x10, led_43_value);
} else if (IS_QLA81XX(ha)) {
int rval; int rval;
/* Save Current */ /* Save Current */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment