Lines Matching defs:nport
220 struct fcloop_nport *nport;
230 struct fcloop_nport *nport;
950 struct fcloop_nport *nport =
955 list_del(&nport->nport_list);
958 kfree(nport);
962 fcloop_nport_put(struct fcloop_nport *nport)
964 kref_put(&nport->ref, fcloop_nport_free);
968 fcloop_nport_get(struct fcloop_nport *nport)
970 return kref_get_unless_zero(&nport->ref);
989 fcloop_nport_put(rport->nport);
998 fcloop_nport_put(tport->nport);
1167 struct fcloop_nport *newnport, *nport = NULL;
1219 list_for_each_entry(nport, &fcloop_nports, nport_list) {
1220 if (nport->node_name == opts->wwnn &&
1221 nport->port_name == opts->wwpn) {
1222 if ((remoteport && nport->rport) ||
1223 (!remoteport && nport->tport)) {
1224 nport = NULL;
1228 fcloop_nport_get(nport);
1233 nport->lport = lport;
1235 nport->port_role = opts->roles;
1237 nport->port_id = opts->fcaddr;
1255 return nport;
1263 struct fcloop_nport *nport;
1268 nport = fcloop_alloc_nport(buf, count, true);
1269 if (!nport)
1273 pinfo.node_name = nport->node_name;
1274 pinfo.port_name = nport->port_name;
1275 pinfo.port_role = nport->port_role;
1276 pinfo.port_id = nport->port_id;
1278 ret = nvme_fc_register_remoteport(nport->lport->localport,
1281 fcloop_nport_put(nport);
1288 rport->targetport = (nport->tport) ? nport->tport->targetport : NULL;
1289 if (nport->tport) {
1290 nport->tport->remoteport = remoteport;
1291 nport->tport->lport = nport->lport;
1293 rport->nport = nport;
1294 rport->lport = nport->lport;
1295 nport->rport = rport;
1305 __unlink_remote_port(struct fcloop_nport *nport)
1307 struct fcloop_rport *rport = nport->rport;
1309 if (rport && nport->tport)
1310 nport->tport->remoteport = NULL;
1311 nport->rport = NULL;
1317 __remoteport_unreg(struct fcloop_nport *nport, struct fcloop_rport *rport)
1329 struct fcloop_nport *nport = NULL, *tmpport;
1344 nport = tmpport;
1345 rport = __unlink_remote_port(nport);
1352 if (!nport)
1355 ret = __remoteport_unreg(nport, rport);
1365 struct fcloop_nport *nport;
1370 nport = fcloop_alloc_nport(buf, count, false);
1371 if (!nport)
1374 tinfo.node_name = nport->node_name;
1375 tinfo.port_name = nport->port_name;
1376 tinfo.port_id = nport->port_id;
1381 fcloop_nport_put(nport);
1388 tport->remoteport = (nport->rport) ? nport->rport->remoteport : NULL;
1389 if (nport->rport)
1390 nport->rport->targetport = targetport;
1391 tport->nport = nport;
1392 tport->lport = nport->lport;
1393 nport->tport = tport;
1403 __unlink_target_port(struct fcloop_nport *nport)
1405 struct fcloop_tport *tport = nport->tport;
1407 if (tport && nport->rport)
1408 nport->rport->targetport = NULL;
1409 nport->tport = NULL;
1415 __targetport_unreg(struct fcloop_nport *nport, struct fcloop_tport *tport)
1427 struct fcloop_nport *nport = NULL, *tmpport;
1442 nport = tmpport;
1443 tport = __unlink_target_port(nport);
1450 if (!nport)
1453 ret = __targetport_unreg(nport, tport);
1521 struct fcloop_nport *nport;
1530 nport = list_first_entry_or_null(&fcloop_nports,
1531 typeof(*nport), nport_list);
1532 if (!nport)
1535 tport = __unlink_target_port(nport);
1536 rport = __unlink_remote_port(nport);
1540 ret = __targetport_unreg(nport, tport);
1544 ret = __remoteport_unreg(nport, rport);