Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
2.2 KiB

  1. #ifndef __USB200_H__
  2. #define __USB200_H__
  3. #include "usb100.h"
  4. #include <PSHPACK1.H>
  5. typedef enum _USB_DEVICE_SPEED {
  6. UsbLowSpeed = 0,
  7. UsbFullSpeed,
  8. UsbHighSpeed
  9. } USB_DEVICE_SPEED;
  10. typedef enum _USB_DEVICE_TYPE {
  11. Usb11Device = 0,
  12. Usb20Device
  13. } USB_DEVICE_TYPE;
  14. // standard definiions for the port status
  15. // word of the HUB port register
  16. #define USB_PORT_STATUS_CONNECT 0x0001
  17. #define USB_PORT_STATUS_ENABLE 0x0002
  18. #define USB_PORT_STATUS_SUSPEND 0x0004
  19. #define USB_PORT_STATUS_OVER_CURRENT 0x0008
  20. #define USB_PORT_STATUS_RESET 0x0010
  21. #define USB_PORT_STATUS_POWER 0x0100
  22. #define USB_PORT_STATUS_LOW_SPEED 0x0200
  23. #define USB_PORT_STATUS_HIGH_SPEED 0x0400
  24. typedef union _BM_REQUEST_TYPE {
  25. struct _BM {
  26. UCHAR Recipient:2;
  27. UCHAR Reserved:3;
  28. UCHAR Type:2;
  29. UCHAR Dir:1;
  30. };
  31. UCHAR B;
  32. } BM_REQUEST_TYPE, *PBM_REQUEST_TYPE;
  33. typedef struct _USB_DEFAULT_PIPE_SETUP_PACKET {
  34. BM_REQUEST_TYPE bmRequestType;
  35. UCHAR bRequest;
  36. union _wValue {
  37. struct {
  38. UCHAR LowByte;
  39. UCHAR HiByte;
  40. };
  41. USHORT W;
  42. } wValue;
  43. union _wIndex {
  44. struct {
  45. UCHAR LowByte;
  46. UCHAR HiByte;
  47. };
  48. USHORT W;
  49. } wIndex;
  50. USHORT wLength;
  51. } USB_DEFAULT_PIPE_SETUP_PACKET, *PUSB_DEFAULT_PIPE_SETUP_PACKET;
  52. // setup packet is eight bytes -- defined by spec
  53. C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET) == 8);
  54. #define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06
  55. typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR {
  56. UCHAR bLength;
  57. UCHAR bDescriptorType;
  58. USHORT bcdUSB;
  59. UCHAR bDeviceClass;
  60. UCHAR bDeviceSubClass;
  61. UCHAR bDeviceProtocol;
  62. UCHAR bMaxPacketSize0;
  63. UCHAR bNumConfigurations;
  64. UCHAR bReserved;
  65. } USB_DEVICE_QUALIFIER_DESCRIPTOR, *PUSB_DEVICE_QUALIFIER_DESCRIPTOR;
  66. typedef union _USB_HIGH_SPEED_MAXPACKET {
  67. struct _MP {
  68. USHORT MaxPacket:11; /* 0..10 */
  69. USHORT HSmux:2; /* 11..12 */
  70. USHORT Reserved:3; /* 13..15 */
  71. };
  72. USHORT us;
  73. } USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET;
  74. #include <POPPACK.H>
  75. #endif __USB200_H__