Lines Matching defs:nport

220 	struct fcloop_nport		*nport;
230 struct fcloop_nport *nport;
996 struct fcloop_nport *nport =
1001 list_del(&nport->nport_list);
1004 kfree(nport);
1008 fcloop_nport_put(struct fcloop_nport *nport)
1010 kref_put(&nport->ref, fcloop_nport_free);
1014 fcloop_nport_get(struct fcloop_nport *nport)
1016 return kref_get_unless_zero(&nport->ref);
1035 fcloop_nport_put(rport->nport);
1044 fcloop_nport_put(tport->nport);
1214 struct fcloop_nport *newnport, *nport = NULL;
1266 list_for_each_entry(nport, &fcloop_nports, nport_list) {
1267 if (nport->node_name == opts->wwnn &&
1268 nport->port_name == opts->wwpn) {
1269 if ((remoteport && nport->rport) ||
1270 (!remoteport && nport->tport)) {
1271 nport = NULL;
1275 fcloop_nport_get(nport);
1280 nport->lport = lport;
1282 nport->port_role = opts->roles;
1284 nport->port_id = opts->fcaddr;
1302 return nport;
1310 struct fcloop_nport *nport;
1315 nport = fcloop_alloc_nport(buf, count, true);
1316 if (!nport)
1320 pinfo.node_name = nport->node_name;
1321 pinfo.port_name = nport->port_name;
1322 pinfo.port_role = nport->port_role;
1323 pinfo.port_id = nport->port_id;
1325 ret = nvme_fc_register_remoteport(nport->lport->localport,
1328 fcloop_nport_put(nport);
1335 rport->targetport = (nport->tport) ? nport->tport->targetport : NULL;
1336 if (nport->tport) {
1337 nport->tport->remoteport = remoteport;
1338 nport->tport->lport = nport->lport;
1340 rport->nport = nport;
1341 rport->lport = nport->lport;
1342 nport->rport = rport;
1352 __unlink_remote_port(struct fcloop_nport *nport)
1354 struct fcloop_rport *rport = nport->rport;
1356 if (rport && nport->tport)
1357 nport->tport->remoteport = NULL;
1358 nport->rport = NULL;
1364 __remoteport_unreg(struct fcloop_nport *nport, struct fcloop_rport *rport)
1376 struct fcloop_nport *nport = NULL, *tmpport;
1391 nport = tmpport;
1392 rport = __unlink_remote_port(nport);
1399 if (!nport)
1402 ret = __remoteport_unreg(nport, rport);
1412 struct fcloop_nport *nport;
1417 nport = fcloop_alloc_nport(buf, count, false);
1418 if (!nport)
1421 tinfo.node_name = nport->node_name;
1422 tinfo.port_name = nport->port_name;
1423 tinfo.port_id = nport->port_id;
1428 fcloop_nport_put(nport);
1435 tport->remoteport = (nport->rport) ? nport->rport->remoteport : NULL;
1436 if (nport->rport)
1437 nport->rport->targetport = targetport;
1438 tport->nport = nport;
1439 tport->lport = nport->lport;
1440 nport->tport = tport;
1450 __unlink_target_port(struct fcloop_nport *nport)
1452 struct fcloop_tport *tport = nport->tport;
1454 if (tport && nport->rport)
1455 nport->rport->targetport = NULL;
1456 nport->tport = NULL;
1462 __targetport_unreg(struct fcloop_nport *nport, struct fcloop_tport *tport)
1474 struct fcloop_nport *nport = NULL, *tmpport;
1489 nport = tmpport;
1490 tport = __unlink_target_port(nport);
1497 if (!nport)
1500 ret = __targetport_unreg(nport, tport);
1598 struct fcloop_nport *nport = NULL;
1607 nport = list_first_entry_or_null(&fcloop_nports,
1608 typeof(*nport), nport_list);
1609 if (!nport)
1612 tport = __unlink_target_port(nport);
1613 rport = __unlink_remote_port(nport);
1617 ret = __targetport_unreg(nport, tport);
1621 ret = __remoteport_unreg(nport, rport);