Lines Matching refs:pipenum
54 static void packet_write(struct r8a66597 *r8a66597, u16 pipenum);
58 static void enable_pipe_irq(struct r8a66597 *r8a66597, u16 pipenum, in enable_pipe_irq() argument
65 r8a66597_bset(r8a66597, 1 << pipenum, reg); in enable_pipe_irq()
70 static void disable_pipe_irq(struct r8a66597 *r8a66597, u16 pipenum, in disable_pipe_irq() argument
77 r8a66597_bclr(r8a66597, 1 << pipenum, reg); in disable_pipe_irq()
312 u16 pipenum = pipe->info.pipenum; in set_pipe_reg_addr() local
324 if (pipenum == 0) in set_pipe_reg_addr()
327 pipe->pipectr = get_pipectr_addr(pipenum); in set_pipe_reg_addr()
329 if (check_bulk_or_isoc(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()
470 if ((pipe->info.pipenum != 0) & ((tmp & PID_STALL) != 0)) /* stall? */ in pipe_start()
493 if (!pipe || pipe->info.pipenum == 0) in clear_all_buffer()
523 static inline void cfifo_change(struct r8a66597 *r8a66597, u16 pipenum) in cfifo_change() argument
527 r8a66597_mdfy(r8a66597, mbw | pipenum, mbw | CURPIPE, CFIFOSEL); in cfifo_change()
528 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, pipenum); in cfifo_change()
541 r8a66597_mdfy(r8a66597, mbw | pipe->info.pipenum, mbw | CURPIPE, in fifo_change_from_pipe()
543 r8a66597_reg_wait(r8a66597, pipe->fifosel, CURPIPE, pipe->info.pipenum); in fifo_change_from_pipe()
553 return pipe->info.pipenum; in r8a66597_get_pipenum()
622 if (info->pipenum == 0) in pipe_buffer_setting()
625 r8a66597_bset(r8a66597, ACLRM, get_pipectr_addr(info->pipenum)); in pipe_buffer_setting()
626 r8a66597_bclr(r8a66597, ACLRM, get_pipectr_addr(info->pipenum)); in pipe_buffer_setting()
627 r8a66597_write(r8a66597, info->pipenum, PIPESEL); in pipe_buffer_setting()
648 if (td->pipenum > 0) { in pipe_setting()
735 static u16 get_bufnum(u16 pipenum) in get_bufnum() argument
739 if (pipenum == 0) in get_bufnum()
741 else if (check_bulk_or_isoc(pipenum)) in get_bufnum()
742 bufnum = 8 + (pipenum - 1) * R8A66597_BUF_BSIZE*2; in get_bufnum()
743 else if (check_interrupt(pipenum)) in get_bufnum()
744 bufnum = 4 + (pipenum - 6); in get_bufnum()
746 printk(KERN_ERR "r8a66597: Illegal pipenum (%d)\n", pipenum); in get_bufnum()
751 static u16 get_buf_bsize(u16 pipenum) in get_buf_bsize() argument
755 if (pipenum == 0) in get_buf_bsize()
757 else if (check_bulk_or_isoc(pipenum)) in get_buf_bsize()
759 else if (check_interrupt(pipenum)) in get_buf_bsize()
762 printk(KERN_ERR "r8a66597: Illegal pipenum (%d)\n", pipenum); in get_buf_bsize()
781 if ((pipe->info.pipenum != 0) && (info->type != R8A66597_INT)) { in enable_r8a66597_pipe_dma()
798 r8a66597_mdfy(r8a66597, mbw | pipe->info.pipenum, in enable_r8a66597_pipe_dma()
802 pipe->info.pipenum); in enable_r8a66597_pipe_dma()
821 r8a66597->pipe_cnt[pipe->info.pipenum]++; in enable_r8a66597_pipe()
822 dev->pipe_cnt[pipe->info.pipenum]++; in enable_r8a66597_pipe()
848 static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address) in force_dequeue() argument
852 struct list_head *list = &r8a66597->pipe_queue[pipenum]; in force_dequeue()
877 u16 pipenum; in disable_r8a66597_pipe_all() local
882 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in disable_r8a66597_pipe_all()
883 if (!dev->pipe_cnt[pipenum]) in disable_r8a66597_pipe_all()
891 r8a66597->pipe_cnt[pipenum] -= dev->pipe_cnt[pipenum]; in disable_r8a66597_pipe_all()
892 dev->pipe_cnt[pipenum] = 0; in disable_r8a66597_pipe_all()
893 force_dequeue(r8a66597, pipenum, dev->address); in disable_r8a66597_pipe_all()
954 info.pipenum = get_empty_pipenum(r8a66597, ep); in init_pipe_info()
959 info.bufnum = get_bufnum(info.pipenum); in init_pipe_info()
960 info.buf_bsize = get_buf_bsize(info.pipenum); in init_pipe_info()
985 u16 pipenum) in pipe_irq_enable() argument
987 if (pipenum == 0 && usb_pipeout(urb->pipe)) in pipe_irq_enable()
988 enable_irq_empty(r8a66597, pipenum); in pipe_irq_enable()
990 enable_irq_ready(r8a66597, pipenum); in pipe_irq_enable()
993 enable_irq_nrdy(r8a66597, pipenum); in pipe_irq_enable()
996 static void pipe_irq_disable(struct r8a66597 *r8a66597, u16 pipenum) in pipe_irq_disable() argument
998 disable_irq_ready(r8a66597, pipenum); in pipe_irq_disable()
999 disable_irq_nrdy(r8a66597, pipenum); in pipe_irq_disable()
1111 pipe_irq_disable(r8a66597, td->pipenum); in prepare_packet_read()
1113 pipe_irq_enable(r8a66597, urb, td->pipenum); in prepare_packet_read()
1116 pipe_irq_disable(r8a66597, td->pipenum); in prepare_packet_read()
1119 r8a66597_write(r8a66597, ~(1 << td->pipenum), BRDYSTS); in prepare_packet_read()
1134 pipe_irq_enable(r8a66597, urb, td->pipenum); in prepare_packet_read()
1161 r8a66597_write(r8a66597, ~(1 << td->pipenum), BRDYSTS); in prepare_packet_write()
1166 pipe_irq_enable(r8a66597, urb, td->pipenum); in prepare_packet_write()
1168 packet_write(r8a66597, td->pipenum); in prepare_packet_write()
1263 if (!list_empty(&r8a66597->pipe_queue[td->pipenum]) && in set_td_timer()
1265 r8a66597->timeout_map |= 1 << td->pipenum; in set_td_timer()
1276 mod_timer(&r8a66597->td_timer[td->pipenum], in set_td_timer()
1283 u16 pipenum, struct urb *urb, int status) in finish_request() argument
1289 r8a66597->timeout_map &= ~(1 << pipenum); in finish_request()
1300 if (!list_empty(&r8a66597->pipe_queue[pipenum])) in finish_request()
1311 td = r8a66597_get_td(r8a66597, pipenum); in finish_request()
1320 static void packet_read(struct r8a66597 *r8a66597, u16 pipenum) in packet_read() argument
1325 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); in packet_read()
1338 pipe_irq_disable(r8a66597, pipenum); in packet_read()
1339 printk(KERN_ERR "r8a66597: in fifo not ready (%d)\n", pipenum); in packet_read()
1340 finish_request(r8a66597, td, pipenum, td->urb, -EPIPE); in packet_read()
1380 pipe_irq_disable(r8a66597, pipenum); in packet_read()
1393 if (finish && pipenum != 0) in packet_read()
1394 finish_request(r8a66597, td, pipenum, urb, status); in packet_read()
1397 static void packet_write(struct r8a66597 *r8a66597, u16 pipenum) in packet_write() argument
1402 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); in packet_write()
1413 pipe_irq_disable(r8a66597, pipenum); in packet_write()
1414 printk(KERN_ERR "r8a66597: out fifo not ready (%d)\n", pipenum); in packet_write()
1415 finish_request(r8a66597, td, pipenum, urb, -EPIPE); in packet_write()
1433 if (pipenum > 0) in packet_write()
1434 r8a66597_write(r8a66597, ~(1 << pipenum), BEMPSTS); in packet_write()
1451 disable_irq_ready(r8a66597, pipenum); in packet_write()
1452 enable_irq_empty(r8a66597, pipenum); in packet_write()
1454 enable_irq_nrdy(r8a66597, pipenum); in packet_write()
1456 pipe_irq_enable(r8a66597, urb, pipenum); in packet_write()
1495 static int get_urb_error(struct r8a66597 *r8a66597, u16 pipenum) in get_urb_error() argument
1497 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); in get_urb_error()
1513 u16 pipenum; in irq_pipe_ready() local
1529 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in irq_pipe_ready()
1530 check = 1 << pipenum; in irq_pipe_ready()
1532 td = r8a66597_get_td(r8a66597, pipenum); in irq_pipe_ready()
1537 packet_read(r8a66597, pipenum); in irq_pipe_ready()
1539 packet_write(r8a66597, pipenum); in irq_pipe_ready()
1548 u16 pipenum; in irq_pipe_empty() local
1563 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in irq_pipe_empty()
1564 check = 1 << pipenum; in irq_pipe_empty()
1567 td = r8a66597_get_td(r8a66597, pipenum); in irq_pipe_empty()
1573 disable_irq_empty(r8a66597, pipenum); in irq_pipe_empty()
1574 pipe_irq_disable(r8a66597, pipenum); in irq_pipe_empty()
1575 finish_request(r8a66597, td, pipenum, td->urb, in irq_pipe_empty()
1585 u16 pipenum; in irq_pipe_nrdy() local
1599 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in irq_pipe_nrdy()
1600 check = 1 << pipenum; in irq_pipe_nrdy()
1603 td = r8a66597_get_td(r8a66597, pipenum); in irq_pipe_nrdy()
1607 status = get_urb_error(r8a66597, pipenum); in irq_pipe_nrdy()
1608 pipe_irq_disable(r8a66597, pipenum); in irq_pipe_nrdy()
1610 finish_request(r8a66597, td, pipenum, td->urb, status); in irq_pipe_nrdy()
1740 u16 pipenum; in r8a66597_interval_timer() local
1745 for (pipenum = 0; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in r8a66597_interval_timer()
1746 if (!(r8a66597->interval_map & (1 << pipenum))) in r8a66597_interval_timer()
1748 if (timer_pending(&r8a66597->interval_timer[pipenum])) in r8a66597_interval_timer()
1751 td = r8a66597_get_td(r8a66597, pipenum); in r8a66597_interval_timer()
1763 u16 pipenum; in r8a66597_td_timer() local
1768 for (pipenum = 0; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in r8a66597_td_timer()
1769 if (!(r8a66597->timeout_map & (1 << pipenum))) in r8a66597_td_timer()
1771 if (timer_pending(&r8a66597->td_timer[pipenum])) in r8a66597_td_timer()
1774 td = r8a66597_get_td(r8a66597, pipenum); in r8a66597_td_timer()
1776 r8a66597->timeout_map &= ~(1 << pipenum); in r8a66597_td_timer()
1792 &r8a66597->pipe_queue[pipenum]); in r8a66597_td_timer()
1793 new_td = r8a66597_get_td(r8a66597, pipenum); in r8a66597_td_timer()
1804 r8a66597->timeout_map &= ~(1 << pipenum); in r8a66597_td_timer()
1872 u16 pipenum; in r8a66597_make_td() local
1878 pipenum = r8a66597_get_pipenum(urb, hep); in r8a66597_make_td()
1879 td->pipenum = pipenum; in r8a66597_make_td()
1937 if (list_empty(&r8a66597->pipe_queue[td->pipenum])) in r8a66597_urb_enqueue()
1939 list_add_tail(&td->queue, &r8a66597->pipe_queue[td->pipenum]); in r8a66597_urb_enqueue()
1944 r8a66597->interval_map |= 1 << td->pipenum; in r8a66597_urb_enqueue()
1945 mod_timer(&r8a66597->interval_timer[td->pipenum], in r8a66597_urb_enqueue()
1982 pipe_irq_disable(r8a66597, td->pipenum); in r8a66597_urb_dequeue()
1983 disable_irq_empty(r8a66597, td->pipenum); in r8a66597_urb_dequeue()
1984 finish_request(r8a66597, td, td->pipenum, urb, status); in r8a66597_urb_dequeue()
2000 u16 pipenum; in r8a66597_endpoint_disable() local
2005 pipenum = pipe->info.pipenum; in r8a66597_endpoint_disable()
2008 if (pipenum == 0) { in r8a66597_endpoint_disable()
2016 pipe_irq_disable(r8a66597, pipenum); in r8a66597_endpoint_disable()
2017 disable_irq_empty(r8a66597, pipenum); in r8a66597_endpoint_disable()
2018 td = r8a66597_get_td(r8a66597, pipenum); in r8a66597_endpoint_disable()
2021 finish_request(r8a66597, td, pipenum, urb, -ESHUTDOWN); in r8a66597_endpoint_disable()