diff options
-rw-r--r-- | firmware/target/arm/usb-drv-arc.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/firmware/target/arm/usb-drv-arc.c b/firmware/target/arm/usb-drv-arc.c index 8a10c5fbd6..3dc7b21151 100644 --- a/firmware/target/arm/usb-drv-arc.c +++ b/firmware/target/arm/usb-drv-arc.c | |||
@@ -829,12 +829,11 @@ int usb_drv_request_endpoint(int type, int dir) | |||
829 | return -1; | 829 | return -1; |
830 | } | 830 | } |
831 | 831 | ||
832 | log_ep(ep_num, ep_dir, "add"); | ||
833 | 832 | ||
834 | endpoint->allocated[ep_dir] = 1; | 833 | endpoint->allocated[ep_dir] = 1; |
835 | endpoint->type[ep_dir] = ep_type; | 834 | endpoint->type[ep_dir] = ep_type; |
836 | 835 | ||
837 | log_ep(ep_num, ep_dir, "got"); | 836 | log_ep(ep_num, ep_dir, "add"); |
838 | return (ep_num | (dir & USB_ENDPOINT_DIR_MASK)); | 837 | return (ep_num | (dir & USB_ENDPOINT_DIR_MASK)); |
839 | } | 838 | } |
840 | 839 | ||
@@ -998,13 +997,13 @@ static void init_endpoints(void) | |||
998 | for(ep_num=1;ep_num<USB_NUM_ENDPOINTS;ep_num++) { | 997 | for(ep_num=1;ep_num<USB_NUM_ENDPOINTS;ep_num++) { |
999 | usb_endpoint_t *endpoint = &endpoints[ep_num]; | 998 | usb_endpoint_t *endpoint = &endpoints[ep_num]; |
1000 | 999 | ||
1001 | /* manual: 32.9.5.18 (Caution) */ | 1000 | /* manual: 32.9.5.18 (Caution): Leaving an unconfigured endpoint control |
1002 | if (!endpoint->allocated[DIR_OUT]) { | 1001 | * will cause undefined behavior for the data pid tracking on the active |
1002 | * endpoint/direction. */ | ||
1003 | if (!endpoint->allocated[DIR_OUT]) | ||
1003 | endpoint->type[DIR_OUT] = USB_ENDPOINT_XFER_BULK; | 1004 | endpoint->type[DIR_OUT] = USB_ENDPOINT_XFER_BULK; |
1004 | } | 1005 | if (!endpoint->allocated[DIR_IN]) |
1005 | if (!endpoint->allocated[DIR_IN]) { | ||
1006 | endpoint->type[DIR_IN] = USB_ENDPOINT_XFER_BULK; | 1006 | endpoint->type[DIR_IN] = USB_ENDPOINT_XFER_BULK; |
1007 | } | ||
1008 | 1007 | ||
1009 | REG_ENDPTCTRL(ep_num) = | 1008 | REG_ENDPTCTRL(ep_num) = |
1010 | EPCTRL_RX_DATA_TOGGLE_RST | EPCTRL_RX_ENABLE | | 1009 | EPCTRL_RX_DATA_TOGGLE_RST | EPCTRL_RX_ENABLE | |