aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_hbadisc.c
diff options
context:
space:
mode:
authorJames Smart <James.Smart@Emulex.Com>2009-07-19 10:01:03 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-08-22 18:51:56 -0400
commit8fa38513ddc1076f3e26c651f3567b084c273ba2 (patch)
treea13d51bd2b2deced5b2209f52118b53ad1f59bbc /drivers/scsi/lpfc/lpfc_hbadisc.c
parent66d6faec2f874cf6bf9bd4900966584ea9feae3d (diff)
[SCSI] lpfc 8.3.4: Various SLI4 fixes
Various SLI4 fixes - Fix switch name not used in the FCF record for FCoE HBAs - Enabled HBA UE error polling error-condition action code - Rewrite lpfc_sli4_scmd_to_wqidx_distr() to handle counter rollover cleanly - Modify resume_rpi mailbox data structure to match current SLI4 spec - Do not issue mailbox command in MBX_POLL mode when LPFC_HBA_ERROR is set - Wait for HBA POST completion before checking Online and UE registers - Fix accumulated total length not being filled in on unsolicited IOCBs - Use PCI config space register to determine SLI rev of HBA - Turn on starting ELS tmo function timer during device initialization Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_hbadisc.c')
-rw-r--r--drivers/scsi/lpfc/lpfc_hbadisc.c66
1 files changed, 60 insertions, 6 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index ed46b24a3380..625b2ef3050f 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -1054,6 +1054,39 @@ lpfc_fab_name_match(uint8_t *fab_name, struct fcf_record *new_fcf_record)
1054} 1054}
1055 1055
1056/** 1056/**
1057 * lpfc_sw_name_match - Check if the fcf switch name match.
1058 * @fab_name: pointer to fabric name.
1059 * @new_fcf_record: pointer to fcf record.
1060 *
1061 * This routine compare the fcf record's switch name with provided
1062 * switch name. If the switch name are identical this function
1063 * returns 1 else return 0.
1064 **/
1065static uint32_t
1066lpfc_sw_name_match(uint8_t *sw_name, struct fcf_record *new_fcf_record)
1067{
1068 if ((sw_name[0] ==
1069 bf_get(lpfc_fcf_record_switch_name_0, new_fcf_record)) &&
1070 (sw_name[1] ==
1071 bf_get(lpfc_fcf_record_switch_name_1, new_fcf_record)) &&
1072 (sw_name[2] ==
1073 bf_get(lpfc_fcf_record_switch_name_2, new_fcf_record)) &&
1074 (sw_name[3] ==
1075 bf_get(lpfc_fcf_record_switch_name_3, new_fcf_record)) &&
1076 (sw_name[4] ==
1077 bf_get(lpfc_fcf_record_switch_name_4, new_fcf_record)) &&
1078 (sw_name[5] ==
1079 bf_get(lpfc_fcf_record_switch_name_5, new_fcf_record)) &&
1080 (sw_name[6] ==
1081 bf_get(lpfc_fcf_record_switch_name_6, new_fcf_record)) &&
1082 (sw_name[7] ==
1083 bf_get(lpfc_fcf_record_switch_name_7, new_fcf_record)))
1084 return 1;
1085 else
1086 return 0;
1087}
1088
1089/**
1057 * lpfc_mac_addr_match - Check if the fcf mac address match. 1090 * lpfc_mac_addr_match - Check if the fcf mac address match.
1058 * @phba: pointer to lpfc hba data structure. 1091 * @phba: pointer to lpfc hba data structure.
1059 * @new_fcf_record: pointer to fcf record. 1092 * @new_fcf_record: pointer to fcf record.
@@ -1123,6 +1156,22 @@ lpfc_copy_fcf_record(struct lpfc_hba *phba, struct fcf_record *new_fcf_record)
1123 bf_get(lpfc_fcf_record_mac_5, new_fcf_record); 1156 bf_get(lpfc_fcf_record_mac_5, new_fcf_record);
1124 phba->fcf.fcf_indx = bf_get(lpfc_fcf_record_fcf_index, new_fcf_record); 1157 phba->fcf.fcf_indx = bf_get(lpfc_fcf_record_fcf_index, new_fcf_record);
1125 phba->fcf.priority = new_fcf_record->fip_priority; 1158 phba->fcf.priority = new_fcf_record->fip_priority;
1159 phba->fcf.switch_name[0] =
1160 bf_get(lpfc_fcf_record_switch_name_0, new_fcf_record);
1161 phba->fcf.switch_name[1] =
1162 bf_get(lpfc_fcf_record_switch_name_1, new_fcf_record);
1163 phba->fcf.switch_name[2] =
1164 bf_get(lpfc_fcf_record_switch_name_2, new_fcf_record);
1165 phba->fcf.switch_name[3] =
1166 bf_get(lpfc_fcf_record_switch_name_3, new_fcf_record);
1167 phba->fcf.switch_name[4] =
1168 bf_get(lpfc_fcf_record_switch_name_4, new_fcf_record);
1169 phba->fcf.switch_name[5] =
1170 bf_get(lpfc_fcf_record_switch_name_5, new_fcf_record);
1171 phba->fcf.switch_name[6] =
1172 bf_get(lpfc_fcf_record_switch_name_6, new_fcf_record);
1173 phba->fcf.switch_name[7] =
1174 bf_get(lpfc_fcf_record_switch_name_7, new_fcf_record);
1126} 1175}
1127 1176
1128/** 1177/**
@@ -1239,9 +1288,12 @@ lpfc_match_fcf_conn_list(struct lpfc_hba *phba,
1239 1288
1240 if ((conn_entry->conn_rec.flags & FCFCNCT_FBNM_VALID) && 1289 if ((conn_entry->conn_rec.flags & FCFCNCT_FBNM_VALID) &&
1241 !lpfc_fab_name_match(conn_entry->conn_rec.fabric_name, 1290 !lpfc_fab_name_match(conn_entry->conn_rec.fabric_name,
1242 new_fcf_record)) 1291 new_fcf_record))
1292 continue;
1293 if ((conn_entry->conn_rec.flags & FCFCNCT_SWNM_VALID) &&
1294 !lpfc_sw_name_match(conn_entry->conn_rec.switch_name,
1295 new_fcf_record))
1243 continue; 1296 continue;
1244
1245 if (conn_entry->conn_rec.flags & FCFCNCT_VLAN_VALID) { 1297 if (conn_entry->conn_rec.flags & FCFCNCT_VLAN_VALID) {
1246 /* 1298 /*
1247 * If the vlan bit map does not have the bit set for the 1299 * If the vlan bit map does not have the bit set for the
@@ -1424,7 +1476,9 @@ lpfc_mbx_cmpl_read_fcf_record(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
1424 spin_lock_irqsave(&phba->hbalock, flags); 1476 spin_lock_irqsave(&phba->hbalock, flags);
1425 if (phba->fcf.fcf_flag & FCF_IN_USE) { 1477 if (phba->fcf.fcf_flag & FCF_IN_USE) {
1426 if (lpfc_fab_name_match(phba->fcf.fabric_name, 1478 if (lpfc_fab_name_match(phba->fcf.fabric_name,
1427 new_fcf_record) && 1479 new_fcf_record) &&
1480 lpfc_sw_name_match(phba->fcf.switch_name,
1481 new_fcf_record) &&
1428 lpfc_mac_addr_match(phba, new_fcf_record)) { 1482 lpfc_mac_addr_match(phba, new_fcf_record)) {
1429 phba->fcf.fcf_flag |= FCF_AVAILABLE; 1483 phba->fcf.fcf_flag |= FCF_AVAILABLE;
1430 spin_unlock_irqrestore(&phba->hbalock, flags); 1484 spin_unlock_irqrestore(&phba->hbalock, flags);
@@ -1464,9 +1518,9 @@ lpfc_mbx_cmpl_read_fcf_record(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq)
1464 * If there is a record with lower priority value for 1518 * If there is a record with lower priority value for
1465 * the current FCF, use that record. 1519 * the current FCF, use that record.
1466 */ 1520 */
1467 if (lpfc_fab_name_match(phba->fcf.fabric_name, new_fcf_record) 1521 if (lpfc_fab_name_match(phba->fcf.fabric_name,
1468 && (new_fcf_record->fip_priority < 1522 new_fcf_record) &&
1469 phba->fcf.priority)) { 1523 (new_fcf_record->fip_priority < phba->fcf.priority)) {
1470 /* Use this FCF record */ 1524 /* Use this FCF record */
1471 lpfc_copy_fcf_record(phba, new_fcf_record); 1525 lpfc_copy_fcf_record(phba, new_fcf_record);
1472 phba->fcf.addr_mode = addr_mode; 1526 phba->fcf.addr_mode = addr_mode;