• Home
  • Raw
  • Download

Lines Matching refs:crd

117     struct usb_cdev_refdata *crd, int need_uref)  in usb_ref_device()  argument
125 (void)memset_s(crd, sizeof(*crd), 0, sizeof(*crd)); in usb_ref_device()
159 crd->do_unlock = usbd_enum_lock(cpd->udev); in usb_ref_device()
166 crd->is_uref = 1; in usb_ref_device()
169 if (crd->do_unlock > 1) { in usb_ref_device()
170 crd->do_unlock = 0; in usb_ref_device()
183 crd->txfifo = f; in usb_ref_device()
184 crd->is_write = 1; /* ref */ in usb_ref_device()
192 crd->is_usbfs = 1; in usb_ref_device()
200 crd->rxfifo = f; in usb_ref_device()
201 crd->is_read = 1; /* ref */ in usb_ref_device()
209 crd->is_usbfs = 1; in usb_ref_device()
215 if (crd->is_write) { in usb_ref_device()
217 crd->txfifo->refcount++; in usb_ref_device()
219 if (crd->is_read) { in usb_ref_device()
221 crd->rxfifo->refcount++; in usb_ref_device()
228 if (crd->do_unlock) in usb_ref_device()
231 if (crd->is_uref) { in usb_ref_device()
239 memset(crd, 0, sizeof(*crd)); in usb_ref_device()
256 struct usb_cdev_refdata *crd) in usb_usb_ref_device() argument
261 if (crd->is_uref) in usb_usb_ref_device()
268 usb_unref_device(cpd, crd); in usb_usb_ref_device()
270 return (usb_ref_device(cpd, crd, 1 /* need uref */)); in usb_usb_ref_device()
281 struct usb_cdev_refdata *crd) in usb_unref_device() argument
284 DPRINTFN(2, "cpd=%p is_uref=%d\n", cpd, crd->is_uref); in usb_unref_device()
286 if (crd->do_unlock) in usb_unref_device()
290 if (crd->is_read) { in usb_unref_device()
291 if (--(crd->rxfifo->refcount) == 0) { in usb_unref_device()
292 cv_signal(&crd->rxfifo->cv_drain); in usb_unref_device()
294 crd->is_read = 0; in usb_unref_device()
296 if (crd->is_write) { in usb_unref_device()
297 if (--(crd->txfifo->refcount) == 0) { in usb_unref_device()
298 cv_signal(&crd->txfifo->cv_drain); in usb_unref_device()
300 crd->is_write = 0; in usb_unref_device()
302 if (crd->is_uref) { in usb_unref_device()
303 crd->is_uref = 0; in usb_unref_device()
331 struct usb_cdev_refdata *crd) in usb_fifo_create() argument
355 crd->txfifo = f; in usb_fifo_create()
361 crd->rxfifo = f; in usb_fifo_create()
488 crd->txfifo = udev->fifo[n + USB_FIFO_TX]; in usb_fifo_create()
491 crd->rxfifo = udev->fifo[n + USB_FIFO_RX]; in usb_fifo_create()