diff options
author | John Soni Jose <sony.john-n@emulex.com> | 2012-10-19 19:15:06 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-11-26 23:59:41 -0500 |
commit | 26000db7a6ffc559e635486dd3d02d368cb0bc7f (patch) | |
tree | b10e668e484512f631b7facc51cb6128215d6f7a /drivers/scsi/be2iscsi | |
parent | 7313326125c8da52a10780b5af3b290fa9498dcb (diff) |
[SCSI] be2iscsi: Fix issue of displaying adapter family.
Fix issue of displaying adapter family through the sysfs
entry for each Scsi_Host created for the adapter.
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.c | 2 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.c | 39 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.h | 3 |
3 files changed, 44 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 2d28cac34f55..ea510ef656f0 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -152,9 +152,11 @@ BEISCSI_RW_ATTR(log_enable, 0x00, | |||
152 | "\t\t\t\tConfiguration Path : 0x20\n"); | 152 | "\t\t\t\tConfiguration Path : 0x20\n"); |
153 | 153 | ||
154 | DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL); | 154 | DEVICE_ATTR(beiscsi_drvr_ver, S_IRUGO, beiscsi_drvr_ver_disp, NULL); |
155 | DEVICE_ATTR(beiscsi_adapter_family, S_IRUGO, beiscsi_adap_family_disp, NULL); | ||
155 | struct device_attribute *beiscsi_attrs[] = { | 156 | struct device_attribute *beiscsi_attrs[] = { |
156 | &dev_attr_beiscsi_log_enable, | 157 | &dev_attr_beiscsi_log_enable, |
157 | &dev_attr_beiscsi_drvr_ver, | 158 | &dev_attr_beiscsi_drvr_ver, |
159 | &dev_attr_beiscsi_adapter_family, | ||
158 | NULL, | 160 | NULL, |
159 | }; | 161 | }; |
160 | 162 | ||
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index b96a159b12c3..ee130bc240c3 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c | |||
@@ -1153,6 +1153,45 @@ beiscsi_drvr_ver_disp(struct device *dev, struct device_attribute *attr, | |||
1153 | return snprintf(buf, PAGE_SIZE, BE_NAME "\n"); | 1153 | return snprintf(buf, PAGE_SIZE, BE_NAME "\n"); |
1154 | } | 1154 | } |
1155 | 1155 | ||
1156 | /** | ||
1157 | * beiscsi_adap_family_disp()- Display adapter family. | ||
1158 | * @dev: ptr to device to get priv structure | ||
1159 | * @attr: device attribute, not used. | ||
1160 | * @buf: contains formatted text driver name and version | ||
1161 | * | ||
1162 | * return | ||
1163 | * size of the formatted string | ||
1164 | **/ | ||
1165 | ssize_t | ||
1166 | beiscsi_adap_family_disp(struct device *dev, struct device_attribute *attr, | ||
1167 | char *buf) | ||
1168 | { | ||
1169 | uint16_t dev_id = 0; | ||
1170 | struct Scsi_Host *shost = class_to_shost(dev); | ||
1171 | struct beiscsi_hba *phba = iscsi_host_priv(shost); | ||
1172 | |||
1173 | dev_id = phba->pcidev->device; | ||
1174 | switch (dev_id) { | ||
1175 | case BE_DEVICE_ID1: | ||
1176 | case OC_DEVICE_ID1: | ||
1177 | case OC_DEVICE_ID2: | ||
1178 | return snprintf(buf, PAGE_SIZE, "BE2 Adapter Family\n"); | ||
1179 | break; | ||
1180 | case BE_DEVICE_ID2: | ||
1181 | case OC_DEVICE_ID3: | ||
1182 | return snprintf(buf, PAGE_SIZE, "BE3-R Adapter Family\n"); | ||
1183 | break; | ||
1184 | case OC_SKH_ID1: | ||
1185 | return snprintf(buf, PAGE_SIZE, "Skyhawk-R Adapter Family\n"); | ||
1186 | break; | ||
1187 | default: | ||
1188 | return snprintf(buf, PAGE_SIZE, | ||
1189 | "Unkown Adapter Family: 0x%x\n", dev_id); | ||
1190 | break; | ||
1191 | } | ||
1192 | } | ||
1193 | |||
1194 | |||
1156 | void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params, | 1195 | void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params, |
1157 | struct wrb_handle *pwrb_handle, | 1196 | struct wrb_handle *pwrb_handle, |
1158 | struct be_mem_descriptor *mem_descr) | 1197 | struct be_mem_descriptor *mem_descr) |
diff --git a/drivers/scsi/be2iscsi/be_mgmt.h b/drivers/scsi/be2iscsi/be_mgmt.h index 4ec61274e70c..e2c222a1cc83 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.h +++ b/drivers/scsi/be2iscsi/be_mgmt.h | |||
@@ -305,6 +305,9 @@ int mgmt_set_vlan(struct beiscsi_hba *phba, uint16_t vlan_tag); | |||
305 | ssize_t beiscsi_drvr_ver_disp(struct device *dev, | 305 | ssize_t beiscsi_drvr_ver_disp(struct device *dev, |
306 | struct device_attribute *attr, char *buf); | 306 | struct device_attribute *attr, char *buf); |
307 | 307 | ||
308 | ssize_t beiscsi_adap_family_disp(struct device *dev, | ||
309 | struct device_attribute *attr, char *buf); | ||
310 | |||
308 | void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params, | 311 | void beiscsi_offload_cxn_v0(struct beiscsi_offload_params *params, |
309 | struct wrb_handle *pwrb_handle, | 312 | struct wrb_handle *pwrb_handle, |
310 | struct be_mem_descriptor *mem_descr); | 313 | struct be_mem_descriptor *mem_descr); |