diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 3eb2208675ae..1612f9200a52 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -98,7 +98,7 @@ qla2x00_sysfs_read_nvram(struct kobject *kobj, | |||
98 | 98 | ||
99 | /* Read NVRAM. */ | 99 | /* Read NVRAM. */ |
100 | spin_lock_irqsave(&ha->hardware_lock, flags); | 100 | spin_lock_irqsave(&ha->hardware_lock, flags); |
101 | ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->nvram_base, | 101 | ha->isp_ops->read_nvram(ha, (uint8_t *)buf, ha->nvram_base, |
102 | ha->nvram_size); | 102 | ha->nvram_size); |
103 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 103 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
104 | 104 | ||
@@ -119,7 +119,7 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, | |||
119 | return 0; | 119 | return 0; |
120 | 120 | ||
121 | /* Checksum NVRAM. */ | 121 | /* Checksum NVRAM. */ |
122 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { | 122 | if (IS_FWI2_CAPABLE(ha)) { |
123 | uint32_t *iter; | 123 | uint32_t *iter; |
124 | uint32_t chksum; | 124 | uint32_t chksum; |
125 | 125 | ||
@@ -143,7 +143,7 @@ qla2x00_sysfs_write_nvram(struct kobject *kobj, | |||
143 | 143 | ||
144 | /* Write NVRAM. */ | 144 | /* Write NVRAM. */ |
145 | spin_lock_irqsave(&ha->hardware_lock, flags); | 145 | spin_lock_irqsave(&ha->hardware_lock, flags); |
146 | ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->nvram_base, count); | 146 | ha->isp_ops->write_nvram(ha, (uint8_t *)buf, ha->nvram_base, count); |
147 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 147 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
148 | 148 | ||
149 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); | 149 | set_bit(ISP_ABORT_NEEDED, &ha->dpc_flags); |
@@ -206,7 +206,7 @@ static struct bin_attribute sysfs_optrom_attr = { | |||
206 | .name = "optrom", | 206 | .name = "optrom", |
207 | .mode = S_IRUSR | S_IWUSR, | 207 | .mode = S_IRUSR | S_IWUSR, |
208 | }, | 208 | }, |
209 | .size = OPTROM_SIZE_24XX, | 209 | .size = 0, |
210 | .read = qla2x00_sysfs_read_optrom, | 210 | .read = qla2x00_sysfs_read_optrom, |
211 | .write = qla2x00_sysfs_write_optrom, | 211 | .write = qla2x00_sysfs_write_optrom, |
212 | }; | 212 | }; |
@@ -252,7 +252,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, | |||
252 | } | 252 | } |
253 | 253 | ||
254 | memset(ha->optrom_buffer, 0, ha->optrom_size); | 254 | memset(ha->optrom_buffer, 0, ha->optrom_size); |
255 | ha->isp_ops.read_optrom(ha, ha->optrom_buffer, 0, | 255 | ha->isp_ops->read_optrom(ha, ha->optrom_buffer, 0, |
256 | ha->optrom_size); | 256 | ha->optrom_size); |
257 | break; | 257 | break; |
258 | case 2: | 258 | case 2: |
@@ -275,7 +275,7 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, | |||
275 | if (ha->optrom_state != QLA_SWRITING) | 275 | if (ha->optrom_state != QLA_SWRITING) |
276 | break; | 276 | break; |
277 | 277 | ||
278 | ha->isp_ops.write_optrom(ha, ha->optrom_buffer, 0, | 278 | ha->isp_ops->write_optrom(ha, ha->optrom_buffer, 0, |
279 | ha->optrom_size); | 279 | ha->optrom_size); |
280 | break; | 280 | break; |
281 | } | 281 | } |
@@ -305,7 +305,8 @@ qla2x00_sysfs_read_vpd(struct kobject *kobj, | |||
305 | 305 | ||
306 | /* Read NVRAM. */ | 306 | /* Read NVRAM. */ |
307 | spin_lock_irqsave(&ha->hardware_lock, flags); | 307 | spin_lock_irqsave(&ha->hardware_lock, flags); |
308 | ha->isp_ops.read_nvram(ha, (uint8_t *)buf, ha->vpd_base, ha->vpd_size); | 308 | ha->isp_ops->read_nvram(ha, (uint8_t *)buf, ha->vpd_base, |
309 | ha->vpd_size); | ||
309 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 310 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
310 | 311 | ||
311 | return ha->vpd_size; | 312 | return ha->vpd_size; |
@@ -325,7 +326,7 @@ qla2x00_sysfs_write_vpd(struct kobject *kobj, | |||
325 | 326 | ||
326 | /* Write NVRAM. */ | 327 | /* Write NVRAM. */ |
327 | spin_lock_irqsave(&ha->hardware_lock, flags); | 328 | spin_lock_irqsave(&ha->hardware_lock, flags); |
328 | ha->isp_ops.write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); | 329 | ha->isp_ops->write_nvram(ha, (uint8_t *)buf, ha->vpd_base, count); |
329 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 330 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
330 | 331 | ||
331 | return count; | 332 | return count; |
@@ -410,7 +411,7 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *ha) | |||
410 | int ret; | 411 | int ret; |
411 | 412 | ||
412 | for (iter = bin_file_entries; iter->name; iter++) { | 413 | for (iter = bin_file_entries; iter->name; iter++) { |
413 | if (iter->is4GBp_only && (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))) | 414 | if (iter->is4GBp_only && !IS_FWI2_CAPABLE(ha)) |
414 | continue; | 415 | continue; |
415 | 416 | ||
416 | ret = sysfs_create_bin_file(&host->shost_gendev.kobj, | 417 | ret = sysfs_create_bin_file(&host->shost_gendev.kobj, |
@@ -429,7 +430,7 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha) | |||
429 | struct sysfs_entry *iter; | 430 | struct sysfs_entry *iter; |
430 | 431 | ||
431 | for (iter = bin_file_entries; iter->name; iter++) { | 432 | for (iter = bin_file_entries; iter->name; iter++) { |
432 | if (iter->is4GBp_only && (!IS_QLA24XX(ha) && !IS_QLA54XX(ha))) | 433 | if (iter->is4GBp_only && !IS_FWI2_CAPABLE(ha)) |
433 | continue; | 434 | continue; |
434 | 435 | ||
435 | sysfs_remove_bin_file(&host->shost_gendev.kobj, | 436 | sysfs_remove_bin_file(&host->shost_gendev.kobj, |
@@ -437,7 +438,7 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *ha) | |||
437 | } | 438 | } |
438 | 439 | ||
439 | if (ha->beacon_blink_led == 1) | 440 | if (ha->beacon_blink_led == 1) |
440 | ha->isp_ops.beacon_off(ha); | 441 | ha->isp_ops->beacon_off(ha); |
441 | } | 442 | } |
442 | 443 | ||
443 | /* Scsi_Host attributes. */ | 444 | /* Scsi_Host attributes. */ |
@@ -455,7 +456,7 @@ qla2x00_fw_version_show(struct class_device *cdev, char *buf) | |||
455 | char fw_str[30]; | 456 | char fw_str[30]; |
456 | 457 | ||
457 | return snprintf(buf, PAGE_SIZE, "%s\n", | 458 | return snprintf(buf, PAGE_SIZE, "%s\n", |
458 | ha->isp_ops.fw_version_str(ha, fw_str)); | 459 | ha->isp_ops->fw_version_str(ha, fw_str)); |
459 | } | 460 | } |
460 | 461 | ||
461 | static ssize_t | 462 | static ssize_t |
@@ -507,7 +508,7 @@ qla2x00_pci_info_show(struct class_device *cdev, char *buf) | |||
507 | char pci_info[30]; | 508 | char pci_info[30]; |
508 | 509 | ||
509 | return snprintf(buf, PAGE_SIZE, "%s\n", | 510 | return snprintf(buf, PAGE_SIZE, "%s\n", |
510 | ha->isp_ops.pci_info_str(ha, pci_info)); | 511 | ha->isp_ops->pci_info_str(ha, pci_info)); |
511 | } | 512 | } |
512 | 513 | ||
513 | static ssize_t | 514 | static ssize_t |
@@ -652,9 +653,9 @@ qla2x00_beacon_store(struct class_device *cdev, const char *buf, | |||
652 | return -EINVAL; | 653 | return -EINVAL; |
653 | 654 | ||
654 | if (val) | 655 | if (val) |
655 | rval = ha->isp_ops.beacon_on(ha); | 656 | rval = ha->isp_ops->beacon_on(ha); |
656 | else | 657 | else |
657 | rval = ha->isp_ops.beacon_off(ha); | 658 | rval = ha->isp_ops->beacon_off(ha); |
658 | 659 | ||
659 | if (rval != QLA_SUCCESS) | 660 | if (rval != QLA_SUCCESS) |
660 | count = 0; | 661 | count = 0; |
@@ -898,7 +899,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost) | |||
898 | pfc_host_stat = &ha->fc_host_stat; | 899 | pfc_host_stat = &ha->fc_host_stat; |
899 | memset(pfc_host_stat, -1, sizeof(struct fc_host_statistics)); | 900 | memset(pfc_host_stat, -1, sizeof(struct fc_host_statistics)); |
900 | 901 | ||
901 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { | 902 | if (IS_FWI2_CAPABLE(ha)) { |
902 | rval = qla24xx_get_isp_stats(ha, (uint32_t *)&stat_buf, | 903 | rval = qla24xx_get_isp_stats(ha, (uint32_t *)&stat_buf, |
903 | sizeof(stat_buf) / 4, mb_stat); | 904 | sizeof(stat_buf) / 4, mb_stat); |
904 | } else if (atomic_read(&ha->loop_state) == LOOP_READY && | 905 | } else if (atomic_read(&ha->loop_state) == LOOP_READY && |