Lines Matching refs:pipe
310 static void set_pipe_reg_addr(struct r8a66597_pipe *pipe, u8 dma_ch) in set_pipe_reg_addr() argument
312 u16 pipenum = pipe->info.pipenum; in set_pipe_reg_addr()
320 pipe->fifoaddr = fifoaddr[dma_ch]; in set_pipe_reg_addr()
321 pipe->fifosel = fifosel[dma_ch]; in set_pipe_reg_addr()
322 pipe->fifoctr = fifoctr[dma_ch]; in set_pipe_reg_addr()
325 pipe->pipectr = DCPCTR; in set_pipe_reg_addr()
327 pipe->pipectr = get_pipectr_addr(pipenum); in set_pipe_reg_addr()
330 pipe->pipetre = get_pipetre_addr(pipenum); in set_pipe_reg_addr()
331 pipe->pipetrn = get_pipetrn_addr(pipenum); in set_pipe_reg_addr()
333 pipe->pipetre = 0; in set_pipe_reg_addr()
334 pipe->pipetrn = 0; in set_pipe_reg_addr()
341 if (usb_pipedevice(urb->pipe) == 0) in get_urb_to_r8a66597_dev()
465 static void pipe_start(struct r8a66597 *r8a66597, struct r8a66597_pipe *pipe) in pipe_start() argument
469 tmp = r8a66597_read(r8a66597, pipe->pipectr) & PID; in pipe_start()
470 if ((pipe->info.pipenum != 0) & ((tmp & PID_STALL) != 0)) /* stall? */ in pipe_start()
471 r8a66597_mdfy(r8a66597, PID_NAK, PID, pipe->pipectr); in pipe_start()
472 r8a66597_mdfy(r8a66597, PID_BUF, PID, pipe->pipectr); in pipe_start()
476 static void pipe_stop(struct r8a66597 *r8a66597, struct r8a66597_pipe *pipe) in pipe_stop() argument
480 tmp = r8a66597_read(r8a66597, pipe->pipectr) & PID; in pipe_stop()
482 r8a66597_mdfy(r8a66597, PID_STALL, PID, pipe->pipectr); in pipe_stop()
483 r8a66597_mdfy(r8a66597, PID_NAK, PID, pipe->pipectr); in pipe_stop()
484 r8a66597_reg_wait(r8a66597, pipe->pipectr, PBUSY, 0); in pipe_stop()
489 struct r8a66597_pipe *pipe) in clear_all_buffer() argument
493 if (!pipe || pipe->info.pipenum == 0) in clear_all_buffer()
496 pipe_stop(r8a66597, pipe); in clear_all_buffer()
497 r8a66597_bset(r8a66597, ACLRM, pipe->pipectr); in clear_all_buffer()
498 tmp = r8a66597_read(r8a66597, pipe->pipectr); in clear_all_buffer()
499 tmp = r8a66597_read(r8a66597, pipe->pipectr); in clear_all_buffer()
500 tmp = r8a66597_read(r8a66597, pipe->pipectr); in clear_all_buffer()
501 r8a66597_bclr(r8a66597, ACLRM, pipe->pipectr); in clear_all_buffer()
506 struct r8a66597_pipe *pipe, int toggle) in r8a66597_pipe_toggle() argument
509 r8a66597_bset(r8a66597, SQSET, pipe->pipectr); in r8a66597_pipe_toggle()
511 r8a66597_bset(r8a66597, SQCLR, pipe->pipectr); in r8a66597_pipe_toggle()
533 struct r8a66597_pipe *pipe) in fifo_change_from_pipe() argument
541 r8a66597_mdfy(r8a66597, mbw | pipe->info.pipenum, mbw | CURPIPE, in fifo_change_from_pipe()
542 pipe->fifosel); in fifo_change_from_pipe()
543 r8a66597_reg_wait(r8a66597, pipe->fifosel, CURPIPE, pipe->info.pipenum); in fifo_change_from_pipe()
548 struct r8a66597_pipe *pipe = hep->hcpriv; in r8a66597_get_pipenum() local
550 if (usb_pipeendpoint(urb->pipe) == 0) in r8a66597_get_pipenum()
553 return pipe->info.pipenum; in r8a66597_get_pipenum()
560 return (usb_pipedevice(urb->pipe) == 0) ? 0 : dev->address; in get_urb_to_r8a66597_addr()
574 struct r8a66597_pipe *pipe, in pipe_toggle_set() argument
578 unsigned char endpoint = usb_pipeendpoint(urb->pipe); in pipe_toggle_set()
579 unsigned short *toggle = get_toggle_pointer(dev, urb->pipe); in pipe_toggle_set()
592 struct r8a66597_pipe *pipe, in pipe_toggle_save() argument
595 if (r8a66597_read(r8a66597, pipe->pipectr) & SQMON) in pipe_toggle_save()
596 pipe_toggle_set(r8a66597, pipe, urb, 1); in pipe_toggle_save()
598 pipe_toggle_set(r8a66597, pipe, urb, 0); in pipe_toggle_save()
603 struct r8a66597_pipe *pipe, in pipe_toggle_restore() argument
607 unsigned char endpoint = usb_pipeendpoint(urb->pipe); in pipe_toggle_restore()
608 unsigned short *toggle = get_toggle_pointer(dev, urb->pipe); in pipe_toggle_restore()
613 r8a66597_pipe_toggle(r8a66597, pipe, *toggle & (1 << endpoint)); in pipe_toggle_restore()
649 info = &td->pipe->info; in pipe_setting()
653 if (!usb_gettoggle(urb->dev, usb_pipeendpoint(urb->pipe), in pipe_setting()
654 usb_pipeout(urb->pipe)) && in pipe_setting()
655 !usb_pipecontrol(urb->pipe)) { in pipe_setting()
656 r8a66597_pipe_toggle(r8a66597, td->pipe, 0); in pipe_setting()
657 pipe_toggle_set(r8a66597, td->pipe, urb, 0); in pipe_setting()
658 clear_all_buffer(r8a66597, td->pipe); in pipe_setting()
659 usb_settoggle(urb->dev, usb_pipeendpoint(urb->pipe), in pipe_setting()
660 usb_pipeout(urb->pipe), 1); in pipe_setting()
662 pipe_toggle_restore(r8a66597, td->pipe, urb); in pipe_setting()
770 struct r8a66597_pipe *pipe, in enable_r8a66597_pipe_dma() argument
774 struct r8a66597_pipe_info *info = &pipe->info; in enable_r8a66597_pipe_dma()
781 if ((pipe->info.pipenum != 0) && (info->type != R8A66597_INT)) { in enable_r8a66597_pipe_dma()
788 "DMA FIFO\n", usb_pipedevice(urb->pipe), in enable_r8a66597_pipe_dma()
795 set_pipe_reg_addr(pipe, i); in enable_r8a66597_pipe_dma()
798 r8a66597_mdfy(r8a66597, mbw | pipe->info.pipenum, in enable_r8a66597_pipe_dma()
799 mbw | CURPIPE, pipe->fifosel); in enable_r8a66597_pipe_dma()
801 r8a66597_reg_wait(r8a66597, pipe->fifosel, CURPIPE, in enable_r8a66597_pipe_dma()
802 pipe->info.pipenum); in enable_r8a66597_pipe_dma()
803 r8a66597_bset(r8a66597, BCLR, pipe->fifoctr); in enable_r8a66597_pipe_dma()
815 struct r8a66597_pipe *pipe = hep->hcpriv; in enable_r8a66597_pipe() local
819 pipe->info = *info; in enable_r8a66597_pipe()
820 set_pipe_reg_addr(pipe, R8A66597_PIPE_NO_DMA); in enable_r8a66597_pipe()
821 r8a66597->pipe_cnt[pipe->info.pipenum]++; in enable_r8a66597_pipe()
822 dev->pipe_cnt[pipe->info.pipenum]++; in enable_r8a66597_pipe()
824 enable_r8a66597_pipe_dma(r8a66597, dev, pipe, urb); in enable_r8a66597_pipe()
832 if (usb_pipein(urb->pipe) && usb_pipetype(urb->pipe) != PIPE_CONTROL) { in r8a66597_urb_done()
933 if (usb_pipeisoc(urb->pipe)) in get_timer_interval()
987 if (pipenum == 0 && usb_pipeout(urb->pipe)) in pipe_irq_enable()
992 if (!usb_pipeisoc(urb->pipe)) in pipe_irq_enable()
1103 if (usb_pipecontrol(urb->pipe)) { in prepare_packet_read()
1108 r8a66597_pipe_toggle(r8a66597, td->pipe, 1); in prepare_packet_read()
1112 pipe_start(r8a66597, td->pipe); in prepare_packet_read()
1118 pipe_stop(r8a66597, td->pipe); in prepare_packet_read()
1121 if (td->pipe->pipetre) { in prepare_packet_read()
1123 td->pipe->pipetre); in prepare_packet_read()
1128 td->pipe->pipetrn); in prepare_packet_read()
1130 td->pipe->pipetre); in prepare_packet_read()
1133 pipe_start(r8a66597, td->pipe); in prepare_packet_read()
1146 if (usb_pipecontrol(urb->pipe)) { in prepare_packet_write()
1147 pipe_stop(r8a66597, td->pipe); in prepare_packet_write()
1152 r8a66597_pipe_toggle(r8a66597, td->pipe, 1); in prepare_packet_write()
1158 if (td->pipe->pipetre) in prepare_packet_write()
1159 r8a66597_bclr(r8a66597, TRENB, td->pipe->pipetre); in prepare_packet_write()
1163 fifo_change_from_pipe(r8a66597, td->pipe); in prepare_packet_write()
1164 tmp = r8a66597_read(r8a66597, td->pipe->fifoctr); in prepare_packet_write()
1169 pipe_start(r8a66597, td->pipe); in prepare_packet_write()
1178 r8a66597_pipe_toggle(r8a66597, td->pipe, 1); in prepare_status_packet()
1179 pipe_stop(r8a66597, td->pipe); in prepare_status_packet()
1196 pipe_start(r8a66597, td->pipe); in prepare_status_packet()
1243 if (usb_pipeisoc(urb->pipe)) { in check_transfer_finish()
1264 !usb_pipecontrol(td->urb->pipe) && usb_pipein(td->urb->pipe)) { in set_td_timer()
1266 switch (usb_pipetype(td->urb->pipe)) { in set_td_timer()
1295 pipe_toggle_save(r8a66597, td->pipe, urb); in finish_request()
1304 if (usb_pipeisoc(urb->pipe)) in finish_request()
1334 fifo_change_from_pipe(r8a66597, td->pipe); in packet_read()
1335 tmp = r8a66597_read(r8a66597, td->pipe->fifoctr); in packet_read()
1337 pipe_stop(r8a66597, td->pipe); in packet_read()
1346 if (usb_pipeisoc(urb->pipe)) { in packet_read()
1370 if (usb_pipeisoc(urb->pipe)) { in packet_read()
1379 pipe_stop(r8a66597, td->pipe); in packet_read()
1387 r8a66597_write(r8a66597, BCLR, td->pipe->fifoctr); in packet_read()
1389 r8a66597_read_fifo(r8a66597, td->pipe->fifoaddr, in packet_read()
1409 fifo_change_from_pipe(r8a66597, td->pipe); in packet_write()
1410 tmp = r8a66597_read(r8a66597, td->pipe->fifoctr); in packet_write()
1412 pipe_stop(r8a66597, td->pipe); in packet_write()
1421 if (usb_pipeisoc(urb->pipe)) { in packet_write()
1436 r8a66597_write_fifo(r8a66597, td->pipe, buf, size); in packet_write()
1437 if (!usb_pipebulk(urb->pipe) || td->maxpacket != size) in packet_write()
1438 r8a66597_write(r8a66597, BVAL, td->pipe->fifoctr); in packet_write()
1443 if (usb_pipeisoc(urb->pipe)) { in packet_write()
1453 if (!usb_pipeisoc(urb->pipe)) in packet_write()
1479 else if (usb_pipeout(urb->pipe)) in check_next_phase()
1500 u16 pid = r8a66597_read(r8a66597, td->pipe->pipectr) & PID; in get_urb_error()
1571 tmp = r8a66597_read(r8a66597, td->pipe->pipectr); in irq_pipe_empty()
1609 pipe_stop(r8a66597, td->pipe); in irq_pipe_nrdy()
1765 struct r8a66597_pipe *pipe; in r8a66597_td_timer() local
1785 pipe = td->pipe; in r8a66597_td_timer()
1786 pipe_stop(r8a66597, pipe); in r8a66597_td_timer()
1799 td->pipe->info.epnum == new_td->pipe->info.epnum); in r8a66597_td_timer()
1854 unsigned int usb_address = usb_pipedevice(urb->pipe); in set_address_zero()
1880 td->pipe = hep->hcpriv; in r8a66597_make_td()
1883 td->maxpacket = usb_maxpacket(urb->dev, urb->pipe, in r8a66597_make_td()
1884 !usb_pipein(urb->pipe)); in r8a66597_make_td()
1885 if (usb_pipecontrol(urb->pipe)) in r8a66597_make_td()
1887 else if (usb_pipein(urb->pipe)) in r8a66597_make_td()
1924 if (usb_pipeendpoint(urb->pipe)) in r8a66597_urb_enqueue()
1943 if (td->pipe->info.timer_interval) { in r8a66597_urb_enqueue()
1947 td->pipe->info.timer_interval)); in r8a66597_urb_enqueue()
1981 pipe_stop(r8a66597, td->pipe); in r8a66597_urb_dequeue()
1997 struct r8a66597_pipe *pipe = (struct r8a66597_pipe *)hep->hcpriv; in r8a66597_endpoint_disable() local
2003 if (pipe == NULL) in r8a66597_endpoint_disable()
2005 pipenum = pipe->info.pipenum; in r8a66597_endpoint_disable()
2015 pipe_stop(r8a66597, pipe); in r8a66597_endpoint_disable()