summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-12-19 17:49:53 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2010-12-19 17:49:53 +0000
commita8017c26317f8f47e6684bed887ff8bc3993c5d0 (patch)
tree4d0c223ae80863744f083f18c8906a1e43e20cf2 /nuttx/include
parentd7e9d1011eafa7f0d8fc272566e3c8c9afaec83c (diff)
downloadpx4-nuttx-a8017c26317f8f47e6684bed887ff8bc3993c5d0.tar.gz
px4-nuttx-a8017c26317f8f47e6684bed887ff8bc3993c5d0.tar.bz2
px4-nuttx-a8017c26317f8f47e6684bed887ff8bc3993c5d0.zip
More descriptor stuff
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3197 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rwxr-xr-xnuttx/include/nuttx/usb/ohci.h28
-rw-r--r--nuttx/include/nuttx/usb/usbhost.h2
2 files changed, 29 insertions, 1 deletions
diff --git a/nuttx/include/nuttx/usb/ohci.h b/nuttx/include/nuttx/usb/ohci.h
index d23e1aa67..d8d1d5cdf 100755
--- a/nuttx/include/nuttx/usb/ohci.h
+++ b/nuttx/include/nuttx/usb/ohci.h
@@ -263,6 +263,34 @@
/* Bits 21-31: Reserved */
/* Transfer Descriptors *****************************************************/
+/* Endpoint Descriptor Offsets (4.2.1) */
+
+#define ED_CONTROL_OFFSET (0x00) /* TD status bits */
+#define ED_TAILP_OFFSET (0x04) /* Current Buffer Pointer (CBP) */
+#define ED_HEADP_OFFSET (0x08) /* Next TD (NextTD) */
+#define ED_NEXTED_OFFSET (0x0c) /* Buffer End (BE) */
+
+/* Endpoint Descriptor Bit Definitions (4.2.2) */
+
+#define ED_CONTROL_FA_SHIFT (0) /* Bits 0-6: Function Address */
+#define ED_CONTROL_FA_MASK (0x7f << ED_CONTROL_FA_SHIFT)
+#define ED_CONTROL_EN_SHIFT (7) /* Bits 7-10: Endpoint number */
+#define ED_CONTROL_EN_MASK (15 << ED_CONTROL_EN_SHIFT)
+#define ED_CONTROL_D_SHIFT (11) /* Bits 11-12: Direction */
+#define ED_CONTROL_D_MASK (3 << ED_CONTROL_D_SHIFT)
+# define ED_CONTROL_D_TD1 (0 << ED_CONTROL_D_SHIFT) /* Get direction from TD */
+# define ED_CONTROL_D_OUT (1 << ED_CONTROL_D_SHIFT) /* OUT */
+# define ED_CONTROL_D_IN (2 << ED_CONTROL_D_SHIFT) /* IN */
+# define ED_CONTROL_D_TD2 (3 << ED_CONTROL_D_SHIFT) /* Get direction from TD */
+#define ED_CONTROL_S (1 << 13) /* Bit 13: Speed (low) */
+#define ED_CONTROL_K (1 << 14) /* Bit 14: Skip */
+#define ED_CONTROL_F (1 << 15) /* Bit 15: Format (isochronous) */
+#define ED_CONTROL_MPS_SHIFT (16) /* Bits 16-26: Maximum packet size */
+#define ED_CONTROL_MPS_MASK (0x7ff << ED_CONTROL_MPS_SHIFT)
+
+#define ED_TAILP_H (1 << 0) /* Bit 0: Halted */
+#define ED_TAILP_C (1 << 1) /* Bit 1: Toggle carry */
+
/* General Transfer Descriptor Offsets (4.3.1) */
#define GTD_STATUS_OFFSET (0x00) /* TD status bits */
diff --git a/nuttx/include/nuttx/usb/usbhost.h b/nuttx/include/nuttx/usb/usbhost.h
index 821d127d2..d197b12e4 100644
--- a/nuttx/include/nuttx/usb/usbhost.h
+++ b/nuttx/include/nuttx/usb/usbhost.h
@@ -466,7 +466,7 @@ struct usbhost_driver_s
*/
int (*transfer)(FAR struct usbhost_driver_s *drvr,
- FAR struct usbhost_epdesc_s *ed,
+ FAR struct usbhost_epdesc_s *ep,
FAR uint8_t *buffer, size_t buflen);
/* Called by the class when an error occurs and driver has been disconnected.