diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2007-10-28 14:02:51 +0000 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2007-10-28 14:02:51 +0000 |
commit | fec406c7a29f015c7fe1ded881e565a73b1e0d09 (patch) | |
tree | 7fc78bbabd16e0220152b9be07107bbaf2512ce7 /firmware | |
parent | b77893e4d5636008ceee56929c7477f7dd064ca9 (diff) |
add some informations about this file
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15344 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/usb/arcotg_dcd.c | 24 | ||||
-rw-r--r-- | firmware/export/usb_ch9.h | 27 |
2 files changed, 30 insertions, 21 deletions
diff --git a/firmware/drivers/usb/arcotg_dcd.c b/firmware/drivers/usb/arcotg_dcd.c index fe8ae803c0..c45a790c04 100644 --- a/firmware/drivers/usb/arcotg_dcd.c +++ b/firmware/drivers/usb/arcotg_dcd.c @@ -467,25 +467,17 @@ static void resume_int(void) static void reset_int(void) { - struct timer t; - /* clear device address */ UDC_DEVICEADDR = 0 << 25; /* update usb state */ dcd_controller.usb_state = USB_STATE_DEFAULT; - timer_set(&t, RESET_TIMER); - UDC_ENDPTSETUPSTAT = UDC_ENDPTSETUPSTAT; UDC_ENDPTCOMPLETE = UDC_ENDPTCOMPLETE; - while (UDC_ENDPTPRIME) { /* prime and flush pending transfers */ - if (timer_expired(&t)) { - logf("TIMEOUT->p&f"); - } - } - + /* prime and flush pending transfers */ + while (UDC_ENDPTPRIME); UDC_ENDPTFLUSH = ~0; if ((UDC_PORTSC1 & PORTSCX_PORT_RESET) == 0) { @@ -493,19 +485,9 @@ static void reset_int(void) } /* clear USB Reset status bit */ - UDC_USBSTS = USB_STS_RESET; - - /* wait for port change */ - while ((UDC_USBSTS & USB_STS_PORT_CHANGE) == 0) { - if (timer_expired(&t)) { - logf("TIMEOUT->portchange"); - } - } - - UDC_USBSTS = (1 << 2); + UDC_USBSTS |= USB_STS_RESET; } - /*-------------------------------------------------------------------------*/ /* usb controller ops */ diff --git a/firmware/export/usb_ch9.h b/firmware/export/usb_ch9.h index a40bc4e4ae..b8fe181158 100644 --- a/firmware/export/usb_ch9.h +++ b/firmware/export/usb_ch9.h @@ -21,6 +21,33 @@ * ****************************************************************************/ +/* + * This file holds USB constants and structures that are needed for + * USB device APIs. These are used by the USB device model, which is + * defined in chapter 9 of the USB 2.0 specification and in the + * Wireless USB 1.0 (spread around). + * + * USB 2.0 adds an additional "On The Go" (OTG) mode, which lets systems + * act either as a USB master/host or as a USB slave/device. That means + * the master and slave side APIs benefit from working well together. + * + * There's also "Wireless USB", using low power short range radios for + * peripheral interconnection but otherwise building on the USB framework. + * + * Note all descriptors are declared '__attribute__((packed))' so that: + * + * [a] they never get padded, either internally (USB spec writers + * probably handled that) or externally; + * + * [b] so that accessing bigger-than-a-bytes fields will never + * generate bus errors on any platform, even when the location of + * its descriptor inside a bundle isn't "naturally aligned", and + * + * [c] for consistency, removing all doubt even when it appears to + * someone that the two other points are non-issues for that + * particular descriptor type. + */ + #ifndef _CH9_H_ #define _CH9_H_ |