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()
102 cq->sq.cmd_buf = devm_kcalloc(ice_hw_to_dev(hw), cq->num_sq_entries, in ice_alloc_ctrlq_sq_ring()
104 if (!cq->sq.cmd_buf) { in ice_alloc_ctrlq_sq_ring()
105 dmam_free_coherent(ice_hw_to_dev(hw), cq->sq.desc_buf.size, in ice_alloc_ctrlq_sq_ring()
106 cq->sq.desc_buf.va, cq->sq.desc_buf.pa); in ice_alloc_ctrlq_sq_ring()
107 cq->sq.desc_buf.va = NULL; in ice_alloc_ctrlq_sq_ring()
108 cq->sq.desc_buf.pa = 0; in ice_alloc_ctrlq_sq_ring()
109 cq->sq.desc_buf.size = 0; in ice_alloc_ctrlq_sq_ring()
235 cq->sq.dma_head = devm_kcalloc(ice_hw_to_dev(hw), cq->num_sq_entries, in ice_alloc_sq_bufs()
236 sizeof(cq->sq.desc_buf), GFP_KERNEL); in ice_alloc_sq_bufs()
237 if (!cq->sq.dma_head) in ice_alloc_sq_bufs()
239 cq->sq.r.sq_bi = (struct ice_dma_mem *)cq->sq.dma_head; in ice_alloc_sq_bufs()
245 bi = &cq->sq.r.sq_bi[i]; in ice_alloc_sq_bufs()
259 dmam_free_coherent(ice_hw_to_dev(hw), cq->sq.r.sq_bi[i].size, in ice_alloc_sq_bufs()
260 cq->sq.r.sq_bi[i].va, cq->sq.r.sq_bi[i].pa); in ice_alloc_sq_bufs()
261 cq->sq.r.sq_bi[i].va = NULL; in ice_alloc_sq_bufs()
262 cq->sq.r.sq_bi[i].pa = 0; in ice_alloc_sq_bufs()
263 cq->sq.r.sq_bi[i].size = 0; in ice_alloc_sq_bufs()
265 cq->sq.r.sq_bi = NULL; in ice_alloc_sq_bufs()
266 devm_kfree(ice_hw_to_dev(hw), cq->sq.dma_head); in ice_alloc_sq_bufs()
267 cq->sq.dma_head = NULL; in ice_alloc_sq_bufs()
301 return ice_cfg_cq_regs(hw, &cq->sq, cq->num_sq_entries); in ice_cfg_sq_regs()
368 if (cq->sq.count > 0) { in ice_init_sq()
380 cq->sq.next_to_use = 0; in ice_init_sq()
381 cq->sq.next_to_clean = 0; in ice_init_sq()
399 cq->sq.count = cq->num_sq_entries; in ice_init_sq()
403 ICE_FREE_CQ_BUFS(hw, cq, sq); in ice_init_sq()
404 ice_free_cq_ring(hw, &cq->sq); in ice_init_sq()
484 if (!cq->sq.count) { in ice_shutdown_sq()
490 wr32(hw, cq->sq.head, 0); in ice_shutdown_sq()
491 wr32(hw, cq->sq.tail, 0); in ice_shutdown_sq()
492 wr32(hw, cq->sq.len, 0); in ice_shutdown_sq()
493 wr32(hw, cq->sq.bal, 0); in ice_shutdown_sq()
494 wr32(hw, cq->sq.bah, 0); in ice_shutdown_sq()
496 cq->sq.count = 0; /* to indicate uninitialized queue */ in ice_shutdown_sq()
499 ICE_FREE_CQ_BUFS(hw, cq, sq); in ice_shutdown_sq()
500 ice_free_cq_ring(hw, &cq->sq); in ice_shutdown_sq()
868 struct ice_ctl_q_ring *sq = &cq->sq; in ice_clean_sq() local
869 u16 ntc = sq->next_to_clean; in ice_clean_sq()
873 desc = ICE_CTL_Q_DESC(*sq, ntc); in ice_clean_sq()
874 details = ICE_CTL_Q_DETAILS(*sq, ntc); in ice_clean_sq()
876 while (rd32(hw, cq->sq.head) != ntc) { in ice_clean_sq()
877 ice_debug(hw, ICE_DBG_AQ_MSG, "ntc %d head %d.\n", ntc, rd32(hw, cq->sq.head)); in ice_clean_sq()
881 if (ntc == sq->count) in ice_clean_sq()
883 desc = ICE_CTL_Q_DESC(*sq, ntc); in ice_clean_sq()
884 details = ICE_CTL_Q_DETAILS(*sq, ntc); in ice_clean_sq()
887 sq->next_to_clean = ntc; in ice_clean_sq()
889 return ICE_CTL_Q_DESC_UNUSED(sq); in ice_clean_sq()
950 return rd32(hw, cq->sq.head) == cq->sq.next_to_use; in ice_sq_done()
986 if (!cq->sq.count) { in ice_sq_send_cmd()
1010 val = rd32(hw, cq->sq.head); in ice_sq_send_cmd()
1018 details = ICE_CTL_Q_DETAILS(cq->sq, cq->sq.next_to_use); in ice_sq_send_cmd()
1036 desc_on_ring = ICE_CTL_Q_DESC(cq->sq, cq->sq.next_to_use); in ice_sq_send_cmd()
1043 dma_buf = &cq->sq.r.sq_bi[cq->sq.next_to_use]; in ice_sq_send_cmd()
1062 (cq->sq.next_to_use)++; in ice_sq_send_cmd()
1063 if (cq->sq.next_to_use == cq->sq.count) in ice_sq_send_cmd()
1064 cq->sq.next_to_use = 0; in ice_sq_send_cmd()
1065 wr32(hw, cq->sq.tail, cq->sq.next_to_use); in ice_sq_send_cmd()
1117 rd32(hw, cq->sq.len) & cq->sq.len_crit_mask) { in ice_sq_send_cmd()