Lines Matching defs:lps
24 BFA_MODULE(lps);
53 static void bfa_lps_free(struct bfa_lps_s *lps);
54 static void bfa_lps_send_login(struct bfa_lps_s *lps);
55 static void bfa_lps_send_logout(struct bfa_lps_s *lps);
56 static void bfa_lps_login_comp(struct bfa_lps_s *lps);
57 static void bfa_lps_logout_comp(struct bfa_lps_s *lps);
58 static void bfa_lps_cvl_event(struct bfa_lps_s *lps);
69 BFA_LPS_SM_DELETE = 5, /* lps delete from user */
74 static void bfa_lps_sm_init(struct bfa_lps_s *lps, enum bfa_lps_event event);
75 static void bfa_lps_sm_login(struct bfa_lps_s *lps, enum bfa_lps_event event);
76 static void bfa_lps_sm_loginwait(struct bfa_lps_s *lps,
78 static void bfa_lps_sm_online(struct bfa_lps_s *lps, enum bfa_lps_event event);
79 static void bfa_lps_sm_logout(struct bfa_lps_s *lps, enum bfa_lps_event event);
80 static void bfa_lps_sm_logowait(struct bfa_lps_s *lps,
87 bfa_lps_sm_init(struct bfa_lps_s *lps, enum bfa_lps_event event)
89 bfa_trc(lps->bfa, lps->lp_tag);
90 bfa_trc(lps->bfa, event);
94 if (bfa_reqq_full(lps->bfa, lps->reqq)) {
95 bfa_sm_set_state(lps, bfa_lps_sm_loginwait);
96 bfa_reqq_wait(lps->bfa, lps->reqq, &lps->wqe);
98 bfa_sm_set_state(lps, bfa_lps_sm_login);
99 bfa_lps_send_login(lps);
101 if (lps->fdisc)
102 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
105 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
110 bfa_lps_logout_comp(lps);
114 bfa_lps_free(lps);
123 * the lps request. Fw will eventually sent out the timeout
129 bfa_sm_fault(lps->bfa, event);
137 bfa_lps_sm_login(struct bfa_lps_s *lps, enum bfa_lps_event event)
139 bfa_trc(lps->bfa, lps->lp_tag);
140 bfa_trc(lps->bfa, event);
144 if (lps->status == BFA_STATUS_OK) {
145 bfa_sm_set_state(lps, bfa_lps_sm_online);
146 if (lps->fdisc)
147 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
150 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
153 bfa_sm_set_state(lps, bfa_lps_sm_init);
154 if (lps->fdisc)
155 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
159 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
163 bfa_lps_login_comp(lps);
167 bfa_sm_set_state(lps, bfa_lps_sm_init);
171 bfa_sm_fault(lps->bfa, event);
179 bfa_lps_sm_loginwait(struct bfa_lps_s *lps, enum bfa_lps_event event)
181 bfa_trc(lps->bfa, lps->lp_tag);
182 bfa_trc(lps->bfa, event);
186 bfa_sm_set_state(lps, bfa_lps_sm_login);
190 bfa_sm_set_state(lps, bfa_lps_sm_init);
191 bfa_reqq_wcancel(&lps->wqe);
203 bfa_sm_fault(lps->bfa, event);
211 bfa_lps_sm_online(struct bfa_lps_s *lps, enum bfa_lps_event event)
213 bfa_trc(lps->bfa, lps->lp_tag);
214 bfa_trc(lps->bfa, event);
218 if (bfa_reqq_full(lps->bfa, lps->reqq)) {
219 bfa_sm_set_state(lps, bfa_lps_sm_logowait);
220 bfa_reqq_wait(lps->bfa, lps->reqq, &lps->wqe);
222 bfa_sm_set_state(lps, bfa_lps_sm_logout);
223 bfa_lps_send_logout(lps);
225 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
230 bfa_sm_set_state(lps, bfa_lps_sm_init);
233 bfa_lps_cvl_event(lps);
234 bfa_plog_str(lps->bfa->plog, BFA_PL_MID_LPS,
240 bfa_sm_set_state(lps, bfa_lps_sm_init);
244 bfa_sm_fault(lps->bfa, event);
252 bfa_lps_sm_logout(struct bfa_lps_s *lps, enum bfa_lps_event event)
254 bfa_trc(lps->bfa, lps->lp_tag);
255 bfa_trc(lps->bfa, event);
259 bfa_sm_set_state(lps, bfa_lps_sm_init);
260 bfa_lps_logout_comp(lps);
264 bfa_sm_set_state(lps, bfa_lps_sm_init);
268 bfa_sm_fault(lps->bfa, event);
276 bfa_lps_sm_logowait(struct bfa_lps_s *lps, enum bfa_lps_event event)
278 bfa_trc(lps->bfa, lps->lp_tag);
279 bfa_trc(lps->bfa, event);
283 bfa_sm_set_state(lps, bfa_lps_sm_logout);
284 bfa_lps_send_logout(lps);
288 bfa_sm_set_state(lps, bfa_lps_sm_init);
289 bfa_reqq_wcancel(&lps->wqe);
293 bfa_sm_fault(lps->bfa, event);
323 struct bfa_lps_s *lps;
332 mod->lps_arr = lps = (struct bfa_lps_s *) bfa_meminfo_kva(meminfo);
339 for (i = 0; i < mod->num_lps; i++, lps++) {
340 lps->bfa = bfa;
341 lps->lp_tag = (u8) i;
342 lps->reqq = BFA_REQQ_LPS;
343 bfa_reqq_winit(&lps->wqe, bfa_lps_reqq_resume, lps);
344 list_add_tail(&lps->qe, &mod->lps_free_q);
364 * IOC in disabled state -- consider all lps offline
370 struct bfa_lps_s *lps;
374 lps = (struct bfa_lps_s *) qe;
375 bfa_sm_send_event(lps, BFA_LPS_SM_OFFLINE);
386 struct bfa_lps_s *lps;
389 lps = BFA_LPS_FROM_TAG(mod, rsp->lp_tag);
391 lps->status = rsp->status;
394 lps->fport = rsp->f_port;
395 lps->npiv_en = rsp->npiv_en;
396 lps->lp_pid = rsp->lp_pid;
397 lps->pr_bbcred = bfa_os_ntohs(rsp->bb_credit);
398 lps->pr_pwwn = rsp->port_name;
399 lps->pr_nwwn = rsp->node_name;
400 lps->auth_req = rsp->auth_req;
401 lps->lp_mac = rsp->lp_mac;
402 lps->brcd_switch = rsp->brcd_switch;
403 lps->fcf_mac = rsp->fcf_mac;
408 lps->lsrjt_rsn = rsp->lsrjt_rsn;
409 lps->lsrjt_expl = rsp->lsrjt_expl;
414 lps->ext_status = rsp->ext_status;
423 bfa_sm_send_event(lps, BFA_LPS_SM_FWRSP);
433 struct bfa_lps_s *lps;
436 lps = BFA_LPS_FROM_TAG(mod, rsp->lp_tag);
438 bfa_sm_send_event(lps, BFA_LPS_SM_FWRSP);
448 struct bfa_lps_s *lps;
450 lps = BFA_LPS_FROM_TAG(mod, cvl->lp_tag);
452 bfa_sm_send_event(lps, BFA_LPS_SM_RX_CVL);
461 struct bfa_lps_s *lps = lps_arg;
463 bfa_sm_send_event(lps, BFA_LPS_SM_RESUME);
467 * lps is freed -- triggered by vport delete
470 bfa_lps_free(struct bfa_lps_s *lps)
472 struct bfa_lps_mod_s *mod = BFA_LPS_MOD(lps->bfa);
474 list_del(&lps->qe);
475 list_add_tail(&lps->qe, &mod->lps_free_q);
482 bfa_lps_send_login(struct bfa_lps_s *lps)
486 m = bfa_reqq_next(lps->bfa, lps->reqq);
490 bfa_lpuid(lps->bfa));
492 m->lp_tag = lps->lp_tag;
493 m->alpa = lps->alpa;
494 m->pdu_size = bfa_os_htons(lps->pdusz);
495 m->pwwn = lps->pwwn;
496 m->nwwn = lps->nwwn;
497 m->fdisc = lps->fdisc;
498 m->auth_en = lps->auth_en;
500 bfa_reqq_produce(lps->bfa, lps->reqq);
507 bfa_lps_send_logout(struct bfa_lps_s *lps)
511 m = bfa_reqq_next(lps->bfa, lps->reqq);
515 bfa_lpuid(lps->bfa));
517 m->lp_tag = lps->lp_tag;
518 m->port_name = lps->pwwn;
519 bfa_reqq_produce(lps->bfa, lps->reqq);
528 struct bfa_lps_s *lps = arg;
533 if (lps->fdisc)
534 bfa_cb_lps_fdisc_comp(lps->bfa->bfad, lps->uarg, lps->status);
536 bfa_cb_lps_flogi_comp(lps->bfa->bfad, lps->uarg, lps->status);
543 bfa_lps_login_comp(struct bfa_lps_s *lps)
545 if (!lps->bfa->fcs) {
546 bfa_cb_queue(lps->bfa, &lps->hcb_qe,
547 bfa_lps_login_comp_cb, lps);
551 if (lps->fdisc)
552 bfa_cb_lps_fdisc_comp(lps->bfa->bfad, lps->uarg, lps->status);
554 bfa_cb_lps_flogi_comp(lps->bfa->bfad, lps->uarg, lps->status);
563 struct bfa_lps_s *lps = arg;
568 if (lps->fdisc)
569 bfa_cb_lps_fdisclogo_comp(lps->bfa->bfad, lps->uarg);
571 bfa_cb_lps_flogo_comp(lps->bfa->bfad, lps->uarg);
578 bfa_lps_logout_comp(struct bfa_lps_s *lps)
580 if (!lps->bfa->fcs) {
581 bfa_cb_queue(lps->bfa, &lps->hcb_qe,
582 bfa_lps_logout_comp_cb, lps);
585 if (lps->fdisc)
586 bfa_cb_lps_fdisclogo_comp(lps->bfa->bfad, lps->uarg);
588 bfa_cb_lps_flogo_comp(lps->bfa->bfad, lps->uarg);
597 struct bfa_lps_s *lps = arg;
603 if (lps->fdisc)
604 bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
612 bfa_lps_cvl_event(struct bfa_lps_s *lps)
614 if (!lps->bfa->fcs) {
615 bfa_cb_queue(lps->bfa, &lps->hcb_qe, bfa_lps_cvl_event_cb,
616 lps);
621 if (lps->fdisc)
622 bfa_cb_lps_cvl_event(lps->bfa->bfad, lps->uarg);
645 struct bfa_lps_s *lps = NULL;
647 bfa_q_deq(&mod->lps_free_q, &lps);
649 if (lps == NULL)
652 list_add_tail(&lps->qe, &mod->lps_active_q);
654 bfa_sm_set_state(lps, bfa_lps_sm_init);
655 return lps;
663 bfa_lps_delete(struct bfa_lps_s *lps)
665 bfa_sm_send_event(lps, BFA_LPS_SM_DELETE);
672 bfa_lps_flogi(struct bfa_lps_s *lps, void *uarg, u8 alpa, u16 pdusz,
675 lps->uarg = uarg;
676 lps->alpa = alpa;
677 lps->pdusz = pdusz;
678 lps->pwwn = pwwn;
679 lps->nwwn = nwwn;
680 lps->fdisc = BFA_FALSE;
681 lps->auth_en = auth_en;
682 bfa_sm_send_event(lps, BFA_LPS_SM_LOGIN);
689 bfa_lps_fdisc(struct bfa_lps_s *lps, void *uarg, u16 pdusz, wwn_t pwwn,
692 lps->uarg = uarg;
693 lps->alpa = 0;
694 lps->pdusz = pdusz;
695 lps->pwwn = pwwn;
696 lps->nwwn = nwwn;
697 lps->fdisc = BFA_TRUE;
698 lps->auth_en = BFA_FALSE;
699 bfa_sm_send_event(lps, BFA_LPS_SM_LOGIN);
706 bfa_lps_flogo(struct bfa_lps_s *lps)
708 bfa_sm_send_event(lps, BFA_LPS_SM_LOGOUT);
715 bfa_lps_fdisclogo(struct bfa_lps_s *lps)
717 bfa_sm_send_event(lps, BFA_LPS_SM_LOGOUT);
725 bfa_lps_discard(struct bfa_lps_s *lps)
727 bfa_sm_send_event(lps, BFA_LPS_SM_OFFLINE);
734 bfa_lps_get_tag(struct bfa_lps_s *lps)
736 return lps->lp_tag;
746 struct bfa_lps_s *lps;
749 for (i = 0, lps = mod->lps_arr; i < mod->num_lps; i++, lps++) {
750 if (lps->lp_pid == pid)
751 return lps->lp_tag;
762 bfa_lps_is_npiv_en(struct bfa_lps_s *lps)
764 return lps->npiv_en;
771 bfa_lps_is_fport(struct bfa_lps_s *lps)
773 return lps->fport;
780 bfa_lps_is_brcd_fabric(struct bfa_lps_s *lps)
782 return lps->brcd_switch;
788 bfa_lps_is_authreq(struct bfa_lps_s *lps)
790 return lps->auth_req;
794 bfa_lps_get_extstatus(struct bfa_lps_s *lps)
796 return lps->ext_status;
803 bfa_lps_get_pid(struct bfa_lps_s *lps)
805 return lps->lp_pid;
812 bfa_lps_get_peer_bbcredit(struct bfa_lps_s *lps)
814 return lps->pr_bbcred;
821 bfa_lps_get_peer_pwwn(struct bfa_lps_s *lps)
823 return lps->pr_pwwn;
830 bfa_lps_get_peer_nwwn(struct bfa_lps_s *lps)
832 return lps->pr_nwwn;
839 bfa_lps_get_lsrjt_rsn(struct bfa_lps_s *lps)
841 return lps->lsrjt_rsn;
848 bfa_lps_get_lsrjt_expl(struct bfa_lps_s *lps)
850 return lps->lsrjt_expl;
857 bfa_lps_get_lp_mac(struct bfa_lps_s *lps)
859 return lps->lp_mac;