25 #define call_cmdq_ent_cbfn(_cmdq_ent, _status) \
27 bfa_msgq_cmdcbfn_t cbfn; \
29 cbfn = (_cmdq_ent)->cbfn; \
30 cbarg = (_cmdq_ent)->cbarg; \
31 (_cmdq_ent)->cbfn = NULL; \
32 (_cmdq_ent)->cbarg = NULL; \
34 cbfn(cbarg, (_status)); \
39 static void bfa_msgq_cmdq_copy_rsp(
struct bfa_msgq_cmdq *cmdq);
99 bfa_wc_down(&cmdq->
msgq->init_wc);
154 bfa_msgq_cmdq_dbell(cmdq);
184 bfa_msgq_cmdq_dbell_ready(
void *
arg)
198 dbell->
mh.mtag.i2htok = 0;
202 bfa_msgq_cmdq_dbell_ready, cmdq)) {
203 bfa_msgq_cmdq_dbell_ready(cmdq);
216 dst = (
u8 *)cmdq->
addr.kva;
222 memcpy(dst, src, to_copy);
226 dst = (
u8 *)cmdq->
addr.kva;
249 __cmd_copy(cmdq, cmd);
262 bfa_msgq_cmdq_copy_next(
void *
arg)
267 bfa_msgq_cmdq_copy_rsp(cmdq);
279 bfa_msgq_cmdq_copy_rsp(cmdq);
303 bfa_msgq_cmdq_copy_next, cmdq)) {
304 bfa_msgq_cmdq_copy_next(cmdq);
364 bfa_wc_down(&rspq->
msgq->init_wc);
412 bfa_msgq_rspq_dbell(rspq);
442 bfa_msgq_rspq_dbell_ready(
void *arg)
456 dbell->
mh.mtag.i2htok = 0;
460 bfa_msgq_rspq_dbell_ready, rspq)) {
461 bfa_msgq_rspq_dbell_ready(rspq);
477 rspq_qe = (
u8 *)rspq->
addr.kva;
505 bfa_msgq_init_rsp(
struct bfa_msgq *msgq,
513 bfa_msgq_init(
void *arg)
521 msgq_cfg->
mh.mtag.i2htok = 0;
536 switch (msg->
mh.msg_id) {
538 bfa_msgq_init_rsp(msgq, msg);
542 bfa_msgq_rspq_pi_update(&msgq->
rspq, msg);
546 bfa_msgq_cmdq_ci_update(&msgq->
cmdq, msg);
550 bfa_msgq_cmdq_copy_req(&msgq->
cmdq, msg);
565 bfa_wc_init(&msgq->
init_wc, bfa_msgq_init, msgq);
598 msgq->
cmdq.addr.kva = kva;
599 msgq->
cmdq.addr.pa = pa;
604 msgq->
rspq.addr.kva = kva;
605 msgq->
rspq.addr.pa = pa;
613 bfa_msgq_cmdq_attach(&msgq->
cmdq, msgq);
614 bfa_msgq_rspq_attach(&msgq->
rspq, msgq);
626 msgq->
rspq.rsphdlr[
mc].cbfn = cbfn;
627 msgq->
rspq.rsphdlr[
mc].cbarg = cbarg;
635 __cmd_copy(&msgq->
cmdq, cmd);
647 size_t len = buf_len;
653 src = (
u8 *)rspq->
addr.kva;
659 len : BFI_MSGQ_RSP_ENTRY_SIZE;
660 memcpy(dst, src, to_copy);
664 src = (
u8 *)rspq->
addr.kva;
665 src += (ci * BFI_MSGQ_RSP_ENTRY_SIZE);