More work on USB related definitions
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 5 Mar 2010 13:32:58 +0000 (13:32 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 5 Mar 2010 13:32:58 +0000 (13:32 +0000)
svn path=/branches/header-work/; revision=45870

include/ddk/usbkern.h
include/ddk/usbprint.h
include/ddk/usbprotocoldefs.h
include/ddk/usbscan.h
include/ddk/usbstorioctl.h

index 26cb6ee..56b0f74 100644 (file)
@@ -1,15 +1,3 @@
-
-#ifndef   __USBKERN_H__
-#define   __USBKERN_H__
+#pragma once
 
 #include "usbiodef.h"
-
-#define IOCTL_INTERNAL_USB_GET_HUB_COUNT USB_KERNEL_CTL(USB_GET_HUB_COUNT)
-#define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO  USB_KERNEL_CTL(USB_GET_ROOTHUB_PDO)
-
-#define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE  \
-    CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS)
-
-#endif
-
-
index 58fa13c..a2efc4f 100644 (file)
@@ -1,5 +1,5 @@
-
 #define USBPRINT_IOCTL_INDEX  0x0000
+
 #define IOCTL_USBPRINT_GET_LPT_STATUS \
                      CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+12, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
@@ -14,4 +14,3 @@
 
 #define IOCTL_USBPRINT_SOFT_RESET \
                       CTL_CODE(FILE_DEVICE_UNKNOWN, USBPRINT_IOCTL_INDEX+16, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
index 678633f..9a25a1b 100644 (file)
@@ -1,6 +1,6 @@
 #pragma once
 
-#include <PSHPACK1.h>
+#include <pshpack1.h>
 
 #define USB_UnConnected_Device_Address 0
 #define USB_UNCONNECTED_ADDRESS(address) ( USB_UnConnected_Device_Address == (address))
@@ -482,13 +482,13 @@ C_ASSERT((sizeof(USBHUBPORTSTATUS) == sizeof(WORD)));
 typedef union _USBHUBPORTSTATUSCHANGE {
   WORD wPortStatusChange;
   struct Bits {
-    BYTE  fConnectionStatusChange:1;
-    BYTE  fEnabledChange:1;
-    BYTE  fSuspendChange:1;
-    BYTE  fOverCurrentChange:1;
-    BYTE  fResetChange:1;
-    BYTE  bReserved1:3;
-    BYTE  bReserved2:8;
+    BYTE fConnectionStatusChange:1;
+    BYTE fEnabledChange:1;
+    BYTE fSuspendChange:1;
+    BYTE fOverCurrentChange:1;
+    BYTE fResetChange:1;
+    BYTE bReserved1:3;
+    BYTE bReserved2:8;
   } Bits;
 } USBHUBPORTSTATUSCHANGE;
 
@@ -674,4 +674,4 @@ typedef struct _USBHUBPORTDATA {
 
 #endif // !defined(MIDL_PASS)
 
-#include <POPPACK.h>
+#include <poppack.h>
index ffe884e..718b13c 100644 (file)
@@ -30,6 +30,88 @@ extern "C" {
 
 #pragma pack(push,8)
 
+#ifndef MAX_NUM_PIPES
+#define MAX_NUM_PIPES                     8
+#endif
+
+#define BULKIN_FLAG                       0x80
+
+typedef struct _DRV_VERSION {
+  OUT ULONG major;
+  OUT ULONG minor;
+  OUT ULONG internal;
+} DRV_VERSION, *PDRV_VERSION;
+
+typedef struct _IO_BLOCK {
+  IN ULONG uOffset;
+  IN ULONG uLength;
+  IN OUT PUCHAR pbyData;
+  IN ULONG uIndex;
+} IO_BLOCK, *PIO_BLOCK;
+
+typedef struct _IO_BLOCK_EX {
+  IN ULONG uOffset;
+  IN ULONG uLength;
+  IN OUT PUCHAR pbyData;
+  IN ULONG uIndex;
+  IN UCHAR bRequest;
+  IN UCHAR bmRequestType;
+  IN UCHAR fTransferDirectionIn;
+} IO_BLOCK_EX, *PIO_BLOCK_EX;
+
+typedef struct _CHANNEL_INFO {
+  OUT ULONG EventChannelSize;
+  OUT ULONG uReadDataAlignment;
+  OUT ULONG uWriteDataAlignment;
+}CHANNEL_INFO, *PCHANNEL_INFO;
+
+typedef enum _PIPE_TYPE {
+  EVENT_PIPE,
+  READ_DATA_PIPE,
+  WRITE_DATA_PIPE,
+  ALL_PIPE
+} PIPE_TYPE;
+
+typedef struct _USBSCAN_GET_DESCRIPTOR {
+  IN UCHAR DescriptorType;
+  IN UCHAR Index;
+  IN USHORT LanguageId;
+} USBSCAN_GET_DESCRIPTOR, *PUSBSCAN_GET_DESCRIPTOR;
+
+typedef struct _DEVICE_DESCRIPTOR {
+  OUT USHORT usVendorId;
+  OUT USHORT usProductId;
+  OUT USHORT usBcdDevice;
+  OUT USHORT usLanguageId;
+} DEVICE_DESCRIPTOR, *PDEVICE_DESCRIPTOR;
+
+typedef enum _RAW_PIPE_TYPE {
+  USBSCAN_PIPE_CONTROL,
+  USBSCAN_PIPE_ISOCHRONOUS,
+  USBSCAN_PIPE_BULK,
+  USBSCAN_PIPE_INTERRUPT
+} RAW_PIPE_TYPE;
+
+typedef struct _USBSCAN_PIPE_INFORMATION {
+  USHORT MaximumPacketSize;
+  UCHAR EndpointAddress;
+  UCHAR Interval;
+  RAW_PIPE_TYPE PipeType;
+} USBSCAN_PIPE_INFORMATION, *PUSBSCAN_PIPE_INFORMATION;
+
+typedef struct _USBSCAN_PIPE_CONFIGURATION {
+  OUT ULONG NumberOfPipes;
+  OUT USBSCAN_PIPE_INFORMATION PipeInfo[MAX_NUM_PIPES];
+} USBSCAN_PIPE_CONFIGURATION, *PUSBSCAN_PIPE_CONFIGURATION;
+
+#if (NTDDI_VERSION >= NTDDI_WINXP)
+typedef struct _USBSCAN_TIMEOUT {
+  IN ULONG TimeoutRead;
+  IN ULONG TimeoutWrite;
+  IN ULONG TimeoutEvent;
+} USBSCAN_TIMEOUT, *PUSBSCAN_TIMEOUT;
+#endif
+
 #define FILE_DEVICE_USB_SCAN              0x8000
 #define IOCTL_INDEX                       0x0800
 
@@ -71,88 +153,6 @@ extern "C" {
   CTL_CODE(FILE_DEVICE_USB_SCAN, IOCTL_INDEX + 11,METHOD_BUFFERED,FILE_ANY_ACCESS)
 #endif
 
-#ifndef MAX_NUM_PIPES
-#define MAX_NUM_PIPES                     8
-#endif
-
-#define BULKIN_FLAG                       0x80
-
-typedef struct _CHANNEL_INFO {
-  OUT ULONG  EventChannelSize;
-  OUT ULONG  uReadDataAlignment;
-  OUT ULONG  uWriteDataAlignment;
-}CHANNEL_INFO, *PCHANNEL_INFO;
-
-typedef struct _DEVICE_DESCRIPTOR {
-  OUT USHORT  usVendorId;
-  OUT USHORT  usProductId;
-  OUT USHORT  usBcdDevice;
-  OUT USHORT  usLanguageId;
-} DEVICE_DESCRIPTOR, *PDEVICE_DESCRIPTOR;
-
-typedef struct _DRV_VERSION {
-  OUT ULONG  major;
-  OUT ULONG  minor;
-  OUT ULONG  internal;
-} DRV_VERSION, *PDRV_VERSION;
-
-typedef struct _IO_BLOCK {
-  IN ULONG  uOffset;
-  IN ULONG  uLength;
-  IN OUT PUCHAR  pbyData;
-  IN ULONG  uIndex;
-} IO_BLOCK, *PIO_BLOCK;
-
-typedef struct _IO_BLOCK_EX {
-  IN  ULONG  uOffset;
-  IN  ULONG  uLength;
-  IN OUT PUCHAR  pbyData;
-  IN  ULONG  uIndex;
-  IN  UCHAR  bRequest;
-  IN  UCHAR  bmRequestType;
-  IN  UCHAR  fTransferDirectionIn;
-} IO_BLOCK_EX, *PIO_BLOCK_EX;
-
-typedef struct _USBSCAN_GET_DESCRIPTOR {
-  IN UCHAR  DescriptorType;
-  IN UCHAR  Index;
-  IN USHORT  LanguageId;
-} USBSCAN_GET_DESCRIPTOR, *PUSBSCAN_GET_DESCRIPTOR;
-
-typedef enum _RAW_PIPE_TYPE {
-  USBSCAN_PIPE_CONTROL,
-  USBSCAN_PIPE_ISOCHRONOUS,
-  USBSCAN_PIPE_BULK,
-  USBSCAN_PIPE_INTERRUPT
-} RAW_PIPE_TYPE;
-
-typedef struct _USBSCAN_PIPE_INFORMATION {
-  USHORT  MaximumPacketSize;
-  UCHAR  EndpointAddress;
-  UCHAR  Interval;
-  RAW_PIPE_TYPE  PipeType;
-} USBSCAN_PIPE_INFORMATION, *PUSBSCAN_PIPE_INFORMATION;
-
-typedef struct _USBSCAN_PIPE_CONFIGURATION {
-  OUT ULONG  NumberOfPipes;
-  OUT USBSCAN_PIPE_INFORMATION  PipeInfo[MAX_NUM_PIPES];
-} USBSCAN_PIPE_CONFIGURATION, *PUSBSCAN_PIPE_CONFIGURATION;
-
-#if (NTDDI_VERSION >= NTDDI_WINXP)
-typedef struct _USBSCAN_TIMEOUT {
-  IN ULONG  TimeoutRead;
-  IN ULONG  TimeoutWrite;
-  IN ULONG  TimeoutEvent;
-} USBSCAN_TIMEOUT, *PUSBSCAN_TIMEOUT;
-#endif
-
-typedef enum _PIPE_TYPE {
-  EVENT_PIPE,
-  READ_DATA_PIPE,
-  WRITE_DATA_PIPE,
-  ALL_PIPE
-} PIPE_TYPE;
-
 #pragma pack(pop)
 
 #endif // (NTDDI_VERSION >= NTDDI_WIN2K)
index bb0c4d1..5e71ae3 100644 (file)
@@ -4,16 +4,6 @@
 #define MAX_PATH 260
 #endif
 
-#define SIZE_ENUM_PDO_RESULTS_HEADER (sizeof(ENUM_PDO_RESULTS) - sizeof(ENUM_PDO_ENTRY))
-
-#define IOCTL_EHSTOR_DEVICE_SET_AUTHZ_STATE   CTL_CODE(IOCTL_STORAGE_BASE, 0x501, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define IOCTL_EHSTOR_DEVICE_GET_AUTHZ_STATE   CTL_CODE(IOCTL_STORAGE_BASE, 0x502, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define IOCTL_EHSTOR_DEVICE_SILO_COMMAND      CTL_CODE(IOCTL_STORAGE_BASE, 0x503, METHOD_BUFFERED, FILE_ANY_ACCESS)
-#define IOCTL_EHSTOR_DEVICE_ENUMERATE_PDOS    CTL_CODE(IOCTL_STORAGE_BASE, 0x504, METHOD_BUFFERED, FILE_ANY_ACCESS)
-
-DEFINE_GUID(GUID_USBSTOR_EHSTOR_SILO_INTERFACE, 0x7c2bcf57, 0x2bea, 0x46da, 0xad, 0x26, 0x78, 0xfd, 0xc8, 0x3c, 0xee, 0x46);
-DEFINE_GUID(GUID_USBSTOR_EHSTOR_CONTROL_INTERFACE, 0x4f40006f, 0xb933, 0x4550, 0xb5, 0x32, 0x2b, 0x58, 0xce, 0xe6, 0x14, 0xd3);
-
 typedef struct tagACT_AUTHZ_STATE {
   UCHAR ACT;
   BOOLEAN fAuthorized;
@@ -62,3 +52,13 @@ typedef struct _ENUM_PDO_RESULTS {
   ULONG cEntries;
   ENUM_PDO_ENTRY rgEntries[ANYSIZE_ARRAY];
 } ENUM_PDO_RESULTS, *PENUM_PDO_RESULTS;
+
+#define SIZE_ENUM_PDO_RESULTS_HEADER (sizeof(ENUM_PDO_RESULTS) - sizeof(ENUM_PDO_ENTRY))
+
+#define IOCTL_EHSTOR_DEVICE_SET_AUTHZ_STATE   CTL_CODE(IOCTL_STORAGE_BASE, 0x501, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_EHSTOR_DEVICE_GET_AUTHZ_STATE   CTL_CODE(IOCTL_STORAGE_BASE, 0x502, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_EHSTOR_DEVICE_SILO_COMMAND      CTL_CODE(IOCTL_STORAGE_BASE, 0x503, METHOD_BUFFERED, FILE_ANY_ACCESS)
+#define IOCTL_EHSTOR_DEVICE_ENUMERATE_PDOS    CTL_CODE(IOCTL_STORAGE_BASE, 0x504, METHOD_BUFFERED, FILE_ANY_ACCESS)
+
+DEFINE_GUID(GUID_USBSTOR_EHSTOR_SILO_INTERFACE, 0x7c2bcf57, 0x2bea, 0x46da, 0xad, 0x26, 0x78, 0xfd, 0xc8, 0x3c, 0xee, 0x46);
+DEFINE_GUID(GUID_USBSTOR_EHSTOR_CONTROL_INTERFACE, 0x4f40006f, 0xb933, 0x4550, 0xb5, 0x32, 0x2b, 0x58, 0xce, 0xe6, 0x14, 0xd3);