Lines Matching refs:page_idx
45 ((void *)((wqs)->page_vaddr[(wq)->page_idx]) \
49 ((wqs)->page_paddr[(wq)->page_idx] \
53 ((void *)((wqs)->shadow_page_vaddr[(wq)->page_idx]) \
137 static int wqs_allocate_page(struct hinic_wqs *wqs, int page_idx) in wqs_allocate_page() argument
139 return queue_alloc_page(wqs->hwif, &wqs->page_vaddr[page_idx], in wqs_allocate_page()
140 &wqs->page_paddr[page_idx], in wqs_allocate_page()
141 &wqs->shadow_page_vaddr[page_idx], in wqs_allocate_page()
150 static void wqs_free_page(struct hinic_wqs *wqs, int page_idx) in wqs_free_page() argument
156 wqs->page_vaddr[page_idx], in wqs_free_page()
157 (dma_addr_t)wqs->page_paddr[page_idx]); in wqs_free_page()
158 vfree(wqs->shadow_page_vaddr[page_idx]); in wqs_free_page()
231 static int wqs_next_block(struct hinic_wqs *wqs, int *page_idx, in wqs_next_block() argument
249 *page_idx = wqs->free_blocks[pos].page_idx; in wqs_next_block()
252 wqs->free_blocks[pos].page_idx = -1; in wqs_next_block()
259 static void wqs_return_block(struct hinic_wqs *wqs, int page_idx, in wqs_return_block() argument
269 wqs->free_blocks[pos].page_idx = page_idx; in wqs_return_block()
279 int page_idx, blk_idx, pos = 0; in init_wqs_blocks_arr() local
281 for (page_idx = 0; page_idx < wqs->num_pages; page_idx++) { in init_wqs_blocks_arr()
283 wqs->free_blocks[pos].page_idx = page_idx; in init_wqs_blocks_arr()
308 int err, i, page_idx; in hinic_wqs_alloc() local
325 for (page_idx = 0; page_idx < wqs->num_pages; page_idx++) { in hinic_wqs_alloc()
326 err = wqs_allocate_page(wqs, page_idx); in hinic_wqs_alloc()
345 for (i = 0; i < page_idx; i++) in hinic_wqs_alloc()
360 int page_idx; in hinic_wqs_free() local
364 for (page_idx = 0; page_idx < wqs->num_pages; page_idx++) in hinic_wqs_free()
365 wqs_free_page(wqs, page_idx); in hinic_wqs_free()
539 err = wqs_next_block(wqs, &wq->page_idx, &wq->block_idx); in hinic_wq_allocate()
570 wqs_return_block(wqs, wq->page_idx, wq->block_idx); in hinic_wq_allocate()
583 wqs_return_block(wqs, wq->page_idx, wq->block_idx); in hinic_wq_free()
645 wq[i].page_idx = 0; in hinic_wqs_cmdq_alloc()