diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_init.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 84 |
1 files changed, 5 insertions, 79 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 388b92a39589..5e9a839111d2 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -1185,63 +1185,11 @@ lpfc_cleanup(struct lpfc_hba * phba) | |||
1185 | 1185 | ||
1186 | /* clean up phba - lpfc specific */ | 1186 | /* clean up phba - lpfc specific */ |
1187 | lpfc_can_disctmo(phba); | 1187 | lpfc_can_disctmo(phba); |
1188 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nlpunmap_list, | 1188 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nodes, nlp_listp) |
1189 | nlp_listp) { | ||
1190 | lpfc_nlp_put(ndlp); | 1189 | lpfc_nlp_put(ndlp); |
1191 | } | ||
1192 | |||
1193 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nlpmap_list, | ||
1194 | nlp_listp) { | ||
1195 | lpfc_nlp_put(ndlp); | ||
1196 | } | ||
1197 | |||
1198 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_unused_list, | ||
1199 | nlp_listp) { | ||
1200 | lpfc_drop_node(phba, ndlp); | ||
1201 | } | ||
1202 | |||
1203 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_plogi_list, | ||
1204 | nlp_listp) { | ||
1205 | lpfc_nlp_put(ndlp); | ||
1206 | } | ||
1207 | |||
1208 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_adisc_list, | ||
1209 | nlp_listp) { | ||
1210 | lpfc_nlp_put(ndlp); | ||
1211 | } | ||
1212 | |||
1213 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_reglogin_list, | ||
1214 | nlp_listp) { | ||
1215 | lpfc_nlp_put(ndlp); | ||
1216 | } | ||
1217 | 1190 | ||
1218 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_prli_list, | 1191 | INIT_LIST_HEAD(&phba->fc_nodes); |
1219 | nlp_listp) { | ||
1220 | lpfc_nlp_put(ndlp); | ||
1221 | } | ||
1222 | 1192 | ||
1223 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_npr_list, | ||
1224 | nlp_listp) { | ||
1225 | lpfc_nlp_put(ndlp); | ||
1226 | } | ||
1227 | |||
1228 | INIT_LIST_HEAD(&phba->fc_nlpmap_list); | ||
1229 | INIT_LIST_HEAD(&phba->fc_nlpunmap_list); | ||
1230 | INIT_LIST_HEAD(&phba->fc_unused_list); | ||
1231 | INIT_LIST_HEAD(&phba->fc_plogi_list); | ||
1232 | INIT_LIST_HEAD(&phba->fc_adisc_list); | ||
1233 | INIT_LIST_HEAD(&phba->fc_reglogin_list); | ||
1234 | INIT_LIST_HEAD(&phba->fc_prli_list); | ||
1235 | INIT_LIST_HEAD(&phba->fc_npr_list); | ||
1236 | |||
1237 | phba->fc_map_cnt = 0; | ||
1238 | phba->fc_unmap_cnt = 0; | ||
1239 | phba->fc_plogi_cnt = 0; | ||
1240 | phba->fc_adisc_cnt = 0; | ||
1241 | phba->fc_reglogin_cnt = 0; | ||
1242 | phba->fc_prli_cnt = 0; | ||
1243 | phba->fc_npr_cnt = 0; | ||
1244 | phba->fc_unused_cnt= 0; | ||
1245 | return; | 1193 | return; |
1246 | } | 1194 | } |
1247 | 1195 | ||
@@ -1336,8 +1284,6 @@ void | |||
1336 | lpfc_offline_prep(struct lpfc_hba * phba) | 1284 | lpfc_offline_prep(struct lpfc_hba * phba) |
1337 | { | 1285 | { |
1338 | struct lpfc_nodelist *ndlp, *next_ndlp; | 1286 | struct lpfc_nodelist *ndlp, *next_ndlp; |
1339 | struct list_head *listp, *node_list[7]; | ||
1340 | int i; | ||
1341 | 1287 | ||
1342 | if (phba->fc_flag & FC_OFFLINE_MODE) | 1288 | if (phba->fc_flag & FC_OFFLINE_MODE) |
1343 | return; | 1289 | return; |
@@ -1347,21 +1293,9 @@ lpfc_offline_prep(struct lpfc_hba * phba) | |||
1347 | lpfc_linkdown(phba); | 1293 | lpfc_linkdown(phba); |
1348 | 1294 | ||
1349 | /* Issue an unreg_login to all nodes */ | 1295 | /* Issue an unreg_login to all nodes */ |
1350 | node_list[0] = &phba->fc_npr_list; /* MUST do this list first */ | 1296 | list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nodes, nlp_listp) |
1351 | node_list[1] = &phba->fc_nlpmap_list; | 1297 | if (ndlp->nlp_state != NLP_STE_UNUSED_NODE) |
1352 | node_list[2] = &phba->fc_nlpunmap_list; | ||
1353 | node_list[3] = &phba->fc_prli_list; | ||
1354 | node_list[4] = &phba->fc_reglogin_list; | ||
1355 | node_list[5] = &phba->fc_adisc_list; | ||
1356 | node_list[6] = &phba->fc_plogi_list; | ||
1357 | for (i = 0; i < 7; i++) { | ||
1358 | listp = node_list[i]; | ||
1359 | if (list_empty(listp)) | ||
1360 | continue; | ||
1361 | |||
1362 | list_for_each_entry_safe(ndlp, next_ndlp, listp, nlp_listp) | ||
1363 | lpfc_unreg_rpi(phba, ndlp); | 1298 | lpfc_unreg_rpi(phba, ndlp); |
1364 | } | ||
1365 | 1299 | ||
1366 | lpfc_sli_flush_mbox_queue(phba); | 1300 | lpfc_sli_flush_mbox_queue(phba); |
1367 | } | 1301 | } |
@@ -1500,15 +1434,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1500 | host->max_lun = phba->cfg_max_luns; | 1434 | host->max_lun = phba->cfg_max_luns; |
1501 | host->this_id = -1; | 1435 | host->this_id = -1; |
1502 | 1436 | ||
1503 | /* Initialize all internally managed lists. */ | 1437 | INIT_LIST_HEAD(&phba->fc_nodes); |
1504 | INIT_LIST_HEAD(&phba->fc_nlpmap_list); | ||
1505 | INIT_LIST_HEAD(&phba->fc_nlpunmap_list); | ||
1506 | INIT_LIST_HEAD(&phba->fc_unused_list); | ||
1507 | INIT_LIST_HEAD(&phba->fc_plogi_list); | ||
1508 | INIT_LIST_HEAD(&phba->fc_adisc_list); | ||
1509 | INIT_LIST_HEAD(&phba->fc_reglogin_list); | ||
1510 | INIT_LIST_HEAD(&phba->fc_prli_list); | ||
1511 | INIT_LIST_HEAD(&phba->fc_npr_list); | ||
1512 | 1438 | ||
1513 | pci_set_master(pdev); | 1439 | pci_set_master(pdev); |
1514 | retval = pci_set_mwi(pdev); | 1440 | retval = pci_set_mwi(pdev); |