Lines Matching refs:pipenum
41 static void packet_write(struct r8a66597 *r8a66597, u16 pipenum);
45 static void enable_pipe_irq(struct r8a66597 *r8a66597, u16 pipenum, in enable_pipe_irq() argument
52 r8a66597_bset(r8a66597, 1 << pipenum, reg); in enable_pipe_irq()
57 static void disable_pipe_irq(struct r8a66597 *r8a66597, u16 pipenum, in disable_pipe_irq() argument
64 r8a66597_bclr(r8a66597, 1 << pipenum, reg); in disable_pipe_irq()
299 u16 pipenum = pipe->info.pipenum; in set_pipe_reg_addr() local
311 if (pipenum == 0) in set_pipe_reg_addr()
314 pipe->pipectr = get_pipectr_addr(pipenum); in set_pipe_reg_addr()
316 if (check_bulk_or_isoc(pipenum)) { in set_pipe_reg_addr()
317 pipe->pipetre = get_pipetre_addr(pipenum); in set_pipe_reg_addr()
318 pipe->pipetrn = get_pipetrn_addr(pipenum); in set_pipe_reg_addr()
457 if ((pipe->info.pipenum != 0) & ((tmp & PID_STALL) != 0)) /* stall? */ in pipe_start()
478 if (!pipe || pipe->info.pipenum == 0) in clear_all_buffer()
508 static inline void cfifo_change(struct r8a66597 *r8a66597, u16 pipenum) in cfifo_change() argument
512 r8a66597_mdfy(r8a66597, mbw | pipenum, mbw | CURPIPE, CFIFOSEL); in cfifo_change()
513 r8a66597_reg_wait(r8a66597, CFIFOSEL, CURPIPE, pipenum); in cfifo_change()
526 r8a66597_mdfy(r8a66597, mbw | pipe->info.pipenum, mbw | CURPIPE, in fifo_change_from_pipe()
528 r8a66597_reg_wait(r8a66597, pipe->fifosel, CURPIPE, pipe->info.pipenum); in fifo_change_from_pipe()
538 return pipe->info.pipenum; in r8a66597_get_pipenum()
607 if (info->pipenum == 0) in pipe_buffer_setting()
610 r8a66597_bset(r8a66597, ACLRM, get_pipectr_addr(info->pipenum)); in pipe_buffer_setting()
611 r8a66597_bclr(r8a66597, ACLRM, get_pipectr_addr(info->pipenum)); in pipe_buffer_setting()
612 r8a66597_write(r8a66597, info->pipenum, PIPESEL); in pipe_buffer_setting()
633 if (td->pipenum > 0) { in pipe_setting()
720 static u16 get_bufnum(u16 pipenum) in get_bufnum() argument
724 if (pipenum == 0) in get_bufnum()
726 else if (check_bulk_or_isoc(pipenum)) in get_bufnum()
727 bufnum = 8 + (pipenum - 1) * R8A66597_BUF_BSIZE*2; in get_bufnum()
728 else if (check_interrupt(pipenum)) in get_bufnum()
729 bufnum = 4 + (pipenum - 6); in get_bufnum()
731 printk(KERN_ERR "r8a66597: Illegal pipenum (%d)\n", pipenum); in get_bufnum()
736 static u16 get_buf_bsize(u16 pipenum) in get_buf_bsize() argument
740 if (pipenum == 0) in get_buf_bsize()
742 else if (check_bulk_or_isoc(pipenum)) in get_buf_bsize()
744 else if (check_interrupt(pipenum)) in get_buf_bsize()
747 printk(KERN_ERR "r8a66597: Illegal pipenum (%d)\n", pipenum); in get_buf_bsize()
766 if ((pipe->info.pipenum != 0) && (info->type != R8A66597_INT)) { in enable_r8a66597_pipe_dma()
783 r8a66597_mdfy(r8a66597, mbw | pipe->info.pipenum, in enable_r8a66597_pipe_dma()
787 pipe->info.pipenum); in enable_r8a66597_pipe_dma()
806 r8a66597->pipe_cnt[pipe->info.pipenum]++; in enable_r8a66597_pipe()
807 dev->pipe_cnt[pipe->info.pipenum]++; in enable_r8a66597_pipe()
833 static void force_dequeue(struct r8a66597 *r8a66597, u16 pipenum, u16 address) in force_dequeue() argument
837 struct list_head *list = &r8a66597->pipe_queue[pipenum]; in force_dequeue()
862 u16 pipenum; in disable_r8a66597_pipe_all() local
867 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in disable_r8a66597_pipe_all()
868 if (!dev->pipe_cnt[pipenum]) in disable_r8a66597_pipe_all()
876 r8a66597->pipe_cnt[pipenum] -= dev->pipe_cnt[pipenum]; in disable_r8a66597_pipe_all()
877 dev->pipe_cnt[pipenum] = 0; in disable_r8a66597_pipe_all()
878 force_dequeue(r8a66597, pipenum, dev->address); in disable_r8a66597_pipe_all()
939 info.pipenum = get_empty_pipenum(r8a66597, ep); in init_pipe_info()
944 info.bufnum = get_bufnum(info.pipenum); in init_pipe_info()
945 info.buf_bsize = get_buf_bsize(info.pipenum); in init_pipe_info()
970 u16 pipenum) in pipe_irq_enable() argument
972 if (pipenum == 0 && usb_pipeout(urb->pipe)) in pipe_irq_enable()
973 enable_irq_empty(r8a66597, pipenum); in pipe_irq_enable()
975 enable_irq_ready(r8a66597, pipenum); in pipe_irq_enable()
978 enable_irq_nrdy(r8a66597, pipenum); in pipe_irq_enable()
981 static void pipe_irq_disable(struct r8a66597 *r8a66597, u16 pipenum) in pipe_irq_disable() argument
983 disable_irq_ready(r8a66597, pipenum); in pipe_irq_disable()
984 disable_irq_nrdy(r8a66597, pipenum); in pipe_irq_disable()
1096 pipe_irq_disable(r8a66597, td->pipenum); in prepare_packet_read()
1098 pipe_irq_enable(r8a66597, urb, td->pipenum); in prepare_packet_read()
1101 pipe_irq_disable(r8a66597, td->pipenum); in prepare_packet_read()
1104 r8a66597_write(r8a66597, ~(1 << td->pipenum), BRDYSTS); in prepare_packet_read()
1119 pipe_irq_enable(r8a66597, urb, td->pipenum); in prepare_packet_read()
1146 r8a66597_write(r8a66597, ~(1 << td->pipenum), BRDYSTS); in prepare_packet_write()
1151 pipe_irq_enable(r8a66597, urb, td->pipenum); in prepare_packet_write()
1153 packet_write(r8a66597, td->pipenum); in prepare_packet_write()
1248 if (!list_empty(&r8a66597->pipe_queue[td->pipenum]) && in set_td_timer()
1250 r8a66597->timeout_map |= 1 << td->pipenum; in set_td_timer()
1261 mod_timer(&r8a66597->timers[td->pipenum].td, in set_td_timer()
1268 u16 pipenum, struct urb *urb, int status) in finish_request() argument
1274 r8a66597->timeout_map &= ~(1 << pipenum); in finish_request()
1285 if (!list_empty(&r8a66597->pipe_queue[pipenum])) in finish_request()
1296 td = r8a66597_get_td(r8a66597, pipenum); in finish_request()
1305 static void packet_read(struct r8a66597 *r8a66597, u16 pipenum) in packet_read() argument
1310 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); in packet_read()
1323 pipe_irq_disable(r8a66597, pipenum); in packet_read()
1324 printk(KERN_ERR "r8a66597: in fifo not ready (%d)\n", pipenum); in packet_read()
1325 finish_request(r8a66597, td, pipenum, td->urb, -EPIPE); in packet_read()
1365 pipe_irq_disable(r8a66597, pipenum); in packet_read()
1378 if (finish && pipenum != 0) in packet_read()
1379 finish_request(r8a66597, td, pipenum, urb, status); in packet_read()
1382 static void packet_write(struct r8a66597 *r8a66597, u16 pipenum) in packet_write() argument
1387 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); in packet_write()
1398 pipe_irq_disable(r8a66597, pipenum); in packet_write()
1399 printk(KERN_ERR "r8a66597: out fifo not ready (%d)\n", pipenum); in packet_write()
1400 finish_request(r8a66597, td, pipenum, urb, -EPIPE); in packet_write()
1418 if (pipenum > 0) in packet_write()
1419 r8a66597_write(r8a66597, ~(1 << pipenum), BEMPSTS); in packet_write()
1436 disable_irq_ready(r8a66597, pipenum); in packet_write()
1437 enable_irq_empty(r8a66597, pipenum); in packet_write()
1439 enable_irq_nrdy(r8a66597, pipenum); in packet_write()
1441 pipe_irq_enable(r8a66597, urb, pipenum); in packet_write()
1480 static int get_urb_error(struct r8a66597 *r8a66597, u16 pipenum) in get_urb_error() argument
1482 struct r8a66597_td *td = r8a66597_get_td(r8a66597, pipenum); in get_urb_error()
1498 u16 pipenum; in irq_pipe_ready() local
1514 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in irq_pipe_ready()
1515 check = 1 << pipenum; in irq_pipe_ready()
1517 td = r8a66597_get_td(r8a66597, pipenum); in irq_pipe_ready()
1522 packet_read(r8a66597, pipenum); in irq_pipe_ready()
1524 packet_write(r8a66597, pipenum); in irq_pipe_ready()
1533 u16 pipenum; in irq_pipe_empty() local
1548 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in irq_pipe_empty()
1549 check = 1 << pipenum; in irq_pipe_empty()
1552 td = r8a66597_get_td(r8a66597, pipenum); in irq_pipe_empty()
1558 disable_irq_empty(r8a66597, pipenum); in irq_pipe_empty()
1559 pipe_irq_disable(r8a66597, pipenum); in irq_pipe_empty()
1560 finish_request(r8a66597, td, pipenum, td->urb, in irq_pipe_empty()
1570 u16 pipenum; in irq_pipe_nrdy() local
1584 for (pipenum = 1; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in irq_pipe_nrdy()
1585 check = 1 << pipenum; in irq_pipe_nrdy()
1588 td = r8a66597_get_td(r8a66597, pipenum); in irq_pipe_nrdy()
1592 status = get_urb_error(r8a66597, pipenum); in irq_pipe_nrdy()
1593 pipe_irq_disable(r8a66597, pipenum); in irq_pipe_nrdy()
1595 finish_request(r8a66597, td, pipenum, td->urb, status); in irq_pipe_nrdy()
1726 u16 pipenum; in r8a66597_interval_timer() local
1731 for (pipenum = 0; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in r8a66597_interval_timer()
1732 if (!(r8a66597->interval_map & (1 << pipenum))) in r8a66597_interval_timer()
1734 if (timer_pending(&r8a66597->timers[pipenum].interval)) in r8a66597_interval_timer()
1737 td = r8a66597_get_td(r8a66597, pipenum); in r8a66597_interval_timer()
1750 u16 pipenum; in r8a66597_td_timer() local
1755 for (pipenum = 0; pipenum < R8A66597_MAX_NUM_PIPE; pipenum++) { in r8a66597_td_timer()
1756 if (!(r8a66597->timeout_map & (1 << pipenum))) in r8a66597_td_timer()
1758 if (timer_pending(&r8a66597->timers[pipenum].td)) in r8a66597_td_timer()
1761 td = r8a66597_get_td(r8a66597, pipenum); in r8a66597_td_timer()
1763 r8a66597->timeout_map &= ~(1 << pipenum); in r8a66597_td_timer()
1779 &r8a66597->pipe_queue[pipenum]); in r8a66597_td_timer()
1780 new_td = r8a66597_get_td(r8a66597, pipenum); in r8a66597_td_timer()
1791 r8a66597->timeout_map &= ~(1 << pipenum); in r8a66597_td_timer()
1859 u16 pipenum; in r8a66597_make_td() local
1865 pipenum = r8a66597_get_pipenum(urb, hep); in r8a66597_make_td()
1866 td->pipenum = pipenum; in r8a66597_make_td()
1924 if (list_empty(&r8a66597->pipe_queue[td->pipenum])) in r8a66597_urb_enqueue()
1926 list_add_tail(&td->queue, &r8a66597->pipe_queue[td->pipenum]); in r8a66597_urb_enqueue()
1931 r8a66597->interval_map |= 1 << td->pipenum; in r8a66597_urb_enqueue()
1932 mod_timer(&r8a66597->timers[td->pipenum].interval, in r8a66597_urb_enqueue()
1969 pipe_irq_disable(r8a66597, td->pipenum); in r8a66597_urb_dequeue()
1970 disable_irq_empty(r8a66597, td->pipenum); in r8a66597_urb_dequeue()
1971 finish_request(r8a66597, td, td->pipenum, urb, status); in r8a66597_urb_dequeue()
1987 u16 pipenum; in r8a66597_endpoint_disable() local
1992 pipenum = pipe->info.pipenum; in r8a66597_endpoint_disable()
1995 if (pipenum == 0) { in r8a66597_endpoint_disable()
2003 pipe_irq_disable(r8a66597, pipenum); in r8a66597_endpoint_disable()
2004 disable_irq_empty(r8a66597, pipenum); in r8a66597_endpoint_disable()
2005 td = r8a66597_get_td(r8a66597, pipenum); in r8a66597_endpoint_disable()
2008 finish_request(r8a66597, td, pipenum, urb, -ESHUTDOWN); in r8a66597_endpoint_disable()