aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/bfa/bfad_attr.c
diff options
context:
space:
mode:
authorKrishna Gudipati <kgudipat@brocade.com>2011-06-13 18:54:31 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 16:56:05 -0400
commit75332a70a84908810ab5f525b03f230be9e31753 (patch)
treef15001807ccaf2b9857e6de82640faff160c7bb1 /drivers/scsi/bfa/bfad_attr.c
parente2187d7f38967aeaf4148cdbe3498f76f4f71bca (diff)
[SCSI] bfa: Driver initialization and model description fix
- Moved FCS initialization, which internally does the im_port creation as well as the scsi_host creation before bfa_init. Once the bfa_init is complete & successful: - Reset the FCS base port cfg params such as pwwn/nwwn and setup fc host params - based on the values learned during the ioc getattr request. - Change needed to support BSG commands even on bfa init failure. - Model description fixes for Brocade adapters. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bfa/bfad_attr.c')
-rw-r--r--drivers/scsi/bfa/bfad_attr.c48
1 files changed, 39 insertions, 9 deletions
diff --git a/drivers/scsi/bfa/bfad_attr.c b/drivers/scsi/bfa/bfad_attr.c
index 3127df2951e6..97391cc727b3 100644
--- a/drivers/scsi/bfa/bfad_attr.c
+++ b/drivers/scsi/bfa/bfad_attr.c
@@ -677,8 +677,10 @@ bfad_im_model_desc_show(struct device *dev, struct device_attribute *attr,
677 struct bfad_s *bfad = im_port->bfad; 677 struct bfad_s *bfad = im_port->bfad;
678 char model[BFA_ADAPTER_MODEL_NAME_LEN]; 678 char model[BFA_ADAPTER_MODEL_NAME_LEN];
679 char model_descr[BFA_ADAPTER_MODEL_DESCR_LEN]; 679 char model_descr[BFA_ADAPTER_MODEL_DESCR_LEN];
680 int nports = 0;
680 681
681 bfa_get_adapter_model(&bfad->bfa, model); 682 bfa_get_adapter_model(&bfad->bfa, model);
683 nports = bfa_get_nports(&bfad->bfa);
682 if (!strcmp(model, "Brocade-425")) 684 if (!strcmp(model, "Brocade-425"))
683 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 685 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
684 "Brocade 4Gbps PCIe dual port FC HBA"); 686 "Brocade 4Gbps PCIe dual port FC HBA");
@@ -687,10 +689,10 @@ bfad_im_model_desc_show(struct device *dev, struct device_attribute *attr,
687 "Brocade 8Gbps PCIe dual port FC HBA"); 689 "Brocade 8Gbps PCIe dual port FC HBA");
688 else if (!strcmp(model, "Brocade-42B")) 690 else if (!strcmp(model, "Brocade-42B"))
689 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 691 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
690 "HP 4Gbps PCIe dual port FC HBA"); 692 "Brocade 4Gbps PCIe dual port FC HBA for HP");
691 else if (!strcmp(model, "Brocade-82B")) 693 else if (!strcmp(model, "Brocade-82B"))
692 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 694 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
693 "HP 8Gbps PCIe dual port FC HBA"); 695 "Brocade 8Gbps PCIe dual port FC HBA for HP");
694 else if (!strcmp(model, "Brocade-1010")) 696 else if (!strcmp(model, "Brocade-1010"))
695 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 697 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
696 "Brocade 10Gbps single port CNA"); 698 "Brocade 10Gbps single port CNA");
@@ -699,7 +701,7 @@ bfad_im_model_desc_show(struct device *dev, struct device_attribute *attr,
699 "Brocade 10Gbps dual port CNA"); 701 "Brocade 10Gbps dual port CNA");
700 else if (!strcmp(model, "Brocade-1007")) 702 else if (!strcmp(model, "Brocade-1007"))
701 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 703 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
702 "Brocade 10Gbps CNA"); 704 "Brocade 10Gbps CNA for IBM Blade Center");
703 else if (!strcmp(model, "Brocade-415")) 705 else if (!strcmp(model, "Brocade-415"))
704 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 706 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
705 "Brocade 4Gbps PCIe single port FC HBA"); 707 "Brocade 4Gbps PCIe single port FC HBA");
@@ -708,17 +710,45 @@ bfad_im_model_desc_show(struct device *dev, struct device_attribute *attr,
708 "Brocade 8Gbps PCIe single port FC HBA"); 710 "Brocade 8Gbps PCIe single port FC HBA");
709 else if (!strcmp(model, "Brocade-41B")) 711 else if (!strcmp(model, "Brocade-41B"))
710 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 712 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
711 "HP 4Gbps PCIe single port FC HBA"); 713 "Brocade 4Gbps PCIe single port FC HBA for HP");
712 else if (!strcmp(model, "Brocade-81B")) 714 else if (!strcmp(model, "Brocade-81B"))
713 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 715 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
714 "HP 8Gbps PCIe single port FC HBA"); 716 "Brocade 8Gbps PCIe single port FC HBA for HP");
715 else if (!strcmp(model, "Brocade-804")) 717 else if (!strcmp(model, "Brocade-804"))
716 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 718 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
717 "HP Bladesystem C-class 8Gbps FC HBA"); 719 "Brocade 8Gbps FC HBA for HP Bladesystem C-class");
718 else if (!strcmp(model, "Brocade-902")) 720 else if (!strcmp(model, "Brocade-902") ||
721 !strcmp(model, "Brocade-1741"))
719 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 722 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
720 "Brocade 10Gbps CNA"); 723 "Brocade 10Gbps CNA for Dell M-Series Blade Servers");
721 else 724 else if (strstr(model, "Brocade-1560")) {
725 if (nports == 1)
726 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
727 "Brocade 16Gbps PCIe single port FC HBA");
728 else
729 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
730 "Brocade 16Gbps PCIe dual port FC HBA");
731 } else if (strstr(model, "Brocade-1710")) {
732 if (nports == 1)
733 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
734 "Brocade 10Gbps single port CNA");
735 else
736 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
737 "Brocade 10Gbps dual port CNA");
738 } else if (strstr(model, "Brocade-1860")) {
739 if (nports == 1 && bfa_ioc_is_cna(&bfad->bfa.ioc))
740 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
741 "Brocade 10Gbps single port CNA");
742 else if (nports == 1 && !bfa_ioc_is_cna(&bfad->bfa.ioc))
743 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
744 "Brocade 16Gbps PCIe single port FC HBA");
745 else if (nports == 2 && bfa_ioc_is_cna(&bfad->bfa.ioc))
746 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
747 "Brocade 10Gbps dual port CNA");
748 else if (nports == 2 && !bfa_ioc_is_cna(&bfad->bfa.ioc))
749 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
750 "Brocade 16Gbps PCIe dual port FC HBA");
751 } else
722 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN, 752 snprintf(model_descr, BFA_ADAPTER_MODEL_DESCR_LEN,
723 "Invalid Model"); 753 "Invalid Model");
724 754