Lines Matching refs:wa

62 	struct wahc *wa;  member
98 struct wahc *wa = nw->wa; in wa_notif_dispatch() local
102 struct device *dev = &wa->usb_iface->dev; in wa_notif_dispatch()
109 atomic_dec(&wa->notifs_queued); /* Throttling ctl */ in wa_notif_dispatch()
110 dev = &wa->usb_iface->dev; in wa_notif_dispatch()
130 wusbhc_handle_dn(wa->wusb, hwa_dn->bSourceDeviceAddr, in wa_notif_dispatch()
136 wa_handle_notif_xfer(wa, notif_hdr); in wa_notif_dispatch()
153 wa_put(wa); in wa_notif_dispatch()
181 static int wa_nep_queue(struct wahc *wa, size_t size) in wa_nep_queue() argument
184 struct device *dev = &wa->usb_iface->dev; in wa_nep_queue()
188 BUG_ON(size > wa->nep_buffer_size); in wa_nep_queue()
191 if (atomic_read(&wa->notifs_queued) > 200) { in wa_nep_queue()
204 nw->wa = wa_get(wa); in wa_nep_queue()
206 memcpy(nw->data, wa->nep_buffer, size); in wa_nep_queue()
207 atomic_inc(&wa->notifs_queued); /* Throttling ctl */ in wa_nep_queue()
223 struct wahc *wa = urb->context; in wa_nep_cb() local
224 struct device *dev = &wa->usb_iface->dev; in wa_nep_cb()
228 result = wa_nep_queue(wa, urb->actual_length); in wa_nep_cb()
239 if (edc_inc(&wa->nep_edc, EDC_MAX_ERRORS, in wa_nep_cb()
243 wa_reset_all(wa); in wa_nep_cb()
248 result = wa_nep_arm(wa, GFP_ATOMIC); in wa_nep_cb()
251 wa_reset_all(wa); in wa_nep_cb()
263 int wa_nep_create(struct wahc *wa, struct usb_interface *iface) in wa_nep_create() argument
270 edc_init(&wa->nep_edc); in wa_nep_create()
272 wa->nep_buffer_size = 1024; in wa_nep_create()
273 wa->nep_buffer = kmalloc(wa->nep_buffer_size, GFP_KERNEL); in wa_nep_create()
274 if (wa->nep_buffer == NULL) { in wa_nep_create()
279 wa->nep_urb = usb_alloc_urb(0, GFP_KERNEL); in wa_nep_create()
280 if (wa->nep_urb == NULL) { in wa_nep_create()
284 usb_fill_int_urb(wa->nep_urb, usb_dev, in wa_nep_create()
286 wa->nep_buffer, wa->nep_buffer_size, in wa_nep_create()
287 wa_nep_cb, wa, epd->bInterval); in wa_nep_create()
288 result = wa_nep_arm(wa, GFP_KERNEL); in wa_nep_create()
296 usb_free_urb(wa->nep_urb); in wa_nep_create()
298 kfree(wa->nep_buffer); in wa_nep_create()
303 void wa_nep_destroy(struct wahc *wa) in wa_nep_destroy() argument
305 wa_nep_disarm(wa); in wa_nep_destroy()
306 usb_free_urb(wa->nep_urb); in wa_nep_destroy()
307 kfree(wa->nep_buffer); in wa_nep_destroy()