Lines Matching refs:udev
133 cpd->udev = cpd->bus->devices[cpd->dev_index]; in usb_ref_device()
134 if (cpd->udev == NULL) { in usb_ref_device()
139 if (cpd->udev->state == USB_STATE_DETACHED && in usb_ref_device()
147 if (cpd->udev->refcount == USB_DEV_REF_MAX) { in usb_ref_device()
151 cpd->udev->refcount++; in usb_ref_device()
159 crd->do_unlock = usbd_enum_lock(cpd->udev); in usb_ref_device()
181 ppf = cpd->udev->fifo; in usb_ref_device()
198 ppf = cpd->udev->fifo; in usb_ref_device()
229 usbd_enum_unlock(cpd->udev); in usb_ref_device()
232 if (cpd->udev && --(cpd->udev->refcount) == 0) in usb_ref_device()
233 cv_broadcast(&cpd->udev->ref_cv); in usb_ref_device()
287 usbd_enum_unlock(cpd->udev); in usb_unref_device()
304 if (--(cpd->udev->refcount) == 0) in usb_unref_device()
305 cv_broadcast(&cpd->udev->ref_cv); in usb_unref_device()
333 struct usb_device *udev = cpd->udev; in usb_fifo_create() local
352 f = udev->fifo[cpd->fifo_index + USB_FIFO_TX]; in usb_fifo_create()
358 f = udev->fifo[cpd->fifo_index + USB_FIFO_RX]; in usb_fifo_create()
383 f = udev->fifo[n + USB_FIFO_TX]; in usb_fifo_create()
400 f = udev->fifo[n + USB_FIFO_RX]; in usb_fifo_create()
437 (udev->fifo[n + USB_FIFO_TX] == NULL)) { in usb_fifo_create()
438 ep = usb_dev_get_ep(udev, e, USB_FIFO_TX); in usb_fifo_create()
444 f = usb_fifo_alloc(&udev->device_mtx); in usb_fifo_create()
455 f->udev = udev; in usb_fifo_create()
457 udev->fifo[n + USB_FIFO_TX] = f; in usb_fifo_create()
462 (udev->fifo[n + USB_FIFO_RX] == NULL)) { in usb_fifo_create()
463 ep = usb_dev_get_ep(udev, e, USB_FIFO_RX); in usb_fifo_create()
469 f = usb_fifo_alloc(&udev->device_mtx); in usb_fifo_create()
480 f->udev = udev; in usb_fifo_create()
482 udev->fifo[n + USB_FIFO_RX] = f; in usb_fifo_create()
486 crd->txfifo = udev->fifo[n + USB_FIFO_TX]; in usb_fifo_create()
489 crd->rxfifo = udev->fifo[n + USB_FIFO_RX]; in usb_fifo_create()
520 (f->udev != NULL) && in usb_fifo_free()
521 (f->udev->fifo[f->fifo_index] == f)) { in usb_fifo_free()
522 f->udev->fifo[f->fifo_index] = NULL; in usb_fifo_free()
565 usb_dev_get_ep(struct usb_device *udev, uint8_t ep_index, uint8_t dir) in usb_dev_get_ep() argument
571 ep = &udev->ctrl_ep; in usb_dev_get_ep()
574 if (udev->flags.usb_mode == USB_MODE_HOST) { in usb_dev_get_ep()
580 if (udev->flags.usb_mode == USB_MODE_HOST) { in usb_dev_get_ep()
586 ep = usbd_get_ep_by_addr(udev, ep_index | ep_dir); in usb_dev_get_ep()
1021 while (f->udev->re_enumerate_wait != USB_RE_ENUM_DONE) { in usb_ioctl()
1477 usb_fifo_attach(struct usb_device *udev, void *priv_sc, in usb_fifo_attach() argument
1506 if (udev->fifo[n + USB_FIFO_TX] != NULL) { in usb_fifo_attach()
1510 if (udev->fifo[n + USB_FIFO_RX] != NULL) { in usb_fifo_attach()
1531 f_tx->udev = udev; in usb_fifo_attach()
1538 f_rx->udev = udev; in usb_fifo_attach()
1544 udev->fifo[f_tx->fifo_index] = f_tx; in usb_fifo_attach()
1545 udev->fifo[f_rx->fifo_index] = f_rx; in usb_fifo_attach()
1580 f_sc->dev = usb_make_dev(udev, devname, -1, in usb_fifo_attach()