Lines Matching +full:re +full:- +full:attached

1 // SPDX-License-Identifier: GPL-2.0
19 struct efc *efc = node->efc; in efc_d_send_prli_rsp()
21 node->ls_acc_oxid = ox_id; in efc_d_send_prli_rsp()
22 node->send_ls_acc = EFC_NODE_SEND_LS_ACC_PRLI; in efc_d_send_prli_rsp()
29 if (node->init) { in efc_d_send_prli_rsp()
31 node->display_name, node->wwpn, node->wwnn); in efc_d_send_prli_rsp()
32 if (node->nport->enable_tgt) in efc_d_send_prli_rsp()
33 rc = efc->tt.scsi_new_node(efc, node); in efc_d_send_prli_rsp()
50 node = ctx->app; in __efc_d_common()
51 efc = node->efc; in __efc_d_common()
56 efc_log_debug(efc, "[%s] %-20s %-20s\n", node->display_name, in __efc_d_common()
58 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT; in __efc_d_common()
62 efc_log_debug(efc, "[%s] %-20s %-20s\n", in __efc_d_common()
63 node->display_name, funcname, in __efc_d_common()
65 node->shutdown_reason = EFC_NODE_SHUTDOWN_EXPLICIT_LOGO; in __efc_d_common()
69 efc_log_debug(efc, "[%s] %-20s %-20s\n", node->display_name, in __efc_d_common()
71 node->shutdown_reason = EFC_NODE_SHUTDOWN_IMPLICIT_LOGO; in __efc_d_common()
85 struct efc_node *node = ctx->app; in __efc_d_wait_del_node()
91 * to the target-server/initiator-client and needs to wait for that in __efc_d_wait_del_node()
122 WARN_ON(!node->els_req_cnt); in __efc_d_wait_del_node()
123 node->els_req_cnt--; in __efc_d_wait_del_node()
126 /* ignore shutdown events as we're already in shutdown path */ in __efc_d_wait_del_node()
129 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT; in __efc_d_wait_del_node()
148 struct efc_node *node = ctx->app; in __efc_d_wait_del_ini_tgt()
175 WARN_ON(!node->els_req_cnt); in __efc_d_wait_del_ini_tgt()
176 node->els_req_cnt--; in __efc_d_wait_del_ini_tgt()
179 /* ignore shutdown events as we're already in shutdown path */ in __efc_d_wait_del_ini_tgt()
182 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT; in __efc_d_wait_del_ini_tgt()
201 struct efc_node *node = ctx->app; in __efc_d_initiate_shutdown()
202 struct efc *efc = node->efc; in __efc_d_initiate_shutdown()
213 node->els_io_enabled = false; in __efc_d_initiate_shutdown()
216 if (node->init && !node->targ) { in __efc_d_initiate_shutdown()
217 efc_log_info(node->efc, in __efc_d_initiate_shutdown()
219 node->display_name, in __efc_d_initiate_shutdown()
220 node->wwpn, node->wwnn); in __efc_d_initiate_shutdown()
224 if (node->nport->enable_tgt) in __efc_d_initiate_shutdown()
225 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_initiate_shutdown()
232 } else if (node->targ && !node->init) { in __efc_d_initiate_shutdown()
233 efc_log_info(node->efc, in __efc_d_initiate_shutdown()
235 node->display_name, in __efc_d_initiate_shutdown()
236 node->wwpn, node->wwnn); in __efc_d_initiate_shutdown()
240 if (node->nport->enable_ini) in __efc_d_initiate_shutdown()
241 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_initiate_shutdown()
248 } else if (node->init && node->targ) { in __efc_d_initiate_shutdown()
249 efc_log_info(node->efc, in __efc_d_initiate_shutdown()
251 node->display_name, node->wwpn, node->wwnn); in __efc_d_initiate_shutdown()
254 if (node->nport->enable_tgt) in __efc_d_initiate_shutdown()
255 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_initiate_shutdown()
263 if (node->nport->enable_ini) in __efc_d_initiate_shutdown()
264 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_initiate_shutdown()
280 if (node->attached) { in __efc_d_initiate_shutdown()
282 * away or sometime later, will check node->attached in __efc_d_initiate_shutdown()
285 rc = efc_cmd_node_detach(efc, &node->rnode); in __efc_d_initiate_shutdown()
293 if (!node->init && !node->targ) { in __efc_d_initiate_shutdown()
317 struct efc_node *node = ctx->app; in __efc_d_wait_loop()
347 u16 ox_id = be16_to_cpu(hdr->fh_ox_id); in efc_send_ls_acc_after_attach()
350 WARN_ON(node->send_ls_acc != EFC_NODE_SEND_LS_ACC_NONE); in efc_send_ls_acc_after_attach()
352 node->ls_acc_oxid = ox_id; in efc_send_ls_acc_after_attach()
353 node->send_ls_acc = ls; in efc_send_ls_acc_after_attach()
354 node->ls_acc_did = ntoh24(hdr->fh_d_id); in efc_send_ls_acc_after_attach()
366 node->init = (pp->sp.spp_flags & FCP_SPPF_INIT_FCN) != 0; in efc_process_prli_payload()
367 node->targ = (pp->sp.spp_flags & FCP_SPPF_TARG_FCN) != 0; in efc_process_prli_payload()
374 struct efc_node *node = ctx->app; in __efc_d_wait_plogi_acc_cmpl()
390 WARN_ON(!node->els_cmpl_cnt); in __efc_d_wait_plogi_acc_cmpl()
391 node->els_cmpl_cnt--; in __efc_d_wait_plogi_acc_cmpl()
392 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT; in __efc_d_wait_plogi_acc_cmpl()
397 WARN_ON(!node->els_cmpl_cnt); in __efc_d_wait_plogi_acc_cmpl()
398 node->els_cmpl_cnt--; in __efc_d_wait_plogi_acc_cmpl()
411 struct efc_node *node = ctx->app; in __efc_d_wait_logo_rsp()
434 WARN_ON(!node->els_req_cnt); in __efc_d_wait_logo_rsp()
435 node->els_req_cnt--; in __efc_d_wait_logo_rsp()
452 node->send_plogi = send_plogi; in efc_node_init_device()
453 if ((node->efc->nodedb_mask & EFC_NODEDB_PAUSE_NEW_NODES) && in efc_node_init_device()
454 (node->rnode.fc_id != FC_FID_DOM_MGR)) { in efc_node_init_device()
455 node->nodedb_state = __efc_d_init; in efc_node_init_device()
465 switch (node->nport->topology) { in efc_d_check_plogi_topology()
467 /* we're not attached and nport is p2p, in efc_d_check_plogi_topology()
470 efc_domain_attach(node->nport->domain, d_id); in efc_d_check_plogi_topology()
474 /* we're not attached and nport is fabric, domain in efc_d_check_plogi_topology()
484 * CQ), thus we don't know what we're connected to in efc_d_check_plogi_topology()
499 node->nport->topology); in efc_d_check_plogi_topology()
507 struct efc_node *node = ctx->app; in __efc_d_init()
520 if (!node->send_plogi) in __efc_d_init()
523 * and domain is attached in __efc_d_init()
525 if (node->nport->enable_ini && in __efc_d_init()
526 node->nport->domain->attached) { in __efc_d_init()
532 node->nport->enable_ini); in __efc_d_init()
533 node_printf(node, "domain attached=%d\n", in __efc_d_init()
534 node->nport->domain->attached); in __efc_d_init()
539 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_init()
542 efc_node_save_sparms(node, cbdata->payload->dma.virt); in __efc_d_init()
544 cbdata->header->dma.virt, in __efc_d_init()
547 /* domain not attached; several possibilities: */ in __efc_d_init()
548 if (!node->nport->domain->attached) { in __efc_d_init()
549 efc_d_check_plogi_topology(node, ntoh24(hdr->fh_d_id)); in __efc_d_init()
553 /* domain already attached */ in __efc_d_init()
568 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_init()
569 u32 d_id = ntoh24(hdr->fh_d_id); in __efc_d_init()
572 memcpy(node->nport->domain->flogi_service_params, in __efc_d_init()
573 cbdata->payload->dma.virt, in __efc_d_init()
579 efc_send_flogi_p2p_acc(node, be16_to_cpu(hdr->fh_ox_id), d_id); in __efc_d_init()
581 if (efc_p2p_setup(node->nport)) { in __efc_d_init()
592 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_init()
594 if (!node->nport->domain->attached) { in __efc_d_init()
600 node_printf(node, "%s domain not attached, dropping\n", in __efc_d_init()
607 efc_send_logo_acc(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_init()
617 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_init()
619 if (!node->nport->domain->attached) { in __efc_d_init()
624 node_printf(node, "%s domain not attached, dropping\n", in __efc_d_init()
635 efc_send_ls_rjt(node, be16_to_cpu(hdr->fh_ox_id), in __efc_d_init()
642 /* note: problem, we're now expecting an ELS REQ completion in __efc_d_init()
645 if (!node->nport->domain->attached) { in __efc_d_init()
651 node_printf(node, "%s domain not attached, dropping\n", in __efc_d_init()
692 struct efc_node *node = ctx->app; in __efc_d_wait_plogi_rsp()
703 * no-op in __efc_d_wait_plogi_rsp()
708 efc_node_save_sparms(node, cbdata->payload->dma.virt); in __efc_d_wait_plogi_rsp()
710 cbdata->header->dma.virt, in __efc_d_wait_plogi_rsp()
712 /* sm: domain->attached / efc_node_attach */ in __efc_d_wait_plogi_rsp()
730 efc_process_prli_payload(node, cbdata->payload->dma.virt); in __efc_d_wait_plogi_rsp()
732 cbdata->header->dma.virt, in __efc_d_wait_plogi_rsp()
745 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_wait_plogi_rsp()
750 efc_send_ls_rjt(node, be16_to_cpu(hdr->fh_ox_id), in __efc_d_wait_plogi_rsp()
762 WARN_ON(!node->els_req_cnt); in __efc_d_wait_plogi_rsp()
763 node->els_req_cnt--; in __efc_d_wait_plogi_rsp()
765 efc_node_save_sparms(node, cbdata->els_rsp.virt); in __efc_d_wait_plogi_rsp()
780 WARN_ON(!node->els_req_cnt); in __efc_d_wait_plogi_rsp()
781 node->els_req_cnt--; in __efc_d_wait_plogi_rsp()
791 WARN_ON(!node->els_req_cnt); in __efc_d_wait_plogi_rsp()
792 node->els_req_cnt--; in __efc_d_wait_plogi_rsp()
814 struct efc_node *node = ctx->app; in __efc_d_wait_plogi_rsp_recvd_prli()
845 WARN_ON(!node->els_req_cnt); in __efc_d_wait_plogi_rsp_recvd_prli()
846 node->els_req_cnt--; in __efc_d_wait_plogi_rsp_recvd_prli()
848 efc_node_save_sparms(node, cbdata->els_rsp.virt); in __efc_d_wait_plogi_rsp_recvd_prli()
864 WARN_ON(!node->els_req_cnt); in __efc_d_wait_plogi_rsp_recvd_prli()
865 node->els_req_cnt--; in __efc_d_wait_plogi_rsp_recvd_prli()
879 struct efc_node *node = ctx->app; in __efc_d_wait_domain_attach()
895 WARN_ON(!node->nport->domain->attached); in __efc_d_wait_domain_attach()
915 struct efc_node *node = ctx->app; in __efc_d_wait_topology_notify()
933 WARN_ON(node->nport->domain->attached); in __efc_d_wait_topology_notify()
935 WARN_ON(node->send_ls_acc != EFC_NODE_SEND_LS_ACC_PLOGI); in __efc_d_wait_topology_notify()
949 efc_domain_attach(node->nport->domain, in __efc_d_wait_topology_notify()
950 node->ls_acc_did); in __efc_d_wait_topology_notify()
961 WARN_ON(!node->nport->domain->attached); in __efc_d_wait_topology_notify()
981 struct efc_node *node = ctx->app; in __efc_d_wait_node_attach()
997 node->attached = true; in __efc_d_wait_node_attach()
998 switch (node->send_ls_acc) { in __efc_d_wait_node_attach()
1002 efc_send_plogi_acc(node, node->ls_acc_oxid); in __efc_d_wait_node_attach()
1005 node->send_ls_acc = EFC_NODE_SEND_LS_ACC_NONE; in __efc_d_wait_node_attach()
1006 node->ls_acc_io = NULL; in __efc_d_wait_node_attach()
1010 efc_d_send_prli_rsp(node, node->ls_acc_oxid); in __efc_d_wait_node_attach()
1011 node->send_ls_acc = EFC_NODE_SEND_LS_ACC_NONE; in __efc_d_wait_node_attach()
1012 node->ls_acc_io = NULL; in __efc_d_wait_node_attach()
1027 node->attached = false; in __efc_d_wait_node_attach()
1029 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT; in __efc_d_wait_node_attach()
1036 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT; in __efc_d_wait_node_attach()
1042 node->shutdown_reason = EFC_NODE_SHUTDOWN_EXPLICIT_LOGO; in __efc_d_wait_node_attach()
1048 node->shutdown_reason = EFC_NODE_SHUTDOWN_IMPLICIT_LOGO; in __efc_d_wait_node_attach()
1061 struct efc_node *node = ctx->app; in __efc_d_wait_attach_evt_shutdown()
1078 node->attached = true; in __efc_d_wait_attach_evt_shutdown()
1086 node->attached = false; in __efc_d_wait_attach_evt_shutdown()
1092 /* ignore shutdown events as we're already in shutdown path */ in __efc_d_wait_attach_evt_shutdown()
1095 node->shutdown_reason = EFC_NODE_SHUTDOWN_DEFAULT; in __efc_d_wait_attach_evt_shutdown()
1113 struct efc_node *node = ctx->app; in __efc_d_port_logged_in()
1122 if (node->nport->enable_ini && in __efc_d_port_logged_in()
1123 !(node->rnode.fc_id != FC_FID_DOM_MGR)) { in __efc_d_port_logged_in()
1136 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_port_logged_in()
1142 pp = cbdata->payload->dma.virt; in __efc_d_port_logged_in()
1143 if (pp->sp.spp_type != FC_TYPE_FCP) { in __efc_d_port_logged_in()
1145 efc_send_ls_rjt(node, be16_to_cpu(hdr->fh_ox_id), in __efc_d_port_logged_in()
1150 efc_process_prli_payload(node, cbdata->payload->dma.virt); in __efc_d_port_logged_in()
1151 efc_d_send_prli_rsp(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_port_logged_in()
1156 if (node->send_ls_acc == EFC_NODE_SEND_LS_ACC_PRLI) in __efc_d_port_logged_in()
1157 efc_send_prli_acc(node, node->ls_acc_oxid); in __efc_d_port_logged_in()
1159 node->send_ls_acc = EFC_NODE_SEND_LS_ACC_NONE; in __efc_d_port_logged_in()
1164 efc_send_ls_rjt(node, node->ls_acc_oxid, ELS_RJT_UNAB, in __efc_d_port_logged_in()
1166 node->send_ls_acc = EFC_NODE_SEND_LS_ACC_NONE; in __efc_d_port_logged_in()
1175 WARN_ON(!node->els_req_cnt); in __efc_d_port_logged_in()
1176 node->els_req_cnt--; in __efc_d_port_logged_in()
1178 efc_process_prli_payload(node, cbdata->els_rsp.virt); in __efc_d_port_logged_in()
1189 WARN_ON(!node->els_req_cnt); in __efc_d_port_logged_in()
1190 node->els_req_cnt--; in __efc_d_port_logged_in()
1206 WARN_ON(!node->els_req_cnt); in __efc_d_port_logged_in()
1207 node->els_req_cnt--; in __efc_d_port_logged_in()
1212 /* Normal T, I+T, target-server rejected the process login */ in __efc_d_port_logged_in()
1217 WARN_ON(!node->els_cmpl_cnt); in __efc_d_port_logged_in()
1218 node->els_cmpl_cnt--; in __efc_d_port_logged_in()
1227 efc_node_save_sparms(node, cbdata->payload->dma.virt); in __efc_d_port_logged_in()
1229 cbdata->header->dma.virt, in __efc_d_port_logged_in()
1242 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_port_logged_in()
1244 node_printf(node, "%s received attached=%d\n", in __efc_d_port_logged_in()
1246 node->attached); in __efc_d_port_logged_in()
1248 efc_send_logo_acc(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_port_logged_in()
1262 struct efc_node *node = ctx->app; in __efc_d_wait_logo_acc_cmpl()
1280 WARN_ON(!node->els_cmpl_cnt); in __efc_d_wait_logo_acc_cmpl()
1281 node->els_cmpl_cnt--; in __efc_d_wait_logo_acc_cmpl()
1295 struct efc_node *node = ctx->app; in __efc_d_device_ready()
1296 struct efc *efc = node->efc; in __efc_d_device_ready()
1305 node->fcp_enabled = true; in __efc_d_device_ready()
1306 if (node->targ) { in __efc_d_device_ready()
1309 node->display_name, in __efc_d_device_ready()
1310 node->wwpn, node->wwnn); in __efc_d_device_ready()
1311 if (node->nport->enable_ini) in __efc_d_device_ready()
1312 efc->tt.scsi_new_node(efc, node); in __efc_d_device_ready()
1317 node->fcp_enabled = false; in __efc_d_device_ready()
1325 efc_node_save_sparms(node, cbdata->payload->dma.virt); in __efc_d_device_ready()
1327 cbdata->header->dma.virt, in __efc_d_device_ready()
1341 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_device_ready()
1347 pp = cbdata->payload->dma.virt; in __efc_d_device_ready()
1348 if (pp->sp.spp_type != FC_TYPE_FCP) { in __efc_d_device_ready()
1350 efc_send_ls_rjt(node, be16_to_cpu(hdr->fh_ox_id), in __efc_d_device_ready()
1355 efc_process_prli_payload(node, cbdata->payload->dma.virt); in __efc_d_device_ready()
1356 efc_send_prli_acc(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_device_ready()
1361 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_device_ready()
1363 efc_send_prlo_acc(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_device_ready()
1369 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_device_ready()
1371 node_printf(node, "%s received attached=%d\n", in __efc_d_device_ready()
1372 efc_sm_event_name(evt), node->attached); in __efc_d_device_ready()
1374 efc_send_logo_acc(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_device_ready()
1380 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_device_ready()
1382 efc_send_adisc_acc(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_device_ready()
1399 if (node->nport->enable_rscn) in __efc_d_device_ready()
1406 WARN_ON(!node->els_cmpl_cnt); in __efc_d_device_ready()
1407 node->els_cmpl_cnt--; in __efc_d_device_ready()
1412 WARN_ON(!node->els_cmpl_cnt); in __efc_d_device_ready()
1413 node->els_cmpl_cnt--; in __efc_d_device_ready()
1427 struct efc_node *node = ctx->app; in __efc_d_device_gone()
1428 struct efc *efc = node->efc; in __efc_d_device_gone()
1443 node->display_name, in __efc_d_device_gone()
1444 labels[(node->targ << 1) | (node->init)], in __efc_d_device_gone()
1445 node->wwpn, node->wwnn); in __efc_d_device_gone()
1451 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_device_gone()
1458 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_device_gone()
1463 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_device_gone()
1468 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_device_gone()
1473 rc = efc->tt.scsi_del_node(efc, node, in __efc_d_device_gone()
1475 rc_2 = efc->tt.scsi_del_node(efc, node, in __efc_d_device_gone()
1507 efc_node_save_sparms(node, cbdata->payload->dma.virt); in __efc_d_device_gone()
1509 cbdata->header->dma.virt, in __efc_d_device_gone()
1531 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_device_gone()
1533 node_printf(node, "%s received attached=%d\n", in __efc_d_device_gone()
1534 efc_sm_event_name(evt), node->attached); in __efc_d_device_gone()
1536 efc_send_logo_acc(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_device_gone()
1550 struct efc_node *node = ctx->app; in __efc_d_wait_adisc_rsp()
1562 WARN_ON(!node->els_req_cnt); in __efc_d_wait_adisc_rsp()
1563 node->els_req_cnt--; in __efc_d_wait_adisc_rsp()
1576 WARN_ON(!node->els_req_cnt); in __efc_d_wait_adisc_rsp()
1577 node->els_req_cnt--; in __efc_d_wait_adisc_rsp()
1586 * the ADISC, so we need to abort the ADISC, and re-login in __efc_d_wait_adisc_rsp()
1590 struct fc_frame_header *hdr = cbdata->header->dma.virt; in __efc_d_wait_adisc_rsp()
1592 node_printf(node, "%s received attached=%d\n", in __efc_d_wait_adisc_rsp()
1593 efc_sm_event_name(evt), node->attached); in __efc_d_wait_adisc_rsp()
1595 efc_send_logo_acc(node, be16_to_cpu(hdr->fh_ox_id)); in __efc_d_wait_adisc_rsp()