Lines Matching refs:rport
43 static void bfa_fcs_rport_free(struct bfa_fcs_rport_s *rport);
44 static void bfa_fcs_rport_hal_online(struct bfa_fcs_rport_s *rport);
45 static void bfa_fcs_rport_fcs_online_action(struct bfa_fcs_rport_s *rport);
46 static void bfa_fcs_rport_hal_online_action(struct bfa_fcs_rport_s *rport);
47 static void bfa_fcs_rport_fcs_offline_action(struct bfa_fcs_rport_s *rport);
48 static void bfa_fcs_rport_hal_offline_action(struct bfa_fcs_rport_s *rport);
49 static void bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport,
79 static void bfa_fcs_rport_process_prli(struct bfa_fcs_rport_s *rport,
81 static void bfa_fcs_rport_send_ls_rjt(struct bfa_fcs_rport_s *rport,
84 static void bfa_fcs_rport_process_adisc(struct bfa_fcs_rport_s *rport,
86 static void bfa_fcs_rport_send_prlo_acc(struct bfa_fcs_rport_s *rport);
87 static void bfa_fcs_rport_hal_offline(struct bfa_fcs_rport_s *rport);
89 static void bfa_fcs_rport_sm_uninit(struct bfa_fcs_rport_s *rport,
91 static void bfa_fcs_rport_sm_plogi_sending(struct bfa_fcs_rport_s *rport,
93 static void bfa_fcs_rport_sm_plogiacc_sending(struct bfa_fcs_rport_s *rport,
95 static void bfa_fcs_rport_sm_plogi_retry(struct bfa_fcs_rport_s *rport,
97 static void bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s *rport,
99 static void bfa_fcs_rport_sm_fc4_fcs_online(struct bfa_fcs_rport_s *rport,
101 static void bfa_fcs_rport_sm_hal_online(struct bfa_fcs_rport_s *rport,
103 static void bfa_fcs_rport_sm_online(struct bfa_fcs_rport_s *rport,
105 static void bfa_fcs_rport_sm_nsquery_sending(struct bfa_fcs_rport_s *rport,
107 static void bfa_fcs_rport_sm_nsquery(struct bfa_fcs_rport_s *rport,
110 struct bfa_fcs_rport_s *rport, enum rport_event event);
111 static void bfa_fcs_rport_sm_adisc_online(struct bfa_fcs_rport_s *rport,
114 *rport, enum rport_event event);
115 static void bfa_fcs_rport_sm_adisc_offline(struct bfa_fcs_rport_s *rport,
117 static void bfa_fcs_rport_sm_fc4_logorcv(struct bfa_fcs_rport_s *rport,
119 static void bfa_fcs_rport_sm_fc4_logosend(struct bfa_fcs_rport_s *rport,
121 static void bfa_fcs_rport_sm_fc4_offline(struct bfa_fcs_rport_s *rport,
123 static void bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s *rport,
125 static void bfa_fcs_rport_sm_hcb_logorcv(struct bfa_fcs_rport_s *rport,
127 static void bfa_fcs_rport_sm_hcb_logosend(struct bfa_fcs_rport_s *rport,
129 static void bfa_fcs_rport_sm_logo_sending(struct bfa_fcs_rport_s *rport,
131 static void bfa_fcs_rport_sm_offline(struct bfa_fcs_rport_s *rport,
133 static void bfa_fcs_rport_sm_nsdisc_sending(struct bfa_fcs_rport_s *rport,
135 static void bfa_fcs_rport_sm_nsdisc_retry(struct bfa_fcs_rport_s *rport,
137 static void bfa_fcs_rport_sm_nsdisc_sent(struct bfa_fcs_rport_s *rport,
139 static void bfa_fcs_rport_sm_nsdisc_sent(struct bfa_fcs_rport_s *rport,
141 static void bfa_fcs_rport_sm_fc4_off_delete(struct bfa_fcs_rport_s *rport,
143 static void bfa_fcs_rport_sm_delete_pending(struct bfa_fcs_rport_s *rport,
178 bfa_fcs_rport_sm_uninit(struct bfa_fcs_rport_s *rport, enum rport_event event) in bfa_fcs_rport_sm_uninit() argument
180 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_uninit()
181 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_uninit()
182 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_uninit()
186 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending); in bfa_fcs_rport_sm_uninit()
187 rport->plogi_retries = 0; in bfa_fcs_rport_sm_uninit()
188 bfa_fcs_rport_send_plogi(rport, NULL); in bfa_fcs_rport_sm_uninit()
192 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_uninit()
193 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_uninit()
197 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online); in bfa_fcs_rport_sm_uninit()
198 bfa_fcs_rport_hal_online(rport); in bfa_fcs_rport_sm_uninit()
203 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); in bfa_fcs_rport_sm_uninit()
204 rport->ns_retries = 0; in bfa_fcs_rport_sm_uninit()
205 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_uninit()
208 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_uninit()
216 bfa_fcs_rport_sm_plogi_sending(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_plogi_sending() argument
219 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi_sending()
220 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi_sending()
221 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi_sending()
225 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi); in bfa_fcs_rport_sm_plogi_sending()
229 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_plogi_sending()
230 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
231 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_plogi_sending()
235 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_plogi_sending()
236 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
237 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_plogi_sending()
241 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_plogi_sending()
242 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
243 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_sending()
244 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi_sending()
250 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
251 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi_sending()
253 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); in bfa_fcs_rport_sm_plogi_sending()
254 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi_sending()
255 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_plogi_sending()
259 rport->pid = 0; in bfa_fcs_rport_sm_plogi_sending()
260 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_plogi_sending()
261 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogi_sending()
262 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_sending()
263 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi_sending()
269 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi_sending()
277 bfa_fcs_rport_sm_plogiacc_sending(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_plogiacc_sending() argument
280 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogiacc_sending()
281 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogiacc_sending()
282 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogiacc_sending()
286 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_fcs_online); in bfa_fcs_rport_sm_plogiacc_sending()
287 bfa_fcs_rport_fcs_online_action(rport); in bfa_fcs_rport_sm_plogiacc_sending()
291 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_plogiacc_sending()
292 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogiacc_sending()
293 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_plogiacc_sending()
305 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); 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()
307 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogiacc_sending()
308 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogiacc_sending()
313 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_plogiacc_sending()
314 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); in bfa_fcs_rport_sm_plogiacc_sending()
315 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogiacc_sending()
316 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_plogiacc_sending()
320 rport->pid = 0; in bfa_fcs_rport_sm_plogiacc_sending()
321 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); 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()
323 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogiacc_sending()
324 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogiacc_sending()
335 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogiacc_sending()
343 bfa_fcs_rport_sm_plogi_retry(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_plogi_retry() argument
346 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi_retry()
347 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi_retry()
348 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi_retry()
352 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending); in bfa_fcs_rport_sm_plogi_retry()
353 bfa_fcs_rport_send_plogi(rport, NULL); in bfa_fcs_rport_sm_plogi_retry()
357 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_plogi_retry()
358 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
359 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_plogi_retry()
367 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_plogi_retry()
368 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
369 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_plogi_retry()
373 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_plogi_retry()
374 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
375 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_retry()
376 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi_retry()
382 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
383 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi_retry()
385 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); in bfa_fcs_rport_sm_plogi_retry()
386 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi_retry()
387 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_plogi_retry()
391 rport->pid = 0; in bfa_fcs_rport_sm_plogi_retry()
392 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_plogi_retry()
393 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
394 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi_retry()
395 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi_retry()
400 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_fcs_online); in bfa_fcs_rport_sm_plogi_retry()
401 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_plogi_retry()
402 bfa_fcs_rport_fcs_online_action(rport); in bfa_fcs_rport_sm_plogi_retry()
406 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi_retry()
414 bfa_fcs_rport_sm_plogi(struct bfa_fcs_rport_s *rport, enum rport_event event) in bfa_fcs_rport_sm_plogi() argument
416 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_plogi()
417 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_plogi()
418 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_plogi()
422 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_fcs_online); in bfa_fcs_rport_sm_plogi()
423 rport->plogi_retries = 0; in bfa_fcs_rport_sm_plogi()
424 bfa_fcs_rport_fcs_online_action(rport); in bfa_fcs_rport_sm_plogi()
428 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_plogi()
433 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_plogi()
434 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_plogi()
436 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
441 if (rport->plogi_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_plogi()
442 rport->plogi_retries++; in bfa_fcs_rport_sm_plogi()
443 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_retry); in bfa_fcs_rport_sm_plogi()
444 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
445 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi()
448 bfa_stats(rport->port, rport_del_max_plogi_retry); in bfa_fcs_rport_sm_plogi()
449 rport->old_pid = rport->pid; in bfa_fcs_rport_sm_plogi()
450 rport->pid = 0; in bfa_fcs_rport_sm_plogi()
451 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_plogi()
452 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
453 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi()
462 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_plogi()
463 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
464 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
465 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi()
470 rport->plogi_retries = 0; in bfa_fcs_rport_sm_plogi()
471 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_retry); in bfa_fcs_rport_sm_plogi()
472 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
473 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi()
478 rport->pid = 0; in bfa_fcs_rport_sm_plogi()
479 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_plogi()
480 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
481 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_plogi()
482 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_plogi()
488 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
489 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_plogi()
491 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); in bfa_fcs_rport_sm_plogi()
492 rport->ns_retries = 0; in bfa_fcs_rport_sm_plogi()
493 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_plogi()
497 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_plogi()
498 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
499 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_plogi()
503 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_plogi()
504 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
505 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_plogi()
509 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_fcs_online); in bfa_fcs_rport_sm_plogi()
510 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_plogi()
511 bfa_fcs_rport_fcs_online_action(rport); in bfa_fcs_rport_sm_plogi()
515 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_plogi()
523 bfa_fcs_rport_sm_fc4_fcs_online(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_fc4_fcs_online() argument
526 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_fcs_online()
527 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_fcs_online()
528 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_fcs_online()
532 if (rport->scsi_function == BFA_RPORT_INITIATOR) { in bfa_fcs_rport_sm_fc4_fcs_online()
533 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_sm_fc4_fcs_online()
534 bfa_fcs_rpf_rport_online(rport); in bfa_fcs_rport_sm_fc4_fcs_online()
535 bfa_sm_set_state(rport, bfa_fcs_rport_sm_online); in bfa_fcs_rport_sm_fc4_fcs_online()
539 if (!rport->bfa_rport) in bfa_fcs_rport_sm_fc4_fcs_online()
540 rport->bfa_rport = in bfa_fcs_rport_sm_fc4_fcs_online()
541 bfa_rport_create(rport->fcs->bfa, rport); in bfa_fcs_rport_sm_fc4_fcs_online()
543 if (rport->bfa_rport) { in bfa_fcs_rport_sm_fc4_fcs_online()
544 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online); in bfa_fcs_rport_sm_fc4_fcs_online()
545 bfa_fcs_rport_hal_online(rport); in bfa_fcs_rport_sm_fc4_fcs_online()
547 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_fc4_fcs_online()
548 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_fc4_fcs_online()
553 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_fc4_fcs_online()
554 rport->plogi_pending = BFA_TRUE; in bfa_fcs_rport_sm_fc4_fcs_online()
555 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_fc4_fcs_online()
563 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_fc4_fcs_online()
564 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_fc4_fcs_online()
569 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logorcv); in bfa_fcs_rport_sm_fc4_fcs_online()
570 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_fc4_fcs_online()
574 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_fc4_fcs_online()
575 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_fc4_fcs_online()
579 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_fcs_online()
589 bfa_fcs_rport_sm_hal_online(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_hal_online() argument
592 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hal_online()
593 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hal_online()
594 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hal_online()
598 bfa_sm_set_state(rport, bfa_fcs_rport_sm_online); in bfa_fcs_rport_sm_hal_online()
599 bfa_fcs_rport_hal_online_action(rport); in bfa_fcs_rport_sm_hal_online()
607 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logorcv); in bfa_fcs_rport_sm_hal_online()
608 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_hal_online()
615 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_hal_online()
616 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_hal_online()
620 rport->plogi_pending = BFA_TRUE; in bfa_fcs_rport_sm_hal_online()
621 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_hal_online()
622 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_hal_online()
626 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_hal_online()
627 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_sm_hal_online()
631 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hal_online()
639 bfa_fcs_rport_sm_online(struct bfa_fcs_rport_s *rport, enum rport_event event) in bfa_fcs_rport_sm_online() argument
641 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_online()
642 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_online()
643 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_online()
647 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_online()
648 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_online()
650 rport->ns_retries = 0; in bfa_fcs_rport_sm_online()
651 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_online()
653 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_online()
655 bfa_fcs_rport_send_adisc(rport, NULL); in bfa_fcs_rport_sm_online()
663 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_online()
664 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_online()
668 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_online()
669 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_online()
674 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logorcv); in bfa_fcs_rport_sm_online()
675 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_online()
683 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_online()
692 bfa_fcs_rport_sm_nsquery_sending(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_nsquery_sending() argument
695 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsquery_sending()
696 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsquery_sending()
697 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsquery_sending()
701 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsquery); in bfa_fcs_rport_sm_nsquery_sending()
705 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_nsquery_sending()
706 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
707 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_nsquery_sending()
718 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logorcv); in bfa_fcs_rport_sm_nsquery_sending()
719 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
720 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_nsquery_sending()
727 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_nsquery_sending()
728 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsquery_sending()
729 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_nsquery_sending()
733 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsquery_sending()
742 bfa_fcs_rport_sm_nsquery(struct bfa_fcs_rport_s *rport, enum rport_event event) in bfa_fcs_rport_sm_nsquery() argument
744 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsquery()
745 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsquery()
746 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsquery()
750 bfa_sm_set_state(rport, bfa_fcs_rport_sm_adisc_online_sending); in bfa_fcs_rport_sm_nsquery()
751 bfa_fcs_rport_send_adisc(rport, NULL); in bfa_fcs_rport_sm_nsquery()
755 rport->ns_retries++; in bfa_fcs_rport_sm_nsquery()
756 if (rport->ns_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_nsquery()
757 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_nsquery()
759 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_nsquery()
761 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_nsquery()
762 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_nsquery()
767 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_nsquery()
768 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
769 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_nsquery()
777 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logorcv); in bfa_fcs_rport_sm_nsquery()
778 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
779 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_nsquery()
786 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_nsquery()
787 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsquery()
788 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_nsquery()
792 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsquery()
801 bfa_fcs_rport_sm_adisc_online_sending(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_adisc_online_sending() argument
804 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_online_sending()
805 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_online_sending()
806 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online_sending()
810 bfa_sm_set_state(rport, bfa_fcs_rport_sm_adisc_online); in bfa_fcs_rport_sm_adisc_online_sending()
814 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_adisc_online_sending()
815 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
816 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_adisc_online_sending()
821 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_adisc_online_sending()
822 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
823 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_adisc_online_sending()
828 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logorcv); in bfa_fcs_rport_sm_adisc_online_sending()
829 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
830 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_adisc_online_sending()
837 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_adisc_online_sending()
838 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_online_sending()
839 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_adisc_online_sending()
843 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online_sending()
852 bfa_fcs_rport_sm_adisc_online(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_adisc_online() argument
855 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_online()
856 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_online()
857 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online()
861 bfa_sm_set_state(rport, bfa_fcs_rport_sm_online); in bfa_fcs_rport_sm_adisc_online()
869 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
876 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_adisc_online()
877 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_adisc_online()
881 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_adisc_online()
882 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
883 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_adisc_online()
893 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_offline); in bfa_fcs_rport_sm_adisc_online()
894 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
895 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_adisc_online()
900 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logorcv); in bfa_fcs_rport_sm_adisc_online()
901 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_online()
902 bfa_fcs_rport_hal_offline_action(rport); in bfa_fcs_rport_sm_adisc_online()
906 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_online()
915 bfa_fcs_rport_sm_adisc_offline_sending(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_adisc_offline_sending() argument
918 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_offline_sending()
919 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_offline_sending()
920 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline_sending()
924 bfa_sm_set_state(rport, bfa_fcs_rport_sm_adisc_offline); in bfa_fcs_rport_sm_adisc_offline_sending()
932 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_adisc_offline_sending()
933 bfa_fcxp_walloc_cancel(rport->fcs->bfa, in bfa_fcs_rport_sm_adisc_offline_sending()
934 &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_offline_sending()
935 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline_sending()
936 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_adisc_offline_sending()
941 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_adisc_offline_sending()
942 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_adisc_offline_sending()
943 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_adisc_offline_sending()
947 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline_sending()
956 bfa_fcs_rport_sm_adisc_offline(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_adisc_offline() argument
959 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_adisc_offline()
960 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_adisc_offline()
961 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline()
965 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hal_online); in bfa_fcs_rport_sm_adisc_offline()
966 bfa_fcs_rport_hal_online(rport); in bfa_fcs_rport_sm_adisc_offline()
970 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_adisc_offline()
971 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_offline()
972 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_adisc_offline()
976 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_adisc_offline()
977 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline()
978 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_adisc_offline()
987 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_adisc_offline()
988 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_adisc_offline()
989 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_adisc_offline()
990 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_adisc_offline()
995 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_adisc_offline()
1003 bfa_fcs_rport_sm_fc4_logorcv(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_fc4_logorcv() argument
1006 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_logorcv()
1007 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_logorcv()
1008 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logorcv()
1012 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logorcv); in bfa_fcs_rport_sm_fc4_logorcv()
1013 bfa_fcs_rport_hal_offline(rport); in bfa_fcs_rport_sm_fc4_logorcv()
1017 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_fc4_logorcv()
1018 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_fc4_logorcv()
1019 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_fc4_logorcv()
1020 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_fc4_logorcv()
1022 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_off_delete); in bfa_fcs_rport_sm_fc4_logorcv()
1034 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logorcv()
1043 bfa_fcs_rport_sm_fc4_logosend(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_fc4_logosend() argument
1046 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_logosend()
1047 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_logosend()
1048 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logosend()
1052 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_logosend); in bfa_fcs_rport_sm_fc4_logosend()
1053 bfa_fcs_rport_hal_offline(rport); in bfa_fcs_rport_sm_fc4_logosend()
1057 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_fc4_logosend()
1059 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_fc4_logosend()
1060 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_fc4_logosend()
1061 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_off_delete); in bfa_fcs_rport_sm_fc4_logosend()
1070 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_logosend()
1078 bfa_fcs_rport_sm_fc4_offline(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_fc4_offline() argument
1081 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_offline()
1082 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_offline()
1083 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_offline()
1087 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline); in bfa_fcs_rport_sm_fc4_offline()
1088 bfa_fcs_rport_hal_offline(rport); in bfa_fcs_rport_sm_fc4_offline()
1097 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_fc4_offline()
1101 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_fc4_offline()
1116 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_logosend); in bfa_fcs_rport_sm_fc4_offline()
1120 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_offline()
1129 bfa_fcs_rport_sm_hcb_offline(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_hcb_offline() argument
1132 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_offline()
1133 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_offline()
1134 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_offline()
1138 if (bfa_fcs_lport_is_online(rport->port) && in bfa_fcs_rport_sm_hcb_offline()
1139 (rport->plogi_pending)) { in bfa_fcs_rport_sm_hcb_offline()
1140 rport->plogi_pending = BFA_FALSE; in bfa_fcs_rport_sm_hcb_offline()
1141 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_hcb_offline()
1143 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_hcb_offline()
1151 if (!bfa_fcs_lport_is_online(rport->port)) { in bfa_fcs_rport_sm_hcb_offline()
1152 rport->pid = 0; in bfa_fcs_rport_sm_hcb_offline()
1153 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_hcb_offline()
1154 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_offline()
1155 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_hcb_offline()
1159 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_hcb_offline()
1160 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_hcb_offline()
1162 rport->ns_retries = 0; in bfa_fcs_rport_sm_hcb_offline()
1163 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_hcb_offline()
1164 } else if (bfa_fcport_get_topology(rport->port->fcs->bfa) == in bfa_fcs_rport_sm_hcb_offline()
1166 if (rport->scn_online) { in bfa_fcs_rport_sm_hcb_offline()
1167 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_hcb_offline()
1169 bfa_fcs_rport_send_adisc(rport, NULL); in bfa_fcs_rport_sm_hcb_offline()
1171 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_hcb_offline()
1173 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_offline()
1174 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_hcb_offline()
1178 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending); in bfa_fcs_rport_sm_hcb_offline()
1179 rport->plogi_retries = 0; in bfa_fcs_rport_sm_hcb_offline()
1180 bfa_fcs_rport_send_plogi(rport, NULL); in bfa_fcs_rport_sm_hcb_offline()
1185 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_hcb_offline()
1186 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_hcb_offline()
1202 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_offline()
1211 bfa_fcs_rport_sm_hcb_logorcv(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_hcb_logorcv() argument
1214 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_logorcv()
1215 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_logorcv()
1216 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logorcv()
1221 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_hcb_logorcv()
1222 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_hcb_logorcv()
1223 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_hcb_logorcv()
1224 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_hcb_logorcv()
1230 if (bfa_fcs_lport_is_online(rport->port) && in bfa_fcs_rport_sm_hcb_logorcv()
1231 (!BFA_FCS_PID_IS_WKA(rport->pid))) { in bfa_fcs_rport_sm_hcb_logorcv()
1232 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) { in bfa_fcs_rport_sm_hcb_logorcv()
1233 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_hcb_logorcv()
1235 rport->ns_retries = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1236 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_hcb_logorcv()
1239 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_hcb_logorcv()
1241 rport->plogi_retries = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1242 bfa_fcs_rport_send_plogi(rport, NULL); in bfa_fcs_rport_sm_hcb_logorcv()
1249 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_sm_hcb_logorcv()
1250 rport->pid = 0; in bfa_fcs_rport_sm_hcb_logorcv()
1251 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_hcb_logorcv()
1252 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_hcb_logorcv()
1253 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_hcb_logorcv()
1259 bfa_sm_set_state(rport, bfa_fcs_rport_sm_delete_pending); in bfa_fcs_rport_sm_hcb_logorcv()
1260 if (rport->pid && (rport->prlo == BFA_TRUE)) in bfa_fcs_rport_sm_hcb_logorcv()
1261 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_hcb_logorcv()
1262 if (rport->pid && (rport->prlo == BFA_FALSE)) in bfa_fcs_rport_sm_hcb_logorcv()
1263 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_hcb_logorcv()
1267 bfa_sm_set_state(rport, bfa_fcs_rport_sm_hcb_offline); in bfa_fcs_rport_sm_hcb_logorcv()
1280 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logorcv()
1290 bfa_fcs_rport_sm_hcb_logosend(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_hcb_logosend() argument
1293 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_hcb_logosend()
1294 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_hcb_logosend()
1295 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logosend()
1299 bfa_sm_set_state(rport, bfa_fcs_rport_sm_logo_sending); in bfa_fcs_rport_sm_hcb_logosend()
1300 bfa_fcs_rport_send_logo(rport, NULL); in bfa_fcs_rport_sm_hcb_logosend()
1304 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_hcb_logosend()
1306 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_hcb_logosend()
1307 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_hcb_logosend()
1309 bfa_sm_set_state(rport, bfa_fcs_rport_sm_delete_pending); in bfa_fcs_rport_sm_hcb_logosend()
1318 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_hcb_logosend()
1326 bfa_fcs_rport_sm_logo_sending(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_logo_sending() argument
1329 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_logo_sending()
1330 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_logo_sending()
1331 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_logo_sending()
1336 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_logo_sending()
1337 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_logo_sending()
1347 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_logo_sending()
1349 if (rport->prlo == BFA_TRUE) in bfa_fcs_rport_sm_logo_sending()
1350 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_logo_sending()
1352 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_logo_sending()
1353 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_logo_sending()
1354 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_logo_sending()
1358 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_logo_sending()
1367 bfa_fcs_rport_sm_offline(struct bfa_fcs_rport_s *rport, enum rport_event event) in bfa_fcs_rport_sm_offline() argument
1369 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_offline()
1370 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_offline()
1371 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_offline()
1375 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_offline()
1376 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_offline()
1381 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1382 WARN_ON(!(bfa_fcport_get_topology(rport->port->fcs->bfa) != in bfa_fcs_rport_sm_offline()
1384 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); in bfa_fcs_rport_sm_offline()
1385 rport->ns_retries = 0; in bfa_fcs_rport_sm_offline()
1386 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_offline()
1390 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_offline()
1391 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1392 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_offline()
1396 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_offline()
1397 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1398 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_offline()
1408 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_fcs_online); in bfa_fcs_rport_sm_offline()
1409 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1410 bfa_fcs_rport_fcs_online_action(rport); in bfa_fcs_rport_sm_offline()
1414 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1415 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending); in bfa_fcs_rport_sm_offline()
1416 bfa_fcs_rport_send_plogi(rport, NULL); in bfa_fcs_rport_sm_offline()
1420 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_offline()
1421 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending); in bfa_fcs_rport_sm_offline()
1422 rport->plogi_retries = 0; in bfa_fcs_rport_sm_offline()
1423 bfa_fcs_rport_send_plogi(rport, NULL); in bfa_fcs_rport_sm_offline()
1427 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_offline()
1435 bfa_fcs_rport_sm_nsdisc_sending(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_nsdisc_sending() argument
1438 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_sending()
1439 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_sending()
1440 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sending()
1444 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sent); in bfa_fcs_rport_sm_nsdisc_sending()
1448 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_nsdisc_sending()
1449 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1450 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_nsdisc_sending()
1454 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_nsdisc_sending()
1455 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1456 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_nsdisc_sending()
1466 rport->ns_retries = 0; /* reset the retry count */ in bfa_fcs_rport_sm_nsdisc_sending()
1470 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_nsdisc_sending()
1471 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1472 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sending()
1473 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_nsdisc_sending()
1478 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_fcs_online); in bfa_fcs_rport_sm_nsdisc_sending()
1479 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rport->fcxp_wqe); in bfa_fcs_rport_sm_nsdisc_sending()
1480 bfa_fcs_rport_fcs_online_action(rport); in bfa_fcs_rport_sm_nsdisc_sending()
1484 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sending()
1492 bfa_fcs_rport_sm_nsdisc_retry(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_nsdisc_retry() argument
1495 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_retry()
1496 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_retry()
1497 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_retry()
1501 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); in bfa_fcs_rport_sm_nsdisc_retry()
1502 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_nsdisc_retry()
1507 bfa_sm_set_state(rport, bfa_fcs_rport_sm_nsdisc_sending); in bfa_fcs_rport_sm_nsdisc_retry()
1508 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1509 rport->ns_retries = 0; in bfa_fcs_rport_sm_nsdisc_retry()
1510 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_nsdisc_retry()
1514 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_nsdisc_retry()
1515 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1516 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_nsdisc_retry()
1520 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_nsdisc_retry()
1521 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1522 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_nsdisc_retry()
1526 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_retry()
1527 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_nsdisc_retry()
1528 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1529 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_retry()
1530 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_nsdisc_retry()
1535 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_nsdisc_retry()
1538 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_nsdisc_retry()
1542 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_fcs_online); in bfa_fcs_rport_sm_nsdisc_retry()
1543 bfa_timer_stop(&rport->timer); in bfa_fcs_rport_sm_nsdisc_retry()
1544 bfa_fcs_rport_fcs_online_action(rport); in bfa_fcs_rport_sm_nsdisc_retry()
1548 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_retry()
1556 bfa_fcs_rport_sm_nsdisc_sent(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_nsdisc_sent() argument
1559 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_nsdisc_sent()
1560 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_nsdisc_sent()
1561 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sent()
1566 if (rport->pid) { in bfa_fcs_rport_sm_nsdisc_sent()
1567 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogi_sending); in bfa_fcs_rport_sm_nsdisc_sent()
1568 bfa_fcs_rport_send_plogi(rport, NULL); in bfa_fcs_rport_sm_nsdisc_sent()
1570 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_nsdisc_sent()
1572 rport->ns_retries = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1573 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_nsdisc_sent()
1578 rport->ns_retries++; in bfa_fcs_rport_sm_nsdisc_sent()
1579 if (rport->ns_retries < BFA_FCS_RPORT_MAX_RETRIES) { in bfa_fcs_rport_sm_nsdisc_sent()
1580 bfa_sm_set_state(rport, in bfa_fcs_rport_sm_nsdisc_sent()
1582 bfa_fcs_rport_send_nsdisc(rport, NULL); in bfa_fcs_rport_sm_nsdisc_sent()
1584 rport->old_pid = rport->pid; in bfa_fcs_rport_sm_nsdisc_sent()
1585 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1586 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_nsdisc_sent()
1587 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sent()
1588 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_nsdisc_sent()
1594 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_nsdisc_sent()
1595 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1596 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_nsdisc_sent()
1600 bfa_sm_set_state(rport, bfa_fcs_rport_sm_plogiacc_sending); in bfa_fcs_rport_sm_nsdisc_sent()
1601 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1602 bfa_fcs_rport_send_plogiacc(rport, NULL); in bfa_fcs_rport_sm_nsdisc_sent()
1606 rport->pid = 0; in bfa_fcs_rport_sm_nsdisc_sent()
1607 bfa_sm_set_state(rport, bfa_fcs_rport_sm_offline); in bfa_fcs_rport_sm_nsdisc_sent()
1608 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1609 bfa_timer_start(rport->fcs->bfa, &rport->timer, in bfa_fcs_rport_sm_nsdisc_sent()
1610 bfa_fcs_rport_timeout, rport, in bfa_fcs_rport_sm_nsdisc_sent()
1616 bfa_fcs_rport_send_prlo_acc(rport); in bfa_fcs_rport_sm_nsdisc_sent()
1628 bfa_fcs_rport_send_logo_acc(rport); in bfa_fcs_rport_sm_nsdisc_sent()
1632 bfa_sm_set_state(rport, bfa_fcs_rport_sm_fc4_fcs_online); in bfa_fcs_rport_sm_nsdisc_sent()
1633 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_sm_nsdisc_sent()
1634 bfa_fcs_rport_fcs_online_action(rport); in bfa_fcs_rport_sm_nsdisc_sent()
1638 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_nsdisc_sent()
1647 bfa_fcs_rport_sm_fc4_off_delete(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_fc4_off_delete() argument
1650 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_fc4_off_delete()
1651 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_fc4_off_delete()
1652 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_fc4_off_delete()
1656 bfa_sm_set_state(rport, bfa_fcs_rport_sm_delete_pending); in bfa_fcs_rport_sm_fc4_off_delete()
1657 bfa_fcs_rport_hal_offline(rport); in bfa_fcs_rport_sm_fc4_off_delete()
1666 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_fc4_off_delete()
1676 bfa_fcs_rport_sm_delete_pending(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_sm_delete_pending() argument
1679 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_sm_delete_pending()
1680 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_sm_delete_pending()
1681 bfa_trc(rport->fcs, event); in bfa_fcs_rport_sm_delete_pending()
1685 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_sm_delete_pending()
1686 bfa_fcs_rport_free(rport); in bfa_fcs_rport_sm_delete_pending()
1696 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rport_sm_delete_pending()
1707 struct bfa_fcs_rport_s *rport = rport_cbarg; in bfa_fcs_rport_send_plogi() local
1708 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_plogi()
1713 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_plogi()
1718 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_plogi()
1719 bfa_fcs_rport_send_plogi, rport, BFA_TRUE); in bfa_fcs_rport_send_plogi()
1722 rport->fcxp = fcxp; in bfa_fcs_rport_send_plogi()
1724 len = fc_plogi_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_plogi()
1732 (void *)rport, FC_MAX_PDUSZ, FC_ELS_TOV); in bfa_fcs_rport_send_plogi()
1734 rport->stats.plogis++; in bfa_fcs_rport_send_plogi()
1735 bfa_sm_send_event(rport, RPSM_EVENT_FCXP_SENT); in bfa_fcs_rport_send_plogi()
1743 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; in bfa_fcs_rport_plogi_response() local
1749 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_plogi_response()
1755 bfa_trc(rport->fcs, req_status); in bfa_fcs_rport_plogi_response()
1756 rport->stats.plogi_failed++; in bfa_fcs_rport_plogi_response()
1757 bfa_sm_send_event(rport, RPSM_EVENT_FAILED); in bfa_fcs_rport_plogi_response()
1769 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rport_plogi_response()
1770 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rport_plogi_response()
1774 rport->stats.rjt_insuff_res++; in bfa_fcs_rport_plogi_response()
1775 bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RETRY); in bfa_fcs_rport_plogi_response()
1779 rport->stats.plogi_rejects++; in bfa_fcs_rport_plogi_response()
1780 bfa_sm_send_event(rport, RPSM_EVENT_FAILED); in bfa_fcs_rport_plogi_response()
1788 list_for_each(qe, &rport->port->rport_q) { in bfa_fcs_rport_plogi_response()
1790 if (twin == rport) in bfa_fcs_rport_plogi_response()
1792 if (!rport->pwwn && (plogi_rsp->port_name == twin->pwwn)) { in bfa_fcs_rport_plogi_response()
1793 bfa_trc(rport->fcs, twin->pid); in bfa_fcs_rport_plogi_response()
1794 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_plogi_response()
1797 twin->stats.plogis += rport->stats.plogis; in bfa_fcs_rport_plogi_response()
1799 rport->stats.plogi_rejects; in bfa_fcs_rport_plogi_response()
1801 rport->stats.plogi_timeouts; in bfa_fcs_rport_plogi_response()
1803 rport->stats.plogi_failed; in bfa_fcs_rport_plogi_response()
1804 twin->stats.plogi_rcvd += rport->stats.plogi_rcvd; in bfa_fcs_rport_plogi_response()
1807 bfa_sm_send_event(rport, RPSM_EVENT_DELETE); in bfa_fcs_rport_plogi_response()
1819 rport->stats.plogi_accs++; in bfa_fcs_rport_plogi_response()
1820 bfa_fcs_rport_update(rport, plogi_rsp); in bfa_fcs_rport_plogi_response()
1821 bfa_sm_send_event(rport, RPSM_EVENT_ACCEPTED); in bfa_fcs_rport_plogi_response()
1827 struct bfa_fcs_rport_s *rport = rport_cbarg; in bfa_fcs_rport_send_plogiacc() local
1828 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_plogiacc()
1833 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_plogiacc()
1834 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_send_plogiacc()
1839 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_plogiacc()
1840 bfa_fcs_rport_send_plogiacc, rport, BFA_FALSE); in bfa_fcs_rport_send_plogiacc()
1843 rport->fcxp = fcxp; in bfa_fcs_rport_send_plogiacc()
1846 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_plogiacc()
1847 rport->reply_oxid, port->port_cfg.pwwn, in bfa_fcs_rport_send_plogiacc()
1855 bfa_sm_send_event(rport, RPSM_EVENT_FCXP_SENT); in bfa_fcs_rport_send_plogiacc()
1861 struct bfa_fcs_rport_s *rport = rport_cbarg; in bfa_fcs_rport_send_adisc() local
1862 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_adisc()
1867 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_send_adisc()
1872 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_adisc()
1873 bfa_fcs_rport_send_adisc, rport, BFA_TRUE); in bfa_fcs_rport_send_adisc()
1876 rport->fcxp = fcxp; in bfa_fcs_rport_send_adisc()
1878 len = fc_adisc_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_adisc()
1884 rport, FC_MAX_PDUSZ, FC_ELS_TOV); in bfa_fcs_rport_send_adisc()
1886 rport->stats.adisc_sent++; in bfa_fcs_rport_send_adisc()
1887 bfa_sm_send_event(rport, RPSM_EVENT_FCXP_SENT); in bfa_fcs_rport_send_adisc()
1895 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; in bfa_fcs_rport_adisc_response() local
1900 bfa_trc(rport->fcs, req_status); in bfa_fcs_rport_adisc_response()
1901 rport->stats.adisc_failed++; in bfa_fcs_rport_adisc_response()
1902 bfa_sm_send_event(rport, RPSM_EVENT_FAILED); in bfa_fcs_rport_adisc_response()
1906 if (fc_adisc_rsp_parse((struct fc_adisc_s *)pld, rsp_len, rport->pwwn, in bfa_fcs_rport_adisc_response()
1907 rport->nwwn) == FC_PARSE_OK) { in bfa_fcs_rport_adisc_response()
1908 rport->stats.adisc_accs++; in bfa_fcs_rport_adisc_response()
1909 bfa_sm_send_event(rport, RPSM_EVENT_ACCEPTED); in bfa_fcs_rport_adisc_response()
1913 rport->stats.adisc_rejects++; in bfa_fcs_rport_adisc_response()
1915 bfa_trc(rport->fcs, ls_rjt->els_cmd.els_code); in bfa_fcs_rport_adisc_response()
1916 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rport_adisc_response()
1917 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rport_adisc_response()
1918 bfa_sm_send_event(rport, RPSM_EVENT_FAILED); in bfa_fcs_rport_adisc_response()
1924 struct bfa_fcs_rport_s *rport = rport_cbarg; in bfa_fcs_rport_send_nsdisc() local
1925 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_nsdisc()
1931 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_nsdisc()
1936 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_nsdisc()
1937 bfa_fcs_rport_send_nsdisc, rport, BFA_TRUE); in bfa_fcs_rport_send_nsdisc()
1940 rport->fcxp = fcxp; in bfa_fcs_rport_send_nsdisc()
1942 if (rport->pwwn) { in bfa_fcs_rport_send_nsdisc()
1944 bfa_fcs_lport_get_fcid(port), 0, rport->pwwn); in bfa_fcs_rport_send_nsdisc()
1948 bfa_fcs_lport_get_fcid(port), 0, rport->pid); in bfa_fcs_rport_send_nsdisc()
1954 (void *)rport, FC_MAX_PDUSZ, FC_FCCT_TOV); in bfa_fcs_rport_send_nsdisc()
1956 bfa_sm_send_event(rport, RPSM_EVENT_FCXP_SENT); in bfa_fcs_rport_send_nsdisc()
1964 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; in bfa_fcs_rport_gidpn_response() local
1970 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_gidpn_response()
1979 if (gidpn_rsp->dap == rport->pid) { in bfa_fcs_rport_gidpn_response()
1981 bfa_sm_send_event(rport, RPSM_EVENT_ACCEPTED); in bfa_fcs_rport_gidpn_response()
1989 list_for_each(qe, &rport->port->rport_q) { in bfa_fcs_rport_gidpn_response()
1991 if (twin == rport) in bfa_fcs_rport_gidpn_response()
1994 bfa_trc(rport->fcs, twin->pid); in bfa_fcs_rport_gidpn_response()
1995 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_gidpn_response()
2002 rport->pid = gidpn_rsp->dap; in bfa_fcs_rport_gidpn_response()
2003 bfa_sm_send_event(rport, RPSM_EVENT_ADDRESS_CHANGE); in bfa_fcs_rport_gidpn_response()
2016 bfa_sm_send_event(rport, RPSM_EVENT_TIMEOUT); in bfa_fcs_rport_gidpn_response()
2023 bfa_sm_send_event(rport, RPSM_EVENT_FAILED); in bfa_fcs_rport_gidpn_response()
2027 bfa_sm_send_event(rport, RPSM_EVENT_FAILED); in bfa_fcs_rport_gidpn_response()
2037 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; in bfa_fcs_rport_gpnid_response() local
2040 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rport_gpnid_response()
2046 bfa_sm_send_event(rport, RPSM_EVENT_ACCEPTED); in bfa_fcs_rport_gpnid_response()
2058 bfa_sm_send_event(rport, RPSM_EVENT_TIMEOUT); in bfa_fcs_rport_gpnid_response()
2065 bfa_sm_send_event(rport, RPSM_EVENT_FAILED); in bfa_fcs_rport_gpnid_response()
2069 bfa_sm_send_event(rport, RPSM_EVENT_FAILED); in bfa_fcs_rport_gpnid_response()
2080 struct bfa_fcs_rport_s *rport = rport_cbarg; in bfa_fcs_rport_send_logo() local
2086 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_logo()
2088 port = rport->port; in bfa_fcs_rport_send_logo()
2093 bfa_fcs_fcxp_alloc_wait(port->fcs->bfa, &rport->fcxp_wqe, in bfa_fcs_rport_send_logo()
2094 bfa_fcs_rport_send_logo, rport, BFA_FALSE); in bfa_fcs_rport_send_logo()
2097 rport->fcxp = fcxp; in bfa_fcs_rport_send_logo()
2099 len = fc_logo_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rport_send_logo()
2105 rport, FC_MAX_PDUSZ, FC_ELS_TOV); in bfa_fcs_rport_send_logo()
2107 rport->stats.logos++; in bfa_fcs_rport_send_logo()
2108 bfa_fcxp_discard(rport->fcxp); in bfa_fcs_rport_send_logo()
2109 bfa_sm_send_event(rport, RPSM_EVENT_FCXP_SENT); in bfa_fcs_rport_send_logo()
2118 struct bfa_fcs_rport_s *rport = rport_cbarg; in bfa_fcs_rport_send_logo_acc() local
2124 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_logo_acc()
2126 port = rport->port; in bfa_fcs_rport_send_logo_acc()
2132 rport->stats.logo_rcvd++; in bfa_fcs_rport_send_logo_acc()
2134 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_logo_acc()
2135 rport->reply_oxid); in bfa_fcs_rport_send_logo_acc()
2158 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) arg; in bfa_fcs_rport_timeout() local
2160 rport->stats.plogi_timeouts++; in bfa_fcs_rport_timeout()
2161 bfa_stats(rport->port, rport_plogi_timeouts); in bfa_fcs_rport_timeout()
2162 bfa_sm_send_event(rport, RPSM_EVENT_TIMEOUT); in bfa_fcs_rport_timeout()
2166 bfa_fcs_rport_process_prli(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_process_prli() argument
2171 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_prli()
2177 rport->stats.prli_rcvd++; in bfa_fcs_rport_process_prli()
2192 rport->scsi_function = BFA_RPORT_TARGET; in bfa_fcs_rport_process_prli()
2194 bfa_trc(rport->fcs, prli->parampage.type); in bfa_fcs_rport_process_prli()
2195 rport->scsi_function = BFA_RPORT_INITIATOR; in bfa_fcs_rport_process_prli()
2196 bfa_fcs_itnim_is_initiator(rport->itnim); in bfa_fcs_rport_process_prli()
2212 bfa_fcs_rport_process_rpsc(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_process_rpsc() argument
2217 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_rpsc()
2224 rport->stats.rpsc_rcvd++; in bfa_fcs_rport_process_rpsc()
2249 bfa_fcs_rport_process_adisc(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_process_adisc() argument
2254 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_process_adisc()
2260 rport->stats.adisc_rcvd++; in bfa_fcs_rport_process_adisc()
2268 if (bfa_fcs_itnim_get_online_state(rport->itnim) == BFA_STATUS_OK) { in bfa_fcs_rport_process_adisc()
2283 rport->stats.adisc_rejected++; in bfa_fcs_rport_process_adisc()
2284 bfa_fcs_rport_send_ls_rjt(rport, rx_fchs, in bfa_fcs_rport_process_adisc()
2291 bfa_fcs_rport_hal_online(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_hal_online() argument
2293 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_online()
2296 rport_info.pid = rport->pid; in bfa_fcs_rport_hal_online()
2301 rport_info.fc_class = rport->fc_cos; in bfa_fcs_rport_hal_online()
2302 rport_info.cisc = rport->cisc; in bfa_fcs_rport_hal_online()
2303 rport_info.max_frmsz = rport->maxfrsize; in bfa_fcs_rport_hal_online()
2304 bfa_rport_online(rport->bfa_rport, &rport_info); in bfa_fcs_rport_hal_online()
2308 bfa_fcs_rport_hal_offline(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_hal_offline() argument
2310 if (rport->bfa_rport) in bfa_fcs_rport_hal_offline()
2311 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_OFFLINE); in bfa_fcs_rport_hal_offline()
2313 bfa_cb_rport_offline(rport); in bfa_fcs_rport_hal_offline()
2320 struct bfa_fcs_rport_s *rport; in bfa_fcs_rport_alloc() local
2331 if (bfa_fcb_rport_alloc(fcs->bfad, &rport, &rport_drv) in bfa_fcs_rport_alloc()
2340 rport->port = port; in bfa_fcs_rport_alloc()
2341 rport->fcs = fcs; in bfa_fcs_rport_alloc()
2342 rport->rp_drv = rport_drv; in bfa_fcs_rport_alloc()
2343 rport->pid = rpid; in bfa_fcs_rport_alloc()
2344 rport->pwwn = pwwn; in bfa_fcs_rport_alloc()
2345 rport->old_pid = 0; in bfa_fcs_rport_alloc()
2347 rport->bfa_rport = NULL; in bfa_fcs_rport_alloc()
2355 rport->itnim = bfa_fcs_itnim_create(rport); in bfa_fcs_rport_alloc()
2356 if (!rport->itnim) { in bfa_fcs_rport_alloc()
2363 bfa_fcs_lport_add_rport(port, rport); in bfa_fcs_rport_alloc()
2366 bfa_sm_set_state(rport, bfa_fcs_rport_sm_uninit); in bfa_fcs_rport_alloc()
2369 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_alloc()
2370 bfa_fcs_rpf_init(rport); in bfa_fcs_rport_alloc()
2372 return rport; in bfa_fcs_rport_alloc()
2377 bfa_fcs_rport_free(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_free() argument
2379 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_free()
2387 rport->plogi_pending = BFA_FALSE; in bfa_fcs_rport_free()
2390 bfa_fcs_itnim_delete(rport->itnim); in bfa_fcs_rport_free()
2391 if (rport->pid != 0 && !BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_free()
2392 bfa_fcs_rpf_rport_offline(rport); in bfa_fcs_rport_free()
2395 if (rport->bfa_rport) { in bfa_fcs_rport_free()
2396 bfa_sm_send_event(rport->bfa_rport, BFA_RPORT_SM_DELETE); in bfa_fcs_rport_free()
2397 rport->bfa_rport = NULL; in bfa_fcs_rport_free()
2400 bfa_fcs_lport_del_rport(port, rport); in bfa_fcs_rport_free()
2402 kfree(rport->rp_drv); in bfa_fcs_rport_free()
2406 bfa_fcs_rport_aen_post(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_aen_post() argument
2410 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_aen_post()
2419 aen_entry->aen_data.rport.priv.qos = data->priv.qos; in bfa_fcs_rport_aen_post()
2421 aen_entry->aen_data.rport.priv.qos = data->priv.qos; in bfa_fcs_rport_aen_post()
2423 aen_entry->aen_data.rport.vf_id = rport->port->fabric->vf_id; in bfa_fcs_rport_aen_post()
2424 aen_entry->aen_data.rport.ppwwn = bfa_fcs_lport_get_pwwn( in bfa_fcs_rport_aen_post()
2425 bfa_fcs_get_base_port(rport->fcs)); in bfa_fcs_rport_aen_post()
2426 aen_entry->aen_data.rport.lpwwn = bfa_fcs_lport_get_pwwn(rport->port); in bfa_fcs_rport_aen_post()
2427 aen_entry->aen_data.rport.rpwwn = rport->pwwn; in bfa_fcs_rport_aen_post()
2430 bfad_im_post_vendor_event(aen_entry, bfad, ++rport->fcs->fcs_aen_seq, in bfa_fcs_rport_aen_post()
2435 bfa_fcs_rport_fcs_online_action(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_fcs_online_action() argument
2437 if ((!rport->pid) || (!rport->pwwn)) { in bfa_fcs_rport_fcs_online_action()
2438 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_fcs_online_action()
2439 bfa_sm_fault(rport->fcs, rport->pid); in bfa_fcs_rport_fcs_online_action()
2442 bfa_sm_send_event(rport->itnim, BFA_FCS_ITNIM_SM_FCS_ONLINE); in bfa_fcs_rport_fcs_online_action()
2446 bfa_fcs_rport_hal_online_action(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_hal_online_action() argument
2448 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_online_action()
2453 rport->stats.onlines++; in bfa_fcs_rport_hal_online_action()
2455 if ((!rport->pid) || (!rport->pwwn)) { in bfa_fcs_rport_hal_online_action()
2456 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_hal_online_action()
2457 bfa_sm_fault(rport->fcs, rport->pid); in bfa_fcs_rport_hal_online_action()
2461 bfa_fcs_itnim_brp_online(rport->itnim); in bfa_fcs_rport_hal_online_action()
2462 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_hal_online_action()
2463 bfa_fcs_rpf_rport_online(rport); in bfa_fcs_rport_hal_online_action()
2467 wwn2str(rpwwn_buf, rport->pwwn); in bfa_fcs_rport_hal_online_action()
2468 if (!BFA_FCS_PID_IS_WKA(rport->pid)) { in bfa_fcs_rport_hal_online_action()
2472 bfa_fcs_rport_aen_post(rport, BFA_RPORT_AEN_ONLINE, NULL); in bfa_fcs_rport_hal_online_action()
2477 bfa_fcs_rport_fcs_offline_action(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_fcs_offline_action() argument
2479 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_fcs_offline_action()
2480 bfa_fcs_rpf_rport_offline(rport); in bfa_fcs_rport_fcs_offline_action()
2482 bfa_fcs_itnim_rport_offline(rport->itnim); in bfa_fcs_rport_fcs_offline_action()
2486 bfa_fcs_rport_hal_offline_action(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_hal_offline_action() argument
2488 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_hal_offline_action()
2493 if (!rport->bfa_rport) { in bfa_fcs_rport_hal_offline_action()
2494 bfa_fcs_rport_fcs_offline_action(rport); in bfa_fcs_rport_hal_offline_action()
2498 rport->stats.offlines++; in bfa_fcs_rport_hal_offline_action()
2501 wwn2str(rpwwn_buf, rport->pwwn); in bfa_fcs_rport_hal_offline_action()
2502 if (!BFA_FCS_PID_IS_WKA(rport->pid)) { in bfa_fcs_rport_hal_offline_action()
2503 if (bfa_fcs_lport_is_online(rport->port) == BFA_TRUE) { in bfa_fcs_rport_hal_offline_action()
2508 bfa_fcs_rport_aen_post(rport, in bfa_fcs_rport_hal_offline_action()
2515 bfa_fcs_rport_aen_post(rport, in bfa_fcs_rport_hal_offline_action()
2521 bfa_fcs_itnim_rport_offline(rport->itnim); in bfa_fcs_rport_hal_offline_action()
2522 if (!BFA_FCS_PID_IS_WKA(rport->pid)) in bfa_fcs_rport_hal_offline_action()
2523 bfa_fcs_rpf_rport_offline(rport); in bfa_fcs_rport_hal_offline_action()
2531 bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi) in bfa_fcs_rport_update() argument
2533 bfa_fcs_lport_t *port = rport->port; in bfa_fcs_rport_update()
2539 rport->pwwn = plogi->port_name; in bfa_fcs_rport_update()
2540 rport->nwwn = plogi->node_name; in bfa_fcs_rport_update()
2545 rport->fc_cos = 0; in bfa_fcs_rport_update()
2547 rport->fc_cos = FC_CLASS_3; in bfa_fcs_rport_update()
2550 rport->fc_cos |= FC_CLASS_2; in bfa_fcs_rport_update()
2556 rport->cisc = plogi->csp.cisc; in bfa_fcs_rport_update()
2558 rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz); in bfa_fcs_rport_update()
2560 rport->maxfrsize = be16_to_cpu(plogi->csp.rxsz); in bfa_fcs_rport_update()
2589 bfa_fcs_rport_process_logo(struct bfa_fcs_rport_s *rport, struct fchs_s *fchs) in bfa_fcs_rport_process_logo() argument
2591 rport->reply_oxid = fchs->ox_id; in bfa_fcs_rport_process_logo()
2592 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_process_logo()
2594 rport->prlo = BFA_FALSE; in bfa_fcs_rport_process_logo()
2595 rport->stats.logo_rcvd++; in bfa_fcs_rport_process_logo()
2596 bfa_sm_send_event(rport, RPSM_EVENT_LOGO_RCVD); in bfa_fcs_rport_process_logo()
2617 struct bfa_fcs_rport_s *rport; in bfa_fcs_rport_create() local
2620 rport = bfa_fcs_rport_alloc(port, WWN_NULL, rpid); in bfa_fcs_rport_create()
2621 if (!rport) in bfa_fcs_rport_create()
2624 bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_SEND); in bfa_fcs_rport_create()
2625 return rport; in bfa_fcs_rport_create()
2639 struct bfa_fcs_rport_s *rport; in bfa_fcs_rport_create_by_wwn() local
2641 rport = bfa_fcs_rport_alloc(port, rpwwn, 0); in bfa_fcs_rport_create_by_wwn()
2642 if (!rport) in bfa_fcs_rport_create_by_wwn()
2645 bfa_sm_send_event(rport, RPSM_EVENT_ADDRESS_DISC); in bfa_fcs_rport_create_by_wwn()
2646 return rport; in bfa_fcs_rport_create_by_wwn()
2659 struct bfa_fcs_rport_s *rport; in bfa_fcs_rport_start() local
2661 rport = bfa_fcs_rport_alloc(port, WWN_NULL, fchs->s_id); in bfa_fcs_rport_start()
2662 if (!rport) in bfa_fcs_rport_start()
2665 bfa_fcs_rport_update(rport, plogi); in bfa_fcs_rport_start()
2667 bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_COMP); in bfa_fcs_rport_start()
2678 struct bfa_fcs_rport_s *rport; in bfa_fcs_rport_plogi_create() local
2680 rport = bfa_fcs_rport_alloc(port, plogi->port_name, fchs->s_id); in bfa_fcs_rport_plogi_create()
2681 if (!rport) in bfa_fcs_rport_plogi_create()
2684 bfa_fcs_rport_update(rport, plogi); in bfa_fcs_rport_plogi_create()
2686 rport->reply_oxid = fchs->ox_id; in bfa_fcs_rport_plogi_create()
2687 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_plogi_create()
2689 rport->stats.plogi_rcvd++; in bfa_fcs_rport_plogi_create()
2690 bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RCVD); in bfa_fcs_rport_plogi_create()
2698 bfa_fcs_rport_plogi(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs, in bfa_fcs_rport_plogi() argument
2705 bfa_fcs_rport_update(rport, plogi); in bfa_fcs_rport_plogi()
2707 rport->reply_oxid = rx_fchs->ox_id; in bfa_fcs_rport_plogi()
2708 bfa_trc(rport->fcs, rport->reply_oxid); in bfa_fcs_rport_plogi()
2710 rport->pid = rx_fchs->s_id; in bfa_fcs_rport_plogi()
2711 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_plogi()
2713 rport->stats.plogi_rcvd++; in bfa_fcs_rport_plogi()
2714 bfa_sm_send_event(rport, RPSM_EVENT_PLOGI_RCVD); in bfa_fcs_rport_plogi()
2722 bfa_fcs_rport_scn(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_scn() argument
2724 rport->stats.rscns++; in bfa_fcs_rport_scn()
2725 bfa_sm_send_event(rport, RPSM_EVENT_FAB_SCN); in bfa_fcs_rport_scn()
2745 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; in bfa_cb_rport_online() local
2747 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_online()
2748 bfa_sm_send_event(rport, RPSM_EVENT_HCB_ONLINE); in bfa_cb_rport_online()
2767 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; in bfa_cb_rport_offline() local
2769 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_offline()
2770 bfa_sm_send_event(rport, RPSM_EVENT_HCB_OFFLINE); in bfa_cb_rport_offline()
2792 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; in bfa_cb_rport_qos_scn_flowid() local
2795 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_qos_scn_flowid()
2797 bfa_fcs_rport_aen_post(rport, BFA_RPORT_AEN_QOS_FLOWID, &aen_data); in bfa_cb_rport_qos_scn_flowid()
2819 bfa_cb_rport_scn_no_dev(void *rport) in bfa_cb_rport_scn_no_dev() argument
2821 struct bfa_fcs_rport_s *rp = rport; in bfa_cb_rport_scn_no_dev()
2861 struct bfa_fcs_rport_s *rport = (struct bfa_fcs_rport_s *) cbarg; in bfa_cb_rport_qos_scn_prio() local
2864 bfa_trc(rport->fcs, rport->pwwn); in bfa_cb_rport_qos_scn_prio()
2866 bfa_fcs_rport_aen_post(rport, BFA_RPORT_AEN_QOS_PRIO, &aen_data); in bfa_cb_rport_qos_scn_prio()
2873 bfa_fcs_rport_uf_recv(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_uf_recv() argument
2876 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_uf_recv()
2879 bfa_trc(rport->fcs, fchs->s_id); in bfa_fcs_rport_uf_recv()
2880 bfa_trc(rport->fcs, fchs->d_id); in bfa_fcs_rport_uf_recv()
2881 bfa_trc(rport->fcs, fchs->type); in bfa_fcs_rport_uf_recv()
2888 bfa_trc(rport->fcs, els_cmd->els_code); in bfa_fcs_rport_uf_recv()
2893 bfa_fcs_rport_process_logo(rport, fchs); in bfa_fcs_rport_uf_recv()
2898 bfa_fcs_rport_process_adisc(rport, fchs, len); in bfa_fcs_rport_uf_recv()
2904 bfa_fcs_fcpim_uf_recv(rport->itnim, fchs, len); in bfa_fcs_rport_uf_recv()
2909 bfa_fcs_rport_process_prli(rport, fchs, len); in bfa_fcs_rport_uf_recv()
2914 bfa_fcs_rport_process_rpsc(rport, fchs, len); in bfa_fcs_rport_uf_recv()
2919 bfa_fcs_rport_send_ls_rjt(rport, fchs, in bfa_fcs_rport_uf_recv()
2928 bfa_fcs_rport_send_prlo_acc(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_send_prlo_acc() argument
2930 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_prlo_acc()
2935 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_send_prlo_acc()
2941 rport->pid, bfa_fcs_lport_get_fcid(port), in bfa_fcs_rport_send_prlo_acc()
2942 rport->reply_oxid, 0); in bfa_fcs_rport_send_prlo_acc()
2944 bfa_fcxp_send(fcxp, rport->bfa_rport, port->fabric->vf_id, in bfa_fcs_rport_send_prlo_acc()
2953 bfa_fcs_rport_send_ls_rjt(struct bfa_fcs_rport_s *rport, struct fchs_s *rx_fchs, in bfa_fcs_rport_send_ls_rjt() argument
2956 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_send_ls_rjt()
2961 bfa_trc(rport->fcs, rx_fchs->s_id); in bfa_fcs_rport_send_ls_rjt()
2963 fcxp = bfa_fcs_fcxp_alloc(rport->fcs, BFA_FALSE); in bfa_fcs_rport_send_ls_rjt()
2980 bfa_fcs_rport_get_state(struct bfa_fcs_rport_s *rport) in bfa_fcs_rport_get_state() argument
2982 return bfa_sm_to_state(rport_sm_table, rport->sm); in bfa_fcs_rport_get_state()
3002 bfa_fcs_rport_prlo(struct bfa_fcs_rport_s *rport, __be16 ox_id) in bfa_fcs_rport_prlo() argument
3004 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rport_prlo()
3006 rport->prlo = BFA_TRUE; in bfa_fcs_rport_prlo()
3007 rport->reply_oxid = ox_id; in bfa_fcs_rport_prlo()
3008 bfa_sm_send_event(rport, RPSM_EVENT_PRLO_RCVD); in bfa_fcs_rport_prlo()
3023 bfa_fcs_rport_get_attr(struct bfa_fcs_rport_s *rport, in bfa_fcs_rport_get_attr() argument
3027 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rport_get_attr()
3028 bfa_port_speed_t rport_speed = rport->rpf.rpsc_speed; in bfa_fcs_rport_get_attr()
3031 bfa_fcport_get_attr(rport->fcs->bfa, &port_attr); in bfa_fcs_rport_get_attr()
3036 rport_attr->pid = rport->pid; in bfa_fcs_rport_get_attr()
3037 rport_attr->pwwn = rport->pwwn; in bfa_fcs_rport_get_attr()
3038 rport_attr->nwwn = rport->nwwn; in bfa_fcs_rport_get_attr()
3039 rport_attr->cos_supported = rport->fc_cos; in bfa_fcs_rport_get_attr()
3040 rport_attr->df_sz = rport->maxfrsize; in bfa_fcs_rport_get_attr()
3041 rport_attr->state = bfa_fcs_rport_get_state(rport); in bfa_fcs_rport_get_attr()
3042 rport_attr->fc_cos = rport->fc_cos; in bfa_fcs_rport_get_attr()
3043 rport_attr->cisc = rport->cisc; in bfa_fcs_rport_get_attr()
3044 rport_attr->scsi_function = rport->scsi_function; in bfa_fcs_rport_get_attr()
3045 rport_attr->curr_speed = rport->rpf.rpsc_speed; in bfa_fcs_rport_get_attr()
3046 rport_attr->assigned_speed = rport->rpf.assigned_speed; in bfa_fcs_rport_get_attr()
3048 if (rport->bfa_rport) { in bfa_fcs_rport_get_attr()
3049 qos_attr.qos_priority = rport->bfa_rport->qos_attr.qos_priority; in bfa_fcs_rport_get_attr()
3051 cpu_to_be32(rport->bfa_rport->qos_attr.qos_flow_id); in bfa_fcs_rport_get_attr()
3057 (rport->scsi_function == BFA_RPORT_TARGET)) { in bfa_fcs_rport_get_attr()
3060 bfa_fcport_get_ratelim_speed(rport->fcs->bfa); in bfa_fcs_rport_get_attr()
3079 struct bfa_fcs_rport_s *rport; in bfa_fcs_rport_lookup() local
3081 rport = bfa_fcs_lport_get_rport_by_pwwn(port, rpwwn); in bfa_fcs_rport_lookup()
3082 if (rport == NULL) { in bfa_fcs_rport_lookup()
3088 return rport; in bfa_fcs_rport_lookup()
3094 struct bfa_fcs_rport_s *rport; in bfa_fcs_rport_lookup_by_nwwn() local
3096 rport = bfa_fcs_lport_get_rport_by_nwwn(port, rnwwn); in bfa_fcs_rport_lookup_by_nwwn()
3097 if (rport == NULL) { in bfa_fcs_rport_lookup_by_nwwn()
3103 return rport; in bfa_fcs_rport_lookup_by_nwwn()
3155 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_uninit() local
3156 struct bfa_fcs_fabric_s *fabric = &rport->fcs->fabric; in bfa_fcs_rpf_sm_uninit()
3158 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_uninit()
3159 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_uninit()
3160 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_uninit()
3165 if ((!BFA_FCS_PID_IS_WKA(rport->pid)) && in bfa_fcs_rpf_sm_uninit()
3166 ((rport->port->fabric->lps->brcd_switch) || in bfa_fcs_rpf_sm_uninit()
3179 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_uninit()
3186 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc_sending() local
3188 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_sending()
3197 bfa_fcxp_walloc_cancel(rport->fcs->bfa, &rpf->fcxp_wqe); in bfa_fcs_rpf_sm_rpsc_sending()
3202 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_sending()
3209 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc() local
3211 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_rpsc()
3212 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc()
3219 bfa_rport_speed(rport->bfa_rport, rpf->rpsc_speed); in bfa_fcs_rpf_sm_rpsc()
3221 bfa_rport_speed(rport->bfa_rport, rpf->assigned_speed); in bfa_fcs_rpf_sm_rpsc()
3232 bfa_timer_start(rport->fcs->bfa, &rpf->timer, in bfa_fcs_rpf_sm_rpsc()
3248 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc()
3255 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_rpsc_retry() local
3257 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_rpsc_retry()
3258 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_retry()
3274 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_rpsc_retry()
3281 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_online() local
3283 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_online()
3284 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_online()
3285 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_online()
3294 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_online()
3301 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_sm_offline() local
3303 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_sm_offline()
3304 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_sm_offline()
3305 bfa_trc(rport->fcs, event); in bfa_fcs_rpf_sm_offline()
3317 bfa_sm_fault(rport->fcs, event); in bfa_fcs_rpf_sm_offline()
3324 bfa_fcs_rpf_init(struct bfa_fcs_rport_s *rport) in bfa_fcs_rpf_init() argument
3326 struct bfa_fcs_rpf_s *rpf = &rport->rpf; in bfa_fcs_rpf_init()
3328 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_init()
3329 rpf->rport = rport; in bfa_fcs_rpf_init()
3338 bfa_fcs_rpf_rport_online(struct bfa_fcs_rport_s *rport) in bfa_fcs_rpf_rport_online() argument
3340 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_rport_online()
3342 if (__fcs_min_cfg(rport->port->fcs)) in bfa_fcs_rpf_rport_online()
3345 if (bfa_fcs_fabric_is_switched(rport->port->fabric)) in bfa_fcs_rpf_rport_online()
3346 bfa_sm_send_event(&rport->rpf, RPFSM_EVENT_RPORT_ONLINE); in bfa_fcs_rpf_rport_online()
3353 bfa_fcs_rpf_rport_offline(struct bfa_fcs_rport_s *rport) in bfa_fcs_rpf_rport_offline() argument
3355 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_rport_offline()
3357 if (__fcs_min_cfg(rport->port->fcs)) in bfa_fcs_rpf_rport_offline()
3360 rport->rpf.rpsc_speed = 0; in bfa_fcs_rpf_rport_offline()
3361 bfa_sm_send_event(&rport->rpf, RPFSM_EVENT_RPORT_OFFLINE); in bfa_fcs_rpf_rport_offline()
3368 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_timeout() local
3370 bfa_trc(rport->fcs, rport->pid); in bfa_fcs_rpf_timeout()
3378 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_send_rpsc2() local
3379 struct bfa_fcs_lport_s *port = rport->port; in bfa_fcs_rpf_send_rpsc2()
3384 bfa_trc(rport->fcs, rport->pwwn); in bfa_fcs_rpf_send_rpsc2()
3395 len = fc_rpsc2_build(&fchs, bfa_fcxp_get_reqbuf(fcxp), rport->pid, in bfa_fcs_rpf_send_rpsc2()
3396 bfa_fcs_lport_get_fcid(port), &rport->pid, 1); in bfa_fcs_rpf_send_rpsc2()
3401 rport->stats.rpsc_sent++; in bfa_fcs_rpf_send_rpsc2()
3412 struct bfa_fcs_rport_s *rport = rpf->rport; in bfa_fcs_rpf_rpsc2_response() local
3417 bfa_trc(rport->fcs, req_status); in bfa_fcs_rpf_rpsc2_response()
3420 bfa_trc(rport->fcs, req_status); in bfa_fcs_rpf_rpsc2_response()
3422 rport->stats.rpsc_failed++; in bfa_fcs_rpf_rpsc2_response()
3429 rport->stats.rpsc_accs++; in bfa_fcs_rpf_rpsc2_response()
3431 bfa_trc(rport->fcs, num_ents); in bfa_fcs_rpf_rpsc2_response()
3434 bfa_ntoh3b(rport->pid)); in bfa_fcs_rpf_rpsc2_response()
3435 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3437 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3439 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3441 bfa_trc(rport->fcs, in bfa_fcs_rpf_rpsc2_response()
3456 bfa_trc(rport->fcs, ls_rjt->reason_code); in bfa_fcs_rpf_rpsc2_response()
3457 bfa_trc(rport->fcs, ls_rjt->reason_code_expl); in bfa_fcs_rpf_rpsc2_response()
3458 rport->stats.rpsc_rejects++; in bfa_fcs_rpf_rpsc2_response()