Lines Matching refs:usbm

105 	struct usb_memory *usbm;  member
186 static void dec_usb_memory_use_count(struct usb_memory *usbm, int *count) in dec_usb_memory_use_count() argument
188 struct usb_dev_state *ps = usbm->ps; in dec_usb_memory_use_count()
194 if (usbm->urb_use_count == 0 && usbm->vma_use_count == 0) { in dec_usb_memory_use_count()
195 list_del(&usbm->memlist); in dec_usb_memory_use_count()
198 hcd_buffer_free_pages(hcd, usbm->size, in dec_usb_memory_use_count()
199 usbm->mem, usbm->dma_handle); in dec_usb_memory_use_count()
201 usbm->size + sizeof(struct usb_memory)); in dec_usb_memory_use_count()
202 kfree(usbm); in dec_usb_memory_use_count()
210 struct usb_memory *usbm = vma->vm_private_data; in usbdev_vm_open() local
213 spin_lock_irqsave(&usbm->ps->lock, flags); in usbdev_vm_open()
214 ++usbm->vma_use_count; in usbdev_vm_open()
215 spin_unlock_irqrestore(&usbm->ps->lock, flags); in usbdev_vm_open()
220 struct usb_memory *usbm = vma->vm_private_data; in usbdev_vm_close() local
222 dec_usb_memory_use_count(usbm, &usbm->vma_use_count); in usbdev_vm_close()
232 struct usb_memory *usbm = NULL; in usbdev_mmap() local
245 usbm = kzalloc(sizeof(struct usb_memory), GFP_KERNEL); in usbdev_mmap()
246 if (!usbm) { in usbdev_mmap()
260 usbm->mem = mem; in usbdev_mmap()
261 usbm->dma_handle = dma_handle; in usbdev_mmap()
262 usbm->size = size; in usbdev_mmap()
263 usbm->ps = ps; in usbdev_mmap()
264 usbm->vm_start = vma->vm_start; in usbdev_mmap()
265 usbm->vma_use_count = 1; in usbdev_mmap()
266 INIT_LIST_HEAD(&usbm->memlist); in usbdev_mmap()
277 virt_to_phys(usbm->mem) >> PAGE_SHIFT, in usbdev_mmap()
279 dec_usb_memory_use_count(usbm, &usbm->vma_use_count); in usbdev_mmap()
285 dec_usb_memory_use_count(usbm, &usbm->vma_use_count); in usbdev_mmap()
292 vma->vm_private_data = usbm; in usbdev_mmap()
295 list_add_tail(&usbm->memlist, &ps->memory_list); in usbdev_mmap()
301 kfree(usbm); in usbdev_mmap()
426 if (as->usbm == NULL) in free_async()
429 dec_usb_memory_use_count(as->usbm, &as->usbm->urb_use_count); in free_async()
1594 struct usb_memory *usbm = NULL, *iter; in find_memory_area() local
1604 usbm = ERR_PTR(-EINVAL); in find_memory_area()
1606 usbm = iter; in find_memory_area()
1607 usbm->urb_use_count++; in find_memory_area()
1613 return usbm; in find_memory_area()
1783 as->usbm = find_memory_area(ps, uurb); in proc_do_submiturb()
1784 if (IS_ERR(as->usbm)) { in proc_do_submiturb()
1785 ret = PTR_ERR(as->usbm); in proc_do_submiturb()
1786 as->usbm = NULL; in proc_do_submiturb()
1793 if (as->usbm) in proc_do_submiturb()
1797 (as->usbm ? 0 : uurb->buffer_length) + in proc_do_submiturb()
1835 if (as->usbm) { in proc_do_submiturb()
1838 as->urb->transfer_buffer = as->usbm->mem + in proc_do_submiturb()
1839 (uurb_start - as->usbm->vm_start); in proc_do_submiturb()
1920 if (as->usbm) { in proc_do_submiturb()
1924 as->urb->transfer_dma = as->usbm->dma_handle + in proc_do_submiturb()
1925 (uurb_start - as->usbm->vm_start); in proc_do_submiturb()