aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/be2iscsi
diff options
context:
space:
mode:
authorJayamohan Kallickal <jayamohank@gmail.com>2013-04-05 23:38:29 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-02 11:11:45 -0400
commit7ad4dfe187a4ce1eabe7e0c6364e4561dc930564 (patch)
tree8aa6de3a0e52ded2c928819df94105f8ada98b43 /drivers/scsi/be2iscsi
parent22661e25cca8bb780f79756e7a7e201b478f8c14 (diff)
[SCSI] be2iscsi: Fix displaying the Active Session Count from driver
This patch fixes the displaying of number of active sessions in use. Signed-off-by: John Soni Jose <sony.john-n@emulex.com> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r--drivers/scsi/be2iscsi/be_main.c2
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.c20
-rw-r--r--drivers/scsi/be2iscsi/be_mgmt.h3
3 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
index adc662dc4ac8..ff89b4cc3634 100644
--- a/drivers/scsi/be2iscsi/be_main.c
+++ b/drivers/scsi/be2iscsi/be_main.c
@@ -154,11 +154,13 @@ BEISCSI_RW_ATTR(log_enable, 0x00,
154DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL); 154DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL);
155DEVICE_ATTR(beiscsi_adapter_family, S_IRUGO, beiscsi_adap_family_disp, NULL); 155DEVICE_ATTR(beiscsi_adapter_family, S_IRUGO, beiscsi_adap_family_disp, NULL);
156DEVICE_ATTR(beiscsi_fw_ver, S_IRUGO, beiscsi_fw_ver_disp, NULL); 156DEVICE_ATTR(beiscsi_fw_ver, S_IRUGO, beiscsi_fw_ver_disp, NULL);
157DEVICE_ATTR(beiscsi_active_cid_count, S_IRUGO, beiscsi_active_cid_disp, NULL);
157struct device_attribute *beiscsi_attrs[] = { 158struct device_attribute *beiscsi_attrs[] = {
158 &dev_attr_beiscsi_log_enable, 159 &dev_attr_beiscsi_log_enable,
159 &dev_attr_beiscsi_drvr_ver, 160 &dev_attr_beiscsi_drvr_ver,
160 &dev_attr_beiscsi_adapter_family, 161 &dev_attr_beiscsi_adapter_family,
161 &dev_attr_beiscsi_fw_ver, 162 &dev_attr_beiscsi_fw_ver,
163 &dev_attr_beiscsi_active_cid_count,
162 NULL, 164 NULL,
163}; 165};
164 166
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c
index 02bad04112ff..3a1a6341c7ca 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.c
+++ b/drivers/scsi/be2iscsi/be_mgmt.c
@@ -1281,6 +1281,26 @@ beiscsi_fw_ver_disp(struct device *dev, struct device_attribute *attr,
1281} 1281}
1282 1282
1283/** 1283/**
1284 * beiscsi_active_cid_disp()- Display Sessions Active
1285 * @dev: ptr to device not used.
1286 * @attr: device attribute, not used.
1287 * @buf: contains formatted text Session Count
1288 *
1289 * return
1290 * size of the formatted string
1291 **/
1292ssize_t
1293beiscsi_active_cid_disp(struct device *dev, struct device_attribute *attr,
1294 char *buf)
1295{
1296 struct Scsi_Host *shost = class_to_shost(dev);
1297 struct beiscsi_hba *phba = iscsi_host_priv(shost);
1298
1299 return snprintf(buf, PAGE_SIZE, "%d\n",
1300 (phba->params.cxns_per_ctrl - phba->avlbl_cids));
1301}
1302
1303/**
1284 * beiscsi_adap_family_disp()- Display adapter family. 1304 * beiscsi_adap_family_disp()- Display adapter family.
1285 * @dev: ptr to device to get priv structure 1305 * @dev: ptr to device to get priv structure
1286 * @attr: device attribute, not used. 1306 * @attr: device attribute, not used.
diff --git a/drivers/scsi/be2iscsi/be_mgmt.h b/drivers/scsi/be2iscsi/be_mgmt.h
index 00f3a4fd1c79..4c7e0a21c1d4 100644
--- a/drivers/scsi/be2iscsi/be_mgmt.h
+++ b/drivers/scsi/be2iscsi/be_mgmt.h
@@ -315,6 +315,9 @@ ssize_t beiscsi_drvr_ver_disp(struct device *dev,
315ssize_t beiscsi_fw_ver_disp(struct device *dev, 315ssize_t beiscsi_fw_ver_disp(struct device *dev,
316 struct device_attribute *attr, char *buf); 316 struct device_attribute *attr, char *buf);
317 317
318ssize_t beiscsi_active_cid_disp(struct device *dev,
319 struct device_attribute *attr, char *buf);
320
318ssize_t beiscsi_adap_family_disp(struct device *dev, 321ssize_t beiscsi_adap_family_disp(struct device *dev,
319 struct device_attribute *attr, char *buf); 322 struct device_attribute *attr, char *buf);
320 323