Lines Matching full:csq
1166 struct hns_roce_v2_cmq_ring *csq) in init_csq() argument
1171 csq->desc_num = CMD_CSQ_DESC_NUM; in init_csq()
1172 spin_lock_init(&csq->lock); in init_csq()
1173 csq->flag = TYPE_CSQ; in init_csq()
1174 csq->head = 0; in init_csq()
1176 ret = hns_roce_alloc_cmq_desc(hr_dev, csq); in init_csq()
1180 dma = csq->desc_dma_addr; in init_csq()
1184 (u32)csq->desc_num >> HNS_ROCE_CMQ_DESC_NUM_S); in init_csq()
1200 ret = init_csq(hr_dev, &priv->cmq.csq); in hns_roce_v2_cmq_init()
1202 dev_err(hr_dev->dev, "failed to init CSQ, ret = %d.\n", ret); in hns_roce_v2_cmq_init()
1211 hns_roce_free_cmq_desc(hr_dev, &priv->cmq.csq); in hns_roce_v2_cmq_exit()
1232 return tail == priv->cmq.csq.head; in hns_roce_cmq_csq_done()
1273 struct hns_roce_v2_cmq_ring *csq = &priv->cmq.csq; in __hns_roce_cmq_send() local
1280 spin_lock_bh(&csq->lock); in __hns_roce_cmq_send()
1282 tail = csq->head; in __hns_roce_cmq_send()
1285 csq->desc[csq->head++] = desc[i]; in __hns_roce_cmq_send()
1286 if (csq->head == csq->desc_num) in __hns_roce_cmq_send()
1287 csq->head = 0; in __hns_roce_cmq_send()
1291 roce_write(hr_dev, ROCEE_TX_CMQ_PI_REG, csq->head); in __hns_roce_cmq_send()
1303 desc[i] = csq->desc[tail++]; in __hns_roce_cmq_send()
1304 if (tail == csq->desc_num) in __hns_roce_cmq_send()
1320 csq->head, tail); in __hns_roce_cmq_send()
1321 csq->head = tail; in __hns_roce_cmq_send()
1328 spin_unlock_bh(&csq->lock); in __hns_roce_cmq_send()