aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/lpfc/lpfc_ct.c24
-rw-r--r--drivers/scsi/lpfc/lpfc_hw.h14
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c182
3 files changed, 126 insertions, 94 deletions
diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c
index 0c982bbc4c77..f3b280313a74 100644
--- a/drivers/scsi/lpfc/lpfc_ct.c
+++ b/drivers/scsi/lpfc/lpfc_ct.c
@@ -1014,19 +1014,19 @@ lpfc_fdmi_cmd(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, int cmdcode)
1014 ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) pab + size); 1014 ae = (ATTRIBUTE_ENTRY *) ((uint8_t *) pab + size);
1015 ae->ad.bits.AttrType = be16_to_cpu(SUPPORTED_SPEED); 1015 ae->ad.bits.AttrType = be16_to_cpu(SUPPORTED_SPEED);
1016 ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + 4); 1016 ae->ad.bits.AttrLen = be16_to_cpu(FOURBYTES + 4);
1017 if (FC_JEDEC_ID(vp->rev.biuRev) == VIPER_JEDEC_ID) 1017
1018 ae->un.SupportSpeed = 0;
1019 if (phba->lmt & LMT_10Gb)
1018 ae->un.SupportSpeed = HBA_PORTSPEED_10GBIT; 1020 ae->un.SupportSpeed = HBA_PORTSPEED_10GBIT;
1019 else if (FC_JEDEC_ID(vp->rev.biuRev) == HELIOS_JEDEC_ID) 1021 if (phba->lmt & LMT_8Gb)
1020 ae->un.SupportSpeed = HBA_PORTSPEED_4GBIT; 1022 ae->un.SupportSpeed |= HBA_PORTSPEED_8GBIT;
1021 else if ((FC_JEDEC_ID(vp->rev.biuRev) == 1023 if (phba->lmt & LMT_4Gb)
1022 CENTAUR_2G_JEDEC_ID) 1024 ae->un.SupportSpeed |= HBA_PORTSPEED_4GBIT;
1023 || (FC_JEDEC_ID(vp->rev.biuRev) == 1025 if (phba->lmt & LMT_2Gb)
1024 PEGASUS_JEDEC_ID) 1026 ae->un.SupportSpeed |= HBA_PORTSPEED_2GBIT;
1025 || (FC_JEDEC_ID(vp->rev.biuRev) == 1027 if (phba->lmt & LMT_1Gb)
1026 THOR_JEDEC_ID)) 1028 ae->un.SupportSpeed |= HBA_PORTSPEED_1GBIT;
1027 ae->un.SupportSpeed = HBA_PORTSPEED_2GBIT; 1029
1028 else
1029 ae->un.SupportSpeed = HBA_PORTSPEED_1GBIT;
1030 pab->ab.EntryCnt++; 1030 pab->ab.EntryCnt++;
1031 size += FOURBYTES + 4; 1031 size += FOURBYTES + 4;
1032 1032
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h
index 98d39cea7954..54d04188f7cc 100644
--- a/drivers/scsi/lpfc/lpfc_hw.h
+++ b/drivers/scsi/lpfc/lpfc_hw.h
@@ -1711,13 +1711,13 @@ typedef struct {
1711 uint32_t rttov; 1711 uint32_t rttov;
1712 uint32_t altov; 1712 uint32_t altov;
1713 uint32_t lmt; 1713 uint32_t lmt;
1714#define LMT_RESERVED 0x0 /* Not used */ 1714#define LMT_RESERVED 0x000 /* Not used */
1715#define LMT_266_10bit 0x1 /* 265.625 Mbaud 10 bit iface */ 1715#define LMT_1Gb 0x004
1716#define LMT_532_10bit 0x2 /* 531.25 Mbaud 10 bit iface */ 1716#define LMT_2Gb 0x008
1717#define LMT_1063_20bit 0x3 /* 1062.5 Mbaud 20 bit iface */ 1717#define LMT_4Gb 0x040
1718#define LMT_1063_10bit 0x4 /* 1062.5 Mbaud 10 bit iface */ 1718#define LMT_8Gb 0x080
1719#define LMT_2125_10bit 0x8 /* 2125 Mbaud 10 bit iface */ 1719#define LMT_10Gb 0x100
1720#define LMT_4250_10bit 0x40 /* 4250 Mbaud 10 bit iface */ 1720
1721 1721
1722 uint32_t rsvd2; 1722 uint32_t rsvd2;
1723 uint32_t rsvd3; 1723 uint32_t rsvd3;
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 391ca50293f2..5fd98a345347 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -42,7 +42,7 @@
42#include "lpfc_crtn.h" 42#include "lpfc_crtn.h"
43#include "lpfc_version.h" 43#include "lpfc_version.h"
44 44
45static int lpfc_parse_vpd(struct lpfc_hba *, uint8_t *); 45static int lpfc_parse_vpd(struct lpfc_hba *, uint8_t *, int);
46static void lpfc_get_hba_model_desc(struct lpfc_hba *, uint8_t *, uint8_t *); 46static void lpfc_get_hba_model_desc(struct lpfc_hba *, uint8_t *, uint8_t *);
47static int lpfc_post_rcv_buf(struct lpfc_hba *); 47static int lpfc_post_rcv_buf(struct lpfc_hba *);
48 48
@@ -161,9 +161,6 @@ lpfc_config_port_prep(struct lpfc_hba * phba)
161 memcpy(phba->RandomData, (char *)&mb->un.varWords[24], 161 memcpy(phba->RandomData, (char *)&mb->un.varWords[24],
162 sizeof (phba->RandomData)); 162 sizeof (phba->RandomData));
163 163
164 /* Get the default values for Model Name and Description */
165 lpfc_get_hba_model_desc(phba, phba->ModelName, phba->ModelDesc);
166
167 /* Get adapter VPD information */ 164 /* Get adapter VPD information */
168 pmb->context2 = kmalloc(DMP_RSP_SIZE, GFP_KERNEL); 165 pmb->context2 = kmalloc(DMP_RSP_SIZE, GFP_KERNEL);
169 if (!pmb->context2) 166 if (!pmb->context2)
@@ -182,16 +179,15 @@ lpfc_config_port_prep(struct lpfc_hba * phba)
182 "mbxCmd x%x DUMP VPD, mbxStatus x%x\n", 179 "mbxCmd x%x DUMP VPD, mbxStatus x%x\n",
183 phba->brd_no, 180 phba->brd_no,
184 mb->mbxCommand, mb->mbxStatus); 181 mb->mbxCommand, mb->mbxStatus);
185 kfree(lpfc_vpd_data); 182 mb->un.varDmp.word_cnt = 0;
186 lpfc_vpd_data = NULL;
187 break;
188 } 183 }
189 184 if (mb->un.varDmp.word_cnt > DMP_VPD_SIZE - offset)
185 mb->un.varDmp.word_cnt = DMP_VPD_SIZE - offset;
190 lpfc_sli_pcimem_bcopy(pmb->context2, lpfc_vpd_data + offset, 186 lpfc_sli_pcimem_bcopy(pmb->context2, lpfc_vpd_data + offset,
191 mb->un.varDmp.word_cnt); 187 mb->un.varDmp.word_cnt);
192 offset += mb->un.varDmp.word_cnt; 188 offset += mb->un.varDmp.word_cnt;
193 } while (mb->un.varDmp.word_cnt); 189 } while (mb->un.varDmp.word_cnt && offset < DMP_VPD_SIZE);
194 lpfc_parse_vpd(phba, lpfc_vpd_data); 190 lpfc_parse_vpd(phba, lpfc_vpd_data, offset);
195 191
196 kfree(lpfc_vpd_data); 192 kfree(lpfc_vpd_data);
197out_free_context2: 193out_free_context2:
@@ -327,13 +323,22 @@ lpfc_config_port_post(struct lpfc_hba * phba)
327 mb->un.varRdConfig.max_xri + 1; 323 mb->un.varRdConfig.max_xri + 1;
328 324
329 phba->lmt = mb->un.varRdConfig.lmt; 325 phba->lmt = mb->un.varRdConfig.lmt;
330 /* HBA is not 4GB capable, or HBA is not 2GB capable, 326
331 don't let link speed ask for it */ 327 /* Get the default values for Model Name and Description */
332 if ((((phba->lmt & LMT_4250_10bit) != LMT_4250_10bit) && 328 lpfc_get_hba_model_desc(phba, phba->ModelName, phba->ModelDesc);
333 (phba->cfg_link_speed > LINK_SPEED_2G)) || 329
334 (((phba->lmt & LMT_2125_10bit) != LMT_2125_10bit) && 330 if ((phba->cfg_link_speed > LINK_SPEED_10G)
335 (phba->cfg_link_speed > LINK_SPEED_1G))) { 331 || ((phba->cfg_link_speed == LINK_SPEED_1G)
336 /* Reset link speed to auto. 1G/2GB HBA cfg'd for 4G */ 332 && !(phba->lmt & LMT_1Gb))
333 || ((phba->cfg_link_speed == LINK_SPEED_2G)
334 && !(phba->lmt & LMT_2Gb))
335 || ((phba->cfg_link_speed == LINK_SPEED_4G)
336 && !(phba->lmt & LMT_4Gb))
337 || ((phba->cfg_link_speed == LINK_SPEED_8G)
338 && !(phba->lmt & LMT_8Gb))
339 || ((phba->cfg_link_speed == LINK_SPEED_10G)
340 && !(phba->lmt & LMT_10Gb))) {
341 /* Reset link speed to auto */
337 lpfc_printf_log(phba, 342 lpfc_printf_log(phba,
338 KERN_WARNING, 343 KERN_WARNING,
339 LOG_LINK_EVENT, 344 LOG_LINK_EVENT,
@@ -647,7 +652,7 @@ lpfc_handle_latt_err_exit:
647/* */ 652/* */
648/************************************************************************/ 653/************************************************************************/
649static int 654static int
650lpfc_parse_vpd(struct lpfc_hba * phba, uint8_t * vpd) 655lpfc_parse_vpd(struct lpfc_hba * phba, uint8_t * vpd, int len)
651{ 656{
652 uint8_t lenlo, lenhi; 657 uint8_t lenlo, lenhi;
653 uint32_t Length; 658 uint32_t Length;
@@ -666,9 +671,10 @@ lpfc_parse_vpd(struct lpfc_hba * phba, uint8_t * vpd)
666 phba->brd_no, 671 phba->brd_no,
667 (uint32_t) vpd[0], (uint32_t) vpd[1], (uint32_t) vpd[2], 672 (uint32_t) vpd[0], (uint32_t) vpd[1], (uint32_t) vpd[2],
668 (uint32_t) vpd[3]); 673 (uint32_t) vpd[3]);
669 do { 674 while (!finished && (index < (len - 4))) {
670 switch (vpd[index]) { 675 switch (vpd[index]) {
671 case 0x82: 676 case 0x82:
677 case 0x91:
672 index += 1; 678 index += 1;
673 lenlo = vpd[index]; 679 lenlo = vpd[index];
674 index += 1; 680 index += 1;
@@ -684,7 +690,8 @@ lpfc_parse_vpd(struct lpfc_hba * phba, uint8_t * vpd)
684 lenhi = vpd[index]; 690 lenhi = vpd[index];
685 index += 1; 691 index += 1;
686 Length = ((((unsigned short)lenhi) << 8) + lenlo); 692 Length = ((((unsigned short)lenhi) << 8) + lenlo);
687 693 if (Length > len - index)
694 Length = len - index;
688 while (Length > 0) { 695 while (Length > 0) {
689 /* Look for Serial Number */ 696 /* Look for Serial Number */
690 if ((vpd[index] == 'S') && (vpd[index+1] == 'N')) { 697 if ((vpd[index] == 'S') && (vpd[index+1] == 'N')) {
@@ -778,7 +785,7 @@ lpfc_parse_vpd(struct lpfc_hba * phba, uint8_t * vpd)
778 index ++; 785 index ++;
779 break; 786 break;
780 } 787 }
781 } while (!finished && (index < 108)); 788 }
782 789
783 return(1); 790 return(1);
784} 791}
@@ -790,124 +797,153 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp)
790 uint16_t dev_id = phba->pcidev->device; 797 uint16_t dev_id = phba->pcidev->device;
791 uint16_t dev_subid = phba->pcidev->subsystem_device; 798 uint16_t dev_subid = phba->pcidev->subsystem_device;
792 uint8_t hdrtype = phba->pcidev->hdr_type; 799 uint8_t hdrtype = phba->pcidev->hdr_type;
793 char *model_str = ""; 800 int max_speed;
801 char * ports = (hdrtype == 0x80) ? "2-port " : "";
802 struct {
803 char * name;
804 int max_speed;
805 char * ports;
806 char * bus;
807 } m;
808
809 if (mdp && mdp[0] != '\0'
810 && descp && descp[0] != '\0')
811 return;
812
813 if (phba->lmt & LMT_10Gb)
814 max_speed = 10;
815 else if (phba->lmt & LMT_8Gb)
816 max_speed = 8;
817 else if (phba->lmt & LMT_4Gb)
818 max_speed = 4;
819 else if (phba->lmt & LMT_2Gb)
820 max_speed = 2;
821 else
822 max_speed = 1;
794 823
795 vp = &phba->vpd; 824 vp = &phba->vpd;
796 825
797 switch (dev_id) { 826 switch (dev_id) {
798 case PCI_DEVICE_ID_FIREFLY: 827 case PCI_DEVICE_ID_FIREFLY:
799 model_str = "LP6000 1Gb PCI"; 828 m = (typeof(m)){"LP6000", max_speed, "", "PCI"};
800 break; 829 break;
801 case PCI_DEVICE_ID_SUPERFLY: 830 case PCI_DEVICE_ID_SUPERFLY:
802 if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3) 831 if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3)
803 model_str = "LP7000 1Gb PCI"; 832 m = (typeof(m)){"LP7000", max_speed, "", "PCI"};
804 else 833 else
805 model_str = "LP7000E 1Gb PCI"; 834 m = (typeof(m)){"LP7000E", max_speed, "", "PCI"};
806 break; 835 break;
807 case PCI_DEVICE_ID_DRAGONFLY: 836 case PCI_DEVICE_ID_DRAGONFLY:
808 model_str = "LP8000 1Gb PCI"; 837 m = (typeof(m)){"LP8000", max_speed, "", "PCI"};
809 break; 838 break;
810 case PCI_DEVICE_ID_CENTAUR: 839 case PCI_DEVICE_ID_CENTAUR:
811 if (FC_JEDEC_ID(vp->rev.biuRev) == CENTAUR_2G_JEDEC_ID) 840 if (FC_JEDEC_ID(vp->rev.biuRev) == CENTAUR_2G_JEDEC_ID)
812 model_str = "LP9002 2Gb PCI"; 841 m = (typeof(m)){"LP9002", max_speed, "", "PCI"};
813 else 842 else
814 model_str = "LP9000 1Gb PCI"; 843 m = (typeof(m)){"LP9000", max_speed, "", "PCI"};
815 break; 844 break;
816 case PCI_DEVICE_ID_RFLY: 845 case PCI_DEVICE_ID_RFLY:
817 model_str = "LP952 2Gb PCI"; 846 m = (typeof(m)){"LP952", max_speed, "", "PCI"};
818 break; 847 break;
819 case PCI_DEVICE_ID_PEGASUS: 848 case PCI_DEVICE_ID_PEGASUS:
820 model_str = "LP9802 2Gb PCI-X"; 849 m = (typeof(m)){"LP9802", max_speed, "", "PCI-X"};
821 break; 850 break;
822 case PCI_DEVICE_ID_THOR: 851 case PCI_DEVICE_ID_THOR:
823 if (hdrtype == 0x80) 852 if (hdrtype == 0x80)
824 model_str = "LP10000DC 2Gb 2-port PCI-X"; 853 m = (typeof(m)){"LP10000DC",
854 max_speed, ports, "PCI-X"};
825 else 855 else
826 model_str = "LP10000 2Gb PCI-X"; 856 m = (typeof(m)){"LP10000",
857 max_speed, ports, "PCI-X"};
827 break; 858 break;
828 case PCI_DEVICE_ID_VIPER: 859 case PCI_DEVICE_ID_VIPER:
829 model_str = "LPX1000 10Gb PCI-X"; 860 m = (typeof(m)){"LPX1000", max_speed, "", "PCI-X"};
830 break; 861 break;
831 case PCI_DEVICE_ID_PFLY: 862 case PCI_DEVICE_ID_PFLY:
832 model_str = "LP982 2Gb PCI-X"; 863 m = (typeof(m)){"LP982", max_speed, "", "PCI-X"};
833 break; 864 break;
834 case PCI_DEVICE_ID_TFLY: 865 case PCI_DEVICE_ID_TFLY:
835 if (hdrtype == 0x80) 866 if (hdrtype == 0x80)
836 model_str = "LP1050DC 2Gb 2-port PCI-X"; 867 m = (typeof(m)){"LP1050DC", max_speed, ports, "PCI-X"};
837 else 868 else
838 model_str = "LP1050 2Gb PCI-X"; 869 m = (typeof(m)){"LP1050", max_speed, ports, "PCI-X"};
839 break; 870 break;
840 case PCI_DEVICE_ID_HELIOS: 871 case PCI_DEVICE_ID_HELIOS:
841 if (hdrtype == 0x80) 872 if (hdrtype == 0x80)
842 model_str = "LP11002 4Gb 2-port PCI-X2"; 873 m = (typeof(m)){"LP11002", max_speed, ports, "PCI-X2"};
843 else 874 else
844 model_str = "LP11000 4Gb PCI-X2"; 875 m = (typeof(m)){"LP11000", max_speed, ports, "PCI-X2"};
845 break; 876 break;
846 case PCI_DEVICE_ID_HELIOS_SCSP: 877 case PCI_DEVICE_ID_HELIOS_SCSP:
847 model_str = "LP11000-SP 4Gb PCI-X2"; 878 m = (typeof(m)){"LP11000-SP", max_speed, ports, "PCI-X2"};
848 break; 879 break;
849 case PCI_DEVICE_ID_HELIOS_DCSP: 880 case PCI_DEVICE_ID_HELIOS_DCSP:
850 model_str = "LP11002-SP 4Gb 2-port PCI-X2"; 881 m = (typeof(m)){"LP11002-SP", max_speed, ports, "PCI-X2"};
851 break; 882 break;
852 case PCI_DEVICE_ID_NEPTUNE: 883 case PCI_DEVICE_ID_NEPTUNE:
853 if (hdrtype == 0x80) 884 if (hdrtype == 0x80)
854 model_str = "LPe1002 4Gb 2-port"; 885 m = (typeof(m)){"LPe1002", max_speed, ports, "PCIe"};
855 else 886 else
856 model_str = "LPe1000 4Gb PCIe"; 887 m = (typeof(m)){"LPe1000", max_speed, ports, "PCIe"};
857 break; 888 break;
858 case PCI_DEVICE_ID_NEPTUNE_SCSP: 889 case PCI_DEVICE_ID_NEPTUNE_SCSP:
859 model_str = "LPe1000-SP 4Gb PCIe"; 890 m = (typeof(m)){"LPe1000-SP", max_speed, ports, "PCIe"};
860 break; 891 break;
861 case PCI_DEVICE_ID_NEPTUNE_DCSP: 892 case PCI_DEVICE_ID_NEPTUNE_DCSP:
862 model_str = "LPe1002-SP 4Gb 2-port PCIe"; 893 m = (typeof(m)){"LPe1002-SP", max_speed, ports, "PCIe"};
863 break; 894 break;
864 case PCI_DEVICE_ID_BMID: 895 case PCI_DEVICE_ID_BMID:
865 model_str = "LP1150 4Gb PCI-X2"; 896 m = (typeof(m)){"LP1150", max_speed, ports, "PCI-X2"};
866 break; 897 break;
867 case PCI_DEVICE_ID_BSMB: 898 case PCI_DEVICE_ID_BSMB:
868 model_str = "LP111 4Gb PCI-X2"; 899 m = (typeof(m)){"LP111", max_speed, ports, "PCI-X2"};
869 break; 900 break;
870 case PCI_DEVICE_ID_ZEPHYR: 901 case PCI_DEVICE_ID_ZEPHYR:
871 if (hdrtype == 0x80) 902 if (hdrtype == 0x80)
872 model_str = "LPe11002 4Gb 2-port PCIe"; 903 m = (typeof(m)){"LPe11002", max_speed, ports, "PCIe"};
873 else 904 else
874 model_str = "LPe11000 4Gb PCIe"; 905 m = (typeof(m)){"LPe11000", max_speed, ports, "PCIe"};
875 break; 906 break;
876 case PCI_DEVICE_ID_ZEPHYR_SCSP: 907 case PCI_DEVICE_ID_ZEPHYR_SCSP:
877 model_str = "LPe11000-SP 4Gb PCIe"; 908 m = (typeof(m)){"LPe11000", max_speed, ports, "PCIe"};
878 break; 909 break;
879 case PCI_DEVICE_ID_ZEPHYR_DCSP: 910 case PCI_DEVICE_ID_ZEPHYR_DCSP:
880 model_str = "LPe11002-SP 4Gb 2-port PCIe"; 911 m = (typeof(m)){"LPe11002-SP", max_speed, ports, "PCIe"};
881 break; 912 break;
882 case PCI_DEVICE_ID_ZMID: 913 case PCI_DEVICE_ID_ZMID:
883 model_str = "LPe1150 4Gb PCIe"; 914 m = (typeof(m)){"LPe1150", max_speed, ports, "PCIe"};
884 break; 915 break;
885 case PCI_DEVICE_ID_ZSMB: 916 case PCI_DEVICE_ID_ZSMB:
886 model_str = "LPe111 4Gb PCIe"; 917 m = (typeof(m)){"LPe111", max_speed, ports, "PCIe"};
887 break; 918 break;
888 case PCI_DEVICE_ID_LP101: 919 case PCI_DEVICE_ID_LP101:
889 model_str = "LP101 2Gb PCI-X"; 920 m = (typeof(m)){"LP101", max_speed, ports, "PCI-X"};
890 break; 921 break;
891 case PCI_DEVICE_ID_LP10000S: 922 case PCI_DEVICE_ID_LP10000S:
892 model_str = "LP10000-S 2Gb PCI"; 923 m = (typeof(m)){"LP10000-S", max_speed, ports, "PCI"};
893 break; 924 break;
894 case PCI_DEVICE_ID_LP11000S: 925 case PCI_DEVICE_ID_LP11000S:
895 case PCI_DEVICE_ID_LPE11000S: 926 case PCI_DEVICE_ID_LPE11000S:
896 switch (dev_subid) { 927 switch (dev_subid) {
897 case PCI_SUBSYSTEM_ID_LP11000S: 928 case PCI_SUBSYSTEM_ID_LP11000S:
898 model_str = "LP11002-S 4Gb PCI-X2"; 929 m = (typeof(m)){"LP11000-S", max_speed,
930 ports, "PCI-X2"};
899 break; 931 break;
900 case PCI_SUBSYSTEM_ID_LP11002S: 932 case PCI_SUBSYSTEM_ID_LP11002S:
901 model_str = "LP11000-S 4Gb 2-port PCI-X2"; 933 m = (typeof(m)){"LP11002-S", max_speed,
934 ports, "PCI-X2"};
902 break; 935 break;
903 case PCI_SUBSYSTEM_ID_LPE11000S: 936 case PCI_SUBSYSTEM_ID_LPE11000S:
904 model_str = "LPe11002-S 4Gb PCIe"; 937 m = (typeof(m)){"LPe11000-S", max_speed,
938 ports, "PCIe"};
905 break; 939 break;
906 case PCI_SUBSYSTEM_ID_LPE11002S: 940 case PCI_SUBSYSTEM_ID_LPE11002S:
907 model_str = "LPe11002-S 4Gb 2-port PCIe"; 941 m = (typeof(m)){"LPe11002-S", max_speed,
942 ports, "PCIe"};
908 break; 943 break;
909 case PCI_SUBSYSTEM_ID_LPE11010S: 944 case PCI_SUBSYSTEM_ID_LPE11010S:
910 model_str = "LPe11010-S 4Gb 10-port PCIe"; 945 m = (typeof(m)){"LPe11010-S", max_speed,
946 "10-port ", "PCIe"};
911 break; 947 break;
912 default: 948 default:
913 break; 949 break;
@@ -916,10 +952,13 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp)
916 default: 952 default:
917 break; 953 break;
918 } 954 }
919 if (mdp) 955
920 sscanf(model_str, "%s", mdp); 956 if (mdp && mdp[0] == '\0')
921 if (descp) 957 snprintf(mdp, 79,"%s", m.name);
922 sprintf(descp, "Emulex %s Fibre Channel Adapter", model_str); 958 if (descp && descp[0] == '\0')
959 snprintf(descp, 255,
960 "Emulex %s %dGb %s%s Fibre Channel Adapter",
961 m.name, m.max_speed, m.ports, m.bus);
923} 962}
924 963
925/**************************************************/ 964/**************************************************/
@@ -1627,21 +1666,14 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid)
1627 lpfc_get_hba_sym_node_name(phba, fc_host_symbolic_name(host)); 1666 lpfc_get_hba_sym_node_name(phba, fc_host_symbolic_name(host));
1628 1667
1629 fc_host_supported_speeds(host) = 0; 1668 fc_host_supported_speeds(host) = 0;
1630 switch (FC_JEDEC_ID(phba->vpd.rev.biuRev)) { 1669 if (phba->lmt & LMT_10Gb)
1631 case VIPER_JEDEC_ID:
1632 fc_host_supported_speeds(host) |= FC_PORTSPEED_10GBIT; 1670 fc_host_supported_speeds(host) |= FC_PORTSPEED_10GBIT;
1633 break; 1671 if (phba->lmt & LMT_4Gb)
1634 case HELIOS_JEDEC_ID:
1635 fc_host_supported_speeds(host) |= FC_PORTSPEED_4GBIT; 1672 fc_host_supported_speeds(host) |= FC_PORTSPEED_4GBIT;
1636 /* Fall through */ 1673 if (phba->lmt & LMT_2Gb)
1637 case CENTAUR_2G_JEDEC_ID:
1638 case PEGASUS_JEDEC_ID:
1639 case THOR_JEDEC_ID:
1640 fc_host_supported_speeds(host) |= FC_PORTSPEED_2GBIT; 1674 fc_host_supported_speeds(host) |= FC_PORTSPEED_2GBIT;
1641 /* Fall through */ 1675 if (phba->lmt & LMT_1Gb)
1642 default: 1676 fc_host_supported_speeds(host) |= FC_PORTSPEED_1GBIT;
1643 fc_host_supported_speeds(host) = FC_PORTSPEED_1GBIT;
1644 }
1645 1677
1646 fc_host_maxframe_size(host) = 1678 fc_host_maxframe_size(host) =
1647 ((((uint32_t) phba->fc_sparam.cmn.bbRcvSizeMsb & 0x0F) << 8) | 1679 ((((uint32_t) phba->fc_sparam.cmn.bbRcvSizeMsb & 0x0F) << 8) |