Lines Matching refs:pc

29 static void	usb_pc_common_mem_cb(struct usb_page_cache *pc,
40 usbd_get_page(struct usb_page_cache *pc, usb_frlength_t offset, in usbd_get_page() argument
46 if (pc->page_start) { in usbd_get_page()
50 if (pc->buffer) { in usbd_get_page()
54 res->buffer = USB_ADD_BYTES(pc->buffer, offset); in usbd_get_page()
56 offset += pc->page_offset_buf; in usbd_get_page()
60 page = pc->page_start; in usbd_get_page()
62 if (pc->ismultiseg) { in usbd_get_page()
74 if (!pc->buffer) { in usbd_get_page()
85 res->buffer = USB_ADD_BYTES(pc->buffer, offset); in usbd_get_page()
169 usb_pc_common_mem_cb(struct usb_page_cache *pc, in usb_pc_common_mem_cb() argument
183 pg = pc->page_start; in usb_pc_common_mem_cb()
186 pc->page_offset_buf = rem; in usb_pc_common_mem_cb()
187 pc->page_offset_end += rem; in usb_pc_common_mem_cb()
204 usb_pc_alloc_mem(struct usb_page_cache *pc, struct usb_page *pg, in usb_pc_alloc_mem() argument
226 pc->buffer = ((uint8_t *)ptr) + rem; in usb_pc_alloc_mem()
227 pc->page_start = pg; in usb_pc_alloc_mem()
228 pc->page_offset_buf = 0; in usb_pc_alloc_mem()
229 pc->page_offset_end = size; in usb_pc_alloc_mem()
230 pc->map = NULL; in usb_pc_alloc_mem()
231 pc->tag = ptr; in usb_pc_alloc_mem()
232 pc->ismultiseg = (align == 1); in usb_pc_alloc_mem()
235 usb_pc_common_mem_cb(pc, pc->buffer, size); in usb_pc_alloc_mem()
237 usb_pc_cpu_flush(pc); in usb_pc_alloc_mem()
242 pc->buffer = NULL; in usb_pc_alloc_mem()
243 pc->page_start = NULL; in usb_pc_alloc_mem()
244 pc->page_offset_buf = 0; in usb_pc_alloc_mem()
245 pc->page_offset_end = 0; in usb_pc_alloc_mem()
246 pc->map = NULL; in usb_pc_alloc_mem()
247 pc->tag = NULL; in usb_pc_alloc_mem()
257 usb_pc_free_mem(struct usb_page_cache *pc) in usb_pc_free_mem() argument
259 if (pc != NULL && pc->buffer != NULL) { in usb_pc_free_mem()
260 free(pc->tag, XXX); in usb_pc_free_mem()
261 pc->buffer = NULL; in usb_pc_free_mem()
273 usb_pc_load_mem(struct usb_page_cache *pc, usb_size_t size, uint8_t sync) in usb_pc_load_mem() argument
276 pc->page_offset_buf = 0; in usb_pc_load_mem()
277 pc->page_offset_end = size; in usb_pc_load_mem()
278 pc->ismultiseg = 1; in usb_pc_load_mem()
280 mtx_assert(pc->tag_parent->mtx, MA_OWNED); in usb_pc_load_mem()
284 usb_pc_common_mem_cb(pc, pc->buffer, size); in usb_pc_load_mem()
291 pc->tag_parent->dma_error = 0; in usb_pc_load_mem()
292 (pc->tag_parent->func) (pc->tag_parent); in usb_pc_load_mem()
301 usb_pc_cpu_invalidate(struct usb_page_cache *pc) in usb_pc_cpu_invalidate() argument
303 if (pc->page_offset_end == pc->page_offset_buf) { in usb_pc_cpu_invalidate()
314 usb_pc_cpu_flush(struct usb_page_cache *pc) in usb_pc_cpu_flush() argument
316 if (pc->page_offset_end == pc->page_offset_buf) { in usb_pc_cpu_flush()
331 usb_pc_dmamap_create(struct usb_page_cache *pc, usb_size_t size) in usb_pc_dmamap_create() argument
342 usb_pc_dmamap_destroy(struct usb_page_cache *pc) in usb_pc_dmamap_destroy() argument
565 struct usb_page_cache *pc; in usb_bdma_pre_sync() local
576 pc = xfer->frbuffers; in usb_bdma_pre_sync()
580 if (pc->isread) { in usb_bdma_pre_sync()
581 usb_pc_cpu_invalidate(pc); in usb_bdma_pre_sync()
583 usb_pc_cpu_flush(pc); in usb_bdma_pre_sync()
585 pc++; in usb_bdma_pre_sync()
598 struct usb_page_cache *pc; in usb_bdma_post_sync() local
609 pc = xfer->frbuffers; in usb_bdma_post_sync()
612 if (pc->isread) { in usb_bdma_post_sync()
613 usb_pc_cpu_invalidate(pc); in usb_bdma_post_sync()
615 pc++; in usb_bdma_post_sync()