Home | History | Annotate | Download | only in include
      1 /*
      2  * usb200.h
      3  *
      4  * This file is part of the ReactOS PSDK package.
      5  *
      6  * Contributors:
      7  *   Magnus Olsen.
      8  *
      9  * THIS SOFTWARE IS NOT COPYRIGHTED
     10  *
     11  * This source code is offered for use in the public domain. You may
     12  * use, modify or distribute it freely.
     13  *
     14  * This code is distributed in the hope that it will be useful but
     15  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
     16  * DISCLAIMED. This includes but is not limited to warranties of
     17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
     18  *
     19  */
     20 
     21 #pragma once
     22 
     23 #include "usb100.h"
     24 
     25 #include <pshpack1.h>
     26 
     27 typedef enum _USB_DEVICE_TYPE {
     28   Usb11Device = 0,
     29   Usb20Device
     30 } USB_DEVICE_TYPE;
     31 
     32 typedef enum _USB_DEVICE_SPEED {
     33   UsbLowSpeed = 0,
     34   UsbFullSpeed,
     35   UsbHighSpeed
     36 } USB_DEVICE_SPEED;
     37 
     38 #define USB_PORT_STATUS_CONNECT                       0x0001
     39 #define USB_PORT_STATUS_ENABLE                        0x0002
     40 #define USB_PORT_STATUS_SUSPEND                       0x0004
     41 #define USB_PORT_STATUS_OVER_CURRENT                  0x0008
     42 #define USB_PORT_STATUS_RESET                         0x0010
     43 #define USB_PORT_STATUS_POWER                         0x0100
     44 #define USB_PORT_STATUS_LOW_SPEED                     0x0200
     45 #define USB_PORT_STATUS_HIGH_SPEED                    0x0400
     46 
     47 
     48 typedef union _BM_REQUEST_TYPE {
     49   struct _BM {
     50     UCHAR Recipient:2;
     51     UCHAR Reserved:3;
     52     UCHAR Type:2;
     53     UCHAR Dir:1;
     54   } _BM;
     55   UCHAR B;
     56 } BM_REQUEST_TYPE, *PBM_REQUEST_TYPE;
     57 
     58 typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET {
     59   BM_REQUEST_TYPE bmRequestType;
     60   UCHAR bRequest;
     61   union _wValue {
     62     __C89_NAMELESS struct {
     63       UCHAR LowByte;
     64       UCHAR HiByte;
     65     };
     66     USHORT W;
     67   } wValue;
     68   union _wIndex {
     69     __C89_NAMELESS struct {
     70       UCHAR LowByte;
     71       UCHAR HiByte;
     72     };
     73     USHORT W;
     74   } wIndex;
     75   USHORT wLength;
     76 } USB_DEFAULT_PIPE_SETUP_PACKET, *PUSB_DEFAULT_PIPE_SETUP_PACKET;
     77 
     78 C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET) == 8);
     79 
     80 #define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE          0x06
     81 #define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07
     82 
     83 typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR {
     84   UCHAR bLength;
     85   UCHAR bDescriptorType;
     86   USHORT bcdUSB;
     87   UCHAR bDeviceClass;
     88   UCHAR bDeviceSubClass;
     89   UCHAR bDeviceProtocol;
     90   UCHAR bMaxPacketSize0;
     91   UCHAR bNumConfigurations;
     92   UCHAR bReserved;
     93 } USB_DEVICE_QUALIFIER_DESCRIPTOR, *PUSB_DEVICE_QUALIFIER_DESCRIPTOR;
     94 
     95 typedef union _USB_HIGH_SPEED_MAXPACKET {
     96   struct _MP {
     97     USHORT MaxPacket:11;
     98     USHORT HSmux:2;
     99     USHORT Reserved:3;
    100   } _MP;
    101   USHORT us;
    102 } USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET;
    103 
    104 #define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE     0x0B
    105 
    106 typedef struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR {
    107   UCHAR bLength;
    108   UCHAR bDescriptorType;
    109   UCHAR bFirstInterface;
    110   UCHAR bInterfaceCount;
    111   UCHAR bFunctionClass;
    112   UCHAR bFunctionSubClass;
    113   UCHAR bFunctionProtocol;
    114   UCHAR iFunction;
    115 } USB_INTERFACE_ASSOCIATION_DESCRIPTOR, *PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR;
    116 
    117 #include <poppack.h>
    118 
    119