Lines Matching refs:rspq

309 static void bfa_msgq_rspq_dbell(struct bfa_msgq_rspq *rspq);
320 bfa_fsm_state_decl(rspq, stopped, struct bfa_msgq_rspq, enum rspq_event);
321 bfa_fsm_state_decl(rspq, init_wait, struct bfa_msgq_rspq,
323 bfa_fsm_state_decl(rspq, ready, struct bfa_msgq_rspq, enum rspq_event);
324 bfa_fsm_state_decl(rspq, dbell_wait, struct bfa_msgq_rspq,
328 rspq_sm_stopped_entry(struct bfa_msgq_rspq *rspq) in rspq_sm_stopped_entry() argument
330 rspq->producer_index = 0; in rspq_sm_stopped_entry()
331 rspq->consumer_index = 0; in rspq_sm_stopped_entry()
332 rspq->flags = 0; in rspq_sm_stopped_entry()
336 rspq_sm_stopped(struct bfa_msgq_rspq *rspq, enum rspq_event event) in rspq_sm_stopped() argument
340 bfa_fsm_set_state(rspq, rspq_sm_init_wait); in rspq_sm_stopped()
354 rspq_sm_init_wait_entry(struct bfa_msgq_rspq *rspq) in rspq_sm_init_wait_entry() argument
356 bfa_wc_down(&rspq->msgq->init_wc); in rspq_sm_init_wait_entry()
360 rspq_sm_init_wait(struct bfa_msgq_rspq *rspq, enum rspq_event event) in rspq_sm_init_wait() argument
365 bfa_fsm_set_state(rspq, rspq_sm_stopped); in rspq_sm_init_wait()
369 bfa_fsm_set_state(rspq, rspq_sm_ready); in rspq_sm_init_wait()
378 rspq_sm_ready_entry(struct bfa_msgq_rspq *rspq) in rspq_sm_ready_entry() argument
383 rspq_sm_ready(struct bfa_msgq_rspq *rspq, enum rspq_event event) in rspq_sm_ready() argument
388 bfa_fsm_set_state(rspq, rspq_sm_stopped); in rspq_sm_ready()
392 bfa_fsm_set_state(rspq, rspq_sm_dbell_wait); in rspq_sm_ready()
401 rspq_sm_dbell_wait_entry(struct bfa_msgq_rspq *rspq) in rspq_sm_dbell_wait_entry() argument
403 if (!bfa_nw_ioc_is_disabled(rspq->msgq->ioc)) in rspq_sm_dbell_wait_entry()
404 bfa_msgq_rspq_dbell(rspq); in rspq_sm_dbell_wait_entry()
408 rspq_sm_dbell_wait(struct bfa_msgq_rspq *rspq, enum rspq_event event) in rspq_sm_dbell_wait() argument
413 bfa_fsm_set_state(rspq, rspq_sm_stopped); in rspq_sm_dbell_wait()
417 rspq->flags |= BFA_MSGQ_RSPQ_F_DB_UPDATE; in rspq_sm_dbell_wait()
421 if (rspq->flags & BFA_MSGQ_RSPQ_F_DB_UPDATE) { in rspq_sm_dbell_wait()
422 rspq->flags &= ~BFA_MSGQ_RSPQ_F_DB_UPDATE; in rspq_sm_dbell_wait()
423 bfa_fsm_set_state(rspq, rspq_sm_dbell_wait); in rspq_sm_dbell_wait()
425 bfa_fsm_set_state(rspq, rspq_sm_ready); in rspq_sm_dbell_wait()
436 struct bfa_msgq_rspq *rspq = (struct bfa_msgq_rspq *)arg; in bfa_msgq_rspq_dbell_ready() local
437 bfa_fsm_send_event(rspq, RSPQ_E_DB_READY); in bfa_msgq_rspq_dbell_ready()
441 bfa_msgq_rspq_dbell(struct bfa_msgq_rspq *rspq) in bfa_msgq_rspq_dbell() argument
444 (struct bfi_msgq_h2i_db *)(&rspq->dbell_mb.msg[0]); in bfa_msgq_rspq_dbell()
449 dbell->idx.rspq_ci = htons(rspq->consumer_index); in bfa_msgq_rspq_dbell()
451 if (!bfa_nw_ioc_mbox_queue(rspq->msgq->ioc, &rspq->dbell_mb, in bfa_msgq_rspq_dbell()
452 bfa_msgq_rspq_dbell_ready, rspq)) { in bfa_msgq_rspq_dbell()
453 bfa_msgq_rspq_dbell_ready(rspq); in bfa_msgq_rspq_dbell()
458 bfa_msgq_rspq_pi_update(struct bfa_msgq_rspq *rspq, struct bfi_mbmsg *mb) in bfa_msgq_rspq_pi_update() argument
466 rspq->producer_index = ntohs(dbell->idx.rspq_pi); in bfa_msgq_rspq_pi_update()
468 while (rspq->consumer_index != rspq->producer_index) { in bfa_msgq_rspq_pi_update()
469 rspq_qe = (u8 *)rspq->addr.kva; in bfa_msgq_rspq_pi_update()
470 rspq_qe += (rspq->consumer_index * BFI_MSGQ_RSP_ENTRY_SIZE); in bfa_msgq_rspq_pi_update()
476 if ((mc >= BFI_MC_MAX) || (rspq->rsphdlr[mc].cbfn == NULL)) in bfa_msgq_rspq_pi_update()
479 (rspq->rsphdlr[mc].cbfn)(rspq->rsphdlr[mc].cbarg, msghdr); in bfa_msgq_rspq_pi_update()
481 BFA_MSGQ_INDX_ADD(rspq->consumer_index, num_entries, in bfa_msgq_rspq_pi_update()
482 rspq->depth); in bfa_msgq_rspq_pi_update()
485 bfa_fsm_send_event(rspq, RSPQ_E_RESP); in bfa_msgq_rspq_pi_update()
489 bfa_msgq_rspq_attach(struct bfa_msgq_rspq *rspq, struct bfa_msgq *msgq) in bfa_msgq_rspq_attach() argument
491 rspq->depth = BFA_MSGQ_RSPQ_NUM_ENTRY; in bfa_msgq_rspq_attach()
492 rspq->msgq = msgq; in bfa_msgq_rspq_attach()
493 bfa_fsm_set_state(rspq, rspq_sm_stopped); in bfa_msgq_rspq_attach()
501 bfa_fsm_send_event(&msgq->rspq, RSPQ_E_INIT_RESP); in bfa_msgq_init_rsp()
517 bfa_dma_be_addr_set(msgq_cfg->rspq.addr, msgq->rspq.addr.pa); in bfa_msgq_init()
518 msgq_cfg->rspq.q_depth = htons(msgq->rspq.depth); in bfa_msgq_init()
534 bfa_msgq_rspq_pi_update(&msgq->rspq, msg); in bfa_msgq_isr()
561 bfa_fsm_send_event(&msgq->rspq, RSPQ_E_START); in bfa_msgq_notify()
567 bfa_fsm_send_event(&msgq->rspq, RSPQ_E_STOP); in bfa_msgq_notify()
572 bfa_fsm_send_event(&msgq->rspq, RSPQ_E_FAIL); in bfa_msgq_notify()
596 msgq->rspq.addr.kva = kva; in bfa_msgq_memclaim()
597 msgq->rspq.addr.pa = pa; in bfa_msgq_memclaim()
606 bfa_msgq_rspq_attach(&msgq->rspq, msgq); in bfa_msgq_attach()
617 msgq->rspq.rsphdlr[mc].cbfn = cbfn; in bfa_msgq_regisr()
618 msgq->rspq.rsphdlr[mc].cbarg = cbarg; in bfa_msgq_regisr()
637 struct bfa_msgq_rspq *rspq = &msgq->rspq; in bfa_msgq_rsp_copy() local
643 ci = rspq->consumer_index; in bfa_msgq_rsp_copy()
644 src = (u8 *)rspq->addr.kva; in bfa_msgq_rsp_copy()
654 BFA_MSGQ_INDX_ADD(ci, 1, rspq->depth); in bfa_msgq_rsp_copy()
655 src = (u8 *)rspq->addr.kva; in bfa_msgq_rsp_copy()