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.
189 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_uninit()
190 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_uninit()
191 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_uninit()
196 rport->plogi_retries = 0; in bfa_fcs_rport_sm_uninit()
213 rport->ns_retries = 0; in bfa_fcs_rport_sm_uninit()
217 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_uninit()
228 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi_sending()
229 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi_sending()
230 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi_sending()
239 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
245 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
251 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
252 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_sending()
259 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
260 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi_sending()
263 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi_sending()
268 rport->pid = 0; in bfa_fcs_rport_sm_plogi_sending()
270 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
271 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_sending()
278 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi_sending()
289 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogiacc_sending()
290 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogiacc_sending()
291 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogiacc_sending()
301 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); 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()
322 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogiacc_sending()
324 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogiacc_sending()
329 rport->pid = 0; in bfa_fcs_rport_sm_plogiacc_sending()
331 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogiacc_sending()
332 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogiacc_sending()
344 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogiacc_sending()
355 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi_retry()
356 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi_retry()
357 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi_retry()
367 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
377 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
383 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
384 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_retry()
391 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
392 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi_retry()
395 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi_retry()
400 rport->pid = 0; in bfa_fcs_rport_sm_plogi_retry()
402 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
403 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_retry()
410 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
415 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi_retry()
425 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi()
426 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi()
427 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi()
432 rport->plogi_retries = 0; in bfa_fcs_rport_sm_plogi()
440 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_plogi()
443 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
446 if (rport->plogi_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_plogi()
447 rport->plogi_retries++; in bfa_fcs_rport_sm_plogi()
449 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
453 bfa_stats(rport->port, rport_del_max_plogi_retry); in bfa_fcs_rport_sm_plogi()
454 rport->old_pid = rport->pid; in bfa_fcs_rport_sm_plogi()
455 rport->pid = 0; in bfa_fcs_rport_sm_plogi()
457 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
468 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
469 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
475 rport->plogi_retries = 0; in bfa_fcs_rport_sm_plogi()
477 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
483 rport->pid = 0; in bfa_fcs_rport_sm_plogi()
485 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
486 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
493 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
494 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi()
497 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi()
503 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
509 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
515 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
520 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi()
531 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_fcs_online()
532 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_fcs_online()
533 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_fcs_online()
537 if (rport->scsi_function == BFA_RPORT_INITIATOR) { in bfa_fcs_rport_sm_fc4_fcs_online()
538 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_sm_fc4_fcs_online()
544 if (!rport->bfa_rport) in bfa_fcs_rport_sm_fc4_fcs_online()
545 rport->bfa_rport = in bfa_fcs_rport_sm_fc4_fcs_online()
546 bfa_rport_create(rport->fcs->bfa, rport); in bfa_fcs_rport_sm_fc4_fcs_online()
548 if (rport->bfa_rport) { in bfa_fcs_rport_sm_fc4_fcs_online()
559 rport->plogi_pending = BFA_TRUE; in bfa_fcs_rport_sm_fc4_fcs_online()
584 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_fcs_online()
590 * PLOGI is complete. Awaiting BFA rport online callback. FC-4s
597 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hal_online()
598 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hal_online()
599 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hal_online()
625 rport->plogi_pending = BFA_TRUE; in bfa_fcs_rport_sm_hal_online()
636 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hal_online()
641 * Rport is ONLINE. FC-4s active.
646 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_online()
647 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_online()
648 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_online()
652 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_online()
655 rport->ns_retries = 0; in bfa_fcs_rport_sm_online()
688 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_online()
694 * prior to ADISC authentication with rport. FC-4s are paused.
700 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsquery_sending()
701 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsquery_sending()
702 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsquery_sending()
711 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
724 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
733 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
738 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsquery_sending()
744 * FC-4s are paused.
749 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsquery()
750 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsquery()
751 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsquery()
760 rport->ns_retries++; in bfa_fcs_rport_sm_nsquery()
761 if (rport->ns_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_nsquery()
773 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
783 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
792 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
797 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsquery()
803 * authenticating with rport. FC-4s are paused.
809 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_online_sending()
810 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_online_sending()
811 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online_sending()
820 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()
834 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
843 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
848 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online_sending()
854 * FC-4s are paused.
860 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_online()
861 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_online()
862 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online()
871 * Too complex to cleanup FC-4 & rport and then acc to PLOGI. in bfa_fcs_rport_sm_adisc_online()
874 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
885 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
897 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
904 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
909 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online()
921 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_offline_sending()
922 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_offline_sending()
923 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline_sending()
936 bfa_fcxp_walloc_cancel(rport->fcs->bfa, in bfa_fcs_rport_sm_adisc_offline_sending()
937 &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_offline_sending()
938 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline_sending()
945 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_offline_sending()
950 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline_sending()
962 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_offline()
963 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_offline()
964 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline()
974 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_offline()
980 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline()
991 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_offline()
992 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline()
998 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline()
1003 * Rport has sent LOGO. Awaiting FC-4 offline completion callback.
1009 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_logorcv()
1010 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_logorcv()
1011 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logorcv()
1020 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_fc4_logorcv()
1022 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_fc4_logorcv()
1037 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logorcv()
1042 * LOGO needs to be sent to rport. Awaiting FC-4 offline completion
1049 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_logosend()
1050 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_logosend()
1051 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logosend()
1063 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_fc4_logosend()
1074 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logosend()
1079 * Rport is going offline. Awaiting FC-4 offline completion callback.
1085 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_offline()
1086 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_offline()
1087 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_offline()
1115 * SCN - ignore and wait till transitioning to offline state in bfa_fcs_rport_sm_fc4_offline()
1124 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_offline()
1129 * Rport is offline. FC-4s are offline. Awaiting BFA rport offline
1136 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_offline()
1137 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_offline()
1138 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_offline()
1142 if (bfa_fcs_lport_is_online(rport->port) && in bfa_fcs_rport_sm_hcb_offline()
1143 (rport->plogi_pending)) { in bfa_fcs_rport_sm_hcb_offline()
1144 rport->plogi_pending = BFA_FALSE; in bfa_fcs_rport_sm_hcb_offline()
1153 if (!bfa_fcs_lport_is_online(rport->port)) { in bfa_fcs_rport_sm_hcb_offline()
1154 rport->pid = 0; in bfa_fcs_rport_sm_hcb_offline()
1156 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_offline()
1161 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_hcb_offline()
1164 rport->ns_retries = 0; in bfa_fcs_rport_sm_hcb_offline()
1166 } else if (bfa_fcport_get_topology(rport->port->fcs->bfa) == in bfa_fcs_rport_sm_hcb_offline()
1168 if (rport->scn_online) { in bfa_fcs_rport_sm_hcb_offline()
1175 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_offline()
1181 rport->plogi_retries = 0; in bfa_fcs_rport_sm_hcb_offline()
1204 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_offline()
1209 * Rport is offline. FC-4s are offline. Awaiting BFA rport offline
1216 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_logorcv()
1217 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_logorcv()
1218 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logorcv()
1223 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_hcb_logorcv()
1225 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_hcb_logorcv()
1230 * we try to re-discover the r-port. in bfa_fcs_rport_sm_hcb_logorcv()
1232 if (bfa_fcs_lport_is_online(rport->port) && in bfa_fcs_rport_sm_hcb_logorcv()
1233 (!BFA_FCS_PID_IS_WKA(rport->pid))) { in bfa_fcs_rport_sm_hcb_logorcv()
1234 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_hcb_logorcv()
1237 rport->ns_retries = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1240 /* For N2N Direct Attach, try to re-login */ in bfa_fcs_rport_sm_hcb_logorcv()
1243 rport->plogi_retries = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1249 * pid to 0. in bfa_fcs_rport_sm_hcb_logorcv()
1251 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_sm_hcb_logorcv()
1252 rport->pid = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1254 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_logorcv()
1262 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_hcb_logorcv()
1264 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_hcb_logorcv()
1277 * Ignore - already processing a LOGO. in bfa_fcs_rport_sm_hcb_logorcv()
1282 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logorcv()
1287 * Rport is being deleted. FC-4s are offline.
1295 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_logosend()
1296 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_logosend()
1297 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logosend()
1309 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_hcb_logosend()
1321 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logosend()
1326 * Rport is being deleted. FC-4s are offline. LOGO is being sent.
1332 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_logo_sending()
1333 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_logo_sending()
1334 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_logo_sending()
1353 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_logo_sending()
1357 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_logo_sending()
1362 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_logo_sending()
1367 * Rport is offline. FC-4s are offline. BFA rport is offline.
1373 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_offline()
1374 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_offline()
1375 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_offline()
1385 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1386 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_offline()
1389 rport->ns_retries = 0; in bfa_fcs_rport_sm_offline()
1395 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1401 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1413 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1418 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1424 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1426 rport->plogi_retries = 0; in bfa_fcs_rport_sm_offline()
1431 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_offline()
1442 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_sending()
1443 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_sending()
1444 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sending()
1453 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); 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()
1470 rport->ns_retries = 0; /* reset the retry count */ in bfa_fcs_rport_sm_nsdisc_sending()
1475 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1476 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sending()
1483 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1488 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sending()
1499 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_retry()
1500 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_retry()
1501 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_retry()
1512 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1513 rport->ns_retries = 0; in bfa_fcs_rport_sm_nsdisc_retry()
1519 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1525 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1530 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_retry()
1532 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1533 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_retry()
1547 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1552 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_retry()
1563 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_sent()
1564 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_sent()
1565 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sent()
1570 if (rport->pid) { in bfa_fcs_rport_sm_nsdisc_sent()
1576 rport->ns_retries = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1582 rport->ns_retries++; in bfa_fcs_rport_sm_nsdisc_sent()
1583 if (rport->ns_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_nsdisc_sent()
1588 rport->old_pid = rport->pid; in bfa_fcs_rport_sm_nsdisc_sent()
1589 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1591 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sent()
1599 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1605 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1610 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1612 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1613 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sent()
1630 * Not logged-in yet. Accept LOGO. in bfa_fcs_rport_sm_nsdisc_sent()
1637 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1642 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sent()
1654 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_off_delete()
1655 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_off_delete()
1656 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_off_delete()
1670 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_off_delete()
1683 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_delete_pending()
1684 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_delete_pending()
1685 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_delete_pending()
1700 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_delete_pending()
1712 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_plogi()
1717 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_plogi()
1720 bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE); in bfa_fcs_rport_send_plogi()
1722 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_plogi()
1726 rport->fcxp = fcxp; in bfa_fcs_rport_send_plogi()
1728 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_plogi()
1730 port->port_cfg.pwwn, port->port_cfg.nwwn, in bfa_fcs_rport_send_plogi()
1731 bfa_fcport_get_maxfrsize(port->fcs->bfa), in bfa_fcs_rport_send_plogi()
1732 bfa_fcport_get_rx_bbcredit(port->fcs->bfa)); in bfa_fcs_rport_send_plogi()
1734 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_plogi()
1738 rport->stats.plogis++; in bfa_fcs_rport_send_plogi()
1753 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_plogi_response()
1759 bfa_trc(rport->fcs, req_status); in bfa_fcs_rport_plogi_response()
1760 rport->stats.plogi_failed++; in bfa_fcs_rport_plogi_response()
1770 if (plogi_rsp->els_cmd.els_code != FC_ELS_ACC) { in bfa_fcs_rport_plogi_response()
1773 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rport_plogi_response()
1774 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rport_plogi_response()
1776 if ((ls_rjt->reason_code == FC_LS_RJT_RSN_UNABLE_TO_PERF_CMD) && in bfa_fcs_rport_plogi_response()
1777 (ls_rjt->reason_code_expl == FC_LS_RJT_EXP_INSUFF_RES)) { in bfa_fcs_rport_plogi_response()
1778 rport->stats.rjt_insuff_res++; in bfa_fcs_rport_plogi_response()
1783 rport->stats.plogi_rejects++; in bfa_fcs_rport_plogi_response()
1792 list_for_each(qe, &rport->port->rport_q) { in bfa_fcs_rport_plogi_response()
1796 if (!rport->pwwn && (plogi_rsp->port_name == twin->pwwn)) { in bfa_fcs_rport_plogi_response()
1797 bfa_trc(rport->fcs, twin->pid); in bfa_fcs_rport_plogi_response()
1798 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_plogi_response()
1801 twin->stats.plogis += rport->stats.plogis; in bfa_fcs_rport_plogi_response()
1802 twin->stats.plogi_rejects += in bfa_fcs_rport_plogi_response()
1803 rport->stats.plogi_rejects; in bfa_fcs_rport_plogi_response()
1804 twin->stats.plogi_timeouts += in bfa_fcs_rport_plogi_response()
1805 rport->stats.plogi_timeouts; in bfa_fcs_rport_plogi_response()
1806 twin->stats.plogi_failed += in bfa_fcs_rport_plogi_response()
1807 rport->stats.plogi_failed; in bfa_fcs_rport_plogi_response()
1808 twin->stats.plogi_rcvd += rport->stats.plogi_rcvd; in bfa_fcs_rport_plogi_response()
1809 twin->stats.plogi_accs++; in bfa_fcs_rport_plogi_response()
1814 twin->pid = rsp_fchs->s_id; in bfa_fcs_rport_plogi_response()
1821 * Normal login path -- no evil twins. in bfa_fcs_rport_plogi_response()
1823 rport->stats.plogi_accs++; in bfa_fcs_rport_plogi_response()
1832 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_plogiacc()
1837 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_plogiacc()
1838 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_send_plogiacc()
1841 bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_send_plogiacc()
1843 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_plogiacc()
1847 rport->fcxp = fcxp; in bfa_fcs_rport_send_plogiacc()
1850 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_plogiacc()
1851 rport->reply_oxid, port->port_cfg.pwwn, in bfa_fcs_rport_send_plogiacc()
1852 port->port_cfg.nwwn, in bfa_fcs_rport_send_plogiacc()
1853 bfa_fcport_get_maxfrsize(port->fcs->bfa), in bfa_fcs_rport_send_plogiacc()
1854 bfa_fcport_get_rx_bbcredit(port->fcs->bfa)); in bfa_fcs_rport_send_plogiacc()
1856 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_plogiacc()
1866 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_adisc()
1871 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_adisc()
1874 bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE); in bfa_fcs_rport_send_adisc()
1876 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_adisc()
1880 rport->fcxp = fcxp; in bfa_fcs_rport_send_adisc()
1882 len = fc_adisc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_adisc()
1884 port->port_cfg.pwwn, port->port_cfg.nwwn); in bfa_fcs_rport_send_adisc()
1886 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_adisc()
1890 rport->stats.adisc_sent++; in bfa_fcs_rport_send_adisc()
1904 bfa_trc(rport->fcs, req_status); in bfa_fcs_rport_adisc_response()
1905 rport->stats.adisc_failed++; in bfa_fcs_rport_adisc_response()
1910 if (fc_adisc_rsp_parse((struct fc_adisc_s *)pld, rsp_len, rport->pwwn, in bfa_fcs_rport_adisc_response()
1911 rport->nwwn) == FC_PARSE_OK) { in bfa_fcs_rport_adisc_response()
1912 rport->stats.adisc_accs++; in bfa_fcs_rport_adisc_response()
1917 rport->stats.adisc_rejects++; in bfa_fcs_rport_adisc_response()
1919 bfa_trc(rport->fcs, ls_rjt->els_cmd.els_code); in bfa_fcs_rport_adisc_response()
1920 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rport_adisc_response()
1921 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rport_adisc_response()
1929 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_nsdisc()
1935 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_nsdisc()
1938 bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE); in bfa_fcs_rport_send_nsdisc()
1940 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_nsdisc()
1944 rport->fcxp = fcxp; in bfa_fcs_rport_send_nsdisc()
1946 if (rport->pwwn) { in bfa_fcs_rport_send_nsdisc()
1948 bfa_fcs_lport_get_fcid(port), 0, rport->pwwn); in bfa_fcs_rport_send_nsdisc()
1952 bfa_fcs_lport_get_fcid(port), 0, rport->pid); in bfa_fcs_rport_send_nsdisc()
1956 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_nsdisc()
1974 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_gidpn_response()
1977 cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code); in bfa_fcs_rport_gidpn_response()
1979 if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) { in bfa_fcs_rport_gidpn_response()
1980 /* Check if the pid is the same as before. */ in bfa_fcs_rport_gidpn_response()
1983 if (gidpn_rsp->dap == rport->pid) { in bfa_fcs_rport_gidpn_response()
1988 * Device's PID has changed. We need to cleanup in bfa_fcs_rport_gidpn_response()
1989 * and re-login. If there is another device with in bfa_fcs_rport_gidpn_response()
1990 * the the newly discovered pid, send an scn notice in bfa_fcs_rport_gidpn_response()
1991 * so that its new pid can be discovered. in bfa_fcs_rport_gidpn_response()
1993 list_for_each(qe, &rport->port->rport_q) { in bfa_fcs_rport_gidpn_response()
1997 if (gidpn_rsp->dap == twin->pid) { in bfa_fcs_rport_gidpn_response()
1998 bfa_trc(rport->fcs, twin->pid); in bfa_fcs_rport_gidpn_response()
1999 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_gidpn_response()
2001 twin->pid = 0; in bfa_fcs_rport_gidpn_response()
2006 rport->pid = gidpn_rsp->dap; in bfa_fcs_rport_gidpn_response()
2015 switch (cthdr->reason_code) { in bfa_fcs_rport_gidpn_response()
2044 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_gpnid_response()
2047 cthdr->cmd_rsp_code = be16_to_cpu(cthdr->cmd_rsp_code); in bfa_fcs_rport_gpnid_response()
2049 if (cthdr->cmd_rsp_code == CT_RSP_ACCEPT) { in bfa_fcs_rport_gpnid_response()
2057 switch (cthdr->reason_code) { in bfa_fcs_rport_gpnid_response()
2090 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_logo()
2092 port = rport->port; in bfa_fcs_rport_send_logo()
2095 bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_send_logo()
2097 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_logo()
2101 rport->fcxp = fcxp; in bfa_fcs_rport_send_logo()
2103 len = fc_logo_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_logo()
2107 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_logo()
2111 rport->stats.logos++; in bfa_fcs_rport_send_logo()
2112 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_send_logo()
2128 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_logo_acc()
2130 port = rport->port; in bfa_fcs_rport_send_logo_acc()
2132 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_send_logo_acc()
2136 rport->stats.logo_rcvd++; in bfa_fcs_rport_send_logo_acc()
2138 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_logo_acc()
2139 rport->reply_oxid); in bfa_fcs_rport_send_logo_acc()
2141 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_send_logo_acc()
2149 * param[in] rport - pointer to bfa_fcs_lport_ns_t.
2150 * param[out] rport_status - pointer to return vport status in
2164 rport->stats.plogi_timeouts++; in bfa_fcs_rport_timeout()
2165 bfa_stats(rport->port, rport_plogi_timeouts); in bfa_fcs_rport_timeout()
2175 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_prli()
2178 bfa_trc(port->fcs, rx_fchs->s_id); in bfa_fcs_rport_process_prli()
2179 bfa_trc(port->fcs, rx_fchs->d_id); in bfa_fcs_rport_process_prli()
2181 rport->stats.prli_rcvd++; in bfa_fcs_rport_process_prli()
2188 if (prli->parampage.servparams.target) { in bfa_fcs_rport_process_prli()
2195 bfa_trc(port->fcs, rx_fchs->s_id); in bfa_fcs_rport_process_prli()
2196 rport->scsi_function = BFA_RPORT_TARGET; in bfa_fcs_rport_process_prli()
2198 bfa_trc(rport->fcs, prli->parampage.type); in bfa_fcs_rport_process_prli()
2199 rport->scsi_function = BFA_RPORT_INITIATOR; in bfa_fcs_rport_process_prli()
2200 bfa_fcs_itnim_is_initiator(rport->itnim); in bfa_fcs_rport_process_prli()
2203 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_process_prli()
2208 rx_fchs->s_id, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_process_prli()
2209 rx_fchs->ox_id, port->port_cfg.roles); in bfa_fcs_rport_process_prli()
2211 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_process_prli()
2221 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_rpsc()
2225 bfa_trc(port->fcs, rx_fchs->s_id); in bfa_fcs_rport_process_rpsc()
2226 bfa_trc(port->fcs, rx_fchs->d_id); in bfa_fcs_rport_process_rpsc()
2228 rport->stats.rpsc_rcvd++; in bfa_fcs_rport_process_rpsc()
2236 bfa_fcport_get_attr(port->fcs->bfa, &pport_attr); in bfa_fcs_rport_process_rpsc()
2240 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_process_rpsc()
2245 rx_fchs->s_id, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_process_rpsc()
2246 rx_fchs->ox_id, &speeds); in bfa_fcs_rport_process_rpsc()
2248 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rport_process_rpsc()
2258 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_adisc()
2260 bfa_trc(port->fcs, rx_fchs->s_id); in bfa_fcs_rport_process_adisc()
2261 bfa_trc(port->fcs, rx_fchs->d_id); in bfa_fcs_rport_process_adisc()
2263 rport->stats.adisc_rcvd++; in bfa_fcs_rport_process_adisc()
2269 if (bfa_fcs_itnim_get_online_state(rport->itnim) == BFA_STATUS_OK) { in bfa_fcs_rport_process_adisc()
2271 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_process_adisc()
2276 rx_fchs->s_id, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_process_adisc()
2277 rx_fchs->ox_id, port->port_cfg.pwwn, in bfa_fcs_rport_process_adisc()
2278 port->port_cfg.nwwn); in bfa_fcs_rport_process_adisc()
2280 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, in bfa_fcs_rport_process_adisc()
2284 rport->stats.adisc_rejected++; in bfa_fcs_rport_process_adisc()
2294 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_online()
2297 rport_info.pid = rport->pid; in bfa_fcs_rport_hal_online()
2298 rport_info.local_pid = port->pid; in bfa_fcs_rport_hal_online()
2299 rport_info.lp_tag = port->lp_tag; in bfa_fcs_rport_hal_online()
2300 rport_info.vf_id = port->fabric->vf_id; in bfa_fcs_rport_hal_online()
2301 rport_info.vf_en = port->fabric->is_vf; in bfa_fcs_rport_hal_online()
2302 rport_info.fc_class = rport->fc_cos; in bfa_fcs_rport_hal_online()
2303 rport_info.cisc = rport->cisc; in bfa_fcs_rport_hal_online()
2304 rport_info.max_frmsz = rport->maxfrsize; in bfa_fcs_rport_hal_online()
2305 bfa_rport_online(rport->bfa_rport, &rport_info); in bfa_fcs_rport_hal_online()
2311 if (rport->bfa_rport) in bfa_fcs_rport_hal_offline()
2312 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); in bfa_fcs_rport_hal_offline()
2320 struct bfa_fcs_s *fcs = port->fcs; in bfa_fcs_rport_alloc()
2327 if (fcs->num_rport_logins >= bfa_fcs_rport_max_logins) { in bfa_fcs_rport_alloc()
2332 if (bfa_fcb_rport_alloc(fcs->bfad, &rport, &rport_drv) in bfa_fcs_rport_alloc()
2339 * Initialize r-port in bfa_fcs_rport_alloc()
2341 rport->port = port; in bfa_fcs_rport_alloc()
2342 rport->fcs = fcs; in bfa_fcs_rport_alloc()
2343 rport->rp_drv = rport_drv; in bfa_fcs_rport_alloc()
2344 rport->pid = rpid; in bfa_fcs_rport_alloc()
2345 rport->pwwn = pwwn; in bfa_fcs_rport_alloc()
2346 rport->old_pid = 0; in bfa_fcs_rport_alloc()
2348 rport->bfa_rport = NULL; in bfa_fcs_rport_alloc()
2351 * allocate FC-4s in bfa_fcs_rport_alloc()
2356 rport->itnim = bfa_fcs_itnim_create(rport); in bfa_fcs_rport_alloc()
2357 if (!rport->itnim) { in bfa_fcs_rport_alloc()
2365 fcs->num_rport_logins++; in bfa_fcs_rport_alloc()
2370 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_alloc()
2380 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_free()
2381 struct bfa_fcs_s *fcs = port->fcs; in bfa_fcs_rport_free()
2384 * - delete FC-4s in bfa_fcs_rport_free()
2385 * - delete BFA rport in bfa_fcs_rport_free()
2386 * - remove from queue of rports in bfa_fcs_rport_free()
2388 rport->plogi_pending = BFA_FALSE; in bfa_fcs_rport_free()
2391 bfa_fcs_itnim_delete(rport->itnim); in bfa_fcs_rport_free()
2392 if (rport->pid != 0 && !BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_free()
2396 if (rport->bfa_rport) { in bfa_fcs_rport_free()
2397 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_DELETE); in bfa_fcs_rport_free()
2398 rport->bfa_rport = NULL; in bfa_fcs_rport_free()
2402 fcs->num_rport_logins--; in bfa_fcs_rport_free()
2403 kfree(rport->rp_drv); in bfa_fcs_rport_free()
2411 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_aen_post()
2412 struct bfad_s *bfad = (struct bfad_s *)port->fcs->bfad; in bfa_fcs_rport_aen_post()
2420 aen_entry->aen_data.rport.priv.qos = data->priv.qos; in bfa_fcs_rport_aen_post()
2422 aen_entry->aen_data.rport.priv.qos = data->priv.qos; in bfa_fcs_rport_aen_post()
2424 aen_entry->aen_data.rport.vf_id = rport->port->fabric->vf_id; in bfa_fcs_rport_aen_post()
2425 aen_entry->aen_data.rport.ppwwn = bfa_fcs_lport_get_pwwn( in bfa_fcs_rport_aen_post()
2426 bfa_fcs_get_base_port(rport->fcs)); in bfa_fcs_rport_aen_post()
2427 aen_entry->aen_data.rport.lpwwn = bfa_fcs_lport_get_pwwn(rport->port); in bfa_fcs_rport_aen_post()
2428 aen_entry->aen_data.rport.rpwwn = rport->pwwn; in bfa_fcs_rport_aen_post()
2431 bfad_im_post_vendor_event(aen_entry, bfad, ++rport->fcs->fcs_aen_seq, in bfa_fcs_rport_aen_post()
2438 if ((!rport->pid) || (!rport->pwwn)) { in bfa_fcs_rport_fcs_online_action()
2439 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_fcs_online_action()
2440 bfa_sm_fault(rport->fcs, rport->pid); in bfa_fcs_rport_fcs_online_action()
2443 bfa_sm_send_event(rport->itnim, BFA_FCS_ITNIM_SM_FCS_ONLINE); in bfa_fcs_rport_fcs_online_action()
2449 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_online_action()
2450 struct bfad_s *bfad = (struct bfad_s *)port->fcs->bfad; in bfa_fcs_rport_hal_online_action()
2454 rport->stats.onlines++; in bfa_fcs_rport_hal_online_action()
2456 if ((!rport->pid) || (!rport->pwwn)) { in bfa_fcs_rport_hal_online_action()
2457 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_hal_online_action()
2458 bfa_sm_fault(rport->fcs, rport->pid); in bfa_fcs_rport_hal_online_action()
2462 bfa_fcs_itnim_brp_online(rport->itnim); in bfa_fcs_rport_hal_online_action()
2463 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_hal_online_action()
2468 wwn2str(rpwwn_buf, rport->pwwn); in bfa_fcs_rport_hal_online_action()
2469 if (!BFA_FCS_PID_IS_WKA(rport->pid)) { in bfa_fcs_rport_hal_online_action()
2471 "Remote port (WWN = %s) online for logical port (WWN = %s)\n", in bfa_fcs_rport_hal_online_action()
2480 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_fcs_offline_action()
2483 bfa_fcs_itnim_rport_offline(rport->itnim); in bfa_fcs_rport_fcs_offline_action()
2489 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_offline_action()
2490 struct bfad_s *bfad = (struct bfad_s *)port->fcs->bfad; in bfa_fcs_rport_hal_offline_action()
2494 if (!rport->bfa_rport) { in bfa_fcs_rport_hal_offline_action()
2499 rport->stats.offlines++; in bfa_fcs_rport_hal_offline_action()
2502 wwn2str(rpwwn_buf, rport->pwwn); in bfa_fcs_rport_hal_offline_action()
2503 if (!BFA_FCS_PID_IS_WKA(rport->pid)) { in bfa_fcs_rport_hal_offline_action()
2504 if (bfa_fcs_lport_is_online(rport->port) == BFA_TRUE) { in bfa_fcs_rport_hal_offline_action()
2506 "Remote port (WWN = %s) connectivity lost for " in bfa_fcs_rport_hal_offline_action()
2513 "Remote port (WWN = %s) offlined by " in bfa_fcs_rport_hal_offline_action()
2522 bfa_fcs_itnim_rport_offline(rport->itnim); in bfa_fcs_rport_hal_offline_action()
2523 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_hal_offline_action()
2534 bfa_fcs_lport_t *port = rport->port; in bfa_fcs_rport_update()
2537 * - port name in bfa_fcs_rport_update()
2538 * - node name in bfa_fcs_rport_update()
2540 rport->pwwn = plogi->port_name; in bfa_fcs_rport_update()
2541 rport->nwwn = plogi->node_name; in bfa_fcs_rport_update()
2544 * - class of service in bfa_fcs_rport_update()
2546 rport->fc_cos = 0; in bfa_fcs_rport_update()
2547 if (plogi->class3.class_valid) in bfa_fcs_rport_update()
2548 rport->fc_cos = FC_CLASS_3; in bfa_fcs_rport_update()
2550 if (plogi->class2.class_valid) in bfa_fcs_rport_update()
2551 rport->fc_cos |= FC_CLASS_2; in bfa_fcs_rport_update()
2554 * - CISC in bfa_fcs_rport_update()
2555 * - MAX receive frame size in bfa_fcs_rport_update()
2557 rport->cisc = plogi->csp.cisc; in bfa_fcs_rport_update()
2558 if (be16_to_cpu(plogi->class3.rxsz) < be16_to_cpu(plogi->csp.rxsz)) in bfa_fcs_rport_update()
2559 rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz); in bfa_fcs_rport_update()
2561 rport->maxfrsize = be16_to_cpu(plogi->csp.rxsz); in bfa_fcs_rport_update()
2563 bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred)); in bfa_fcs_rport_update()
2564 bfa_trc(port->fcs, port->fabric->bb_credit); in bfa_fcs_rport_update()
2573 if ((!bfa_fcs_fabric_is_switched(port->fabric)) && in bfa_fcs_rport_update()
2574 (be16_to_cpu(plogi->csp.bbcred) < port->fabric->bb_credit)) { in bfa_fcs_rport_update()
2576 bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred)); in bfa_fcs_rport_update()
2577 bfa_trc(port->fcs, port->fabric->bb_credit); in bfa_fcs_rport_update()
2579 port->fabric->bb_credit = be16_to_cpu(plogi->csp.bbcred); in bfa_fcs_rport_update()
2580 bfa_fcport_set_tx_bbcredit(port->fcs->bfa, in bfa_fcs_rport_update()
2581 port->fabric->bb_credit); in bfa_fcs_rport_update()
2587 * Called to handle LOGO received from an existing remote port.
2592 rport->reply_oxid = fchs->ox_id; in bfa_fcs_rport_process_logo()
2593 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_process_logo()
2595 rport->prlo = BFA_FALSE; in bfa_fcs_rport_process_logo()
2596 rport->stats.logo_rcvd++; in bfa_fcs_rport_process_logo()
2607 * Called by bport/vport to create a remote port instance for a discovered
2608 * remote device.
2610 * @param[in] port - base port or vport
2611 * @param[in] rpid - remote port ID
2620 bfa_trc(port->fcs, rpid); in bfa_fcs_rport_create()
2632 * @param[in] port - base port
2633 * @param[in] rpwwn - remote port wwn
2641 bfa_trc(port->fcs, rpwwn); in bfa_fcs_rport_create_by_wwn()
2651 * Called by bport/vport to handle PLOGI received from a new remote port.
2660 rport = bfa_fcs_rport_alloc(port, plogi->port_name, fchs->s_id); in bfa_fcs_rport_plogi_create()
2666 rport->reply_oxid = fchs->ox_id; in bfa_fcs_rport_plogi_create()
2667 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_plogi_create()
2669 rport->stats.plogi_rcvd++; in bfa_fcs_rport_plogi_create()
2675 * remote port.
2682 * @todo Handle P2P and initiator-initiator. in bfa_fcs_rport_plogi()
2687 rport->reply_oxid = rx_fchs->ox_id; in bfa_fcs_rport_plogi()
2688 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_plogi()
2690 rport->pid = rx_fchs->s_id; in bfa_fcs_rport_plogi()
2691 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_plogi()
2693 rport->stats.plogi_rcvd++; in bfa_fcs_rport_plogi()
2699 * Called by bport/vport to notify SCN for the remote port
2704 rport->stats.rscns++; in bfa_fcs_rport_scn()
2712 * param[in] cb_arg - rport struct.
2727 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_online()
2735 * param[in] rport -
2749 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_offline()
2758 * param[in] rport -
2775 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_qos_scn_flowid()
2783 struct bfa_fcs_s *fcs = &((struct bfad_s *)bfa->bfad)->bfa_fcs; in bfa_cb_rport_scn_online()
2788 list_for_each(qe, &port->rport_q) { in bfa_cb_rport_scn_online()
2791 rp->scn_online = BFA_TRUE; in bfa_cb_rport_scn_online()
2804 rp->scn_online = BFA_FALSE; in bfa_cb_rport_scn_no_dev()
2810 struct bfa_fcs_s *fcs = &((struct bfad_s *)bfa->bfad)->bfa_fcs; in bfa_cb_rport_scn_offline()
2815 list_for_each(qe, &port->rport_q) { in bfa_cb_rport_scn_offline()
2818 rp->scn_online = BFA_FALSE; in bfa_cb_rport_scn_offline()
2827 * param[in] rport -
2844 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_qos_scn_prio()
2850 * Called to process any unsolicted frames from this remote port
2856 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_uf_recv()
2859 bfa_trc(rport->fcs, fchs->s_id); in bfa_fcs_rport_uf_recv()
2860 bfa_trc(rport->fcs, fchs->d_id); in bfa_fcs_rport_uf_recv()
2861 bfa_trc(rport->fcs, fchs->type); in bfa_fcs_rport_uf_recv()
2863 if (fchs->type != FC_TYPE_ELS) in bfa_fcs_rport_uf_recv()
2868 bfa_trc(rport->fcs, els_cmd->els_code); in bfa_fcs_rport_uf_recv()
2870 switch (els_cmd->els_code) { in bfa_fcs_rport_uf_recv()
2884 bfa_fcs_fcpim_uf_recv(rport->itnim, fchs, len); in bfa_fcs_rport_uf_recv()
2910 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_prlo_acc()
2915 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_prlo_acc()
2917 fcxp = bfa_fcs_fcxp_alloc(port->fcs, BFA_FALSE); in bfa_fcs_rport_send_prlo_acc()
2921 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_prlo_acc()
2922 rport->reply_oxid, 0); in bfa_fcs_rport_send_prlo_acc()
2924 bfa_fcxp_send(fcxp, rport->bfa_rport, port->fabric->vf_id, in bfa_fcs_rport_send_prlo_acc()
2925 port->lp_tag, BFA_FALSE, FC_CLASS_3, len, &fchs, in bfa_fcs_rport_send_prlo_acc()
2936 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_ls_rjt()
2941 bfa_trc(rport->fcs, rx_fchs->s_id); in bfa_fcs_rport_send_ls_rjt()
2943 fcxp = bfa_fcs_fcxp_alloc(rport->fcs, BFA_FALSE); in bfa_fcs_rport_send_ls_rjt()
2948 rx_fchs->s_id, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_ls_rjt()
2949 rx_fchs->ox_id, reason_code, reason_code_expl); in bfa_fcs_rport_send_ls_rjt()
2951 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, in bfa_fcs_rport_send_ls_rjt()
2962 return bfa_rport_sm_to_state(rport_sm_table, rport->sm); in bfa_fcs_rport_get_state()
2984 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_prlo()
2986 rport->prlo = BFA_TRUE; in bfa_fcs_rport_prlo()
2987 rport->reply_oxid = ox_id; in bfa_fcs_rport_prlo()
2993 * which limits number of concurrent logins to remote ports
3007 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_get_attr()
3008 bfa_port_speed_t rport_speed = rport->rpf.rpsc_speed; in bfa_fcs_rport_get_attr()
3011 bfa_fcport_get_attr(rport->fcs->bfa, &port_attr); in bfa_fcs_rport_get_attr()
3016 rport_attr->pid = rport->pid; in bfa_fcs_rport_get_attr()
3017 rport_attr->pwwn = rport->pwwn; in bfa_fcs_rport_get_attr()
3018 rport_attr->nwwn = rport->nwwn; in bfa_fcs_rport_get_attr()
3019 rport_attr->cos_supported = rport->fc_cos; in bfa_fcs_rport_get_attr()
3020 rport_attr->df_sz = rport->maxfrsize; in bfa_fcs_rport_get_attr()
3021 rport_attr->state = bfa_fcs_rport_get_state(rport); in bfa_fcs_rport_get_attr()
3022 rport_attr->fc_cos = rport->fc_cos; in bfa_fcs_rport_get_attr()
3023 rport_attr->cisc = rport->cisc; in bfa_fcs_rport_get_attr()
3024 rport_attr->scsi_function = rport->scsi_function; in bfa_fcs_rport_get_attr()
3025 rport_attr->curr_speed = rport->rpf.rpsc_speed; in bfa_fcs_rport_get_attr()
3026 rport_attr->assigned_speed = rport->rpf.assigned_speed; in bfa_fcs_rport_get_attr()
3028 if (rport->bfa_rport) { in bfa_fcs_rport_get_attr()
3029 qos_attr.qos_priority = rport->bfa_rport->qos_attr.qos_priority; in bfa_fcs_rport_get_attr()
3031 cpu_to_be32(rport->bfa_rport->qos_attr.qos_flow_id); in bfa_fcs_rport_get_attr()
3033 rport_attr->qos_attr = qos_attr; in bfa_fcs_rport_get_attr()
3035 rport_attr->trl_enforced = BFA_FALSE; in bfa_fcs_rport_get_attr()
3036 if (bfa_fcport_is_ratelim(port->fcs->bfa) && in bfa_fcs_rport_get_attr()
3037 (rport->scsi_function == BFA_RPORT_TARGET)) { in bfa_fcs_rport_get_attr()
3040 bfa_fcport_get_ratelim_speed(rport->fcs->bfa); in bfa_fcs_rport_get_attr()
3044 rport_attr->trl_enforced = BFA_TRUE; in bfa_fcs_rport_get_attr()
3049 * Remote port implementation.
3072 * Remote port features (RPF) implementation.
3106 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_uninit()
3107 struct bfa_fcs_fabric_s *fabric = &rport->fcs->fabric; in bfa_fcs_rpf_sm_uninit()
3109 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_uninit()
3110 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_uninit()
3111 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_uninit()
3116 if ((!BFA_FCS_PID_IS_WKA(rport->pid)) && in bfa_fcs_rpf_sm_uninit()
3117 ((rport->port->fabric->lps->brcd_switch) || in bfa_fcs_rpf_sm_uninit()
3121 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_uninit()
3130 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_uninit()
3137 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc_sending()
3139 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_sending()
3148 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rpf->fcxp_wqe); in bfa_fcs_rpf_sm_rpsc_sending()
3149 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_rpsc_sending()
3153 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_sending()
3160 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc()
3162 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_rpsc()
3163 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc()
3169 if (rpf->rpsc_speed != BFA_PORT_SPEED_UNKNOWN) in bfa_fcs_rpf_sm_rpsc()
3170 bfa_rport_speed(rport->bfa_rport, rpf->rpsc_speed); in bfa_fcs_rpf_sm_rpsc()
3171 else if (rpf->assigned_speed != BFA_PORT_SPEED_UNKNOWN) in bfa_fcs_rpf_sm_rpsc()
3172 bfa_rport_speed(rport->bfa_rport, rpf->assigned_speed); in bfa_fcs_rpf_sm_rpsc()
3182 if (rpf->rpsc_retries++ < BFA_FCS_RPF_RETRIES) { in bfa_fcs_rpf_sm_rpsc()
3183 bfa_timer_start(rport->fcs->bfa, &rpf->timer, in bfa_fcs_rpf_sm_rpsc()
3194 bfa_fcxp_discard(rpf->fcxp); in bfa_fcs_rpf_sm_rpsc()
3195 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_rpsc()
3199 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc()
3206 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc_retry()
3208 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_rpsc_retry()
3209 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_retry()
3213 /* re-send the RPSC */ in bfa_fcs_rpf_sm_rpsc_retry()
3219 bfa_timer_stop(&rpf->timer); in bfa_fcs_rpf_sm_rpsc_retry()
3221 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_rpsc_retry()
3225 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_retry()
3232 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_online()
3234 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_online()
3235 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_online()
3236 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_online()
3241 rpf->rpsc_retries = 0; in bfa_fcs_rpf_sm_online()
3245 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_online()
3252 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_offline()
3254 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_offline()
3255 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_offline()
3256 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_offline()
3268 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_offline()
3277 struct bfa_fcs_rpf_s *rpf = &rport->rpf; in bfa_fcs_rpf_init()
3279 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_init()
3280 rpf->rport = rport; in bfa_fcs_rpf_init()
3291 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_rport_online()
3293 if (__fcs_min_cfg(rport->port->fcs)) in bfa_fcs_rpf_rport_online()
3296 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) in bfa_fcs_rpf_rport_online()
3297 bfa_sm_send_event(&rport->rpf, RPFSM_EVENT_RPORT_ONLINE); in bfa_fcs_rpf_rport_online()
3306 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_rport_offline()
3308 if (__fcs_min_cfg(rport->port->fcs)) in bfa_fcs_rpf_rport_offline()
3311 rport->rpf.rpsc_speed = 0; in bfa_fcs_rpf_rport_offline()
3312 bfa_sm_send_event(&rport->rpf, RPFSM_EVENT_RPORT_OFFLINE); in bfa_fcs_rpf_rport_offline()
3319 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_timeout()
3321 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_timeout()
3329 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_send_rpsc2()
3330 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rpf_send_rpsc2()
3335 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_send_rpsc2()
3338 bfa_fcs_fcxp_alloc(port->fcs, BFA_TRUE); in bfa_fcs_rpf_send_rpsc2()
3340 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rpf->fcxp_wqe, in bfa_fcs_rpf_send_rpsc2()
3344 rpf->fcxp = fcxp; in bfa_fcs_rpf_send_rpsc2()
3346 len = fc_rpsc2_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rpf_send_rpsc2()
3347 bfa_fcs_lport_get_fcid(port), &rport->pid, 1); in bfa_fcs_rpf_send_rpsc2()
3349 bfa_fcxp_send(fcxp, NULL, port->fabric->vf_id, port->lp_tag, BFA_FALSE, in bfa_fcs_rpf_send_rpsc2()
3352 rport->stats.rpsc_sent++; in bfa_fcs_rpf_send_rpsc2()
3363 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_rpsc2_response()
3368 bfa_trc(rport->fcs, req_status); in bfa_fcs_rpf_rpsc2_response()
3371 bfa_trc(rport->fcs, req_status); in bfa_fcs_rpf_rpsc2_response()
3373 rport->stats.rpsc_failed++; in bfa_fcs_rpf_rpsc2_response()
3379 if (rpsc2_acc->els_cmd == FC_ELS_ACC) { in bfa_fcs_rpf_rpsc2_response()
3380 rport->stats.rpsc_accs++; in bfa_fcs_rpf_rpsc2_response()
3381 num_ents = be16_to_cpu(rpsc2_acc->num_pids); in bfa_fcs_rpf_rpsc2_response()
3382 bfa_trc(rport->fcs, num_ents); in bfa_fcs_rpf_rpsc2_response()
3384 WARN_ON(be32_to_cpu(rpsc2_acc->port_info[0].pid) != in bfa_fcs_rpf_rpsc2_response()
3385 bfa_ntoh3b(rport->pid)); in bfa_fcs_rpf_rpsc2_response()
3386 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3387 be32_to_cpu(rpsc2_acc->port_info[0].pid)); in bfa_fcs_rpf_rpsc2_response()
3388 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3389 be16_to_cpu(rpsc2_acc->port_info[0].speed)); in bfa_fcs_rpf_rpsc2_response()
3390 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3391 be16_to_cpu(rpsc2_acc->port_info[0].index)); in bfa_fcs_rpf_rpsc2_response()
3392 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3393 rpsc2_acc->port_info[0].type); in bfa_fcs_rpf_rpsc2_response()
3395 if (rpsc2_acc->port_info[0].speed == 0) { in bfa_fcs_rpf_rpsc2_response()
3400 rpf->rpsc_speed = fc_rpsc_operspeed_to_bfa_speed( in bfa_fcs_rpf_rpsc2_response()
3401 be16_to_cpu(rpsc2_acc->port_info[0].speed)); in bfa_fcs_rpf_rpsc2_response()
3407 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rpf_rpsc2_response()
3408 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rpf_rpsc2_response()
3409 rport->stats.rpsc_rejects++; in bfa_fcs_rpf_rpsc2_response()
3410 if (ls_rjt->reason_code == FC_LS_RJT_RSN_CMD_NOT_SUPP) in bfa_fcs_rpf_rpsc2_response()