USB: add generic class/vendor request handling
[bertos.git] / bertos / drv / usb.h
index b68d9bf6fb5770007b3acede54ef7eba83af63fd..9909eb38f99dc5fd6e0a0d4f0b995e6c9a7cea1f 100644 (file)
@@ -252,6 +252,16 @@ typedef struct usb_string_descriptor
 #define USB_CLASS_APP_SPEC             0xfe
 #define USB_CLASS_VENDOR_SPEC          0xff
 
+/* USB Device subclasses */
+#define USB_CDC_SUBCLASS_ACM                    0x02
+#define USB_CDC_SUBCLASS_ETHERNET               0x06
+#define USB_CDC_SUBCLASS_WHCM                   0x08
+#define USB_CDC_SUBCLASS_DMM                    0x09
+#define USB_CDC_SUBCLASS_MDLM                   0x0a
+#define USB_CDC_SUBCLASS_OBEX                   0x0b
+#define USB_CDC_SUBCLASS_EEM                    0x0c
+#define USB_CDC_SUBCLASS_NCM                    0x0d
+
 /* Device configuration descriptor */
 typedef struct usb_config_descriptor
 {
@@ -321,6 +331,10 @@ struct usb_device
        usb_device_descriptor_t *device;
        usb_descriptor_header_t **config;
        usb_string_descriptor_t **strings;
+
+       /* Callbacks */
+       void (*event_cb)(usb_ctrlrequest_t *);
+
        /* Private data */
        bool configured;
 };