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.

193 lines
4.6 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. DBCI.H
  5. Abstract:
  6. common structures for DBC port drivers.
  7. Environment:
  8. Kernel & user mode
  9. Revision History:
  10. 04-13-98 : created
  11. --*/
  12. #ifndef __DBCI_H__
  13. #define __DBCI_H__
  14. #include "dbc100.h"
  15. /*
  16. Device Bay Request Block (DRB)
  17. format of data packets passed between the
  18. Device Bay class driver and Port Driver
  19. */
  20. /*
  21. / DRB request codes
  22. */
  23. #ifndef ANY_SIZE_ARRAY
  24. #define ANY_SIZE_ARRAY 1
  25. #endif
  26. #define MAX_BAY_NUMBER 31
  27. #define DRB_FUNCTION_CHANGE_REQUEST 0x0000
  28. #define DRB_FUNCTION_GET_SUBSYSTEM_DESCRIPTOR 0x0001
  29. #define DRB_FUNCTION_GET_BAY_DESCRIPTOR 0x0002
  30. #define DRB_FUNCTION_SET_BAY_FEATURE 0x0003
  31. #define DRB_FUNCTION_CLEAR_BAY_FEATURE 0x0004
  32. #define DRB_FUNCTION_GET_BAY_STATUS 0x0005
  33. #define DRB_FUNCTION_GET_CONTROLLER_STATUS 0x0006
  34. #define DRB_FUNCTION_START_DEVICE_IN_BAY 0x0007
  35. #define DRB_FUNCTION_EJECT_DEVICE_IN_BAY 0x0008
  36. #define DRB_FUNCTION_STOP_DEVICE_IN_BAY 0x0009
  37. #define DBC_ACPI_CONTROLLER_SIG 0x49504341 /* "ACPI" */
  38. #define DBC_USB_CONTROLLER_SIG 0x4253555F /* "_USB" */
  39. #define DBC_OEM_FILTER_SIG 0x464D454F /* "OEMF" */
  40. struct _DRB_HEADER {
  41. USHORT Length;
  42. USHORT Function;
  43. ULONG Flags;
  44. };
  45. struct _DRB_CHANGE_REQUEST {
  46. struct _DRB_HEADER Hdr;
  47. ULONG BayChange; /* 0 refers to subsytstem 1..31 bays */
  48. };
  49. struct _DRB_GET_SUBSYSTEM_DESCRIPTOR {
  50. struct _DRB_HEADER Hdr;
  51. DBC_SUBSYSTEM_DESCRIPTOR SubsystemDescriptor;
  52. };
  53. struct _DRB_GET_BAY_DESCRIPTOR {
  54. struct _DRB_HEADER Hdr;
  55. USHORT BayNumber; /* 1,2...*/
  56. USHORT ReservedMBZ;
  57. DBC_BAY_DESCRIPTOR BayDescriptor;
  58. };
  59. struct _DRB_BAY_FEATURE_REQUEST {
  60. struct _DRB_HEADER Hdr;
  61. USHORT BayNumber; /* 1,2...*/
  62. USHORT FeatureSelector;
  63. };
  64. struct _DRB_GET_BAY_STATUS {
  65. struct _DRB_HEADER Hdr;
  66. USHORT BayNumber; /* 1,2...*/
  67. USHORT Reserved;
  68. BAY_STATUS BayStatus;
  69. };
  70. struct _DRB_GET_CONTROLLER_STATUS {
  71. struct _DRB_HEADER Hdr;
  72. };
  73. struct _DRB_START_DEVICE_IN_BAY {
  74. struct _DRB_HEADER Hdr;
  75. USHORT BayNumber; /* 1,2...*/
  76. USHORT ReservedMBZ;
  77. /*
  78. Pdo of the the device in the bay
  79. */
  80. PDEVICE_OBJECT PdoDeviceObjectUsb;
  81. PDEVICE_OBJECT PdoDeviceObject1394;
  82. };
  83. struct _DRB_STOP_DEVICE_IN_BAY {
  84. struct _DRB_HEADER Hdr;
  85. USHORT BayNumber; /* 1,2...*/
  86. USHORT ReservedMBZ;
  87. };
  88. struct _DRB_EJECT_DEVICE_IN_BAY {
  89. struct _DRB_HEADER Hdr;
  90. USHORT BayNumber; /* 1,2...*/
  91. USHORT ReservedMBZ;
  92. };
  93. typedef struct _DRB {
  94. union {
  95. struct _DRB_HEADER DrbHeader;
  96. struct _DRB_CHANGE_REQUEST DrbChangeRequest;
  97. struct _DRB_GET_SUBSYSTEM_DESCRIPTOR DrbGetSubsystemDescriptor;
  98. struct _DRB_GET_BAY_DESCRIPTOR DrbGetBayDescriptor;
  99. struct _DRB_BAY_FEATURE_REQUEST DrbBayFeatureRequest;
  100. struct _DRB_GET_BAY_STATUS DrbGetBayStatus;
  101. struct _DRB_GET_CONTROLLER_STATUS DrbGetControllerStatus;
  102. struct _DRB_START_DEVICE_IN_BAY DrbStartDeviceInBay;
  103. struct _DRB_EJECT_DEVICE_IN_BAY DrbEjectDeviceInBay;
  104. struct _DRB_STOP_DEVICE_IN_BAY DrbStopDeviceInBay;
  105. };
  106. } DRB, *PDRB;
  107. /*
  108. IOCTL interface
  109. */
  110. /* USB guid */
  111. DEFINE_GUID( GUID_CLASS_DBC, 0xf18a0e88, 0xc30c, 0x11d0, 0x88, 0x15, 0x00, \
  112. 0xa0, 0xc9, 0x06, 0xbe, 0xd8);
  113. /*f18a0e88-c30c-11d0-8815-00a0c906bed8 */
  114. #define FILE_DEVICE_DBC FILE_DEVICE_UNKNOWN
  115. /*
  116. / DBC IOCTLS
  117. */
  118. struct {
  119. ULONG Reserved1;
  120. ULONG Reserved2;
  121. ULONG IoControlCode;
  122. PVOID Argument1;
  123. PVOID Argument2;
  124. } DeviceIoControl;
  125. #define DBC_IOCTL_INTERNAL_INDEX 0x0000
  126. /*
  127. / DBC Internal IOCtls
  128. */
  129. /* IOCTL_INTERNAL_DBC_SUBMIT_DRB
  130. This IOCTL is used by the class driver to submit DRB (device bay
  131. request blocks) to the port drivers
  132. Parameters.Others.Argument1 = pointer to DRB
  133. */
  134. #define IOCTL_INTERNAL_DBC_SUBMIT_DRB CTL_CODE(FILE_DEVICE_UNKNOWN, \
  135. DBC_IOCTL_INTERNAL_INDEX, \
  136. METHOD_NEITHER, \
  137. FILE_ANY_ACCESS)
  138. #endif /* __DBCI_H__ */