Lines Matching refs:fabric

41 	bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_CREATE);  in bfa_fcs_init()
56 struct bfa_fcs_fabric_s *fabric = &fcs->fabric; in bfa_fcs_update_cfg() local
57 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; in bfa_fcs_update_cfg()
58 struct bfa_ioc_s *ioc = &fabric->fcs->bfa->ioc; in bfa_fcs_update_cfg()
110 bfa_fcs_fabric_psymb_init(&fcs->fabric); in bfa_fcs_driver_info_init()
111 bfa_fcs_fabric_nsymb_init(&fcs->fabric); in bfa_fcs_driver_info_init()
127 bfa_lps_delete(fcs->fabric.lps); in bfa_fcs_exit()
128 bfa_sm_send_event(&fcs->fabric, BFA_FCS_FABRIC_SM_DELETE); in bfa_fcs_exit()
142 if (fabric->fab_type == BFA_FCS_FABRIC_SWITCHED) \
153 static void bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric);
154 static void bfa_fcs_fabric_login(struct bfa_fcs_fabric_s *fabric);
155 static void bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric);
156 static void bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric);
158 static void bfa_fcs_fabric_delete(struct bfa_fcs_fabric_s *fabric);
160 static void bfa_fcs_fabric_stop(struct bfa_fcs_fabric_s *fabric);
162 static void bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric,
164 static void bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric,
166 static void bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric);
174 static void bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric,
176 static void bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric,
178 static void bfa_fcs_fabric_sm_linkdown(struct bfa_fcs_fabric_s *fabric,
180 static void bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric,
182 static void bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric,
184 static void bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric,
186 static void bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric,
188 static void bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric,
190 static void bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric,
192 static void bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric,
194 static void bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric,
196 static void bfa_fcs_fabric_sm_stopping(struct bfa_fcs_fabric_s *fabric,
198 static void bfa_fcs_fabric_sm_cleanup(struct bfa_fcs_fabric_s *fabric,
204 bfa_fcs_fabric_sm_uninit(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_uninit() argument
207 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_uninit()
208 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_uninit()
212 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_created); in bfa_fcs_fabric_sm_uninit()
213 bfa_fcs_fabric_init(fabric); in bfa_fcs_fabric_sm_uninit()
214 bfa_fcs_lport_init(&fabric->bport, &fabric->bport.port_cfg); in bfa_fcs_fabric_sm_uninit()
222 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_uninit()
230 bfa_fcs_fabric_sm_created(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_created() argument
233 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_sm_created()
235 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_created()
236 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_created()
240 if (!bfa_fcport_is_linkup(fabric->fcs->bfa)) { in bfa_fcs_fabric_sm_created()
241 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); in bfa_fcs_fabric_sm_created()
246 fabric->fab_type = BFA_FCS_FABRIC_LOOP; in bfa_fcs_fabric_sm_created()
247 fabric->bport.pid = bfa_fcport_get_myalpa(bfa); in bfa_fcs_fabric_sm_created()
248 fabric->bport.pid = bfa_hton3b(fabric->bport.pid); in bfa_fcs_fabric_sm_created()
249 bfa_sm_set_state(fabric, in bfa_fcs_fabric_sm_created()
251 bfa_fcs_fabric_set_opertype(fabric); in bfa_fcs_fabric_sm_created()
252 bfa_fcs_lport_online(&fabric->bport); in bfa_fcs_fabric_sm_created()
254 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi); in bfa_fcs_fabric_sm_created()
255 bfa_fcs_fabric_login(fabric); in bfa_fcs_fabric_sm_created()
264 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_created()
265 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_created()
269 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_created()
278 bfa_fcs_fabric_sm_linkdown(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_linkdown() argument
281 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_sm_linkdown()
283 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_linkdown()
284 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_linkdown()
289 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi); in bfa_fcs_fabric_sm_linkdown()
290 bfa_fcs_fabric_login(fabric); in bfa_fcs_fabric_sm_linkdown()
293 fabric->fab_type = BFA_FCS_FABRIC_LOOP; in bfa_fcs_fabric_sm_linkdown()
294 fabric->bport.pid = bfa_fcport_get_myalpa(bfa); in bfa_fcs_fabric_sm_linkdown()
295 fabric->bport.pid = bfa_hton3b(fabric->bport.pid); in bfa_fcs_fabric_sm_linkdown()
296 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_online); in bfa_fcs_fabric_sm_linkdown()
297 bfa_fcs_fabric_set_opertype(fabric); in bfa_fcs_fabric_sm_linkdown()
298 bfa_fcs_lport_online(&fabric->bport); in bfa_fcs_fabric_sm_linkdown()
306 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_linkdown()
307 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_linkdown()
311 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_cleanup); in bfa_fcs_fabric_sm_linkdown()
312 bfa_fcs_fabric_stop(fabric); in bfa_fcs_fabric_sm_linkdown()
316 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_linkdown()
324 bfa_fcs_fabric_sm_flogi(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_flogi() argument
327 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_flogi()
328 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi()
333 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, in bfa_fcs_fabric_sm_flogi()
334 fabric->bb_credit); in bfa_fcs_fabric_sm_flogi()
335 fabric->fab_type = BFA_FCS_FABRIC_SWITCHED; in bfa_fcs_fabric_sm_flogi()
337 if (fabric->auth_reqd && fabric->is_auth) { in bfa_fcs_fabric_sm_flogi()
338 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth); in bfa_fcs_fabric_sm_flogi()
339 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi()
341 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_online); in bfa_fcs_fabric_sm_flogi()
342 bfa_fcs_fabric_notify_online(fabric); in bfa_fcs_fabric_sm_flogi()
347 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi_retry); in bfa_fcs_fabric_sm_flogi()
348 bfa_timer_start(fabric->fcs->bfa, &fabric->delay_timer, in bfa_fcs_fabric_sm_flogi()
349 bfa_fcs_fabric_delay, fabric, in bfa_fcs_fabric_sm_flogi()
354 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_loopback); in bfa_fcs_fabric_sm_flogi()
355 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_flogi()
356 bfa_fcs_fabric_set_opertype(fabric); in bfa_fcs_fabric_sm_flogi()
360 fabric->fab_type = BFA_FCS_FABRIC_N2N; in bfa_fcs_fabric_sm_flogi()
361 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, in bfa_fcs_fabric_sm_flogi()
362 fabric->bb_credit); in bfa_fcs_fabric_sm_flogi()
363 bfa_fcs_fabric_notify_online(fabric); in bfa_fcs_fabric_sm_flogi()
364 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_nofabric); in bfa_fcs_fabric_sm_flogi()
368 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); in bfa_fcs_fabric_sm_flogi()
369 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_flogi()
373 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_flogi()
374 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_flogi()
375 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_flogi()
379 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi()
385 bfa_fcs_fabric_sm_flogi_retry(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_flogi_retry() argument
388 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_flogi_retry()
389 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi_retry()
393 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_flogi); in bfa_fcs_fabric_sm_flogi_retry()
394 bfa_fcs_fabric_login(fabric); in bfa_fcs_fabric_sm_flogi_retry()
398 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); in bfa_fcs_fabric_sm_flogi_retry()
399 bfa_timer_stop(&fabric->delay_timer); in bfa_fcs_fabric_sm_flogi_retry()
403 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_flogi_retry()
404 bfa_timer_stop(&fabric->delay_timer); in bfa_fcs_fabric_sm_flogi_retry()
405 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_flogi_retry()
409 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_flogi_retry()
417 bfa_fcs_fabric_sm_auth(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_auth() argument
420 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_auth()
421 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_auth()
425 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed); in bfa_fcs_fabric_sm_auth()
426 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_auth()
430 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_online); in bfa_fcs_fabric_sm_auth()
431 bfa_fcs_fabric_notify_online(fabric); in bfa_fcs_fabric_sm_auth()
435 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_evfp); in bfa_fcs_fabric_sm_auth()
439 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); in bfa_fcs_fabric_sm_auth()
440 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_auth()
444 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_auth()
445 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_auth()
449 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_auth()
457 bfa_fcs_fabric_sm_auth_failed(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_auth_failed() argument
460 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_auth_failed()
461 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_auth_failed()
465 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); in bfa_fcs_fabric_sm_auth_failed()
466 bfa_fcs_fabric_notify_offline(fabric); in bfa_fcs_fabric_sm_auth_failed()
470 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_auth_failed()
471 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_auth_failed()
475 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_auth_failed()
483 bfa_fcs_fabric_sm_loopback(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_loopback() argument
486 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_loopback()
487 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_loopback()
491 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); in bfa_fcs_fabric_sm_loopback()
492 bfa_fcs_fabric_notify_offline(fabric); in bfa_fcs_fabric_sm_loopback()
496 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_loopback()
497 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_loopback()
501 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_loopback()
509 bfa_fcs_fabric_sm_nofabric(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_nofabric() argument
512 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_nofabric()
513 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_nofabric()
517 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); in bfa_fcs_fabric_sm_nofabric()
518 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_nofabric()
519 bfa_fcs_fabric_notify_offline(fabric); in bfa_fcs_fabric_sm_nofabric()
523 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_nofabric()
524 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_nofabric()
528 bfa_trc(fabric->fcs, fabric->bb_credit); in bfa_fcs_fabric_sm_nofabric()
529 bfa_fcport_set_tx_bbcredit(fabric->fcs->bfa, in bfa_fcs_fabric_sm_nofabric()
530 fabric->bb_credit); in bfa_fcs_fabric_sm_nofabric()
537 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_nofabric()
545 bfa_fcs_fabric_sm_online(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_online() argument
548 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_sm_online()
550 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_online()
551 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_online()
555 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_linkdown); in bfa_fcs_fabric_sm_online()
557 bfa_fcs_lport_offline(&fabric->bport); in bfa_fcs_fabric_sm_online()
559 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_online()
560 bfa_fcs_fabric_notify_offline(fabric); in bfa_fcs_fabric_sm_online()
565 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_deleting); in bfa_fcs_fabric_sm_online()
566 bfa_fcs_fabric_delete(fabric); in bfa_fcs_fabric_sm_online()
570 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_stopping); in bfa_fcs_fabric_sm_online()
571 bfa_fcs_fabric_stop(fabric); in bfa_fcs_fabric_sm_online()
575 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_auth_failed); in bfa_fcs_fabric_sm_online()
576 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_OFFLINE); in bfa_fcs_fabric_sm_online()
583 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_online()
591 bfa_fcs_fabric_sm_evfp(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_evfp() argument
594 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_evfp()
595 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_evfp()
599 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_evfp_done); in bfa_fcs_fabric_sm_evfp()
603 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_isolated); in bfa_fcs_fabric_sm_evfp()
607 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_evfp()
615 bfa_fcs_fabric_sm_evfp_done(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_evfp_done() argument
618 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_evfp_done()
619 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_evfp_done()
626 bfa_fcs_fabric_sm_isolated(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_isolated() argument
629 struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad; in bfa_fcs_fabric_sm_isolated()
632 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_isolated()
633 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_isolated()
634 wwn2str(pwwn_ptr, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_isolated()
639 pwwn_ptr, fabric->fcs->port_vfid, in bfa_fcs_fabric_sm_isolated()
640 fabric->event_arg.swp_vfid); in bfa_fcs_fabric_sm_isolated()
647 bfa_fcs_fabric_sm_deleting(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_deleting() argument
650 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_deleting()
651 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_deleting()
655 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); in bfa_fcs_fabric_sm_deleting()
656 bfa_wc_down(&fabric->fcs->wc); in bfa_fcs_fabric_sm_deleting()
663 bfa_fcs_fabric_notify_offline(fabric); in bfa_fcs_fabric_sm_deleting()
667 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_deleting()
675 bfa_fcs_fabric_sm_stopping(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_stopping() argument
678 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_sm_stopping()
680 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_stopping()
681 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_stopping()
686 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_created); in bfa_fcs_fabric_sm_stopping()
688 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_cleanup); in bfa_fcs_fabric_sm_stopping()
689 bfa_sm_send_event(fabric->lps, BFA_LPS_SM_LOGOUT); in bfa_fcs_fabric_sm_stopping()
698 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_created); in bfa_fcs_fabric_sm_stopping()
700 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_cleanup); in bfa_fcs_fabric_sm_stopping()
704 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_stopping()
712 bfa_fcs_fabric_sm_cleanup(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_sm_cleanup() argument
715 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_sm_cleanup()
716 bfa_trc(fabric->fcs, event); in bfa_fcs_fabric_sm_cleanup()
721 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_created); in bfa_fcs_fabric_sm_cleanup()
722 bfa_wc_down(&(fabric->fcs)->wc); in bfa_fcs_fabric_sm_cleanup()
733 bfa_sm_fault(fabric->fcs, event); in bfa_fcs_fabric_sm_cleanup()
742 bfa_fcs_fabric_init(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_init() argument
744 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_init()
747 port_cfg->nwwn = fabric->fcs->bfa->ioc.attr->nwwn; in bfa_fcs_fabric_init()
748 port_cfg->pwwn = fabric->fcs->bfa->ioc.attr->pwwn; in bfa_fcs_fabric_init()
755 bfa_fcs_fabric_psymb_init(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_psymb_init() argument
757 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_psymb_init()
759 struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info; in bfa_fcs_fabric_psymb_init()
761 bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model); in bfa_fcs_fabric_psymb_init()
816 bfa_fcs_fabric_nsymb_init(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_nsymb_init() argument
818 struct bfa_lport_cfg_s *port_cfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_nsymb_init()
820 struct bfa_fcs_driver_info_s *driver_info = &fabric->fcs->driver_info; in bfa_fcs_fabric_nsymb_init()
822 bfa_ioc_get_adapter_model(&fabric->fcs->bfa->ioc, model); in bfa_fcs_fabric_nsymb_init()
856 struct bfa_fcs_fabric_s *fabric = uarg; in bfa_cb_lps_flogi_comp() local
858 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_cb_lps_flogi_comp()
859 bfa_trc(fabric->fcs, status); in bfa_cb_lps_flogi_comp()
863 fabric->stats.flogi_accepts++; in bfa_cb_lps_flogi_comp()
868 fabric->stats.flogi_acc_err++; in bfa_cb_lps_flogi_comp()
869 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP); in bfa_cb_lps_flogi_comp()
874 switch (fabric->lps->ext_status) { in bfa_cb_lps_flogi_comp()
876 fabric->stats.flogi_acc_err++; in bfa_cb_lps_flogi_comp()
880 fabric->stats.flogi_unknown_rsp++; in bfa_cb_lps_flogi_comp()
886 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP); in bfa_cb_lps_flogi_comp()
891 fabric->stats.flogi_rejects++; in bfa_cb_lps_flogi_comp()
892 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP); in bfa_cb_lps_flogi_comp()
896 fabric->stats.flogi_rsp_err++; in bfa_cb_lps_flogi_comp()
897 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_RETRY_OP); in bfa_cb_lps_flogi_comp()
901 fabric->bb_credit = fabric->lps->pr_bbcred; in bfa_cb_lps_flogi_comp()
902 bfa_trc(fabric->fcs, fabric->bb_credit); in bfa_cb_lps_flogi_comp()
904 if (!(fabric->lps->brcd_switch)) in bfa_cb_lps_flogi_comp()
905 fabric->fabric_name = fabric->lps->pr_nwwn; in bfa_cb_lps_flogi_comp()
910 if (fabric->lps->fport) { in bfa_cb_lps_flogi_comp()
911 fabric->bport.pid = fabric->lps->lp_pid; in bfa_cb_lps_flogi_comp()
912 fabric->is_npiv = fabric->lps->npiv_en; in bfa_cb_lps_flogi_comp()
913 fabric->is_auth = fabric->lps->auth_req; in bfa_cb_lps_flogi_comp()
914 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_CONT_OP); in bfa_cb_lps_flogi_comp()
919 fabric->bport.port_topo.pn2n.rem_port_wwn = in bfa_cb_lps_flogi_comp()
920 fabric->lps->pr_pwwn; in bfa_cb_lps_flogi_comp()
921 fabric->fab_type = BFA_FCS_FABRIC_N2N; in bfa_cb_lps_flogi_comp()
922 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC); in bfa_cb_lps_flogi_comp()
925 bfa_trc(fabric->fcs, fabric->bport.pid); in bfa_cb_lps_flogi_comp()
926 bfa_trc(fabric->fcs, fabric->is_npiv); in bfa_cb_lps_flogi_comp()
927 bfa_trc(fabric->fcs, fabric->is_auth); in bfa_cb_lps_flogi_comp()
933 bfa_fcs_fabric_login(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_login() argument
935 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_login()
936 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_login()
940 bfa_lps_flogi(fabric->lps, fabric, alpa, bfa_fcport_get_maxfrsize(bfa), in bfa_fcs_fabric_login()
941 pcfg->pwwn, pcfg->nwwn, fabric->auth_reqd); in bfa_fcs_fabric_login()
943 fabric->stats.flogi_sent++; in bfa_fcs_fabric_login()
947 bfa_fcs_fabric_notify_online(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_notify_online() argument
952 bfa_trc(fabric->fcs, fabric->fabric_name); in bfa_fcs_fabric_notify_online()
954 bfa_fcs_fabric_set_opertype(fabric); in bfa_fcs_fabric_notify_online()
955 fabric->stats.fabric_onlines++; in bfa_fcs_fabric_notify_online()
960 bfa_fcs_lport_online(&fabric->bport); in bfa_fcs_fabric_notify_online()
962 list_for_each_safe(qe, qen, &fabric->vport_q) { in bfa_fcs_fabric_notify_online()
969 bfa_fcs_fabric_notify_offline(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_notify_offline() argument
974 bfa_trc(fabric->fcs, fabric->fabric_name); in bfa_fcs_fabric_notify_offline()
975 fabric->stats.fabric_offlines++; in bfa_fcs_fabric_notify_offline()
980 list_for_each_safe(qe, qen, &fabric->vport_q) { in bfa_fcs_fabric_notify_offline()
985 bfa_fcs_lport_offline(&fabric->bport); in bfa_fcs_fabric_notify_offline()
987 fabric->fabric_name = 0; in bfa_fcs_fabric_notify_offline()
988 fabric->fabric_ip_addr[0] = 0; in bfa_fcs_fabric_notify_offline()
994 struct bfa_fcs_fabric_s *fabric = cbarg; in bfa_fcs_fabric_delay() local
996 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELAYED); in bfa_fcs_fabric_delay()
1003 bfa_fcs_fabric_stop(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_stop() argument
1008 bfa_wc_init(&fabric->stop_wc, bfa_fcs_fabric_stop_comp, fabric); in bfa_fcs_fabric_stop()
1010 list_for_each_safe(qe, qen, &fabric->vport_q) { in bfa_fcs_fabric_stop()
1012 bfa_wc_up(&fabric->stop_wc); in bfa_fcs_fabric_stop()
1016 bfa_wc_up(&fabric->stop_wc); in bfa_fcs_fabric_stop()
1017 bfa_fcs_lport_stop(&fabric->bport); in bfa_fcs_fabric_stop()
1018 bfa_wc_wait(&fabric->stop_wc); in bfa_fcs_fabric_stop()
1025 bfa_fcs_fabric_delete(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_delete() argument
1030 list_for_each_safe(qe, qen, &fabric->vport_q) { in bfa_fcs_fabric_delete()
1035 bfa_fcs_lport_delete(&fabric->bport); in bfa_fcs_fabric_delete()
1036 bfa_wc_wait(&fabric->wc); in bfa_fcs_fabric_delete()
1042 struct bfa_fcs_fabric_s *fabric = cbarg; in bfa_fcs_fabric_delete_comp() local
1044 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_DELCOMP); in bfa_fcs_fabric_delete_comp()
1050 struct bfa_fcs_fabric_s *fabric = cbarg; in bfa_fcs_fabric_stop_comp() local
1052 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_STOPCOMP); in bfa_fcs_fabric_stop_comp()
1065 struct bfa_fcs_fabric_s *fabric; in bfa_fcs_fabric_modstop() local
1068 fabric = &fcs->fabric; in bfa_fcs_fabric_modstop()
1069 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_STOP); in bfa_fcs_fabric_modstop()
1078 struct bfa_fcs_fabric_s *fabric; in bfa_fcs_fabric_modstart() local
1081 fabric = &fcs->fabric; in bfa_fcs_fabric_modstart()
1082 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_START); in bfa_fcs_fabric_modstart()
1090 bfa_fcs_fabric_link_up(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_link_up() argument
1092 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_link_up()
1093 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_UP); in bfa_fcs_fabric_link_up()
1100 bfa_fcs_fabric_link_down(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_link_down() argument
1102 bfa_trc(fabric->fcs, fabric->bport.port_cfg.pwwn); in bfa_fcs_fabric_link_down()
1103 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LINK_DOWN); in bfa_fcs_fabric_link_down()
1118 bfa_fcs_fabric_addvport(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_addvport() argument
1124 bfa_trc(fabric->fcs, fabric->vf_id); in bfa_fcs_fabric_addvport()
1126 list_add_tail(&vport->qe, &fabric->vport_q); in bfa_fcs_fabric_addvport()
1127 fabric->num_vports++; in bfa_fcs_fabric_addvport()
1128 bfa_wc_up(&fabric->wc); in bfa_fcs_fabric_addvport()
1137 bfa_fcs_fabric_delvport(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_delvport() argument
1141 fabric->num_vports--; in bfa_fcs_fabric_delvport()
1142 bfa_wc_down(&fabric->wc); in bfa_fcs_fabric_delvport()
1150 bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn) in bfa_fcs_fabric_vport_lookup() argument
1155 list_for_each(qe, &fabric->vport_q) { in bfa_fcs_fabric_vport_lookup()
1177 bfa_fcs_fabric_get_switch_oui(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_get_switch_oui() argument
1183 fab_nwwn = fabric->lps->pr_nwwn; in bfa_fcs_fabric_get_switch_oui()
1194 bfa_fcs_fabric_uf_recv(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs, in bfa_fcs_fabric_uf_recv() argument
1203 bfa_trc(fabric->fcs, len); in bfa_fcs_fabric_uf_recv()
1204 bfa_trc(fabric->fcs, pid); in bfa_fcs_fabric_uf_recv()
1213 (flogi->port_name == bfa_fcs_lport_get_pwwn(&fabric->bport))) { in bfa_fcs_fabric_uf_recv()
1214 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LOOPBACK); in bfa_fcs_fabric_uf_recv()
1222 bfa_trc(fabric->fcs, pid); in bfa_fcs_fabric_uf_recv()
1223 bfa_fcs_fabric_process_uf(fabric, fchs, len); in bfa_fcs_fabric_uf_recv()
1227 if (fabric->bport.pid == pid) { in bfa_fcs_fabric_uf_recv()
1231 bfa_trc(fabric->fcs, els_cmd->els_code); in bfa_fcs_fabric_uf_recv()
1233 bfa_trc(fabric->fcs, els_cmd->els_code); in bfa_fcs_fabric_uf_recv()
1237 bfa_trc(fabric->fcs, *(u8 *) ((u8 *) fchs)); in bfa_fcs_fabric_uf_recv()
1238 bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len); in bfa_fcs_fabric_uf_recv()
1245 list_for_each(qe, &fabric->vport_q) { in bfa_fcs_fabric_uf_recv()
1253 if (!bfa_fcs_fabric_is_switched(fabric)) in bfa_fcs_fabric_uf_recv()
1254 bfa_fcs_lport_uf_recv(&fabric->bport, fchs, len); in bfa_fcs_fabric_uf_recv()
1256 bfa_trc(fabric->fcs, fchs->type); in bfa_fcs_fabric_uf_recv()
1263 bfa_fcs_fabric_process_uf(struct bfa_fcs_fabric_s *fabric, struct fchs_s *fchs, in bfa_fcs_fabric_process_uf() argument
1268 bfa_trc(fabric->fcs, els_cmd->els_code); in bfa_fcs_fabric_process_uf()
1272 bfa_fcs_fabric_process_flogi(fabric, fchs, len); in bfa_fcs_fabric_process_uf()
1287 bfa_fcs_fabric_process_flogi(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_process_flogi() argument
1291 struct bfa_fcs_lport_s *bport = &fabric->bport; in bfa_fcs_fabric_process_flogi()
1293 bfa_trc(fabric->fcs, fchs->s_id); in bfa_fcs_fabric_process_flogi()
1295 fabric->stats.flogi_rcvd++; in bfa_fcs_fabric_process_flogi()
1303 bfa_trc(fabric->fcs, flogi->port_name); in bfa_fcs_fabric_process_flogi()
1304 fabric->stats.flogi_rejected++; in bfa_fcs_fabric_process_flogi()
1308 fabric->bb_credit = be16_to_cpu(flogi->csp.bbcred); in bfa_fcs_fabric_process_flogi()
1315 bfa_fcs_fabric_send_flogi_acc(fabric); in bfa_fcs_fabric_process_flogi()
1316 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_NO_FABRIC); in bfa_fcs_fabric_process_flogi()
1320 bfa_fcs_fabric_send_flogi_acc(struct bfa_fcs_fabric_s *fabric) in bfa_fcs_fabric_send_flogi_acc() argument
1322 struct bfa_lport_cfg_s *pcfg = &fabric->bport.port_cfg; in bfa_fcs_fabric_send_flogi_acc()
1323 struct bfa_fcs_lport_n2n_s *n2n_port = &fabric->bport.port_topo.pn2n; in bfa_fcs_fabric_send_flogi_acc()
1324 struct bfa_s *bfa = fabric->fcs->bfa; in bfa_fcs_fabric_send_flogi_acc()
1329 fcxp = bfa_fcs_fcxp_alloc(fabric->fcs, BFA_FALSE); in bfa_fcs_fabric_send_flogi_acc()
1343 bfa_fcxp_send(fcxp, NULL, fabric->vf_id, fabric->lps->bfa_tag, in bfa_fcs_fabric_send_flogi_acc()
1345 reqlen, &fchs, bfa_fcs_fabric_flogiacc_comp, fabric, in bfa_fcs_fabric_send_flogi_acc()
1357 struct bfa_fcs_fabric_s *fabric = cbarg; in bfa_fcs_fabric_flogiacc_comp() local
1359 bfa_trc(fabric->fcs, status); in bfa_fcs_fabric_flogiacc_comp()
1370 struct bfad_s *bfad = (struct bfad_s *)port->fabric->fcs->bfad; in bfa_fcs_fabric_aen_post()
1393 bfa_fcs_fabric_set_fabric_name(struct bfa_fcs_fabric_s *fabric, in bfa_fcs_fabric_set_fabric_name() argument
1396 struct bfad_s *bfad = (struct bfad_s *)fabric->fcs->bfad; in bfa_fcs_fabric_set_fabric_name()
1400 bfa_trc(fabric->fcs, fabric_name); in bfa_fcs_fabric_set_fabric_name()
1402 if (fabric->fabric_name == 0) { in bfa_fcs_fabric_set_fabric_name()
1407 fabric->fabric_name = fabric_name; in bfa_fcs_fabric_set_fabric_name()
1409 fabric->fabric_name = fabric_name; in bfa_fcs_fabric_set_fabric_name()
1410 wwn2str(pwwn_ptr, bfa_fcs_lport_get_pwwn(&fabric->bport)); in bfa_fcs_fabric_set_fabric_name()
1412 bfa_fcs_lport_get_fabric_name(&fabric->bport)); in bfa_fcs_fabric_set_fabric_name()
1416 bfa_fcs_fabric_aen_post(&fabric->bport, in bfa_fcs_fabric_set_fabric_name()
1424 struct bfa_fcs_fabric_s *fabric = uarg; in bfa_cb_lps_flogo_comp() local
1425 bfa_sm_send_event(fabric, BFA_FCS_FABRIC_SM_LOGOCOMP); in bfa_cb_lps_flogo_comp()
1441 return &fcs->fabric; in bfa_fcs_vf_lookup()
1497 bfa_fcs_fabric_link_up(&fcs->fabric); in bfa_fcs_port_event_handler()
1501 bfa_fcs_fabric_link_down(&fcs->fabric); in bfa_fcs_port_event_handler()
1528 struct bfa_fcs_fabric_s *fabric; in bfa_fcs_uf_recv() local
1538 fabric = &fcs->fabric; in bfa_fcs_uf_recv()
1540 fabric = bfa_fcs_vf_lookup(fcs, (u16) vft->vf_id); in bfa_fcs_uf_recv()
1545 if (!fabric) { in bfa_fcs_uf_recv()
1561 fabric = &fcs->fabric; in bfa_fcs_uf_recv()
1572 bfa_fcs_fabric_uf_recv(fabric, fchs, len); in bfa_fcs_uf_recv()
1583 struct bfa_fcs_fabric_s *fabric = &fcs->fabric; in bfa_fcs_attach() local
1596 memset(fabric, 0, sizeof(struct bfa_fcs_fabric_s)); in bfa_fcs_attach()
1601 fabric->fcs = fcs; in bfa_fcs_attach()
1602 INIT_LIST_HEAD(&fabric->vport_q); in bfa_fcs_attach()
1603 INIT_LIST_HEAD(&fabric->vf_q); in bfa_fcs_attach()
1604 fabric->lps = bfa_lps_alloc(fcs->bfa); in bfa_fcs_attach()
1605 WARN_ON(!fabric->lps); in bfa_fcs_attach()
1611 bfa_wc_init(&fabric->wc, bfa_fcs_fabric_delete_comp, fabric); in bfa_fcs_attach()
1612 bfa_wc_up(&fabric->wc); /* For the base port */ in bfa_fcs_attach()
1614 bfa_sm_set_state(fabric, bfa_fcs_fabric_sm_uninit); in bfa_fcs_attach()
1615 bfa_fcs_lport_attach(&fabric->bport, fabric->fcs, FC_VF_ID_NULL, NULL); in bfa_fcs_attach()