diff options
author | Jayamohan Kallickal <jayamohank@gmail.com> | 2013-04-05 23:38:28 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-02 11:10:11 -0400 |
commit | 22661e25cca8bb780f79756e7a7e201b478f8c14 (patch) | |
tree | 0bfd3f90706e83fd5caf49a8271fd38117176806 /drivers/scsi/be2iscsi | |
parent | ef9e1b9bdca82d9b692da77e35595c2d4b87a4b5 (diff) |
[SCSI] be2iscsi: Fix displaying the FW Version from driver.
The mgmt_hba_attributes structure declared was not proper and
because of that the FW response returned for the MBX_CMD was not
matching. This issue went unnoticed as mgmt_hba_attribs structure
members were never used in the code path.
This fix of displaying the FW version had to change the mgmt_hba_attrib
structure also. The latest driver will also work with the older FW as
the issue was in the driver declaration.
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_main.h | 2 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.c | 21 | ||||
-rw-r--r-- | drivers/scsi/be2iscsi/be_mgmt.h | 30 |
4 files changed, 42 insertions, 13 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 6be5e296c3c1..adc662dc4ac8 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -153,10 +153,12 @@ BEISCSI_RW_ATTR(log_enable, 0x00, | |||
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 | DEVICE_ATTR(beiscsi_adapter_family, S_IRUGO, beiscsi_adap_family_disp, NULL); |
156 | DEVICE_ATTR(beiscsi_fw_ver, S_IRUGO, beiscsi_fw_ver_disp, NULL); | ||
156 | struct device_attribute *beiscsi_attrs[] = { | 157 | struct device_attribute *beiscsi_attrs[] = { |
157 | &dev_attr_beiscsi_log_enable, | 158 | &dev_attr_beiscsi_log_enable, |
158 | &dev_attr_beiscsi_drvr_ver, | 159 | &dev_attr_beiscsi_drvr_ver, |
159 | &dev_attr_beiscsi_adapter_family, | 160 | &dev_attr_beiscsi_adapter_family, |
161 | &dev_attr_beiscsi_fw_ver, | ||
160 | NULL, | 162 | NULL, |
161 | }; | 163 | }; |
162 | 164 | ||
diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index 77b13c3e463e..3c5df9219b03 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h | |||
@@ -68,6 +68,7 @@ | |||
68 | #define BEISCSI_MAX_NUM_CPUS 7 | 68 | #define BEISCSI_MAX_NUM_CPUS 7 |
69 | #define OC_SKH_MAX_NUM_CPUS 31 | 69 | #define OC_SKH_MAX_NUM_CPUS 31 |
70 | 70 | ||
71 | #define BEISCSI_VER_STRLEN 32 | ||
71 | 72 | ||
72 | #define BEISCSI_SGLIST_ELEMENTS 30 | 73 | #define BEISCSI_SGLIST_ELEMENTS 30 |
73 | 74 | ||
@@ -341,6 +342,7 @@ struct beiscsi_hba { | |||
341 | struct delayed_work beiscsi_hw_check_task; | 342 | struct delayed_work beiscsi_hw_check_task; |
342 | 343 | ||
343 | u8 mac_address[ETH_ALEN]; | 344 | u8 mac_address[ETH_ALEN]; |
345 | char fw_ver_str[BEISCSI_VER_STRLEN]; | ||
344 | char wq_name[20]; | 346 | char wq_name[20]; |
345 | struct workqueue_struct *wq; /* The actuak work queue */ | 347 | struct workqueue_struct *wq; /* The actuak work queue */ |
346 | struct be_ctrl_info ctrl; | 348 | struct be_ctrl_info ctrl; |
diff --git a/drivers/scsi/be2iscsi/be_mgmt.c b/drivers/scsi/be2iscsi/be_mgmt.c index 55cc9902263d..02bad04112ff 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.c +++ b/drivers/scsi/be2iscsi/be_mgmt.c | |||
@@ -368,6 +368,8 @@ int mgmt_check_supported_fw(struct be_ctrl_info *ctrl, | |||
368 | beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, | 368 | beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, |
369 | "BM_%d : phba->fw_config.iscsi_features = %d\n", | 369 | "BM_%d : phba->fw_config.iscsi_features = %d\n", |
370 | phba->fw_config.iscsi_features); | 370 | phba->fw_config.iscsi_features); |
371 | memcpy(phba->fw_ver_str, resp->params.hba_attribs. | ||
372 | firmware_version_string, BEISCSI_VER_STRLEN); | ||
371 | } else | 373 | } else |
372 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, | 374 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, |
373 | "BG_%d : Failed in mgmt_check_supported_fw\n"); | 375 | "BG_%d : Failed in mgmt_check_supported_fw\n"); |
@@ -1260,6 +1262,25 @@ beiscsi_drvr_ver_disp(struct device *dev, struct device_attribute *attr, | |||
1260 | } | 1262 | } |
1261 | 1263 | ||
1262 | /** | 1264 | /** |
1265 | * beiscsi_fw_ver_disp()- Display Firmware Version | ||
1266 | * @dev: ptr to device not used. | ||
1267 | * @attr: device attribute, not used. | ||
1268 | * @buf: contains formatted text Firmware version | ||
1269 | * | ||
1270 | * return | ||
1271 | * size of the formatted string | ||
1272 | **/ | ||
1273 | ssize_t | ||
1274 | beiscsi_fw_ver_disp(struct device *dev, struct device_attribute *attr, | ||
1275 | char *buf) | ||
1276 | { | ||
1277 | struct Scsi_Host *shost = class_to_shost(dev); | ||
1278 | struct beiscsi_hba *phba = iscsi_host_priv(shost); | ||
1279 | |||
1280 | return snprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str); | ||
1281 | } | ||
1282 | |||
1283 | /** | ||
1263 | * beiscsi_adap_family_disp()- Display adapter family. | 1284 | * beiscsi_adap_family_disp()- Display adapter family. |
1264 | * @dev: ptr to device to get priv structure | 1285 | * @dev: ptr to device to get priv structure |
1265 | * @attr: device attribute, not used. | 1286 | * @attr: device attribute, not used. |
diff --git a/drivers/scsi/be2iscsi/be_mgmt.h b/drivers/scsi/be2iscsi/be_mgmt.h index 2e4968add799..00f3a4fd1c79 100644 --- a/drivers/scsi/be2iscsi/be_mgmt.h +++ b/drivers/scsi/be2iscsi/be_mgmt.h | |||
@@ -156,25 +156,25 @@ union invalidate_commands_params { | |||
156 | } __packed; | 156 | } __packed; |
157 | 157 | ||
158 | struct mgmt_hba_attributes { | 158 | struct mgmt_hba_attributes { |
159 | u8 flashrom_version_string[32]; | 159 | u8 flashrom_version_string[BEISCSI_VER_STRLEN]; |
160 | u8 manufacturer_name[32]; | 160 | u8 manufacturer_name[BEISCSI_VER_STRLEN]; |
161 | u32 supported_modes; | 161 | u32 supported_modes; |
162 | u8 seeprom_version_lo; | 162 | u8 seeprom_version_lo; |
163 | u8 seeprom_version_hi; | 163 | u8 seeprom_version_hi; |
164 | u8 rsvd0[2]; | 164 | u8 rsvd0[2]; |
165 | u32 fw_cmd_data_struct_version; | 165 | u32 fw_cmd_data_struct_version; |
166 | u32 ep_fw_data_struct_version; | 166 | u32 ep_fw_data_struct_version; |
167 | u32 future_reserved[12]; | 167 | u8 ncsi_version_string[12]; |
168 | u32 default_extended_timeout; | 168 | u32 default_extended_timeout; |
169 | u8 controller_model_number[32]; | 169 | u8 controller_model_number[BEISCSI_VER_STRLEN]; |
170 | u8 controller_description[64]; | 170 | u8 controller_description[64]; |
171 | u8 controller_serial_number[32]; | 171 | u8 controller_serial_number[BEISCSI_VER_STRLEN]; |
172 | u8 ip_version_string[32]; | 172 | u8 ip_version_string[BEISCSI_VER_STRLEN]; |
173 | u8 firmware_version_string[32]; | 173 | u8 firmware_version_string[BEISCSI_VER_STRLEN]; |
174 | u8 bios_version_string[32]; | 174 | u8 bios_version_string[BEISCSI_VER_STRLEN]; |
175 | u8 redboot_version_string[32]; | 175 | u8 redboot_version_string[BEISCSI_VER_STRLEN]; |
176 | u8 driver_version_string[32]; | 176 | u8 driver_version_string[BEISCSI_VER_STRLEN]; |
177 | u8 fw_on_flash_version_string[32]; | 177 | u8 fw_on_flash_version_string[BEISCSI_VER_STRLEN]; |
178 | u32 functionalities_supported; | 178 | u32 functionalities_supported; |
179 | u16 max_cdblength; | 179 | u16 max_cdblength; |
180 | u8 asic_revision; | 180 | u8 asic_revision; |
@@ -190,7 +190,8 @@ struct mgmt_hba_attributes { | |||
190 | u32 firmware_post_status; | 190 | u32 firmware_post_status; |
191 | u32 hba_mtu[8]; | 191 | u32 hba_mtu[8]; |
192 | u8 iscsi_features; | 192 | u8 iscsi_features; |
193 | u8 future_u8[3]; | 193 | u8 asic_generation; |
194 | u8 future_u8[2]; | ||
194 | u32 future_u32[3]; | 195 | u32 future_u32[3]; |
195 | } __packed; | 196 | } __packed; |
196 | 197 | ||
@@ -207,7 +208,7 @@ struct mgmt_controller_attributes { | |||
207 | u64 unique_identifier; | 208 | u64 unique_identifier; |
208 | u8 netfilters; | 209 | u8 netfilters; |
209 | u8 rsvd0[3]; | 210 | u8 rsvd0[3]; |
210 | u8 future_u32[4]; | 211 | u32 future_u32[4]; |
211 | } __packed; | 212 | } __packed; |
212 | 213 | ||
213 | struct be_mgmt_controller_attributes { | 214 | struct be_mgmt_controller_attributes { |
@@ -311,6 +312,9 @@ int mgmt_set_vlan(struct beiscsi_hba *phba, uint16_t vlan_tag); | |||
311 | ssize_t beiscsi_drvr_ver_disp(struct device *dev, | 312 | ssize_t beiscsi_drvr_ver_disp(struct device *dev, |
312 | struct device_attribute *attr, char *buf); | 313 | struct device_attribute *attr, char *buf); |
313 | 314 | ||
315 | ssize_t beiscsi_fw_ver_disp(struct device *dev, | ||
316 | struct device_attribute *attr, char *buf); | ||
317 | |||
314 | ssize_t beiscsi_adap_family_disp(struct device *dev, | 318 | ssize_t beiscsi_adap_family_disp(struct device *dev, |
315 | struct device_attribute *attr, char *buf); | 319 | struct device_attribute *attr, char *buf); |
316 | 320 | ||