2 * Copyright (c) 2005-2009 Brocade Communications Systems, Inc.
6 * Linux driver for Brocade Fibre Channel Host Bus Adapter.
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License (GPL) Version 2 as
10 * published by the Free Software Foundation
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
19 #include <bfi/bfi_lps.h>
20 #include <cs/bfa_debug.h>
21 #include <defs/bfa_defs_pci.h>
23 BFA_TRC_FILE(HAL
, LPS
);
26 #define BFA_LPS_MIN_LPORTS (1)
27 #define BFA_LPS_MAX_LPORTS (256)
30 * Maximum Vports supported per physical port or vf.
32 #define BFA_LPS_MAX_VPORTS_SUPP_CB 255
33 #define BFA_LPS_MAX_VPORTS_SUPP_CT 190
36 * forward declarations
38 static void bfa_lps_meminfo(struct bfa_iocfc_cfg_s
*cfg
, u32
*ndm_len
,
40 static void bfa_lps_attach(struct bfa_s
*bfa
, void *bfad
,
41 struct bfa_iocfc_cfg_s
*cfg
,
42 struct bfa_meminfo_s
*meminfo
,
43 struct bfa_pcidev_s
*pcidev
);
44 static void bfa_lps_detach(struct bfa_s
*bfa
);
45 static void bfa_lps_start(struct bfa_s
*bfa
);
46 static void bfa_lps_stop(struct bfa_s
*bfa
);
47 static void bfa_lps_iocdisable(struct bfa_s
*bfa
);
48 static void bfa_lps_login_rsp(struct bfa_s
*bfa
,
49 struct bfi_lps_login_rsp_s
*rsp
);
50 static void bfa_lps_logout_rsp(struct bfa_s
*bfa
,
51 struct bfi_lps_logout_rsp_s
*rsp
);
52 static void bfa_lps_reqq_resume(void *lps_arg
);
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
);
61 * lps_pvt BFA LPS private functions
65 BFA_LPS_SM_LOGIN
= 1, /* login request from user */
66 BFA_LPS_SM_LOGOUT
= 2, /* logout request from user */
67 BFA_LPS_SM_FWRSP
= 3, /* f/w response to login/logout */
68 BFA_LPS_SM_RESUME
= 4, /* space present in reqq queue */
69 BFA_LPS_SM_DELETE
= 5, /* lps delete from user */
70 BFA_LPS_SM_OFFLINE
= 6, /* Link is offline */
71 BFA_LPS_SM_RX_CVL
= 7, /* Rx clear virtual link */
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
,
77 enum bfa_lps_event event
);
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
,
81 enum bfa_lps_event event
);
84 * Init state -- no login
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
);
93 case BFA_LPS_SM_LOGIN
:
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
);
102 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
103 BFA_PL_EID_LOGIN
, 0, "FDISC Request");
105 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
106 BFA_PL_EID_LOGIN
, 0, "FLOGI Request");
109 case BFA_LPS_SM_LOGOUT
:
110 bfa_lps_logout_comp(lps
);
113 case BFA_LPS_SM_DELETE
:
117 case BFA_LPS_SM_RX_CVL
:
118 case BFA_LPS_SM_OFFLINE
:
121 case BFA_LPS_SM_FWRSP
:
122 /* Could happen when fabric detects loopback and discards
123 * the lps request. Fw will eventually sent out the timeout
129 bfa_sm_fault(lps
->bfa
, event
);
134 * login is in progress -- awaiting response from firmware
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
);
143 case BFA_LPS_SM_FWRSP
:
144 if (lps
->status
== BFA_STATUS_OK
) {
145 bfa_sm_set_state(lps
, bfa_lps_sm_online
);
147 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
148 BFA_PL_EID_LOGIN
, 0, "FDISC Accept");
150 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
151 BFA_PL_EID_LOGIN
, 0, "FLOGI Accept");
153 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
155 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
157 "FDISC Fail (RJT or timeout)");
159 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
161 "FLOGI Fail (RJT or timeout)");
163 bfa_lps_login_comp(lps
);
166 case BFA_LPS_SM_OFFLINE
:
167 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
171 bfa_sm_fault(lps
->bfa
, event
);
176 * login pending - awaiting space in request queue
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
);
185 case BFA_LPS_SM_RESUME
:
186 bfa_sm_set_state(lps
, bfa_lps_sm_login
);
189 case BFA_LPS_SM_OFFLINE
:
190 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
191 bfa_reqq_wcancel(&lps
->wqe
);
194 case BFA_LPS_SM_RX_CVL
:
196 * Login was not even sent out; so when getting out
197 * of this state, it will appear like a login retry
198 * after Clear virtual link
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
);
217 case BFA_LPS_SM_LOGOUT
:
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
,
226 BFA_PL_EID_LOGO
, 0, "Logout");
229 case BFA_LPS_SM_RX_CVL
:
230 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
232 /* Let the vport module know about this event */
233 bfa_lps_cvl_event(lps
);
234 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
235 BFA_PL_EID_FIP_FCF_CVL
, 0, "FCF Clear Virt. Link Rx");
238 case BFA_LPS_SM_OFFLINE
:
239 case BFA_LPS_SM_DELETE
:
240 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
244 bfa_sm_fault(lps
->bfa
, event
);
249 * logout in progress - awaiting firmware response
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
);
258 case BFA_LPS_SM_FWRSP
:
259 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
260 bfa_lps_logout_comp(lps
);
263 case BFA_LPS_SM_OFFLINE
:
264 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
268 bfa_sm_fault(lps
->bfa
, event
);
273 * logout pending -- awaiting space in request queue
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
);
282 case BFA_LPS_SM_RESUME
:
283 bfa_sm_set_state(lps
, bfa_lps_sm_logout
);
284 bfa_lps_send_logout(lps
);
287 case BFA_LPS_SM_OFFLINE
:
288 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
289 bfa_reqq_wcancel(&lps
->wqe
);
293 bfa_sm_fault(lps
->bfa
, event
);
300 * lps_pvt BFA LPS private functions
304 * return memory requirement
307 bfa_lps_meminfo(struct bfa_iocfc_cfg_s
*cfg
, u32
*ndm_len
, u32
*dm_len
)
309 if (cfg
->drvcfg
.min_cfg
)
310 *ndm_len
+= sizeof(struct bfa_lps_s
) * BFA_LPS_MIN_LPORTS
;
312 *ndm_len
+= sizeof(struct bfa_lps_s
) * BFA_LPS_MAX_LPORTS
;
316 * bfa module attach at initialization time
319 bfa_lps_attach(struct bfa_s
*bfa
, void *bfad
, struct bfa_iocfc_cfg_s
*cfg
,
320 struct bfa_meminfo_s
*meminfo
, struct bfa_pcidev_s
*pcidev
)
322 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
323 struct bfa_lps_s
*lps
;
326 bfa_os_memset(mod
, 0, sizeof(struct bfa_lps_mod_s
));
327 mod
->num_lps
= BFA_LPS_MAX_LPORTS
;
328 if (cfg
->drvcfg
.min_cfg
)
329 mod
->num_lps
= BFA_LPS_MIN_LPORTS
;
331 mod
->num_lps
= BFA_LPS_MAX_LPORTS
;
332 mod
->lps_arr
= lps
= (struct bfa_lps_s
*) bfa_meminfo_kva(meminfo
);
334 bfa_meminfo_kva(meminfo
) += mod
->num_lps
* sizeof(struct bfa_lps_s
);
336 INIT_LIST_HEAD(&mod
->lps_free_q
);
337 INIT_LIST_HEAD(&mod
->lps_active_q
);
339 for (i
= 0; i
< mod
->num_lps
; i
++, lps
++) {
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
);
349 bfa_lps_detach(struct bfa_s
*bfa
)
354 bfa_lps_start(struct bfa_s
*bfa
)
359 bfa_lps_stop(struct bfa_s
*bfa
)
364 * IOC in disabled state -- consider all lps offline
367 bfa_lps_iocdisable(struct bfa_s
*bfa
)
369 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
370 struct bfa_lps_s
*lps
;
371 struct list_head
*qe
, *qen
;
373 list_for_each_safe(qe
, qen
, &mod
->lps_active_q
) {
374 lps
= (struct bfa_lps_s
*) qe
;
375 bfa_sm_send_event(lps
, BFA_LPS_SM_OFFLINE
);
380 * Firmware login response
383 bfa_lps_login_rsp(struct bfa_s
*bfa
, struct bfi_lps_login_rsp_s
*rsp
)
385 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
386 struct bfa_lps_s
*lps
;
388 bfa_assert(rsp
->lp_tag
< mod
->num_lps
);
389 lps
= BFA_LPS_FROM_TAG(mod
, rsp
->lp_tag
);
391 lps
->status
= rsp
->status
;
392 switch (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
;
407 case BFA_STATUS_FABRIC_RJT
:
408 lps
->lsrjt_rsn
= rsp
->lsrjt_rsn
;
409 lps
->lsrjt_expl
= rsp
->lsrjt_expl
;
413 case BFA_STATUS_EPROTOCOL
:
414 lps
->ext_status
= rsp
->ext_status
;
419 /* Nothing to do with other status */
423 bfa_sm_send_event(lps
, BFA_LPS_SM_FWRSP
);
427 * Firmware logout response
430 bfa_lps_logout_rsp(struct bfa_s
*bfa
, struct bfi_lps_logout_rsp_s
*rsp
)
432 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
433 struct bfa_lps_s
*lps
;
435 bfa_assert(rsp
->lp_tag
< mod
->num_lps
);
436 lps
= BFA_LPS_FROM_TAG(mod
, rsp
->lp_tag
);
438 bfa_sm_send_event(lps
, BFA_LPS_SM_FWRSP
);
442 * Firmware received a Clear virtual link request (for FCoE)
445 bfa_lps_rx_cvl_event(struct bfa_s
*bfa
, struct bfi_lps_cvl_event_s
*cvl
)
447 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
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
);
456 * Space is available in request queue, resume queueing request to firmware.
459 bfa_lps_reqq_resume(void *lps_arg
)
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
);
475 list_add_tail(&lps
->qe
, &mod
->lps_free_q
);
479 * send login request to firmware
482 bfa_lps_send_login(struct bfa_lps_s
*lps
)
484 struct bfi_lps_login_req_s
*m
;
486 m
= bfa_reqq_next(lps
->bfa
, lps
->reqq
);
489 bfi_h2i_set(m
->mh
, BFI_MC_LPS
, BFI_LPS_H2I_LOGIN_REQ
,
490 bfa_lpuid(lps
->bfa
));
492 m
->lp_tag
= lps
->lp_tag
;
494 m
->pdu_size
= bfa_os_htons(lps
->pdusz
);
497 m
->fdisc
= lps
->fdisc
;
498 m
->auth_en
= lps
->auth_en
;
500 bfa_reqq_produce(lps
->bfa
, lps
->reqq
);
504 * send logout request to firmware
507 bfa_lps_send_logout(struct bfa_lps_s
*lps
)
509 struct bfi_lps_logout_req_s
*m
;
511 m
= bfa_reqq_next(lps
->bfa
, lps
->reqq
);
514 bfi_h2i_set(m
->mh
, BFI_MC_LPS
, BFI_LPS_H2I_LOGOUT_REQ
,
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
);
523 * Indirect login completion handler for non-fcs
526 bfa_lps_login_comp_cb(void *arg
, bfa_boolean_t complete
)
528 struct bfa_lps_s
*lps
= arg
;
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
);
540 * Login completion handler -- direct call for fcs, queue for others
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
);
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
);
558 * Indirect logout completion handler for non-fcs
561 bfa_lps_logout_comp_cb(void *arg
, bfa_boolean_t complete
)
563 struct bfa_lps_s
*lps
= arg
;
569 bfa_cb_lps_fdisclogo_comp(lps
->bfa
->bfad
, lps
->uarg
);
571 bfa_cb_lps_flogo_comp(lps
->bfa
->bfad
, lps
->uarg
);
575 * Logout completion handler -- direct call for fcs, queue for others
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
);
586 bfa_cb_lps_fdisclogo_comp(lps
->bfa
->bfad
, lps
->uarg
);
588 bfa_cb_lps_flogo_comp(lps
->bfa
->bfad
, lps
->uarg
);
592 * Clear virtual link completion handler for non-fcs
595 bfa_lps_cvl_event_cb(void *arg
, bfa_boolean_t complete
)
597 struct bfa_lps_s
*lps
= arg
;
602 /* Clear virtual link to base port will result in link down */
604 bfa_cb_lps_cvl_event(lps
->bfa
->bfad
, lps
->uarg
);
608 * Received Clear virtual link event --direct call for fcs,
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
,
620 /* Clear virtual link to base port will result in link down */
622 bfa_cb_lps_cvl_event(lps
->bfa
->bfad
, lps
->uarg
);
626 bfa_lps_get_max_vport(struct bfa_s
*bfa
)
628 if (bfa_ioc_devid(&bfa
->ioc
) == BFA_PCI_DEVICE_ID_CT
)
629 return BFA_LPS_MAX_VPORTS_SUPP_CT
;
631 return BFA_LPS_MAX_VPORTS_SUPP_CB
;
635 * lps_public BFA LPS public functions
639 * Allocate a lport srvice tag.
642 bfa_lps_alloc(struct bfa_s
*bfa
)
644 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
645 struct bfa_lps_s
*lps
= NULL
;
647 bfa_q_deq(&mod
->lps_free_q
, &lps
);
652 list_add_tail(&lps
->qe
, &mod
->lps_active_q
);
654 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
659 * Free lport service tag. This can be called anytime after an alloc.
660 * No need to wait for any pending login/logout completions.
663 bfa_lps_delete(struct bfa_lps_s
*lps
)
665 bfa_sm_send_event(lps
, BFA_LPS_SM_DELETE
);
669 * Initiate a lport login.
672 bfa_lps_flogi(struct bfa_lps_s
*lps
, void *uarg
, u8 alpa
, u16 pdusz
,
673 wwn_t pwwn
, wwn_t nwwn
, bfa_boolean_t auth_en
)
680 lps
->fdisc
= BFA_FALSE
;
681 lps
->auth_en
= auth_en
;
682 bfa_sm_send_event(lps
, BFA_LPS_SM_LOGIN
);
686 * Initiate a lport fdisc login.
689 bfa_lps_fdisc(struct bfa_lps_s
*lps
, void *uarg
, u16 pdusz
, wwn_t pwwn
,
697 lps
->fdisc
= BFA_TRUE
;
698 lps
->auth_en
= BFA_FALSE
;
699 bfa_sm_send_event(lps
, BFA_LPS_SM_LOGIN
);
703 * Initiate a lport logout (flogi).
706 bfa_lps_flogo(struct bfa_lps_s
*lps
)
708 bfa_sm_send_event(lps
, BFA_LPS_SM_LOGOUT
);
712 * Initiate a lport FDSIC logout.
715 bfa_lps_fdisclogo(struct bfa_lps_s
*lps
)
717 bfa_sm_send_event(lps
, BFA_LPS_SM_LOGOUT
);
721 * Discard a pending login request -- should be called only for
722 * link down handling.
725 bfa_lps_discard(struct bfa_lps_s
*lps
)
727 bfa_sm_send_event(lps
, BFA_LPS_SM_OFFLINE
);
731 * Return lport services tag
734 bfa_lps_get_tag(struct bfa_lps_s
*lps
)
740 * Return lport services tag given the pid
743 bfa_lps_get_tag_from_pid(struct bfa_s
*bfa
, u32 pid
)
745 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
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
)
754 /* Return base port tag anyway */
759 * return if fabric login indicates support for NPIV
762 bfa_lps_is_npiv_en(struct bfa_lps_s
*lps
)
768 * Return TRUE if attached to F-Port, else return FALSE
771 bfa_lps_is_fport(struct bfa_lps_s
*lps
)
777 * Return TRUE if attached to a Brocade Fabric
780 bfa_lps_is_brcd_fabric(struct bfa_lps_s
*lps
)
782 return lps
->brcd_switch
;
785 * return TRUE if authentication is required
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
;
800 * return port id assigned to the lport
803 bfa_lps_get_pid(struct bfa_lps_s
*lps
)
809 * Return bb_credit assigned in FLOGI response
812 bfa_lps_get_peer_bbcredit(struct bfa_lps_s
*lps
)
814 return lps
->pr_bbcred
;
818 * Return peer port name
821 bfa_lps_get_peer_pwwn(struct bfa_lps_s
*lps
)
827 * Return peer node name
830 bfa_lps_get_peer_nwwn(struct bfa_lps_s
*lps
)
836 * return reason code if login request is rejected
839 bfa_lps_get_lsrjt_rsn(struct bfa_lps_s
*lps
)
841 return lps
->lsrjt_rsn
;
845 * return explanation code if login request is rejected
848 bfa_lps_get_lsrjt_expl(struct bfa_lps_s
*lps
)
850 return lps
->lsrjt_expl
;
854 * Return fpma/spma MAC for lport
857 bfa_lps_get_lp_mac(struct bfa_lps_s
*lps
)
863 * LPS firmware message class handler.
866 bfa_lps_isr(struct bfa_s
*bfa
, struct bfi_msg_s
*m
)
868 union bfi_lps_i2h_msg_u msg
;
870 bfa_trc(bfa
, m
->mhdr
.msg_id
);
873 switch (m
->mhdr
.msg_id
) {
874 case BFI_LPS_H2I_LOGIN_RSP
:
875 bfa_lps_login_rsp(bfa
, msg
.login_rsp
);
878 case BFI_LPS_H2I_LOGOUT_RSP
:
879 bfa_lps_logout_rsp(bfa
, msg
.logout_rsp
);
882 case BFI_LPS_H2I_CVL_EVENT
:
883 bfa_lps_rx_cvl_event(bfa
, msg
.cvl_event
);
887 bfa_trc(bfa
, m
->mhdr
.msg_id
);