}
}
-static void ep_enable(int num, int in, int maxpacket)
+static void ep_enable(int num, int in, int type, int maxpacket)
{
struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor;
unsigned n;
n = readl(&udc->epctrl[num]);
if (in)
- n |= (CTRL_TXE | CTRL_TXR | CTRL_TXT_BULK);
+ n |= (CTRL_TXE | CTRL_TXR | CTRL_TXT(type));
else
- n |= (CTRL_RXE | CTRL_RXR | CTRL_RXT_BULK);
+ n |= (CTRL_RXE | CTRL_RXR | CTRL_RXT(type));
if (num != 0) {
struct ept_queue_head *head = ci_get_qh(num, in);
const struct usb_endpoint_descriptor *desc)
{
struct ci_ep *ci_ep = container_of(ep, struct ci_ep, ep);
- int num, in;
+ int num, in, type;
num = desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
in = (desc->bEndpointAddress & USB_DIR_IN) != 0;
return -EBUSY;
}
+ type = usb_endpoint_type(desc);
ci_ep->desc = desc;
ep->desc = desc;
ep->maxpacket = max;
}
}
- ep_enable(num, in, ep->maxpacket);
+ ep_enable(num, in, type, ep->maxpacket);
DBG("%s: num=%d maxpacket=%d\n", __func__, num, ep->maxpacket);
return 0;
}
struct ept_queue_head *head;
struct usb_ctrlrequest r;
int status = 0;
- int num, in, _num, _in, i;
+ int num, in, _num, _in, i, type;
char *buf;
ci_req = controller.ep0_req;
& USB_ENDPOINT_NUMBER_MASK;
in = (ep->desc->bEndpointAddress
& USB_DIR_IN) != 0;
+ type = usb_endpoint_type(ep->desc);
if ((num == _num) && (in == _in)) {
- ep_enable(num, in, ep->ep.maxpacket);
+ ep_enable(num, in, type, ep->ep.maxpacket);
usb_ep_queue(controller.gadget.ep0,
req, 0);
break;