Lines Matching refs:ev
210 req->zero = len < le16_to_cpu(ffs->ev.setup.wLength); in __ffs_ep0_queue_wait()
212 spin_unlock_irq(&ffs->ev.waitq.lock); in __ffs_ep0_queue_wait()
243 if (ffs->ev.can_stall) { in __ffs_ep0_stall()
328 spin_lock_irq(&ffs->ev.waitq.lock); in ffs_ep0_write()
343 if (!(ffs->ev.setup.bRequestType & USB_DIR_IN)) { in ffs_ep0_write()
344 spin_unlock_irq(&ffs->ev.waitq.lock); in ffs_ep0_write()
350 len = min(len, (size_t)le16_to_cpu(ffs->ev.setup.wLength)); in ffs_ep0_write()
352 spin_unlock_irq(&ffs->ev.waitq.lock); in ffs_ep0_write()
360 spin_lock_irq(&ffs->ev.waitq.lock); in ffs_ep0_write()
378 spin_unlock_irq(&ffs->ev.waitq.lock); in ffs_ep0_write()
404 struct usb_functionfs_event events[ARRAY_SIZE(ffs->ev.types)]; in __ffs_ep0_read_events()
411 events[i].type = ffs->ev.types[i]; in __ffs_ep0_read_events()
413 events[i].u.setup = ffs->ev.setup; in __ffs_ep0_read_events()
418 ffs->ev.count -= n; in __ffs_ep0_read_events()
419 if (ffs->ev.count) in __ffs_ep0_read_events()
420 memmove(ffs->ev.types, ffs->ev.types + n, in __ffs_ep0_read_events()
421 ffs->ev.count * sizeof *ffs->ev.types); in __ffs_ep0_read_events()
423 spin_unlock_irq(&ffs->ev.waitq.lock); in __ffs_ep0_read_events()
458 spin_lock_irq(&ffs->ev.waitq.lock); in ffs_ep0_read()
472 if ((file->f_flags & O_NONBLOCK) && !ffs->ev.count) { in ffs_ep0_read()
477 if (wait_event_interruptible_exclusive_locked_irq(ffs->ev.waitq, in ffs_ep0_read()
478 ffs->ev.count)) { in ffs_ep0_read()
484 min(n, (size_t)ffs->ev.count)); in ffs_ep0_read()
487 if (ffs->ev.setup.bRequestType & USB_DIR_IN) { in ffs_ep0_read()
488 spin_unlock_irq(&ffs->ev.waitq.lock); in ffs_ep0_read()
493 len = min(len, (size_t)le16_to_cpu(ffs->ev.setup.wLength)); in ffs_ep0_read()
495 spin_unlock_irq(&ffs->ev.waitq.lock); in ffs_ep0_read()
505 spin_lock_irq(&ffs->ev.waitq.lock); in ffs_ep0_read()
525 spin_unlock_irq(&ffs->ev.waitq.lock); in ffs_ep0_read()
584 poll_wait(file, &ffs->ev.waitq, wait); in ffs_ep0_poll()
599 if (ffs->ev.count) in ffs_ep0_poll()
1406 BUG_ON(waitqueue_active(&ffs->ev.waitq) || in ffs_data_put()
1453 init_waitqueue_head(&ffs->ev.waitq); in ffs_data_new()
1457 ffs->ev.can_stall = 1; in ffs_data_new()
1502 ffs->ev.count = 0; in ffs_data_reset()
2422 u8 *ev = ffs->ev.types, *out = ev; in __ffs_event_add() local
2423 unsigned n = ffs->ev.count; in __ffs_event_add()
2424 for (; n; --n, ++ev) in __ffs_event_add()
2425 if ((*ev == rem_type1 || *ev == rem_type2) == neg) in __ffs_event_add()
2426 *out++ = *ev; in __ffs_event_add()
2428 pr_vdebug("purging event %d\n", *ev); in __ffs_event_add()
2429 ffs->ev.count = out - ffs->ev.types; in __ffs_event_add()
2433 ffs->ev.types[ffs->ev.count++] = type; in __ffs_event_add()
2434 wake_up_locked(&ffs->ev.waitq); in __ffs_event_add()
2443 spin_lock_irqsave(&ffs->ev.waitq.lock, flags); in ffs_event_add()
2445 spin_unlock_irqrestore(&ffs->ev.waitq.lock, flags); in ffs_event_add()
3007 spin_lock_irqsave(&ffs->ev.waitq.lock, flags); in ffs_func_setup()
3008 ffs->ev.setup = *creq; in ffs_func_setup()
3009 ffs->ev.setup.wIndex = cpu_to_le16(ret); in ffs_func_setup()
3011 spin_unlock_irqrestore(&ffs->ev.waitq.lock, flags); in ffs_func_setup()