Commit 7ad4dfe1 authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley

[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: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Reviewed-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 22661e25
...@@ -154,11 +154,13 @@ BEISCSI_RW_ATTR(log_enable, 0x00, ...@@ -154,11 +154,13 @@ BEISCSI_RW_ATTR(log_enable, 0x00,
DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL); DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL);
DEVICE_ATTR(beiscsi_adapter_family, S_IRUGO, beiscsi_adap_family_disp, NULL); DEVICE_ATTR(beiscsi_adapter_family, S_IRUGO, beiscsi_adap_family_disp, NULL);
DEVICE_ATTR(beiscsi_fw_ver, S_IRUGO, beiscsi_fw_ver_disp, NULL); DEVICE_ATTR(beiscsi_fw_ver, S_IRUGO, beiscsi_fw_ver_disp, NULL);
DEVICE_ATTR(beiscsi_active_cid_count, S_IRUGO, beiscsi_active_cid_disp, NULL);
struct device_attribute *beiscsi_attrs[] = { struct device_attribute *beiscsi_attrs[] = {
&dev_attr_beiscsi_log_enable, &dev_attr_beiscsi_log_enable,
&dev_attr_beiscsi_drvr_ver, &dev_attr_beiscsi_drvr_ver,
&dev_attr_beiscsi_adapter_family, &dev_attr_beiscsi_adapter_family,
&dev_attr_beiscsi_fw_ver, &dev_attr_beiscsi_fw_ver,
&dev_attr_beiscsi_active_cid_count,
NULL, NULL,
}; };
......
...@@ -1280,6 +1280,26 @@ beiscsi_fw_ver_disp(struct device *dev, struct device_attribute *attr, ...@@ -1280,6 +1280,26 @@ beiscsi_fw_ver_disp(struct device *dev, struct device_attribute *attr,
return snprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str); return snprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str);
} }
/**
* beiscsi_active_cid_disp()- Display Sessions Active
* @dev: ptr to device not used.
* @attr: device attribute, not used.
* @buf: contains formatted text Session Count
*
* return
* size of the formatted string
**/
ssize_t
beiscsi_active_cid_disp(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct Scsi_Host *shost = class_to_shost(dev);
struct beiscsi_hba *phba = iscsi_host_priv(shost);
return snprintf(buf, PAGE_SIZE, "%d\n",
(phba->params.cxns_per_ctrl - phba->avlbl_cids));
}
/** /**
* beiscsi_adap_family_disp()- Display adapter family. * beiscsi_adap_family_disp()- Display adapter family.
* @dev: ptr to device to get priv structure * @dev: ptr to device to get priv structure
......
...@@ -315,6 +315,9 @@ ssize_t beiscsi_drvr_ver_disp(struct device *dev, ...@@ -315,6 +315,9 @@ ssize_t beiscsi_drvr_ver_disp(struct device *dev,
ssize_t beiscsi_fw_ver_disp(struct device *dev, ssize_t beiscsi_fw_ver_disp(struct device *dev,
struct device_attribute *attr, char *buf); struct device_attribute *attr, char *buf);
ssize_t beiscsi_active_cid_disp(struct device *dev,
struct device_attribute *attr, char *buf);
ssize_t beiscsi_adap_family_disp(struct device *dev, ssize_t beiscsi_adap_family_disp(struct device *dev,
struct device_attribute *attr, char *buf); struct device_attribute *attr, char *buf);
......
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