summaryrefslogtreecommitdiff
path: root/os/mpc/usb.h
diff options
context:
space:
mode:
authorCharles.Forsyth <devnull@localhost>2006-12-22 21:39:35 +0000
committerCharles.Forsyth <devnull@localhost>2006-12-22 21:39:35 +0000
commit74a4d8c26dd3c1e9febcb717cfd6cb6512991a7a (patch)
treec6e220ba61db3a6ea4052e6841296d829654e664 /os/mpc/usb.h
parent46439007cf417cbd9ac8049bb4122c890097a0fa (diff)
20060303
Diffstat (limited to 'os/mpc/usb.h')
-rw-r--r--os/mpc/usb.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/os/mpc/usb.h b/os/mpc/usb.h
new file mode 100644
index 00000000..1d750f3f
--- /dev/null
+++ b/os/mpc/usb.h
@@ -0,0 +1,62 @@
+/*
+ * USB packet definitions
+ */
+
+#define GET2(p) ((((p)[1]&0xFF)<<8)|((p)[0]&0xFF))
+#define PUT2(p,v) {((p)[0] = (v)); ((p)[1] = (v)>>8);}
+
+enum {
+ /* request type */
+ RH2D = 0<<7,
+ RD2H = 1<<7,
+ Rstandard = 0<<5,
+ Rclass = 1<<5,
+ Rvendor = 2<<5,
+ Rdevice = 0,
+ Rinterface = 1,
+ Rendpt = 2,
+ Rother = 3,
+
+ /* standard requests */
+ GET_STATUS = 0,
+ CLEAR_FEATURE = 1,
+ SET_FEATURE = 3,
+ SET_ADDRESS = 5,
+ GET_DESCRIPTOR = 6,
+ SET_DESCRIPTOR = 7,
+ GET_CONFIGURATION = 8,
+ SET_CONFIGURATION = 9,
+ GET_INTERFACE = 10,
+ SET_INTERFACE = 11,
+ SYNCH_FRAME = 12,
+
+ /* hub class feature selectors */
+ C_HUB_LOCAL_POWER = 0,
+ C_HUB_OVER_CURRENT,
+ PORT_CONNECTION = 0,
+ PORT_ENABLE = 1,
+ PORT_SUSPEND = 2,
+ PORT_OVER_CURRENT = 3,
+ PORT_RESET = 4,
+ PORT_POWER = 8,
+ PORT_LOW_SPEED = 9,
+ C_PORT_CONNECTION = 16,
+ C_PORT_ENABLE,
+ C_PORT_SUSPEND,
+ C_PORT_OVER_CURRENT,
+ C_PORT_RESET,
+
+ /* descriptor types */
+ DEVICE = 1,
+ CONFIGURATION = 2,
+ STRING = 3,
+ INTERFACE = 4,
+ ENDPOINT = 5,
+ HID = 0x21,
+ REPORT = 0x22,
+ PHYSICAL = 0x23,
+
+ /* feature selectors */
+ DEVICE_REMOTE_WAKEUP = 1,
+ ENDPOINT_STALL = 0,
+};