Lines Matching refs:cp
113 struct auerswald *cp = NULL; in auerchar_open() local
125 cp = auerdev_table[dtindex]; in auerchar_open()
126 if (cp == NULL) { in auerchar_open()
130 if (down_interruptible(&cp->mutex)) { in auerchar_open()
156 cp->maxControlLength + AUH_SIZE); in auerchar_open()
161 cp->open_count++; in auerchar_open()
162 ccp->auerdev = cp; in auerchar_open()
163 dbg("open %s as /dev/usb/%s", cp->dev_desc, cp->name); in auerchar_open()
164 up(&cp->mutex); in auerchar_open()
172 ofail:up(&cp->mutex); in auerchar_open()
185 struct auerswald *cp = NULL; in auerchar_ioctl() local
193 cp = ccp->auerdev; in auerchar_ioctl()
194 if (!cp) { in auerchar_ioctl()
198 if (down_interruptible(&cp->mutex)) { in auerchar_ioctl()
204 if (!cp->usbdev) { in auerchar_ioctl()
205 up(&cp->mutex); in auerchar_ioctl()
216 && !list_empty(&cp->bufctl.free_buff_list); in auerchar_ioctl()
251 u = cp->maxControlLength; in auerchar_ioctl()
259 auerswald_removeservice(cp, &ccp->scontext); in auerchar_ioctl()
273 ret = auerswald_addservice(cp, &ccp->scontext); in auerchar_ioctl()
288 u = strlen(cp->dev_desc) + 1; in auerchar_ioctl()
292 ret = copy_to_user(devinfo.buf, cp->dev_desc, u); in auerchar_ioctl()
308 up(&cp->mutex); in auerchar_ioctl()
459 struct auerswald *cp = NULL; in auerchar_write() local
485 cp = ccp->auerdev; in auerchar_write()
486 if (!cp) { in auerchar_write()
490 if (down_interruptible(&cp->mutex)) { in auerchar_write()
494 if (!cp->usbdev) { in auerchar_write()
495 up(&cp->mutex); in auerchar_write()
502 add_wait_queue(&cp->bufferwait, &wait); in auerchar_write()
507 bp = auerbuf_getbuf(&cp->bufctl); in auerchar_write()
510 up(&cp->mutex); in auerchar_write()
516 remove_wait_queue(&cp->bufferwait, &wait); in auerchar_write()
522 remove_wait_queue(&cp->bufferwait, &wait); in auerchar_write()
530 remove_wait_queue(&cp->bufferwait, &wait); in auerchar_write()
534 if (len > cp->maxControlLength) in auerchar_write()
535 len = cp->maxControlLength; in auerchar_write()
542 wake_up(&cp->bufferwait); in auerchar_write()
543 up(&cp->mutex); in auerchar_write()
559 FILL_CONTROL_URB(bp->urbp, cp->usbdev, in auerchar_write()
560 usb_sndctrlpipe(cp->usbdev, 0), in auerchar_write()
564 ret = auerchain_submit_urb(&cp->controlchain, bp->urbp); in auerchar_write()
565 up(&cp->mutex); in auerchar_write()
570 wake_up(&cp->bufferwait); in auerchar_write()
585 struct auerswald *cp; in auerchar_release() local
592 cp = ccp->auerdev; in auerchar_release()
593 if (cp) { in auerchar_release()
594 if (down_interruptible(&cp->mutex)) { in auerchar_release()
599 auerswald_removeservice(cp, &ccp->scontext); in auerchar_release()
601 if ((--cp->open_count <= 0) && (cp->usbdev == NULL)) { in auerchar_release()
603 up(&cp->mutex); in auerchar_release()
604 auerswald_delete(cp); in auerchar_release()
606 up(&cp->mutex); in auerchar_release()
608 cp = NULL; in auerchar_release()