1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (c) 2005-2014 Brocade Communications Systems, Inc.
4 * Copyright (c) 2014- QLogic Corporation.
8 * Linux driver for QLogic BR-series Fibre Channel Host Bus Adapter.
12 #include "bfa_defs_svc.h"
18 BFA_TRC_FILE(CNA
, PORT
);
21 bfa_port_stats_swap(struct bfa_port_s
*port
, union bfa_port_stats_u
*stats
)
23 u32
*dip
= (u32
*) stats
;
27 for (i
= 0; i
< sizeof(union bfa_port_stats_u
)/sizeof(u32
);
32 dip
[i
] = be32_to_cpu(t0
);
33 dip
[i
+ 1] = be32_to_cpu(t1
);
35 dip
[i
] = be32_to_cpu(t1
);
36 dip
[i
+ 1] = be32_to_cpu(t0
);
42 * bfa_port_enable_isr()
45 * @param[in] port - Pointer to the port module
46 * status - Return status from the f/w
51 bfa_port_enable_isr(struct bfa_port_s
*port
, bfa_status_t status
)
53 bfa_trc(port
, status
);
54 port
->endis_pending
= BFA_FALSE
;
55 port
->endis_cbfn(port
->endis_cbarg
, status
);
59 * bfa_port_disable_isr()
62 * @param[in] port - Pointer to the port module
63 * status - Return status from the f/w
68 bfa_port_disable_isr(struct bfa_port_s
*port
, bfa_status_t status
)
70 bfa_trc(port
, status
);
71 port
->endis_pending
= BFA_FALSE
;
72 port
->endis_cbfn(port
->endis_cbarg
, status
);
76 * bfa_port_get_stats_isr()
79 * @param[in] port - Pointer to the Port module
80 * status - Return status from the f/w
85 bfa_port_get_stats_isr(struct bfa_port_s
*port
, bfa_status_t status
)
87 port
->stats_status
= status
;
88 port
->stats_busy
= BFA_FALSE
;
90 if (status
== BFA_STATUS_OK
) {
91 memcpy(port
->stats
, port
->stats_dma
.kva
,
92 sizeof(union bfa_port_stats_u
));
93 bfa_port_stats_swap(port
, port
->stats
);
95 port
->stats
->fc
.secs_reset
= ktime_get_seconds() - port
->stats_reset_time
;
98 if (port
->stats_cbfn
) {
99 port
->stats_cbfn(port
->stats_cbarg
, status
);
100 port
->stats_cbfn
= NULL
;
105 * bfa_port_clear_stats_isr()
108 * @param[in] port - Pointer to the Port module
109 * status - Return status from the f/w
114 bfa_port_clear_stats_isr(struct bfa_port_s
*port
, bfa_status_t status
)
116 port
->stats_status
= status
;
117 port
->stats_busy
= BFA_FALSE
;
120 * re-initialize time stamp for stats reset
122 port
->stats_reset_time
= ktime_get_seconds();
124 if (port
->stats_cbfn
) {
125 port
->stats_cbfn(port
->stats_cbarg
, status
);
126 port
->stats_cbfn
= NULL
;
134 * @param[in] Pointer to the Port module data structure.
139 bfa_port_isr(void *cbarg
, struct bfi_mbmsg_s
*m
)
141 struct bfa_port_s
*port
= (struct bfa_port_s
*) cbarg
;
142 union bfi_port_i2h_msg_u
*i2hmsg
;
144 i2hmsg
= (union bfi_port_i2h_msg_u
*) m
;
145 bfa_trc(port
, m
->mh
.msg_id
);
147 switch (m
->mh
.msg_id
) {
148 case BFI_PORT_I2H_ENABLE_RSP
:
149 if (port
->endis_pending
== BFA_FALSE
)
151 bfa_port_enable_isr(port
, i2hmsg
->enable_rsp
.status
);
154 case BFI_PORT_I2H_DISABLE_RSP
:
155 if (port
->endis_pending
== BFA_FALSE
)
157 bfa_port_disable_isr(port
, i2hmsg
->disable_rsp
.status
);
160 case BFI_PORT_I2H_GET_STATS_RSP
:
161 /* Stats busy flag is still set? (may be cmd timed out) */
162 if (port
->stats_busy
== BFA_FALSE
)
164 bfa_port_get_stats_isr(port
, i2hmsg
->getstats_rsp
.status
);
167 case BFI_PORT_I2H_CLEAR_STATS_RSP
:
168 if (port
->stats_busy
== BFA_FALSE
)
170 bfa_port_clear_stats_isr(port
, i2hmsg
->clearstats_rsp
.status
);
184 * @return Size of DMA region
187 bfa_port_meminfo(void)
189 return BFA_ROUNDUP(sizeof(union bfa_port_stats_u
), BFA_DMA_ALIGN_SZ
);
193 * bfa_port_mem_claim()
196 * @param[in] port Port module pointer
197 * dma_kva Kernel Virtual Address of Port DMA Memory
198 * dma_pa Physical Address of Port DMA Memory
203 bfa_port_mem_claim(struct bfa_port_s
*port
, u8
*dma_kva
, u64 dma_pa
)
205 port
->stats_dma
.kva
= dma_kva
;
206 port
->stats_dma
.pa
= dma_pa
;
212 * Send the Port enable request to the f/w
214 * @param[in] Pointer to the Port module data structure.
219 bfa_port_enable(struct bfa_port_s
*port
, bfa_port_endis_cbfn_t cbfn
,
222 struct bfi_port_generic_req_s
*m
;
224 /* If port is PBC disabled, return error */
225 if (port
->pbc_disabled
) {
226 bfa_trc(port
, BFA_STATUS_PBC
);
227 return BFA_STATUS_PBC
;
230 if (bfa_ioc_is_disabled(port
->ioc
)) {
231 bfa_trc(port
, BFA_STATUS_IOC_DISABLED
);
232 return BFA_STATUS_IOC_DISABLED
;
235 if (!bfa_ioc_is_operational(port
->ioc
)) {
236 bfa_trc(port
, BFA_STATUS_IOC_FAILURE
);
237 return BFA_STATUS_IOC_FAILURE
;
240 /* if port is d-port enabled, return error */
241 if (port
->dport_enabled
) {
242 bfa_trc(port
, BFA_STATUS_DPORT_ERR
);
243 return BFA_STATUS_DPORT_ERR
;
246 if (port
->endis_pending
) {
247 bfa_trc(port
, BFA_STATUS_DEVBUSY
);
248 return BFA_STATUS_DEVBUSY
;
251 m
= (struct bfi_port_generic_req_s
*) port
->endis_mb
.msg
;
254 port
->endis_cbfn
= cbfn
;
255 port
->endis_cbarg
= cbarg
;
256 port
->endis_pending
= BFA_TRUE
;
258 bfi_h2i_set(m
->mh
, BFI_MC_PORT
, BFI_PORT_H2I_ENABLE_REQ
,
259 bfa_ioc_portid(port
->ioc
));
260 bfa_ioc_mbox_queue(port
->ioc
, &port
->endis_mb
);
262 return BFA_STATUS_OK
;
268 * Send the Port disable request to the f/w
270 * @param[in] Pointer to the Port module data structure.
275 bfa_port_disable(struct bfa_port_s
*port
, bfa_port_endis_cbfn_t cbfn
,
278 struct bfi_port_generic_req_s
*m
;
280 /* If port is PBC disabled, return error */
281 if (port
->pbc_disabled
) {
282 bfa_trc(port
, BFA_STATUS_PBC
);
283 return BFA_STATUS_PBC
;
286 if (bfa_ioc_is_disabled(port
->ioc
)) {
287 bfa_trc(port
, BFA_STATUS_IOC_DISABLED
);
288 return BFA_STATUS_IOC_DISABLED
;
291 if (!bfa_ioc_is_operational(port
->ioc
)) {
292 bfa_trc(port
, BFA_STATUS_IOC_FAILURE
);
293 return BFA_STATUS_IOC_FAILURE
;
296 /* if port is d-port enabled, return error */
297 if (port
->dport_enabled
) {
298 bfa_trc(port
, BFA_STATUS_DPORT_ERR
);
299 return BFA_STATUS_DPORT_ERR
;
302 if (port
->endis_pending
) {
303 bfa_trc(port
, BFA_STATUS_DEVBUSY
);
304 return BFA_STATUS_DEVBUSY
;
307 m
= (struct bfi_port_generic_req_s
*) port
->endis_mb
.msg
;
310 port
->endis_cbfn
= cbfn
;
311 port
->endis_cbarg
= cbarg
;
312 port
->endis_pending
= BFA_TRUE
;
314 bfi_h2i_set(m
->mh
, BFI_MC_PORT
, BFI_PORT_H2I_DISABLE_REQ
,
315 bfa_ioc_portid(port
->ioc
));
316 bfa_ioc_mbox_queue(port
->ioc
, &port
->endis_mb
);
318 return BFA_STATUS_OK
;
322 * bfa_port_get_stats()
324 * Send the request to the f/w to fetch Port statistics.
326 * @param[in] Pointer to the Port module data structure.
331 bfa_port_get_stats(struct bfa_port_s
*port
, union bfa_port_stats_u
*stats
,
332 bfa_port_stats_cbfn_t cbfn
, void *cbarg
)
334 struct bfi_port_get_stats_req_s
*m
;
336 if (!bfa_ioc_is_operational(port
->ioc
)) {
337 bfa_trc(port
, BFA_STATUS_IOC_FAILURE
);
338 return BFA_STATUS_IOC_FAILURE
;
341 if (port
->stats_busy
) {
342 bfa_trc(port
, BFA_STATUS_DEVBUSY
);
343 return BFA_STATUS_DEVBUSY
;
346 m
= (struct bfi_port_get_stats_req_s
*) port
->stats_mb
.msg
;
349 port
->stats_cbfn
= cbfn
;
350 port
->stats_cbarg
= cbarg
;
351 port
->stats_busy
= BFA_TRUE
;
352 bfa_dma_be_addr_set(m
->dma_addr
, port
->stats_dma
.pa
);
354 bfi_h2i_set(m
->mh
, BFI_MC_PORT
, BFI_PORT_H2I_GET_STATS_REQ
,
355 bfa_ioc_portid(port
->ioc
));
356 bfa_ioc_mbox_queue(port
->ioc
, &port
->stats_mb
);
358 return BFA_STATUS_OK
;
362 * bfa_port_clear_stats()
365 * @param[in] Pointer to the Port module data structure.
370 bfa_port_clear_stats(struct bfa_port_s
*port
, bfa_port_stats_cbfn_t cbfn
,
373 struct bfi_port_generic_req_s
*m
;
375 if (!bfa_ioc_is_operational(port
->ioc
)) {
376 bfa_trc(port
, BFA_STATUS_IOC_FAILURE
);
377 return BFA_STATUS_IOC_FAILURE
;
380 if (port
->stats_busy
) {
381 bfa_trc(port
, BFA_STATUS_DEVBUSY
);
382 return BFA_STATUS_DEVBUSY
;
385 m
= (struct bfi_port_generic_req_s
*) port
->stats_mb
.msg
;
387 port
->stats_cbfn
= cbfn
;
388 port
->stats_cbarg
= cbarg
;
389 port
->stats_busy
= BFA_TRUE
;
391 bfi_h2i_set(m
->mh
, BFI_MC_PORT
, BFI_PORT_H2I_CLEAR_STATS_REQ
,
392 bfa_ioc_portid(port
->ioc
));
393 bfa_ioc_mbox_queue(port
->ioc
, &port
->stats_mb
);
395 return BFA_STATUS_OK
;
401 * Port module IOC event handler
403 * @param[in] Pointer to the Port module data structure.
404 * @param[in] IOC event structure
409 bfa_port_notify(void *arg
, enum bfa_ioc_event_e event
)
411 struct bfa_port_s
*port
= (struct bfa_port_s
*) arg
;
414 case BFA_IOC_E_DISABLED
:
415 case BFA_IOC_E_FAILED
:
416 /* Fail any pending get_stats/clear_stats requests */
417 if (port
->stats_busy
) {
418 if (port
->stats_cbfn
)
419 port
->stats_cbfn(port
->stats_cbarg
,
421 port
->stats_cbfn
= NULL
;
422 port
->stats_busy
= BFA_FALSE
;
425 /* Clear any enable/disable is pending */
426 if (port
->endis_pending
) {
427 if (port
->endis_cbfn
)
428 port
->endis_cbfn(port
->endis_cbarg
,
430 port
->endis_cbfn
= NULL
;
431 port
->endis_pending
= BFA_FALSE
;
434 /* clear D-port mode */
435 if (port
->dport_enabled
)
436 bfa_port_set_dportenabled(port
, BFA_FALSE
);
447 * @param[in] port - Pointer to the Port module data structure
448 * ioc - Pointer to the ioc module data structure
449 * dev - Pointer to the device driver module data structure
450 * The device driver specific mbox ISR functions have
451 * this pointer as one of the parameters.
457 bfa_port_attach(struct bfa_port_s
*port
, struct bfa_ioc_s
*ioc
,
458 void *dev
, struct bfa_trc_mod_s
*trcmod
)
464 port
->trcmod
= trcmod
;
466 port
->stats_busy
= BFA_FALSE
;
467 port
->endis_pending
= BFA_FALSE
;
468 port
->stats_cbfn
= NULL
;
469 port
->endis_cbfn
= NULL
;
470 port
->pbc_disabled
= BFA_FALSE
;
471 port
->dport_enabled
= BFA_FALSE
;
473 bfa_ioc_mbox_regisr(port
->ioc
, BFI_MC_PORT
, bfa_port_isr
, port
);
474 bfa_q_qe_init(&port
->ioc_notify
);
475 bfa_ioc_notify_init(&port
->ioc_notify
, bfa_port_notify
, port
);
476 list_add_tail(&port
->ioc_notify
.qe
, &port
->ioc
->notify_q
);
479 * initialize time stamp for stats reset
481 port
->stats_reset_time
= ktime_get_seconds();
487 * bfa_port_set_dportenabled();
489 * Port module- set pbc disabled flag
491 * @param[in] port - Pointer to the Port module data structure
496 bfa_port_set_dportenabled(struct bfa_port_s
*port
, bfa_boolean_t enabled
)
498 port
->dport_enabled
= enabled
;
502 * CEE module specific definitions
506 * bfa_cee_get_attr_isr()
508 * @brief CEE ISR for get-attributes responses from f/w
510 * @param[in] cee - Pointer to the CEE module
511 * status - Return status from the f/w
516 bfa_cee_get_attr_isr(struct bfa_cee_s
*cee
, bfa_status_t status
)
518 struct bfa_cee_lldp_cfg_s
*lldp_cfg
= &cee
->attr
->lldp_remote
;
520 cee
->get_attr_status
= status
;
522 if (status
== BFA_STATUS_OK
) {
524 memcpy(cee
->attr
, cee
->attr_dma
.kva
,
525 sizeof(struct bfa_cee_attr_s
));
526 lldp_cfg
->time_to_live
= be16_to_cpu(lldp_cfg
->time_to_live
);
527 lldp_cfg
->enabled_system_cap
=
528 be16_to_cpu(lldp_cfg
->enabled_system_cap
);
530 cee
->get_attr_pending
= BFA_FALSE
;
531 if (cee
->cbfn
.get_attr_cbfn
) {
533 cee
->cbfn
.get_attr_cbfn(cee
->cbfn
.get_attr_cbarg
, status
);
538 * bfa_cee_get_stats_isr()
540 * @brief CEE ISR for get-stats responses from f/w
542 * @param[in] cee - Pointer to the CEE module
543 * status - Return status from the f/w
548 bfa_cee_get_stats_isr(struct bfa_cee_s
*cee
, bfa_status_t status
)
553 cee
->get_stats_status
= status
;
555 if (status
== BFA_STATUS_OK
) {
557 memcpy(cee
->stats
, cee
->stats_dma
.kva
,
558 sizeof(struct bfa_cee_stats_s
));
559 /* swap the cee stats */
560 buffer
= (u32
*)cee
->stats
;
561 for (i
= 0; i
< (sizeof(struct bfa_cee_stats_s
) /
563 buffer
[i
] = cpu_to_be32(buffer
[i
]);
565 cee
->get_stats_pending
= BFA_FALSE
;
567 if (cee
->cbfn
.get_stats_cbfn
) {
569 cee
->cbfn
.get_stats_cbfn(cee
->cbfn
.get_stats_cbarg
, status
);
574 * bfa_cee_reset_stats_isr()
576 * @brief CEE ISR for reset-stats responses from f/w
578 * @param[in] cee - Pointer to the CEE module
579 * status - Return status from the f/w
584 bfa_cee_reset_stats_isr(struct bfa_cee_s
*cee
, bfa_status_t status
)
586 cee
->reset_stats_status
= status
;
587 cee
->reset_stats_pending
= BFA_FALSE
;
588 if (cee
->cbfn
.reset_stats_cbfn
)
589 cee
->cbfn
.reset_stats_cbfn(cee
->cbfn
.reset_stats_cbarg
, status
);
595 * @brief Returns the size of the DMA memory needed by CEE module
599 * @return Size of DMA region
602 bfa_cee_meminfo(void)
604 return BFA_ROUNDUP(sizeof(struct bfa_cee_attr_s
), BFA_DMA_ALIGN_SZ
) +
605 BFA_ROUNDUP(sizeof(struct bfa_cee_stats_s
), BFA_DMA_ALIGN_SZ
);
609 * bfa_cee_mem_claim()
611 * @brief Initialized CEE DMA Memory
613 * @param[in] cee CEE module pointer
614 * dma_kva Kernel Virtual Address of CEE DMA Memory
615 * dma_pa Physical Address of CEE DMA Memory
620 bfa_cee_mem_claim(struct bfa_cee_s
*cee
, u8
*dma_kva
, u64 dma_pa
)
622 cee
->attr_dma
.kva
= dma_kva
;
623 cee
->attr_dma
.pa
= dma_pa
;
624 cee
->stats_dma
.kva
= dma_kva
+ BFA_ROUNDUP(
625 sizeof(struct bfa_cee_attr_s
), BFA_DMA_ALIGN_SZ
);
626 cee
->stats_dma
.pa
= dma_pa
+ BFA_ROUNDUP(
627 sizeof(struct bfa_cee_attr_s
), BFA_DMA_ALIGN_SZ
);
628 cee
->attr
= (struct bfa_cee_attr_s
*) dma_kva
;
629 cee
->stats
= (struct bfa_cee_stats_s
*) (dma_kva
+ BFA_ROUNDUP(
630 sizeof(struct bfa_cee_attr_s
), BFA_DMA_ALIGN_SZ
));
637 * Send the request to the f/w to fetch CEE attributes.
639 * @param[in] Pointer to the CEE module data structure.
645 bfa_cee_get_attr(struct bfa_cee_s
*cee
, struct bfa_cee_attr_s
*attr
,
646 bfa_cee_get_attr_cbfn_t cbfn
, void *cbarg
)
648 struct bfi_cee_get_req_s
*cmd
;
650 WARN_ON((cee
== NULL
) || (cee
->ioc
== NULL
));
652 if (!bfa_ioc_is_operational(cee
->ioc
)) {
654 return BFA_STATUS_IOC_FAILURE
;
656 if (cee
->get_attr_pending
== BFA_TRUE
) {
658 return BFA_STATUS_DEVBUSY
;
660 cee
->get_attr_pending
= BFA_TRUE
;
661 cmd
= (struct bfi_cee_get_req_s
*) cee
->get_cfg_mb
.msg
;
663 cee
->cbfn
.get_attr_cbfn
= cbfn
;
664 cee
->cbfn
.get_attr_cbarg
= cbarg
;
665 bfi_h2i_set(cmd
->mh
, BFI_MC_CEE
, BFI_CEE_H2I_GET_CFG_REQ
,
666 bfa_ioc_portid(cee
->ioc
));
667 bfa_dma_be_addr_set(cmd
->dma_addr
, cee
->attr_dma
.pa
);
668 bfa_ioc_mbox_queue(cee
->ioc
, &cee
->get_cfg_mb
);
670 return BFA_STATUS_OK
;
674 * bfa_cee_get_stats()
677 * Send the request to the f/w to fetch CEE statistics.
679 * @param[in] Pointer to the CEE module data structure.
685 bfa_cee_get_stats(struct bfa_cee_s
*cee
, struct bfa_cee_stats_s
*stats
,
686 bfa_cee_get_stats_cbfn_t cbfn
, void *cbarg
)
688 struct bfi_cee_get_req_s
*cmd
;
690 WARN_ON((cee
== NULL
) || (cee
->ioc
== NULL
));
692 if (!bfa_ioc_is_operational(cee
->ioc
)) {
694 return BFA_STATUS_IOC_FAILURE
;
696 if (cee
->get_stats_pending
== BFA_TRUE
) {
698 return BFA_STATUS_DEVBUSY
;
700 cee
->get_stats_pending
= BFA_TRUE
;
701 cmd
= (struct bfi_cee_get_req_s
*) cee
->get_stats_mb
.msg
;
703 cee
->cbfn
.get_stats_cbfn
= cbfn
;
704 cee
->cbfn
.get_stats_cbarg
= cbarg
;
705 bfi_h2i_set(cmd
->mh
, BFI_MC_CEE
, BFI_CEE_H2I_GET_STATS_REQ
,
706 bfa_ioc_portid(cee
->ioc
));
707 bfa_dma_be_addr_set(cmd
->dma_addr
, cee
->stats_dma
.pa
);
708 bfa_ioc_mbox_queue(cee
->ioc
, &cee
->get_stats_mb
);
710 return BFA_STATUS_OK
;
714 * bfa_cee_reset_stats()
716 * @brief Clears CEE Stats in the f/w.
718 * @param[in] Pointer to the CEE module data structure.
724 bfa_cee_reset_stats(struct bfa_cee_s
*cee
,
725 bfa_cee_reset_stats_cbfn_t cbfn
, void *cbarg
)
727 struct bfi_cee_reset_stats_s
*cmd
;
729 WARN_ON((cee
== NULL
) || (cee
->ioc
== NULL
));
730 if (!bfa_ioc_is_operational(cee
->ioc
)) {
732 return BFA_STATUS_IOC_FAILURE
;
734 if (cee
->reset_stats_pending
== BFA_TRUE
) {
736 return BFA_STATUS_DEVBUSY
;
738 cee
->reset_stats_pending
= BFA_TRUE
;
739 cmd
= (struct bfi_cee_reset_stats_s
*) cee
->reset_stats_mb
.msg
;
740 cee
->cbfn
.reset_stats_cbfn
= cbfn
;
741 cee
->cbfn
.reset_stats_cbarg
= cbarg
;
742 bfi_h2i_set(cmd
->mh
, BFI_MC_CEE
, BFI_CEE_H2I_RESET_STATS
,
743 bfa_ioc_portid(cee
->ioc
));
744 bfa_ioc_mbox_queue(cee
->ioc
, &cee
->reset_stats_mb
);
746 return BFA_STATUS_OK
;
752 * @brief Handles Mail-box interrupts for CEE module.
754 * @param[in] Pointer to the CEE module data structure.
760 bfa_cee_isr(void *cbarg
, struct bfi_mbmsg_s
*m
)
762 union bfi_cee_i2h_msg_u
*msg
;
763 struct bfi_cee_get_rsp_s
*get_rsp
;
764 struct bfa_cee_s
*cee
= (struct bfa_cee_s
*) cbarg
;
765 msg
= (union bfi_cee_i2h_msg_u
*) m
;
766 get_rsp
= (struct bfi_cee_get_rsp_s
*) m
;
767 bfa_trc(cee
, msg
->mh
.msg_id
);
768 switch (msg
->mh
.msg_id
) {
769 case BFI_CEE_I2H_GET_CFG_RSP
:
770 bfa_trc(cee
, get_rsp
->cmd_status
);
771 bfa_cee_get_attr_isr(cee
, get_rsp
->cmd_status
);
773 case BFI_CEE_I2H_GET_STATS_RSP
:
774 bfa_cee_get_stats_isr(cee
, get_rsp
->cmd_status
);
776 case BFI_CEE_I2H_RESET_STATS_RSP
:
777 bfa_cee_reset_stats_isr(cee
, get_rsp
->cmd_status
);
787 * @brief CEE module IOC event handler.
789 * @param[in] Pointer to the CEE module data structure.
790 * @param[in] IOC event type
796 bfa_cee_notify(void *arg
, enum bfa_ioc_event_e event
)
798 struct bfa_cee_s
*cee
= (struct bfa_cee_s
*) arg
;
803 case BFA_IOC_E_DISABLED
:
804 case BFA_IOC_E_FAILED
:
805 if (cee
->get_attr_pending
== BFA_TRUE
) {
806 cee
->get_attr_status
= BFA_STATUS_FAILED
;
807 cee
->get_attr_pending
= BFA_FALSE
;
808 if (cee
->cbfn
.get_attr_cbfn
) {
809 cee
->cbfn
.get_attr_cbfn(
810 cee
->cbfn
.get_attr_cbarg
,
814 if (cee
->get_stats_pending
== BFA_TRUE
) {
815 cee
->get_stats_status
= BFA_STATUS_FAILED
;
816 cee
->get_stats_pending
= BFA_FALSE
;
817 if (cee
->cbfn
.get_stats_cbfn
) {
818 cee
->cbfn
.get_stats_cbfn(
819 cee
->cbfn
.get_stats_cbarg
,
823 if (cee
->reset_stats_pending
== BFA_TRUE
) {
824 cee
->reset_stats_status
= BFA_STATUS_FAILED
;
825 cee
->reset_stats_pending
= BFA_FALSE
;
826 if (cee
->cbfn
.reset_stats_cbfn
) {
827 cee
->cbfn
.reset_stats_cbfn(
828 cee
->cbfn
.reset_stats_cbarg
,
842 * @brief CEE module-attach API
844 * @param[in] cee - Pointer to the CEE module data structure
845 * ioc - Pointer to the ioc module data structure
846 * dev - Pointer to the device driver module data structure
847 * The device driver specific mbox ISR functions have
848 * this pointer as one of the parameters.
853 bfa_cee_attach(struct bfa_cee_s
*cee
, struct bfa_ioc_s
*ioc
,
856 WARN_ON(cee
== NULL
);
860 bfa_ioc_mbox_regisr(cee
->ioc
, BFI_MC_CEE
, bfa_cee_isr
, cee
);
861 bfa_q_qe_init(&cee
->ioc_notify
);
862 bfa_ioc_notify_init(&cee
->ioc_notify
, bfa_cee_notify
, cee
);
863 list_add_tail(&cee
->ioc_notify
.qe
, &cee
->ioc
->notify_q
);