diff options
author | James Smart <James.Smart@Emulex.Com> | 2008-08-24 21:50:06 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-10-13 09:28:54 -0400 |
commit | 84774a4d0a4dba8a5767da6c58ea5a8c5b0cfe25 (patch) | |
tree | 2bc1c62a32f76260ae5743f7888c4ff45122cef4 /drivers/scsi/lpfc | |
parent | d7c255b26d8e3f12164d82093de3bf22efad2b4a (diff) |
[SCSI] lpfc 8.2.8 : Add new FCOE hardware support
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 4 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_attr.c | 33 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hbadisc.c | 66 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw.h | 26 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 30 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 12 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.h | 1 |
7 files changed, 153 insertions, 19 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index f57a416033b9..aee5444b63d9 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h | |||
@@ -613,6 +613,7 @@ struct lpfc_hba { | |||
613 | unsigned long last_completion_time; | 613 | unsigned long last_completion_time; |
614 | struct timer_list hb_tmofunc; | 614 | struct timer_list hb_tmofunc; |
615 | uint8_t hb_outstanding; | 615 | uint8_t hb_outstanding; |
616 | enum hba_temp_state over_temp_state; | ||
616 | /* ndlp reference management */ | 617 | /* ndlp reference management */ |
617 | spinlock_t ndlp_lock; | 618 | spinlock_t ndlp_lock; |
618 | /* | 619 | /* |
@@ -621,7 +622,8 @@ struct lpfc_hba { | |||
621 | */ | 622 | */ |
622 | #define QUE_BUFTAG_BIT (1<<31) | 623 | #define QUE_BUFTAG_BIT (1<<31) |
623 | uint32_t buffer_tag_count; | 624 | uint32_t buffer_tag_count; |
624 | enum hba_temp_state over_temp_state; | 625 | int wait_4_mlo_maint_flg; |
626 | wait_queue_head_t wait_4_mlo_m_q; | ||
625 | }; | 627 | }; |
626 | 628 | ||
627 | static inline struct Scsi_Host * | 629 | static inline struct Scsi_Host * |
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c index 172b6b0a5704..b9acc6eefe62 100644 --- a/drivers/scsi/lpfc/lpfc_attr.c +++ b/drivers/scsi/lpfc/lpfc_attr.c | |||
@@ -211,6 +211,25 @@ lpfc_programtype_show(struct device *dev, struct device_attribute *attr, | |||
211 | } | 211 | } |
212 | 212 | ||
213 | /** | 213 | /** |
214 | * lpfc_mlomgmt_show: Return the Menlo Maintenance sli flag. | ||
215 | * @dev: class converted to a Scsi_host structure. | ||
216 | * @attr: device attribute, not used. | ||
217 | * @buf: on return contains the Menlo Maintenance sli flag. | ||
218 | * | ||
219 | * Returns: size of formatted string. | ||
220 | **/ | ||
221 | static ssize_t | ||
222 | lpfc_mlomgmt_show(struct device *dev, struct device_attribute *attr, char *buf) | ||
223 | { | ||
224 | struct Scsi_Host *shost = class_to_shost(dev); | ||
225 | struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; | ||
226 | struct lpfc_hba *phba = vport->phba; | ||
227 | |||
228 | return snprintf(buf, PAGE_SIZE, "%d\n", | ||
229 | (phba->sli.sli_flag & LPFC_MENLO_MAINT)); | ||
230 | } | ||
231 | |||
232 | /** | ||
214 | * lpfc_vportnum_show: Return the port number in ascii of the hba. | 233 | * lpfc_vportnum_show: Return the port number in ascii of the hba. |
215 | * @dev: class converted to a Scsi_host structure. | 234 | * @dev: class converted to a Scsi_host structure. |
216 | * @attr: device attribute, not used. | 235 | * @attr: device attribute, not used. |
@@ -352,8 +371,10 @@ lpfc_link_state_show(struct device *dev, struct device_attribute *attr, | |||
352 | "Unknown\n"); | 371 | "Unknown\n"); |
353 | break; | 372 | break; |
354 | } | 373 | } |
355 | 374 | if (phba->sli.sli_flag & LPFC_MENLO_MAINT) | |
356 | if (phba->fc_topology == TOPOLOGY_LOOP) { | 375 | len += snprintf(buf + len, PAGE_SIZE-len, |
376 | " Menlo Maint Mode\n"); | ||
377 | else if (phba->fc_topology == TOPOLOGY_LOOP) { | ||
357 | if (vport->fc_flag & FC_PUBLIC_LOOP) | 378 | if (vport->fc_flag & FC_PUBLIC_LOOP) |
358 | len += snprintf(buf + len, PAGE_SIZE-len, | 379 | len += snprintf(buf + len, PAGE_SIZE-len, |
359 | " Public Loop\n"); | 380 | " Public Loop\n"); |
@@ -1476,6 +1497,7 @@ static DEVICE_ATTR(option_rom_version, S_IRUGO, | |||
1476 | lpfc_option_rom_version_show, NULL); | 1497 | lpfc_option_rom_version_show, NULL); |
1477 | static DEVICE_ATTR(num_discovered_ports, S_IRUGO, | 1498 | static DEVICE_ATTR(num_discovered_ports, S_IRUGO, |
1478 | lpfc_num_discovered_ports_show, NULL); | 1499 | lpfc_num_discovered_ports_show, NULL); |
1500 | static DEVICE_ATTR(menlo_mgmt_mode, S_IRUGO, lpfc_mlomgmt_show, NULL); | ||
1479 | static DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL); | 1501 | static DEVICE_ATTR(nport_evt_cnt, S_IRUGO, lpfc_nport_evt_cnt_show, NULL); |
1480 | static DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show, NULL); | 1502 | static DEVICE_ATTR(lpfc_drvr_version, S_IRUGO, lpfc_drvr_version_show, NULL); |
1481 | static DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR, | 1503 | static DEVICE_ATTR(board_mode, S_IRUGO | S_IWUSR, |
@@ -2395,6 +2417,7 @@ struct device_attribute *lpfc_hba_attrs[] = { | |||
2395 | &dev_attr_option_rom_version, | 2417 | &dev_attr_option_rom_version, |
2396 | &dev_attr_link_state, | 2418 | &dev_attr_link_state, |
2397 | &dev_attr_num_discovered_ports, | 2419 | &dev_attr_num_discovered_ports, |
2420 | &dev_attr_menlo_mgmt_mode, | ||
2398 | &dev_attr_lpfc_drvr_version, | 2421 | &dev_attr_lpfc_drvr_version, |
2399 | &dev_attr_lpfc_temp_sensor, | 2422 | &dev_attr_lpfc_temp_sensor, |
2400 | &dev_attr_lpfc_log_verbose, | 2423 | &dev_attr_lpfc_log_verbose, |
@@ -2763,6 +2786,8 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
2763 | case MBX_DEL_LD_ENTRY: | 2786 | case MBX_DEL_LD_ENTRY: |
2764 | case MBX_SET_VARIABLE: | 2787 | case MBX_SET_VARIABLE: |
2765 | case MBX_WRITE_WWN: | 2788 | case MBX_WRITE_WWN: |
2789 | case MBX_PORT_CAPABILITIES: | ||
2790 | case MBX_PORT_IOV_CONTROL: | ||
2766 | break; | 2791 | break; |
2767 | case MBX_READ_SPARM64: | 2792 | case MBX_READ_SPARM64: |
2768 | case MBX_READ_LA: | 2793 | case MBX_READ_LA: |
@@ -2867,7 +2892,7 @@ static struct bin_attribute sysfs_mbox_attr = { | |||
2867 | }; | 2892 | }; |
2868 | 2893 | ||
2869 | /** | 2894 | /** |
2870 | * lpfc_alloc_sysfs_attr: Creates the sysfs, ctlreg, menlo and mbox entries. | 2895 | * lpfc_alloc_sysfs_attr: Creates the ctlreg and mbox entries. |
2871 | * @vport: address of lpfc vport structure. | 2896 | * @vport: address of lpfc vport structure. |
2872 | * | 2897 | * |
2873 | * Return codes: | 2898 | * Return codes: |
@@ -2898,7 +2923,7 @@ out: | |||
2898 | } | 2923 | } |
2899 | 2924 | ||
2900 | /** | 2925 | /** |
2901 | * lpfc_free_sysfs_attr: Removes the sysfs, ctlreg, menlo and mbox entries. | 2926 | * lpfc_free_sysfs_attr: Removes the ctlreg and mbox entries. |
2902 | * @vport: address of lpfc vport structure. | 2927 | * @vport: address of lpfc vport structure. |
2903 | **/ | 2928 | **/ |
2904 | void | 2929 | void |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 72c1cf15ef2b..b4ef83623532 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -1013,14 +1013,10 @@ out: | |||
1013 | } | 1013 | } |
1014 | 1014 | ||
1015 | static void | 1015 | static void |
1016 | lpfc_mbx_issue_link_down(struct lpfc_hba *phba) | 1016 | lpfc_enable_la(struct lpfc_hba *phba) |
1017 | { | 1017 | { |
1018 | uint32_t control; | 1018 | uint32_t control; |
1019 | struct lpfc_sli *psli = &phba->sli; | 1019 | struct lpfc_sli *psli = &phba->sli; |
1020 | |||
1021 | lpfc_linkdown(phba); | ||
1022 | |||
1023 | /* turn on Link Attention interrupts - no CLEAR_LA needed */ | ||
1024 | spin_lock_irq(&phba->hbalock); | 1020 | spin_lock_irq(&phba->hbalock); |
1025 | psli->sli_flag |= LPFC_PROCESS_LA; | 1021 | psli->sli_flag |= LPFC_PROCESS_LA; |
1026 | control = readl(phba->HCregaddr); | 1022 | control = readl(phba->HCregaddr); |
@@ -1030,6 +1026,15 @@ lpfc_mbx_issue_link_down(struct lpfc_hba *phba) | |||
1030 | spin_unlock_irq(&phba->hbalock); | 1026 | spin_unlock_irq(&phba->hbalock); |
1031 | } | 1027 | } |
1032 | 1028 | ||
1029 | static void | ||
1030 | lpfc_mbx_issue_link_down(struct lpfc_hba *phba) | ||
1031 | { | ||
1032 | lpfc_linkdown(phba); | ||
1033 | lpfc_enable_la(phba); | ||
1034 | /* turn on Link Attention interrupts - no CLEAR_LA needed */ | ||
1035 | } | ||
1036 | |||
1037 | |||
1033 | /* | 1038 | /* |
1034 | * This routine handles processing a READ_LA mailbox | 1039 | * This routine handles processing a READ_LA mailbox |
1035 | * command upon completion. It is setup in the LPFC_MBOXQ | 1040 | * command upon completion. It is setup in the LPFC_MBOXQ |
@@ -1077,8 +1082,12 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1077 | } | 1082 | } |
1078 | 1083 | ||
1079 | phba->fc_eventTag = la->eventTag; | 1084 | phba->fc_eventTag = la->eventTag; |
1085 | if (la->mm) | ||
1086 | phba->sli.sli_flag |= LPFC_MENLO_MAINT; | ||
1087 | else | ||
1088 | phba->sli.sli_flag &= ~LPFC_MENLO_MAINT; | ||
1080 | 1089 | ||
1081 | if (la->attType == AT_LINK_UP) { | 1090 | if (la->attType == AT_LINK_UP && (!la->mm)) { |
1082 | phba->fc_stat.LinkUp++; | 1091 | phba->fc_stat.LinkUp++; |
1083 | if (phba->link_flag & LS_LOOPBACK_MODE) { | 1092 | if (phba->link_flag & LS_LOOPBACK_MODE) { |
1084 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1093 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
@@ -1090,13 +1099,15 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1090 | } else { | 1099 | } else { |
1091 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1100 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
1092 | "1303 Link Up Event x%x received " | 1101 | "1303 Link Up Event x%x received " |
1093 | "Data: x%x x%x x%x x%x\n", | 1102 | "Data: x%x x%x x%x x%x x%x x%x %d\n", |
1094 | la->eventTag, phba->fc_eventTag, | 1103 | la->eventTag, phba->fc_eventTag, |
1095 | la->granted_AL_PA, la->UlnkSpeed, | 1104 | la->granted_AL_PA, la->UlnkSpeed, |
1096 | phba->alpa_map[0]); | 1105 | phba->alpa_map[0], |
1106 | la->mm, la->fa, | ||
1107 | phba->wait_4_mlo_maint_flg); | ||
1097 | } | 1108 | } |
1098 | lpfc_mbx_process_link_up(phba, la); | 1109 | lpfc_mbx_process_link_up(phba, la); |
1099 | } else { | 1110 | } else if (la->attType == AT_LINK_DOWN) { |
1100 | phba->fc_stat.LinkDown++; | 1111 | phba->fc_stat.LinkDown++; |
1101 | if (phba->link_flag & LS_LOOPBACK_MODE) { | 1112 | if (phba->link_flag & LS_LOOPBACK_MODE) { |
1102 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1113 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
@@ -1109,11 +1120,46 @@ lpfc_mbx_cmpl_read_la(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) | |||
1109 | else { | 1120 | else { |
1110 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | 1121 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, |
1111 | "1305 Link Down Event x%x received " | 1122 | "1305 Link Down Event x%x received " |
1123 | "Data: x%x x%x x%x x%x x%x\n", | ||
1124 | la->eventTag, phba->fc_eventTag, | ||
1125 | phba->pport->port_state, vport->fc_flag, | ||
1126 | la->mm, la->fa); | ||
1127 | } | ||
1128 | lpfc_mbx_issue_link_down(phba); | ||
1129 | } | ||
1130 | if (la->mm && la->attType == AT_LINK_UP) { | ||
1131 | if (phba->link_state != LPFC_LINK_DOWN) { | ||
1132 | phba->fc_stat.LinkDown++; | ||
1133 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | ||
1134 | "1312 Link Down Event x%x received " | ||
1135 | "Data: x%x x%x x%x\n", | ||
1136 | la->eventTag, phba->fc_eventTag, | ||
1137 | phba->pport->port_state, vport->fc_flag); | ||
1138 | lpfc_mbx_issue_link_down(phba); | ||
1139 | } else | ||
1140 | lpfc_enable_la(phba); | ||
1141 | |||
1142 | lpfc_printf_log(phba, KERN_ERR, LOG_LINK_EVENT, | ||
1143 | "1310 Menlo Maint Mode Link up Event x%x rcvd " | ||
1112 | "Data: x%x x%x x%x\n", | 1144 | "Data: x%x x%x x%x\n", |
1113 | la->eventTag, phba->fc_eventTag, | 1145 | la->eventTag, phba->fc_eventTag, |
1114 | phba->pport->port_state, vport->fc_flag); | 1146 | phba->pport->port_state, vport->fc_flag); |
1147 | /* | ||
1148 | * The cmnd that triggered this will be waiting for this | ||
1149 | * signal. | ||
1150 | */ | ||
1151 | /* WAKEUP for MENLO_SET_MODE or MENLO_RESET command. */ | ||
1152 | if (phba->wait_4_mlo_maint_flg) { | ||
1153 | phba->wait_4_mlo_maint_flg = 0; | ||
1154 | wake_up_interruptible(&phba->wait_4_mlo_m_q); | ||
1115 | } | 1155 | } |
1116 | lpfc_mbx_issue_link_down(phba); | 1156 | } |
1157 | |||
1158 | if (la->fa) { | ||
1159 | if (la->mm) | ||
1160 | lpfc_issue_clear_la(phba, vport); | ||
1161 | lpfc_printf_log(phba, KERN_INFO, LOG_LINK_EVENT, | ||
1162 | "1311 fa %d\n", la->fa); | ||
1117 | } | 1163 | } |
1118 | 1164 | ||
1119 | lpfc_mbx_cmpl_read_la_free_mbuf: | 1165 | lpfc_mbx_cmpl_read_la_free_mbuf: |
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 9f94dab5ea73..ee4e50175ca8 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h | |||
@@ -1107,6 +1107,8 @@ typedef struct { | |||
1107 | /* Start FireFly Register definitions */ | 1107 | /* Start FireFly Register definitions */ |
1108 | #define PCI_VENDOR_ID_EMULEX 0x10df | 1108 | #define PCI_VENDOR_ID_EMULEX 0x10df |
1109 | #define PCI_DEVICE_ID_FIREFLY 0x1ae5 | 1109 | #define PCI_DEVICE_ID_FIREFLY 0x1ae5 |
1110 | #define PCI_DEVICE_ID_PROTEUS_VF 0xe100 | ||
1111 | #define PCI_DEVICE_ID_PROTEUS_PF 0xe180 | ||
1110 | #define PCI_DEVICE_ID_SAT_SMB 0xf011 | 1112 | #define PCI_DEVICE_ID_SAT_SMB 0xf011 |
1111 | #define PCI_DEVICE_ID_SAT_MID 0xf015 | 1113 | #define PCI_DEVICE_ID_SAT_MID 0xf015 |
1112 | #define PCI_DEVICE_ID_RFLY 0xf095 | 1114 | #define PCI_DEVICE_ID_RFLY 0xf095 |
@@ -1133,10 +1135,12 @@ typedef struct { | |||
1133 | #define PCI_DEVICE_ID_LP11000S 0xfc10 | 1135 | #define PCI_DEVICE_ID_LP11000S 0xfc10 |
1134 | #define PCI_DEVICE_ID_LPE11000S 0xfc20 | 1136 | #define PCI_DEVICE_ID_LPE11000S 0xfc20 |
1135 | #define PCI_DEVICE_ID_SAT_S 0xfc40 | 1137 | #define PCI_DEVICE_ID_SAT_S 0xfc40 |
1138 | #define PCI_DEVICE_ID_PROTEUS_S 0xfc50 | ||
1136 | #define PCI_DEVICE_ID_HELIOS 0xfd00 | 1139 | #define PCI_DEVICE_ID_HELIOS 0xfd00 |
1137 | #define PCI_DEVICE_ID_HELIOS_SCSP 0xfd11 | 1140 | #define PCI_DEVICE_ID_HELIOS_SCSP 0xfd11 |
1138 | #define PCI_DEVICE_ID_HELIOS_DCSP 0xfd12 | 1141 | #define PCI_DEVICE_ID_HELIOS_DCSP 0xfd12 |
1139 | #define PCI_DEVICE_ID_ZEPHYR 0xfe00 | 1142 | #define PCI_DEVICE_ID_ZEPHYR 0xfe00 |
1143 | #define PCI_DEVICE_ID_HORNET 0xfe05 | ||
1140 | #define PCI_DEVICE_ID_ZEPHYR_SCSP 0xfe11 | 1144 | #define PCI_DEVICE_ID_ZEPHYR_SCSP 0xfe11 |
1141 | #define PCI_DEVICE_ID_ZEPHYR_DCSP 0xfe12 | 1145 | #define PCI_DEVICE_ID_ZEPHYR_DCSP 0xfe12 |
1142 | 1146 | ||
@@ -1154,6 +1158,7 @@ typedef struct { | |||
1154 | #define ZEPHYR_JEDEC_ID 0x0577 | 1158 | #define ZEPHYR_JEDEC_ID 0x0577 |
1155 | #define VIPER_JEDEC_ID 0x4838 | 1159 | #define VIPER_JEDEC_ID 0x4838 |
1156 | #define SATURN_JEDEC_ID 0x1004 | 1160 | #define SATURN_JEDEC_ID 0x1004 |
1161 | #define HORNET_JDEC_ID 0x2057706D | ||
1157 | 1162 | ||
1158 | #define JEDEC_ID_MASK 0x0FFFF000 | 1163 | #define JEDEC_ID_MASK 0x0FFFF000 |
1159 | #define JEDEC_ID_SHIFT 12 | 1164 | #define JEDEC_ID_SHIFT 12 |
@@ -1289,6 +1294,9 @@ typedef struct { /* FireFly BIU registers */ | |||
1289 | #define MBX_WRITE_VPARMS 0x32 | 1294 | #define MBX_WRITE_VPARMS 0x32 |
1290 | #define MBX_ASYNCEVT_ENABLE 0x33 | 1295 | #define MBX_ASYNCEVT_ENABLE 0x33 |
1291 | 1296 | ||
1297 | #define MBX_PORT_CAPABILITIES 0x3B | ||
1298 | #define MBX_PORT_IOV_CONTROL 0x3C | ||
1299 | |||
1292 | #define MBX_CONFIG_HBQ 0x7C | 1300 | #define MBX_CONFIG_HBQ 0x7C |
1293 | #define MBX_LOAD_AREA 0x81 | 1301 | #define MBX_LOAD_AREA 0x81 |
1294 | #define MBX_RUN_BIU_DIAG64 0x84 | 1302 | #define MBX_RUN_BIU_DIAG64 0x84 |
@@ -2195,7 +2203,10 @@ typedef struct { | |||
2195 | typedef struct { | 2203 | typedef struct { |
2196 | uint32_t eventTag; /* Event tag */ | 2204 | uint32_t eventTag; /* Event tag */ |
2197 | #ifdef __BIG_ENDIAN_BITFIELD | 2205 | #ifdef __BIG_ENDIAN_BITFIELD |
2198 | uint32_t rsvd1:22; | 2206 | uint32_t rsvd1:19; |
2207 | uint32_t fa:1; | ||
2208 | uint32_t mm:1; /* Menlo Maintenance mode enabled */ | ||
2209 | uint32_t rx:1; | ||
2199 | uint32_t pb:1; | 2210 | uint32_t pb:1; |
2200 | uint32_t il:1; | 2211 | uint32_t il:1; |
2201 | uint32_t attType:8; | 2212 | uint32_t attType:8; |
@@ -2203,7 +2214,10 @@ typedef struct { | |||
2203 | uint32_t attType:8; | 2214 | uint32_t attType:8; |
2204 | uint32_t il:1; | 2215 | uint32_t il:1; |
2205 | uint32_t pb:1; | 2216 | uint32_t pb:1; |
2206 | uint32_t rsvd1:22; | 2217 | uint32_t rx:1; |
2218 | uint32_t mm:1; | ||
2219 | uint32_t fa:1; | ||
2220 | uint32_t rsvd1:19; | ||
2207 | #endif | 2221 | #endif |
2208 | 2222 | ||
2209 | #define AT_RESERVED 0x00 /* Reserved - attType */ | 2223 | #define AT_RESERVED 0x00 /* Reserved - attType */ |
@@ -2224,6 +2238,7 @@ typedef struct { | |||
2224 | 2238 | ||
2225 | #define TOPOLOGY_PT_PT 0x01 /* Topology is pt-pt / pt-fabric */ | 2239 | #define TOPOLOGY_PT_PT 0x01 /* Topology is pt-pt / pt-fabric */ |
2226 | #define TOPOLOGY_LOOP 0x02 /* Topology is FC-AL */ | 2240 | #define TOPOLOGY_LOOP 0x02 /* Topology is FC-AL */ |
2241 | #define TOPOLOGY_LNK_MENLO_MAINTENANCE 0x05 /* maint mode zephtr to menlo */ | ||
2227 | 2242 | ||
2228 | union { | 2243 | union { |
2229 | struct ulp_bde lilpBde; /* This BDE points to a 128 byte buffer | 2244 | struct ulp_bde lilpBde; /* This BDE points to a 128 byte buffer |
@@ -3346,3 +3361,10 @@ lpfc_error_lost_link(IOCB_t *iocbp) | |||
3346 | iocbp->un.ulpWord[4] == IOERR_LINK_DOWN || | 3361 | iocbp->un.ulpWord[4] == IOERR_LINK_DOWN || |
3347 | iocbp->un.ulpWord[4] == IOERR_SLI_DOWN)); | 3362 | iocbp->un.ulpWord[4] == IOERR_SLI_DOWN)); |
3348 | } | 3363 | } |
3364 | |||
3365 | #define MENLO_TRANSPORT_TYPE 0xfe | ||
3366 | #define MENLO_CONTEXT 0 | ||
3367 | #define MENLO_PU 3 | ||
3368 | #define MENLO_TIMEOUT 30 | ||
3369 | #define SETVAR_MLOMNT 0x103107 | ||
3370 | #define SETVAR_MLORST 0x103007 | ||
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index b8989c43aaf2..41a8c13e6950 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1130,6 +1130,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
1130 | lpfc_vpd_t *vp; | 1130 | lpfc_vpd_t *vp; |
1131 | uint16_t dev_id = phba->pcidev->device; | 1131 | uint16_t dev_id = phba->pcidev->device; |
1132 | int max_speed; | 1132 | int max_speed; |
1133 | int GE = 0; | ||
1133 | struct { | 1134 | struct { |
1134 | char * name; | 1135 | char * name; |
1135 | int max_speed; | 1136 | int max_speed; |
@@ -1261,6 +1262,19 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
1261 | case PCI_DEVICE_ID_SAT_S: | 1262 | case PCI_DEVICE_ID_SAT_S: |
1262 | m = (typeof(m)){"LPe12000-S", max_speed, "PCIe"}; | 1263 | m = (typeof(m)){"LPe12000-S", max_speed, "PCIe"}; |
1263 | break; | 1264 | break; |
1265 | case PCI_DEVICE_ID_HORNET: | ||
1266 | m = (typeof(m)){"LP21000", max_speed, "PCIe"}; | ||
1267 | GE = 1; | ||
1268 | break; | ||
1269 | case PCI_DEVICE_ID_PROTEUS_VF: | ||
1270 | m = (typeof(m)) {"LPev12000", max_speed, "PCIe IOV"}; | ||
1271 | break; | ||
1272 | case PCI_DEVICE_ID_PROTEUS_PF: | ||
1273 | m = (typeof(m)) {"LPev12000", max_speed, "PCIe IOV"}; | ||
1274 | break; | ||
1275 | case PCI_DEVICE_ID_PROTEUS_S: | ||
1276 | m = (typeof(m)) {"LPemv12002-S", max_speed, "PCIe IOV"}; | ||
1277 | break; | ||
1264 | default: | 1278 | default: |
1265 | m = (typeof(m)){ NULL }; | 1279 | m = (typeof(m)){ NULL }; |
1266 | break; | 1280 | break; |
@@ -1270,8 +1284,11 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) | |||
1270 | snprintf(mdp, 79,"%s", m.name); | 1284 | snprintf(mdp, 79,"%s", m.name); |
1271 | if (descp && descp[0] == '\0') | 1285 | if (descp && descp[0] == '\0') |
1272 | snprintf(descp, 255, | 1286 | snprintf(descp, 255, |
1273 | "Emulex %s %dGb %s Fibre Channel Adapter", | 1287 | "Emulex %s %d%s %s %s", |
1274 | m.name, m.max_speed, m.bus); | 1288 | m.name, m.max_speed, |
1289 | (GE) ? "GE" : "Gb", | ||
1290 | m.bus, | ||
1291 | (GE) ? "FCoE Adapter" : "Fibre Channel Adapter"); | ||
1275 | } | 1292 | } |
1276 | 1293 | ||
1277 | /** | 1294 | /** |
@@ -2248,6 +2265,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
2248 | goto out_free_phba; | 2265 | goto out_free_phba; |
2249 | 2266 | ||
2250 | INIT_LIST_HEAD(&phba->port_list); | 2267 | INIT_LIST_HEAD(&phba->port_list); |
2268 | init_waitqueue_head(&phba->wait_4_mlo_m_q); | ||
2251 | /* | 2269 | /* |
2252 | * Get all the module params for configuring this host and then | 2270 | * Get all the module params for configuring this host and then |
2253 | * establish the host. | 2271 | * establish the host. |
@@ -2796,6 +2814,8 @@ static struct pci_device_id lpfc_id_table[] = { | |||
2796 | PCI_ANY_ID, PCI_ANY_ID, }, | 2814 | PCI_ANY_ID, PCI_ANY_ID, }, |
2797 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR, | 2815 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR, |
2798 | PCI_ANY_ID, PCI_ANY_ID, }, | 2816 | PCI_ANY_ID, PCI_ANY_ID, }, |
2817 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_HORNET, | ||
2818 | PCI_ANY_ID, PCI_ANY_ID, }, | ||
2799 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR_SCSP, | 2819 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR_SCSP, |
2800 | PCI_ANY_ID, PCI_ANY_ID, }, | 2820 | PCI_ANY_ID, PCI_ANY_ID, }, |
2801 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR_DCSP, | 2821 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_ZEPHYR_DCSP, |
@@ -2826,6 +2846,12 @@ static struct pci_device_id lpfc_id_table[] = { | |||
2826 | PCI_ANY_ID, PCI_ANY_ID, }, | 2846 | PCI_ANY_ID, PCI_ANY_ID, }, |
2827 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SAT_S, | 2847 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_SAT_S, |
2828 | PCI_ANY_ID, PCI_ANY_ID, }, | 2848 | PCI_ANY_ID, PCI_ANY_ID, }, |
2849 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PROTEUS_VF, | ||
2850 | PCI_ANY_ID, PCI_ANY_ID, }, | ||
2851 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PROTEUS_PF, | ||
2852 | PCI_ANY_ID, PCI_ANY_ID, }, | ||
2853 | {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PROTEUS_S, | ||
2854 | PCI_ANY_ID, PCI_ANY_ID, }, | ||
2829 | { 0 } | 2855 | { 0 } |
2830 | }; | 2856 | }; |
2831 | 2857 | ||
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index c7a520fa1aaa..857bc0a57c47 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -1050,6 +1050,8 @@ lpfc_sli_chk_mbx_command(uint8_t mbxCommand) | |||
1050 | case MBX_REG_VPI: | 1050 | case MBX_REG_VPI: |
1051 | case MBX_UNREG_VPI: | 1051 | case MBX_UNREG_VPI: |
1052 | case MBX_HEARTBEAT: | 1052 | case MBX_HEARTBEAT: |
1053 | case MBX_PORT_CAPABILITIES: | ||
1054 | case MBX_PORT_IOV_CONTROL: | ||
1053 | ret = mbxCommand; | 1055 | ret = mbxCommand; |
1054 | break; | 1056 | break; |
1055 | default: | 1057 | default: |
@@ -3697,6 +3699,16 @@ __lpfc_sli_issue_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, | |||
3697 | * can be issued if the link is not up. | 3699 | * can be issued if the link is not up. |
3698 | */ | 3700 | */ |
3699 | switch (piocb->iocb.ulpCommand) { | 3701 | switch (piocb->iocb.ulpCommand) { |
3702 | case CMD_GEN_REQUEST64_CR: | ||
3703 | case CMD_GEN_REQUEST64_CX: | ||
3704 | if (!(phba->sli.sli_flag & LPFC_MENLO_MAINT) || | ||
3705 | (piocb->iocb.un.genreq64.w5.hcsw.Rctl != | ||
3706 | FC_FCP_CMND) || | ||
3707 | (piocb->iocb.un.genreq64.w5.hcsw.Type != | ||
3708 | MENLO_TRANSPORT_TYPE)) | ||
3709 | |||
3710 | goto iocb_busy; | ||
3711 | break; | ||
3700 | case CMD_QUE_RING_BUF_CN: | 3712 | case CMD_QUE_RING_BUF_CN: |
3701 | case CMD_QUE_RING_BUF64_CN: | 3713 | case CMD_QUE_RING_BUF64_CN: |
3702 | /* | 3714 | /* |
diff --git a/drivers/scsi/lpfc/lpfc_sli.h b/drivers/scsi/lpfc/lpfc_sli.h index 7249fd252cbb..883938652a6a 100644 --- a/drivers/scsi/lpfc/lpfc_sli.h +++ b/drivers/scsi/lpfc/lpfc_sli.h | |||
@@ -233,6 +233,7 @@ struct lpfc_sli { | |||
233 | #define LPFC_SLI2_ACTIVE 0x200 /* SLI2 overlay in firmware is active */ | 233 | #define LPFC_SLI2_ACTIVE 0x200 /* SLI2 overlay in firmware is active */ |
234 | #define LPFC_PROCESS_LA 0x400 /* Able to process link attention */ | 234 | #define LPFC_PROCESS_LA 0x400 /* Able to process link attention */ |
235 | #define LPFC_BLOCK_MGMT_IO 0x800 /* Don't allow mgmt mbx or iocb cmds */ | 235 | #define LPFC_BLOCK_MGMT_IO 0x800 /* Don't allow mgmt mbx or iocb cmds */ |
236 | #define LPFC_MENLO_MAINT 0x1000 /* need for menl fw download */ | ||
236 | 237 | ||
237 | struct lpfc_sli_ring ring[LPFC_MAX_RING]; | 238 | struct lpfc_sli_ring ring[LPFC_MAX_RING]; |
238 | int fcp_ring; /* ring used for FCP initiator commands */ | 239 | int fcp_ring; /* ring used for FCP initiator commands */ |