Lines Matching refs:dir
58 static inline int hw_ep_bit(int num, int dir) in hw_ep_bit() argument
60 return num + ((dir == TX) ? 16 : 0); in hw_ep_bit()
99 static int hw_ep_flush(struct ci_hdrc *ci, int num, int dir) in hw_ep_flush() argument
101 int n = hw_ep_bit(num, dir); in hw_ep_flush()
120 static int hw_ep_disable(struct ci_hdrc *ci, int num, int dir) in hw_ep_disable() argument
123 (dir == TX) ? ENDPTCTRL_TXE : ENDPTCTRL_RXE, 0); in hw_ep_disable()
135 static int hw_ep_enable(struct ci_hdrc *ci, int num, int dir, int type) in hw_ep_enable() argument
139 if (dir == TX) { in hw_ep_enable()
169 static int hw_ep_get_halt(struct ci_hdrc *ci, int num, int dir) in hw_ep_get_halt() argument
171 u32 mask = (dir == TX) ? ENDPTCTRL_TXS : ENDPTCTRL_RXS; in hw_ep_get_halt()
184 static int hw_ep_prime(struct ci_hdrc *ci, int num, int dir, int is_ctrl) in hw_ep_prime() argument
186 int n = hw_ep_bit(num, dir); in hw_ep_prime()
191 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) in hw_ep_prime()
198 if (is_ctrl && dir == RX && hw_read(ci, OP_ENDPTSETUPSTAT, BIT(num))) in hw_ep_prime()
214 static int hw_ep_set_halt(struct ci_hdrc *ci, int num, int dir, int value) in hw_ep_set_halt() argument
221 u32 mask_xs = (dir == TX) ? ENDPTCTRL_TXS : ENDPTCTRL_RXS; in hw_ep_set_halt()
222 u32 mask_xr = (dir == TX) ? ENDPTCTRL_TXR : ENDPTCTRL_RXR; in hw_ep_set_halt()
227 } while (value != hw_ep_get_halt(ci, num, dir)); in hw_ep_set_halt()
360 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == TX) { in add_td_to_list()
400 return ((ep->dir == TX) ? USB_ENDPOINT_DIR_MASK : 0) | ep->num; in _usb_addr()
425 &hwreq->req, hwep->dir); in _hardware_enqueue()
452 if (hwreq->req.zero && hwreq->req.length && hwep->dir == TX in _hardware_enqueue()
472 int n = hw_ep_bit(hwep->num, hwep->dir); in _hardware_enqueue()
500 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == RX) { in _hardware_enqueue()
509 ret = hw_ep_prime(ci, hwep->num, hwep->dir, in _hardware_enqueue()
535 return hw_ep_prime(ci, hwep->num, hwep->dir, in reprime_dtd()
562 int n = hw_ep_bit(hwep->num, hwep->dir); in _hardware_dequeue()
588 if (hwep->dir == TX) { in _hardware_dequeue()
606 &hwreq->req, hwep->dir); in _hardware_dequeue()
631 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in _ep_nuke()
676 if (value && hwep->dir == TX && check_transfer && in _ep_set_halt()
683 direction = hwep->dir; in _ep_set_halt()
685 retval |= hw_ep_set_halt(hwep->ci, hwep->num, hwep->dir, value); in _ep_set_halt()
691 hwep->dir = (hwep->dir == TX) ? RX : TX; in _ep_set_halt()
693 } while (hwep->dir != direction); in _ep_set_halt()
864 int dir, num, retval; in isr_get_status_response() local
888 dir = (le16_to_cpu(setup->wIndex) & USB_ENDPOINT_DIR_MASK) ? in isr_get_status_response()
891 *(u16 *)req->buf = hw_ep_get_halt(ci, num, dir); in isr_get_status_response()
1019 int type, num, dir, err = -EINVAL; in isr_setup_packet_handler() local
1047 dir = (num & USB_ENDPOINT_DIR_MASK) ? TX : RX; in isr_setup_packet_handler()
1049 if (dir == TX) in isr_setup_packet_handler()
1099 dir = (num & USB_ENDPOINT_DIR_MASK) ? TX : RX; in isr_setup_packet_handler()
1101 if (dir == TX) in isr_setup_packet_handler()
1249 hwep->dir = usb_endpoint_dir_in(desc) ? TX : RX; in ep_enable()
1265 if (hwep->type == USB_ENDPOINT_XFER_ISOC && hwep->dir == TX) in ep_enable()
1282 retval |= hw_ep_enable(hwep->ci, hwep->num, hwep->dir, in ep_enable()
1313 direction = hwep->dir; in ep_disable()
1316 retval |= hw_ep_disable(hwep->ci, hwep->num, hwep->dir); in ep_disable()
1319 hwep->dir = (hwep->dir == TX) ? RX : TX; in ep_disable()
1321 } while (hwep->dir != direction); in ep_disable()
1427 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in ep_dequeue()
1438 usb_gadget_unmap_request(&hwep->ci->gadget, req, hwep->dir); in ep_dequeue()
1503 hw_ep_flush(hwep->ci, hwep->num, hwep->dir); in ep_fifo_flush()