Lines Matching +full:0 +full:xb
55 #define USB_VENDOR_ID_XILINX 0x03fd
56 #define USB_VENDOR_ID_ALTERA 0x09fb
58 #define USB_PRODUCT_ID_XILLYUSB 0xebbe
198 OPCODE_DATA = 0,
207 OPCODE_QUIESCE = 0,
228 unsigned int done = 0; in fifo_write()
242 if (n == 0) { in fifo_write()
268 writepos = 0; in fifo_write()
272 writebuf = 0; in fifo_write()
281 unsigned int done = 0; in fifo_read()
305 if (n == 0) { in fifo_read()
331 readpos = 0; in fifo_read()
335 readbuf = 0; in fifo_read()
351 return 0; in xilly_copy_from_user()
359 return 0; in xilly_copy_to_user()
366 return 0; in xilly_memcpy()
386 log2_bufnum = 0; in fifo_init()
388 log2_size - PAGE_SHIFT : 0; in fifo_init()
401 for (i = 0; i < fifo->bufnum; i++) { in fifo_init()
409 fifo->fill = 0; in fifo_init()
410 fifo->readpos = 0; in fifo_init()
411 fifo->readbuf = 0; in fifo_init()
412 fifo->writepos = 0; in fifo_init()
413 fifo->writebuf = 0; in fifo_init()
416 return 0; in fifo_init()
419 for (i--; i >= 0; i--) in fifo_init()
440 for (i = 0; i < fifo->bufnum; i++) in fifo_mem_release()
477 struct xillybuffer *xb = in endpoint_dealloc() local
480 free_pages((unsigned long)xb->buf, ep->order); in endpoint_dealloc()
481 kfree(xb); in endpoint_dealloc()
514 ep->outstanding_urbs = 0; in endpoint_alloc()
521 for (i = 0; i < bufnum; i++) { in endpoint_alloc()
522 struct xillybuffer *xb; in endpoint_alloc() local
525 xb = kzalloc(sizeof(*xb), GFP_KERNEL); in endpoint_alloc()
527 if (!xb) { in endpoint_alloc()
535 kfree(xb); in endpoint_alloc()
540 xb->buf = (void *)addr; in endpoint_alloc()
541 xb->ep = ep; in endpoint_alloc()
542 list_add_tail(&xb->entry, &ep->buffers); in endpoint_alloc()
583 for (i = 0; i < xdev->num_channels; i++) { in wakeup_all()
593 chan->read_data_ok = 0; in wakeup_all()
648 struct xillybuffer *xb = urb->context; in bulk_in_completer() local
649 struct xillyusb_endpoint *ep = xb->ep; in bulk_in_completer()
659 list_add_tail(&xb->entry, &ep->buffers); in bulk_in_completer()
666 xb->len = urb->actual_length; in bulk_in_completer()
669 list_add_tail(&xb->entry, &ep->filled_buffers); in bulk_in_completer()
678 struct xillybuffer *xb = urb->context; in bulk_out_completer() local
679 struct xillyusb_endpoint *ep = xb->ep; in bulk_out_completer()
689 list_add_tail(&xb->entry, &ep->buffers); in bulk_out_completer()
700 struct xillybuffer *xb; in try_queue_bulk_in() local
720 xb = list_first_entry(&ep->buffers, struct xillybuffer, entry); in try_queue_bulk_in()
721 list_del(&xb->entry); in try_queue_bulk_in()
726 urb = usb_alloc_urb(0, GFP_KERNEL); in try_queue_bulk_in()
734 xb->buf, bufsize, bulk_in_completer, xb); in try_queue_bulk_in()
755 list_add_tail(&xb->entry, &ep->buffers); in try_queue_bulk_in()
767 struct xillybuffer *xb; in try_queue_bulk_out() local
815 xb = list_first_entry(&ep->buffers, struct xillybuffer, entry); in try_queue_bulk_out()
816 list_del(&xb->entry); in try_queue_bulk_out()
823 count = fifo_read(&ep->fifo, xb->buf, max_read, xilly_memcpy); in try_queue_bulk_out()
826 * xilly_memcpy always returns 0 => fifo_read can't fail => in try_queue_bulk_out()
827 * count > 0 in try_queue_bulk_out()
830 urb = usb_alloc_urb(0, GFP_KERNEL); in try_queue_bulk_out()
838 xb->buf, count, bulk_out_completer, xb); in try_queue_bulk_out()
862 list_add_tail(&xb->entry, &ep->buffers); in try_queue_bulk_out()
911 WRITE_ONCE(chan->read_data_ok, 0); in process_in_opcode()
916 chan->flushing = 0; in process_in_opcode()
931 return 0; in process_in_opcode()
934 static int process_bulk_in(struct xillybuffer *xb) in process_bulk_in() argument
936 struct xillyusb_endpoint *ep = xb->ep; in process_bulk_in()
939 int dws = xb->len >> 2; in process_bulk_in()
940 __le32 *p = xb->buf; in process_bulk_in()
944 int chan_num = 0, opcode; in process_bulk_in()
947 int in_bytes_left = 0; in process_bulk_in()
950 if ((dws << 2) != xb->len) { in process_bulk_in()
952 xb->len); in process_bulk_in()
967 chan_num = ctrlword & 0xfff; in process_bulk_in()
968 count = (ctrlword >> 12) & 0x3ff; in process_bulk_in()
969 opcode = (ctrlword >> 24) & 0xf; in process_bulk_in()
972 unsigned int in_counter = xdev->in_counter++ & 0x3ff; in process_bulk_in()
1021 return 0; in process_bulk_in()
1030 struct xillybuffer *xb; in bulk_in_work() local
1032 int rc = 0; in bulk_in_work()
1051 xb = list_first_entry(&ep->filled_buffers, struct xillybuffer, in bulk_in_work()
1053 list_del(&xb->entry); in bulk_in_work()
1060 rc = process_bulk_in(xb); in bulk_in_work()
1063 list_add_tail(&xb->entry, &ep->buffers); in bulk_in_work()
1075 int rc = 0; in xillyusb_send_opcode()
1077 msg[0] = cpu_to_le32((chan_num & 0xfff) | in xillyusb_send_opcode()
1078 ((opcode & 0xf) << 24)); in xillyusb_send_opcode()
1136 return 0; in flush_downstream()
1143 chan->canceled = 0; in flush_downstream()
1145 OPCODE_CANCEL_CHECKPOINT, 0); in flush_downstream()
1154 if (left_to_sleep <= 0) { in flush_downstream()
1204 if (left_to_sleep <= 0) in flush_downstream()
1215 if (interruptible && rc < 0) in flush_downstream()
1221 return 0; in flush_downstream()
1314 chan->out_bytes = 0; in xillyusb_open()
1315 chan->flushed = 0; in xillyusb_open()
1364 u32 in_checkpoint = 0; in xillyusb_open()
1370 chan->in_consumed_bytes = 0; in xillyusb_open()
1371 chan->poll_used = 0; in xillyusb_open()
1392 return 0; in xillyusb_open()
1395 chan->read_data_ok = 0; in xillyusb_open()
1414 chan->open_for_read = 0; in xillyusb_open()
1417 chan->open_for_write = 0; in xillyusb_open()
1440 int bytes_done = 0; in xillyusb_read()
1462 if (rc < 0) in xillyusb_read()
1488 if (chan->in_synchronous && diff >= 0) { in xillyusb_read()
1512 (checkpoint_for_complete && leap > 0))) { in xillyusb_read()
1523 (left_to_sleep <= 0 && bytes_done)) in xillyusb_read()
1539 rc = 0; in xillyusb_read()
1564 if (left_to_sleep > 0) { in xillyusb_read()
1576 } else { /* bytes_done == 0 */ in xillyusb_read()
1588 if (rc < 0) { in xillyusb_read()
1612 return 0; in xillyusb_flush()
1661 if (count == 0) in xillyusb_write()
1667 if (rc != 0) in xillyusb_write()
1683 if (rc < 0) in xillyusb_write()
1690 chan->flushed = 0; in xillyusb_write()
1694 int flush_rc = flush_downstream(chan, 0, true); in xillyusb_write()
1710 int rc_read = 0, rc_write = 0; in xillyusb_release()
1716 OPCODE_CLOSE, 0); in xillyusb_release()
1739 chan->open_for_read = 0; in xillyusb_release()
1765 OPCODE_CLOSE, 0); in xillyusb_release()
1768 chan->open_for_write = 0; in xillyusb_release()
1787 int rc = 0; in xillyusb_llseek()
1830 chan->flushed = 0; in xillyusb_llseek()
1849 __poll_t mask = 0; in xillyusb_poll()
1930 return 0; in xillyusb_setup_base_eps()
1952 for (i = 0; i < num_channels; i++, chan++) { in setup_channels()
1964 if (in_desc & 0x80) { /* Entry is valid */ in setup_channels()
1966 chan->in_synchronous = !!(in_desc & 0x40); in setup_channels()
1967 chan->in_seekable = !!(in_desc & 0x20); in setup_channels()
1968 chan->in_log2_element_size = in_desc & 0x0f; in setup_channels()
1969 chan->in_log2_fifo_size = ((in_desc >> 8) & 0x1f) + 16; in setup_channels()
1978 if ((out_desc & 0x80) && i < 14) { /* Entry is valid */ in setup_channels()
1989 chan->out_synchronous = !!(out_desc & 0x40); in setup_channels()
1990 chan->out_seekable = !!(out_desc & 0x20); in setup_channels()
1991 chan->out_log2_element_size = out_desc & 0x0f; in setup_channels()
1993 ((out_desc >> 8) & 0x1f) + 16; in setup_channels()
1998 return 0; in setup_channels()
2012 rc = xillyusb_send_opcode(xdev, ~0, OPCODE_QUIESCE, 0); in xillyusb_discovery()
2022 bogus_chandesc[0] = cpu_to_le16(0x80); in xillyusb_discovery()
2023 bogus_chandesc[1] = cpu_to_le16(0); in xillyusb_discovery()
2042 rc = xillyusb_send_opcode(xdev, ~0, OPCODE_REQ_IDT, 0); in xillyusb_discovery()
2058 if (rc < 0) { in xillyusb_discovery()
2079 if (crc32_le(~0, idt, idt_len) != 0) { in xillyusb_discovery()
2085 if (*idt > 0x90) { in xillyusb_discovery()
2086 …dev_err(&interface->dev, "No support for IDT version 0x%02x. Maybe the xillyusb driver needs an up… in xillyusb_discovery()
2162 xdev->error = 0; in xillyusb_probe()
2164 xdev->in_counter = 0; in xillyusb_probe()
2165 xdev->in_bytes_left = 0; in xillyusb_probe()
2166 xdev->workq = alloc_workqueue(xillyname, WQ_HIGHPRI, 0); in xillyusb_probe()
2186 return 0; in xillyusb_probe()
2214 xillyusb_send_opcode(xdev, ~0, OPCODE_QUIESCE, 0); in xillyusb_disconnect()
2240 for (i = 0; i < xdev->num_channels; i++) { in xillyusb_disconnect()
2276 int rc = 0; in xillyusb_init()
2278 wakeup_wq = alloc_workqueue(xillyname, 0, 0); in xillyusb_init()
2285 fifo_buf_order = 0; in xillyusb_init()