Lines Matching +full:remote +full:- +full:pid
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
4 * Copyright (c) 2014- QLogic Corporation.
8 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
12 * rport.c Remote port implementation.
173 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_uninit()
174 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_uninit()
175 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_uninit()
180 rport->plogi_retries = 0; in bfa_fcs_rport_sm_uninit()
197 rport->ns_retries = 0; in bfa_fcs_rport_sm_uninit()
201 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_uninit()
212 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi_sending()
213 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi_sending()
214 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi_sending()
223 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
229 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
235 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
236 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_sending()
243 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
244 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi_sending()
247 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi_sending()
252 rport->pid = 0; in bfa_fcs_rport_sm_plogi_sending()
254 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
255 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_sending()
262 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi_sending()
273 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogiacc_sending()
274 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogiacc_sending()
275 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogiacc_sending()
285 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogiacc_sending()
299 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogiacc_sending()
300 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogiacc_sending()
306 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogiacc_sending()
308 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogiacc_sending()
313 rport->pid = 0; in bfa_fcs_rport_sm_plogiacc_sending()
315 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogiacc_sending()
316 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogiacc_sending()
328 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogiacc_sending()
339 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi_retry()
340 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi_retry()
341 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi_retry()
351 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
361 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
367 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
368 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_retry()
375 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
376 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi_retry()
379 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi_retry()
384 rport->pid = 0; in bfa_fcs_rport_sm_plogi_retry()
386 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
387 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_retry()
394 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
399 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi_retry()
409 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi()
410 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi()
411 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi()
416 rport->plogi_retries = 0; in bfa_fcs_rport_sm_plogi()
424 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_plogi()
427 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
430 if (rport->plogi_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_plogi()
431 rport->plogi_retries++; in bfa_fcs_rport_sm_plogi()
433 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
437 bfa_stats(rport->port, rport_del_max_plogi_retry); in bfa_fcs_rport_sm_plogi()
438 rport->old_pid = rport->pid; in bfa_fcs_rport_sm_plogi()
439 rport->pid = 0; in bfa_fcs_rport_sm_plogi()
441 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
452 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
453 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
459 rport->plogi_retries = 0; in bfa_fcs_rport_sm_plogi()
461 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
467 rport->pid = 0; in bfa_fcs_rport_sm_plogi()
469 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
470 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
477 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
478 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi()
481 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi()
487 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
493 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
499 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
504 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi()
515 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_fcs_online()
516 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_fcs_online()
517 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_fcs_online()
521 if (rport->scsi_function == BFA_RPORT_INITIATOR) { in bfa_fcs_rport_sm_fc4_fcs_online()
522 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_sm_fc4_fcs_online()
528 if (!rport->bfa_rport) in bfa_fcs_rport_sm_fc4_fcs_online()
529 rport->bfa_rport = in bfa_fcs_rport_sm_fc4_fcs_online()
530 bfa_rport_create(rport->fcs->bfa, rport); in bfa_fcs_rport_sm_fc4_fcs_online()
532 if (rport->bfa_rport) { in bfa_fcs_rport_sm_fc4_fcs_online()
543 rport->plogi_pending = BFA_TRUE; in bfa_fcs_rport_sm_fc4_fcs_online()
568 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_fcs_online()
574 * PLOGI is complete. Awaiting BFA rport online callback. FC-4s
581 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hal_online()
582 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hal_online()
583 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hal_online()
609 rport->plogi_pending = BFA_TRUE; in bfa_fcs_rport_sm_hal_online()
620 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hal_online()
625 * Rport is ONLINE. FC-4s active.
630 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_online()
631 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_online()
632 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_online()
636 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_online()
639 rport->ns_retries = 0; in bfa_fcs_rport_sm_online()
672 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_online()
678 * prior to ADISC authentication with rport. FC-4s are paused.
684 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsquery_sending()
685 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsquery_sending()
686 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsquery_sending()
695 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
708 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
717 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
722 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsquery_sending()
728 * FC-4s are paused.
733 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsquery()
734 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsquery()
735 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsquery()
744 rport->ns_retries++; in bfa_fcs_rport_sm_nsquery()
745 if (rport->ns_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_nsquery()
757 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
767 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
776 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
781 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsquery()
787 * authenticating with rport. FC-4s are paused.
793 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_online_sending()
794 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_online_sending()
795 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online_sending()
804 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
811 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
818 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
827 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
832 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online_sending()
838 * FC-4s are paused.
844 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_online()
845 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_online()
846 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online()
855 * Too complex to cleanup FC-4 & rport and then acc to PLOGI. in bfa_fcs_rport_sm_adisc_online()
858 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
869 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
881 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
888 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
893 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online()
905 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_offline_sending()
906 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_offline_sending()
907 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline_sending()
920 bfa_fcxp_walloc_cancel(rport->fcs->bfa, in bfa_fcs_rport_sm_adisc_offline_sending()
921 &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_offline_sending()
922 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline_sending()
929 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_offline_sending()
934 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline_sending()
946 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_offline()
947 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_offline()
948 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline()
958 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_offline()
964 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline()
975 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_offline()
976 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline()
982 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline()
987 * Rport has sent LOGO. Awaiting FC-4 offline completion callback.
993 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_logorcv()
994 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_logorcv()
995 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logorcv()
1004 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_fc4_logorcv()
1006 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_fc4_logorcv()
1021 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logorcv()
1026 * LOGO needs to be sent to rport. Awaiting FC-4 offline completion
1033 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_logosend()
1034 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_logosend()
1035 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logosend()
1047 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_fc4_logosend()
1058 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logosend()
1063 * Rport is going offline. Awaiting FC-4 offline completion callback.
1069 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_offline()
1070 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_offline()
1071 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_offline()
1099 * SCN - ignore and wait till transitioning to offline state in bfa_fcs_rport_sm_fc4_offline()
1108 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_offline()
1113 * Rport is offline. FC-4s are offline. Awaiting BFA rport offline
1120 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_offline()
1121 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_offline()
1122 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_offline()
1126 if (bfa_fcs_lport_is_online(rport->port) && in bfa_fcs_rport_sm_hcb_offline()
1127 (rport->plogi_pending)) { in bfa_fcs_rport_sm_hcb_offline()
1128 rport->plogi_pending = BFA_FALSE; in bfa_fcs_rport_sm_hcb_offline()
1137 if (!bfa_fcs_lport_is_online(rport->port)) { in bfa_fcs_rport_sm_hcb_offline()
1138 rport->pid = 0; in bfa_fcs_rport_sm_hcb_offline()
1140 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_offline()
1145 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_hcb_offline()
1148 rport->ns_retries = 0; in bfa_fcs_rport_sm_hcb_offline()
1150 } else if (bfa_fcport_get_topology(rport->port->fcs->bfa) == in bfa_fcs_rport_sm_hcb_offline()
1152 if (rport->scn_online) { in bfa_fcs_rport_sm_hcb_offline()
1159 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_offline()
1165 rport->plogi_retries = 0; in bfa_fcs_rport_sm_hcb_offline()
1188 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_offline()
1193 * Rport is offline. FC-4s are offline. Awaiting BFA rport offline
1200 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_logorcv()
1201 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_logorcv()
1202 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logorcv()
1207 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_hcb_logorcv()
1209 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_hcb_logorcv()
1214 * we try to re-discover the r-port. in bfa_fcs_rport_sm_hcb_logorcv()
1216 if (bfa_fcs_lport_is_online(rport->port) && in bfa_fcs_rport_sm_hcb_logorcv()
1217 (!BFA_FCS_PID_IS_WKA(rport->pid))) { in bfa_fcs_rport_sm_hcb_logorcv()
1218 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_hcb_logorcv()
1221 rport->ns_retries = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1224 /* For N2N Direct Attach, try to re-login */ in bfa_fcs_rport_sm_hcb_logorcv()
1227 rport->plogi_retries = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1233 * pid to 0. in bfa_fcs_rport_sm_hcb_logorcv()
1235 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_sm_hcb_logorcv()
1236 rport->pid = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1238 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_logorcv()
1246 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_hcb_logorcv()
1248 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_hcb_logorcv()
1261 * Ignore - already processing a LOGO. in bfa_fcs_rport_sm_hcb_logorcv()
1266 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logorcv()
1271 * Rport is being deleted. FC-4s are offline.
1279 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_logosend()
1280 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_logosend()
1281 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logosend()
1293 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_hcb_logosend()
1305 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logosend()
1310 * Rport is being deleted. FC-4s are offline. LOGO is being sent.
1316 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_logo_sending()
1317 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_logo_sending()
1318 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_logo_sending()
1337 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_logo_sending()
1341 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_logo_sending()
1346 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_logo_sending()
1351 * Rport is offline. FC-4s are offline. BFA rport is offline.
1357 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_offline()
1358 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_offline()
1359 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_offline()
1369 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1370 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_offline()
1373 rport->ns_retries = 0; in bfa_fcs_rport_sm_offline()
1379 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1385 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1397 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1402 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1408 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1410 rport->plogi_retries = 0; in bfa_fcs_rport_sm_offline()
1415 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_offline()
1426 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_sending()
1427 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_sending()
1428 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sending()
1437 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1443 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1454 rport->ns_retries = 0; /* reset the retry count */ in bfa_fcs_rport_sm_nsdisc_sending()
1459 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1460 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sending()
1467 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1472 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sending()
1483 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_retry()
1484 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_retry()
1485 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_retry()
1496 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1497 rport->ns_retries = 0; in bfa_fcs_rport_sm_nsdisc_retry()
1503 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1509 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1514 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_retry()
1516 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1517 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_retry()
1531 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1536 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_retry()
1547 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_sent()
1548 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_sent()
1549 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sent()
1554 if (rport->pid) { in bfa_fcs_rport_sm_nsdisc_sent()
1560 rport->ns_retries = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1566 rport->ns_retries++; in bfa_fcs_rport_sm_nsdisc_sent()
1567 if (rport->ns_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_nsdisc_sent()
1572 rport->old_pid = rport->pid; in bfa_fcs_rport_sm_nsdisc_sent()
1573 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1575 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sent()
1583 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1589 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1594 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1596 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1597 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sent()
1614 * Not logged-in yet. Accept LOGO. in bfa_fcs_rport_sm_nsdisc_sent()
1621 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1626 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sent()
1638 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_off_delete()
1639 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_off_delete()
1640 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_off_delete()
1654 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_off_delete()
1667 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_delete_pending()
1668 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_delete_pending()
1669 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_delete_pending()
1684 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_delete_pending()
1696 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_plogi()
1701 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_plogi()
1704 bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE); in bfa_fcs_rport_send_plogi()
1706 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_plogi()
1710 rport->fcxp = fcxp; in bfa_fcs_rport_send_plogi()
1712 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_plogi()
1714 port->port_cfg.pwwn, port->port_cfg.nwwn, in bfa_fcs_rport_send_plogi()
1715 bfa_fcport_get_maxfrsize(port->fcs->bfa), in bfa_fcs_rport_send_plogi()
1716 bfa_fcport_get_rx_bbcredit(port->fcs->bfa)); in bfa_fcs_rport_send_plogi()
1718 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_plogi()
1722 rport->stats.plogis++; in bfa_fcs_rport_send_plogi()
1737 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_plogi_response()
1743 bfa_trc(rport->fcs, req_status); in bfa_fcs_rport_plogi_response()
1744 rport->stats.plogi_failed++; in bfa_fcs_rport_plogi_response()
1754 if (plogi_rsp->els_cmd.els_code != FC_ELS_ACC) { in bfa_fcs_rport_plogi_response()
1757 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rport_plogi_response()
1758 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rport_plogi_response()
1760 if ((ls_rjt->reason_code == FC_LS_RJT_RSN_UNABLE_TO_PERF_CMD) && in bfa_fcs_rport_plogi_response()
1761 (ls_rjt->reason_code_expl == FC_LS_RJT_EXP_INSUFF_RES)) { in bfa_fcs_rport_plogi_response()
1762 rport->stats.rjt_insuff_res++; in bfa_fcs_rport_plogi_response()
1767 rport->stats.plogi_rejects++; in bfa_fcs_rport_plogi_response()
1776 list_for_each(qe, &rport->port->rport_q) { in bfa_fcs_rport_plogi_response()
1780 if (!rport->pwwn && (plogi_rsp->port_name == twin->pwwn)) { in bfa_fcs_rport_plogi_response()
1781 bfa_trc(rport->fcs, twin->pid); in bfa_fcs_rport_plogi_response()
1782 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_plogi_response()
1785 twin->stats.plogis += rport->stats.plogis; in bfa_fcs_rport_plogi_response()
1786 twin->stats.plogi_rejects += in bfa_fcs_rport_plogi_response()
1787 rport->stats.plogi_rejects; in bfa_fcs_rport_plogi_response()
1788 twin->stats.plogi_timeouts += in bfa_fcs_rport_plogi_response()
1789 rport->stats.plogi_timeouts; in bfa_fcs_rport_plogi_response()
1790 twin->stats.plogi_failed += in bfa_fcs_rport_plogi_response()
1791 rport->stats.plogi_failed; in bfa_fcs_rport_plogi_response()
1792 twin->stats.plogi_rcvd += rport->stats.plogi_rcvd; in bfa_fcs_rport_plogi_response()
1793 twin->stats.plogi_accs++; in bfa_fcs_rport_plogi_response()
1798 twin->pid = rsp_fchs->s_id; in bfa_fcs_rport_plogi_response()
1805 * Normal login path -- no evil twins. in bfa_fcs_rport_plogi_response()
1807 rport->stats.plogi_accs++; in bfa_fcs_rport_plogi_response()
1816 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_plogiacc()
1821 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_plogiacc()
1822 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_send_plogiacc()
1825 bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_send_plogiacc()
1827 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_plogiacc()
1831 rport->fcxp = fcxp; in bfa_fcs_rport_send_plogiacc()
1834 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_plogiacc()
1835 rport->reply_oxid, port->port_cfg.pwwn, in bfa_fcs_rport_send_plogiacc()
1836 port->port_cfg.nwwn, in bfa_fcs_rport_send_plogiacc()
1837 bfa_fcport_get_maxfrsize(port->fcs->bfa), in bfa_fcs_rport_send_plogiacc()
1838 bfa_fcport_get_rx_bbcredit(port->fcs->bfa)); in bfa_fcs_rport_send_plogiacc()
1840 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_plogiacc()
1850 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_adisc()
1855 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_adisc()
1858 bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE); in bfa_fcs_rport_send_adisc()
1860 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_adisc()
1864 rport->fcxp = fcxp; in bfa_fcs_rport_send_adisc()
1866 len = fc_adisc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_adisc()
1868 port->port_cfg.pwwn, port->port_cfg.nwwn); in bfa_fcs_rport_send_adisc()
1870 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_adisc()
1874 rport->stats.adisc_sent++; in bfa_fcs_rport_send_adisc()
1888 bfa_trc(rport->fcs, req_status); in bfa_fcs_rport_adisc_response()
1889 rport->stats.adisc_failed++; in bfa_fcs_rport_adisc_response()
1894 if (fc_adisc_rsp_parse((struct fc_adisc_s *)pld, rsp_len, rport->pwwn, in bfa_fcs_rport_adisc_response()
1895 rport->nwwn) == FC_PARSE_OK) { in bfa_fcs_rport_adisc_response()
1896 rport->stats.adisc_accs++; in bfa_fcs_rport_adisc_response()
1901 rport->stats.adisc_rejects++; in bfa_fcs_rport_adisc_response()
1903 bfa_trc(rport->fcs, ls_rjt->els_cmd.els_code); in bfa_fcs_rport_adisc_response()
1904 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rport_adisc_response()
1905 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rport_adisc_response()
1913 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_nsdisc()
1919 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_nsdisc()
1922 bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE); in bfa_fcs_rport_send_nsdisc()
1924 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_nsdisc()
1928 rport->fcxp = fcxp; in bfa_fcs_rport_send_nsdisc()
1930 if (rport->pwwn) { in bfa_fcs_rport_send_nsdisc()
1932 bfa_fcs_lport_get_fcid(port), 0, rport->pwwn); in bfa_fcs_rport_send_nsdisc()
1936 bfa_fcs_lport_get_fcid(port), 0, rport->pid); in bfa_fcs_rport_send_nsdisc()
1940 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_nsdisc()
1958 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_gidpn_response()
1961 cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code); in bfa_fcs_rport_gidpn_response()
1963 if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) { in bfa_fcs_rport_gidpn_response()
1964 /* Check if the pid is the same as before. */ in bfa_fcs_rport_gidpn_response()
1967 if (gidpn_rsp->dap == rport->pid) { in bfa_fcs_rport_gidpn_response()
1972 * Device's PID has changed. We need to cleanup in bfa_fcs_rport_gidpn_response()
1973 * and re-login. If there is another device with in bfa_fcs_rport_gidpn_response()
1974 * the the newly discovered pid, send an scn notice in bfa_fcs_rport_gidpn_response()
1975 * so that its new pid can be discovered. in bfa_fcs_rport_gidpn_response()
1977 list_for_each(qe, &rport->port->rport_q) { in bfa_fcs_rport_gidpn_response()
1981 if (gidpn_rsp->dap == twin->pid) { in bfa_fcs_rport_gidpn_response()
1982 bfa_trc(rport->fcs, twin->pid); in bfa_fcs_rport_gidpn_response()
1983 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_gidpn_response()
1985 twin->pid = 0; in bfa_fcs_rport_gidpn_response()
1990 rport->pid = gidpn_rsp->dap; in bfa_fcs_rport_gidpn_response()
1999 switch (cthdr->reason_code) { in bfa_fcs_rport_gidpn_response()
2028 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_gpnid_response()
2031 cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code); in bfa_fcs_rport_gpnid_response()
2033 if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) { in bfa_fcs_rport_gpnid_response()
2041 switch (cthdr->reason_code) { in bfa_fcs_rport_gpnid_response()
2074 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_logo()
2076 port = rport->port; in bfa_fcs_rport_send_logo()
2079 bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_send_logo()
2081 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_logo()
2085 rport->fcxp = fcxp; in bfa_fcs_rport_send_logo()
2087 len = fc_logo_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_logo()
2091 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_logo()
2095 rport->stats.logos++; in bfa_fcs_rport_send_logo()
2096 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_send_logo()
2112 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_logo_acc()
2114 port = rport->port; in bfa_fcs_rport_send_logo_acc()
2116 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_send_logo_acc()
2120 rport->stats.logo_rcvd++; in bfa_fcs_rport_send_logo_acc()
2122 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_logo_acc()
2123 rport->reply_oxid); in bfa_fcs_rport_send_logo_acc()
2125 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_logo_acc()
2133 * param[in] rport - pointer to bfa_fcs_lport_ns_t.
2134 * param[out] rport_status - pointer to return vport status in
2148 rport->stats.plogi_timeouts++; in bfa_fcs_rport_timeout()
2149 bfa_stats(rport->port, rport_plogi_timeouts); in bfa_fcs_rport_timeout()
2159 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_prli()
2162 bfa_trc(port->fcs, rx_fchs->s_id); in bfa_fcs_rport_process_prli()
2163 bfa_trc(port->fcs, rx_fchs->d_id); in bfa_fcs_rport_process_prli()
2165 rport->stats.prli_rcvd++; in bfa_fcs_rport_process_prli()
2172 if (prli->parampage.servparams.target) { in bfa_fcs_rport_process_prli()
2179 bfa_trc(port->fcs, rx_fchs->s_id); in bfa_fcs_rport_process_prli()
2180 rport->scsi_function = BFA_RPORT_TARGET; in bfa_fcs_rport_process_prli()
2182 bfa_trc(rport->fcs, prli->parampage.type); in bfa_fcs_rport_process_prli()
2183 rport->scsi_function = BFA_RPORT_INITIATOR; in bfa_fcs_rport_process_prli()
2184 bfa_fcs_itnim_is_initiator(rport->itnim); in bfa_fcs_rport_process_prli()
2187 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_process_prli()
2192 rx_fchs->s_id, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_process_prli()
2193 rx_fchs->ox_id, port->port_cfg.roles); in bfa_fcs_rport_process_prli()
2195 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_process_prli()
2205 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_rpsc()
2209 bfa_trc(port->fcs, rx_fchs->s_id); in bfa_fcs_rport_process_rpsc()
2210 bfa_trc(port->fcs, rx_fchs->d_id); in bfa_fcs_rport_process_rpsc()
2212 rport->stats.rpsc_rcvd++; in bfa_fcs_rport_process_rpsc()
2220 bfa_fcport_get_attr(port->fcs->bfa, &pport_attr); in bfa_fcs_rport_process_rpsc()
2224 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_process_rpsc()
2229 rx_fchs->s_id, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_process_rpsc()
2230 rx_fchs->ox_id, &speeds); in bfa_fcs_rport_process_rpsc()
2232 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_process_rpsc()
2242 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_adisc()
2244 bfa_trc(port->fcs, rx_fchs->s_id); in bfa_fcs_rport_process_adisc()
2245 bfa_trc(port->fcs, rx_fchs->d_id); in bfa_fcs_rport_process_adisc()
2247 rport->stats.adisc_rcvd++; in bfa_fcs_rport_process_adisc()
2253 if (bfa_fcs_itnim_get_online_state(rport->itnim) == BFA_STATUS_OK) { in bfa_fcs_rport_process_adisc()
2255 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_process_adisc()
2260 rx_fchs->s_id, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_process_adisc()
2261 rx_fchs->ox_id, port->port_cfg.pwwn, in bfa_fcs_rport_process_adisc()
2262 port->port_cfg.nwwn); in bfa_fcs_rport_process_adisc()
2264 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, in bfa_fcs_rport_process_adisc()
2268 rport->stats.adisc_rejected++; in bfa_fcs_rport_process_adisc()
2278 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_online()
2281 rport_info.pid = rport->pid; in bfa_fcs_rport_hal_online()
2282 rport_info.local_pid = port->pid; in bfa_fcs_rport_hal_online()
2283 rport_info.lp_tag = port->lp_tag; in bfa_fcs_rport_hal_online()
2284 rport_info.vf_id = port->fabric->vf_id; in bfa_fcs_rport_hal_online()
2285 rport_info.vf_en = port->fabric->is_vf; in bfa_fcs_rport_hal_online()
2286 rport_info.fc_class = rport->fc_cos; in bfa_fcs_rport_hal_online()
2287 rport_info.cisc = rport->cisc; in bfa_fcs_rport_hal_online()
2288 rport_info.max_frmsz = rport->maxfrsize; in bfa_fcs_rport_hal_online()
2289 bfa_rport_online(rport->bfa_rport, &rport_info); in bfa_fcs_rport_hal_online()
2295 if (rport->bfa_rport) in bfa_fcs_rport_hal_offline()
2296 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); in bfa_fcs_rport_hal_offline()
2304 struct bfa_fcs_s *fcs = port->fcs; in bfa_fcs_rport_alloc()
2311 if (fcs->num_rport_logins >= bfa_fcs_rport_max_logins) { in bfa_fcs_rport_alloc()
2316 if (bfa_fcb_rport_alloc(fcs->bfad, &rport, &rport_drv) in bfa_fcs_rport_alloc()
2323 * Initialize r-port in bfa_fcs_rport_alloc()
2325 rport->port = port; in bfa_fcs_rport_alloc()
2326 rport->fcs = fcs; in bfa_fcs_rport_alloc()
2327 rport->rp_drv = rport_drv; in bfa_fcs_rport_alloc()
2328 rport->pid = rpid; in bfa_fcs_rport_alloc()
2329 rport->pwwn = pwwn; in bfa_fcs_rport_alloc()
2330 rport->old_pid = 0; in bfa_fcs_rport_alloc()
2332 rport->bfa_rport = NULL; in bfa_fcs_rport_alloc()
2335 * allocate FC-4s in bfa_fcs_rport_alloc()
2340 rport->itnim = bfa_fcs_itnim_create(rport); in bfa_fcs_rport_alloc()
2341 if (!rport->itnim) { in bfa_fcs_rport_alloc()
2349 fcs->num_rport_logins++; in bfa_fcs_rport_alloc()
2354 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_alloc()
2364 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_free()
2365 struct bfa_fcs_s *fcs = port->fcs; in bfa_fcs_rport_free()
2368 * - delete FC-4s in bfa_fcs_rport_free()
2369 * - delete BFA rport in bfa_fcs_rport_free()
2370 * - remove from queue of rports in bfa_fcs_rport_free()
2372 rport->plogi_pending = BFA_FALSE; in bfa_fcs_rport_free()
2375 bfa_fcs_itnim_delete(rport->itnim); in bfa_fcs_rport_free()
2376 if (rport->pid != 0 && !BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_free()
2380 if (rport->bfa_rport) { in bfa_fcs_rport_free()
2381 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_DELETE); in bfa_fcs_rport_free()
2382 rport->bfa_rport = NULL; in bfa_fcs_rport_free()
2386 fcs->num_rport_logins--; in bfa_fcs_rport_free()
2387 kfree(rport->rp_drv); in bfa_fcs_rport_free()
2395 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_aen_post()
2396 struct bfad_s *bfad = (struct bfad_s *)port->fcs->bfad; in bfa_fcs_rport_aen_post()
2404 aen_entry->aen_data.rport.priv.qos = data->priv.qos; in bfa_fcs_rport_aen_post()
2406 aen_entry->aen_data.rport.priv.qos = data->priv.qos; in bfa_fcs_rport_aen_post()
2408 aen_entry->aen_data.rport.vf_id = rport->port->fabric->vf_id; in bfa_fcs_rport_aen_post()
2409 aen_entry->aen_data.rport.ppwwn = bfa_fcs_lport_get_pwwn( in bfa_fcs_rport_aen_post()
2410 bfa_fcs_get_base_port(rport->fcs)); in bfa_fcs_rport_aen_post()
2411 aen_entry->aen_data.rport.lpwwn = bfa_fcs_lport_get_pwwn(rport->port); in bfa_fcs_rport_aen_post()
2412 aen_entry->aen_data.rport.rpwwn = rport->pwwn; in bfa_fcs_rport_aen_post()
2415 bfad_im_post_vendor_event(aen_entry, bfad, ++rport->fcs->fcs_aen_seq, in bfa_fcs_rport_aen_post()
2422 if ((!rport->pid) || (!rport->pwwn)) { in bfa_fcs_rport_fcs_online_action()
2423 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_fcs_online_action()
2424 bfa_sm_fault(rport->fcs, rport->pid); in bfa_fcs_rport_fcs_online_action()
2427 bfa_sm_send_event(rport->itnim, BFA_FCS_ITNIM_SM_FCS_ONLINE); in bfa_fcs_rport_fcs_online_action()
2433 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_online_action()
2434 struct bfad_s *bfad = (struct bfad_s *)port->fcs->bfad; in bfa_fcs_rport_hal_online_action()
2438 rport->stats.onlines++; in bfa_fcs_rport_hal_online_action()
2440 if ((!rport->pid) || (!rport->pwwn)) { in bfa_fcs_rport_hal_online_action()
2441 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_hal_online_action()
2442 bfa_sm_fault(rport->fcs, rport->pid); in bfa_fcs_rport_hal_online_action()
2446 bfa_fcs_itnim_brp_online(rport->itnim); in bfa_fcs_rport_hal_online_action()
2447 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_hal_online_action()
2452 wwn2str(rpwwn_buf, rport->pwwn); in bfa_fcs_rport_hal_online_action()
2453 if (!BFA_FCS_PID_IS_WKA(rport->pid)) { in bfa_fcs_rport_hal_online_action()
2455 "Remote port (WWN = %s) online for logical port (WWN = %s)\n", in bfa_fcs_rport_hal_online_action()
2464 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_fcs_offline_action()
2467 bfa_fcs_itnim_rport_offline(rport->itnim); in bfa_fcs_rport_fcs_offline_action()
2473 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_offline_action()
2474 struct bfad_s *bfad = (struct bfad_s *)port->fcs->bfad; in bfa_fcs_rport_hal_offline_action()
2478 if (!rport->bfa_rport) { in bfa_fcs_rport_hal_offline_action()
2483 rport->stats.offlines++; in bfa_fcs_rport_hal_offline_action()
2486 wwn2str(rpwwn_buf, rport->pwwn); in bfa_fcs_rport_hal_offline_action()
2487 if (!BFA_FCS_PID_IS_WKA(rport->pid)) { in bfa_fcs_rport_hal_offline_action()
2488 if (bfa_fcs_lport_is_online(rport->port) == BFA_TRUE) { in bfa_fcs_rport_hal_offline_action()
2490 "Remote port (WWN = %s) connectivity lost for " in bfa_fcs_rport_hal_offline_action()
2497 "Remote port (WWN = %s) offlined by " in bfa_fcs_rport_hal_offline_action()
2506 bfa_fcs_itnim_rport_offline(rport->itnim); in bfa_fcs_rport_hal_offline_action()
2507 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_hal_offline_action()
2518 bfa_fcs_lport_t *port = rport->port; in bfa_fcs_rport_update()
2521 * - port name in bfa_fcs_rport_update()
2522 * - node name in bfa_fcs_rport_update()
2524 rport->pwwn = plogi->port_name; in bfa_fcs_rport_update()
2525 rport->nwwn = plogi->node_name; in bfa_fcs_rport_update()
2528 * - class of service in bfa_fcs_rport_update()
2530 rport->fc_cos = 0; in bfa_fcs_rport_update()
2531 if (plogi->class3.class_valid) in bfa_fcs_rport_update()
2532 rport->fc_cos = FC_CLASS_3; in bfa_fcs_rport_update()
2534 if (plogi->class2.class_valid) in bfa_fcs_rport_update()
2535 rport->fc_cos |= FC_CLASS_2; in bfa_fcs_rport_update()
2538 * - CISC in bfa_fcs_rport_update()
2539 * - MAX receive frame size in bfa_fcs_rport_update()
2541 rport->cisc = plogi->csp.cisc; in bfa_fcs_rport_update()
2542 if (be16_to_cpu(plogi->class3.rxsz) < be16_to_cpu(plogi->csp.rxsz)) in bfa_fcs_rport_update()
2543 rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz); in bfa_fcs_rport_update()
2545 rport->maxfrsize = be16_to_cpu(plogi->csp.rxsz); in bfa_fcs_rport_update()
2547 bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred)); in bfa_fcs_rport_update()
2548 bfa_trc(port->fcs, port->fabric->bb_credit); in bfa_fcs_rport_update()
2557 if ((!bfa_fcs_fabric_is_switched(port->fabric)) && in bfa_fcs_rport_update()
2558 (be16_to_cpu(plogi->csp.bbcred) < port->fabric->bb_credit)) { in bfa_fcs_rport_update()
2560 bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred)); in bfa_fcs_rport_update()
2561 bfa_trc(port->fcs, port->fabric->bb_credit); in bfa_fcs_rport_update()
2563 port->fabric->bb_credit = be16_to_cpu(plogi->csp.bbcred); in bfa_fcs_rport_update()
2564 bfa_fcport_set_tx_bbcredit(port->fcs->bfa, in bfa_fcs_rport_update()
2565 port->fabric->bb_credit); in bfa_fcs_rport_update()
2571 * Called to handle LOGO received from an existing remote port.
2576 rport->reply_oxid = fchs->ox_id; in bfa_fcs_rport_process_logo()
2577 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_process_logo()
2579 rport->prlo = BFA_FALSE; in bfa_fcs_rport_process_logo()
2580 rport->stats.logo_rcvd++; in bfa_fcs_rport_process_logo()
2591 * Called by bport/vport to create a remote port instance for a discovered
2592 * remote device.
2594 * @param[in] port - base port or vport
2595 * @param[in] rpid - remote port ID
2604 bfa_trc(port->fcs, rpid); in bfa_fcs_rport_create()
2616 * @param[in] port - base port
2617 * @param[in] rpwwn - remote port wwn
2625 bfa_trc(port->fcs, rpwwn); in bfa_fcs_rport_create_by_wwn()
2637 * @param[in] port - base port or vport
2638 * @param[in] rpid - remote port ID
2646 rport = bfa_fcs_rport_alloc(port, WWN_NULL, fchs->s_id); in bfa_fcs_rport_start()
2656 * Called by bport/vport to handle PLOGI received from a new remote port.
2665 rport = bfa_fcs_rport_alloc(port, plogi->port_name, fchs->s_id); in bfa_fcs_rport_plogi_create()
2671 rport->reply_oxid = fchs->ox_id; in bfa_fcs_rport_plogi_create()
2672 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_plogi_create()
2674 rport->stats.plogi_rcvd++; in bfa_fcs_rport_plogi_create()
2680 * remote port.
2687 * @todo Handle P2P and initiator-initiator. in bfa_fcs_rport_plogi()
2692 rport->reply_oxid = rx_fchs->ox_id; in bfa_fcs_rport_plogi()
2693 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_plogi()
2695 rport->pid = rx_fchs->s_id; in bfa_fcs_rport_plogi()
2696 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_plogi()
2698 rport->stats.plogi_rcvd++; in bfa_fcs_rport_plogi()
2704 * Called by bport/vport to notify SCN for the remote port
2709 rport->stats.rscns++; in bfa_fcs_rport_scn()
2717 * param[in] cb_arg - rport struct.
2732 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_online()
2740 * param[in] rport -
2754 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_offline()
2763 * param[in] rport -
2780 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_qos_scn_flowid()
2788 struct bfa_fcs_s *fcs = &((struct bfad_s *)bfa->bfad)->bfa_fcs; in bfa_cb_rport_scn_online()
2793 list_for_each(qe, &port->rport_q) { in bfa_cb_rport_scn_online()
2796 rp->scn_online = BFA_TRUE; in bfa_cb_rport_scn_online()
2809 rp->scn_online = BFA_FALSE; in bfa_cb_rport_scn_no_dev()
2815 struct bfa_fcs_s *fcs = &((struct bfad_s *)bfa->bfad)->bfa_fcs; in bfa_cb_rport_scn_offline()
2820 list_for_each(qe, &port->rport_q) { in bfa_cb_rport_scn_offline()
2823 rp->scn_online = BFA_FALSE; in bfa_cb_rport_scn_offline()
2832 * param[in] rport -
2849 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_qos_scn_prio()
2855 * Called to process any unsolicted frames from this remote port
2861 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_uf_recv()
2864 bfa_trc(rport->fcs, fchs->s_id); in bfa_fcs_rport_uf_recv()
2865 bfa_trc(rport->fcs, fchs->d_id); in bfa_fcs_rport_uf_recv()
2866 bfa_trc(rport->fcs, fchs->type); in bfa_fcs_rport_uf_recv()
2868 if (fchs->type != FC_TYPE_ELS) in bfa_fcs_rport_uf_recv()
2873 bfa_trc(rport->fcs, els_cmd->els_code); in bfa_fcs_rport_uf_recv()
2875 switch (els_cmd->els_code) { in bfa_fcs_rport_uf_recv()
2889 bfa_fcs_fcpim_uf_recv(rport->itnim, fchs, len); in bfa_fcs_rport_uf_recv()
2915 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_prlo_acc()
2920 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_prlo_acc()
2922 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_send_prlo_acc()
2926 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_prlo_acc()
2927 rport->reply_oxid, 0); in bfa_fcs_rport_send_prlo_acc()
2929 bfa_fcxp_send(fcxp, rport->bfa_rport, port->fabric->vf_id, in bfa_fcs_rport_send_prlo_acc()
2930 port->lp_tag, BFA_FALSE, FC_CLASS_3, len, &fchs, in bfa_fcs_rport_send_prlo_acc()
2941 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_ls_rjt()
2946 bfa_trc(rport->fcs, rx_fchs->s_id); in bfa_fcs_rport_send_ls_rjt()
2948 fcxp = bfa_fcs_fcxp_alloc(rport->fcs, BFA_FALSE); in bfa_fcs_rport_send_ls_rjt()
2953 rx_fchs->s_id, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_ls_rjt()
2954 rx_fchs->ox_id, reason_code, reason_code_expl); in bfa_fcs_rport_send_ls_rjt()
2956 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, in bfa_fcs_rport_send_ls_rjt()
2967 return bfa_sm_to_state(rport_sm_table, rport->sm); in bfa_fcs_rport_get_state()
2989 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_prlo()
2991 rport->prlo = BFA_TRUE; in bfa_fcs_rport_prlo()
2992 rport->reply_oxid = ox_id; in bfa_fcs_rport_prlo()
2998 * which limits number of concurrent logins to remote ports
3012 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_get_attr()
3013 bfa_port_speed_t rport_speed = rport->rpf.rpsc_speed; in bfa_fcs_rport_get_attr()
3016 bfa_fcport_get_attr(rport->fcs->bfa, &port_attr); in bfa_fcs_rport_get_attr()
3021 rport_attr->pid = rport->pid; in bfa_fcs_rport_get_attr()
3022 rport_attr->pwwn = rport->pwwn; in bfa_fcs_rport_get_attr()
3023 rport_attr->nwwn = rport->nwwn; in bfa_fcs_rport_get_attr()
3024 rport_attr->cos_supported = rport->fc_cos; in bfa_fcs_rport_get_attr()
3025 rport_attr->df_sz = rport->maxfrsize; in bfa_fcs_rport_get_attr()
3026 rport_attr->state = bfa_fcs_rport_get_state(rport); in bfa_fcs_rport_get_attr()
3027 rport_attr->fc_cos = rport->fc_cos; in bfa_fcs_rport_get_attr()
3028 rport_attr->cisc = rport->cisc; in bfa_fcs_rport_get_attr()
3029 rport_attr->scsi_function = rport->scsi_function; in bfa_fcs_rport_get_attr()
3030 rport_attr->curr_speed = rport->rpf.rpsc_speed; in bfa_fcs_rport_get_attr()
3031 rport_attr->assigned_speed = rport->rpf.assigned_speed; in bfa_fcs_rport_get_attr()
3033 if (rport->bfa_rport) { in bfa_fcs_rport_get_attr()
3034 qos_attr.qos_priority = rport->bfa_rport->qos_attr.qos_priority; in bfa_fcs_rport_get_attr()
3036 cpu_to_be32(rport->bfa_rport->qos_attr.qos_flow_id); in bfa_fcs_rport_get_attr()
3038 rport_attr->qos_attr = qos_attr; in bfa_fcs_rport_get_attr()
3040 rport_attr->trl_enforced = BFA_FALSE; in bfa_fcs_rport_get_attr()
3041 if (bfa_fcport_is_ratelim(port->fcs->bfa) && in bfa_fcs_rport_get_attr()
3042 (rport->scsi_function == BFA_RPORT_TARGET)) { in bfa_fcs_rport_get_attr()
3045 bfa_fcport_get_ratelim_speed(rport->fcs->bfa); in bfa_fcs_rport_get_attr()
3049 rport_attr->trl_enforced = BFA_TRUE; in bfa_fcs_rport_get_attr()
3054 * Remote port implementation.
3092 * Remote port features (RPF) implementation.
3140 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_uninit()
3141 struct bfa_fcs_fabric_s *fabric = &rport->fcs->fabric; in bfa_fcs_rpf_sm_uninit()
3143 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_uninit()
3144 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_uninit()
3145 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_uninit()
3150 if ((!BFA_FCS_PID_IS_WKA(rport->pid)) && in bfa_fcs_rpf_sm_uninit()
3151 ((rport->port->fabric->lps->brcd_switch) || in bfa_fcs_rpf_sm_uninit()
3155 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_uninit()
3164 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_uninit()
3171 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc_sending()
3173 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_sending()
3182 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rpf->fcxp_wqe); in bfa_fcs_rpf_sm_rpsc_sending()
3183 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_rpsc_sending()
3187 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_sending()
3194 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc()
3196 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_rpsc()
3197 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc()
3203 if (rpf->rpsc_speed != BFA_PORT_SPEED_UNKNOWN) in bfa_fcs_rpf_sm_rpsc()
3204 bfa_rport_speed(rport->bfa_rport, rpf->rpsc_speed); in bfa_fcs_rpf_sm_rpsc()
3205 else if (rpf->assigned_speed != BFA_PORT_SPEED_UNKNOWN) in bfa_fcs_rpf_sm_rpsc()
3206 bfa_rport_speed(rport->bfa_rport, rpf->assigned_speed); in bfa_fcs_rpf_sm_rpsc()
3216 if (rpf->rpsc_retries++ < BFA_FCS_RPF_RETRIES) { in bfa_fcs_rpf_sm_rpsc()
3217 bfa_timer_start(rport->fcs->bfa, &rpf->timer, in bfa_fcs_rpf_sm_rpsc()
3228 bfa_fcxp_discard(rpf->fcxp); in bfa_fcs_rpf_sm_rpsc()
3229 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_rpsc()
3233 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc()
3240 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc_retry()
3242 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_rpsc_retry()
3243 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_retry()
3247 /* re-send the RPSC */ in bfa_fcs_rpf_sm_rpsc_retry()
3253 bfa_timer_stop(&rpf->timer); in bfa_fcs_rpf_sm_rpsc_retry()
3255 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_rpsc_retry()
3259 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_retry()
3266 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_online()
3268 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_online()
3269 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_online()
3270 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_online()
3275 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_online()
3279 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_online()
3286 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_offline()
3288 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_offline()
3289 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_offline()
3290 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_offline()
3302 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_offline()
3311 struct bfa_fcs_rpf_s *rpf = &rport->rpf; in bfa_fcs_rpf_init()
3313 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_init()
3314 rpf->rport = rport; in bfa_fcs_rpf_init()
3325 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_rport_online()
3327 if (__fcs_min_cfg(rport->port->fcs)) in bfa_fcs_rpf_rport_online()
3330 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) in bfa_fcs_rpf_rport_online()
3331 bfa_sm_send_event(&rport->rpf, RPFSM_EVENT_RPORT_ONLINE); in bfa_fcs_rpf_rport_online()
3340 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_rport_offline()
3342 if (__fcs_min_cfg(rport->port->fcs)) in bfa_fcs_rpf_rport_offline()
3345 rport->rpf.rpsc_speed = 0; in bfa_fcs_rpf_rport_offline()
3346 bfa_sm_send_event(&rport->rpf, RPFSM_EVENT_RPORT_OFFLINE); in bfa_fcs_rpf_rport_offline()
3353 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_timeout()
3355 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_timeout()
3363 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_send_rpsc2()
3364 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rpf_send_rpsc2()
3369 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_send_rpsc2()
3372 bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE); in bfa_fcs_rpf_send_rpsc2()
3374 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rpf->fcxp_wqe, in bfa_fcs_rpf_send_rpsc2()
3378 rpf->fcxp = fcxp; in bfa_fcs_rpf_send_rpsc2()
3380 len = fc_rpsc2_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rpf_send_rpsc2()
3381 bfa_fcs_lport_get_fcid(port), &rport->pid, 1); in bfa_fcs_rpf_send_rpsc2()
3383 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rpf_send_rpsc2()
3386 rport->stats.rpsc_sent++; in bfa_fcs_rpf_send_rpsc2()
3397 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_rpsc2_response()
3402 bfa_trc(rport->fcs, req_status); in bfa_fcs_rpf_rpsc2_response()
3405 bfa_trc(rport->fcs, req_status); in bfa_fcs_rpf_rpsc2_response()
3407 rport->stats.rpsc_failed++; in bfa_fcs_rpf_rpsc2_response()
3413 if (rpsc2_acc->els_cmd == FC_ELS_ACC) { in bfa_fcs_rpf_rpsc2_response()
3414 rport->stats.rpsc_accs++; in bfa_fcs_rpf_rpsc2_response()
3415 num_ents = be16_to_cpu(rpsc2_acc->num_pids); in bfa_fcs_rpf_rpsc2_response()
3416 bfa_trc(rport->fcs, num_ents); in bfa_fcs_rpf_rpsc2_response()
3418 WARN_ON(be32_to_cpu(rpsc2_acc->port_info[0].pid) != in bfa_fcs_rpf_rpsc2_response()
3419 bfa_ntoh3b(rport->pid)); in bfa_fcs_rpf_rpsc2_response()
3420 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3421 be32_to_cpu(rpsc2_acc->port_info[0].pid)); in bfa_fcs_rpf_rpsc2_response()
3422 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3423 be16_to_cpu(rpsc2_acc->port_info[0].speed)); in bfa_fcs_rpf_rpsc2_response()
3424 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3425 be16_to_cpu(rpsc2_acc->port_info[0].index)); in bfa_fcs_rpf_rpsc2_response()
3426 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3427 rpsc2_acc->port_info[0].type); in bfa_fcs_rpf_rpsc2_response()
3429 if (rpsc2_acc->port_info[0].speed == 0) { in bfa_fcs_rpf_rpsc2_response()
3434 rpf->rpsc_speed = fc_rpsc_operspeed_to_bfa_speed( in bfa_fcs_rpf_rpsc2_response()
3435 be16_to_cpu(rpsc2_acc->port_info[0].speed)); in bfa_fcs_rpf_rpsc2_response()
3441 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rpf_rpsc2_response()
3442 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rpf_rpsc2_response()
3443 rport->stats.rpsc_rejects++; in bfa_fcs_rpf_rpsc2_response()
3444 if (ls_rjt->reason_code == FC_LS_RJT_RSN_CMD_NOT_SUPP) in bfa_fcs_rpf_rpsc2_response()