diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2009-06-03 12:55:29 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2009-06-08 15:46:58 -0400 |
commit | 656e89122a737b60cebc7b8fcb669faf0e7bc905 (patch) | |
tree | c0aa6e674b51a1484d194fe7d4f60173b9c736af /drivers/scsi | |
parent | f999f4c1961fe5399fd66c95860cc2d5d67e591e (diff) |
[SCSI] qla2xxx: Export additional firmware-states for application support.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 18 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 7 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 4 |
3 files changed, 25 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index cbdafb0aaf4c..0f8796201504 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1233,6 +1233,22 @@ qla2x00_fabric_param_show(struct device *dev, struct device_attribute *attr, | |||
1233 | return snprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap); | 1233 | return snprintf(buf, PAGE_SIZE, "%d\n", vha->hw->switch_cap); |
1234 | } | 1234 | } |
1235 | 1235 | ||
1236 | static ssize_t | ||
1237 | qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, | ||
1238 | char *buf) | ||
1239 | { | ||
1240 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
1241 | int rval; | ||
1242 | uint16_t state[5]; | ||
1243 | |||
1244 | rval = qla2x00_get_firmware_state(vha, state); | ||
1245 | if (rval != QLA_SUCCESS) | ||
1246 | memset(state, -1, sizeof(state)); | ||
1247 | |||
1248 | return snprintf(buf, PAGE_SIZE, "0x%x 0x%x 0x%x 0x%x 0x%x\n", state[0], | ||
1249 | state[1], state[2], state[3], state[4]); | ||
1250 | } | ||
1251 | |||
1236 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); | 1252 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); |
1237 | static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); | 1253 | static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); |
1238 | static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); | 1254 | static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); |
@@ -1265,6 +1281,7 @@ static DEVICE_ATTR(vlan_id, S_IRUGO, qla2x00_vlan_id_show, NULL); | |||
1265 | static DEVICE_ATTR(vn_port_mac_address, S_IRUGO, | 1281 | static DEVICE_ATTR(vn_port_mac_address, S_IRUGO, |
1266 | qla2x00_vn_port_mac_address_show, NULL); | 1282 | qla2x00_vn_port_mac_address_show, NULL); |
1267 | static DEVICE_ATTR(fabric_param, S_IRUGO, qla2x00_fabric_param_show, NULL); | 1283 | static DEVICE_ATTR(fabric_param, S_IRUGO, qla2x00_fabric_param_show, NULL); |
1284 | static DEVICE_ATTR(fw_state, S_IRUGO, qla2x00_fw_state_show, NULL); | ||
1268 | 1285 | ||
1269 | struct device_attribute *qla2x00_host_attrs[] = { | 1286 | struct device_attribute *qla2x00_host_attrs[] = { |
1270 | &dev_attr_driver_version, | 1287 | &dev_attr_driver_version, |
@@ -1290,6 +1307,7 @@ struct device_attribute *qla2x00_host_attrs[] = { | |||
1290 | &dev_attr_vlan_id, | 1307 | &dev_attr_vlan_id, |
1291 | &dev_attr_vn_port_mac_address, | 1308 | &dev_attr_vn_port_mac_address, |
1292 | &dev_attr_fabric_param, | 1309 | &dev_attr_fabric_param, |
1310 | &dev_attr_fw_state, | ||
1293 | NULL, | 1311 | NULL, |
1294 | }; | 1312 | }; |
1295 | 1313 | ||
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 46bd08525964..36cea2224b3c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -1304,7 +1304,7 @@ qla2x00_fw_ready(scsi_qla_host_t *vha) | |||
1304 | unsigned long wtime, mtime, cs84xx_time; | 1304 | unsigned long wtime, mtime, cs84xx_time; |
1305 | uint16_t min_wait; /* Minimum wait time if loop is down */ | 1305 | uint16_t min_wait; /* Minimum wait time if loop is down */ |
1306 | uint16_t wait_time; /* Wait time if loop is coming ready */ | 1306 | uint16_t wait_time; /* Wait time if loop is coming ready */ |
1307 | uint16_t state[3]; | 1307 | uint16_t state[5]; |
1308 | struct qla_hw_data *ha = vha->hw; | 1308 | struct qla_hw_data *ha = vha->hw; |
1309 | 1309 | ||
1310 | rval = QLA_SUCCESS; | 1310 | rval = QLA_SUCCESS; |
@@ -1403,8 +1403,9 @@ qla2x00_fw_ready(scsi_qla_host_t *vha) | |||
1403 | vha->host_no, state[0], jiffies)); | 1403 | vha->host_no, state[0], jiffies)); |
1404 | } while (1); | 1404 | } while (1); |
1405 | 1405 | ||
1406 | DEBUG(printk("scsi(%ld): fw_state=%x curr time=%lx.\n", | 1406 | DEBUG(printk("scsi(%ld): fw_state=%x (%x, %x, %x, %x) curr time=%lx.\n", |
1407 | vha->host_no, state[0], jiffies)); | 1407 | vha->host_no, state[0], state[1], state[2], state[3], state[4], |
1408 | jiffies)); | ||
1408 | 1409 | ||
1409 | if (rval) { | 1410 | if (rval) { |
1410 | DEBUG2_3(printk("scsi(%ld): Firmware ready **** FAILED ****.\n", | 1411 | DEBUG2_3(printk("scsi(%ld): Firmware ready **** FAILED ****.\n", |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index df919c072cae..f21557845d6f 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -1267,7 +1267,7 @@ qla2x00_get_firmware_state(scsi_qla_host_t *vha, uint16_t *states) | |||
1267 | 1267 | ||
1268 | mcp->mb[0] = MBC_GET_FIRMWARE_STATE; | 1268 | mcp->mb[0] = MBC_GET_FIRMWARE_STATE; |
1269 | mcp->out_mb = MBX_0; | 1269 | mcp->out_mb = MBX_0; |
1270 | mcp->in_mb = MBX_3|MBX_2|MBX_1|MBX_0; | 1270 | mcp->in_mb = MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; |
1271 | mcp->tov = MBX_TOV_SECONDS; | 1271 | mcp->tov = MBX_TOV_SECONDS; |
1272 | mcp->flags = 0; | 1272 | mcp->flags = 0; |
1273 | rval = qla2x00_mailbox_command(vha, mcp); | 1273 | rval = qla2x00_mailbox_command(vha, mcp); |
@@ -1276,6 +1276,8 @@ qla2x00_get_firmware_state(scsi_qla_host_t *vha, uint16_t *states) | |||
1276 | states[0] = mcp->mb[1]; | 1276 | states[0] = mcp->mb[1]; |
1277 | states[1] = mcp->mb[2]; | 1277 | states[1] = mcp->mb[2]; |
1278 | states[2] = mcp->mb[3]; | 1278 | states[2] = mcp->mb[3]; |
1279 | states[3] = mcp->mb[4]; | ||
1280 | states[4] = mcp->mb[5]; | ||
1279 | 1281 | ||
1280 | if (rval != QLA_SUCCESS) { | 1282 | if (rval != QLA_SUCCESS) { |
1281 | /*EMPTY*/ | 1283 | /*EMPTY*/ |