• Home
  • Raw
  • Download

Lines Matching refs:qid

208 static u32 prestera_fw_evtq_len(struct prestera_fw *fw, u8 qid)  in prestera_fw_evtq_len()  argument
210 return fw->evt_queue[qid].len; in prestera_fw_evtq_len()
213 static u32 prestera_fw_evtq_avail(struct prestera_fw *fw, u8 qid) in prestera_fw_evtq_avail() argument
215 u32 wr_idx = prestera_fw_read(fw, PRESTERA_EVTQ_WR_IDX_REG(qid)); in prestera_fw_evtq_avail()
216 u32 rd_idx = prestera_fw_read(fw, PRESTERA_EVTQ_RD_IDX_REG(qid)); in prestera_fw_evtq_avail()
218 return CIRC_CNT(wr_idx, rd_idx, prestera_fw_evtq_len(fw, qid)); in prestera_fw_evtq_avail()
222 u8 qid, u32 idx) in prestera_fw_evtq_rd_set() argument
224 u32 rd_idx = idx & (prestera_fw_evtq_len(fw, qid) - 1); in prestera_fw_evtq_rd_set()
226 prestera_fw_write(fw, PRESTERA_EVTQ_RD_IDX_REG(qid), rd_idx); in prestera_fw_evtq_rd_set()
229 static u8 __iomem *prestera_fw_evtq_buf(struct prestera_fw *fw, u8 qid) in prestera_fw_evtq_buf() argument
231 return fw->evt_queue[qid].addr; in prestera_fw_evtq_buf()
234 static u32 prestera_fw_evtq_read32(struct prestera_fw *fw, u8 qid) in prestera_fw_evtq_read32() argument
236 u32 rd_idx = prestera_fw_read(fw, PRESTERA_EVTQ_RD_IDX_REG(qid)); in prestera_fw_evtq_read32()
239 val = readl(prestera_fw_evtq_buf(fw, qid) + rd_idx); in prestera_fw_evtq_read32()
240 prestera_fw_evtq_rd_set(fw, qid, rd_idx + 4); in prestera_fw_evtq_read32()
245 u8 qid, void *buf, size_t len) in prestera_fw_evtq_read_buf() argument
247 u32 idx = prestera_fw_read(fw, PRESTERA_EVTQ_RD_IDX_REG(qid)); in prestera_fw_evtq_read_buf()
248 u8 __iomem *evtq_addr = prestera_fw_evtq_buf(fw, qid); in prestera_fw_evtq_read_buf()
254 idx = (idx + 4) & (prestera_fw_evtq_len(fw, qid) - 1); in prestera_fw_evtq_read_buf()
257 prestera_fw_evtq_rd_set(fw, qid, idx); in prestera_fw_evtq_read_buf()
264 int qid; in prestera_fw_evtq_pick() local
266 for (qid = 0; qid < fw->evt_qnum; qid++) { in prestera_fw_evtq_pick()
267 if (prestera_fw_evtq_avail(fw, qid) >= 4) in prestera_fw_evtq_pick()
268 return qid; in prestera_fw_evtq_pick()
287 u8 qid; in prestera_fw_evt_work_fn() local
294 while ((qid = prestera_fw_evtq_pick(fw)) < PRESTERA_EVT_QNUM_MAX) { in prestera_fw_evt_work_fn()
298 len = prestera_fw_evtq_read32(fw, qid); in prestera_fw_evt_work_fn()
299 idx = prestera_fw_read(fw, PRESTERA_EVTQ_RD_IDX_REG(qid)); in prestera_fw_evt_work_fn()
301 WARN_ON(prestera_fw_evtq_avail(fw, qid) < len); in prestera_fw_evt_work_fn()
304 prestera_fw_evtq_rd_set(fw, qid, idx + len); in prestera_fw_evt_work_fn()
308 prestera_fw_evtq_read_buf(fw, qid, msg, len); in prestera_fw_evt_work_fn()
396 u8 qid; in prestera_fw_init() local
425 for (qid = 0; qid < fw->evt_qnum; qid++) { in prestera_fw_init()
426 u32 offs = prestera_fw_read(fw, PRESTERA_EVTQ_OFFS_REG(qid)); in prestera_fw_init()
427 struct prestera_fw_evtq *evtq = &fw->evt_queue[qid]; in prestera_fw_init()
429 evtq->len = prestera_fw_read(fw, PRESTERA_EVTQ_LEN_REG(qid)); in prestera_fw_init()