On Mon, 20 Jul 2020 17:38:01 -0700 Tony Nguyen wrote:
> @@ -30,7 +38,32 @@ static enum iecm_status iecm_ctlq_init_regs(struct iecm_hw 
> *hw,
>                                           struct iecm_ctlq_info *cq,
>                                           bool is_rxq)
>  {
> -     /* stub */
> +     u32 reg = 0;
> +
> +     if (is_rxq)
> +             /* Update tail to post pre-allocated buffers for Rx queues */
> +             wr32(hw, cq->reg.tail, (u32)(cq->ring_size - 1));
> +     else
> +             wr32(hw, cq->reg.tail, 0);
> +
> +     /* For non-Mailbox control queues only TAIL need to be set */
> +     if (cq->q_id != -1)
> +             return 0;
> +
> +     /* Clear Head for both send or receive */
> +     wr32(hw, cq->reg.head, 0);
> +
> +     /* set starting point */
> +     wr32(hw, cq->reg.bal, IECM_LO_DWORD(cq->desc_ring.pa));
> +     wr32(hw, cq->reg.bah, IECM_HI_DWORD(cq->desc_ring.pa));
> +     wr32(hw, cq->reg.len, (cq->ring_size | cq->reg.len_ena_mask));
> +
> +     /* Check one register to verify that config was applied */
> +     reg = rd32(hw, cq->reg.bah);
> +     if (reg != IECM_HI_DWORD(cq->desc_ring.pa))
> +             return IECM_ERR_CTLQ_ERROR;

Please stop using your own error codes.

> +     return 0;
>  }

Reply via email to