Lines Matching refs:rx
651 struct zd_usb_rx *rx; in rx_urb_complete() local
675 rx = &usb->rx; in rx_urb_complete()
677 tasklet_schedule(&rx->reset_timer_tasklet); in rx_urb_complete()
679 if (length%rx->usb_packet_size > rx->usb_packet_size-4) { in rx_urb_complete()
682 ZD_ASSERT(length <= ARRAY_SIZE(rx->fragment)); in rx_urb_complete()
683 spin_lock_irqsave(&rx->lock, flags); in rx_urb_complete()
684 memcpy(rx->fragment, buffer, length); in rx_urb_complete()
685 rx->fragment_length = length; in rx_urb_complete()
686 spin_unlock_irqrestore(&rx->lock, flags); in rx_urb_complete()
690 spin_lock_irqsave(&rx->lock, flags); in rx_urb_complete()
691 if (rx->fragment_length > 0) { in rx_urb_complete()
693 ZD_ASSERT(length + rx->fragment_length <= in rx_urb_complete()
694 ARRAY_SIZE(rx->fragment)); in rx_urb_complete()
696 memcpy(rx->fragment+rx->fragment_length, buffer, length); in rx_urb_complete()
697 handle_rx_packet(usb, rx->fragment, in rx_urb_complete()
698 rx->fragment_length + length); in rx_urb_complete()
699 rx->fragment_length = 0; in rx_urb_complete()
700 spin_unlock_irqrestore(&rx->lock, flags); in rx_urb_complete()
702 spin_unlock_irqrestore(&rx->lock, flags); in rx_urb_complete()
748 struct zd_usb_rx *rx = &usb->rx; in __zd_usb_enable_rx() local
764 spin_lock_irq(&rx->lock); in __zd_usb_enable_rx()
765 if (rx->urbs) { in __zd_usb_enable_rx()
766 spin_unlock_irq(&rx->lock); in __zd_usb_enable_rx()
770 rx->urbs = urbs; in __zd_usb_enable_rx()
771 rx->urbs_count = RX_URBS_COUNT; in __zd_usb_enable_rx()
772 spin_unlock_irq(&rx->lock); in __zd_usb_enable_rx()
785 spin_lock_irq(&rx->lock); in __zd_usb_enable_rx()
786 rx->urbs = NULL; in __zd_usb_enable_rx()
787 rx->urbs_count = 0; in __zd_usb_enable_rx()
788 spin_unlock_irq(&rx->lock); in __zd_usb_enable_rx()
800 struct zd_usb_rx *rx = &usb->rx; in zd_usb_enable_rx() local
802 mutex_lock(&rx->setup_mutex); in zd_usb_enable_rx()
804 mutex_unlock(&rx->setup_mutex); in zd_usb_enable_rx()
817 struct zd_usb_rx *rx = &usb->rx; in __zd_usb_disable_rx() local
819 spin_lock_irqsave(&rx->lock, flags); in __zd_usb_disable_rx()
820 urbs = rx->urbs; in __zd_usb_disable_rx()
821 count = rx->urbs_count; in __zd_usb_disable_rx()
822 spin_unlock_irqrestore(&rx->lock, flags); in __zd_usb_disable_rx()
832 spin_lock_irqsave(&rx->lock, flags); in __zd_usb_disable_rx()
833 rx->urbs = NULL; in __zd_usb_disable_rx()
834 rx->urbs_count = 0; in __zd_usb_disable_rx()
835 spin_unlock_irqrestore(&rx->lock, flags); in __zd_usb_disable_rx()
840 struct zd_usb_rx *rx = &usb->rx; in zd_usb_disable_rx() local
842 mutex_lock(&rx->setup_mutex); in zd_usb_disable_rx()
844 mutex_unlock(&rx->setup_mutex); in zd_usb_disable_rx()
846 tasklet_kill(&rx->reset_timer_tasklet); in zd_usb_disable_rx()
847 cancel_delayed_work_sync(&rx->idle_work); in zd_usb_disable_rx()
853 struct zd_usb_rx *rx = &usb->rx; in zd_usb_reset_rx() local
856 mutex_lock(&rx->setup_mutex); in zd_usb_reset_rx()
858 spin_lock_irqsave(&rx->lock, flags); in zd_usb_reset_rx()
859 do_reset = rx->urbs != NULL; in zd_usb_reset_rx()
860 spin_unlock_irqrestore(&rx->lock, flags); in zd_usb_reset_rx()
867 mutex_unlock(&rx->setup_mutex); in zd_usb_reset_rx()
1129 container_of(work, struct zd_usb, rx.idle_work.work); in zd_rx_idle_timer_handler()
1143 struct zd_usb *usb = from_tasklet(usb, t, rx.reset_timer_tasklet); in zd_usb_reset_rx_idle_timer_tasklet()
1150 struct zd_usb_rx *rx = &usb->rx; in zd_usb_reset_rx_idle_timer() local
1152 mod_delayed_work(zd_workqueue, &rx->idle_work, ZD_RX_IDLE_INTERVAL); in zd_usb_reset_rx_idle_timer()
1168 struct zd_usb_rx *rx = &usb->rx; in init_usb_rx() local
1170 spin_lock_init(&rx->lock); in init_usb_rx()
1171 mutex_init(&rx->setup_mutex); in init_usb_rx()
1173 rx->usb_packet_size = 512; in init_usb_rx()
1175 rx->usb_packet_size = 64; in init_usb_rx()
1177 ZD_ASSERT(rx->fragment_length == 0); in init_usb_rx()
1178 INIT_DELAYED_WORK(&rx->idle_work, zd_rx_idle_timer_handler); in init_usb_rx()
1179 rx->reset_timer_tasklet.func = (void (*)) in init_usb_rx()
1181 rx->reset_timer_tasklet.data = (unsigned long)&rx->reset_timer_tasklet; in init_usb_rx()