diff options
author | Saurav Kashyap <saurav.kashyap@qlogic.com> | 2012-08-22 14:21:01 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-24 04:10:47 -0400 |
commit | a9b6f722f62d0a302b980a4fdcdf9c9933955772 (patch) | |
tree | d353225c380d8183faddbf535a6116ada1a41279 /drivers/scsi/qla2xxx/qla_attr.c | |
parent | 5f16b331d83757ad5154af07b449c722fef45d5e (diff) |
[SCSI] qla2xxx: Implementation of bidirectional.
[jejb: merge fix for introduced warning]
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>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 5ab953029f8d..ff2439bd9b4b 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1251,6 +1251,31 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr, | |||
1251 | state[1], state[2], state[3], state[4]); | 1251 | state[1], state[2], state[3], state[4]); |
1252 | } | 1252 | } |
1253 | 1253 | ||
1254 | static ssize_t | ||
1255 | qla2x00_diag_requests_show(struct device *dev, | ||
1256 | struct device_attribute *attr, char *buf) | ||
1257 | { | ||
1258 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
1259 | |||
1260 | if (!IS_BIDI_CAPABLE(vha->hw)) | ||
1261 | return snprintf(buf, PAGE_SIZE, "\n"); | ||
1262 | |||
1263 | return snprintf(buf, PAGE_SIZE, "%llu\n", vha->bidi_stats.io_count); | ||
1264 | } | ||
1265 | |||
1266 | static ssize_t | ||
1267 | qla2x00_diag_megabytes_show(struct device *dev, | ||
1268 | struct device_attribute *attr, char *buf) | ||
1269 | { | ||
1270 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | ||
1271 | |||
1272 | if (!IS_BIDI_CAPABLE(vha->hw)) | ||
1273 | return snprintf(buf, PAGE_SIZE, "\n"); | ||
1274 | |||
1275 | return snprintf(buf, PAGE_SIZE, "%llu\n", | ||
1276 | vha->bidi_stats.transfer_bytes >> 20); | ||
1277 | } | ||
1278 | |||
1254 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); | 1279 | static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL); |
1255 | static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); | 1280 | static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL); |
1256 | static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); | 1281 | static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL); |
@@ -1289,6 +1314,8 @@ static DEVICE_ATTR(vn_port_mac_address, S_IRUGO, | |||
1289 | static DEVICE_ATTR(fabric_param, S_IRUGO, qla2x00_fabric_param_show, NULL); | 1314 | static DEVICE_ATTR(fabric_param, S_IRUGO, qla2x00_fabric_param_show, NULL); |
1290 | static DEVICE_ATTR(fw_state, S_IRUGO, qla2x00_fw_state_show, NULL); | 1315 | static DEVICE_ATTR(fw_state, S_IRUGO, qla2x00_fw_state_show, NULL); |
1291 | static DEVICE_ATTR(thermal_temp, S_IRUGO, qla2x00_thermal_temp_show, NULL); | 1316 | static DEVICE_ATTR(thermal_temp, S_IRUGO, qla2x00_thermal_temp_show, NULL); |
1317 | static DEVICE_ATTR(diag_requests, S_IRUGO, qla2x00_diag_requests_show, NULL); | ||
1318 | static DEVICE_ATTR(diag_megabytes, S_IRUGO, qla2x00_diag_megabytes_show, NULL); | ||
1292 | 1319 | ||
1293 | struct device_attribute *qla2x00_host_attrs[] = { | 1320 | struct device_attribute *qla2x00_host_attrs[] = { |
1294 | &dev_attr_driver_version, | 1321 | &dev_attr_driver_version, |
@@ -1318,6 +1345,8 @@ struct device_attribute *qla2x00_host_attrs[] = { | |||
1318 | &dev_attr_fw_state, | 1345 | &dev_attr_fw_state, |
1319 | &dev_attr_optrom_gold_fw_version, | 1346 | &dev_attr_optrom_gold_fw_version, |
1320 | &dev_attr_thermal_temp, | 1347 | &dev_attr_thermal_temp, |
1348 | &dev_attr_diag_requests, | ||
1349 | &dev_attr_diag_megabytes, | ||
1321 | NULL, | 1350 | NULL, |
1322 | }; | 1351 | }; |
1323 | 1352 | ||