diff options
author | Chad Dupuis <chad.dupuis@qlogic.com> | 2012-08-22 14:21:11 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-24 04:10:49 -0400 |
commit | 0143d8b7460e790ee522dcef0072801e8818c4eb (patch) | |
tree | 8b6f29112e3a16b71d47192243339640074edbd2 | |
parent | 370d550ea4eda6889ae2fb8a5e9845d2276f1567 (diff) |
[SCSI] qla2xxx: Implement beacon support for ISP83xx.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_sup.c | 41 |
1 files changed, 35 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 41ed7af79f42..32fdc2a66dd1 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -1662,6 +1662,23 @@ qla24xx_beacon_blink(struct scsi_qla_host *vha) | |||
1662 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 1662 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
1663 | } | 1663 | } |
1664 | 1664 | ||
1665 | static uint32_t | ||
1666 | qla83xx_select_led_port(struct qla_hw_data *ha) | ||
1667 | { | ||
1668 | uint32_t led_select_value = 0; | ||
1669 | |||
1670 | if (!IS_QLA83XX(ha)) | ||
1671 | goto out; | ||
1672 | |||
1673 | if (ha->flags.port0) | ||
1674 | led_select_value = QLA83XX_LED_PORT0; | ||
1675 | else | ||
1676 | led_select_value = QLA83XX_LED_PORT1; | ||
1677 | |||
1678 | out: | ||
1679 | return led_select_value; | ||
1680 | } | ||
1681 | |||
1665 | void | 1682 | void |
1666 | qla83xx_beacon_blink(struct scsi_qla_host *vha) | 1683 | qla83xx_beacon_blink(struct scsi_qla_host *vha) |
1667 | { | 1684 | { |
@@ -1669,22 +1686,34 @@ qla83xx_beacon_blink(struct scsi_qla_host *vha) | |||
1669 | struct qla_hw_data *ha = vha->hw; | 1686 | struct qla_hw_data *ha = vha->hw; |
1670 | uint16_t led_cfg[6]; | 1687 | uint16_t led_cfg[6]; |
1671 | uint16_t orig_led_cfg[6]; | 1688 | uint16_t orig_led_cfg[6]; |
1689 | uint32_t led_10_value, led_43_value; | ||
1672 | 1690 | ||
1673 | if (!IS_QLA83XX(ha) && !IS_QLA81XX(ha)) | 1691 | if (!IS_QLA83XX(ha) && !IS_QLA81XX(ha)) |
1674 | return; | 1692 | return; |
1675 | 1693 | ||
1676 | if (IS_QLA2031(ha) && ha->beacon_blink_led) { | 1694 | if (!ha->beacon_blink_led) |
1677 | if (ha->flags.port0) | 1695 | return; |
1678 | led_select_value = QLA83XX_LED_PORT0; | 1696 | |
1679 | else | 1697 | if (IS_QLA2031(ha)) { |
1680 | led_select_value = QLA83XX_LED_PORT1; | 1698 | led_select_value = qla83xx_select_led_port(ha); |
1681 | 1699 | ||
1682 | qla83xx_wr_reg(vha, led_select_value, 0x40002000); | 1700 | qla83xx_wr_reg(vha, led_select_value, 0x40002000); |
1683 | qla83xx_wr_reg(vha, led_select_value + 4, 0x40002000); | 1701 | qla83xx_wr_reg(vha, led_select_value + 4, 0x40002000); |
1684 | msleep(1000); | 1702 | msleep(1000); |
1685 | qla83xx_wr_reg(vha, led_select_value, 0x40004000); | 1703 | qla83xx_wr_reg(vha, led_select_value, 0x40004000); |
1686 | qla83xx_wr_reg(vha, led_select_value + 4, 0x40004000); | 1704 | qla83xx_wr_reg(vha, led_select_value + 4, 0x40004000); |
1687 | } else if ((IS_QLA8031(ha) || IS_QLA81XX(ha)) && ha->beacon_blink_led) { | 1705 | } else if (IS_QLA8031(ha)) { |
1706 | led_select_value = qla83xx_select_led_port(ha); | ||
1707 | |||
1708 | qla83xx_rd_reg(vha, led_select_value, &led_10_value); | ||
1709 | qla83xx_rd_reg(vha, led_select_value + 0x10, &led_43_value); | ||
1710 | qla83xx_wr_reg(vha, led_select_value, 0x01f44000); | ||
1711 | msleep(500); | ||
1712 | qla83xx_wr_reg(vha, led_select_value, 0x400001f4); | ||
1713 | msleep(1000); | ||
1714 | qla83xx_wr_reg(vha, led_select_value, led_10_value); | ||
1715 | qla83xx_wr_reg(vha, led_select_value + 0x10, led_43_value); | ||
1716 | } else if (IS_QLA81XX(ha)) { | ||
1688 | int rval; | 1717 | int rval; |
1689 | 1718 | ||
1690 | /* Save Current */ | 1719 | /* Save Current */ |