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_initdone(struct bfa_s
*bfa
);
45 static void bfa_lps_detach(struct bfa_s
*bfa
);
46 static void bfa_lps_start(struct bfa_s
*bfa
);
47 static void bfa_lps_stop(struct bfa_s
*bfa
);
48 static void bfa_lps_iocdisable(struct bfa_s
*bfa
);
49 static void bfa_lps_login_rsp(struct bfa_s
*bfa
,
50 struct bfi_lps_login_rsp_s
*rsp
);
51 static void bfa_lps_logout_rsp(struct bfa_s
*bfa
,
52 struct bfi_lps_logout_rsp_s
*rsp
);
53 static void bfa_lps_reqq_resume(void *lps_arg
);
54 static void bfa_lps_free(struct bfa_lps_s
*lps
);
55 static void bfa_lps_send_login(struct bfa_lps_s
*lps
);
56 static void bfa_lps_send_logout(struct bfa_lps_s
*lps
);
57 static void bfa_lps_login_comp(struct bfa_lps_s
*lps
);
58 static void bfa_lps_logout_comp(struct bfa_lps_s
*lps
);
59 static void bfa_lps_cvl_event(struct bfa_lps_s
*lps
);
62 * lps_pvt BFA LPS private functions
66 BFA_LPS_SM_LOGIN
= 1, /* login request from user */
67 BFA_LPS_SM_LOGOUT
= 2, /* logout request from user */
68 BFA_LPS_SM_FWRSP
= 3, /* f/w response to login/logout */
69 BFA_LPS_SM_RESUME
= 4, /* space present in reqq queue */
70 BFA_LPS_SM_DELETE
= 5, /* lps delete from user */
71 BFA_LPS_SM_OFFLINE
= 6, /* Link is offline */
72 BFA_LPS_SM_RX_CVL
= 7, /* Rx clear virtual link */
75 static void bfa_lps_sm_init(struct bfa_lps_s
*lps
, enum bfa_lps_event event
);
76 static void bfa_lps_sm_login(struct bfa_lps_s
*lps
, enum bfa_lps_event event
);
77 static void bfa_lps_sm_loginwait(struct bfa_lps_s
*lps
,
78 enum bfa_lps_event event
);
79 static void bfa_lps_sm_online(struct bfa_lps_s
*lps
, enum bfa_lps_event event
);
80 static void bfa_lps_sm_logout(struct bfa_lps_s
*lps
, enum bfa_lps_event event
);
81 static void bfa_lps_sm_logowait(struct bfa_lps_s
*lps
,
82 enum bfa_lps_event event
);
85 * Init state -- no login
88 bfa_lps_sm_init(struct bfa_lps_s
*lps
, enum bfa_lps_event event
)
90 bfa_trc(lps
->bfa
, lps
->lp_tag
);
91 bfa_trc(lps
->bfa
, event
);
94 case BFA_LPS_SM_LOGIN
:
95 if (bfa_reqq_full(lps
->bfa
, lps
->reqq
)) {
96 bfa_sm_set_state(lps
, bfa_lps_sm_loginwait
);
97 bfa_reqq_wait(lps
->bfa
, lps
->reqq
, &lps
->wqe
);
99 bfa_sm_set_state(lps
, bfa_lps_sm_login
);
100 bfa_lps_send_login(lps
);
103 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
104 BFA_PL_EID_LOGIN
, 0, "FDISC Request");
106 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
107 BFA_PL_EID_LOGIN
, 0, "FLOGI Request");
110 case BFA_LPS_SM_LOGOUT
:
111 bfa_lps_logout_comp(lps
);
114 case BFA_LPS_SM_DELETE
:
118 case BFA_LPS_SM_RX_CVL
:
119 case BFA_LPS_SM_OFFLINE
:
122 case BFA_LPS_SM_FWRSP
:
123 /* Could happen when fabric detects loopback and discards
124 * the lps request. Fw will eventually sent out the timeout
130 bfa_sm_fault(lps
->bfa
, event
);
135 * login is in progress -- awaiting response from firmware
138 bfa_lps_sm_login(struct bfa_lps_s
*lps
, enum bfa_lps_event event
)
140 bfa_trc(lps
->bfa
, lps
->lp_tag
);
141 bfa_trc(lps
->bfa
, event
);
144 case BFA_LPS_SM_FWRSP
:
145 if (lps
->status
== BFA_STATUS_OK
) {
146 bfa_sm_set_state(lps
, bfa_lps_sm_online
);
148 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
149 BFA_PL_EID_LOGIN
, 0, "FDISC Accept");
151 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
152 BFA_PL_EID_LOGIN
, 0, "FLOGI Accept");
154 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
156 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
158 "FDISC Fail (RJT or timeout)");
160 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
162 "FLOGI Fail (RJT or timeout)");
164 bfa_lps_login_comp(lps
);
167 case BFA_LPS_SM_OFFLINE
:
168 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
172 bfa_sm_fault(lps
->bfa
, event
);
177 * login pending - awaiting space in request queue
180 bfa_lps_sm_loginwait(struct bfa_lps_s
*lps
, enum bfa_lps_event event
)
182 bfa_trc(lps
->bfa
, lps
->lp_tag
);
183 bfa_trc(lps
->bfa
, event
);
186 case BFA_LPS_SM_RESUME
:
187 bfa_sm_set_state(lps
, bfa_lps_sm_login
);
190 case BFA_LPS_SM_OFFLINE
:
191 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
192 bfa_reqq_wcancel(&lps
->wqe
);
195 case BFA_LPS_SM_RX_CVL
:
197 * Login was not even sent out; so when getting out
198 * of this state, it will appear like a login retry
199 * after Clear virtual link
204 bfa_sm_fault(lps
->bfa
, event
);
212 bfa_lps_sm_online(struct bfa_lps_s
*lps
, enum bfa_lps_event event
)
214 bfa_trc(lps
->bfa
, lps
->lp_tag
);
215 bfa_trc(lps
->bfa
, event
);
218 case BFA_LPS_SM_LOGOUT
:
219 if (bfa_reqq_full(lps
->bfa
, lps
->reqq
)) {
220 bfa_sm_set_state(lps
, bfa_lps_sm_logowait
);
221 bfa_reqq_wait(lps
->bfa
, lps
->reqq
, &lps
->wqe
);
223 bfa_sm_set_state(lps
, bfa_lps_sm_logout
);
224 bfa_lps_send_logout(lps
);
226 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
227 BFA_PL_EID_LOGO
, 0, "Logout");
230 case BFA_LPS_SM_RX_CVL
:
231 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
233 /* Let the vport module know about this event */
234 bfa_lps_cvl_event(lps
);
235 bfa_plog_str(lps
->bfa
->plog
, BFA_PL_MID_LPS
,
236 BFA_PL_EID_FIP_FCF_CVL
, 0, "FCF Clear Virt. Link Rx");
239 case BFA_LPS_SM_OFFLINE
:
240 case BFA_LPS_SM_DELETE
:
241 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
245 bfa_sm_fault(lps
->bfa
, event
);
250 * logout in progress - awaiting firmware response
253 bfa_lps_sm_logout(struct bfa_lps_s
*lps
, enum bfa_lps_event event
)
255 bfa_trc(lps
->bfa
, lps
->lp_tag
);
256 bfa_trc(lps
->bfa
, event
);
259 case BFA_LPS_SM_FWRSP
:
260 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
261 bfa_lps_logout_comp(lps
);
264 case BFA_LPS_SM_OFFLINE
:
265 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
269 bfa_sm_fault(lps
->bfa
, event
);
274 * logout pending -- awaiting space in request queue
277 bfa_lps_sm_logowait(struct bfa_lps_s
*lps
, enum bfa_lps_event event
)
279 bfa_trc(lps
->bfa
, lps
->lp_tag
);
280 bfa_trc(lps
->bfa
, event
);
283 case BFA_LPS_SM_RESUME
:
284 bfa_sm_set_state(lps
, bfa_lps_sm_logout
);
285 bfa_lps_send_logout(lps
);
288 case BFA_LPS_SM_OFFLINE
:
289 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
290 bfa_reqq_wcancel(&lps
->wqe
);
294 bfa_sm_fault(lps
->bfa
, event
);
301 * lps_pvt BFA LPS private functions
305 * return memory requirement
308 bfa_lps_meminfo(struct bfa_iocfc_cfg_s
*cfg
, u32
*ndm_len
, u32
*dm_len
)
310 if (cfg
->drvcfg
.min_cfg
)
311 *ndm_len
+= sizeof(struct bfa_lps_s
) * BFA_LPS_MIN_LPORTS
;
313 *ndm_len
+= sizeof(struct bfa_lps_s
) * BFA_LPS_MAX_LPORTS
;
317 * bfa module attach at initialization time
320 bfa_lps_attach(struct bfa_s
*bfa
, void *bfad
, struct bfa_iocfc_cfg_s
*cfg
,
321 struct bfa_meminfo_s
*meminfo
, struct bfa_pcidev_s
*pcidev
)
323 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
324 struct bfa_lps_s
*lps
;
327 bfa_os_memset(mod
, 0, sizeof(struct bfa_lps_mod_s
));
328 mod
->num_lps
= BFA_LPS_MAX_LPORTS
;
329 if (cfg
->drvcfg
.min_cfg
)
330 mod
->num_lps
= BFA_LPS_MIN_LPORTS
;
332 mod
->num_lps
= BFA_LPS_MAX_LPORTS
;
333 mod
->lps_arr
= lps
= (struct bfa_lps_s
*) bfa_meminfo_kva(meminfo
);
335 bfa_meminfo_kva(meminfo
) += mod
->num_lps
* sizeof(struct bfa_lps_s
);
337 INIT_LIST_HEAD(&mod
->lps_free_q
);
338 INIT_LIST_HEAD(&mod
->lps_active_q
);
340 for (i
= 0; i
< mod
->num_lps
; i
++, lps
++) {
342 lps
->lp_tag
= (u8
) i
;
343 lps
->reqq
= BFA_REQQ_LPS
;
344 bfa_reqq_winit(&lps
->wqe
, bfa_lps_reqq_resume
, lps
);
345 list_add_tail(&lps
->qe
, &mod
->lps_free_q
);
350 bfa_lps_initdone(struct bfa_s
*bfa
)
355 bfa_lps_detach(struct bfa_s
*bfa
)
360 bfa_lps_start(struct bfa_s
*bfa
)
365 bfa_lps_stop(struct bfa_s
*bfa
)
370 * IOC in disabled state -- consider all lps offline
373 bfa_lps_iocdisable(struct bfa_s
*bfa
)
375 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
376 struct bfa_lps_s
*lps
;
377 struct list_head
*qe
, *qen
;
379 list_for_each_safe(qe
, qen
, &mod
->lps_active_q
) {
380 lps
= (struct bfa_lps_s
*) qe
;
381 bfa_sm_send_event(lps
, BFA_LPS_SM_OFFLINE
);
386 * Firmware login response
389 bfa_lps_login_rsp(struct bfa_s
*bfa
, struct bfi_lps_login_rsp_s
*rsp
)
391 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
392 struct bfa_lps_s
*lps
;
394 bfa_assert(rsp
->lp_tag
< mod
->num_lps
);
395 lps
= BFA_LPS_FROM_TAG(mod
, rsp
->lp_tag
);
397 lps
->status
= rsp
->status
;
398 switch (rsp
->status
) {
400 lps
->fport
= rsp
->f_port
;
401 lps
->npiv_en
= rsp
->npiv_en
;
402 lps
->lp_pid
= rsp
->lp_pid
;
403 lps
->pr_bbcred
= bfa_os_ntohs(rsp
->bb_credit
);
404 lps
->pr_pwwn
= rsp
->port_name
;
405 lps
->pr_nwwn
= rsp
->node_name
;
406 lps
->auth_req
= rsp
->auth_req
;
407 lps
->lp_mac
= rsp
->lp_mac
;
408 lps
->brcd_switch
= rsp
->brcd_switch
;
409 lps
->fcf_mac
= rsp
->fcf_mac
;
413 case BFA_STATUS_FABRIC_RJT
:
414 lps
->lsrjt_rsn
= rsp
->lsrjt_rsn
;
415 lps
->lsrjt_expl
= rsp
->lsrjt_expl
;
419 case BFA_STATUS_EPROTOCOL
:
420 lps
->ext_status
= rsp
->ext_status
;
425 /* Nothing to do with other status */
429 bfa_sm_send_event(lps
, BFA_LPS_SM_FWRSP
);
433 * Firmware logout response
436 bfa_lps_logout_rsp(struct bfa_s
*bfa
, struct bfi_lps_logout_rsp_s
*rsp
)
438 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
439 struct bfa_lps_s
*lps
;
441 bfa_assert(rsp
->lp_tag
< mod
->num_lps
);
442 lps
= BFA_LPS_FROM_TAG(mod
, rsp
->lp_tag
);
444 bfa_sm_send_event(lps
, BFA_LPS_SM_FWRSP
);
448 * Firmware received a Clear virtual link request (for FCoE)
451 bfa_lps_rx_cvl_event(struct bfa_s
*bfa
, struct bfi_lps_cvl_event_s
*cvl
)
453 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
454 struct bfa_lps_s
*lps
;
456 lps
= BFA_LPS_FROM_TAG(mod
, cvl
->lp_tag
);
458 bfa_sm_send_event(lps
, BFA_LPS_SM_RX_CVL
);
462 * Space is available in request queue, resume queueing request to firmware.
465 bfa_lps_reqq_resume(void *lps_arg
)
467 struct bfa_lps_s
*lps
= lps_arg
;
469 bfa_sm_send_event(lps
, BFA_LPS_SM_RESUME
);
473 * lps is freed -- triggered by vport delete
476 bfa_lps_free(struct bfa_lps_s
*lps
)
478 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(lps
->bfa
);
481 list_add_tail(&lps
->qe
, &mod
->lps_free_q
);
485 * send login request to firmware
488 bfa_lps_send_login(struct bfa_lps_s
*lps
)
490 struct bfi_lps_login_req_s
*m
;
492 m
= bfa_reqq_next(lps
->bfa
, lps
->reqq
);
495 bfi_h2i_set(m
->mh
, BFI_MC_LPS
, BFI_LPS_H2I_LOGIN_REQ
,
496 bfa_lpuid(lps
->bfa
));
498 m
->lp_tag
= lps
->lp_tag
;
500 m
->pdu_size
= bfa_os_htons(lps
->pdusz
);
503 m
->fdisc
= lps
->fdisc
;
504 m
->auth_en
= lps
->auth_en
;
506 bfa_reqq_produce(lps
->bfa
, lps
->reqq
);
510 * send logout request to firmware
513 bfa_lps_send_logout(struct bfa_lps_s
*lps
)
515 struct bfi_lps_logout_req_s
*m
;
517 m
= bfa_reqq_next(lps
->bfa
, lps
->reqq
);
520 bfi_h2i_set(m
->mh
, BFI_MC_LPS
, BFI_LPS_H2I_LOGOUT_REQ
,
521 bfa_lpuid(lps
->bfa
));
523 m
->lp_tag
= lps
->lp_tag
;
524 m
->port_name
= lps
->pwwn
;
525 bfa_reqq_produce(lps
->bfa
, lps
->reqq
);
529 * Indirect login completion handler for non-fcs
532 bfa_lps_login_comp_cb(void *arg
, bfa_boolean_t complete
)
534 struct bfa_lps_s
*lps
= arg
;
540 bfa_cb_lps_fdisc_comp(lps
->bfa
->bfad
, lps
->uarg
, lps
->status
);
542 bfa_cb_lps_flogi_comp(lps
->bfa
->bfad
, lps
->uarg
, lps
->status
);
546 * Login completion handler -- direct call for fcs, queue for others
549 bfa_lps_login_comp(struct bfa_lps_s
*lps
)
551 if (!lps
->bfa
->fcs
) {
552 bfa_cb_queue(lps
->bfa
, &lps
->hcb_qe
,
553 bfa_lps_login_comp_cb
, lps
);
558 bfa_cb_lps_fdisc_comp(lps
->bfa
->bfad
, lps
->uarg
, lps
->status
);
560 bfa_cb_lps_flogi_comp(lps
->bfa
->bfad
, lps
->uarg
, lps
->status
);
564 * Indirect logout completion handler for non-fcs
567 bfa_lps_logout_comp_cb(void *arg
, bfa_boolean_t complete
)
569 struct bfa_lps_s
*lps
= arg
;
575 bfa_cb_lps_fdisclogo_comp(lps
->bfa
->bfad
, lps
->uarg
);
577 bfa_cb_lps_flogo_comp(lps
->bfa
->bfad
, lps
->uarg
);
581 * Logout completion handler -- direct call for fcs, queue for others
584 bfa_lps_logout_comp(struct bfa_lps_s
*lps
)
586 if (!lps
->bfa
->fcs
) {
587 bfa_cb_queue(lps
->bfa
, &lps
->hcb_qe
,
588 bfa_lps_logout_comp_cb
, lps
);
592 bfa_cb_lps_fdisclogo_comp(lps
->bfa
->bfad
, lps
->uarg
);
594 bfa_cb_lps_flogo_comp(lps
->bfa
->bfad
, lps
->uarg
);
598 * Clear virtual link completion handler for non-fcs
601 bfa_lps_cvl_event_cb(void *arg
, bfa_boolean_t complete
)
603 struct bfa_lps_s
*lps
= arg
;
608 /* Clear virtual link to base port will result in link down */
610 bfa_cb_lps_cvl_event(lps
->bfa
->bfad
, lps
->uarg
);
614 * Received Clear virtual link event --direct call for fcs,
618 bfa_lps_cvl_event(struct bfa_lps_s
*lps
)
620 if (!lps
->bfa
->fcs
) {
621 bfa_cb_queue(lps
->bfa
, &lps
->hcb_qe
, bfa_lps_cvl_event_cb
,
626 /* Clear virtual link to base port will result in link down */
628 bfa_cb_lps_cvl_event(lps
->bfa
->bfad
, lps
->uarg
);
632 bfa_lps_get_max_vport(struct bfa_s
*bfa
)
634 if (bfa_ioc_devid(&bfa
->ioc
) == BFA_PCI_DEVICE_ID_CT
)
635 return BFA_LPS_MAX_VPORTS_SUPP_CT
;
637 return BFA_LPS_MAX_VPORTS_SUPP_CB
;
641 * lps_public BFA LPS public functions
645 * Allocate a lport srvice tag.
648 bfa_lps_alloc(struct bfa_s
*bfa
)
650 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
651 struct bfa_lps_s
*lps
= NULL
;
653 bfa_q_deq(&mod
->lps_free_q
, &lps
);
658 list_add_tail(&lps
->qe
, &mod
->lps_active_q
);
660 bfa_sm_set_state(lps
, bfa_lps_sm_init
);
665 * Free lport service tag. This can be called anytime after an alloc.
666 * No need to wait for any pending login/logout completions.
669 bfa_lps_delete(struct bfa_lps_s
*lps
)
671 bfa_sm_send_event(lps
, BFA_LPS_SM_DELETE
);
675 * Initiate a lport login.
678 bfa_lps_flogi(struct bfa_lps_s
*lps
, void *uarg
, u8 alpa
, u16 pdusz
,
679 wwn_t pwwn
, wwn_t nwwn
, bfa_boolean_t auth_en
)
686 lps
->fdisc
= BFA_FALSE
;
687 lps
->auth_en
= auth_en
;
688 bfa_sm_send_event(lps
, BFA_LPS_SM_LOGIN
);
692 * Initiate a lport fdisc login.
695 bfa_lps_fdisc(struct bfa_lps_s
*lps
, void *uarg
, u16 pdusz
, wwn_t pwwn
,
703 lps
->fdisc
= BFA_TRUE
;
704 lps
->auth_en
= BFA_FALSE
;
705 bfa_sm_send_event(lps
, BFA_LPS_SM_LOGIN
);
709 * Initiate a lport logout (flogi).
712 bfa_lps_flogo(struct bfa_lps_s
*lps
)
714 bfa_sm_send_event(lps
, BFA_LPS_SM_LOGOUT
);
718 * Initiate a lport FDSIC logout.
721 bfa_lps_fdisclogo(struct bfa_lps_s
*lps
)
723 bfa_sm_send_event(lps
, BFA_LPS_SM_LOGOUT
);
727 * Discard a pending login request -- should be called only for
728 * link down handling.
731 bfa_lps_discard(struct bfa_lps_s
*lps
)
733 bfa_sm_send_event(lps
, BFA_LPS_SM_OFFLINE
);
737 * Return lport services tag
740 bfa_lps_get_tag(struct bfa_lps_s
*lps
)
746 * Return lport services tag given the pid
749 bfa_lps_get_tag_from_pid(struct bfa_s
*bfa
, u32 pid
)
751 struct bfa_lps_mod_s
*mod
= BFA_LPS_MOD(bfa
);
752 struct bfa_lps_s
*lps
;
755 for (i
= 0, lps
= mod
->lps_arr
; i
< mod
->num_lps
; i
++, lps
++) {
756 if (lps
->lp_pid
== pid
)
760 /* Return base port tag anyway */
765 * return if fabric login indicates support for NPIV
768 bfa_lps_is_npiv_en(struct bfa_lps_s
*lps
)
774 * Return TRUE if attached to F-Port, else return FALSE
777 bfa_lps_is_fport(struct bfa_lps_s
*lps
)
783 * Return TRUE if attached to a Brocade Fabric
786 bfa_lps_is_brcd_fabric(struct bfa_lps_s
*lps
)
788 return lps
->brcd_switch
;
791 * return TRUE if authentication is required
794 bfa_lps_is_authreq(struct bfa_lps_s
*lps
)
796 return lps
->auth_req
;
800 bfa_lps_get_extstatus(struct bfa_lps_s
*lps
)
802 return lps
->ext_status
;
806 * return port id assigned to the lport
809 bfa_lps_get_pid(struct bfa_lps_s
*lps
)
815 * Return bb_credit assigned in FLOGI response
818 bfa_lps_get_peer_bbcredit(struct bfa_lps_s
*lps
)
820 return lps
->pr_bbcred
;
824 * Return peer port name
827 bfa_lps_get_peer_pwwn(struct bfa_lps_s
*lps
)
833 * Return peer node name
836 bfa_lps_get_peer_nwwn(struct bfa_lps_s
*lps
)
842 * return reason code if login request is rejected
845 bfa_lps_get_lsrjt_rsn(struct bfa_lps_s
*lps
)
847 return lps
->lsrjt_rsn
;
851 * return explanation code if login request is rejected
854 bfa_lps_get_lsrjt_expl(struct bfa_lps_s
*lps
)
856 return lps
->lsrjt_expl
;
860 * Return fpma/spma MAC for lport
863 bfa_lps_get_lp_mac(struct bfa_lps_s
*lps
)
869 * LPS firmware message class handler.
872 bfa_lps_isr(struct bfa_s
*bfa
, struct bfi_msg_s
*m
)
874 union bfi_lps_i2h_msg_u msg
;
876 bfa_trc(bfa
, m
->mhdr
.msg_id
);
879 switch (m
->mhdr
.msg_id
) {
880 case BFI_LPS_H2I_LOGIN_RSP
:
881 bfa_lps_login_rsp(bfa
, msg
.login_rsp
);
884 case BFI_LPS_H2I_LOGOUT_RSP
:
885 bfa_lps_logout_rsp(bfa
, msg
.logout_rsp
);
888 case BFI_LPS_H2I_CVL_EVENT
:
889 bfa_lps_rx_cvl_event(bfa
, msg
.cvl_event
);
893 bfa_trc(bfa
, m
->mhdr
.msg_id
);