2 * Copyright (c) 2007-2008, Juniper Networks, Inc.
3 * Copyright (c) 2008, Excito Elektronik i Skåne AB
4 * Copyright (c) 2008, Michael Trimarchi <trimarchimichael@yahoo.it>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation version 2 of
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
24 #include <asm/byteorder.h>
33 struct ehci_hccr *hccr; /* R/O registers, not need for volatile */
34 volatile struct ehci_hcor *hcor;
36 static uint16_t portreset;
37 static struct QH qh_list __attribute__((aligned(32)));
39 static struct descriptor {
40 struct usb_hub_descriptor hub;
41 struct usb_device_descriptor device;
42 struct usb_linux_config_descriptor config;
43 struct usb_linux_interface_descriptor interface;
44 struct usb_endpoint_descriptor endpoint;
45 } __attribute__ ((packed)) descriptor = {
47 0x8, /* bDescLength */
48 0x29, /* bDescriptorType: hub descriptor */
49 2, /* bNrPorts -- runtime modified */
50 0, /* wHubCharacteristics */
51 10, /* bPwrOn2PwrGood */
52 0, /* bHubCntrCurrent */
53 {}, /* Device removable */
54 {} /* at most 7 ports! XXX */
58 1, /* bDescriptorType: UDESC_DEVICE */
59 cpu_to_le16(0x0200), /* bcdUSB: v2.0 */
60 9, /* bDeviceClass: UDCLASS_HUB */
61 0, /* bDeviceSubClass: UDSUBCLASS_HUB */
62 1, /* bDeviceProtocol: UDPROTO_HSHUBSTT */
63 64, /* bMaxPacketSize: 64 bytes */
64 0x0000, /* idVendor */
65 0x0000, /* idProduct */
66 cpu_to_le16(0x0100), /* bcdDevice */
67 1, /* iManufacturer */
69 0, /* iSerialNumber */
70 1 /* bNumConfigurations: 1 */
74 2, /* bDescriptorType: UDESC_CONFIG */
76 1, /* bNumInterface */
77 1, /* bConfigurationValue */
78 0, /* iConfiguration */
79 0x40, /* bmAttributes: UC_SELF_POWER */
84 4, /* bDescriptorType: UDESC_INTERFACE */
85 0, /* bInterfaceNumber */
86 0, /* bAlternateSetting */
87 1, /* bNumEndpoints */
88 9, /* bInterfaceClass: UICLASS_HUB */
89 0, /* bInterfaceSubClass: UISUBCLASS_HUB */
90 0, /* bInterfaceProtocol: UIPROTO_HSHUBSTT */
95 5, /* bDescriptorType: UDESC_ENDPOINT */
96 0x81, /* bEndpointAddress:
97 * UE_DIR_IN | EHCI_INTR_ENDPT
99 3, /* bmAttributes: UE_INTERRUPT */
100 8, /* wMaxPacketSize */
105 #if defined(CONFIG_EHCI_IS_TDI)
106 #define ehci_is_TDI() (1)
108 #define ehci_is_TDI() (0)
111 void __ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
116 void ehci_powerup_fixup(uint32_t *status_reg, uint32_t *reg)
117 __attribute__((weak, alias("__ehci_powerup_fixup")));
119 static int handshake(uint32_t *ptr, uint32_t mask, uint32_t done, int usec)
123 result = ehci_readl(ptr);
125 if (result == ~(uint32_t)0)
135 static int ehci_reset(void)
142 cmd = ehci_readl(&hcor->or_usbcmd);
143 cmd = (cmd & ~CMD_RUN) | CMD_RESET;
144 ehci_writel(&hcor->or_usbcmd, cmd);
145 ret = handshake((uint32_t *)&hcor->or_usbcmd, CMD_RESET, 0, 250 * 1000);
147 printf("EHCI fail to reset\n");
152 reg_ptr = (uint32_t *)((u8 *)hcor + USBMODE);
153 tmp = ehci_readl(reg_ptr);
154 tmp |= USBMODE_CM_HC;
155 #if defined(CONFIG_EHCI_MMIO_BIG_ENDIAN)
158 ehci_writel(reg_ptr, tmp);
161 #ifdef CONFIG_USB_EHCI_TXFIFO_THRESH
162 cmd = ehci_readl(&hcor->or_txfilltuning);
163 cmd &= ~TXFIFO_THRESH(0x3f);
164 cmd |= TXFIFO_THRESH(CONFIG_USB_EHCI_TXFIFO_THRESH);
165 ehci_writel(&hcor->or_txfilltuning, cmd);
171 static int ehci_td_buffer(struct qTD *td, void *buf, size_t sz)
173 uint32_t delta, next;
174 uint32_t addr = (uint32_t)buf;
175 size_t rsz = roundup(sz, 32);
179 debug("EHCI-HCD: Misaligned buffer size (%08x)\n", sz);
182 debug("EHCI-HCD: Misaligned buffer address (%p)\n", buf);
186 flush_dcache_range(addr, addr + rsz);
187 td->qt_buffer[idx] = cpu_to_hc32(addr);
188 td->qt_buffer_hi[idx] = 0;
189 next = (addr + 4096) & ~4095;
199 debug("out of buffer pointers (%u bytes left)\n", sz);
207 ehci_submit_async(struct usb_device *dev, unsigned long pipe, void *buffer,
208 int length, struct devrequest *req)
210 static struct QH qh __attribute__((aligned(32)));
211 static struct qTD qtd[3] __attribute__((aligned (32)));
214 volatile struct qTD *vtd;
217 uint32_t endpt, token, usbsts;
223 debug("dev=%p, pipe=%lx, buffer=%p, length=%d, req=%p\n", dev, pipe,
224 buffer, length, req);
226 debug("req=%u (%#x), type=%u (%#x), value=%u (%#x), index=%u\n",
227 req->request, req->request,
228 req->requesttype, req->requesttype,
229 le16_to_cpu(req->value), le16_to_cpu(req->value),
230 le16_to_cpu(req->index));
232 memset(&qh, 0, sizeof(struct QH));
233 memset(qtd, 0, sizeof(qtd));
235 toggle = usb_gettoggle(dev, usb_pipeendpoint(pipe), usb_pipeout(pipe));
238 * Setup QH (3.6 in ehci-r10.pdf)
240 * qh_link ................. 03-00 H
241 * qh_endpt1 ............... 07-04 H
242 * qh_endpt2 ............... 0B-08 H
244 * qh_overlay.qt_next ...... 13-10 H
245 * - qh_overlay.qt_altnext
247 qh.qh_link = cpu_to_hc32((uint32_t)&qh_list | QH_LINK_TYPE_QH);
248 c = (usb_pipespeed(pipe) != USB_SPEED_HIGH &&
249 usb_pipeendpoint(pipe) == 0) ? 1 : 0;
252 (usb_maxpacket(dev, pipe) << 16) |
255 (usb_pipespeed(pipe) << 12) |
256 (usb_pipeendpoint(pipe) << 8) |
257 (0 << 7) | (usb_pipedevice(pipe) << 0);
258 qh.qh_endpt1 = cpu_to_hc32(endpt);
260 (dev->portnr << 23) |
261 (dev->parent->devnum << 16) | (0 << 8) | (0 << 0);
262 qh.qh_endpt2 = cpu_to_hc32(endpt);
263 qh.qh_overlay.qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
265 tdp = &qh.qh_overlay.qt_next;
269 * Setup request qTD (3.5 in ehci-r10.pdf)
271 * qt_next ................ 03-00 H
272 * qt_altnext ............. 07-04 H
273 * qt_token ............... 0B-08 H
275 * [ buffer, buffer_hi ] loaded with "req".
277 qtd[qtd_counter].qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
278 qtd[qtd_counter].qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
280 (sizeof(*req) << 16) |
281 (0 << 15) | (0 << 12) | (3 << 10) | (2 << 8) | (0x80 << 0);
282 qtd[qtd_counter].qt_token = cpu_to_hc32(token);
283 if (ehci_td_buffer(&qtd[qtd_counter], req, sizeof(*req)) != 0) {
284 debug("unable construct SETUP td\n");
287 /* Update previous qTD! */
288 *tdp = cpu_to_hc32((uint32_t)&qtd[qtd_counter]);
289 tdp = &qtd[qtd_counter++].qt_next;
293 if (length > 0 || req == NULL) {
295 * Setup request qTD (3.5 in ehci-r10.pdf)
297 * qt_next ................ 03-00 H
298 * qt_altnext ............. 07-04 H
299 * qt_token ............... 0B-08 H
301 * [ buffer, buffer_hi ] loaded with "buffer".
303 qtd[qtd_counter].qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
304 qtd[qtd_counter].qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
305 token = (toggle << 31) |
307 ((req == NULL ? 1 : 0) << 15) |
310 ((usb_pipein(pipe) ? 1 : 0) << 8) | (0x80 << 0);
311 qtd[qtd_counter].qt_token = cpu_to_hc32(token);
312 if (ehci_td_buffer(&qtd[qtd_counter], buffer, length) != 0) {
313 debug("unable construct DATA td\n");
316 /* Update previous qTD! */
317 *tdp = cpu_to_hc32((uint32_t)&qtd[qtd_counter]);
318 tdp = &qtd[qtd_counter++].qt_next;
323 * Setup request qTD (3.5 in ehci-r10.pdf)
325 * qt_next ................ 03-00 H
326 * qt_altnext ............. 07-04 H
327 * qt_token ............... 0B-08 H
329 qtd[qtd_counter].qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
330 qtd[qtd_counter].qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
331 token = (toggle << 31) |
336 ((usb_pipein(pipe) ? 0 : 1) << 8) | (0x80 << 0);
337 qtd[qtd_counter].qt_token = cpu_to_hc32(token);
338 /* Update previous qTD! */
339 *tdp = cpu_to_hc32((uint32_t)&qtd[qtd_counter]);
340 tdp = &qtd[qtd_counter++].qt_next;
343 qh_list.qh_link = cpu_to_hc32((uint32_t)&qh | QH_LINK_TYPE_QH);
346 flush_dcache_range((uint32_t)&qh_list,
347 (uint32_t)&qh_list + sizeof(struct QH));
348 flush_dcache_range((uint32_t)&qh, (uint32_t)&qh + sizeof(struct QH));
349 flush_dcache_range((uint32_t)qtd, (uint32_t)qtd + sizeof(qtd));
351 usbsts = ehci_readl(&hcor->or_usbsts);
352 ehci_writel(&hcor->or_usbsts, (usbsts & 0x3f));
354 /* Enable async. schedule. */
355 cmd = ehci_readl(&hcor->or_usbcmd);
357 ehci_writel(&hcor->or_usbcmd, cmd);
359 ret = handshake((uint32_t *)&hcor->or_usbsts, STD_ASS, STD_ASS,
362 printf("EHCI fail timeout STD_ASS set\n");
366 /* Wait for TDs to be processed. */
368 vtd = &qtd[qtd_counter - 1];
369 timeout = USB_TIMEOUT_MS(pipe);
371 /* Invalidate dcache */
372 invalidate_dcache_range((uint32_t)&qh_list,
373 (uint32_t)&qh_list + sizeof(struct QH));
374 invalidate_dcache_range((uint32_t)&qh,
375 (uint32_t)&qh + sizeof(struct QH));
376 invalidate_dcache_range((uint32_t)qtd,
377 (uint32_t)qtd + sizeof(qtd));
379 token = hc32_to_cpu(vtd->qt_token);
383 } while (get_timer(ts) < timeout);
385 /* Invalidate the memory area occupied by buffer */
386 invalidate_dcache_range(((uint32_t)buffer & ~31),
387 ((uint32_t)buffer & ~31) + roundup(length, 32));
389 /* Check that the TD processing happened */
391 printf("EHCI timed out on TD - token=%#x\n", token);
394 /* Disable async schedule. */
395 cmd = ehci_readl(&hcor->or_usbcmd);
397 ehci_writel(&hcor->or_usbcmd, cmd);
399 ret = handshake((uint32_t *)&hcor->or_usbsts, STD_ASS, 0,
402 printf("EHCI fail timeout STD_ASS reset\n");
406 qh_list.qh_link = cpu_to_hc32((uint32_t)&qh_list | QH_LINK_TYPE_QH);
408 token = hc32_to_cpu(qh.qh_overlay.qt_token);
409 if (!(token & 0x80)) {
410 debug("TOKEN=%#x\n", token);
411 switch (token & 0xfc) {
413 toggle = token >> 31;
414 usb_settoggle(dev, usb_pipeendpoint(pipe),
415 usb_pipeout(pipe), toggle);
419 dev->status = USB_ST_STALLED;
423 dev->status = USB_ST_BUF_ERR;
427 dev->status = USB_ST_BABBLE_DET;
430 dev->status = USB_ST_CRC_ERR;
431 if ((token & 0x40) == 0x40)
432 dev->status |= USB_ST_STALLED;
435 dev->act_len = length - ((token >> 16) & 0x7fff);
438 debug("dev=%u, usbsts=%#x, p[1]=%#x, p[2]=%#x\n",
439 dev->devnum, ehci_readl(&hcor->or_usbsts),
440 ehci_readl(&hcor->or_portsc[0]),
441 ehci_readl(&hcor->or_portsc[1]));
444 return (dev->status != USB_ST_NOT_PROC) ? 0 : -1;
450 static inline int min3(int a, int b, int c)
461 ehci_submit_root(struct usb_device *dev, unsigned long pipe, void *buffer,
462 int length, struct devrequest *req)
469 uint32_t *status_reg;
471 if (le16_to_cpu(req->index) > CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS) {
472 printf("The request port(%d) is not configured\n",
473 le16_to_cpu(req->index) - 1);
476 status_reg = (uint32_t *)&hcor->or_portsc[
477 le16_to_cpu(req->index) - 1];
480 debug("req=%u (%#x), type=%u (%#x), value=%u, index=%u\n",
481 req->request, req->request,
482 req->requesttype, req->requesttype,
483 le16_to_cpu(req->value), le16_to_cpu(req->index));
485 typeReq = req->request | req->requesttype << 8;
488 case DeviceRequest | USB_REQ_GET_DESCRIPTOR:
489 switch (le16_to_cpu(req->value) >> 8) {
491 debug("USB_DT_DEVICE request\n");
492 srcptr = &descriptor.device;
496 debug("USB_DT_CONFIG config\n");
497 srcptr = &descriptor.config;
501 debug("USB_DT_STRING config\n");
502 switch (le16_to_cpu(req->value) & 0xff) {
503 case 0: /* Language */
508 srcptr = "\16\3u\0-\0b\0o\0o\0t\0";
511 case 2: /* Product */
512 srcptr = "\52\3E\0H\0C\0I\0 "
514 "\0C\0o\0n\0t\0r\0o\0l\0l\0e\0r\0";
518 debug("unknown value DT_STRING %x\n",
519 le16_to_cpu(req->value));
524 debug("unknown value %x\n", le16_to_cpu(req->value));
528 case USB_REQ_GET_DESCRIPTOR | ((USB_DIR_IN | USB_RT_HUB) << 8):
529 switch (le16_to_cpu(req->value) >> 8) {
531 debug("USB_DT_HUB config\n");
532 srcptr = &descriptor.hub;
536 debug("unknown value %x\n", le16_to_cpu(req->value));
540 case USB_REQ_SET_ADDRESS | (USB_RECIP_DEVICE << 8):
541 debug("USB_REQ_SET_ADDRESS\n");
542 rootdev = le16_to_cpu(req->value);
544 case DeviceOutRequest | USB_REQ_SET_CONFIGURATION:
545 debug("USB_REQ_SET_CONFIGURATION\n");
548 case USB_REQ_GET_STATUS | ((USB_DIR_IN | USB_RT_HUB) << 8):
549 tmpbuf[0] = 1; /* USB_STATUS_SELFPOWERED */
554 case USB_REQ_GET_STATUS | ((USB_RT_PORT | USB_DIR_IN) << 8):
555 memset(tmpbuf, 0, 4);
556 reg = ehci_readl(status_reg);
557 if (reg & EHCI_PS_CS)
558 tmpbuf[0] |= USB_PORT_STAT_CONNECTION;
559 if (reg & EHCI_PS_PE)
560 tmpbuf[0] |= USB_PORT_STAT_ENABLE;
561 if (reg & EHCI_PS_SUSP)
562 tmpbuf[0] |= USB_PORT_STAT_SUSPEND;
563 if (reg & EHCI_PS_OCA)
564 tmpbuf[0] |= USB_PORT_STAT_OVERCURRENT;
565 if (reg & EHCI_PS_PR)
566 tmpbuf[0] |= USB_PORT_STAT_RESET;
567 if (reg & EHCI_PS_PP)
568 tmpbuf[1] |= USB_PORT_STAT_POWER >> 8;
571 switch ((reg >> 26) & 3) {
575 tmpbuf[1] |= USB_PORT_STAT_LOW_SPEED >> 8;
579 tmpbuf[1] |= USB_PORT_STAT_HIGH_SPEED >> 8;
583 tmpbuf[1] |= USB_PORT_STAT_HIGH_SPEED >> 8;
586 if (reg & EHCI_PS_CSC)
587 tmpbuf[2] |= USB_PORT_STAT_C_CONNECTION;
588 if (reg & EHCI_PS_PEC)
589 tmpbuf[2] |= USB_PORT_STAT_C_ENABLE;
590 if (reg & EHCI_PS_OCC)
591 tmpbuf[2] |= USB_PORT_STAT_C_OVERCURRENT;
592 if (portreset & (1 << le16_to_cpu(req->index)))
593 tmpbuf[2] |= USB_PORT_STAT_C_RESET;
598 case USB_REQ_SET_FEATURE | ((USB_DIR_OUT | USB_RT_PORT) << 8):
599 reg = ehci_readl(status_reg);
600 reg &= ~EHCI_PS_CLEAR;
601 switch (le16_to_cpu(req->value)) {
602 case USB_PORT_FEAT_ENABLE:
604 ehci_writel(status_reg, reg);
606 case USB_PORT_FEAT_POWER:
607 if (HCS_PPC(ehci_readl(&hccr->cr_hcsparams))) {
609 ehci_writel(status_reg, reg);
612 case USB_PORT_FEAT_RESET:
613 if ((reg & (EHCI_PS_PE | EHCI_PS_CS)) == EHCI_PS_CS &&
615 EHCI_PS_IS_LOWSPEED(reg)) {
616 /* Low speed device, give up ownership. */
617 debug("port %d low speed --> companion\n",
620 ehci_writel(status_reg, reg);
627 ehci_writel(status_reg, reg);
629 * caller must wait, then call GetPortStatus
630 * usb 2.0 specification say 50 ms resets on
633 ehci_powerup_fixup(status_reg, ®);
635 ehci_writel(status_reg, reg & ~EHCI_PS_PR);
637 * A host controller must terminate the reset
638 * and stabilize the state of the port within
641 ret = handshake(status_reg, EHCI_PS_PR, 0,
645 1 << le16_to_cpu(req->index);
647 printf("port(%d) reset error\n",
648 le16_to_cpu(req->index) - 1);
652 debug("unknown feature %x\n", le16_to_cpu(req->value));
655 /* unblock posted writes */
656 (void) ehci_readl(&hcor->or_usbcmd);
658 case USB_REQ_CLEAR_FEATURE | ((USB_DIR_OUT | USB_RT_PORT) << 8):
659 reg = ehci_readl(status_reg);
660 switch (le16_to_cpu(req->value)) {
661 case USB_PORT_FEAT_ENABLE:
664 case USB_PORT_FEAT_C_ENABLE:
665 reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_PE;
667 case USB_PORT_FEAT_POWER:
668 if (HCS_PPC(ehci_readl(&hccr->cr_hcsparams)))
669 reg = reg & ~(EHCI_PS_CLEAR | EHCI_PS_PP);
670 case USB_PORT_FEAT_C_CONNECTION:
671 reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_CSC;
673 case USB_PORT_FEAT_OVER_CURRENT:
674 reg = (reg & ~EHCI_PS_CLEAR) | EHCI_PS_OCC;
676 case USB_PORT_FEAT_C_RESET:
677 portreset &= ~(1 << le16_to_cpu(req->index));
680 debug("unknown feature %x\n", le16_to_cpu(req->value));
683 ehci_writel(status_reg, reg);
684 /* unblock posted write */
685 (void) ehci_readl(&hcor->or_usbcmd);
688 debug("Unknown request\n");
693 len = min3(srclen, le16_to_cpu(req->length), length);
694 if (srcptr != NULL && len > 0)
695 memcpy(buffer, srcptr, len);
704 debug("requesttype=%x, request=%x, value=%x, index=%x, length=%x\n",
705 req->requesttype, req->request, le16_to_cpu(req->value),
706 le16_to_cpu(req->index), le16_to_cpu(req->length));
709 dev->status = USB_ST_STALLED;
713 int usb_lowlevel_stop(void)
715 return ehci_hcd_stop();
718 int usb_lowlevel_init(void)
723 if (ehci_hcd_init() != 0)
726 /* EHCI spec section 4.1 */
727 if (ehci_reset() != 0)
730 #if defined(CONFIG_EHCI_HCD_INIT_AFTER_RESET)
731 if (ehci_hcd_init() != 0)
735 /* Set head of reclaim list */
736 memset(&qh_list, 0, sizeof(qh_list));
737 qh_list.qh_link = cpu_to_hc32((uint32_t)&qh_list | QH_LINK_TYPE_QH);
738 qh_list.qh_endpt1 = cpu_to_hc32((1 << 15) | (USB_SPEED_HIGH << 12));
739 qh_list.qh_curtd = cpu_to_hc32(QT_NEXT_TERMINATE);
740 qh_list.qh_overlay.qt_next = cpu_to_hc32(QT_NEXT_TERMINATE);
741 qh_list.qh_overlay.qt_altnext = cpu_to_hc32(QT_NEXT_TERMINATE);
742 qh_list.qh_overlay.qt_token = cpu_to_hc32(0x40);
744 /* Set async. queue head pointer. */
745 ehci_writel(&hcor->or_asynclistaddr, (uint32_t)&qh_list);
747 reg = ehci_readl(&hccr->cr_hcsparams);
748 descriptor.hub.bNbrPorts = HCS_N_PORTS(reg);
749 printf("Register %x NbrPorts %d\n", reg, descriptor.hub.bNbrPorts);
750 /* Port Indicators */
751 if (HCS_INDICATOR(reg))
752 descriptor.hub.wHubCharacteristics |= 0x80;
753 /* Port Power Control */
755 descriptor.hub.wHubCharacteristics |= 0x01;
757 /* Start the host controller. */
758 cmd = ehci_readl(&hcor->or_usbcmd);
760 * Philips, Intel, and maybe others need CMD_RUN before the
761 * root hub will detect new devices (why?); NEC doesn't
763 cmd &= ~(CMD_LRESET|CMD_IAAD|CMD_PSE|CMD_ASE|CMD_RESET);
765 ehci_writel(&hcor->or_usbcmd, cmd);
767 /* take control over the ports */
768 cmd = ehci_readl(&hcor->or_configflag);
770 ehci_writel(&hcor->or_configflag, cmd);
771 /* unblock posted write */
772 cmd = ehci_readl(&hcor->or_usbcmd);
774 reg = HC_VERSION(ehci_readl(&hccr->cr_capbase));
775 printf("USB EHCI %x.%02x\n", reg >> 8, reg & 0xff);
783 submit_bulk_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
787 if (usb_pipetype(pipe) != PIPE_BULK) {
788 debug("non-bulk pipe (type=%lu)", usb_pipetype(pipe));
791 return ehci_submit_async(dev, pipe, buffer, length, NULL);
795 submit_control_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
796 int length, struct devrequest *setup)
799 if (usb_pipetype(pipe) != PIPE_CONTROL) {
800 debug("non-control pipe (type=%lu)", usb_pipetype(pipe));
804 if (usb_pipedevice(pipe) == rootdev) {
806 dev->speed = USB_SPEED_HIGH;
807 return ehci_submit_root(dev, pipe, buffer, length, setup);
809 return ehci_submit_async(dev, pipe, buffer, length, setup);
813 submit_int_msg(struct usb_device *dev, unsigned long pipe, void *buffer,
814 int length, int interval)
817 debug("dev=%p, pipe=%lu, buffer=%p, length=%d, interval=%d",
818 dev, pipe, buffer, length, interval);
819 return ehci_submit_async(dev, pipe, buffer, length, NULL);