diff options
author | Giridhar Malavali <giridhar.malavali@qlogic.com> | 2010-04-12 20:59:55 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-05-01 15:11:17 -0400 |
commit | a9083016a5314b3aeba6e0d2e814872e72168c08 (patch) | |
tree | 5b8dbdfe6abfe1c452dc6684ed81eea65edc1a28 /drivers/scsi/qla2xxx/qla_attr.c | |
parent | c446c1f9907e84d014edb0bf3501f30cb512e06a (diff) |
[SCSI] qla2xxx: Add ISP82XX support.
Enhanced the driver to support new FCoE host bus adapter.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_attr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 0710e3c8760f..c272af4a76e4 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -41,6 +41,12 @@ qla2x00_sysfs_write_fw_dump(struct kobject *kobj, | |||
41 | struct qla_hw_data *ha = vha->hw; | 41 | struct qla_hw_data *ha = vha->hw; |
42 | int reading; | 42 | int reading; |
43 | 43 | ||
44 | if (IS_QLA82XX(ha)) { | ||
45 | DEBUG2(qla_printk(KERN_INFO, ha, | ||
46 | "Firmware dump not supported for ISP82xx\n")); | ||
47 | return count; | ||
48 | } | ||
49 | |||
44 | if (off != 0) | 50 | if (off != 0) |
45 | return (0); | 51 | return (0); |
46 | 52 | ||
@@ -313,8 +319,8 @@ qla2x00_sysfs_write_optrom_ctl(struct kobject *kobj, | |||
313 | else if (start == (ha->flt_region_boot * 4) || | 319 | else if (start == (ha->flt_region_boot * 4) || |
314 | start == (ha->flt_region_fw * 4)) | 320 | start == (ha->flt_region_fw * 4)) |
315 | valid = 1; | 321 | valid = 1; |
316 | else if (IS_QLA25XX(ha) || IS_QLA81XX(ha)) | 322 | else if (IS_QLA25XX(ha) || IS_QLA8XXX_TYPE(ha)) |
317 | valid = 1; | 323 | valid = 1; |
318 | if (!valid) { | 324 | if (!valid) { |
319 | qla_printk(KERN_WARNING, ha, | 325 | qla_printk(KERN_WARNING, ha, |
320 | "Invalid start region 0x%x/0x%x.\n", start, size); | 326 | "Invalid start region 0x%x/0x%x.\n", start, size); |
@@ -517,6 +523,7 @@ qla2x00_sysfs_write_reset(struct kobject *kobj, | |||
517 | struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, | 523 | struct scsi_qla_host *vha = shost_priv(dev_to_shost(container_of(kobj, |
518 | struct device, kobj))); | 524 | struct device, kobj))); |
519 | struct qla_hw_data *ha = vha->hw; | 525 | struct qla_hw_data *ha = vha->hw; |
526 | struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); | ||
520 | int type; | 527 | int type; |
521 | 528 | ||
522 | if (off != 0) | 529 | if (off != 0) |
@@ -551,6 +558,20 @@ qla2x00_sysfs_write_reset(struct kobject *kobj, | |||
551 | "MPI reset failed on (%ld).\n", vha->host_no); | 558 | "MPI reset failed on (%ld).\n", vha->host_no); |
552 | scsi_unblock_requests(vha->host); | 559 | scsi_unblock_requests(vha->host); |
553 | break; | 560 | break; |
561 | case 0x2025e: | ||
562 | if (!IS_QLA82XX(ha) || vha != base_vha) { | ||
563 | qla_printk(KERN_INFO, ha, | ||
564 | "FCoE ctx reset not supported for host%ld.\n", | ||
565 | vha->host_no); | ||
566 | return count; | ||
567 | } | ||
568 | |||
569 | qla_printk(KERN_INFO, ha, | ||
570 | "Issuing FCoE CTX reset on host%ld.\n", vha->host_no); | ||
571 | set_bit(FCOE_CTX_RESET_NEEDED, &vha->dpc_flags); | ||
572 | qla2xxx_wake_dpc(vha); | ||
573 | qla2x00_wait_for_fcoe_ctx_reset(vha); | ||
574 | break; | ||
554 | } | 575 | } |
555 | return count; | 576 | return count; |
556 | } | 577 | } |
@@ -836,7 +857,7 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha) | |||
836 | continue; | 857 | continue; |
837 | if (iter->is4GBp_only == 2 && !IS_QLA25XX(vha->hw)) | 858 | if (iter->is4GBp_only == 2 && !IS_QLA25XX(vha->hw)) |
838 | continue; | 859 | continue; |
839 | if (iter->is4GBp_only == 3 && !IS_QLA81XX(vha->hw)) | 860 | if (iter->is4GBp_only == 3 && !(IS_QLA8XXX_TYPE(vha->hw))) |
840 | continue; | 861 | continue; |
841 | 862 | ||
842 | ret = sysfs_create_bin_file(&host->shost_gendev.kobj, | 863 | ret = sysfs_create_bin_file(&host->shost_gendev.kobj, |
@@ -860,7 +881,7 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *vha) | |||
860 | continue; | 881 | continue; |
861 | if (iter->is4GBp_only == 2 && !IS_QLA25XX(ha)) | 882 | if (iter->is4GBp_only == 2 && !IS_QLA25XX(ha)) |
862 | continue; | 883 | continue; |
863 | if (iter->is4GBp_only == 3 && !IS_QLA81XX(ha)) | 884 | if (iter->is4GBp_only == 3 && !!(IS_QLA8XXX_TYPE(vha->hw))) |
864 | continue; | 885 | continue; |
865 | 886 | ||
866 | sysfs_remove_bin_file(&host->shost_gendev.kobj, | 887 | sysfs_remove_bin_file(&host->shost_gendev.kobj, |
@@ -1233,7 +1254,7 @@ qla2x00_vlan_id_show(struct device *dev, struct device_attribute *attr, | |||
1233 | { | 1254 | { |
1234 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1255 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1235 | 1256 | ||
1236 | if (!IS_QLA81XX(vha->hw)) | 1257 | if (!IS_QLA8XXX_TYPE(vha->hw)) |
1237 | return snprintf(buf, PAGE_SIZE, "\n"); | 1258 | return snprintf(buf, PAGE_SIZE, "\n"); |
1238 | 1259 | ||
1239 | return snprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); | 1260 | return snprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); |
@@ -1245,7 +1266,7 @@ qla2x00_vn_port_mac_address_show(struct device *dev, | |||
1245 | { | 1266 | { |
1246 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); | 1267 | scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); |
1247 | 1268 | ||
1248 | if (!IS_QLA81XX(vha->hw)) | 1269 | if (!IS_QLA8XXX_TYPE(vha->hw)) |
1249 | return snprintf(buf, PAGE_SIZE, "\n"); | 1270 | return snprintf(buf, PAGE_SIZE, "\n"); |
1250 | 1271 | ||
1251 | return snprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", | 1272 | return snprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", |
@@ -1922,7 +1943,7 @@ qla2x00_init_host_attr(scsi_qla_host_t *vha) | |||
1922 | fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; | 1943 | fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; |
1923 | fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; | 1944 | fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; |
1924 | 1945 | ||
1925 | if (IS_QLA81XX(ha)) | 1946 | if (IS_QLA8XXX_TYPE(ha)) |
1926 | speed = FC_PORTSPEED_10GBIT; | 1947 | speed = FC_PORTSPEED_10GBIT; |
1927 | else if (IS_QLA25XX(ha)) | 1948 | else if (IS_QLA25XX(ha)) |
1928 | speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | | 1949 | speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | |