diff options
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_ctl.c')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_ctl.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index d99f41c2ca13..5a19e1930b4b 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c | |||
@@ -309,6 +309,39 @@ static ssize_t pm8001_ctl_aap_log_show(struct device *cdev, | |||
309 | } | 309 | } |
310 | static DEVICE_ATTR(aap_log, S_IRUGO, pm8001_ctl_aap_log_show, NULL); | 310 | static DEVICE_ATTR(aap_log, S_IRUGO, pm8001_ctl_aap_log_show, NULL); |
311 | /** | 311 | /** |
312 | * pm8001_ctl_bios_version_show - Bios version Display | ||
313 | * @cdev:pointer to embedded class device | ||
314 | * @buf:the buffer returned | ||
315 | * A sysfs 'read-only' shost attribute. | ||
316 | */ | ||
317 | static ssize_t pm8001_ctl_bios_version_show(struct device *cdev, | ||
318 | struct device_attribute *attr, char *buf) | ||
319 | { | ||
320 | struct Scsi_Host *shost = class_to_shost(cdev); | ||
321 | struct sas_ha_struct *sha = SHOST_TO_SAS_HA(shost); | ||
322 | struct pm8001_hba_info *pm8001_ha = sha->lldd_ha; | ||
323 | char *str = buf; | ||
324 | void *virt_addr; | ||
325 | int bios_index; | ||
326 | DECLARE_COMPLETION_ONSTACK(completion); | ||
327 | struct pm8001_ioctl_payload payload; | ||
328 | |||
329 | pm8001_ha->nvmd_completion = &completion; | ||
330 | payload.minor_function = 7; | ||
331 | payload.offset = 0; | ||
332 | payload.length = 4096; | ||
333 | payload.func_specific = kzalloc(4096, GFP_KERNEL); | ||
334 | PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload); | ||
335 | wait_for_completion(&completion); | ||
336 | virt_addr = pm8001_ha->memoryMap.region[NVMD].virt_ptr; | ||
337 | for (bios_index = BIOSOFFSET; bios_index < BIOS_OFFSET_LIMIT; | ||
338 | bios_index++) | ||
339 | str += sprintf(str, "%c", | ||
340 | *((u8 *)((u8 *)virt_addr+bios_index))); | ||
341 | return str - buf; | ||
342 | } | ||
343 | static DEVICE_ATTR(bios_version, S_IRUGO, pm8001_ctl_bios_version_show, NULL); | ||
344 | /** | ||
312 | * pm8001_ctl_aap_log_show - IOP event log | 345 | * pm8001_ctl_aap_log_show - IOP event log |
313 | * @cdev: pointer to embedded class device | 346 | * @cdev: pointer to embedded class device |
314 | * @buf: the buffer returned | 347 | * @buf: the buffer returned |
@@ -609,6 +642,7 @@ struct device_attribute *pm8001_host_attrs[] = { | |||
609 | &dev_attr_sas_spec_support, | 642 | &dev_attr_sas_spec_support, |
610 | &dev_attr_logging_level, | 643 | &dev_attr_logging_level, |
611 | &dev_attr_host_sas_address, | 644 | &dev_attr_host_sas_address, |
645 | &dev_attr_bios_version, | ||
612 | NULL, | 646 | NULL, |
613 | }; | 647 | }; |
614 | 648 | ||