• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/scsi/lpfc/

Lines Matching refs:ndlp

63 	struct lpfc_nodelist * ndlp;
67 ndlp = rdata->pnode;
69 if (!ndlp) {
77 phba = ndlp->nlp_phba;
80 if (ndlp->nlp_sid != NLP_NO_SID) {
82 ndlp->nlp_sid, 0, 0, LPFC_CTX_TGT);
96 struct lpfc_nodelist * ndlp;
102 ndlp = rdata->pnode;
104 if (!ndlp) {
112 if (ndlp->nlp_state == NLP_STE_MAPPED_NODE)
115 name = (uint8_t *)&ndlp->nlp_portname;
116 phba = ndlp->nlp_phba;
120 if (ndlp->nlp_sid != NLP_NO_SID) {
124 ndlp->nlp_sid, 0, 0, LPFC_CTX_TGT);
139 ndlp->nlp_DID, ndlp->nlp_flag,
140 ndlp->nlp_state, ndlp->nlp_rpi);
149 ndlp->nlp_DID, ndlp->nlp_flag,
150 ndlp->nlp_state, ndlp->nlp_rpi);
154 !(ndlp->nlp_flag & NLP_DELAY_TMO) &&
155 !(ndlp->nlp_flag & NLP_NPR_2B_DISC) &&
156 (ndlp->nlp_state != NLP_STE_UNMAPPED_NODE))
157 lpfc_disc_state_machine(phba, ndlp, NULL, NLP_EVT_DEVICE_RM);
160 ndlp->rport = NULL;
161 lpfc_nlp_put(ndlp);
172 struct lpfc_nodelist *ndlp;
183 ndlp = (struct lpfc_nodelist *)(evtp->evt_arg1);
184 lpfc_els_retry_delay_handler(ndlp);
380 struct lpfc_nodelist *ndlp, *next_ndlp;
417 list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nodes, nlp_listp) {
418 /* free any ndlp's on unused list */
419 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE)
420 lpfc_drop_node(phba, ndlp);
422 rc = lpfc_disc_state_machine(phba, ndlp, NULL,
456 struct lpfc_nodelist *ndlp, *next_ndlp;
471 list_for_each_entry(ndlp, &phba->fc_nodes, nlp_listp) {
472 if (ndlp->nlp_state != NLP_STE_UNUSED_NODE) {
473 if (ndlp->nlp_type & NLP_FABRIC) {
476 * ndlp from Fabric connections.
478 lpfc_nlp_set_state(phba, ndlp,
480 } else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) {
485 lpfc_unreg_rpi(phba, ndlp);
491 /* free any ndlp's on unused list */
492 list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nodes,
494 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE)
495 lpfc_drop_node(phba, ndlp);
929 struct lpfc_nodelist *ndlp;
934 ndlp = (struct lpfc_nodelist *) pmb->context2;
940 lpfc_disc_state_machine(phba, ndlp, pmb, NLP_EVT_CMPL_REG_LOGIN);
944 lpfc_nlp_put(ndlp);
961 struct lpfc_nodelist *ndlp;
968 ndlp = (struct lpfc_nodelist *) pmb->context2;
978 lpfc_nlp_put(ndlp);
988 ndlp->nlp_rpi = mb->un.varWords[0];
989 ndlp->nlp_type |= NLP_FABRIC;
990 lpfc_nlp_set_state(phba, ndlp, NLP_STE_UNMAPPED_NODE);
992 lpfc_nlp_put(ndlp); /* Drop the reference from the mbox */
1003 ndlp = lpfc_findnode_did(phba, NameServer_DID);
1004 if (!ndlp) {
1010 ndlp = mempool_alloc(phba->nlp_mem_pool, GFP_ATOMIC);
1011 if (!ndlp) {
1018 lpfc_nlp_init(phba, ndlp, NameServer_DID);
1019 ndlp->nlp_type |= NLP_FABRIC;
1022 lpfc_nlp_set_state(phba, ndlp, NLP_STE_PLOGI_ISSUE);
1054 struct lpfc_nodelist *ndlp;
1059 ndlp = (struct lpfc_nodelist *) pmb->context2;
1063 lpfc_nlp_put(ndlp);
1067 lpfc_drop_node(phba, ndlp);
1080 ndlp->nlp_rpi = mb->un.varWords[0];
1081 ndlp->nlp_type |= NLP_FABRIC;
1082 lpfc_nlp_set_state(phba, ndlp, NLP_STE_UNMAPPED_NODE);
1086 lpfc_ns_cmd(phba, ndlp, SLI_CTNS_RNN_ID);
1087 lpfc_ns_cmd(phba, ndlp, SLI_CTNS_RSNN_NN);
1088 lpfc_ns_cmd(phba, ndlp, SLI_CTNS_RFT_ID);
1089 lpfc_ns_cmd(phba, ndlp, SLI_CTNS_RFF_ID);
1094 if (lpfc_ns_cmd(phba, ndlp, SLI_CTNS_GID_FT)) {
1099 lpfc_nlp_put(ndlp);
1108 lpfc_register_remote_port(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
1115 rport_ids.node_name = wwn_to_u64(ndlp->nlp_nodename.u.wwn);
1116 rport_ids.port_name = wwn_to_u64(ndlp->nlp_portname.u.wwn);
1117 rport_ids.port_id = ndlp->nlp_DID;
1127 if (ndlp->rport && ndlp->rport->dd_data &&
1128 *(struct lpfc_rport_data **) ndlp->rport->dd_data) {
1129 lpfc_nlp_put(ndlp);
1131 ndlp->rport = rport = fc_remote_port_add(phba->host, 0, &rport_ids);
1139 rport->maxframe_size = ndlp->nlp_maxframe;
1140 rport->supported_classes = ndlp->nlp_class_sup;
1142 rdata->pnode = lpfc_nlp_get(ndlp);
1144 if (ndlp->nlp_type & NLP_FCP_TARGET)
1146 if (ndlp->nlp_type & NLP_FCP_INITIATOR)
1155 ndlp->nlp_sid = rport->scsi_target_id;
1162 lpfc_unregister_remote_port(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
1164 struct fc_rport *rport = ndlp->rport;
1168 ndlp->rport = NULL;
1170 lpfc_nlp_put(ndlp);
1213 lpfc_nlp_state_cleanup(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp,
1217 ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR);
1218 ndlp->nlp_flag &= ~NLP_NODEV_REMOVE;
1219 ndlp->nlp_type |= NLP_FC_NODE;
1222 ndlp->nlp_flag &= ~NLP_NODEV_REMOVE;
1224 ndlp->nlp_flag &= ~NLP_RCV_PLOGI;
1227 if (ndlp->rport && (old_state == NLP_STE_MAPPED_NODE ||
1230 lpfc_unregister_remote_port(phba, ndlp);
1241 lpfc_register_remote_port(phba, ndlp);
1251 (!ndlp->rport ||
1252 ndlp->rport->scsi_target_id == -1 ||
1253 ndlp->rport->scsi_target_id >= LPFC_MAX_TARGET)) {
1255 ndlp->nlp_flag |= NLP_TGT_NO_SCSIID;
1257 lpfc_nlp_set_state(phba, ndlp, NLP_STE_UNMAPPED_NODE);
1283 lpfc_nlp_set_state(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, int state)
1285 int old_state = ndlp->nlp_state;
1291 ndlp->nlp_DID,
1295 (ndlp->nlp_flag & NLP_DELAY_TMO) != 0 &&
1297 lpfc_cancel_retry_delay_tmo(phba, ndlp);
1299 ndlp->nlp_flag &= ~NLP_TGT_NO_SCSIID;
1300 ndlp->nlp_type &= ~NLP_FC_NODE;
1303 if (list_empty(&ndlp->nlp_listp)) {
1305 list_add_tail(&ndlp->nlp_listp, &phba->fc_nodes);
1310 ndlp->nlp_state = state;
1312 lpfc_nlp_state_cleanup(phba, ndlp, old_state, state);
1316 lpfc_dequeue_node(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
1318 if ((ndlp->nlp_flag & NLP_DELAY_TMO) != 0)
1319 lpfc_cancel_retry_delay_tmo(phba, ndlp);
1320 if (ndlp->nlp_state && !list_empty(&ndlp->nlp_listp))
1321 lpfc_nlp_counters(phba, ndlp->nlp_state, -1);
1323 list_del_init(&ndlp->nlp_listp);
1325 lpfc_nlp_state_cleanup(phba, ndlp, ndlp->nlp_state, 0);
1329 lpfc_drop_node(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
1331 if ((ndlp->nlp_flag & NLP_DELAY_TMO) != 0)
1332 lpfc_cancel_retry_delay_tmo(phba, ndlp);
1333 if (ndlp->nlp_state && !list_empty(&ndlp->nlp_listp))
1334 lpfc_nlp_counters(phba, ndlp->nlp_state, -1);
1336 list_del_init(&ndlp->nlp_listp);
1338 lpfc_nlp_put(ndlp);
1407 struct lpfc_iocbq * iocb, struct lpfc_nodelist * ndlp)
1417 if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi)
1420 if (icmd->un.elsreq64.remoteID == ndlp->nlp_DID)
1423 if (iocb->context1 == (uint8_t *) ndlp)
1430 if ((ndlp->nlp_type & NLP_FCP_TARGET) &&
1431 (ndlp->nlp_flag & NLP_DELAY_TMO)) {
1434 if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) {
1448 lpfc_no_rpi(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1462 rpi = ndlp->nlp_rpi;
1476 (phba, pring, iocb, ndlp))) {
1515 lpfc_unreg_rpi(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1520 if (ndlp->nlp_rpi) {
1522 lpfc_unreg_login(phba, ndlp->nlp_rpi, mbox);
1529 lpfc_no_rpi(phba, ndlp);
1530 ndlp->nlp_rpi = 0;
1541 lpfc_cleanup_node(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1551 phba->brd_no, ndlp->nlp_DID, ndlp->nlp_flag,
1552 ndlp->nlp_state, ndlp->nlp_rpi);
1554 lpfc_dequeue_node(phba, ndlp);
1556 /* cleanup any ndlp on mbox q waiting for reglogin cmpl */
1559 (ndlp == (struct lpfc_nodelist *) mb->context2)) {
1568 (ndlp == (struct lpfc_nodelist *) mb->context2)) {
1576 lpfc_nlp_put(ndlp);
1581 lpfc_els_abort(phba,ndlp);
1583 ndlp->nlp_flag &= ~NLP_DELAY_TMO;
1586 ndlp->nlp_last_elscmd = 0;
1587 del_timer_sync(&ndlp->nlp_delayfunc);
1589 if (!list_empty(&ndlp->els_retry_evt.evt_listp))
1590 list_del_init(&ndlp->els_retry_evt.evt_listp);
1592 lpfc_unreg_rpi(phba, ndlp);
1603 lpfc_nlp_remove(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp)
1607 if (ndlp->nlp_flag & NLP_DELAY_TMO) {
1608 lpfc_cancel_retry_delay_tmo(phba, ndlp);
1611 lpfc_cleanup_node(phba, ndlp);
1613 if ((ndlp->rport) && !(phba->fc_flag & FC_UNLOADING)) {
1614 put_device(&ndlp->rport->dev);
1615 rdata = ndlp->rport->dd_data;
1617 ndlp->rport = NULL;
1622 lpfc_matchdid(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, uint32_t did)
1631 if (ndlp->nlp_DID == 0) {
1636 if (ndlp->nlp_DID == did)
1646 ndlpdid.un.word = ndlp->nlp_DID;
1658 matchdid.un.word = ndlp->nlp_DID;
1675 struct lpfc_nodelist *ndlp;
1679 list_for_each_entry(ndlp, &phba->fc_nodes, nlp_listp) {
1680 if (lpfc_matchdid(phba, ndlp, did)) {
1681 data1 = (((uint32_t) ndlp->nlp_state << 24) |
1682 ((uint32_t) ndlp->nlp_xri << 16) |
1683 ((uint32_t) ndlp->nlp_type << 8) |
1684 ((uint32_t) ndlp->nlp_rpi & 0xff));
1689 ndlp, ndlp->nlp_DID,
1690 ndlp->nlp_flag, data1);
1692 return ndlp;
1707 struct lpfc_nodelist *ndlp;
1709 ndlp = lpfc_findnode_did(phba, did);
1710 if (!ndlp) {
1714 ndlp = (struct lpfc_nodelist *)
1716 if (!ndlp)
1718 lpfc_nlp_init(phba, ndlp, did);
1719 lpfc_nlp_set_state(phba, ndlp, NLP_STE_NPR_NODE);
1720 ndlp->nlp_flag |= NLP_NPR_2B_DISC;
1721 return ndlp;
1725 ndlp->nlp_flag |= NLP_NPR_2B_DISC;
1730 if (ndlp->nlp_flag & NLP_DELAY_TMO)
1731 lpfc_cancel_retry_delay_tmo(phba, ndlp);
1733 ndlp = NULL;
1735 if (ndlp->nlp_state == NLP_STE_ADISC_ISSUE ||
1736 ndlp->nlp_state == NLP_STE_PLOGI_ISSUE)
1738 lpfc_nlp_set_state(phba, ndlp, NLP_STE_NPR_NODE);
1739 ndlp->nlp_flag |= NLP_NPR_2B_DISC;
1741 return ndlp;
1795 struct lpfc_nodelist *ndlp, *next_ndlp;
1832 list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nodes, nlp_listp) {
1833 if (ndlp->nlp_state == NLP_STE_NPR_NODE &&
1834 (ndlp->nlp_flag & NLP_NPR_2B_DISC) != 0 &&
1837 ndlp->nlp_flag &= ~NLP_NPR_ADISC;
1896 lpfc_free_tx(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp)
1912 if (iocb->context1 != ndlp) {
1926 if (iocb->context1 != ndlp) {
1956 struct lpfc_nodelist *ndlp, *next_ndlp;
1959 list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nodes,
1961 if (ndlp->nlp_state == NLP_STE_PLOGI_ISSUE ||
1962 ndlp->nlp_state == NLP_STE_ADISC_ISSUE) {
1963 lpfc_free_tx(phba, ndlp);
1964 lpfc_nlp_put(ndlp);
2008 struct lpfc_nodelist *ndlp, *next_ndlp;
2036 list_for_each_entry_safe(ndlp, next_ndlp, &phba->fc_nodes,
2038 if (ndlp->nlp_state != NLP_STE_NPR_NODE)
2040 if (ndlp->nlp_type & NLP_FABRIC) {
2041 /* Clean up the ndlp on Fabric connections */
2042 lpfc_drop_node(phba, ndlp);
2043 } else if (!(ndlp->nlp_flag & NLP_NPR_ADISC)) {
2047 lpfc_unreg_rpi(phba, ndlp);
2082 /* Next look for NameServer ndlp */
2083 ndlp = lpfc_findnode_did(phba, NameServer_DID);
2084 if (ndlp)
2085 lpfc_nlp_put(ndlp);
2098 ndlp = lpfc_findnode_did(phba, NameServer_DID);
2099 if (ndlp && ndlp->nlp_state == NLP_STE_UNMAPPED_NODE) {
2102 rc = lpfc_ns_cmd(phba, ndlp, SLI_CTNS_GID_FT);
2235 struct lpfc_nodelist *ndlp;
2240 ndlp = (struct lpfc_nodelist *) pmb->context2;
2245 ndlp->nlp_rpi = mb->un.varWords[0];
2246 ndlp->nlp_type |= NLP_FABRIC;
2247 lpfc_nlp_set_state(phba, ndlp, NLP_STE_UNMAPPED_NODE);
2253 lpfc_fdmi_cmd(phba, ndlp, SLI_MGMT_DHBA);
2263 lpfc_nlp_put(ndlp);
2272 lpfc_filter_by_rpi(struct lpfc_nodelist *ndlp, void *param)
2276 return ndlp->nlp_rpi == *rpi;
2280 lpfc_filter_by_wwpn(struct lpfc_nodelist *ndlp, void *param)
2282 return memcmp(&ndlp->nlp_portname, param,
2283 sizeof(ndlp->nlp_portname)) == 0;
2293 struct lpfc_nodelist *ndlp;
2295 list_for_each_entry(ndlp, &phba->fc_nodes, nlp_listp) {
2296 if (ndlp->nlp_state != NLP_STE_UNUSED_NODE &&
2297 filter(ndlp, param))
2298 return ndlp;
2310 struct lpfc_nodelist *ndlp;
2313 ndlp = __lpfc_find_node(phba, filter, param);
2315 return ndlp;
2319 * This routine looks up the ndlp lists for the given RPI. If rpi found it
2331 struct lpfc_nodelist *ndlp;
2334 ndlp = __lpfc_findnode_rpi(phba, rpi);
2336 return ndlp;
2340 * This routine looks up the ndlp lists for the given WWPN. If WWPN found it
2346 struct lpfc_nodelist *ndlp;
2349 ndlp = __lpfc_find_node(phba, lpfc_filter_by_wwpn, wwpn);
2355 lpfc_nlp_init(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, uint32_t did)
2357 memset(ndlp, 0, sizeof (struct lpfc_nodelist));
2358 INIT_LIST_HEAD(&ndlp->els_retry_evt.evt_listp);
2359 init_timer(&ndlp->nlp_delayfunc);
2360 ndlp->nlp_delayfunc.function = lpfc_els_retry_delay;
2361 ndlp->nlp_delayfunc.data = (unsigned long)ndlp;
2362 ndlp->nlp_DID = did;
2363 ndlp->nlp_phba = phba;
2364 ndlp->nlp_sid = NLP_NO_SID;
2365 INIT_LIST_HEAD(&ndlp->nlp_listp);
2366 kref_init(&ndlp->kref);
2373 struct lpfc_nodelist *ndlp = container_of(kref, struct lpfc_nodelist,
2375 lpfc_nlp_remove(ndlp->nlp_phba, ndlp);
2376 mempool_free(ndlp, ndlp->nlp_phba->nlp_mem_pool);
2380 lpfc_nlp_get(struct lpfc_nodelist *ndlp)
2382 if (ndlp)
2383 kref_get(&ndlp->kref);
2384 return ndlp;
2388 lpfc_nlp_put(struct lpfc_nodelist *ndlp)
2390 return ndlp ? kref_put(&ndlp->kref, lpfc_nlp_release) : 0;