Lines Matching refs:sq
8 (qinfo)->sq.head = prefix##_ATQH; \
9 (qinfo)->sq.tail = prefix##_ATQT; \
10 (qinfo)->sq.len = prefix##_ATQLEN; \
11 (qinfo)->sq.bah = prefix##_ATQBAH; \
12 (qinfo)->sq.bal = prefix##_ATQBAL; \
13 (qinfo)->sq.len_mask = prefix##_ATQLEN_ATQLEN_M; \
14 (qinfo)->sq.len_ena_mask = prefix##_ATQLEN_ATQENABLE_M; \
15 (qinfo)->sq.len_crit_mask = prefix##_ATQLEN_ATQCRIT_M; \
16 (qinfo)->sq.head_mask = prefix##_ATQH_ATQH_M; \
77 if (cq->sq.len && cq->sq.len_mask && cq->sq.len_ena_mask) in ice_check_sq_alive()
78 return (rd32(hw, cq->sq.len) & (cq->sq.len_mask | in ice_check_sq_alive()
79 cq->sq.len_ena_mask)) == in ice_check_sq_alive()
80 (cq->num_sq_entries | cq->sq.len_ena_mask); in ice_check_sq_alive()
95 cq->sq.desc_buf.va = dmam_alloc_coherent(ice_hw_to_dev(hw), size, in ice_alloc_ctrlq_sq_ring()
96 &cq->sq.desc_buf.pa, in ice_alloc_ctrlq_sq_ring()
98 if (!cq->sq.desc_buf.va) in ice_alloc_ctrlq_sq_ring()
100 cq->sq.desc_buf.size = size; in ice_alloc_ctrlq_sq_ring()
224 cq->sq.dma_head = devm_kcalloc(ice_hw_to_dev(hw), cq->num_sq_entries, in ice_alloc_sq_bufs()
225 sizeof(cq->sq.desc_buf), GFP_KERNEL); in ice_alloc_sq_bufs()
226 if (!cq->sq.dma_head) in ice_alloc_sq_bufs()
228 cq->sq.r.sq_bi = (struct ice_dma_mem *)cq->sq.dma_head; in ice_alloc_sq_bufs()
234 bi = &cq->sq.r.sq_bi[i]; in ice_alloc_sq_bufs()
248 dmam_free_coherent(ice_hw_to_dev(hw), cq->sq.r.sq_bi[i].size, in ice_alloc_sq_bufs()
249 cq->sq.r.sq_bi[i].va, cq->sq.r.sq_bi[i].pa); in ice_alloc_sq_bufs()
250 cq->sq.r.sq_bi[i].va = NULL; in ice_alloc_sq_bufs()
251 cq->sq.r.sq_bi[i].pa = 0; in ice_alloc_sq_bufs()
252 cq->sq.r.sq_bi[i].size = 0; in ice_alloc_sq_bufs()
254 cq->sq.r.sq_bi = NULL; in ice_alloc_sq_bufs()
255 devm_kfree(ice_hw_to_dev(hw), cq->sq.dma_head); in ice_alloc_sq_bufs()
256 cq->sq.dma_head = NULL; in ice_alloc_sq_bufs()
289 return ice_cfg_cq_regs(hw, &cq->sq, cq->num_sq_entries); in ice_cfg_sq_regs()
352 if (cq->sq.count > 0) { in ice_init_sq()
364 cq->sq.next_to_use = 0; in ice_init_sq()
365 cq->sq.next_to_clean = 0; in ice_init_sq()
383 cq->sq.count = cq->num_sq_entries; in ice_init_sq()
387 ICE_FREE_CQ_BUFS(hw, cq, sq); in ice_init_sq()
388 ice_free_cq_ring(hw, &cq->sq); in ice_init_sq()
467 if (!cq->sq.count) { in ice_shutdown_sq()
473 wr32(hw, cq->sq.head, 0); in ice_shutdown_sq()
474 wr32(hw, cq->sq.tail, 0); in ice_shutdown_sq()
475 wr32(hw, cq->sq.len, 0); in ice_shutdown_sq()
476 wr32(hw, cq->sq.bal, 0); in ice_shutdown_sq()
477 wr32(hw, cq->sq.bah, 0); in ice_shutdown_sq()
479 cq->sq.count = 0; /* to indicate uninitialized queue */ in ice_shutdown_sq()
482 ICE_FREE_CQ_BUFS(hw, cq, sq); in ice_shutdown_sq()
483 ice_free_cq_ring(hw, &cq->sq); in ice_shutdown_sq()
859 struct ice_ctl_q_ring *sq = &cq->sq; in ice_clean_sq() local
860 u16 ntc = sq->next_to_clean; in ice_clean_sq()
863 desc = ICE_CTL_Q_DESC(*sq, ntc); in ice_clean_sq()
865 while (rd32(hw, cq->sq.head) != ntc) { in ice_clean_sq()
866 ice_debug(hw, ICE_DBG_AQ_MSG, "ntc %d head %d.\n", ntc, rd32(hw, cq->sq.head)); in ice_clean_sq()
869 if (ntc == sq->count) in ice_clean_sq()
871 desc = ICE_CTL_Q_DESC(*sq, ntc); in ice_clean_sq()
874 sq->next_to_clean = ntc; in ice_clean_sq()
876 return ICE_CTL_Q_DESC_UNUSED(sq); in ice_clean_sq()
975 return !rd32_poll_timeout(hw, cq->sq.head, in ice_sq_done()
976 head, head == cq->sq.next_to_use, in ice_sq_done()
1012 if (!cq->sq.count) { in ice_sq_send_cmd()
1036 val = rd32(hw, cq->sq.head); in ice_sq_send_cmd()
1056 desc_on_ring = ICE_CTL_Q_DESC(cq->sq, cq->sq.next_to_use); in ice_sq_send_cmd()
1063 dma_buf = &cq->sq.r.sq_bi[cq->sq.next_to_use]; in ice_sq_send_cmd()
1082 (cq->sq.next_to_use)++; in ice_sq_send_cmd()
1083 if (cq->sq.next_to_use == cq->sq.count) in ice_sq_send_cmd()
1084 cq->sq.next_to_use = 0; in ice_sq_send_cmd()
1085 wr32(hw, cq->sq.tail, cq->sq.next_to_use); in ice_sq_send_cmd()
1131 rd32(hw, cq->sq.len) & cq->sq.len_crit_mask) { in ice_sq_send_cmd()