ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
March 2010
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
19 participants
896 discussions
Start a n
N
ew thread
[akhaldi] 45867: More work on USB related definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 5 13:25:38 2010 New Revision: 45867 URL:
http://svn.reactos.org/svn/reactos?rev=45867&view=rev
Log: More work on USB related definitions Modified: branches/header-work/include/psdk/usb200.h branches/header-work/include/psdk/usbcamdi.h Modified: branches/header-work/include/psdk/usb200.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/usb200…
============================================================================== --- branches/header-work/include/psdk/usb200.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/usb200.h [iso-8859-1] Fri Mar 5 13:25:38 2010 @@ -23,6 +23,16 @@ UsbFullSpeed, UsbHighSpeed } USB_DEVICE_SPEED; + +#define USB_PORT_STATUS_CONNECT 0x0001 +#define USB_PORT_STATUS_ENABLE 0x0002 +#define USB_PORT_STATUS_SUSPEND 0x0004 +#define USB_PORT_STATUS_OVER_CURRENT 0x0008 +#define USB_PORT_STATUS_RESET 0x0010 +#define USB_PORT_STATUS_POWER 0x0100 +#define USB_PORT_STATUS_LOW_SPEED 0x0200 +#define USB_PORT_STATUS_HIGH_SPEED 0x0400 + typedef union _BM_REQUEST_TYPE { struct _BM { @@ -56,6 +66,9 @@ C_ASSERT(sizeof(USB_DEFAULT_PIPE_SETUP_PACKET) == 8); +#define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06 +#define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07 + typedef struct _USB_DEVICE_QUALIFIER_DESCRIPTOR { UCHAR bLength; UCHAR bDescriptorType; @@ -77,6 +90,8 @@ USHORT us; } USB_HIGH_SPEED_MAXPACKET, *PUSB_HIGH_SPEED_MAXPACKET; +#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B + typedef struct _USB_INTERFACE_ASSOCIATION_DESCRIPTOR { UCHAR bLength; UCHAR bDescriptorType; @@ -88,16 +103,4 @@ UCHAR iFunction; } USB_INTERFACE_ASSOCIATION_DESCRIPTOR, *PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR; -#define USB_PORT_STATUS_CONNECT 0x0001 -#define USB_PORT_STATUS_ENABLE 0x0002 -#define USB_PORT_STATUS_SUSPEND 0x0004 -#define USB_PORT_STATUS_OVER_CURRENT 0x0008 -#define USB_PORT_STATUS_RESET 0x0010 -#define USB_PORT_STATUS_POWER 0x0100 -#define USB_PORT_STATUS_LOW_SPEED 0x0200 -#define USB_PORT_STATUS_HIGH_SPEED 0x0400 -#define USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE 0x06 -#define USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE 0x07 -#define USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE 0x0B - #include <poppack.h> Modified: branches/header-work/include/psdk/usbcamdi.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/usbcam…
============================================================================== --- branches/header-work/include/psdk/usbcamdi.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/usbcamdi.h [iso-8859-1] Fri Mar 5 13:25:38 2010 @@ -21,10 +21,6 @@ */ #pragma once - -#if !defined(__USB_H) && !defined(__USBDI_H) -#error include usb.h or usbdi.h before usbcamdi.h -#else #ifdef __cplusplus extern "C" { @@ -36,12 +32,10 @@ #define USBCAMAPI DECLSPEC_IMPORT #endif -DEFINE_GUID(GUID_USBCAMD_INTERFACE, - 0x2bcb75c0, 0xb27f, 0x11d1, 0xba, 0x41, 0x0, 0xa0, 0xc9, 0xd, 0x2b, 0x5); - -#define USBCAMD_PROCESSPACKETEX_DropFrame 0x0002 -#define USBCAMD_PROCESSPACKETEX_NextFrameIsStill 0x0004 -#define USBCAMD_PROCESSPACKETEX_CurrentFrameIsStill 0x0008 +typedef struct _pipe_config_descriptor { + CHAR StreamAssociation; + UCHAR PipeConfigFlags; +} USBCAMD_Pipe_Config_Descriptor, *PUSBCAMD_Pipe_Config_Descriptor; #define USBCAMD_DATA_PIPE 0x0001 #define USBCAMD_MULTIPLEX_PIPE 0x0002 @@ -52,13 +46,12 @@ #define USBCAMD_STILL_STREAM 0x2 #define USBCAMD_VIDEO_STILL_STREAM (USBCAMD_VIDEO_STREAM | USBCAMD_STILL_STREAM) +#define USBCAMD_PROCESSPACKETEX_DropFrame 0x0002 +#define USBCAMD_PROCESSPACKETEX_NextFrameIsStill 0x0004 +#define USBCAMD_PROCESSPACKETEX_CurrentFrameIsStill 0x0008 + #define USBCAMD_STOP_STREAM 0x00000001 #define USBCAMD_START_STREAM 0x00000000 - -typedef struct _pipe_config_descriptor { - CHAR StreamAssociation; - UCHAR PipeConfigFlags; -} USBCAMD_Pipe_Config_Descriptor, *PUSBCAMD_Pipe_Config_Descriptor; typedef enum { USBCAMD_CamControlFlag_NoVideoRawProcessing = 1, @@ -68,19 +61,21 @@ } USBCAMD_CamControlFlags; typedef NTSTATUS -(NTAPI *PCAM_ALLOCATE_BW_ROUTINE)( - IN PDEVICE_OBJECT BusDeviceObject, - IN PVOID DeviceContext, - IN PULONG RawFrameLength, - IN PVOID Format); - -typedef NTSTATUS -(NTAPI *PCAM_ALLOCATE_BW_ROUTINE_EX)( - IN PDEVICE_OBJECT BusDeviceObject, - IN PVOID DeviceContext, - IN PULONG RawFrameLength, - IN PVOID Format, - IN ULONG StreamNumber); +(NTAPI *PCOMMAND_COMPLETE_FUNCTION)( + IN PVOID DeviceContext, + IN OUT PVOID CommandContext, + IN NTSTATUS NtStatus); + +typedef VOID +(NTAPI *PSTREAM_RECEIVE_PACKET)( + IN PVOID Srb, + IN PVOID DeviceContext, + IN PBOOLEAN Completed); + +typedef NTSTATUS +(NTAPI *PCAM_INITIALIZE_ROUTINE)( + PDEVICE_OBJECT BusDeviceObject, + PVOID DeviceContext); typedef NTSTATUS (NTAPI *PCAM_CONFIGURE_ROUTINE)( @@ -102,6 +97,32 @@ IN PUSB_DEVICE_DESCRIPTOR DeviceDescriptor); typedef NTSTATUS +(NTAPI *PCAM_START_CAPTURE_ROUTINE)( + IN PDEVICE_OBJECT BusDeviceObject, + IN PVOID DeviceContext); + +typedef NTSTATUS +(NTAPI *PCAM_START_CAPTURE_ROUTINE_EX)( + IN PDEVICE_OBJECT BusDeviceObject, + IN PVOID DeviceContext, + IN ULONG StreamNumber); + +typedef NTSTATUS +(NTAPI *PCAM_ALLOCATE_BW_ROUTINE)( + IN PDEVICE_OBJECT BusDeviceObject, + IN PVOID DeviceContext, + IN PULONG RawFrameLength, + IN PVOID Format); + +typedef NTSTATUS +(NTAPI *PCAM_ALLOCATE_BW_ROUTINE_EX)( + IN PDEVICE_OBJECT BusDeviceObject, + IN PVOID DeviceContext, + IN PULONG RawFrameLength, + IN PVOID Format, + IN ULONG StreamNumber); + +typedef NTSTATUS (NTAPI *PCAM_FREE_BW_ROUTINE)( IN PDEVICE_OBJECT BusDeviceObject, IN PVOID DeviceContext); @@ -112,10 +133,45 @@ IN PVOID DeviceContext, IN ULONG StreamNumber); -typedef NTSTATUS -(NTAPI *PCAM_INITIALIZE_ROUTINE)( - PDEVICE_OBJECT BusDeviceObject, - PVOID DeviceContext); +typedef VOID +(NTAPI *PADAPTER_RECEIVE_PACKET_ROUTINE)( + IN OUT PHW_STREAM_REQUEST_BLOCK Srb); + +typedef NTSTATUS +(NTAPI *PCAM_STOP_CAPTURE_ROUTINE)( + IN PDEVICE_OBJECT BusDeviceObject, + IN PVOID DeviceContext); + +typedef NTSTATUS +(NTAPI *PCAM_STOP_CAPTURE_ROUTINE_EX)( + IN PDEVICE_OBJECT BusDeviceObject, + IN PVOID DeviceContext, + IN ULONG StreamNumber); + +typedef ULONG +(NTAPI *PCAM_PROCESS_PACKET_ROUTINE)( + IN PDEVICE_OBJECT BusDeviceObject, + IN PVOID DeviceContext, + IN PVOID CurrentFrameContext, + IN PUSBD_ISO_PACKET_DESCRIPTOR SyncPacket OPTIONAL, + IN PVOID SyncBuffer OPTIONAL, + IN PUSBD_ISO_PACKET_DESCRIPTOR DataPacket OPTIONAL, + IN OUT PVOID DataBuffer, + OUT PBOOLEAN FrameComplete, + OUT PBOOLEAN NextFrameIsStill); + +typedef ULONG +(NTAPI *PCAM_PROCESS_PACKET_ROUTINE_EX)( + IN PDEVICE_OBJECT BusDeviceObject, + IN PVOID DeviceContext, + IN PVOID CurrentFrameContext, + IN PUSBD_ISO_PACKET_DESCRIPTOR SyncPacket OPTIONAL, + IN PVOID SyncBuffer OPTIONAL, + IN PUSBD_ISO_PACKET_DESCRIPTOR DataPacket OPTIONAL, + IN OUT PVOID DataBuffer, + OUT PBOOLEAN FrameComplete, + OUT PULONG PacketFlag, + OUT PULONG ValidDataOffset); typedef VOID (NTAPI *PCAM_NEW_FRAME_ROUTINE)( @@ -155,57 +211,30 @@ IN ULONG ActualRawFrameLength, IN ULONG StreamNumber); -typedef ULONG -(NTAPI *PCAM_PROCESS_PACKET_ROUTINE)( - IN PDEVICE_OBJECT BusDeviceObject, - IN PVOID DeviceContext, - IN PVOID CurrentFrameContext, - IN PUSBD_ISO_PACKET_DESCRIPTOR SyncPacket OPTIONAL, - IN PVOID SyncBuffer OPTIONAL, - IN PUSBD_ISO_PACKET_DESCRIPTOR DataPacket OPTIONAL, - IN OUT PVOID DataBuffer, - OUT PBOOLEAN FrameComplete, - OUT PBOOLEAN NextFrameIsStill); - -typedef ULONG -(NTAPI *PCAM_PROCESS_PACKET_ROUTINE_EX)( - IN PDEVICE_OBJECT BusDeviceObject, - IN PVOID DeviceContext, - IN PVOID CurrentFrameContext, - IN PUSBD_ISO_PACKET_DESCRIPTOR SyncPacket OPTIONAL, - IN PVOID SyncBuffer OPTIONAL, - IN PUSBD_ISO_PACKET_DESCRIPTOR DataPacket OPTIONAL, - IN OUT PVOID DataBuffer, - OUT PBOOLEAN FrameComplete, - OUT PULONG PacketFlag, - OUT PULONG ValidDataOffset); - typedef NTSTATUS (NTAPI *PCAM_STATE_ROUTINE)( IN PDEVICE_OBJECT BusDeviceObject, IN PVOID DeviceContext); -typedef NTSTATUS -(NTAPI *PCAM_START_CAPTURE_ROUTINE)( - IN PDEVICE_OBJECT BusDeviceObject, - IN PVOID DeviceContext); - -typedef NTSTATUS -(NTAPI *PCAM_START_CAPTURE_ROUTINE_EX)( - IN PDEVICE_OBJECT BusDeviceObject, - IN PVOID DeviceContext, - IN ULONG StreamNumber); - -typedef NTSTATUS -(NTAPI *PCAM_STOP_CAPTURE_ROUTINE)( - IN PDEVICE_OBJECT BusDeviceObject, - IN PVOID DeviceContext); - -typedef NTSTATUS -(NTAPI *PCAM_STOP_CAPTURE_ROUTINE_EX)( - IN PDEVICE_OBJECT BusDeviceObject, - IN PVOID DeviceContext, - IN ULONG StreamNumber); +#if defined(DEBUG_LOG) + +USBCAMAPI +VOID +NTAPI +USBCAMD_Debug_LogEntry( + IN CHAR *Name, + IN ULONG Info1, + IN ULONG Info2, + IN ULONG Info3); + +#define ILOGENTRY(sig, info1, info2, info3) \ + USBCAMD_Debug_LogEntry(sig, (ULONG)info1, (ULONG)info2, (ULONG)info3) + +#else + +#define ILOGENTRY(sig, info1, info2, info3) + +#endif /* DEBUG_LOG */ typedef struct _USBCAMD_DEVICE_DATA { ULONG Sig; @@ -239,39 +268,8 @@ PCAM_FREE_BW_ROUTINE_EX CamFreeBandwidthEx; } USBCAMD_DEVICE_DATA2, *PUSBCAMD_DEVICE_DATA2; -USBCAMAPI -ULONG -NTAPI -USBCAMD_InitializeNewInterface( - IN PVOID DeviceContext, - IN PVOID DeviceData, - IN ULONG Version, - IN ULONG CamControlFlag); - -typedef NTSTATUS -(NTAPI *PCOMMAND_COMPLETE_FUNCTION)( - IN PVOID DeviceContext, - IN OUT PVOID CommandContext, - IN NTSTATUS NtStatus); - -typedef NTSTATUS -(NTAPI *PFNUSBCAMD_BulkReadWrite)( - IN PVOID DeviceContext, - IN USHORT PipeIndex, - IN PVOID Buffer, - IN ULONG BufferLength, - IN PCOMMAND_COMPLETE_FUNCTION CommandComplete, - IN PVOID CommandContext); - -typedef NTSTATUS -(NTAPI *PFNUSBCAMD_SetIsoPipeState)( - IN PVOID DeviceContext, - IN ULONG PipeStateFlags); - -typedef NTSTATUS -(NTAPI *PFNUSBCAMD_CancelBulkReadWrite)( - IN PVOID DeviceContext, - IN ULONG PipeIndex); +DEFINE_GUID(GUID_USBCAMD_INTERFACE, + 0x2bcb75c0, 0xb27f, 0x11d1, 0xba, 0x41, 0x0, 0xa0, 0xc9, 0xd, 0x2b, 0x5); typedef NTSTATUS (NTAPI *PFNUSBCAMD_SetVideoFormat)( @@ -288,9 +286,24 @@ IN PVOID EventContext, IN BOOLEAN LoopBack); -typedef VOID -(NTAPI *PADAPTER_RECEIVE_PACKET_ROUTINE)( - IN OUT PHW_STREAM_REQUEST_BLOCK Srb); +typedef NTSTATUS +(NTAPI *PFNUSBCAMD_CancelBulkReadWrite)( + IN PVOID DeviceContext, + IN ULONG PipeIndex); + +typedef NTSTATUS +(NTAPI *PFNUSBCAMD_SetIsoPipeState)( + IN PVOID DeviceContext, + IN ULONG PipeStateFlags); + +typedef NTSTATUS +(NTAPI *PFNUSBCAMD_BulkReadWrite)( + IN PVOID DeviceContext, + IN USHORT PipeIndex, + IN PVOID Buffer, + IN ULONG BufferLength, + IN PCOMMAND_COMPLETE_FUNCTION CommandComplete, + IN PVOID CommandContext); #define USBCAMD_VERSION_200 0x200 @@ -303,13 +316,17 @@ PFNUSBCAMD_CancelBulkReadWrite USBCAMD_CancelBulkReadWrite; } USBCAMD_INTERFACE, *PUSBCAMD_INTERFACE; -typedef VOID -(NTAPI *PSTREAM_RECEIVE_PACKET)( - IN PVOID Srb, - IN PVOID DeviceContext, - IN PBOOLEAN Completed); - /* FIXME : Do we need USBCAMAPI here ? */ + +USBCAMAPI +ULONG +NTAPI +USBCAMD_DriverEntry( + IN PVOID Context1, + IN PVOID Context2, + IN ULONG DeviceContextSize, + IN ULONG FrameContextSize, + IN PADAPTER_RECEIVE_PACKET_ROUTINE ReceivePacket); USBCAMAPI PVOID @@ -335,14 +352,11 @@ IN PVOID CommandContext OPTIONAL); USBCAMAPI -ULONG -NTAPI -USBCAMD_DriverEntry( - IN PVOID Context1, - IN PVOID Context2, - IN ULONG DeviceContextSize, - IN ULONG FrameContextSize, - IN PADAPTER_RECEIVE_PACKET_ROUTINE ReceivePacket); +NTSTATUS +NTAPI +USBCAMD_SelectAlternateInterface( + IN PVOID DeviceContext, + IN OUT PUSBD_INTERFACE_INFORMATION RequestInterface); USBCAMAPI NTSTATUS @@ -355,31 +369,13 @@ IN ULONG DataLength); USBCAMAPI -NTSTATUS -NTAPI -USBCAMD_SelectAlternateInterface( - IN PVOID DeviceContext, - IN OUT PUSBD_INTERFACE_INFORMATION RequestInterface); - -#if defined(DEBUG_LOG) - -USBCAMAPI -VOID -NTAPI -USBCAMD_Debug_LogEntry( - IN CHAR *Name, - IN ULONG Info1, - IN ULONG Info2, - IN ULONG Info3); - -#define ILOGENTRY(sig, info1, info2, info3) \ - USBCAMD_Debug_LogEntry(sig, (ULONG)info1, (ULONG)info2, (ULONG)info3) - -#else - -#define ILOGENTRY(sig, info1, info2, info3) - -#endif /* DEBUG_LOG */ +ULONG +NTAPI +USBCAMD_InitializeNewInterface( + IN PVOID DeviceContext, + IN PVOID DeviceData, + IN ULONG Version, + IN ULONG CamControlFlag); #ifdef __cplusplus }
14 years, 9 months
1
0
0
0
[akhaldi] 45866: More work on USB related definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 5 13:07:35 2010 New Revision: 45866 URL:
http://svn.reactos.org/svn/reactos?rev=45866&view=rev
Log: More work on USB related definitions Modified: branches/header-work/include/psdk/usb.h branches/header-work/include/psdk/usb100.h Modified: branches/header-work/include/psdk/usb.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/usb.h?…
============================================================================== --- branches/header-work/include/psdk/usb.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/usb.h [iso-8859-1] Fri Mar 5 13:07:35 2010 @@ -432,13 +432,13 @@ PMDL TransferBufferMDL; struct _URB *UrbLink; struct _URB_HCD_AREA hca; - UCHAR Recipient:5; - UCHAR Reserved1:3; - UCHAR Reserved2; - UCHAR InterfaceNumber; - UCHAR MS_PageIndex; - USHORT MS_FeatureDescriptorIndex; - USHORT Reserved3; + UCHAR Recipient:5; + UCHAR Reserved1:3; + UCHAR Reserved2; + UCHAR InterfaceNumber; + UCHAR MS_PageIndex; + USHORT MS_FeatureDescriptorIndex; + USHORT Reserved3; }; #endif Modified: branches/header-work/include/psdk/usb100.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/usb100…
============================================================================== --- branches/header-work/include/psdk/usb100.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/usb100.h [iso-8859-1] Fri Mar 5 13:07:35 2010 @@ -28,7 +28,64 @@ #include <pshpack1.h> +#define BMREQUEST_HOST_TO_DEVICE 0 +#define BMREQUEST_DEVICE_TO_HOST 1 + +#define BMREQUEST_STANDARD 0 +#define BMREQUEST_CLASS 1 +#define BMREQUEST_VENDOR 2 + +#define BMREQUEST_TO_DEVICE 0 +#define BMREQUEST_TO_INTERFACE 1 +#define BMREQUEST_TO_ENDPOINT 2 +#define BMREQUEST_TO_OTHER 3 + #define MAXIMUM_USB_STRING_LENGTH 255 + +#define USB_GETSTATUS_SELF_POWERED 0x01 +#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED 0x02 + +/* USB_COMMON_DESCRIPTOR.bDescriptorType constants */ +#define USB_DEVICE_DESCRIPTOR_TYPE 0x01 +#define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02 +#define USB_STRING_DESCRIPTOR_TYPE 0x03 +#define USB_INTERFACE_DESCRIPTOR_TYPE 0x04 +#define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05 +#define USB_RESERVED_DESCRIPTOR_TYPE 0x06 +#define USB_CONFIG_POWER_DESCRIPTOR_TYPE 0x07 +#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08 + +#define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT)((USHORT)d << 8 | i)) + +/* USB_ENDPOINT_DESCRIPTOR.bmAttributes constants */ +#define USB_ENDPOINT_TYPE_MASK 0x03 +#define USB_ENDPOINT_TYPE_CONTROL 0x00 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01 +#define USB_ENDPOINT_TYPE_BULK 0x02 +#define USB_ENDPOINT_TYPE_INTERRUPT 0x03 + +/* USB_CONFIGURATION_DESCRIPTOR.bmAttributes constants */ +#define USB_CONFIG_POWERED_MASK 0xc0 +#define USB_CONFIG_BUS_POWERED 0x80 +#define USB_CONFIG_SELF_POWERED 0x40 +#define USB_CONFIG_REMOTE_WAKEUP 0x20 + +#define USB_ENDPOINT_DIRECTION_MASK 0x80 + +#define USB_ENDPOINT_DIRECTION_OUT(x) (!((x) & USB_ENDPOINT_DIRECTION_MASK)) +#define USB_ENDPOINT_DIRECTION_IN(x) ((x) & USB_ENDPOINT_DIRECTION_MASK) + +#define USB_REQUEST_GET_STATUS 0x00 +#define USB_REQUEST_CLEAR_FEATURE 0x01 +#define USB_REQUEST_SET_FEATURE 0x03 +#define USB_REQUEST_SET_ADDRESS 0x05 +#define USB_REQUEST_GET_DESCRIPTOR 0x06 +#define USB_REQUEST_SET_DESCRIPTOR 0x07 +#define USB_REQUEST_GET_CONFIGURATION 0x08 +#define USB_REQUEST_SET_CONFIGURATION 0x09 +#define USB_REQUEST_GET_INTERFACE 0x0A +#define USB_REQUEST_SET_INTERFACE 0x0B +#define USB_REQUEST_SYNC_FRAME 0x0C #define USB_DEVICE_CLASS_RESERVED 0x00 #define USB_DEVICE_CLASS_AUDIO 0x01 @@ -42,67 +99,13 @@ #define USB_DEVICE_CLASS_HUB 0x09 #define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF -#define USB_RESERVED_DESCRIPTOR_TYPE 0x06 -#define USB_CONFIG_POWER_DESCRIPTOR_TYPE 0x07 -#define USB_INTERFACE_POWER_DESCRIPTOR_TYPE 0x08 - -#define USB_REQUEST_GET_STATUS 0x00 -#define USB_REQUEST_CLEAR_FEATURE 0x01 -#define USB_REQUEST_SET_FEATURE 0x03 -#define USB_REQUEST_SET_ADDRESS 0x05 -#define USB_REQUEST_GET_DESCRIPTOR 0x06 -#define USB_REQUEST_SET_DESCRIPTOR 0x07 -#define USB_REQUEST_GET_CONFIGURATION 0x08 -#define USB_REQUEST_SET_CONFIGURATION 0x09 -#define USB_REQUEST_GET_INTERFACE 0x0A -#define USB_REQUEST_SET_INTERFACE 0x0B -#define USB_REQUEST_SYNC_FRAME 0x0C - -#define USB_GETSTATUS_SELF_POWERED 0x01 -#define USB_GETSTATUS_REMOTE_WAKEUP_ENABLED 0x02 - -#define BMREQUEST_HOST_TO_DEVICE 0 -#define BMREQUEST_DEVICE_TO_HOST 1 - -#define BMREQUEST_STANDARD 0 -#define BMREQUEST_CLASS 1 -#define BMREQUEST_VENDOR 2 - -#define BMREQUEST_TO_DEVICE 0 -#define BMREQUEST_TO_INTERFACE 1 -#define BMREQUEST_TO_ENDPOINT 2 -#define BMREQUEST_TO_OTHER 3 - -/* USB_COMMON_DESCRIPTOR.bDescriptorType constants */ -#define USB_DEVICE_DESCRIPTOR_TYPE 0x01 -#define USB_CONFIGURATION_DESCRIPTOR_TYPE 0x02 -#define USB_STRING_DESCRIPTOR_TYPE 0x03 -#define USB_INTERFACE_DESCRIPTOR_TYPE 0x04 -#define USB_ENDPOINT_DESCRIPTOR_TYPE 0x05 - -typedef struct _USB_COMMON_DESCRIPTOR { - UCHAR bLength; - UCHAR bDescriptorType; -} USB_COMMON_DESCRIPTOR, *PUSB_COMMON_DESCRIPTOR; - -#define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT)((USHORT)d << 8 | i)) - -/* USB_CONFIGURATION_DESCRIPTOR.bmAttributes constants */ -#define USB_CONFIG_POWERED_MASK 0xc0 -#define USB_CONFIG_BUS_POWERED 0x80 -#define USB_CONFIG_SELF_POWERED 0x40 -#define USB_CONFIG_REMOTE_WAKEUP 0x20 - -typedef struct _USB_CONFIGURATION_DESCRIPTOR { - UCHAR bLength; - UCHAR bDescriptorType; - USHORT wTotalLength; - UCHAR bNumInterfaces; - UCHAR bConfigurationValue; - UCHAR iConfiguration; - UCHAR bmAttributes; - UCHAR MaxPower; -} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR; +#define USB_FEATURE_ENDPOINT_STALL 0x0000 +#define USB_FEATURE_REMOTE_WAKEUP 0x0001 + +#define USB_FEATURE_INTERFACE_POWER_D0 0x0002 +#define USB_FEATURE_INTERFACE_POWER_D1 0x0003 +#define USB_FEATURE_INTERFACE_POWER_D2 0x0004 +#define USB_FEATURE_INTERFACE_POWER_D3 0x0005 typedef struct _USB_DEVICE_DESCRIPTOR { UCHAR bLength; @@ -121,18 +124,6 @@ UCHAR bNumConfigurations; } USB_DEVICE_DESCRIPTOR, *PUSB_DEVICE_DESCRIPTOR; -#define USB_ENDPOINT_DIRECTION_MASK 0x80 - -#define USB_ENDPOINT_DIRECTION_OUT(x) (!((x) & USB_ENDPOINT_DIRECTION_MASK)) -#define USB_ENDPOINT_DIRECTION_IN(x) ((x) & USB_ENDPOINT_DIRECTION_MASK) - -/* USB_ENDPOINT_DESCRIPTOR.bmAttributes constants */ -#define USB_ENDPOINT_TYPE_MASK 0x03 -#define USB_ENDPOINT_TYPE_CONTROL 0x00 -#define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01 -#define USB_ENDPOINT_TYPE_BULK 0x02 -#define USB_ENDPOINT_TYPE_INTERRUPT 0x03 - typedef struct _USB_ENDPOINT_DESCRIPTOR { UCHAR bLength; UCHAR bDescriptorType; @@ -142,8 +133,16 @@ UCHAR bInterval; } USB_ENDPOINT_DESCRIPTOR, *PUSB_ENDPOINT_DESCRIPTOR; -#define USB_FEATURE_ENDPOINT_STALL 0x0000 -#define USB_FEATURE_REMOTE_WAKEUP 0x0001 +typedef struct _USB_CONFIGURATION_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; + USHORT wTotalLength; + UCHAR bNumInterfaces; + UCHAR bConfigurationValue; + UCHAR iConfiguration; + UCHAR bmAttributes; + UCHAR MaxPower; +} USB_CONFIGURATION_DESCRIPTOR, *PUSB_CONFIGURATION_DESCRIPTOR; typedef struct _USB_INTERFACE_DESCRIPTOR { UCHAR bLength; @@ -162,6 +161,11 @@ UCHAR bDescriptorType; WCHAR bString[1]; } USB_STRING_DESCRIPTOR, *PUSB_STRING_DESCRIPTOR; + +typedef struct _USB_COMMON_DESCRIPTOR { + UCHAR bLength; + UCHAR bDescriptorType; +} USB_COMMON_DESCRIPTOR, *PUSB_COMMON_DESCRIPTOR; typedef struct _USB_HUB_DESCRIPTOR { UCHAR bDescriptorLength; @@ -197,24 +201,19 @@ USHORT TransitionTimeFromD3; } USB_CONFIGURATION_POWER_DESCRIPTOR, *PUSB_CONFIGURATION_POWER_DESCRIPTOR; -#define USB_FEATURE_INTERFACE_POWER_D0 0x0002 -#define USB_FEATURE_INTERFACE_POWER_D1 0x0003 -#define USB_FEATURE_INTERFACE_POWER_D2 0x0004 -#define USB_FEATURE_INTERFACE_POWER_D3 0x0005 - typedef struct _USB_INTERFACE_POWER_DESCRIPTOR { - UCHAR bLength; - UCHAR bDescriptorType; - UCHAR bmCapabilitiesFlags; - UCHAR bBusPowerSavingD1; - UCHAR bSelfPowerSavingD1; - UCHAR bBusPowerSavingD2; - UCHAR bSelfPowerSavingD2; - UCHAR bBusPowerSavingD3; - UCHAR bSelfPowerSavingD3; - USHORT TransitionTimeFromD1; - USHORT TransitionTimeFromD2; - USHORT TransitionTimeFromD3; + UCHAR bLength; + UCHAR bDescriptorType; + UCHAR bmCapabilitiesFlags; + UCHAR bBusPowerSavingD1; + UCHAR bSelfPowerSavingD1; + UCHAR bBusPowerSavingD2; + UCHAR bSelfPowerSavingD2; + UCHAR bBusPowerSavingD3; + UCHAR bSelfPowerSavingD3; + USHORT TransitionTimeFromD1; + USHORT TransitionTimeFromD2; + USHORT TransitionTimeFromD3; } USB_INTERFACE_POWER_DESCRIPTOR, *PUSB_INTERFACE_POWER_DESCRIPTOR; #include <poppack.h>
14 years, 9 months
1
0
0
0
[akhaldi] 45865: More work on USB related definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 5 12:58:34 2010 New Revision: 45865 URL:
http://svn.reactos.org/svn/reactos?rev=45865&view=rev
Log: More work on USB related definitions Modified: branches/header-work/include/psdk/usb.h Modified: branches/header-work/include/psdk/usb.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/usb.h?…
============================================================================== --- branches/header-work/include/psdk/usb.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/usb.h [iso-8859-1] Fri Mar 5 12:58:34 2010 @@ -9,10 +9,6 @@ #endif #endif -#ifdef __USBDI_H__ -error -#endif - #ifdef OSR21_COMPAT #pragma message("WARNING: OSR21_COMPAT SWITCH NOT SUPPORTED") #endif @@ -24,14 +20,16 @@ #endif #endif -#define USBDI_VERSION 0x00000500 +#define USBDI_VERSION 0x00000600 #include "usb200.h" -typedef LONG USBD_STATUS; -typedef PVOID USBD_PIPE_HANDLE; -typedef PVOID USBD_CONFIGURATION_HANDLE; -typedef PVOID USBD_INTERFACE_HANDLE; +#define USB_PORTATTR_NO_CONNECTOR 0x00000001 +#define USB_PORTATTR_SHARED_USB2 0x00000002 +#define USB_PORTATTR_MINI_CONNECTOR 0x00000004 +#define USB_PORTATTR_OEM_CONNECTOR 0x00000008 +#define USB_PORTATTR_OWNED_BY_CC 0x01000000 +#define USB_PORTATTR_NO_OVERCURRENT_UI 0x02000000 typedef enum _USB_CONTROLLER_FLAVOR { USB_HcGeneric = 0, @@ -60,282 +58,7 @@ EHCI_Lucent = 3000 } USB_CONTROLLER_FLAVOR; -typedef enum _USBD_PIPE_TYPE { - UsbdPipeTypeControl, - UsbdPipeTypeIsochronous, - UsbdPipeTypeBulk, - UsbdPipeTypeInterrupt -} USBD_PIPE_TYPE; - -typedef struct _USBD_VERSION_INFORMATION { - ULONG USBDI_Version; - ULONG Supported_USB_Version; -} USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION; - -typedef struct _USBD_PIPE_INFORMATION { - USHORT MaximumPacketSize; - UCHAR EndpointAddress; - UCHAR Interval; - USBD_PIPE_TYPE PipeType; - USBD_PIPE_HANDLE PipeHandle; - ULONG MaximumTransferSize; - ULONG PipeFlags; -} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION; - -typedef struct _USBD_DEVICE_INFORMATION { - ULONG OffsetNext; - PVOID UsbdDeviceHandle; - USB_DEVICE_DESCRIPTOR DeviceDescriptor; -} USBD_DEVICE_INFORMATION, *PUSBD_DEVICE_INFORMATION; - -typedef struct _USBD_INTERFACE_INFORMATION { - USHORT Length; - UCHAR InterfaceNumber; - UCHAR AlternateSetting; - UCHAR Class; - UCHAR SubClass; - UCHAR Protocol; - UCHAR Reserved; - USBD_INTERFACE_HANDLE InterfaceHandle; - ULONG NumberOfPipes; - USBD_PIPE_INFORMATION Pipes[1]; -} USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION; - -struct _URB_HCD_AREA { - PVOID Reserved8[8]; -}; - -struct _URB_HEADER { - USHORT Length; - USHORT Function; - USBD_STATUS Status; - PVOID UsbdDeviceHandle; - ULONG UsbdFlags; -}; - -struct _URB_SELECT_INTERFACE { - struct _URB_HEADER Hdr; - USBD_CONFIGURATION_HANDLE ConfigurationHandle; - USBD_INTERFACE_INFORMATION Interface; -}; - -struct _URB_SELECT_CONFIGURATION { - struct _URB_HEADER Hdr; - PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; - USBD_CONFIGURATION_HANDLE ConfigurationHandle; - USBD_INTERFACE_INFORMATION Interface; -}; - -struct _URB_PIPE_REQUEST { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG Reserved; -}; - -struct _URB_FRAME_LENGTH_CONTROL { - struct _URB_HEADER Hdr; -}; - -struct _URB_GET_FRAME_LENGTH { - struct _URB_HEADER Hdr; - ULONG FrameLength; - ULONG FrameNumber; -}; - -struct _URB_SET_FRAME_LENGTH { - struct _URB_HEADER Hdr; - LONG FrameLengthDelta; -}; - -struct _URB_GET_CURRENT_FRAME_NUMBER { - struct _URB_HEADER Hdr; - ULONG FrameNumber; -}; - -struct _URB_CONTROL_DESCRIPTOR_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - USHORT Reserved1; - UCHAR Index; - UCHAR DescriptorType; - USHORT LanguageId; - USHORT Reserved2; -}; - -struct _URB_CONTROL_GET_STATUS_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[4]; - USHORT Index; - USHORT Reserved2; -}; - -struct _URB_CONTROL_FEATURE_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved2; - ULONG Reserved3; - PVOID Reserved4; - PMDL Reserved5; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - USHORT Reserved0; - USHORT FeatureSelector; - USHORT Index; - USHORT Reserved1; -}; - -struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR RequestTypeReservedBits; - UCHAR Request; - USHORT Value; - USHORT Index; - USHORT Reserved1; -}; - -struct _URB_CONTROL_GET_INTERFACE_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[4]; - USHORT Interface; - USHORT Reserved2; -}; - -struct _URB_CONTROL_GET_CONFIGURATION_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[8]; -}; - -struct _URB_CONTROL_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR SetupPacket[8]; -}; - -#if (_WIN32_WINNT >= 0x0600) - -struct _URB_CONTROL_TRANSFER_EX { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - ULONG Timeout; -#ifdef WIN64 - ULONG Pad; -#endif - struct _URB_HCD_AREA hca; - UCHAR SetupPacket[8]; -}; - -#endif - -struct _URB_BULK_OR_INTERRUPT_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; -}; - -typedef struct _USBD_ISO_PACKET_DESCRIPTOR { - ULONG Offset; - ULONG Length; - USBD_STATUS Status; -} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; - -struct _URB_ISOCH_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - ULONG StartFrame; - ULONG NumberOfPackets; - ULONG ErrorCount; - USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; -}; - -typedef struct _URB { - __GNU_EXTENSION union { - struct _URB_HEADER UrbHeader; - struct _URB_SELECT_INTERFACE UrbSelectInterface; - struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration; - struct _URB_PIPE_REQUEST UrbPipeRequest; - struct _URB_FRAME_LENGTH_CONTROL UrbFrameLengthControl; - struct _URB_GET_FRAME_LENGTH UrbGetFrameLength; - struct _URB_SET_FRAME_LENGTH UrbSetFrameLength; - struct _URB_GET_CURRENT_FRAME_NUMBER UrbGetCurrentFrameNumber; - struct _URB_CONTROL_TRANSFER UrbControlTransfer; -#if (_WIN32_WINNT >= 0x0600) - struct _URB_CONTROL_TRANSFER_EX UrbControlTransferEx; -#endif - struct _URB_BULK_OR_INTERRUPT_TRANSFER UrbBulkOrInterruptTransfer; - struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer; - struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest; - struct _URB_CONTROL_GET_STATUS_REQUEST UrbControlGetStatusRequest; - struct _URB_CONTROL_FEATURE_REQUEST UrbControlFeatureRequest; - struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST UrbControlVendorClassRequest; - struct _URB_CONTROL_GET_INTERFACE_REQUEST UrbControlGetInterfaceRequest; - struct _URB_CONTROL_GET_CONFIGURATION_REQUEST UrbControlGetConfigurationRequest; -#if (_WIN32_WINNT >= 0x0501) - struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST UrbOSFeatureDescriptorRequest; -#endif - }; -} URB, *PURB; - -#define USB_PORTATTR_NO_CONNECTOR 0x00000001 -#define USB_PORTATTR_SHARED_USB2 0x00000002 -#define USB_PORTATTR_MINI_CONNECTOR 0x00000004 -#define USB_PORTATTR_OEM_CONNECTOR 0x00000008 -#define USB_PORTATTR_OWNED_BY_CC 0x01000000 -#define USB_PORTATTR_NO_OVERCURRENT_UI 0x02000000 + #define USB_DEFAULT_DEVICE_ADDRESS 0 #define USB_DEFAULT_ENDPOINT_ADDRESS 0 #define USB_DEFAULT_MAX_PACKET 64 @@ -418,6 +141,9 @@ #define VALID_TRANSFER_FLAGS_MASK (USBD_SHORT_TRANSFER_OK | USBD_TRANSFER_DIRECTION | \ USBD_START_ISO_TRANSFER_ASAP | USBD_DEFAULT_PIPE_TRANSFER) #define USBD_ISO_START_FRAME_RANGE 1024 + +typedef LONG USBD_STATUS; + #define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0) #define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1) #define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0) @@ -480,6 +206,9 @@ #define USBD_STATUS_BAD_NUMBER_OF_ENDPOINTS ((USBD_STATUS)0xC0100008L) #define USBD_STATUS_BAD_ENDPOINT_ADDRESS ((USBD_STATUS)0xC0100009L) +typedef PVOID USBD_PIPE_HANDLE; +typedef PVOID USBD_CONFIGURATION_HANDLE; +typedef PVOID USBD_INTERFACE_HANDLE; #if (_WIN32_WINNT >= 0x0501) #define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE 0xFFFFFFFF @@ -487,7 +216,35 @@ #define USBD_DEFAULT_MAXIMUM_TRANSFER_SIZE PAGE_SIZE #endif - +typedef struct _USBD_VERSION_INFORMATION { + ULONG USBDI_Version; + ULONG Supported_USB_Version; +} USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION; + +typedef enum _USBD_PIPE_TYPE { + UsbdPipeTypeControl, + UsbdPipeTypeIsochronous, + UsbdPipeTypeBulk, + UsbdPipeTypeInterrupt +} USBD_PIPE_TYPE; + +#define USBD_PIPE_DIRECTION_IN(pipeInformation) ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) + +typedef struct _USBD_DEVICE_INFORMATION { + ULONG OffsetNext; + PVOID UsbdDeviceHandle; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; +} USBD_DEVICE_INFORMATION, *PUSBD_DEVICE_INFORMATION; + +typedef struct _USBD_PIPE_INFORMATION { + USHORT MaximumPacketSize; + UCHAR EndpointAddress; + UCHAR Interval; + USBD_PIPE_TYPE PipeType; + USBD_PIPE_HANDLE PipeHandle; + ULONG MaximumTransferSize; + ULONG PipeFlags; +} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION; #define USBD_PF_CHANGE_MAX_PACKET 0x00000001 #define USBD_PF_SHORT_PACKET_OPT 0x00000002 @@ -495,6 +252,157 @@ #define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 #define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | USBD_PF_SHORT_PACKET_OPT | \ USBD_PF_ENABLE_RT_THREAD_ACCESS | USBD_PF_MAP_ADD_TRANSFERS) + +typedef struct _USBD_INTERFACE_INFORMATION { + USHORT Length; + UCHAR InterfaceNumber; + UCHAR AlternateSetting; + UCHAR Class; + UCHAR SubClass; + UCHAR Protocol; + UCHAR Reserved; + USBD_INTERFACE_HANDLE InterfaceHandle; + ULONG NumberOfPipes; + USBD_PIPE_INFORMATION Pipes[1]; +} USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION; + +struct _URB_HCD_AREA { + PVOID Reserved8[8]; +}; + +struct _URB_HEADER { + USHORT Length; + USHORT Function; + USBD_STATUS Status; + PVOID UsbdDeviceHandle; + ULONG UsbdFlags; +}; + +struct _URB_SELECT_INTERFACE { + struct _URB_HEADER Hdr; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; + USBD_INTERFACE_INFORMATION Interface; +}; + +struct _URB_SELECT_CONFIGURATION { + struct _URB_HEADER Hdr; + PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; + USBD_CONFIGURATION_HANDLE ConfigurationHandle; + USBD_INTERFACE_INFORMATION Interface; +}; + +struct _URB_PIPE_REQUEST { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG Reserved; +}; + +struct _URB_FRAME_LENGTH_CONTROL { + struct _URB_HEADER Hdr; +}; + +struct _URB_GET_FRAME_LENGTH { + struct _URB_HEADER Hdr; + ULONG FrameLength; + ULONG FrameNumber; +}; + +struct _URB_SET_FRAME_LENGTH { + struct _URB_HEADER Hdr; + LONG FrameLengthDelta; +}; + +struct _URB_GET_CURRENT_FRAME_NUMBER { + struct _URB_HEADER Hdr; + ULONG FrameNumber; +}; + +struct _URB_CONTROL_DESCRIPTOR_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + USHORT Reserved1; + UCHAR Index; + UCHAR DescriptorType; + USHORT LanguageId; + USHORT Reserved2; +}; + +struct _URB_CONTROL_GET_STATUS_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[4]; + USHORT Index; + USHORT Reserved2; +}; + +struct _URB_CONTROL_FEATURE_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved2; + ULONG Reserved3; + PVOID Reserved4; + PMDL Reserved5; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + USHORT Reserved0; + USHORT FeatureSelector; + USHORT Index; + USHORT Reserved1; +}; + +struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR RequestTypeReservedBits; + UCHAR Request; + USHORT Value; + USHORT Index; + USHORT Reserved1; +}; + +struct _URB_CONTROL_GET_INTERFACE_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[4]; + USHORT Interface; + USHORT Reserved2; +}; + +struct _URB_CONTROL_GET_CONFIGURATION_REQUEST { + struct _URB_HEADER Hdr; + PVOID Reserved; + ULONG Reserved0; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR Reserved1[8]; +}; #if (_WIN32_WINNT >= 0x0501) @@ -535,4 +443,93 @@ #endif -#define USBD_PIPE_DIRECTION_IN(pipeInformation) ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) +struct _URB_CONTROL_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + UCHAR SetupPacket[8]; +}; + +#if (_WIN32_WINNT >= 0x0600) + +struct _URB_CONTROL_TRANSFER_EX { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + ULONG Timeout; +#ifdef WIN64 + ULONG Pad; +#endif + struct _URB_HCD_AREA hca; + UCHAR SetupPacket[8]; +}; + +#endif + +struct _URB_BULK_OR_INTERRUPT_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; +}; + +typedef struct _USBD_ISO_PACKET_DESCRIPTOR { + ULONG Offset; + ULONG Length; + USBD_STATUS Status; +} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; + +struct _URB_ISOCH_TRANSFER { + struct _URB_HEADER Hdr; + USBD_PIPE_HANDLE PipeHandle; + ULONG TransferFlags; + ULONG TransferBufferLength; + PVOID TransferBuffer; + PMDL TransferBufferMDL; + struct _URB *UrbLink; + struct _URB_HCD_AREA hca; + ULONG StartFrame; + ULONG NumberOfPackets; + ULONG ErrorCount; + USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; +}; + +typedef struct _URB { + __GNU_EXTENSION union { + struct _URB_HEADER UrbHeader; + struct _URB_SELECT_INTERFACE UrbSelectInterface; + struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration; + struct _URB_PIPE_REQUEST UrbPipeRequest; + struct _URB_FRAME_LENGTH_CONTROL UrbFrameLengthControl; + struct _URB_GET_FRAME_LENGTH UrbGetFrameLength; + struct _URB_SET_FRAME_LENGTH UrbSetFrameLength; + struct _URB_GET_CURRENT_FRAME_NUMBER UrbGetCurrentFrameNumber; + struct _URB_CONTROL_TRANSFER UrbControlTransfer; +#if (_WIN32_WINNT >= 0x0600) + struct _URB_CONTROL_TRANSFER_EX UrbControlTransferEx; +#endif + struct _URB_BULK_OR_INTERRUPT_TRANSFER UrbBulkOrInterruptTransfer; + struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer; + struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest; + struct _URB_CONTROL_GET_STATUS_REQUEST UrbControlGetStatusRequest; + struct _URB_CONTROL_FEATURE_REQUEST UrbControlFeatureRequest; + struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST UrbControlVendorClassRequest; + struct _URB_CONTROL_GET_INTERFACE_REQUEST UrbControlGetInterfaceRequest; + struct _URB_CONTROL_GET_CONFIGURATION_REQUEST UrbControlGetConfigurationRequest; +#if (_WIN32_WINNT >= 0x0501) + struct _URB_OS_FEATURE_DESCRIPTOR_REQUEST UrbOSFeatureDescriptorRequest; +#endif + }; +} URB, *PURB;
14 years, 9 months
1
0
0
0
[akhaldi] 45864: More work on USB related definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 5 12:44:11 2010 New Revision: 45864 URL:
http://svn.reactos.org/svn/reactos?rev=45864&view=rev
Log: More work on USB related definitions Added: branches/header-work/include/psdk/usbuser.h - copied, changed from r45846, branches/header-work/include/ddk/usbuser.h Removed: branches/header-work/include/ddk/usbuser.h Removed: branches/header-work/include/ddk/usbuser.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/usbuser…
============================================================================== --- branches/header-work/include/ddk/usbuser.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/usbuser.h (removed) @@ -1,323 +1,0 @@ -/* - * usbuser.h - * - * USB user mode IOCTL interface - * - * This file is part of the w32api package. - * - * Contributors: - * Created by Casper S. Hornstrup <chorns(a)users.sourceforge.net> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef __USBUSER_H -#define __USBUSER_H - -#include "usb.h" -#include "usbiodef.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#include <pshpack1.h> - -#define USBUSER_VERSION 0x0004 - -#define IOCTL_USB_USER_REQUEST USB_CTL(HCD_USER_REQUEST) - -#ifndef IOCTL_USB_DIAGNOSTIC_MODE_ON -#define IOCTL_USB_DIAGNOSTIC_MODE_ON USB_CTL(HCD_DIAGNOSTIC_MODE_ON) -#endif -#ifndef IOCTL_USB_DIAGNOSTIC_MODE_OFF -#define IOCTL_USB_DIAGNOSTIC_MODE_OFF USB_CTL(HCD_DIAGNOSTIC_MODE_OFF) -#endif - -#ifndef IOCTL_USB_GET_ROOT_HUB_NAME -#define IOCTL_USB_GET_ROOT_HUB_NAME USB_CTL(HCD_GET_ROOT_HUB_NAME) -#endif -#ifndef IOCTL_GET_HCD_DRIVERKEY_NAME -#define IOCTL_GET_HCD_DRIVERKEY_NAME USB_CTL(HCD_GET_DRIVERKEY_NAME) -#endif - -typedef enum _USB_USER_ERROR_CODE { - UsbUserSuccess = 0, - UsbUserNotSupported, - UsbUserInvalidRequestCode, - UsbUserFeatureDisabled, - UsbUserInvalidHeaderParameter, - UsbUserInvalidParameter, - UsbUserMiniportError, - UsbUserBufferTooSmall, - UsbUserErrorNotMapped, - UsbUserDeviceNotStarted, - UsbUserNoDeviceConnected -} USB_USER_ERROR_CODE; - -#define USBUSER_GET_CONTROLLER_INFO_0 0x00000001 -#define USBUSER_GET_CONTROLLER_DRIVER_KEY 0x00000002 -#define USBUSER_PASS_THRU 0x00000003 -#define USBUSER_GET_POWER_STATE_MAP 0x00000004 -#define USBUSER_GET_BANDWIDTH_INFORMATION 0x00000005 -#define USBUSER_GET_BUS_STATISTICS_0 0x00000006 -#define USBUSER_GET_ROOTHUB_SYMBOLIC_NAME 0x00000007 -#define USBUSER_GET_USB_DRIVER_VERSION 0x00000008 -#define USBUSER_GET_USB2_HW_VERSION 0x00000009 -#define USBUSER_OP_SEND_ONE_PACKET 0x10000001 -#define USBUSER_OP_RAW_RESET_PORT 0x20000001 -#define USBUSER_OP_OPEN_RAW_DEVICE 0x20000002 -#define USBUSER_OP_CLOSE_RAW_DEVICE 0x20000003 -#define USBUSER_OP_SEND_RAW_COMMAND 0x20000004 -#define USBUSER_INVALID_REQUEST 0xFFFFFFF0 -#define USBUSER_OP_MASK_DEVONLY_API 0x10000000 -#define USBUSER_OP_MASK_HCTEST_API 0x20000000 - -#define USB_PACKETFLAG_LOW_SPEED 0x00000001 -#define USB_PACKETFLAG_FULL_SPEED 0x00000002 -#define USB_PACKETFLAG_HIGH_SPEED 0x00000004 -#define USB_PACKETFLAG_ASYNC_IN 0x00000008 -#define USB_PACKETFLAG_ASYNC_OUT 0x00000010 -#define USB_PACKETFLAG_ISO_IN 0x00000020 -#define USB_PACKETFLAG_ISO_OUT 0x00000040 -#define USB_PACKETFLAG_SETUP 0x00000080 -#define USB_PACKETFLAG_TOGGLE0 0x00000100 -#define USB_PACKETFLAG_TOGGLE1 0x00000200 - -typedef struct _PACKET_PARAMETERS { - UCHAR DeviceAddress; - UCHAR EndpointAddress; - USHORT MaximumPacketSize; - ULONG Timeout; - ULONG Flags; - ULONG DataLength; - USHORT HubDeviceAddress; - USHORT PortTTNumber; - UCHAR ErrorCount; - UCHAR Pad[3]; - USBD_STATUS UsbdStatusCode; - UCHAR Data[4]; -} PACKET_PARAMETERS, *PPACKET_PARAMETERS; - -typedef struct _RAW_RESET_PORT_PARAMETERS { - USHORT PortNumber; - USHORT PortStatus; -} RAW_RESET_PORT_PARAMETERS, *PRAW_RESET_PORT_PARAMETERS; - -typedef struct _USB_BANDWIDTH_INFO { - ULONG DeviceCount; - ULONG TotalBusBandwidth; - ULONG Total32secBandwidth; - ULONG AllocedBulkAndControl; - ULONG AllocedIso; - ULONG AllocedInterrupt_1ms; - ULONG AllocedInterrupt_2ms; - ULONG AllocedInterrupt_4ms; - ULONG AllocedInterrupt_8ms; - ULONG AllocedInterrupt_16ms; - ULONG AllocedInterrupt_32ms; -} USB_BANDWIDTH_INFO, *PUSB_BANDWIDTH_INFO; - -typedef struct _USBUSER_REQUEST_HEADER { - ULONG UsbUserRequest; - USB_USER_ERROR_CODE UsbUserStatusCode; - ULONG RequestBufferLength; - ULONG ActualBufferLength; -} USBUSER_REQUEST_HEADER, *PUSBUSER_REQUEST_HEADER; - -typedef struct _USBUSER_BANDWIDTH_INFO_REQUEST { - USBUSER_REQUEST_HEADER Header; - USB_BANDWIDTH_INFO BandwidthInformation; -} USBUSER_BANDWIDTH_INFO_REQUEST, *PUSBUSER_BANDWIDTH_INFO_REQUEST; - -typedef struct _USB_BUS_STATISTICS_0 { - ULONG DeviceCount; - LARGE_INTEGER CurrentSystemTime; - ULONG CurrentUsbFrame; - ULONG BulkBytes; - ULONG IsoBytes; - ULONG InterruptBytes; - ULONG ControlDataBytes; - ULONG PciInterruptCount; - ULONG HardResetCount; - ULONG WorkerSignalCount; - ULONG CommonBufferBytes; - ULONG WorkerIdleTimeMs; - BOOLEAN RootHubEnabled; - UCHAR RootHubDevicePowerState; - UCHAR Unused; - UCHAR NameIndex; -} USB_BUS_STATISTICS_0, *PUSB_BUS_STATISTICS_0; - -typedef struct _USBUSER_BUS_STATISTICS_0_REQUEST { - USBUSER_REQUEST_HEADER Header; - USB_BUS_STATISTICS_0 BusStatistics0; -} USBUSER_BUS_STATISTICS_0_REQUEST, *PUSBUSER_BUS_STATISTICS_0_REQUEST; - -/* USB_CONTROLLER_INFO_0.HcFeatureFlags constants */ -#define USB_HC_FEATURE_FLAG_PORT_POWER_SWITCHING 0x00000001 -#define USB_HC_FEATURE_FLAG_SEL_SUSPEND 0x00000002 -#define USB_HC_FEATURE_LEGACY_BIOS 0x00000004 - -typedef struct _USB_CLOSE_RAW_DEVICE_PARAMETERS { - ULONG xxx; -} USB_CLOSE_RAW_DEVICE_PARAMETERS , *PUSB_CLOSE_RAW_DEVICE_PARAMETERS; - -typedef struct _USBUSER_CLOSE_RAW_DEVICE { - USBUSER_REQUEST_HEADER Header; - USB_CLOSE_RAW_DEVICE_PARAMETERS Parameters; -} USBUSER_CLOSE_RAW_DEVICE, *PUSBUSER_CLOSE_RAW_DEVICE; - -typedef struct _USB_CONTROLLER_INFO_0 { - ULONG PciVendorId; - ULONG PciDeviceId; - ULONG PciRevision; - ULONG NumberOfRootPorts; - USB_CONTROLLER_FLAVOR ControllerFlavor; - ULONG HcFeatureFlags; -} USB_CONTROLLER_INFO_0 , *PUSB_CONTROLLER_INFO_0; - -typedef struct _USBUSER_CONTROLLER_INFO_0 { - USBUSER_REQUEST_HEADER Header; - USB_CONTROLLER_INFO_0 Info0; -} USBUSER_CONTROLLER_INFO_0, *PUSBUSER_CONTROLLER_INFO_0; - -typedef struct _USB_DRIVER_VERSION_PARAMETERS { - ULONG DriverTrackingCode; - ULONG USBDI_Version; - ULONG USBUSER_Version; - BOOLEAN CheckedPortDriver; - BOOLEAN CheckedMiniportDriver; - USHORT USB_Version; -} USB_DRIVER_VERSION_PARAMETERS , *PUSB_DRIVER_VERSION_PARAMETERS; - -typedef struct _USBUSER_GET_DRIVER_VERSION { - USBUSER_REQUEST_HEADER Header; - USB_DRIVER_VERSION_PARAMETERS Parameters; -} USBUSER_GET_DRIVER_VERSION, *PUSBUSER_GET_DRIVER_VERSION; - -typedef struct _USB_OPEN_RAW_DEVICE_PARAMETERS { - USHORT PortStatus; - USHORT MaxPacketEp0; -} USB_OPEN_RAW_DEVICE_PARAMETERS , *PUSB_OPEN_RAW_DEVICE_PARAMETERS; - -typedef struct _USBUSER_OPEN_RAW_DEVICE { - USBUSER_REQUEST_HEADER Header; - USB_OPEN_RAW_DEVICE_PARAMETERS Parameters; -} USBUSER_OPEN_RAW_DEVICE, *PUSBUSER_OPEN_RAW_DEVICE; - -typedef enum _WDMUSB_POWER_STATE { - WdmUsbPowerNotMapped = 0, - WdmUsbPowerSystemUnspecified = 100, - WdmUsbPowerSystemWorking, - WdmUsbPowerSystemSleeping1, - WdmUsbPowerSystemSleeping2, - WdmUsbPowerSystemSleeping3, - WdmUsbPowerSystemHibernate, - WdmUsbPowerSystemShutdown, - WdmUsbPowerDeviceUnspecified = 200, - WdmUsbPowerDeviceD0, - WdmUsbPowerDeviceD1, - WdmUsbPowerDeviceD2, - WdmUsbPowerDeviceD3 -} WDMUSB_POWER_STATE; - -typedef struct _USB_POWER_INFO { - WDMUSB_POWER_STATE SystemState; - WDMUSB_POWER_STATE HcDevicePowerState; - WDMUSB_POWER_STATE HcDeviceWake; - WDMUSB_POWER_STATE HcSystemWake; - WDMUSB_POWER_STATE RhDevicePowerState; - WDMUSB_POWER_STATE RhDeviceWake; - WDMUSB_POWER_STATE RhSystemWake; - WDMUSB_POWER_STATE LastSystemSleepState; - BOOLEAN CanWakeup; - BOOLEAN IsPowered; -} USB_POWER_INFO, *PUSB_POWER_INFO; - -typedef struct _USBUSER_POWER_INFO_REQUEST { - USBUSER_REQUEST_HEADER Header; - USB_POWER_INFO PowerInformation; -} USBUSER_POWER_INFO_REQUEST, *PUSBUSER_POWER_INFO_REQUEST; - -typedef struct _USB_UNICODE_NAME { - ULONG Length; - WCHAR String[1]; -} USB_UNICODE_NAME, *PUSB_UNICODE_NAME; - -typedef struct _USBUSER_CONTROLLER_UNICODE_NAME { - USBUSER_REQUEST_HEADER Header; - USB_UNICODE_NAME UnicodeName; -} USBUSER_CONTROLLER_UNICODE_NAME, *PUSBUSER_CONTROLLER_UNICODE_NAME; - -typedef struct _USB_PASS_THRU_PARAMETERS { - GUID FunctionGUID; - ULONG ParameterLength; - UCHAR Parameters[4]; -} USB_PASS_THRU_PARAMETERS, *PUSB_PASS_THRU_PARAMETERS; - -typedef struct _USBUSER_PASS_THRU_REQUEST { - USBUSER_REQUEST_HEADER Header; - USB_PASS_THRU_PARAMETERS PassThru; -} USBUSER_PASS_THRU_REQUEST, *PUSBUSER_PASS_THRU_REQUEST; - -typedef struct _USBUSER_RAW_RESET_ROOT_PORT { - USBUSER_REQUEST_HEADER Header; - RAW_RESET_PORT_PARAMETERS Parameters; -} USBUSER_RAW_RESET_ROOT_PORT, *PUSBUSER_RAW_RESET_ROOT_PORT; - -typedef struct _USBUSER_SEND_ONE_PACKET { - USBUSER_REQUEST_HEADER Header; - PACKET_PARAMETERS PacketParameters; -} USBUSER_SEND_ONE_PACKET, *PUSBUSER_SEND_ONE_PACKET; - -typedef struct _USB_SEND_RAW_COMMAND_PARAMETERS { - UCHAR Usb_bmRequest; - UCHAR Usb_bRequest; - USHORT Usb_wVlaue; - USHORT Usb_wIndex; - USHORT Usb_wLength; - USHORT DeviceAddress; - USHORT MaximumPacketSize; - ULONG Timeout; - ULONG DataLength; - USBD_STATUS UsbdStatusCode; - UCHAR Data[4]; -} USB_SEND_RAW_COMMAND_PARAMETERS, *PUSB_SEND_RAW_COMMAND_PARAMETERS; - -typedef struct _USBUSER_SEND_RAW_COMMAND { - USBUSER_REQUEST_HEADER Header; - USB_SEND_RAW_COMMAND_PARAMETERS Parameters; -} USBUSER_SEND_RAW_COMMAND, *PUSBUSER_SEND_RAW_COMMAND; - -/* USB_USB2HW_VERSION_PARAMETERS.Usb2HwRevision constants */ -#define USB2HW_UNKNOWN 0x00 -#define USB2HW_A0 0xA0 -#define USB2HW_A1 0xA1 -#define USB2HW_B0 0xB0 - -typedef struct _USB_USB2HW_VERSION_PARAMETERS { - UCHAR Usb2HwRevision; -} USB_USB2HW_VERSION_PARAMETERS, *PUSB_USB2HW_VERSION_PARAMETERS; - -typedef struct _USBUSER_GET_USB2HW_VERSION { - USBUSER_REQUEST_HEADER Header; - USB_USB2HW_VERSION_PARAMETERS Parameters; -} USBUSER_GET_USB2HW_VERSION, *PUSBUSER_GET_USB2HW_VERSION; - -#include <poppack.h> - -#ifdef __cplusplus -} -#endif - -#endif /* __USBUSER_H */ Copied: branches/header-work/include/psdk/usbuser.h (from r45846, branches/header-work/include/ddk/usbuser.h) URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/usbuse…
============================================================================== --- branches/header-work/include/ddk/usbuser.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/usbuser.h [iso-8859-1] Fri Mar 5 12:44:11 2010 @@ -20,16 +20,16 @@ * */ -#ifndef __USBUSER_H -#define __USBUSER_H - -#include "usb.h" -#include "usbiodef.h" +#pragma once #ifdef __cplusplus extern "C" { #endif +#if (_WIN32_WINNT >= 0x0501) + +#include "usbiodef.h" + #include <pshpack1.h> #define USBUSER_VERSION 0x0004 @@ -51,17 +51,17 @@ #endif typedef enum _USB_USER_ERROR_CODE { - UsbUserSuccess = 0, - UsbUserNotSupported, - UsbUserInvalidRequestCode, - UsbUserFeatureDisabled, - UsbUserInvalidHeaderParameter, - UsbUserInvalidParameter, - UsbUserMiniportError, - UsbUserBufferTooSmall, - UsbUserErrorNotMapped, - UsbUserDeviceNotStarted, - UsbUserNoDeviceConnected + UsbUserSuccess = 0, + UsbUserNotSupported, + UsbUserInvalidRequestCode, + UsbUserFeatureDisabled, + UsbUserInvalidHeaderParameter, + UsbUserInvalidParameter, + UsbUserMiniportError, + UsbUserBufferTooSmall, + UsbUserErrorNotMapped, + UsbUserDeviceNotStarted, + UsbUserNoDeviceConnected } USB_USER_ERROR_CODE; #define USBUSER_GET_CONTROLLER_INFO_0 0x00000001 @@ -73,11 +73,17 @@ #define USBUSER_GET_ROOTHUB_SYMBOLIC_NAME 0x00000007 #define USBUSER_GET_USB_DRIVER_VERSION 0x00000008 #define USBUSER_GET_USB2_HW_VERSION 0x00000009 +#define USBUSER_USB_REFRESH_HCT_REG 0x0000000a + #define USBUSER_OP_SEND_ONE_PACKET 0x10000001 #define USBUSER_OP_RAW_RESET_PORT 0x20000001 #define USBUSER_OP_OPEN_RAW_DEVICE 0x20000002 #define USBUSER_OP_CLOSE_RAW_DEVICE 0x20000003 #define USBUSER_OP_SEND_RAW_COMMAND 0x20000004 +#define USBUSER_SET_ROOTPORT_FEATURE 0x20000005 +#define USBUSER_CLEAR_ROOTPORT_FEATURE 0x20000006 +#define USBUSER_GET_ROOTPORT_STATUS 0x20000007 + #define USBUSER_INVALID_REQUEST 0xFFFFFFF0 #define USBUSER_OP_MASK_DEVONLY_API 0x10000000 #define USBUSER_OP_MASK_HCTEST_API 0x20000000 @@ -93,231 +99,249 @@ #define USB_PACKETFLAG_TOGGLE0 0x00000100 #define USB_PACKETFLAG_TOGGLE1 0x00000200 -typedef struct _PACKET_PARAMETERS { - UCHAR DeviceAddress; - UCHAR EndpointAddress; - USHORT MaximumPacketSize; - ULONG Timeout; - ULONG Flags; - ULONG DataLength; - USHORT HubDeviceAddress; - USHORT PortTTNumber; - UCHAR ErrorCount; - UCHAR Pad[3]; - USBD_STATUS UsbdStatusCode; - UCHAR Data[4]; -} PACKET_PARAMETERS, *PPACKET_PARAMETERS; - -typedef struct _RAW_RESET_PORT_PARAMETERS { - USHORT PortNumber; - USHORT PortStatus; -} RAW_RESET_PORT_PARAMETERS, *PRAW_RESET_PORT_PARAMETERS; - -typedef struct _USB_BANDWIDTH_INFO { - ULONG DeviceCount; - ULONG TotalBusBandwidth; - ULONG Total32secBandwidth; - ULONG AllocedBulkAndControl; - ULONG AllocedIso; - ULONG AllocedInterrupt_1ms; - ULONG AllocedInterrupt_2ms; - ULONG AllocedInterrupt_4ms; - ULONG AllocedInterrupt_8ms; - ULONG AllocedInterrupt_16ms; - ULONG AllocedInterrupt_32ms; -} USB_BANDWIDTH_INFO, *PUSB_BANDWIDTH_INFO; - -typedef struct _USBUSER_REQUEST_HEADER { - ULONG UsbUserRequest; - USB_USER_ERROR_CODE UsbUserStatusCode; - ULONG RequestBufferLength; - ULONG ActualBufferLength; -} USBUSER_REQUEST_HEADER, *PUSBUSER_REQUEST_HEADER; - -typedef struct _USBUSER_BANDWIDTH_INFO_REQUEST { - USBUSER_REQUEST_HEADER Header; - USB_BANDWIDTH_INFO BandwidthInformation; -} USBUSER_BANDWIDTH_INFO_REQUEST, *PUSBUSER_BANDWIDTH_INFO_REQUEST; - -typedef struct _USB_BUS_STATISTICS_0 { - ULONG DeviceCount; - LARGE_INTEGER CurrentSystemTime; - ULONG CurrentUsbFrame; - ULONG BulkBytes; - ULONG IsoBytes; - ULONG InterruptBytes; - ULONG ControlDataBytes; - ULONG PciInterruptCount; - ULONG HardResetCount; - ULONG WorkerSignalCount; - ULONG CommonBufferBytes; - ULONG WorkerIdleTimeMs; - BOOLEAN RootHubEnabled; - UCHAR RootHubDevicePowerState; - UCHAR Unused; - UCHAR NameIndex; -} USB_BUS_STATISTICS_0, *PUSB_BUS_STATISTICS_0; - -typedef struct _USBUSER_BUS_STATISTICS_0_REQUEST { - USBUSER_REQUEST_HEADER Header; - USB_BUS_STATISTICS_0 BusStatistics0; -} USBUSER_BUS_STATISTICS_0_REQUEST, *PUSBUSER_BUS_STATISTICS_0_REQUEST; - /* USB_CONTROLLER_INFO_0.HcFeatureFlags constants */ #define USB_HC_FEATURE_FLAG_PORT_POWER_SWITCHING 0x00000001 #define USB_HC_FEATURE_FLAG_SEL_SUSPEND 0x00000002 #define USB_HC_FEATURE_LEGACY_BIOS 0x00000004 +typedef struct _USBUSER_REQUEST_HEADER { + ULONG UsbUserRequest; + USB_USER_ERROR_CODE UsbUserStatusCode; + ULONG RequestBufferLength; + ULONG ActualBufferLength; +} USBUSER_REQUEST_HEADER, *PUSBUSER_REQUEST_HEADER; + +typedef struct _PACKET_PARAMETERS { + UCHAR DeviceAddress; + UCHAR EndpointAddress; + USHORT MaximumPacketSize; + ULONG Timeout; + ULONG Flags; + ULONG DataLength; + USHORT HubDeviceAddress; + USHORT PortTTNumber; + UCHAR ErrorCount; + UCHAR Pad[3]; + USBD_STATUS UsbdStatusCode; + UCHAR Data[4]; +} PACKET_PARAMETERS, *PPACKET_PARAMETERS; + +typedef struct _USBUSER_SEND_ONE_PACKET { + USBUSER_REQUEST_HEADER Header; + PACKET_PARAMETERS PacketParameters; +} USBUSER_SEND_ONE_PACKET, *PUSBUSER_SEND_ONE_PACKET; + +typedef struct _RAW_RESET_PORT_PARAMETERS { + USHORT PortNumber; + USHORT PortStatus; +} RAW_RESET_PORT_PARAMETERS, *PRAW_RESET_PORT_PARAMETERS; + +typedef struct _USBUSER_RAW_RESET_ROOT_PORT { + USBUSER_REQUEST_HEADER Header; + RAW_RESET_PORT_PARAMETERS Parameters; +} USBUSER_RAW_RESET_ROOT_PORT, *PUSBUSER_RAW_RESET_ROOT_PORT; + +typedef struct _RAW_ROOTPORT_FEATURE { + USHORT PortNumber; + USHORT PortFeature; + USHORT PortStatus; +} RAW_ROOTPORT_FEATURE, *PRAW_ROOTPORT_FEATURE; + +typedef struct _USBUSER_ROOTPORT_FEATURE_REQUEST { + USBUSER_REQUEST_HEADER Header; + RAW_ROOTPORT_FEATURE Parameters; +} USBUSER_ROOTPORT_FEATURE_REQUEST, *PUSBUSER_ROOTPORT_FEATURE_REQUEST; + +typedef struct _RAW_ROOTPORT_PARAMETERS { + USHORT PortNumber; + USHORT PortStatus; +} RAW_ROOTPORT_PARAMETERS, *PRAW_ROOTPORT_PARAMETERS; + +typedef struct _USBUSER_ROOTPORT_PARAMETERS { + USBUSER_REQUEST_HEADER Header; + RAW_ROOTPORT_PARAMETERS Parameters; +} USBUSER_ROOTPORT_PARAMETERS, *PUSBUSER_ROOTPORT_PARAMETERS; + +typedef struct _USB_CONTROLLER_INFO_0 { + ULONG PciVendorId; + ULONG PciDeviceId; + ULONG PciRevision; + ULONG NumberOfRootPorts; + USB_CONTROLLER_FLAVOR ControllerFlavor; + ULONG HcFeatureFlags; +} USB_CONTROLLER_INFO_0 , *PUSB_CONTROLLER_INFO_0; + +typedef struct _USBUSER_CONTROLLER_INFO_0 { + USBUSER_REQUEST_HEADER Header; + USB_CONTROLLER_INFO_0 Info0; +} USBUSER_CONTROLLER_INFO_0, *PUSBUSER_CONTROLLER_INFO_0; + +typedef struct _USB_UNICODE_NAME { + ULONG Length; + WCHAR String[1]; +} USB_UNICODE_NAME, *PUSB_UNICODE_NAME; + +typedef struct _USBUSER_CONTROLLER_UNICODE_NAME { + USBUSER_REQUEST_HEADER Header; + USB_UNICODE_NAME UnicodeName; +} USBUSER_CONTROLLER_UNICODE_NAME, *PUSBUSER_CONTROLLER_UNICODE_NAME; + +typedef struct _USB_PASS_THRU_PARAMETERS { + GUID FunctionGUID; + ULONG ParameterLength; + UCHAR Parameters[4]; +} USB_PASS_THRU_PARAMETERS, *PUSB_PASS_THRU_PARAMETERS; + +typedef struct _USBUSER_PASS_THRU_REQUEST { + USBUSER_REQUEST_HEADER Header; + USB_PASS_THRU_PARAMETERS PassThru; +} USBUSER_PASS_THRU_REQUEST, *PUSBUSER_PASS_THRU_REQUEST; + +typedef enum _WDMUSB_POWER_STATE { + WdmUsbPowerNotMapped = 0, + WdmUsbPowerSystemUnspecified = 100, + WdmUsbPowerSystemWorking, + WdmUsbPowerSystemSleeping1, + WdmUsbPowerSystemSleeping2, + WdmUsbPowerSystemSleeping3, + WdmUsbPowerSystemHibernate, + WdmUsbPowerSystemShutdown, + WdmUsbPowerDeviceUnspecified = 200, + WdmUsbPowerDeviceD0, + WdmUsbPowerDeviceD1, + WdmUsbPowerDeviceD2, + WdmUsbPowerDeviceD3 +} WDMUSB_POWER_STATE; + +typedef struct _USB_POWER_INFO { + WDMUSB_POWER_STATE SystemState; + WDMUSB_POWER_STATE HcDevicePowerState; + WDMUSB_POWER_STATE HcDeviceWake; + WDMUSB_POWER_STATE HcSystemWake; + WDMUSB_POWER_STATE RhDevicePowerState; + WDMUSB_POWER_STATE RhDeviceWake; + WDMUSB_POWER_STATE RhSystemWake; + WDMUSB_POWER_STATE LastSystemSleepState; + BOOLEAN CanWakeup; + BOOLEAN IsPowered; +} USB_POWER_INFO, *PUSB_POWER_INFO; + +typedef struct _USBUSER_POWER_INFO_REQUEST { + USBUSER_REQUEST_HEADER Header; + USB_POWER_INFO PowerInformation; +} USBUSER_POWER_INFO_REQUEST, *PUSBUSER_POWER_INFO_REQUEST; + +typedef struct _USB_OPEN_RAW_DEVICE_PARAMETERS { + USHORT PortStatus; + USHORT MaxPacketEp0; +} USB_OPEN_RAW_DEVICE_PARAMETERS , *PUSB_OPEN_RAW_DEVICE_PARAMETERS; + +typedef struct _USBUSER_OPEN_RAW_DEVICE { + USBUSER_REQUEST_HEADER Header; + USB_OPEN_RAW_DEVICE_PARAMETERS Parameters; +} USBUSER_OPEN_RAW_DEVICE, *PUSBUSER_OPEN_RAW_DEVICE; + typedef struct _USB_CLOSE_RAW_DEVICE_PARAMETERS { - ULONG xxx; + ULONG xxx; } USB_CLOSE_RAW_DEVICE_PARAMETERS , *PUSB_CLOSE_RAW_DEVICE_PARAMETERS; typedef struct _USBUSER_CLOSE_RAW_DEVICE { - USBUSER_REQUEST_HEADER Header; - USB_CLOSE_RAW_DEVICE_PARAMETERS Parameters; + USBUSER_REQUEST_HEADER Header; + USB_CLOSE_RAW_DEVICE_PARAMETERS Parameters; } USBUSER_CLOSE_RAW_DEVICE, *PUSBUSER_CLOSE_RAW_DEVICE; -typedef struct _USB_CONTROLLER_INFO_0 { - ULONG PciVendorId; - ULONG PciDeviceId; - ULONG PciRevision; - ULONG NumberOfRootPorts; - USB_CONTROLLER_FLAVOR ControllerFlavor; - ULONG HcFeatureFlags; -} USB_CONTROLLER_INFO_0 , *PUSB_CONTROLLER_INFO_0; - -typedef struct _USBUSER_CONTROLLER_INFO_0 { - USBUSER_REQUEST_HEADER Header; - USB_CONTROLLER_INFO_0 Info0; -} USBUSER_CONTROLLER_INFO_0, *PUSBUSER_CONTROLLER_INFO_0; +typedef struct _USB_SEND_RAW_COMMAND_PARAMETERS { + UCHAR Usb_bmRequest; + UCHAR Usb_bRequest; + USHORT Usb_wVlaue; + USHORT Usb_wIndex; + USHORT Usb_wLength; + USHORT DeviceAddress; + USHORT MaximumPacketSize; + ULONG Timeout; + ULONG DataLength; + USBD_STATUS UsbdStatusCode; + UCHAR Data[4]; +} USB_SEND_RAW_COMMAND_PARAMETERS, *PUSB_SEND_RAW_COMMAND_PARAMETERS; + +typedef struct _USBUSER_SEND_RAW_COMMAND { + USBUSER_REQUEST_HEADER Header; + USB_SEND_RAW_COMMAND_PARAMETERS Parameters; +} USBUSER_SEND_RAW_COMMAND, *PUSBUSER_SEND_RAW_COMMAND; + +typedef struct _USB_BANDWIDTH_INFO { + ULONG DeviceCount; + ULONG TotalBusBandwidth; + ULONG Total32secBandwidth; + ULONG AllocedBulkAndControl; + ULONG AllocedIso; + ULONG AllocedInterrupt_1ms; + ULONG AllocedInterrupt_2ms; + ULONG AllocedInterrupt_4ms; + ULONG AllocedInterrupt_8ms; + ULONG AllocedInterrupt_16ms; + ULONG AllocedInterrupt_32ms; +} USB_BANDWIDTH_INFO, *PUSB_BANDWIDTH_INFO; + +typedef struct _USBUSER_BANDWIDTH_INFO_REQUEST { + USBUSER_REQUEST_HEADER Header; + USB_BANDWIDTH_INFO BandwidthInformation; +} USBUSER_BANDWIDTH_INFO_REQUEST, *PUSBUSER_BANDWIDTH_INFO_REQUEST; + +typedef struct _USB_BUS_STATISTICS_0 { + ULONG DeviceCount; + LARGE_INTEGER CurrentSystemTime; + ULONG CurrentUsbFrame; + ULONG BulkBytes; + ULONG IsoBytes; + ULONG InterruptBytes; + ULONG ControlDataBytes; + ULONG PciInterruptCount; + ULONG HardResetCount; + ULONG WorkerSignalCount; + ULONG CommonBufferBytes; + ULONG WorkerIdleTimeMs; + BOOLEAN RootHubEnabled; + UCHAR RootHubDevicePowerState; + UCHAR Unused; + UCHAR NameIndex; +} USB_BUS_STATISTICS_0, *PUSB_BUS_STATISTICS_0; + +typedef struct _USBUSER_BUS_STATISTICS_0_REQUEST { + USBUSER_REQUEST_HEADER Header; + USB_BUS_STATISTICS_0 BusStatistics0; +} USBUSER_BUS_STATISTICS_0_REQUEST, *PUSBUSER_BUS_STATISTICS_0_REQUEST; typedef struct _USB_DRIVER_VERSION_PARAMETERS { - ULONG DriverTrackingCode; - ULONG USBDI_Version; - ULONG USBUSER_Version; - BOOLEAN CheckedPortDriver; - BOOLEAN CheckedMiniportDriver; - USHORT USB_Version; + ULONG DriverTrackingCode; + ULONG USBDI_Version; + ULONG USBUSER_Version; + BOOLEAN CheckedPortDriver; + BOOLEAN CheckedMiniportDriver; + USHORT USB_Version; } USB_DRIVER_VERSION_PARAMETERS , *PUSB_DRIVER_VERSION_PARAMETERS; typedef struct _USBUSER_GET_DRIVER_VERSION { - USBUSER_REQUEST_HEADER Header; - USB_DRIVER_VERSION_PARAMETERS Parameters; + USBUSER_REQUEST_HEADER Header; + USB_DRIVER_VERSION_PARAMETERS Parameters; } USBUSER_GET_DRIVER_VERSION, *PUSBUSER_GET_DRIVER_VERSION; -typedef struct _USB_OPEN_RAW_DEVICE_PARAMETERS { - USHORT PortStatus; - USHORT MaxPacketEp0; -} USB_OPEN_RAW_DEVICE_PARAMETERS , *PUSB_OPEN_RAW_DEVICE_PARAMETERS; - -typedef struct _USBUSER_OPEN_RAW_DEVICE { - USBUSER_REQUEST_HEADER Header; - USB_OPEN_RAW_DEVICE_PARAMETERS Parameters; -} USBUSER_OPEN_RAW_DEVICE, *PUSBUSER_OPEN_RAW_DEVICE; - -typedef enum _WDMUSB_POWER_STATE { - WdmUsbPowerNotMapped = 0, - WdmUsbPowerSystemUnspecified = 100, - WdmUsbPowerSystemWorking, - WdmUsbPowerSystemSleeping1, - WdmUsbPowerSystemSleeping2, - WdmUsbPowerSystemSleeping3, - WdmUsbPowerSystemHibernate, - WdmUsbPowerSystemShutdown, - WdmUsbPowerDeviceUnspecified = 200, - WdmUsbPowerDeviceD0, - WdmUsbPowerDeviceD1, - WdmUsbPowerDeviceD2, - WdmUsbPowerDeviceD3 -} WDMUSB_POWER_STATE; - -typedef struct _USB_POWER_INFO { - WDMUSB_POWER_STATE SystemState; - WDMUSB_POWER_STATE HcDevicePowerState; - WDMUSB_POWER_STATE HcDeviceWake; - WDMUSB_POWER_STATE HcSystemWake; - WDMUSB_POWER_STATE RhDevicePowerState; - WDMUSB_POWER_STATE RhDeviceWake; - WDMUSB_POWER_STATE RhSystemWake; - WDMUSB_POWER_STATE LastSystemSleepState; - BOOLEAN CanWakeup; - BOOLEAN IsPowered; -} USB_POWER_INFO, *PUSB_POWER_INFO; - -typedef struct _USBUSER_POWER_INFO_REQUEST { - USBUSER_REQUEST_HEADER Header; - USB_POWER_INFO PowerInformation; -} USBUSER_POWER_INFO_REQUEST, *PUSBUSER_POWER_INFO_REQUEST; - -typedef struct _USB_UNICODE_NAME { - ULONG Length; - WCHAR String[1]; -} USB_UNICODE_NAME, *PUSB_UNICODE_NAME; - -typedef struct _USBUSER_CONTROLLER_UNICODE_NAME { - USBUSER_REQUEST_HEADER Header; - USB_UNICODE_NAME UnicodeName; -} USBUSER_CONTROLLER_UNICODE_NAME, *PUSBUSER_CONTROLLER_UNICODE_NAME; - -typedef struct _USB_PASS_THRU_PARAMETERS { - GUID FunctionGUID; - ULONG ParameterLength; - UCHAR Parameters[4]; -} USB_PASS_THRU_PARAMETERS, *PUSB_PASS_THRU_PARAMETERS; - -typedef struct _USBUSER_PASS_THRU_REQUEST { - USBUSER_REQUEST_HEADER Header; - USB_PASS_THRU_PARAMETERS PassThru; -} USBUSER_PASS_THRU_REQUEST, *PUSBUSER_PASS_THRU_REQUEST; - -typedef struct _USBUSER_RAW_RESET_ROOT_PORT { - USBUSER_REQUEST_HEADER Header; - RAW_RESET_PORT_PARAMETERS Parameters; -} USBUSER_RAW_RESET_ROOT_PORT, *PUSBUSER_RAW_RESET_ROOT_PORT; - -typedef struct _USBUSER_SEND_ONE_PACKET { - USBUSER_REQUEST_HEADER Header; - PACKET_PARAMETERS PacketParameters; -} USBUSER_SEND_ONE_PACKET, *PUSBUSER_SEND_ONE_PACKET; - -typedef struct _USB_SEND_RAW_COMMAND_PARAMETERS { - UCHAR Usb_bmRequest; - UCHAR Usb_bRequest; - USHORT Usb_wVlaue; - USHORT Usb_wIndex; - USHORT Usb_wLength; - USHORT DeviceAddress; - USHORT MaximumPacketSize; - ULONG Timeout; - ULONG DataLength; - USBD_STATUS UsbdStatusCode; - UCHAR Data[4]; -} USB_SEND_RAW_COMMAND_PARAMETERS, *PUSB_SEND_RAW_COMMAND_PARAMETERS; - -typedef struct _USBUSER_SEND_RAW_COMMAND { - USBUSER_REQUEST_HEADER Header; - USB_SEND_RAW_COMMAND_PARAMETERS Parameters; -} USBUSER_SEND_RAW_COMMAND, *PUSBUSER_SEND_RAW_COMMAND; - -/* USB_USB2HW_VERSION_PARAMETERS.Usb2HwRevision constants */ -#define USB2HW_UNKNOWN 0x00 -#define USB2HW_A0 0xA0 -#define USB2HW_A1 0xA1 -#define USB2HW_B0 0xB0 - typedef struct _USB_USB2HW_VERSION_PARAMETERS { - UCHAR Usb2HwRevision; + UCHAR Usb2HwRevision; } USB_USB2HW_VERSION_PARAMETERS, *PUSB_USB2HW_VERSION_PARAMETERS; typedef struct _USBUSER_GET_USB2HW_VERSION { - USBUSER_REQUEST_HEADER Header; - USB_USB2HW_VERSION_PARAMETERS Parameters; + USBUSER_REQUEST_HEADER Header; + USB_USB2HW_VERSION_PARAMETERS Parameters; } USBUSER_GET_USB2HW_VERSION, *PUSBUSER_GET_USB2HW_VERSION; + +typedef struct _USBUSER_REFRESH_HCT_REG { + USBUSER_REQUEST_HEADER Header; + ULONG Flags; +} USBUSER_REFRESH_HCT_REG, *PUSBUSER_REFRESH_HCT_REG; #include <poppack.h> #ifdef __cplusplus } #endif - -#endif /* __USBUSER_H */
14 years, 9 months
1
0
0
0
[akhaldi] 45863: More work on USB related definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 5 12:12:29 2010 New Revision: 45863 URL:
http://svn.reactos.org/svn/reactos?rev=45863&view=rev
Log: More work on USB related definitions Added: branches/header-work/include/psdk/usbioctl.h - copied, changed from r45846, branches/header-work/include/ddk/usbioctl.h Removed: branches/header-work/include/ddk/usbioctl.h Removed: branches/header-work/include/ddk/usbioctl.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/usbioct…
============================================================================== --- branches/header-work/include/ddk/usbioctl.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/usbioctl.h (removed) @@ -1,348 +1,0 @@ -/* - * usbioctl.h - * - * USB IOCTL interface. - * - * This file is part of the w32api package. - * - * Contributors: - * Created by Casper S. Hornstrup <chorns(a)users.sourceforge.net> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef __USBIOCTL_H -#define __USBIOCTL_H - -#include "usb100.h" -#include "usbiodef.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define USBD_PORT_ENABLED 1 -#define USBD_PORT_CONNECTED 2 - -#define IOCTL_INTERNAL_USB_CYCLE_PORT \ - CTL_CODE(FILE_DEVICE_USB, USB_CYCLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_ENABLE_PORT \ - CTL_CODE(FILE_DEVICE_USB, USB_ENABLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_BUS_INFO \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_BUS_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_BUSGUID_INFO \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_BUSGUID_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_CONTROLLER_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_HUB_COUNT \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_COUNT, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_HUB_NAME \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_PARENT_HUB_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_PORT_STATUS \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_PORT_STATUS, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_RESET_PORT \ - CTL_CODE(FILE_DEVICE_USB, USB_RESET_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_ROOTHUB_PDO, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION \ - CTL_CODE(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_SUBMIT_URB \ - CTL_CODE(FILE_DEVICE_USB, USB_SUBMIT_URB, METHOD_NEITHER, FILE_ANY_ACCESS) - - -#define IOCTL_USB_DIAG_IGNORE_HUBS_ON \ - CTL_CODE(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_DIAG_IGNORE_HUBS_OFF \ - CTL_CODE(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_DIAGNOSTIC_MODE_OFF \ - CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_DIAGNOSTIC_MODE_ON \ - CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_HUB_CAPABILITIES \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_ROOT_HUB_NAME \ - CTL_CODE(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_GET_HCD_DRIVERKEY_NAME \ - CTL_CODE(FILE_DEVICE_USB, HCD_GET_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_NODE_INFORMATION \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_NODE_CONNECTION_NAME \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_HCD_DISABLE_PORT \ - CTL_CODE(FILE_DEVICE_USB, HCD_DISABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_HCD_ENABLE_PORT \ - CTL_CODE(FILE_DEVICE_USB, HCD_ENABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_HCD_GET_STATS_1 \ - CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_1, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_HCD_GET_STATS_2 \ - CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_2, METHOD_BUFFERED, FILE_ANY_ACCESS) - - -typedef struct _USB_HUB_CAPABILITIES { - ULONG HubIs2xCapable : 1; -} USB_HUB_CAPABILITIES, *PUSB_HUB_CAPABILITIES; - -typedef enum _USB_CONNECTION_STATUS { - NoDeviceConnected, - DeviceConnected, - DeviceFailedEnumeration, - DeviceGeneralFailure, - DeviceCausedOvercurrent, - DeviceNotEnoughPower, - DeviceNotEnoughBandwidth, - DeviceHubNestedTooDeeply, - DeviceInLegacyHub -} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; - -#include <pshpack1.h> - -typedef struct _USB_DESCRIPTOR_REQUEST { - ULONG ConnectionIndex; - struct { - UCHAR bmRequest; - UCHAR bRequest; - USHORT wValue; - USHORT wIndex; - USHORT wLength; - } SetupPacket; - UCHAR Data[0]; -} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST; - -typedef struct _USB_HCD_DRIVERKEY_NAME { - ULONG ActualLength; - WCHAR DriverKeyName[1]; -} USB_HCD_DRIVERKEY_NAME, *PUSB_HCD_DRIVERKEY_NAME; - -typedef struct _HCD_ISO_STAT_COUNTERS { - USHORT LateUrbs; - USHORT DoubleBufferedPackets; - USHORT TransfersCF_5ms; - USHORT TransfersCF_2ms; - USHORT TransfersCF_1ms; - USHORT MaxInterruptLatency; - USHORT BadStartFrame; - USHORT StaleUrbs; - USHORT IsoPacketNotAccesed; - USHORT IsoPacketHWError; - USHORT SmallestUrbPacketCount; - USHORT LargestUrbPacketCount; - USHORT IsoCRC_Error; - USHORT IsoOVERRUN_Error; - USHORT IsoINTERNAL_Error; - USHORT IsoUNKNOWN_Error; - ULONG IsoBytesTransferred; - USHORT LateMissedCount; - USHORT HWIsoMissedCount; - ULONG Reserved7[8]; -} HCD_ISO_STAT_COUNTERS, *PHCD_ISO_STAT_COUNTERS; - -typedef struct _HCD_STAT_COUNTERS { - ULONG BytesTransferred; - USHORT IsoMissedCount; - USHORT DataOverrunErrorCount; - USHORT CrcErrorCount; - USHORT ScheduleOverrunCount; - USHORT TimeoutErrorCount; - USHORT InternalHcErrorCount; - USHORT BufferOverrunErrorCount; - USHORT SWErrorCount; - USHORT StallPidCount; - USHORT PortDisableCount; -} HCD_STAT_COUNTERS, *PHCD_STAT_COUNTERS; - -typedef struct _HCD_STAT_INFORMATION_1 { - ULONG Reserved1; - ULONG Reserved2; - ULONG ResetCounters; - LARGE_INTEGER TimeRead; - HCD_STAT_COUNTERS Counters; -} HCD_STAT_INFORMATION_1, *PHCD_STAT_INFORMATION_1; - -typedef struct _HCD_STAT_INFORMATION_2 { - ULONG Reserved1; - ULONG Reserved2; - ULONG ResetCounters; - LARGE_INTEGER TimeRead; - LONG LockedMemoryUsed; - HCD_STAT_COUNTERS Counters; - HCD_ISO_STAT_COUNTERS IsoCounters; -} HCD_STAT_INFORMATION_2, *PHCD_STAT_INFORMATION_2; - -typedef struct _USB_HUB_INFORMATION { - USB_HUB_DESCRIPTOR HubDescriptor; - BOOLEAN HubIsBusPowered; -} USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION; - -typedef struct _USB_HUB_NAME { - ULONG ActualLength; - WCHAR HubName[1]; -} USB_HUB_NAME, *PUSB_HUB_NAME; - -typedef enum _USB_HUB_NODE { - UsbHub, - UsbMIParent -} USB_HUB_NODE; - -typedef VOID NTAPI -(*USB_IDLE_CALLBACK)( - PVOID Context); - -typedef struct _USB_IDLE_CALLBACK_INFO { - USB_IDLE_CALLBACK IdleCallback; - PVOID IdleContext; -} USB_IDLE_CALLBACK_INFO, *PUSB_IDLE_CALLBACK_INFO; - -typedef struct _USB_NODE_CONNECTION_ATTRIBUTES { - ULONG ConnectionIndex; - USB_CONNECTION_STATUS ConnectionStatus; - ULONG PortAttributes; -} USB_NODE_CONNECTION_ATTRIBUTES, *PUSB_NODE_CONNECTION_ATTRIBUTES; - -typedef struct _USB_NODE_CONNECTION_DRIVERKEY_NAME { - ULONG ConnectionIndex; - ULONG ActualLength; - WCHAR DriverKeyName[1]; -} USB_NODE_CONNECTION_DRIVERKEY_NAME, *PUSB_NODE_CONNECTION_DRIVERKEY_NAME; - -typedef struct _USB_PIPE_INFO { - USB_ENDPOINT_DESCRIPTOR EndpointDescriptor; - ULONG ScheduleOffset; -} USB_PIPE_INFO, *PUSB_PIPE_INFO; - -typedef struct _USB_NODE_CONNECTION_INFORMATION { - ULONG ConnectionIndex; - USB_DEVICE_DESCRIPTOR DeviceDescriptor; - UCHAR CurrentConfigurationValue; - BOOLEAN LowSpeed; - BOOLEAN DeviceIsHub; - USHORT DeviceAddress; - ULONG NumberOfOpenPipes; - USB_CONNECTION_STATUS ConnectionStatus; - USB_PIPE_INFO PipeList[0]; -} USB_NODE_CONNECTION_INFORMATION, *PUSB_NODE_CONNECTION_INFORMATION; - -typedef struct _USB_NODE_CONNECTION_NAME { - ULONG ConnectionIndex; - ULONG ActualLength; - WCHAR NodeName[1]; -} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME; - -typedef struct _USB_MI_PARENT_INFORMATION { - ULONG NumberOfInterfaces; -} USB_MI_PARENT_INFORMATION, *PUSB_MI_PARENT_INFORMATION; - -typedef struct _USB_NODE_INFORMATION { - USB_HUB_NODE NodeType; - union { - USB_HUB_INFORMATION HubInformation; - USB_MI_PARENT_INFORMATION MiParentInformation; - } u; -} USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION; - -#define WMI_USB_DRIVER_INFORMATION 0 -#define WMI_USB_DRIVER_NOTIFICATION 1 -#define WMI_USB_POWER_DEVICE_ENABLE 2 - -typedef enum _USB_NOTIFICATION_TYPE { - EnumerationFailure = 0, - InsufficentBandwidth, - InsufficentPower, - OverCurrent, - ResetOvercurrent, - AcquireBusInfo, - AcquireHubName, - AcquireControllerName, - HubOvercurrent, - HubPowerChange, - HubNestedTooDeeply, - ModernDeviceInLegacyHub -} USB_NOTIFICATION_TYPE; - -typedef struct _USB_ACQUIRE_INFO { - USB_NOTIFICATION_TYPE NotificationType; - ULONG TotalSize; - WCHAR Buffer[1]; -} USB_ACQUIRE_INFO, *PUSB_ACQUIRE_INFO; - -typedef struct _USB_NOTIFICATION { - USB_NOTIFICATION_TYPE NotificationType; -} USB_NOTIFICATION, *PUSB_NOTIFICATION; - -typedef struct _USB_BUS_NOTIFICATION { - USB_NOTIFICATION_TYPE NotificationType; - ULONG TotalBandwidth; - ULONG ConsumedBandwidth; - ULONG ControllerNameLength; -} USB_BUS_NOTIFICATION, *PUSB_BUS_NOTIFICATION; - -typedef struct _USB_CONNECTION_NOTIFICATION { - USB_NOTIFICATION_TYPE NotificationType; - ULONG ConnectionNumber; - ULONG RequestedBandwidth; - ULONG EnumerationFailReason; - ULONG PowerRequested; - ULONG HubNameLength; -} USB_CONNECTION_NOTIFICATION, *PUSB_CONNECTION_NOTIFICATION; - -typedef struct _USB_ROOT_HUB_NAME { - ULONG ActualLength; - WCHAR RootHubName[1]; -} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME; - -#include <poppack.h> - -#ifdef __cplusplus -} -#endif - -#endif /* __USBIOCTL_H */ Copied: branches/header-work/include/psdk/usbioctl.h (from r45846, branches/header-work/include/ddk/usbioctl.h) URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/usbioc…
============================================================================== --- branches/header-work/include/ddk/usbioctl.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/usbioctl.h [iso-8859-1] Fri Mar 5 12:12:29 2010 @@ -20,8 +20,7 @@ * */ -#ifndef __USBIOCTL_H -#define __USBIOCTL_H +#pragma once #include "usb100.h" #include "usbiodef.h" @@ -30,51 +29,154 @@ extern "C" { #endif +#define IOCTL_INTERNAL_USB_SUBMIT_URB \ + CTL_CODE(FILE_DEVICE_USB, USB_SUBMIT_URB, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_RESET_PORT \ + CTL_CODE(FILE_DEVICE_USB, USB_RESET_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_ROOTHUB_PDO, METHOD_NEITHER, FILE_ANY_ACCESS) + #define USBD_PORT_ENABLED 1 #define USBD_PORT_CONNECTED 2 +#define IOCTL_INTERNAL_USB_GET_PORT_STATUS \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_PORT_STATUS, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_ENABLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, USB_ENABLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_HUB_COUNT \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_COUNT, METHOD_NEITHER, FILE_ANY_ACCESS) + #define IOCTL_INTERNAL_USB_CYCLE_PORT \ CTL_CODE(FILE_DEVICE_USB, USB_CYCLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_USB_ENABLE_PORT \ - CTL_CODE(FILE_DEVICE_USB, USB_ENABLE_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_USB_GET_HUB_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_INTERNAL_USB_GET_BUS_INFO \ CTL_CODE(FILE_DEVICE_USB, USB_GET_BUS_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_CONTROLLER_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + #define IOCTL_INTERNAL_USB_GET_BUSGUID_INFO \ CTL_CODE(FILE_DEVICE_USB, USB_GET_BUSGUID_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_USB_GET_CONTROLLER_NAME \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_CONTROLLER_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_PARENT_HUB_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#if (_WIN32_WINNT >= 0x0501) + +#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION \ + CTL_CODE(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION, METHOD_NEITHER, FILE_ANY_ACCESS) #define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE \ CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS) -#define IOCTL_INTERNAL_USB_GET_HUB_COUNT \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_COUNT, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_HUB_NAME \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_PARENT_HUB_INFO \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_PARENT_HUB_INFO, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_PORT_STATUS \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_PORT_STATUS, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_RESET_PORT \ - CTL_CODE(FILE_DEVICE_USB, USB_RESET_PORT, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_GET_ROOTHUB_PDO \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_ROOTHUB_PDO, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_SUBMIT_IDLE_NOTIFICATION \ - CTL_CODE(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION, METHOD_NEITHER, FILE_ANY_ACCESS) - -#define IOCTL_INTERNAL_USB_SUBMIT_URB \ - CTL_CODE(FILE_DEVICE_USB, USB_SUBMIT_URB, METHOD_NEITHER, FILE_ANY_ACCESS) - +#endif + +#if (_WIN32_WINNT >= 0x0600) + +#define IOCTL_INTERNAL_USB_NOTIFY_IDLE_READY \ + CTL_CODE(FILE_DEVICE_USB, USB_IDLE_NOTIFICATION_EX, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_REQ_GLOBAL_SUSPEND \ + CTL_CODE(FILE_DEVICE_USB, USB_REQ_GLOBAL_SUSPEND, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_REQ_GLOBAL_RESUME \ + CTL_CODE(FILE_DEVICE_USB, USB_REQ_GLOBAL_RESUME, METHOD_NEITHER, FILE_ANY_ACCESS) + +#ifdef USB20_API +typedef struct _USB_START_FAILDATA { + ULONG LengthInBytes; + NTSTATUS NtStatus; + USBD_STATUS UsbdStatus; + ULONG ConnectStatus; + UCHAR DriverData[4]; +} USB_START_FAILDATA, *PUSB_START_FAILDATA; +#endif + +#define IOCTL_INTERNAL_USB_RECORD_FAILURE \ + CTL_CODE(FILE_DEVICE_USB, USB_RECORD_FAILURE, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_DEVICE_HANDLE_EX \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_DEVICE_HANDLE_EX, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_TT_DEVICE_HANDLE \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_TT_DEVICE_HANDLE, METHOD_NEITHER, FILE_ANY_ACCESS) + +typedef struct _USB_TOPOLOGY_ADDRESS { + ULONG PciBusNumber; + ULONG PciDeviceNumber; + ULONG PciFunctionNumber; + ULONG Reserved; + USHORT RootHubPortNumber; + USHORT HubPortNumber[5]; + USHORT Reserved2; +} USB_TOPOLOGY_ADDRESS, *PUSB_TOPOLOGY_ADDRESS; + +#define IOCTL_INTERNAL_USB_GET_TOPOLOGY_ADDRESS \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_TOPOLOGY_ADDRESS, METHOD_NEITHER, FILE_ANY_ACCESS) + +#define IOCTL_INTERNAL_USB_GET_DEVICE_CONFIG_INFO \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CONFIG_INFO, METHOD_NEITHER, FILE_ANY_ACCESS) + +#endif + +#ifndef USB_KERNEL_IOCTL + +#define IOCTL_USB_HCD_GET_STATS_1 \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_1, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_GET_STATS_2 \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_2, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_DISABLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, HCD_DISABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_ENABLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, HCD_ENABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_DISABLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, HCD_DISABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_HCD_ENABLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, HCD_ENABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#ifndef IOCTL_USB_DIAGNOSTIC_MODE_OFF +#define IOCTL_USB_DIAGNOSTIC_MODE_OFF \ + CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) +#endif + +#ifndef IOCTL_USB_DIAGNOSTIC_MODE_ON +#define IOCTL_USB_DIAGNOSTIC_MODE_ON \ + CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) +#endif + +#ifndef IOCTL_USB_GET_ROOT_HUB_NAME +#define IOCTL_USB_GET_ROOT_HUB_NAME \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) +#endif + +#ifndef IOCTL_GET_HCD_DRIVERKEY_NAME +#define IOCTL_GET_HCD_DRIVERKEY_NAME \ + CTL_CODE(FILE_DEVICE_USB, HCD_GET_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) +#endif + +#define IOCTL_USB_GET_NODE_INFORMATION \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_NODE_CONNECTION_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_USB_DIAG_IGNORE_HUBS_ON \ CTL_CODE(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -82,267 +184,487 @@ #define IOCTL_USB_DIAG_IGNORE_HUBS_OFF \ CTL_CODE(FILE_DEVICE_USB, USB_DIAG_IGNORE_HUBS_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_USB_DIAGNOSTIC_MODE_OFF \ - CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_OFF, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_DIAGNOSTIC_MODE_ON \ - CTL_CODE(FILE_DEVICE_USB, HCD_DIAGNOSTIC_MODE_ON, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_DESCRIPTOR_FROM_NODE_CONNECTION, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#if (_WIN32_WINNT >= 0x0501) #define IOCTL_USB_GET_HUB_CAPABILITIES \ CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_USB_GET_ROOT_HUB_NAME \ - CTL_CODE(FILE_DEVICE_USB, HCD_GET_ROOT_HUB_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_GET_HCD_DRIVERKEY_NAME \ - CTL_CODE(FILE_DEVICE_USB, HCD_GET_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_NODE_INFORMATION \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define IOCTL_USB_HUB_CYCLE_PORT \ + CTL_CODE(FILE_DEVICE_USB, USB_HUB_CYCLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) #define IOCTL_USB_GET_NODE_CONNECTION_ATTRIBUTES \ CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_ATTRIBUTES, METHOD_BUFFERED, FILE_ANY_ACCESS) -#define IOCTL_USB_GET_NODE_CONNECTION_NAME \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_GET_NODE_CONNECTION_DRIVERKEY_NAME \ - CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_DRIVERKEY_NAME, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_HCD_DISABLE_PORT \ - CTL_CODE(FILE_DEVICE_USB, HCD_DISABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_HCD_ENABLE_PORT \ - CTL_CODE(FILE_DEVICE_USB, HCD_ENABLE_PORT, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_HCD_GET_STATS_1 \ - CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_1, METHOD_BUFFERED, FILE_ANY_ACCESS) - -#define IOCTL_USB_HCD_GET_STATS_2 \ - CTL_CODE(FILE_DEVICE_USB, HCD_GET_STATS_2, METHOD_BUFFERED, FILE_ANY_ACCESS) - +#define IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_NODE_CONNECTION_INFORMATION_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#endif + +#if (_WIN32_WINNT >= 0x0600) + +#define IOCTL_USB_RESET_HUB \ + CTL_CODE(FILE_DEVICE_USB, USB_RESET_HUB, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#define IOCTL_USB_GET_HUB_CAPABILITIES_EX \ + CTL_CODE(FILE_DEVICE_USB, USB_GET_HUB_CAPABILITIES_EX, METHOD_BUFFERED, FILE_ANY_ACCESS) + +#endif + +#include <pshpack1.h> + +typedef enum _USB_HUB_NODE { + UsbHub, + UsbMIParent +} USB_HUB_NODE; + +typedef struct _USB_HUB_INFORMATION { + USB_HUB_DESCRIPTOR HubDescriptor; + BOOLEAN HubIsBusPowered; +} USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION; + +typedef struct _USB_MI_PARENT_INFORMATION { + ULONG NumberOfInterfaces; +} USB_MI_PARENT_INFORMATION, *PUSB_MI_PARENT_INFORMATION; + +typedef struct _USB_NODE_INFORMATION { + USB_HUB_NODE NodeType; + union { + USB_HUB_INFORMATION HubInformation; + USB_MI_PARENT_INFORMATION MiParentInformation; + } u; +} USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION; + +typedef struct _USB_PIPE_INFO { + USB_ENDPOINT_DESCRIPTOR EndpointDescriptor; + ULONG ScheduleOffset; +} USB_PIPE_INFO, *PUSB_PIPE_INFO; + +#if (_WIN32_WINNT >= 0x0600) + +typedef enum _USB_CONNECTION_STATUS { + NoDeviceConnected, + DeviceConnected, + DeviceFailedEnumeration, + DeviceGeneralFailure, + DeviceCausedOvercurrent, + DeviceNotEnoughPower, + DeviceNotEnoughBandwidth, + DeviceHubNestedTooDeeply, + DeviceInLegacyHub, + DeviceEnumerating, + DeviceReset +} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; + +#elif (_WIN32_WINNT >= 0x0501) + +typedef enum _USB_CONNECTION_STATUS { + NoDeviceConnected, + DeviceConnected, + DeviceFailedEnumeration, + DeviceGeneralFailure, + DeviceCausedOvercurrent, + DeviceNotEnoughPower, + DeviceNotEnoughBandwidth, + DeviceHubNestedTooDeeply, + DeviceInLegacyHub +} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; + +#else + +typedef enum _USB_CONNECTION_STATUS { + NoDeviceConnected, + DeviceConnected, + DeviceFailedEnumeration, + DeviceGeneralFailure, + DeviceCausedOvercurrent, + DeviceNotEnoughPower, + DeviceNotEnoughBandwidth +} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; + +#endif + +typedef struct _USB_NODE_CONNECTION_INFORMATION { + ULONG ConnectionIndex; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; + UCHAR CurrentConfigurationValue; + BOOLEAN LowSpeed; + BOOLEAN DeviceIsHub; + USHORT DeviceAddress; + ULONG NumberOfOpenPipes; + USB_CONNECTION_STATUS ConnectionStatus; + USB_PIPE_INFO PipeList[0]; +} USB_NODE_CONNECTION_INFORMATION, *PUSB_NODE_CONNECTION_INFORMATION; + +typedef struct _USB_NODE_CONNECTION_DRIVERKEY_NAME { + ULONG ConnectionIndex; + ULONG ActualLength; + WCHAR DriverKeyName[1]; +} USB_NODE_CONNECTION_DRIVERKEY_NAME, *PUSB_NODE_CONNECTION_DRIVERKEY_NAME; + +typedef struct _USB_NODE_CONNECTION_NAME { + ULONG ConnectionIndex; + ULONG ActualLength; + WCHAR NodeName[1]; +} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME; + +typedef struct _USB_HUB_NAME { + ULONG ActualLength; + WCHAR HubName[1]; +} USB_HUB_NAME, *PUSB_HUB_NAME; + +typedef struct _USB_ROOT_HUB_NAME { + ULONG ActualLength; + WCHAR RootHubName[1]; +} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME; + +typedef struct _USB_HCD_DRIVERKEY_NAME { + ULONG ActualLength; + WCHAR DriverKeyName[1]; +} USB_HCD_DRIVERKEY_NAME, *PUSB_HCD_DRIVERKEY_NAME; + +typedef struct _USB_DESCRIPTOR_REQUEST { + ULONG ConnectionIndex; + struct { + UCHAR bmRequest; + UCHAR bRequest; + USHORT wValue; + USHORT wIndex; + USHORT wLength; + } SetupPacket; + UCHAR Data[0]; +} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST; + +#if (_WIN32_WINNT >= 0x0501) typedef struct _USB_HUB_CAPABILITIES { - ULONG HubIs2xCapable : 1; + ULONG HubIs2xCapable:1; } USB_HUB_CAPABILITIES, *PUSB_HUB_CAPABILITIES; -typedef enum _USB_CONNECTION_STATUS { - NoDeviceConnected, - DeviceConnected, - DeviceFailedEnumeration, - DeviceGeneralFailure, - DeviceCausedOvercurrent, - DeviceNotEnoughPower, - DeviceNotEnoughBandwidth, - DeviceHubNestedTooDeeply, - DeviceInLegacyHub -} USB_CONNECTION_STATUS, *PUSB_CONNECTION_STATUS; - -#include <pshpack1.h> - -typedef struct _USB_DESCRIPTOR_REQUEST { - ULONG ConnectionIndex; - struct { - UCHAR bmRequest; - UCHAR bRequest; - USHORT wValue; - USHORT wIndex; - USHORT wLength; - } SetupPacket; - UCHAR Data[0]; -} USB_DESCRIPTOR_REQUEST, *PUSB_DESCRIPTOR_REQUEST; - -typedef struct _USB_HCD_DRIVERKEY_NAME { - ULONG ActualLength; - WCHAR DriverKeyName[1]; -} USB_HCD_DRIVERKEY_NAME, *PUSB_HCD_DRIVERKEY_NAME; +typedef struct _USB_NODE_CONNECTION_ATTRIBUTES { + ULONG ConnectionIndex; + USB_CONNECTION_STATUS ConnectionStatus; + ULONG PortAttributes; +} USB_NODE_CONNECTION_ATTRIBUTES, *PUSB_NODE_CONNECTION_ATTRIBUTES; + +typedef struct _USB_NODE_CONNECTION_INFORMATION_EX { + ULONG ConnectionIndex; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; + UCHAR CurrentConfigurationValue; + UCHAR Speed; + BOOLEAN DeviceIsHub; + USHORT DeviceAddress; + ULONG NumberOfOpenPipes; + USB_CONNECTION_STATUS ConnectionStatus; + USB_PIPE_INFO PipeList[0]; +} USB_NODE_CONNECTION_INFORMATION_EX, *PUSB_NODE_CONNECTION_INFORMATION_EX; + +C_ASSERT(sizeof(USB_NODE_CONNECTION_INFORMATION_EX) == sizeof(USB_NODE_CONNECTION_INFORMATION)); + +#endif + +#if (_WIN32_WINNT >= 0x0600) + +typedef union _USB_HUB_CAP_FLAGS { + ULONG ul; + struct { + ULONG HubIsHighSpeedCapable:1; + ULONG HubIsHighSpeed:1; + ULONG HubIsMultiTtCapable:1; + ULONG HubIsMultiTt:1; + ULONG HubIsRoot:1; + ULONG HubIsArmedWakeOnConnect:1; + ULONG HubIsBusPowered:1; + ULONG ReservedMBZ:25; + }; +} USB_HUB_CAP_FLAGS, *PUSB_HUB_CAP_FLAGS; + +C_ASSERT(sizeof(USB_HUB_CAP_FLAGS) == sizeof(ULONG)); + +typedef struct _USB_HUB_CAPABILITIES_EX { + USB_HUB_CAP_FLAGS CapabilityFlags; +} USB_HUB_CAPABILITIES_EX, *PUSB_HUB_CAPABILITIES_EX; + +typedef struct _USB_CYCLE_PORT_PARAMS { + ULONG ConnectionIndex; + ULONG StatusReturned; +} USB_CYCLE_PORT_PARAMS, *PUSB_CYCLE_PORT_PARAMS; + +typedef struct _USB_ID_STRING { + USHORT LanguageId; + USHORT Pad; + ULONG LengthInBytes; + PWCHAR Buffer; +} USB_ID_STRING, *PUSB_ID_STRING; + +typedef struct _USB_HUB_DEVICE_UXD_SETTINGS { + ULONG Version; + GUID PnpGuid; + GUID OwnerGuid; + ULONG DeleteOnShutdown; + ULONG DeleteOnReload; + ULONG DeleteOnDisconnect; + ULONG Reserved[5]; +} USB_HUB_DEVICE_UXD_SETTINGS, *PUSB_HUB_DEVICE_UXD_SETTINGS; + +typedef struct _HUB_DEVICE_CONFIG_INFO_V1 { + ULONG Version; + ULONG Length; + USB_HUB_CAP_FLAGS HubFlags; + USB_ID_STRING HardwareIds; + USB_ID_STRING CompatibleIds; + USB_ID_STRING DeviceDescription; + ULONG Reserved[19]; + USB_HUB_DEVICE_UXD_SETTINGS UxdSettings; +} HUB_DEVICE_CONFIG_INFO, *PHUB_DEVICE_CONFIG_INFO; + +#endif typedef struct _HCD_ISO_STAT_COUNTERS { - USHORT LateUrbs; - USHORT DoubleBufferedPackets; - USHORT TransfersCF_5ms; - USHORT TransfersCF_2ms; - USHORT TransfersCF_1ms; - USHORT MaxInterruptLatency; - USHORT BadStartFrame; - USHORT StaleUrbs; - USHORT IsoPacketNotAccesed; - USHORT IsoPacketHWError; - USHORT SmallestUrbPacketCount; - USHORT LargestUrbPacketCount; - USHORT IsoCRC_Error; - USHORT IsoOVERRUN_Error; - USHORT IsoINTERNAL_Error; - USHORT IsoUNKNOWN_Error; - ULONG IsoBytesTransferred; - USHORT LateMissedCount; - USHORT HWIsoMissedCount; - ULONG Reserved7[8]; + USHORT LateUrbs; + USHORT DoubleBufferedPackets; + USHORT TransfersCF_5ms; + USHORT TransfersCF_2ms; + USHORT TransfersCF_1ms; + USHORT MaxInterruptLatency; + USHORT BadStartFrame; + USHORT StaleUrbs; + USHORT IsoPacketNotAccesed; + USHORT IsoPacketHWError; + USHORT SmallestUrbPacketCount; + USHORT LargestUrbPacketCount; + USHORT IsoCRC_Error; + USHORT IsoOVERRUN_Error; + USHORT IsoINTERNAL_Error; + USHORT IsoUNKNOWN_Error; + ULONG IsoBytesTransferred; + USHORT LateMissedCount; + USHORT HWIsoMissedCount; + ULONG Reserved7[8]; } HCD_ISO_STAT_COUNTERS, *PHCD_ISO_STAT_COUNTERS; typedef struct _HCD_STAT_COUNTERS { - ULONG BytesTransferred; - USHORT IsoMissedCount; - USHORT DataOverrunErrorCount; - USHORT CrcErrorCount; - USHORT ScheduleOverrunCount; - USHORT TimeoutErrorCount; - USHORT InternalHcErrorCount; - USHORT BufferOverrunErrorCount; - USHORT SWErrorCount; - USHORT StallPidCount; - USHORT PortDisableCount; + ULONG BytesTransferred; + USHORT IsoMissedCount; + USHORT DataOverrunErrorCount; + USHORT CrcErrorCount; + USHORT ScheduleOverrunCount; + USHORT TimeoutErrorCount; + USHORT InternalHcErrorCount; + USHORT BufferOverrunErrorCount; + USHORT SWErrorCount; + USHORT StallPidCount; + USHORT PortDisableCount; } HCD_STAT_COUNTERS, *PHCD_STAT_COUNTERS; typedef struct _HCD_STAT_INFORMATION_1 { - ULONG Reserved1; - ULONG Reserved2; - ULONG ResetCounters; - LARGE_INTEGER TimeRead; - HCD_STAT_COUNTERS Counters; + ULONG Reserved1; + ULONG Reserved2; + ULONG ResetCounters; + LARGE_INTEGER TimeRead; + HCD_STAT_COUNTERS Counters; } HCD_STAT_INFORMATION_1, *PHCD_STAT_INFORMATION_1; typedef struct _HCD_STAT_INFORMATION_2 { - ULONG Reserved1; - ULONG Reserved2; - ULONG ResetCounters; - LARGE_INTEGER TimeRead; - LONG LockedMemoryUsed; - HCD_STAT_COUNTERS Counters; - HCD_ISO_STAT_COUNTERS IsoCounters; + ULONG Reserved1; + ULONG Reserved2; + ULONG ResetCounters; + LARGE_INTEGER TimeRead; + LONG LockedMemoryUsed; + HCD_STAT_COUNTERS Counters; + HCD_ISO_STAT_COUNTERS IsoCounters; } HCD_STAT_INFORMATION_2, *PHCD_STAT_INFORMATION_2; - -typedef struct _USB_HUB_INFORMATION { - USB_HUB_DESCRIPTOR HubDescriptor; - BOOLEAN HubIsBusPowered; -} USB_HUB_INFORMATION, *PUSB_HUB_INFORMATION; - -typedef struct _USB_HUB_NAME { - ULONG ActualLength; - WCHAR HubName[1]; -} USB_HUB_NAME, *PUSB_HUB_NAME; - -typedef enum _USB_HUB_NODE { - UsbHub, - UsbMIParent -} USB_HUB_NODE; - -typedef VOID NTAPI -(*USB_IDLE_CALLBACK)( - PVOID Context); - -typedef struct _USB_IDLE_CALLBACK_INFO { - USB_IDLE_CALLBACK IdleCallback; - PVOID IdleContext; -} USB_IDLE_CALLBACK_INFO, *PUSB_IDLE_CALLBACK_INFO; - -typedef struct _USB_NODE_CONNECTION_ATTRIBUTES { - ULONG ConnectionIndex; - USB_CONNECTION_STATUS ConnectionStatus; - ULONG PortAttributes; -} USB_NODE_CONNECTION_ATTRIBUTES, *PUSB_NODE_CONNECTION_ATTRIBUTES; - -typedef struct _USB_NODE_CONNECTION_DRIVERKEY_NAME { - ULONG ConnectionIndex; - ULONG ActualLength; - WCHAR DriverKeyName[1]; -} USB_NODE_CONNECTION_DRIVERKEY_NAME, *PUSB_NODE_CONNECTION_DRIVERKEY_NAME; - -typedef struct _USB_PIPE_INFO { - USB_ENDPOINT_DESCRIPTOR EndpointDescriptor; - ULONG ScheduleOffset; -} USB_PIPE_INFO, *PUSB_PIPE_INFO; - -typedef struct _USB_NODE_CONNECTION_INFORMATION { - ULONG ConnectionIndex; - USB_DEVICE_DESCRIPTOR DeviceDescriptor; - UCHAR CurrentConfigurationValue; - BOOLEAN LowSpeed; - BOOLEAN DeviceIsHub; - USHORT DeviceAddress; - ULONG NumberOfOpenPipes; - USB_CONNECTION_STATUS ConnectionStatus; - USB_PIPE_INFO PipeList[0]; -} USB_NODE_CONNECTION_INFORMATION, *PUSB_NODE_CONNECTION_INFORMATION; - -typedef struct _USB_NODE_CONNECTION_NAME { - ULONG ConnectionIndex; - ULONG ActualLength; - WCHAR NodeName[1]; -} USB_NODE_CONNECTION_NAME, *PUSB_NODE_CONNECTION_NAME; - -typedef struct _USB_MI_PARENT_INFORMATION { - ULONG NumberOfInterfaces; -} USB_MI_PARENT_INFORMATION, *PUSB_MI_PARENT_INFORMATION; - -typedef struct _USB_NODE_INFORMATION { - USB_HUB_NODE NodeType; - union { - USB_HUB_INFORMATION HubInformation; - USB_MI_PARENT_INFORMATION MiParentInformation; - } u; -} USB_NODE_INFORMATION, *PUSB_NODE_INFORMATION; #define WMI_USB_DRIVER_INFORMATION 0 #define WMI_USB_DRIVER_NOTIFICATION 1 #define WMI_USB_POWER_DEVICE_ENABLE 2 +#define WMI_USB_HUB_NODE_INFORMATION 4 + +#define WMI_USB_PERFORMANCE_INFORMATION 1 +#define WMI_USB_DEVICE_NODE_INFORMATION 2 + +#if (_WIN32_WINNT >= 0x0501) typedef enum _USB_NOTIFICATION_TYPE { - EnumerationFailure = 0, - InsufficentBandwidth, - InsufficentPower, - OverCurrent, - ResetOvercurrent, - AcquireBusInfo, - AcquireHubName, - AcquireControllerName, - HubOvercurrent, - HubPowerChange, - HubNestedTooDeeply, - ModernDeviceInLegacyHub + EnumerationFailure = 0, + InsufficentBandwidth, + InsufficentPower, + OverCurrent, + ResetOvercurrent, + AcquireBusInfo, + AcquireHubName, + AcquireControllerName, + HubOvercurrent, + HubPowerChange, + HubNestedTooDeeply, + ModernDeviceInLegacyHub } USB_NOTIFICATION_TYPE; +#else + +typedef enum _USB_NOTIFICATION_TYPE { + EnumerationFailure = 0, + InsufficentBandwidth, + InsufficentPower, + OverCurrent, + ResetOvercurrent, + AcquireBusInfo, + AcquireHubName, + AcquireControllerName, + HubOvercurrent, + HubPowerChange +} USB_NOTIFICATION_TYPE; + +#endif + +typedef struct _USB_NOTIFICATION { + USB_NOTIFICATION_TYPE NotificationType; +} USB_NOTIFICATION, *PUSB_NOTIFICATION; + +typedef struct _USB_CONNECTION_NOTIFICATION { + USB_NOTIFICATION_TYPE NotificationType; + ULONG ConnectionNumber; + ULONG RequestedBandwidth; + ULONG EnumerationFailReason; + ULONG PowerRequested; + ULONG HubNameLength; +} USB_CONNECTION_NOTIFICATION, *PUSB_CONNECTION_NOTIFICATION; + +typedef struct _USB_BUS_NOTIFICATION { + USB_NOTIFICATION_TYPE NotificationType; + ULONG TotalBandwidth; + ULONG ConsumedBandwidth; + ULONG ControllerNameLength; +} USB_BUS_NOTIFICATION, *PUSB_BUS_NOTIFICATION; + typedef struct _USB_ACQUIRE_INFO { - USB_NOTIFICATION_TYPE NotificationType; - ULONG TotalSize; - WCHAR Buffer[1]; + USB_NOTIFICATION_TYPE NotificationType; + ULONG TotalSize; + WCHAR Buffer[1]; } USB_ACQUIRE_INFO, *PUSB_ACQUIRE_INFO; -typedef struct _USB_NOTIFICATION { - USB_NOTIFICATION_TYPE NotificationType; -} USB_NOTIFICATION, *PUSB_NOTIFICATION; - -typedef struct _USB_BUS_NOTIFICATION { - USB_NOTIFICATION_TYPE NotificationType; - ULONG TotalBandwidth; - ULONG ConsumedBandwidth; - ULONG ControllerNameLength; -} USB_BUS_NOTIFICATION, *PUSB_BUS_NOTIFICATION; - -typedef struct _USB_CONNECTION_NOTIFICATION { - USB_NOTIFICATION_TYPE NotificationType; - ULONG ConnectionNumber; - ULONG RequestedBandwidth; - ULONG EnumerationFailReason; - ULONG PowerRequested; - ULONG HubNameLength; -} USB_CONNECTION_NOTIFICATION, *PUSB_CONNECTION_NOTIFICATION; - -typedef struct _USB_ROOT_HUB_NAME { - ULONG ActualLength; - WCHAR RootHubName[1]; -} USB_ROOT_HUB_NAME, *PUSB_ROOT_HUB_NAME; +#if (_WIN32_WINNT >= 0x0600) + +#define USB_NODE_INFO_SIG 'USBN' + +typedef enum _USB_WMI_DEVICE_NODE_TYPE { + UsbDevice, + HubDevice, + CompositeDevice, + UsbController +} USB_WMI_DEVICE_NODE_TYPE, *PUSB_WMI_DEVICE_NODE_TYPE; + +typedef struct _USB_DEVICE_STATE { + ULONG DeviceConnected:1; + ULONG DeviceStarted:1; +} USB_DEVICE_STATE, *PUSB_DEVICE_STATE; + +typedef struct _USB_HUB_PORT_INFORMATION { + USB_DEVICE_STATE DeviceState; + USHORT PortNumber; + USHORT DeviceAddress; + ULONG ConnectionIndex; + USB_CONNECTION_STATUS ConnectionStatus; +} USB_HUB_PORT_INFORMATION, *PUSB_HUB_PORT_INFORMATION; + +typedef struct _USB_HUB_DEVICE_INFO { + USB_HUB_DESCRIPTOR HubDescriptor; + ULONG HubNumber; + USHORT DeviceAddress; + BOOLEAN HubIsSelfPowered; + BOOLEAN HubIsRootHub; + USB_HUB_CAPABILITIES HubCapabilities; + ULONG NumberOfHubPorts; + USB_HUB_PORT_INFORMATION PortInfo[1]; +} USB_HUB_DEVICE_INFO, *PUSB_HUB_DEVICE_INFO; + +typedef struct _USB_COMPOSITE_FUNCTION_INFO { + UCHAR FunctionNumber; + UCHAR BaseInterfaceNumber; + UCHAR NumberOfInterfaces; + BOOLEAN FunctionIsIdle; +} USB_COMPOSITE_FUNCTION_INFO, *PUSB_COMPOSITE_FUNCTION_INFO; + +typedef struct _USB_COMPOSITE_DEVICE_INFO { + USB_DEVICE_DESCRIPTOR DeviceDescriptor; + USB_CONFIGURATION_DESCRIPTOR CurrentConfigDescriptor; + UCHAR CurrentConfigurationValue; + UCHAR NumberOfFunctions; + USB_COMPOSITE_FUNCTION_INFO FunctionInfo[1]; +} USB_COMPOSITE_DEVICE_INFO, *PUSB_COMPOSITE_DEVICE_INFO; + +typedef struct _USB_CONTROLLER_DEVICE_INFO { + ULONG PciVendorId; + ULONG PciDeviceId; + ULONG PciRevision; + ULONG NumberOfRootPorts; + ULONG HcFeatureFlags; +} USB_CONTROLLER_DEVICE_INFO, *PUSB_CONTROLLER_DEVICE_INFO; + +typedef struct _USB_DEVICE_INFO { + USB_DEVICE_STATE DeviceState; + USHORT PortNumber; + USB_DEVICE_DESCRIPTOR DeviceDescriptor; + UCHAR CurrentConfigurationValue; + USB_DEVICE_SPEED Speed; + USHORT DeviceAddress; + ULONG ConnectionIndex; + USB_CONNECTION_STATUS ConnectionStatus; + WCHAR PnpHardwareId[128]; + WCHAR PnpCompatibleId[128]; + WCHAR SerialNumberId[128]; + WCHAR PnpDeviceDescription[128]; + ULONG NumberOfOpenPipes; + USB_PIPE_INFO PipeList[1]; +} USB_DEVICE_INFO, *PUSB_DEVICE_INFO; + +typedef struct _USB_DEVICE_NODE_INFO { + ULONG Sig; + ULONG LengthInBytes; + WCHAR DeviceDescription[40]; + USB_WMI_DEVICE_NODE_TYPE NodeType; + USB_TOPOLOGY_ADDRESS BusAddress; + union{ + USB_DEVICE_INFO UsbDeviceInfo; + USB_HUB_DEVICE_INFO HubDeviceInfo; + USB_COMPOSITE_DEVICE_INFO CompositeDeviceInfo; + USB_CONTROLLER_DEVICE_INFO ControllerDeviceInfo; + UCHAR DeviceInformation[4]; + }; +} USB_DEVICE_NODE_INFO, *PUSB_DEVICE_NODE_INFO; + +typedef struct _USB_DEVICE_PERFORMANCE_INFO { + ULONG BulkBytes; + ULONG ControlDataBytes; + ULONG IsoBytes; + ULONG InterruptBytes; + ULONG BulkUrbCount; + ULONG ControlUrbCount; + ULONG IsoUrbCount; + ULONG InterruptUrbCount; + ULONG AllocedInterrupt[6]; + ULONG AllocedIso; + ULONG Total32secBandwidth; + ULONG TotalTtBandwidth; + WCHAR DeviceDescription[60]; + USB_DEVICE_SPEED DeviceSpeed; + ULONG TotalIsoLatency; + ULONG DroppedIsoPackets; + ULONG TransferErrors; + ULONG PciInterruptCount; + ULONG HcIdleState; + ULONG HcAsyncIdleState; + ULONG HcAsyncCacheFlushCount; + ULONG HcPeriodicIdleState; + ULONG HcPeriodicCacheFlushCount; +} USB_DEVICE_PERFORMANCE_INFO, *PUSB_DEVICE_PERFORMANCE_INFO; + +#endif #include <poppack.h> #ifdef __cplusplus } #endif - -#endif /* __USBIOCTL_H */
14 years, 9 months
1
0
0
0
[janderwald] 45862: [PORTCLS] - Implement a function to retrieve the current acquired mapping tag range of the miniport driver - Call RevokeMappings when audio pin is stopped
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Mar 5 11:11:54 2010 New Revision: 45862 URL:
http://svn.reactos.org/svn/reactos?rev=45862&view=rev
Log: [PORTCLS] - Implement a function to retrieve the current acquired mapping tag range of the miniport driver - Call RevokeMappings when audio pin is stopped Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp [iso-8859-1] Fri Mar 5 11:11:54 2010 @@ -351,6 +351,11 @@ STDMETHOD_(BOOLEAN, HasLastMappingFailed)(THIS) PURE; STDMETHOD_(ULONG, GetCurrentIrpOffset)(THIS) PURE; + + STDMETHOD_(BOOLEAN, GetAcquiredTagRange)(THIS_ + IN PVOID * FirstTag, + IN PVOID * LastTag); + }; @@ -387,7 +392,11 @@ IN PVOID Tag); \ \ STDMETHODIMP_(BOOLEAN) HasLastMappingFailed(THIS); \ - STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS); + STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS); \ + STDMETHODIMP_(BOOLEAN) GetAcquiredTagRange(THIS_ \ + IN PVOID * FirstTag, \ + IN PVOID * LastTag); + /***************************************************************************** Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] Fri Mar 5 11:11:54 2010 @@ -539,6 +539,53 @@ return m_CurrentOffset; } +BOOLEAN +NTAPI +CIrpQueue::GetAcquiredTagRange( + IN PVOID * FirstTag, + IN PVOID * LastTag) +{ + KIRQL OldLevel; + BOOLEAN Ret = FALSE; + PIRP Irp; + PLIST_ENTRY CurEntry; + + KeAcquireSpinLock(&m_IrpListLock, &OldLevel); + + if (!IsListEmpty(&m_FreeIrpList)) + { + // get first entry + CurEntry = RemoveHeadList(&m_FreeIrpList); + // get irp from list entry + Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry); + + // get tag of first acquired buffer + *FirstTag = Irp->Tail.Overlay.DriverContext[3]; + + // put back irp + InsertHeadList(&m_FreeIrpList, &Irp->Tail.Overlay.ListEntry); + + // get last entry + CurEntry = RemoveTailList(&m_FreeIrpList); + // get irp from list entry + Irp = (PIRP)CONTAINING_RECORD(CurEntry, IRP, Tail.Overlay.ListEntry); + + // get tag of first acquired buffer + *LastTag = Irp->Tail.Overlay.DriverContext[3]; + + // put back irp + InsertTailList(&m_FreeIrpList, &Irp->Tail.Overlay.ListEntry); + + // indicate success + Ret = TRUE; + } + + // release lock + KeReleaseSpinLock(&m_IrpListLock, OldLevel); + // done + return Ret; +} + NTSTATUS NTAPI NewIrpQueue( Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] Fri Mar 5 11:11:54 2010 @@ -346,7 +346,6 @@ Position->WriteOffset = (ULONGLONG)Pin->m_IrpQueue->GetCurrentIrpOffset(); DPRINT("Play %lu Write %lu\n", Position->PlayOffset, Position->WriteOffset); } - Irp->IoStatus.Information = sizeof(KSAUDIO_POSITION); return STATUS_SUCCESS; Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp [iso-8859-1] Fri Mar 5 11:11:54 2010 @@ -195,6 +195,8 @@ NTSTATUS Status = STATUS_UNSUCCESSFUL; CPortPinWavePci *Pin; PSUBDEVICE_DESCRIPTOR Descriptor; + PVOID FirstTag, LastTag; + ULONG MappingsRevoked; PKSSTATE State = (PKSSTATE)Data; // get sub device descriptor @@ -221,6 +223,35 @@ { // store new state Pin->m_State = *State; + if (Pin->m_ConnectDetails->Interface.Id == KSINTERFACE_STANDARD_LOOPED_STREAMING && Pin->m_State == KSSTATE_STOP) + { + // FIXME + // complete with successful state + Pin->m_IrpQueue->CancelBuffers(); + while(Pin->m_IrpQueue->GetAcquiredTagRange(&FirstTag, &LastTag)) + { + Status = Pin->m_Stream->RevokeMappings(FirstTag, LastTag, &MappingsRevoked); + DPRINT("RevokeMappings Status %lx MappingsRevoked: %lu\n", Status, MappingsRevoked); + KeStallExecutionProcessor(10); + } + Pin->m_Position.PlayOffset = 0; + Pin->m_Position.WriteOffset = 0; + } + else if (Pin->m_State == KSSTATE_STOP) + { + Pin->m_IrpQueue->CancelBuffers(); + while(Pin->m_IrpQueue->GetAcquiredTagRange(&FirstTag, &LastTag)) + { + Status = Pin->m_Stream->RevokeMappings(FirstTag, LastTag, &MappingsRevoked); + DPRINT("RevokeMappings Status %lx MappingsRevoked: %lu\n", Status, MappingsRevoked); + KeStallExecutionProcessor(10); + } + Pin->m_Position.PlayOffset = 0; + Pin->m_Position.WriteOffset = 0; + } + // store result + Irp->IoStatus.Information = sizeof(KSSTATE); + } // store result Irp->IoStatus.Information = sizeof(KSSTATE);
14 years, 9 months
1
0
0
0
[akhaldi] 45861: More work on USB related definitions
by akhaldi@svn.reactos.org
Author: akhaldi Date: Fri Mar 5 10:56:28 2010 New Revision: 45861 URL:
http://svn.reactos.org/svn/reactos?rev=45861&view=rev
Log: More work on USB related definitions Added: branches/header-work/include/psdk/usbdi.h - copied, changed from r45846, branches/header-work/include/ddk/usbdi.h Removed: branches/header-work/include/ddk/usbdi.h Removed: branches/header-work/include/ddk/usbdi.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/usbdi.h…
============================================================================== --- branches/header-work/include/ddk/usbdi.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/usbdi.h (removed) @@ -1,411 +1,0 @@ -/* - * usbdi.h - * - * USBD and USB device driver definitions - * - * This file is part of the w32api package. - * - * Contributors: - * Created by Casper S. Hornstrup <chorns(a)users.sourceforge.net> - * - * THIS SOFTWARE IS NOT COPYRIGHTED - * - * This source code is offered for use in the public domain. You may - * use, modify or distribute it freely. - * - * This code is distributed in the hope that it will be useful but - * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY - * DISCLAIMED. This includes but is not limited to warranties of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - */ - -#ifndef __USBDI_H -#define __USBDI_H - -/* Helper macro to enable gcc's extension. */ -#ifndef __GNU_EXTENSION -#ifdef __GNUC__ -#define __GNU_EXTENSION __extension__ -#else -#define __GNU_EXTENSION -#endif -#endif - -#ifdef __USB_H -#error usb.h cannot be included with usbdi.h -#else - -#include "usbioctl.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define USBDI_VERSION 0x300 - -#define USB_DEFAULT_DEVICE_ADDRESS 0 -#define USB_DEFAULT_ENDPOINT_ADDRESS 0 -#define USB_DEFAULT_MAX_PACKET 64 - -#define URB_FROM_IRP(Irp) ((IoGetCurrentIrpStackLocation(Irp))->Parameters.Others.Argument1) - -#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 -#define URB_FUNCTION_SELECT_INTERFACE 0x0001 -#define URB_FUNCTION_ABORT_PIPE 0x0002 -#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 -#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 -#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 -#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 -#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 -#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 -#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 -#define URB_FUNCTION_ISOCH_TRANSFER 0x000A -#define URB_FUNCTION_RESET_PIPE 0x001E -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C -#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 -#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D -#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E -#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F -#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 -#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 -#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 -#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 -#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 -#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 -#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 -#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 -#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 -#define URB_FUNCTION_RESERVED0 0x0016 -#define URB_FUNCTION_VENDOR_DEVICE 0x0017 -#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 -#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 -#define URB_FUNCTION_VENDOR_OTHER 0x0020 -#define URB_FUNCTION_CLASS_DEVICE 0x001A -#define URB_FUNCTION_CLASS_INTERFACE 0x001B -#define URB_FUNCTION_CLASS_ENDPOINT 0x001C -#define URB_FUNCTION_CLASS_OTHER 0x001F -#define URB_FUNCTION_RESERVED 0x001D -#define URB_FUNCTION_GET_CONFIGURATION 0x0026 -#define URB_FUNCTION_GET_INTERFACE 0x0027 -#define URB_FUNCTION_LAST 0x0029 - -typedef LONG USBD_STATUS; -typedef PVOID USBD_PIPE_HANDLE; -typedef PVOID USBD_CONFIGURATION_HANDLE; -typedef PVOID USBD_INTERFACE_HANDLE; - -#define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0) -#define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3) -#define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1) -#define USBD_STATUS(Status) ((ULONG)(Status) & 0x0FFFFFFFL) -#define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0) - -#define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L) -#define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L) -#define USBD_STATUS_HALTED ((USBD_STATUS)0xC0000000L) -#define USBD_STATUS_ERROR ((USBD_STATUS)0x80000000L) -#define USBD_STATUS_NO_MEMORY ((USBD_STATUS)0x80000100L) -#define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L) -#define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L) -#define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L) -#define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS)0x80000500L) -#define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L) -#define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L) -#define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L) -#define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L) -#define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L) -#define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L) -#define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L) -#define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L) -#define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L) -#define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L) -#define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L) -#define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L) -#define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L) -#define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL) -#define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL) -#define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL) -#define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL) -#define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL) -#define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L) -#define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L) -#define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L) -#define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L) -#define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L) -#define USBD_STATUS_FRAME_CONTROL_NOT_OWNED \ - ((USBD_STATUS)0xC0000D00L) -#define USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR \ - ((USBD_STATUS)0xC0000F00L) -#define USBD_STATUS_CANCELING ((USBD_STATUS)0x00020000L) - -#define USBD_PIPE_DIRECTION_IN(pipeInformation) \ - ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) - -struct _URB_HEADER { - USHORT Length; - USHORT Function; - USBD_STATUS Status; - PVOID UsbdDeviceHandle; - ULONG UsbdFlags; -}; - -struct _URB_HCD_AREA { - PVOID HcdEndpoint; - PIRP HcdIrp; - LIST_ENTRY HcdListEntry; - LIST_ENTRY HcdListEntry2; - PVOID HcdCurrentIoFlushPointer; - PVOID HcdExtension; -}; - -struct _URB_BULK_OR_INTERRUPT_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; -}; - -struct _URB_CONTROL_DESCRIPTOR_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - USHORT Reserved1; - UCHAR Index; - UCHAR DescriptorType; - USHORT LanguageId; - USHORT Reserved2; -}; - -struct _URB_CONTROL_FEATURE_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved2; - ULONG Reserved3; - PVOID Reserved4; - PMDL Reserved5; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - USHORT Reserved0; - USHORT FeatureSelector; - USHORT Index; - USHORT Reserved1; -}; - -struct _URB_CONTROL_GET_CONFIGURATION_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[8]; -}; - -struct _URB_CONTROL_GET_INTERFACE_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[4]; - USHORT Interface; - USHORT Reserved2; -}; - -struct _URB_CONTROL_GET_STATUS_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[4]; - USHORT Index; - USHORT Reserved2; -}; - -struct _URB_CONTROL_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR SetupPacket[8]; -}; - -struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR RequestTypeReservedBits; - UCHAR Request; - USHORT Value; - USHORT Index; - USHORT Reserved1; -}; - -struct _URB_FRAME_LENGTH_CONTROL { - struct _URB_HEADER Hdr; -}; - -struct _URB_GET_CURRENT_FRAME_NUMBER { - struct _URB_HEADER Hdr; - ULONG FrameNumber; -}; - -struct _URB_GET_FRAME_LENGTH { - struct _URB_HEADER Hdr; - ULONG FrameLength; - ULONG FrameNumber; -}; - -typedef struct _USBD_ISO_PACKET_DESCRIPTOR { - ULONG Offset; - ULONG Length; - USBD_STATUS Status; -} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; - -struct _URB_ISOCH_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - ULONG StartFrame; - ULONG NumberOfPackets; - ULONG ErrorCount; - USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; -}; - -struct _URB_PIPE_REQUEST { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG Reserved; -}; - -struct _URB_SET_FRAME_LENGTH { - struct _URB_HEADER Hdr; - LONG FrameLengthDelta; -}; - -typedef struct _USBD_DEVICE_INFORMATION { - ULONG OffsetNext; - PVOID UsbdDeviceHandle; - USB_DEVICE_DESCRIPTOR DeviceDescriptor; -} USBD_DEVICE_INFORMATION, *PUSBD_DEVICE_INFORMATION; - -typedef enum _USBD_PIPE_TYPE { - UsbdPipeTypeControl, - UsbdPipeTypeIsochronous, - UsbdPipeTypeBulk, - UsbdPipeTypeInterrupt -} USBD_PIPE_TYPE; - -/* USBD_PIPE_INFORMATION.PipeFlags constants */ -#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 -#define USBD_PF_DOUBLE_BUFFER 0x00000002 -#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 -#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 - -typedef struct _USBD_PIPE_INFORMATION { - USHORT MaximumPacketSize; - UCHAR EndpointAddress; - UCHAR Interval; - USBD_PIPE_TYPE PipeType; - USBD_PIPE_HANDLE PipeHandle; - ULONG MaximumTransferSize; - ULONG PipeFlags; -} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION; - -typedef struct _USBD_INTERFACE_INFORMATION { - USHORT Length; - UCHAR InterfaceNumber; - UCHAR AlternateSetting; - UCHAR Class; - UCHAR SubClass; - UCHAR Protocol; - UCHAR Reserved; - USBD_INTERFACE_HANDLE InterfaceHandle; - ULONG NumberOfPipes; - USBD_PIPE_INFORMATION Pipes[1]; -} USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION; - -struct _URB_SELECT_CONFIGURATION { - struct _URB_HEADER Hdr; - PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; - USBD_CONFIGURATION_HANDLE ConfigurationHandle; - USBD_INTERFACE_INFORMATION Interface; -}; - -struct _URB_SELECT_INTERFACE { - struct _URB_HEADER Hdr; - USBD_CONFIGURATION_HANDLE ConfigurationHandle; - USBD_INTERFACE_INFORMATION Interface; -}; - -typedef struct _USBD_VERSION_INFORMATION { - ULONG USBDI_Version; - ULONG Supported_USB_Version; -} USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION; - -typedef struct _URB { - __GNU_EXTENSION union { - struct _URB_HEADER UrbHeader; - struct _URB_SELECT_INTERFACE UrbSelectInterface; - struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration; - struct _URB_PIPE_REQUEST UrbPipeRequest; - struct _URB_FRAME_LENGTH_CONTROL UrbFrameLengthControl; - struct _URB_GET_FRAME_LENGTH UrbGetFrameLength; - struct _URB_SET_FRAME_LENGTH UrbSetFrameLength; - struct _URB_GET_CURRENT_FRAME_NUMBER UrbGetCurrentFrameNumber; - struct _URB_CONTROL_TRANSFER UrbControlTransfer; - struct _URB_BULK_OR_INTERRUPT_TRANSFER UrbBulkOrInterruptTransfer; - struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer; - struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest; - struct _URB_CONTROL_GET_STATUS_REQUEST UrbControlGetStatusRequest; - struct _URB_CONTROL_FEATURE_REQUEST UrbControlFeatureRequest; - struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST UrbControlVendorClassRequest; - struct _URB_CONTROL_GET_INTERFACE_REQUEST UrbControlGetInterfaceRequest; - struct _URB_CONTROL_GET_CONFIGURATION_REQUEST UrbControlGetConfigurationRequest; - }; -} URB, *PURB; - -#ifdef __cplusplus -} -#endif - -#endif /* defined __USB_H */ - -#endif /* __USBDI_H */ Copied: branches/header-work/include/psdk/usbdi.h (from r45846, branches/header-work/include/ddk/usbdi.h) URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/psdk/usbdi.…
============================================================================== --- branches/header-work/include/ddk/usbdi.h [iso-8859-1] (original) +++ branches/header-work/include/psdk/usbdi.h [iso-8859-1] Fri Mar 5 10:56:28 2010 @@ -2,6 +2,8 @@ * usbdi.h * * USBD and USB device driver definitions + * + * FIXME : Obsolete header.. Use usb.h instead. * * This file is part of the w32api package. * @@ -20,8 +22,7 @@ * */ -#ifndef __USBDI_H -#define __USBDI_H +#pragma once /* Helper macro to enable gcc's extension. */ #ifndef __GNU_EXTENSION @@ -32,380 +33,47 @@ #endif #endif -#ifdef __USB_H -#error usb.h cannot be included with usbdi.h -#else - -#include "usbioctl.h" +#include <usb.h> +#include <usbioctl.h> #ifdef __cplusplus extern "C" { #endif -#define USBDI_VERSION 0x300 +#define USBD_STATUS_CANCELLING ((USBD_STATUS)0x00020000L) +#define USBD_STATUS_CANCELING ((USBD_STATUS)0x00020000L) +#define USBD_STATUS_NO_MEMORY ((USBD_STATUS)0x80000100L) +#define USBD_STATUS_ERROR ((USBD_STATUS)0x80000000L) +#define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS)0x80000500L) +#define USBD_STATUS_HALTED ((USBD_STATUS)0xC0000000L) -#define USB_DEFAULT_DEVICE_ADDRESS 0 -#define USB_DEFAULT_ENDPOINT_ADDRESS 0 -#define USB_DEFAULT_MAX_PACKET 64 -#define URB_FROM_IRP(Irp) ((IoGetCurrentIrpStackLocation(Irp))->Parameters.Others.Argument1) +#define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3) +#define USBD_STATUS(Status) ((ULONG)(Status) & 0x0FFFFFFFL) -#define URB_FUNCTION_SELECT_CONFIGURATION 0x0000 -#define URB_FUNCTION_SELECT_INTERFACE 0x0001 -#define URB_FUNCTION_ABORT_PIPE 0x0002 -#define URB_FUNCTION_TAKE_FRAME_LENGTH_CONTROL 0x0003 -#define URB_FUNCTION_RELEASE_FRAME_LENGTH_CONTROL 0x0004 -#define URB_FUNCTION_GET_FRAME_LENGTH 0x0005 -#define URB_FUNCTION_SET_FRAME_LENGTH 0x0006 -#define URB_FUNCTION_GET_CURRENT_FRAME_NUMBER 0x0007 -#define URB_FUNCTION_CONTROL_TRANSFER 0x0008 -#define URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER 0x0009 -#define URB_FUNCTION_ISOCH_TRANSFER 0x000A -#define URB_FUNCTION_RESET_PIPE 0x001E -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_DEVICE 0x000B -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_ENDPOINT 0x0024 -#define URB_FUNCTION_GET_DESCRIPTOR_FROM_INTERFACE 0x0028 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_DEVICE 0x000C -#define URB_FUNCTION_SET_DESCRIPTOR_TO_ENDPOINT 0x0025 -#define URB_FUNCTION_SET_DESCRIPTOR_TO_INTERFACE 0x0029 -#define URB_FUNCTION_SET_FEATURE_TO_DEVICE 0x000D -#define URB_FUNCTION_SET_FEATURE_TO_INTERFACE 0x000E -#define URB_FUNCTION_SET_FEATURE_TO_ENDPOINT 0x000F -#define URB_FUNCTION_SET_FEATURE_TO_OTHER 0x0023 -#define URB_FUNCTION_CLEAR_FEATURE_TO_DEVICE 0x0010 -#define URB_FUNCTION_CLEAR_FEATURE_TO_INTERFACE 0x0011 -#define URB_FUNCTION_CLEAR_FEATURE_TO_ENDPOINT 0x0012 -#define URB_FUNCTION_CLEAR_FEATURE_TO_OTHER 0x0022 -#define URB_FUNCTION_GET_STATUS_FROM_DEVICE 0x0013 -#define URB_FUNCTION_GET_STATUS_FROM_INTERFACE 0x0014 -#define URB_FUNCTION_GET_STATUS_FROM_ENDPOINT 0x0015 -#define URB_FUNCTION_GET_STATUS_FROM_OTHER 0x0021 #define URB_FUNCTION_RESERVED0 0x0016 -#define URB_FUNCTION_VENDOR_DEVICE 0x0017 -#define URB_FUNCTION_VENDOR_INTERFACE 0x0018 -#define URB_FUNCTION_VENDOR_ENDPOINT 0x0019 -#define URB_FUNCTION_VENDOR_OTHER 0x0020 -#define URB_FUNCTION_CLASS_DEVICE 0x001A -#define URB_FUNCTION_CLASS_INTERFACE 0x001B -#define URB_FUNCTION_CLASS_ENDPOINT 0x001C -#define URB_FUNCTION_CLASS_OTHER 0x001F #define URB_FUNCTION_RESERVED 0x001D -#define URB_FUNCTION_GET_CONFIGURATION 0x0026 -#define URB_FUNCTION_GET_INTERFACE 0x0027 #define URB_FUNCTION_LAST 0x0029 -typedef LONG USBD_STATUS; -typedef PVOID USBD_PIPE_HANDLE; -typedef PVOID USBD_CONFIGURATION_HANDLE; -typedef PVOID USBD_INTERFACE_HANDLE; +#define USBD_PF_DOUBLE_BUFFER 0x00000002 -#define USBD_ERROR(Status) ((USBD_STATUS)(Status) < 0) -#define USBD_HALTED(Status) ((ULONG)(Status) >> 30 == 3) -#define USBD_PENDING(Status) ((ULONG)(Status) >> 30 == 1) -#define USBD_STATUS(Status) ((ULONG)(Status) & 0x0FFFFFFFL) -#define USBD_SUCCESS(Status) ((USBD_STATUS)(Status) >= 0) +#ifdef USBD_PF_VALID_MASK +#undef USBD_PF_VALID_MASK +#endif -#define USBD_STATUS_SUCCESS ((USBD_STATUS)0x00000000L) -#define USBD_STATUS_PENDING ((USBD_STATUS)0x40000000L) -#define USBD_STATUS_HALTED ((USBD_STATUS)0xC0000000L) -#define USBD_STATUS_ERROR ((USBD_STATUS)0x80000000L) -#define USBD_STATUS_NO_MEMORY ((USBD_STATUS)0x80000100L) -#define USBD_STATUS_INVALID_URB_FUNCTION ((USBD_STATUS)0x80000200L) -#define USBD_STATUS_INVALID_PARAMETER ((USBD_STATUS)0x80000300L) -#define USBD_STATUS_ERROR_BUSY ((USBD_STATUS)0x80000400L) -#define USBD_STATUS_REQUEST_FAILED ((USBD_STATUS)0x80000500L) -#define USBD_STATUS_INVALID_PIPE_HANDLE ((USBD_STATUS)0x80000600L) -#define USBD_STATUS_NO_BANDWIDTH ((USBD_STATUS)0x80000700L) -#define USBD_STATUS_INTERNAL_HC_ERROR ((USBD_STATUS)0x80000800L) -#define USBD_STATUS_ERROR_SHORT_TRANSFER ((USBD_STATUS)0x80000900L) -#define USBD_STATUS_CRC ((USBD_STATUS)0xC0000001L) -#define USBD_STATUS_BTSTUFF ((USBD_STATUS)0xC0000002L) -#define USBD_STATUS_DATA_TOGGLE_MISMATCH ((USBD_STATUS)0xC0000003L) -#define USBD_STATUS_STALL_PID ((USBD_STATUS)0xC0000004L) -#define USBD_STATUS_DEV_NOT_RESPONDING ((USBD_STATUS)0xC0000005L) -#define USBD_STATUS_PID_CHECK_FAILURE ((USBD_STATUS)0xC0000006L) -#define USBD_STATUS_UNEXPECTED_PID ((USBD_STATUS)0xC0000007L) -#define USBD_STATUS_DATA_OVERRUN ((USBD_STATUS)0xC0000008L) -#define USBD_STATUS_DATA_UNDERRUN ((USBD_STATUS)0xC0000009L) -#define USBD_STATUS_RESERVED1 ((USBD_STATUS)0xC000000AL) -#define USBD_STATUS_RESERVED2 ((USBD_STATUS)0xC000000BL) -#define USBD_STATUS_BUFFER_OVERRUN ((USBD_STATUS)0xC000000CL) -#define USBD_STATUS_BUFFER_UNDERRUN ((USBD_STATUS)0xC000000DL) -#define USBD_STATUS_NOT_ACCESSED ((USBD_STATUS)0xC000000FL) -#define USBD_STATUS_FIFO ((USBD_STATUS)0xC0000010L) -#define USBD_STATUS_ENDPOINT_HALTED ((USBD_STATUS)0xC0000030L) -#define USBD_STATUS_BAD_START_FRAME ((USBD_STATUS)0xC0000A00L) -#define USBD_STATUS_ISOCH_REQUEST_FAILED ((USBD_STATUS)0xC0000B00L) -#define USBD_STATUS_FRAME_CONTROL_OWNED ((USBD_STATUS)0xC0000C00L) -#define USBD_STATUS_FRAME_CONTROL_NOT_OWNED \ - ((USBD_STATUS)0xC0000D00L) -#define USBD_STATUS_INAVLID_CONFIGURATION_DESCRIPTOR \ - ((USBD_STATUS)0xC0000F00L) -#define USBD_STATUS_CANCELING ((USBD_STATUS)0x00020000L) +#define USBD_PF_VALID_MASK (USBD_PF_CHANGE_MAX_PACKET | USBD_PF_DOUBLE_BUFFER | \ + USBD_PF_ENABLE_RT_THREAD_ACCESS | USBD_PF_MAP_ADD_TRANSFERS) -#define USBD_PIPE_DIRECTION_IN(pipeInformation) \ - ((pipeInformation)->EndpointAddress & USB_ENDPOINT_DIRECTION_MASK) +#define USBD_TRANSFER_DIRECTION_BIT 0 +#define USBD_SHORT_TRANSFER_OK_BIT 1 +#define USBD_START_ISO_TRANSFER_ASAP_BIT 2 -struct _URB_HEADER { - USHORT Length; - USHORT Function; - USBD_STATUS Status; - PVOID UsbdDeviceHandle; - ULONG UsbdFlags; -}; +#ifdef USBD_TRANSFER_DIRECTION +#undef USBD_TRANSFER_DIRECTION +#endif -struct _URB_HCD_AREA { - PVOID HcdEndpoint; - PIRP HcdIrp; - LIST_ENTRY HcdListEntry; - LIST_ENTRY HcdListEntry2; - PVOID HcdCurrentIoFlushPointer; - PVOID HcdExtension; -}; - -struct _URB_BULK_OR_INTERRUPT_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; -}; - -struct _URB_CONTROL_DESCRIPTOR_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - USHORT Reserved1; - UCHAR Index; - UCHAR DescriptorType; - USHORT LanguageId; - USHORT Reserved2; -}; - -struct _URB_CONTROL_FEATURE_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved2; - ULONG Reserved3; - PVOID Reserved4; - PMDL Reserved5; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - USHORT Reserved0; - USHORT FeatureSelector; - USHORT Index; - USHORT Reserved1; -}; - -struct _URB_CONTROL_GET_CONFIGURATION_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[8]; -}; - -struct _URB_CONTROL_GET_INTERFACE_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[4]; - USHORT Interface; - USHORT Reserved2; -}; - -struct _URB_CONTROL_GET_STATUS_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG Reserved0; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR Reserved1[4]; - USHORT Index; - USHORT Reserved2; -}; - -struct _URB_CONTROL_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR SetupPacket[8]; -}; - -struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST { - struct _URB_HEADER Hdr; - PVOID Reserved; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - UCHAR RequestTypeReservedBits; - UCHAR Request; - USHORT Value; - USHORT Index; - USHORT Reserved1; -}; - -struct _URB_FRAME_LENGTH_CONTROL { - struct _URB_HEADER Hdr; -}; - -struct _URB_GET_CURRENT_FRAME_NUMBER { - struct _URB_HEADER Hdr; - ULONG FrameNumber; -}; - -struct _URB_GET_FRAME_LENGTH { - struct _URB_HEADER Hdr; - ULONG FrameLength; - ULONG FrameNumber; -}; - -typedef struct _USBD_ISO_PACKET_DESCRIPTOR { - ULONG Offset; - ULONG Length; - USBD_STATUS Status; -} USBD_ISO_PACKET_DESCRIPTOR, *PUSBD_ISO_PACKET_DESCRIPTOR; - -struct _URB_ISOCH_TRANSFER { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG TransferFlags; - ULONG TransferBufferLength; - PVOID TransferBuffer; - PMDL TransferBufferMDL; - struct _URB *UrbLink; - struct _URB_HCD_AREA hca; - ULONG StartFrame; - ULONG NumberOfPackets; - ULONG ErrorCount; - USBD_ISO_PACKET_DESCRIPTOR IsoPacket[1]; -}; - -struct _URB_PIPE_REQUEST { - struct _URB_HEADER Hdr; - USBD_PIPE_HANDLE PipeHandle; - ULONG Reserved; -}; - -struct _URB_SET_FRAME_LENGTH { - struct _URB_HEADER Hdr; - LONG FrameLengthDelta; -}; - -typedef struct _USBD_DEVICE_INFORMATION { - ULONG OffsetNext; - PVOID UsbdDeviceHandle; - USB_DEVICE_DESCRIPTOR DeviceDescriptor; -} USBD_DEVICE_INFORMATION, *PUSBD_DEVICE_INFORMATION; - -typedef enum _USBD_PIPE_TYPE { - UsbdPipeTypeControl, - UsbdPipeTypeIsochronous, - UsbdPipeTypeBulk, - UsbdPipeTypeInterrupt -} USBD_PIPE_TYPE; - -/* USBD_PIPE_INFORMATION.PipeFlags constants */ -#define USBD_PF_CHANGE_MAX_PACKET 0x00000001 -#define USBD_PF_DOUBLE_BUFFER 0x00000002 -#define USBD_PF_ENABLE_RT_THREAD_ACCESS 0x00000004 -#define USBD_PF_MAP_ADD_TRANSFERS 0x00000008 - -typedef struct _USBD_PIPE_INFORMATION { - USHORT MaximumPacketSize; - UCHAR EndpointAddress; - UCHAR Interval; - USBD_PIPE_TYPE PipeType; - USBD_PIPE_HANDLE PipeHandle; - ULONG MaximumTransferSize; - ULONG PipeFlags; -} USBD_PIPE_INFORMATION, *PUSBD_PIPE_INFORMATION; - -typedef struct _USBD_INTERFACE_INFORMATION { - USHORT Length; - UCHAR InterfaceNumber; - UCHAR AlternateSetting; - UCHAR Class; - UCHAR SubClass; - UCHAR Protocol; - UCHAR Reserved; - USBD_INTERFACE_HANDLE InterfaceHandle; - ULONG NumberOfPipes; - USBD_PIPE_INFORMATION Pipes[1]; -} USBD_INTERFACE_INFORMATION, *PUSBD_INTERFACE_INFORMATION; - -struct _URB_SELECT_CONFIGURATION { - struct _URB_HEADER Hdr; - PUSB_CONFIGURATION_DESCRIPTOR ConfigurationDescriptor; - USBD_CONFIGURATION_HANDLE ConfigurationHandle; - USBD_INTERFACE_INFORMATION Interface; -}; - -struct _URB_SELECT_INTERFACE { - struct _URB_HEADER Hdr; - USBD_CONFIGURATION_HANDLE ConfigurationHandle; - USBD_INTERFACE_INFORMATION Interface; -}; - -typedef struct _USBD_VERSION_INFORMATION { - ULONG USBDI_Version; - ULONG Supported_USB_Version; -} USBD_VERSION_INFORMATION, *PUSBD_VERSION_INFORMATION; - -typedef struct _URB { - __GNU_EXTENSION union { - struct _URB_HEADER UrbHeader; - struct _URB_SELECT_INTERFACE UrbSelectInterface; - struct _URB_SELECT_CONFIGURATION UrbSelectConfiguration; - struct _URB_PIPE_REQUEST UrbPipeRequest; - struct _URB_FRAME_LENGTH_CONTROL UrbFrameLengthControl; - struct _URB_GET_FRAME_LENGTH UrbGetFrameLength; - struct _URB_SET_FRAME_LENGTH UrbSetFrameLength; - struct _URB_GET_CURRENT_FRAME_NUMBER UrbGetCurrentFrameNumber; - struct _URB_CONTROL_TRANSFER UrbControlTransfer; - struct _URB_BULK_OR_INTERRUPT_TRANSFER UrbBulkOrInterruptTransfer; - struct _URB_ISOCH_TRANSFER UrbIsochronousTransfer; - struct _URB_CONTROL_DESCRIPTOR_REQUEST UrbControlDescriptorRequest; - struct _URB_CONTROL_GET_STATUS_REQUEST UrbControlGetStatusRequest; - struct _URB_CONTROL_FEATURE_REQUEST UrbControlFeatureRequest; - struct _URB_CONTROL_VENDOR_OR_CLASS_REQUEST UrbControlVendorClassRequest; - struct _URB_CONTROL_GET_INTERFACE_REQUEST UrbControlGetInterfaceRequest; - struct _URB_CONTROL_GET_CONFIGURATION_REQUEST UrbControlGetConfigurationRequest; - }; -} URB, *PURB; +#define USBD_TRANSFER_DIRECTION(x) ((x) & USBD_TRANSFER_DIRECTION_IN) #ifdef __cplusplus } #endif - -#endif /* defined __USB_H */ - -#endif /* __USBDI_H */
14 years, 9 months
1
0
0
0
[janderwald] 45860: [PORTCLS] - More cleanup - Only copy audio bytes to common buffer when the audio pin is in the running state - Only notify miniport when the audio pin is in the running state
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Mar 5 10:43:42 2010 New Revision: 45860 URL:
http://svn.reactos.org/svn/reactos?rev=45860&view=rev
Log: [PORTCLS] - More cleanup - Only copy audio bytes to common buffer when the audio pin is in the running state - Only notify miniport when the audio pin is in the running state Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp [iso-8859-1] Fri Mar 5 10:43:42 2010 @@ -320,8 +320,6 @@ STDMETHOD_(NTSTATUS, Init)(THIS_ IN KSPIN_CONNECT *ConnectDetails, - IN PKSDATAFORMAT DataFormat, - IN PDEVICE_OBJECT DeviceObject, IN ULONG FrameSize, IN ULONG Alignment, IN PVOID SilenceBuffer) PURE; @@ -359,8 +357,6 @@ #define IMP_IIrpQueue \ STDMETHODIMP_(NTSTATUS) Init(THIS_ \ IN KSPIN_CONNECT *ConnectDetails, \ - IN PKSDATAFORMAT DataFormat, \ - IN PDEVICE_OBJECT DeviceObject, \ IN ULONG FrameSize, \ IN ULONG Alignment, \ IN PVOID SilenceBuffer); \ Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] Fri Mar 5 10:43:42 2010 @@ -38,10 +38,7 @@ volatile ULONG m_CurrentOffset; LONG m_NumMappings; ULONG m_NumDataAvailable; - BOOL m_StartStream; PKSPIN_CONNECT m_ConnectDetails; - PKSDATAFORMAT_WAVEFORMATEX m_DataFormat; - KSPIN_LOCK m_IrpListLock; LIST_ENTRY m_IrpList; LIST_ENTRY m_FreeIrpList; @@ -51,7 +48,6 @@ ULONG m_OutOfMapping; ULONG m_MaxFrameSize; ULONG m_Alignment; - ULONG m_MinimumDataThreshold; LONG m_Ref; @@ -87,18 +83,14 @@ NTAPI CIrpQueue::Init( IN KSPIN_CONNECT *ConnectDetails, - IN PKSDATAFORMAT DataFormat, - IN PDEVICE_OBJECT DeviceObject, IN ULONG FrameSize, IN ULONG Alignment, IN PVOID SilenceBuffer) { m_ConnectDetails = ConnectDetails; - m_DataFormat = (PKSDATAFORMAT_WAVEFORMATEX)DataFormat; m_MaxFrameSize = FrameSize; m_SilenceBuffer = SilenceBuffer; m_Alignment = Alignment; - m_MinimumDataThreshold = ((PKSDATAFORMAT_WAVEFORMATEX)DataFormat)->WaveFormatEx.nAvgBytesPerSec / 3; InitializeListHead(&m_IrpList); InitializeListHead(&m_FreeIrpList); @@ -273,10 +265,6 @@ // no irp available, use silence buffer *Buffer = (PUCHAR)m_SilenceBuffer; *BufferSize = m_MaxFrameSize; - // flag for port wave pci driver - m_OutOfMapping = TRUE; - // indicate flag to restart fast buffering - m_StartStream = FALSE; return STATUS_SUCCESS; } @@ -436,8 +424,6 @@ // cancel all irps KsCancelIo(&m_IrpList, &m_IrpListLock); - // reset stream start flag - m_StartStream = FALSE; // reset number of mappings m_NumMappings = 0; // reset number of data available @@ -470,7 +456,6 @@ { // no irp available m_OutOfMapping = TRUE; - m_StartStream = FALSE; return STATUS_NOT_FOUND; } Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp [iso-8859-1] Fri Mar 5 10:43:42 2010 @@ -605,7 +605,7 @@ m_ServiceGroup->SupportDelayedService(); } - Status = m_IrpQueue->Init(ConnectDetails, m_Format, DeviceObject, 0, 0, NULL); + Status = m_IrpQueue->Init(ConnectDetails, 0, 0, NULL); if (!NT_SUCCESS(Status)) { DPRINT("IrpQueue_Init failed with %x\n", Status); Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] Fri Mar 5 10:43:42 2010 @@ -780,29 +780,32 @@ PC_ASSERT_IRQL(DISPATCH_LEVEL); - Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize); - if (!NT_SUCCESS(Status)) - { - return; - } - - Status = m_Stream->GetPosition(&Position); - DPRINT("Position %u Buffer %p BufferSize %u ActiveIrpOffset %u Capture %u\n", Position, Buffer, m_CommonBufferSize, BufferSize, m_Capture); - - OldOffset = m_Position.PlayOffset; - - if (Position < m_CommonBufferOffset) - { - UpdateCommonBufferOverlap(Position, m_FrameSize); - } - else if (Position >= m_CommonBufferOffset) - { - UpdateCommonBuffer(Position, m_FrameSize); - } - - NewOffset = m_Position.PlayOffset; - - GeneratePositionEvents(OldOffset, NewOffset); + if (m_State == KSSTATE_RUN) + { + Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize); + if (!NT_SUCCESS(Status)) + { + return; + } + + Status = m_Stream->GetPosition(&Position); + DPRINT("Position %u Buffer %p BufferSize %u ActiveIrpOffset %u Capture %u\n", Position, Buffer, m_CommonBufferSize, BufferSize, m_Capture); + + OldOffset = m_Position.PlayOffset; + + if (Position < m_CommonBufferOffset) + { + UpdateCommonBufferOverlap(Position, m_FrameSize); + } + else if (Position >= m_CommonBufferOffset) + { + UpdateCommonBuffer(Position, m_FrameSize); + } + + NewOffset = m_Position.PlayOffset; + + GeneratePositionEvents(OldOffset, NewOffset); + } } NTSTATUS @@ -1239,7 +1242,7 @@ m_Stream->Silence(SilenceBuffer, m_FrameSize); m_Stream->Silence(m_CommonBuffer, m_CommonBufferSize); - Status = m_IrpQueue->Init(ConnectDetails, DataFormat, DeviceObject, m_FrameSize, 0, SilenceBuffer); + Status = m_IrpQueue->Init(ConnectDetails, m_FrameSize, 0, SilenceBuffer); if (!NT_SUCCESS(Status)) { m_IrpQueue->Release(); Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp [iso-8859-1] Fri Mar 5 10:43:42 2010 @@ -432,9 +432,12 @@ { PC_ASSERT_IRQL(DISPATCH_LEVEL); - m_Stream->Service(); - //TODO - //generate events + if (m_State == KSSTATE_RUN) + { + m_Stream->Service(); + //TODO + //generate events + } } //================================================================================================================================== @@ -829,7 +832,7 @@ if (!NT_SUCCESS(Status)) return Status; - Status = m_IrpQueue->Init(ConnectDetails, m_Format, DeviceObject, m_AllocatorFraming.FrameSize, m_AllocatorFraming.FileAlignment, NULL); + Status = m_IrpQueue->Init(ConnectDetails, m_AllocatorFraming.FrameSize, m_AllocatorFraming.FileAlignment, NULL); if (!NT_SUCCESS(Status)) { DPRINT("IrpQueue_Init failed with %x\n", Status); Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp [iso-8859-1] Fri Mar 5 10:43:42 2010 @@ -587,7 +587,7 @@ goto cleanup; } - Status = m_IrpQueue->Init(ConnectDetails, DataFormat, DeviceObject, 0, 0, NULL); + Status = m_IrpQueue->Init(ConnectDetails, 0, 0, NULL); if (!NT_SUCCESS(Status)) { goto cleanup;
14 years, 9 months
1
0
0
0
[janderwald] 45859: [PORTCLS] - Remove dead code - Disable last mapping failed status when a new mapping is inserted - Notify IMiniportWavePciStream::MappingAvailable when a new mapping has arrived and the last one has failed - Return STATUS_NOT_FOUND in IPortWavePciStream::GetMapping when no mapping is available - Don't stop stream when no mapping is currently available
by janderwald@svn.reactos.org
Author: janderwald Date: Fri Mar 5 10:09:14 2010 New Revision: 45859 URL:
http://svn.reactos.org/svn/reactos?rev=45859&view=rev
Log: [PORTCLS] - Remove dead code - Disable last mapping failed status when a new mapping is inserted - Notify IMiniportWavePciStream::MappingAvailable when a new mapping has arrived and the last one has failed - Return STATUS_NOT_FOUND in IPortWavePciStream::GetMapping when no mapping is available - Don't stop stream when no mapping is currently available Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/interfaces.hpp [iso-8859-1] Fri Mar 5 10:09:14 2010 @@ -337,16 +337,9 @@ STDMETHOD_(VOID, UpdateMapping)(THIS_ IN ULONG BytesWritten) PURE; - STDMETHOD_(ULONG, NumMappings)(THIS) PURE; - STDMETHOD_(ULONG, NumData)(THIS) PURE; - STDMETHOD_(BOOL, MinimumDataAvailable)(THIS) PURE; - STDMETHOD_(BOOL, CancelBuffers)(THIS) PURE; - - STDMETHOD_(VOID, UpdateFormat)(THIS_ - IN PKSDATAFORMAT DataFormat) PURE; STDMETHOD_(NTSTATUS, GetMappingWithTag)(THIS_ IN PVOID Tag, @@ -358,11 +351,8 @@ STDMETHOD_(NTSTATUS, ReleaseMappingWithTag)(THIS_ IN PVOID Tag) PURE; - STDMETHOD_(BOOL, HasLastMappingFailed)(THIS) PURE; + STDMETHOD_(BOOLEAN, HasLastMappingFailed)(THIS) PURE; STDMETHOD_(ULONG, GetCurrentIrpOffset)(THIS) PURE; - STDMETHOD_(VOID, SetMinimumDataThreshold)(THIS_ - IN ULONG MinimumDataThreshold) PURE; - STDMETHOD_(ULONG, GetMinimumDataThreshold)(THIS) PURE; }; @@ -386,16 +376,9 @@ STDMETHODIMP_(VOID) UpdateMapping(THIS_ \ IN ULONG BytesWritten); \ \ - STDMETHODIMP_(ULONG) NumMappings(THIS); \ - \ STDMETHODIMP_(ULONG) NumData(THIS); \ \ - STDMETHODIMP_(BOOL) MinimumDataAvailable(THIS); \ - \ STDMETHODIMP_(BOOL) CancelBuffers(THIS); \ - \ - STDMETHODIMP_(VOID) UpdateFormat(THIS_ \ - IN PKSDATAFORMAT DataFormat); \ \ STDMETHODIMP_(NTSTATUS) GetMappingWithTag(THIS_ \ IN PVOID Tag, \ @@ -407,11 +390,9 @@ STDMETHODIMP_(NTSTATUS) ReleaseMappingWithTag( \ IN PVOID Tag); \ \ - STDMETHODIMP_(BOOL) HasLastMappingFailed(THIS); \ - STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS); \ - STDMETHODIMP_(VOID) SetMinimumDataThreshold( \ - IN ULONG MinimumDataThreshold); \ - STDMETHODIMP_(ULONG) GetMinimumDataThreshold(VOID) + STDMETHODIMP_(BOOLEAN) HasLastMappingFailed(THIS); \ + STDMETHODIMP_(ULONG) GetCurrentIrpOffset(THIS); + /***************************************************************************** * IKsWorkSink Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.cpp [iso-8859-1] Fri Mar 5 10:09:14 2010 @@ -224,6 +224,9 @@ // add irp to cancelable queue KsAddIrpToCancelableQueue(&m_IrpList, &m_IrpListLock, Irp, KsListEntryTail, NULL); + + // disable mapping failed status + m_OutOfMapping = FALSE; // done return Status; @@ -412,41 +415,10 @@ ULONG NTAPI -CIrpQueue::NumMappings() -{ - - // returns the amount of mappings available - return m_NumMappings; -} - -ULONG -NTAPI CIrpQueue::NumData() { // returns the amount of audio stream data available return m_NumDataAvailable; -} - - -BOOL -NTAPI -CIrpQueue::MinimumDataAvailable() -{ - BOOL Result; - - if (m_StartStream) - return TRUE; - - if (m_MinimumDataThreshold < m_NumDataAvailable) - { - m_StartStream = TRUE; - Result = TRUE; - } - else - { - Result = FALSE; - } - return Result; } BOOL @@ -475,17 +447,6 @@ return TRUE; } -VOID -NTAPI -CIrpQueue::UpdateFormat( - PKSDATAFORMAT DataFormat) -{ - m_DataFormat = (PKSDATAFORMAT_WAVEFORMATEX)DataFormat; - m_MinimumDataThreshold = m_DataFormat->WaveFormatEx.nAvgBytesPerSec / 3; - m_StartStream = FALSE; - m_NumDataAvailable = 0; -} - NTSTATUS NTAPI CIrpQueue::GetMappingWithTag( @@ -510,7 +471,7 @@ // no irp available m_OutOfMapping = TRUE; m_StartStream = FALSE; - return STATUS_UNSUCCESSFUL; + return STATUS_NOT_FOUND; } //FIXME support more than one stream header @@ -578,7 +539,7 @@ return STATUS_SUCCESS; } -BOOL +BOOLEAN NTAPI CIrpQueue::HasLastMappingFailed() { @@ -592,23 +553,6 @@ return m_CurrentOffset; } - -VOID -NTAPI -CIrpQueue::SetMinimumDataThreshold( - ULONG MinimumDataThreshold) -{ - - m_MinimumDataThreshold = MinimumDataThreshold; -} - -ULONG -NTAPI -CIrpQueue::GetMinimumDataThreshold() -{ - return m_MinimumDataThreshold; -} - NTSTATUS NTAPI Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_dmus.cpp [iso-8859-1] Fri Mar 5 10:09:14 2010 @@ -41,9 +41,6 @@ VOID TransferMidiDataToDMus(); VOID TransferMidiData(); - VOID NTAPI SetStreamState(IN KSSTATE State); - - IPortDMus * m_Port; IPortFilterDMus * m_Filter; KSPIN_DESCRIPTOR * m_KsPinDescriptor; @@ -75,10 +72,6 @@ ULONG m_LastTag; LONG m_Ref; - - friend VOID NTAPI SetStreamWorkerRoutineDMus(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context); - friend VOID NTAPI CloseStreamRoutineDMus(IN PDEVICE_OBJECT DeviceObject, IN PVOID Context); - }; typedef struct @@ -199,92 +192,6 @@ //================================================================================================================================== VOID -NTAPI -SetStreamWorkerRoutineDMus( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context) -{ - CPortPinDMus* This; - KSSTATE State; - NTSTATUS Status; - PSETSTREAM_CONTEXT Ctx = (PSETSTREAM_CONTEXT)Context; - - This = Ctx->Pin; - State = Ctx->State; - - IoFreeWorkItem(Ctx->WorkItem); - FreeItem(Ctx, TAG_PORTCLASS); - - // Has the audio stream resumed? - if (This->m_IrpQueue->NumMappings() && State == KSSTATE_STOP) - return; - - // Set the state - if (This->m_MidiStream) - { - Status = This->m_MidiStream->SetState(State); - } - else - { - Status = This->m_Mxf->SetState(State); - } - - if (NT_SUCCESS(Status)) - { - // Set internal state to requested state - This->m_State = State; - - if (This->m_State == KSSTATE_STOP) - { - // reset start stream - This->m_IrpQueue->CancelBuffers(); //FIX function name - DPRINT("Stopping PreCompleted %u PostCompleted %u\n", This->m_PreCompleted, This->m_PostCompleted); - } - } -} - -VOID -NTAPI -CPortPinDMus::SetStreamState( - IN KSSTATE State) -{ - PIO_WORKITEM WorkItem; - PSETSTREAM_CONTEXT Context; - - PC_ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); - - // Has the audio stream resumed? - if (m_IrpQueue->NumMappings() && State == KSSTATE_STOP) - return; - - // Has the audio state already been set? - if (m_State == State) - return; - - // allocate set state context - Context = (PSETSTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(SETSTREAM_CONTEXT), TAG_PORTCLASS); - - if (!Context) - return; - - // allocate work item - WorkItem = IoAllocateWorkItem(m_DeviceObject); - - if (!WorkItem) - { - ExFreePool(Context); - return; - } - - Context->Pin = this; - Context->WorkItem = WorkItem; - Context->State = State; - - // queue the work item - IoQueueWorkItem(WorkItem, SetStreamWorkerRoutineDMus, DelayedWorkQueue, (PVOID)Context); -} - -VOID CPortPinDMus::TransferMidiData() { NTSTATUS Status; @@ -297,7 +204,6 @@ Status = m_IrpQueue->GetMapping(&Buffer, &BufferSize); if (!NT_SUCCESS(Status)) { - SetStreamState(KSSTATE_STOP); return; } @@ -375,7 +281,6 @@ if (!Root) { - SetStreamState(KSSTATE_STOP); return; } @@ -482,128 +387,59 @@ return KsDispatchInvalidDeviceRequest(DeviceObject, Irp); } - -VOID -NTAPI -CloseStreamRoutineDMus( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context) -{ - PMINIPORTMIDISTREAM Stream = NULL; +NTSTATUS +NTAPI +CPortPinDMus::Close( + IN PDEVICE_OBJECT DeviceObject, + IN PIRP Irp) +{ NTSTATUS Status; - ISubdevice *ISubDevice; + ISubdevice * SubDevice; PSUBDEVICE_DESCRIPTOR Descriptor; - CPortPinDMus * This; - PCLOSESTREAM_CONTEXT Ctx = (PCLOSESTREAM_CONTEXT)Context; - - This = (CPortPinDMus*)Ctx->Pin; - - if (This->m_MidiStream) - { - if (This->m_State != KSSTATE_STOP) - { - This->m_MidiStream->SetState(KSSTATE_STOP); - } - Stream = This->m_MidiStream; - This->m_MidiStream = NULL; - } - - if (This->m_ServiceGroup) - { - This->m_ServiceGroup->RemoveMember(PSERVICESINK(This)); - } - - Status = This->m_Port->QueryInterface(IID_ISubdevice, (PVOID*)&ISubDevice); + + if (m_ServiceGroup) + { + m_ServiceGroup->RemoveMember(PSERVICESINK(this)); + } + + if (m_MidiStream) + { + if (m_State != KSSTATE_STOP) + { + m_MidiStream->SetState(KSSTATE_STOP); + m_State = KSSTATE_STOP; + } + DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql()); + m_MidiStream->Release(); + } + + Status = m_Port->QueryInterface(IID_ISubdevice, (PVOID*)&SubDevice); if (NT_SUCCESS(Status)) { - Status = ISubDevice->GetDescriptor(&Descriptor); + Status = SubDevice->GetDescriptor(&Descriptor); if (NT_SUCCESS(Status)) { - Descriptor->Factory.Instances[This->m_ConnectDetails->PinId].CurrentPinInstanceCount--; - ISubDevice->Release(); - } - } - - if (This->m_Format) - { - ExFreePool(This->m_Format); - This->m_Format = NULL; + // release reference count + Descriptor->Factory.Instances[m_ConnectDetails->PinId].CurrentPinInstanceCount--; + } + SubDevice->Release(); + } + + if (m_Format) + { + ExFreePool(m_Format); + m_Format = NULL; } // complete the irp - Ctx->Irp->IoStatus.Information = 0; - Ctx->Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Ctx->Irp, IO_NO_INCREMENT); - - // free the work item - IoFreeWorkItem(Ctx->WorkItem); - - // free work item ctx - FreeItem(Ctx, TAG_PORTCLASS); - - // destroy DMus pin - This->m_Filter->FreePin(PPORTPINDMUS(This)); - - if (Stream) - { - DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql()); - Stream->Release(); - } -} - -NTSTATUS -NTAPI -CPortPinDMus::Close( - IN PDEVICE_OBJECT DeviceObject, - IN PIRP Irp) -{ - PCLOSESTREAM_CONTEXT Ctx; - - if (m_MidiStream || m_Mxf) - { - Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS); - if (!Ctx) - { - DPRINT("Failed to allocate stream context\n"); - goto cleanup; - } - - Ctx->WorkItem = IoAllocateWorkItem(DeviceObject); - if (!Ctx->WorkItem) - { - DPRINT("Failed to allocate work item\n"); - goto cleanup; - } - - Ctx->Irp = Irp; - Ctx->Pin = this; - - IoMarkIrpPending(Irp); - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_PENDING; - - // defer work item - IoQueueWorkItem(Ctx->WorkItem, CloseStreamRoutineDMus, DelayedWorkQueue, (PVOID)Ctx); - // Return result - return STATUS_PENDING; - } - Irp->IoStatus.Information = 0; Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_SUCCESS; - -cleanup: - - if (Ctx) - FreeItem(Ctx, TAG_PORTCLASS); - - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_UNSUCCESSFUL; - + // destroy DMus pin + m_Filter->FreePin(PPORTPINDMUS(this)); + + return STATUS_SUCCESS; } NTSTATUS Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavecyclic.cpp [iso-8859-1] Fri Mar 5 10:09:14 2010 @@ -542,9 +542,6 @@ { // free old format FreeItem(Pin->m_Format, TAG_PORTCLASS); - - // update irp queue with new format - Pin->m_IrpQueue->UpdateFormat((PKSDATAFORMAT)NewDataFormat); // store new format Pin->m_Format = NewDataFormat; Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavepci.cpp [iso-8859-1] Fri Mar 5 10:09:14 2010 @@ -36,9 +36,6 @@ IMP_IPortWavePciStream; CPortPinWavePci(IUnknown *OuterUnknown) {} virtual ~CPortPinWavePci(){} - - VOID NTAPI SetState( IN KSSTATE State); - VOID NTAPI CloseStream(); protected: friend NTSTATUS NTAPI PinWavePciState(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data); @@ -77,9 +74,6 @@ NTSTATUS NTAPI HandleKsProperty(IN PIRP Irp); NTSTATUS NTAPI HandleKsStream(IN PIRP Irp); - - - VOID NTAPI SetStreamState( IN KSSTATE State); }; typedef struct @@ -311,9 +305,6 @@ // free old format FreeItem(Pin->m_Format, TAG_PORTCLASS); - // update irp queue with new format - Pin->m_IrpQueue->UpdateFormat((PKSDATAFORMAT)NewDataFormat); - // store new format Pin->m_Format = NewDataFormat; Irp->IoStatus.Information = NewDataFormat->FormatSize; @@ -373,7 +364,7 @@ IN REFIID refiid, OUT PVOID* Output) { - DPRINT("CPortPinWavePci::QueryInterface entered\n"); + //DPRINT("CPortPinWavePci::QueryInterface entered\n"); if (IsEqualGUIDAligned(refiid, IID_IIrpTarget) || IsEqualGUIDAligned(refiid, IID_IUnknown)) @@ -436,132 +427,10 @@ VOID -CPortPinWavePci::SetState(KSSTATE State) -{ - ULONG MinimumDataThreshold; - ULONG MaximumDataThreshold; - - // Has the audio stream resumed? - if (m_IrpQueue->NumMappings() && State == KSSTATE_STOP) - return; - - // Set the state - if (NT_SUCCESS(m_Stream->SetState(State))) - { - // Save new internal state - m_State = State; - - if (m_State == KSSTATE_STOP) - { - // reset start stream - m_IrpQueue->CancelBuffers(); //FIX function name - //This->ServiceGroup->lpVtbl->CancelDelayedService(This->ServiceGroup); - // increase stop counter - m_StopCount++; - // get current data threshold - MinimumDataThreshold = m_IrpQueue->GetMinimumDataThreshold(); - // get maximum data threshold - MaximumDataThreshold = ((PKSDATAFORMAT_WAVEFORMATEX)m_Format)->WaveFormatEx.nAvgBytesPerSec; - // increase minimum data threshold by 10 frames - MinimumDataThreshold += m_AllocatorFraming.FrameSize * 10; - - // assure it has not exceeded - MinimumDataThreshold = min(MinimumDataThreshold, MaximumDataThreshold); - // store minimum data threshold - m_IrpQueue->SetMinimumDataThreshold(MinimumDataThreshold); - - DPRINT("Stopping TotalCompleted %u StopCount %u MinimumDataThreshold %u\n", m_TotalPackets, m_StopCount, MinimumDataThreshold); - } - if (m_State == KSSTATE_RUN) - { - // start the notification timer - //m_ServiceGroup->RequestDelayedService(m_ServiceGroup, m_Delay); - } - } - - -} - -VOID -NTAPI -PinWavePciSetStreamWorkerRoutine( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context) -{ - CPortPinWavePci * This; - PSETSTREAM_CONTEXT Ctx = (PSETSTREAM_CONTEXT)Context; - KSSTATE State; - - This = Ctx->Pin; - State = Ctx->State; - - IoFreeWorkItem(Ctx->WorkItem); - FreeItem(Ctx, TAG_PORTCLASS); - - This->SetState(State); -} - -VOID -NTAPI -CPortPinWavePci::SetStreamState( - IN KSSTATE State) -{ - PDEVICE_OBJECT DeviceObject; - PIO_WORKITEM WorkItem; - PSETSTREAM_CONTEXT Context; - - PC_ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); - - // Has the audio stream resumed? - if (m_IrpQueue->NumMappings() && State == KSSTATE_STOP) - return; - - // Has the audio state already been set? - if (m_State == State) - return; - - // Get device object - DeviceObject = GetDeviceObjectFromPortWavePci(m_Port); - - // allocate set state context - Context = (PSETSTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(SETSTREAM_CONTEXT), TAG_PORTCLASS); - - if (!Context) - return; - - // allocate work item - WorkItem = IoAllocateWorkItem(DeviceObject); - - if (!WorkItem) - { - ExFreePool(Context); - return; - } - - Context->Pin = this; - Context->WorkItem = WorkItem; - Context->State = State; - - // queue the work item - IoQueueWorkItem(WorkItem, PinWavePciSetStreamWorkerRoutine, DelayedWorkQueue, (PVOID)Context); -} - - -VOID NTAPI CPortPinWavePci::RequestService() { PC_ASSERT_IRQL(DISPATCH_LEVEL); - - if (m_IrpQueue->HasLastMappingFailed()) - { - if (m_IrpQueue->NumMappings() == 0) - { - DPRINT("Stopping stream...\n"); - SetStreamState(KSSTATE_STOP); - return; - } - } m_Stream->Service(); //TODO @@ -597,18 +466,18 @@ { PKSPROPERTY Property; NTSTATUS Status; - UNICODE_STRING GuidString; + //UNICODE_STRING GuidString; PIO_STACK_LOCATION IoStack; IoStack = IoGetCurrentIrpStackLocation(Irp); - DPRINT("IPortPinWave_HandleKsProperty entered\n"); + //DPRINT("IPortPinWave_HandleKsProperty entered\n"); IoStack = IoGetCurrentIrpStackLocation(Irp); if (IoStack->Parameters.DeviceIoControl.IoControlCode != IOCTL_KS_PROPERTY) { - DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength); + //DPRINT("Unhandled function %lx Length %x\n", IoStack->Parameters.DeviceIoControl.IoControlCode, IoStack->Parameters.DeviceIoControl.InputBufferLength); Irp->IoStatus.Status = STATUS_SUCCESS; @@ -621,10 +490,11 @@ if (Status == STATUS_NOT_FOUND) { Property = (PKSPROPERTY)IoStack->Parameters.DeviceIoControl.Type3InputBuffer; - +#if 0 RtlStringFromGUID(Property->Set, &GuidString); - DPRINT("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags); + //DPRINT("Unhandeled property Set |%S| Id %u Flags %x\n", GuidString.Buffer, Property->Id, Property->Flags); RtlFreeUnicodeString(&GuidString); +#endif } if (Status != STATUS_PENDING) @@ -636,29 +506,6 @@ return Status; } -#if 0 - else if (Property->Id == KSPROPERTY_CONNECTION_ALLOCATORFRAMING) - { - PKSALLOCATOR_FRAMING Framing = (PKSALLOCATOR_FRAMING)OutputBuffer; - - PC_ASSERT_IRQL(DISPATCH_LEVEL); - // Validate input buffer - if (OutputBufferLength < sizeof(KSALLOCATOR_FRAMING)) - { - IoStatusBlock->Information = sizeof(KSALLOCATOR_FRAMING); - IoStatusBlock->Status = STATUS_BUFFER_TOO_SMALL; - return STATUS_BUFFER_TOO_SMALL; - } - // copy frame allocator struct - RtlMoveMemory(Framing, &m_AllocatorFraming, sizeof(KSALLOCATOR_FRAMING)); - - IoStatusBlock->Information = sizeof(KSALLOCATOR_FRAMING); - IoStatusBlock->Status = STATUS_SUCCESS; - return STATUS_SUCCESS; - } - } -#endif - NTSTATUS NTAPI CPortPinWavePci::HandleKsStream( @@ -666,9 +513,12 @@ { NTSTATUS Status; ULONG Data = 0; + BOOLEAN bFailed; InterlockedIncrement((PLONG)&m_TotalPackets); DPRINT("IPortPinWaveCyclic_HandleKsStream entered Total %u State %x MinData %u\n", m_TotalPackets, m_State, m_IrpQueue->NumData()); + + bFailed = m_IrpQueue->HasLastMappingFailed(); Status = m_IrpQueue->AddMapping(Irp, &Data); @@ -679,6 +529,12 @@ else m_Position.WriteOffset += Data; + if (bFailed) + { + // notify stream of new mapping + m_Stream->MappingAvailable(); + } + return STATUS_PENDING; } @@ -741,132 +597,52 @@ return KsDispatchInvalidDeviceRequest(DeviceObject, Irp); } -VOID -NTAPI -CPortPinWavePci::CloseStream() -{ - PMINIPORTWAVEPCISTREAM Stream; - ISubdevice *ISubDevice; - NTSTATUS Status; - PSUBDEVICE_DESCRIPTOR Descriptor; - - if (m_Stream) - { - if (m_State != KSSTATE_STOP) - { - m_Stream->SetState(KSSTATE_STOP); - } - } - - if (m_ServiceGroup) - { - m_ServiceGroup->RemoveMember(PSERVICESINK(this)); - } - - Status = m_Port->QueryInterface(IID_ISubdevice, (PVOID*)&ISubDevice); - if (NT_SUCCESS(Status)) - { - Status = ISubDevice->GetDescriptor(&Descriptor); - if (NT_SUCCESS(Status)) - { - Descriptor->Factory.Instances[m_ConnectDetails->PinId].CurrentPinInstanceCount--; - } - ISubDevice->Release(); - } - - if (m_Format) - { - ExFreePool(m_Format); - m_Format = NULL; - } - - if (m_Stream) - { - Stream = m_Stream; - m_Stream = 0; - DPRINT("Closing stream at Irql %u\n", KeGetCurrentIrql()); - Stream->Release(); - } -} - -VOID -NTAPI -PinWavePciCloseStreamRoutine( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context) -{ - CPortPinWavePci * This; - PCLOSESTREAM_CONTEXT Ctx = (PCLOSESTREAM_CONTEXT)Context; - - This = (CPortPinWavePci*)Ctx->Pin; - - This->CloseStream(); - - // complete the irp - Ctx->Irp->IoStatus.Information = 0; - Ctx->Irp->IoStatus.Status = STATUS_SUCCESS; - IoCompleteRequest(Ctx->Irp, IO_NO_INCREMENT); - - // free the work item - IoFreeWorkItem(Ctx->WorkItem); - - // free work item ctx - FreeItem(Ctx, TAG_PORTCLASS); -} - NTSTATUS NTAPI CPortPinWavePci::Close( IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp) { - PCLOSESTREAM_CONTEXT Ctx; + ISubdevice *SubDevice; + NTSTATUS Status; + PSUBDEVICE_DESCRIPTOR Descriptor; + + if (m_ServiceGroup) + { + m_ServiceGroup->RemoveMember(PSERVICESINK(this)); + } if (m_Stream) { - Ctx = (PCLOSESTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(CLOSESTREAM_CONTEXT), TAG_PORTCLASS); - if (!Ctx) - { - DPRINT("Failed to allocate stream context\n"); - goto cleanup; - } - - Ctx->WorkItem = IoAllocateWorkItem(DeviceObject); - if (!Ctx->WorkItem) - { - DPRINT("Failed to allocate work item\n"); - goto cleanup; - } - - Ctx->Irp = Irp; - Ctx->Pin = (PVOID)this; - - IoMarkIrpPending(Irp); - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_PENDING; - - // defer work item - IoQueueWorkItem(Ctx->WorkItem, PinWavePciCloseStreamRoutine, DelayedWorkQueue, (PVOID)Ctx); - // Return result - return STATUS_PENDING; - } - + if (m_State != KSSTATE_STOP) + { + m_Stream->SetState(KSSTATE_STOP); + } + m_Stream->Release(); + } + + Status = m_Port->QueryInterface(IID_ISubdevice, (PVOID*)&SubDevice); + if (NT_SUCCESS(Status)) + { + Status = SubDevice->GetDescriptor(&Descriptor); + if (NT_SUCCESS(Status)) + { + Descriptor->Factory.Instances[m_ConnectDetails->PinId].CurrentPinInstanceCount--; + } + SubDevice->Release(); + } + + if (m_Format) + { + ExFreePool(m_Format); + m_Format = NULL; + } + + Irp->IoStatus.Status = STATUS_SUCCESS; Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_SUCCESS; IoCompleteRequest(Irp, IO_NO_INCREMENT); return STATUS_SUCCESS; - -cleanup: - - if (Ctx) - FreeItem(Ctx, TAG_PORTCLASS); - - Irp->IoStatus.Information = 0; - Irp->IoStatus.Status = STATUS_UNSUCCESSFUL; - IoCompleteRequest(Irp, IO_NO_INCREMENT); - return STATUS_UNSUCCESSFUL; - } NTSTATUS Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
============================================================================== --- trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp [iso-8859-1] (original) +++ trunk/reactos/drivers/wdm/audio/backpln/portcls/pin_wavert.cpp [iso-8859-1] Fri Mar 5 10:09:14 2010 @@ -98,91 +98,6 @@ return STATUS_SUCCESS; } return STATUS_UNSUCCESSFUL; -} - -VOID -NTAPI -SetStreamWorkerRoutine( - IN PDEVICE_OBJECT DeviceObject, - IN PVOID Context) -{ - CPortPinWaveRT * This; - PSETSTREAM_CONTEXT Ctx = (PSETSTREAM_CONTEXT)Context; - KSSTATE State; - - This = Ctx->Pin; - State = Ctx->State; - - IoFreeWorkItem(Ctx->WorkItem); - FreeItem(Ctx, TAG_PORTCLASS); - - // Has the audio stream resumed? - if (This->m_IrpQueue->NumMappings() && State == KSSTATE_STOP) - return; - - // Set the state - if (NT_SUCCESS(This->m_Stream->SetState(State))) - { - // Set internal state to stop - This->m_State = State; - - if (This->m_State == KSSTATE_STOP) - { - // reset start stream - This->m_IrpQueue->CancelBuffers(); //FIX function name - DPRINT("Stopping PreCompleted %u PostCompleted %u\n", This->m_PreCompleted, This->m_PostCompleted); - } - - if (This->m_State == KSSTATE_RUN) - { - // start the notification timer - } - } -} - -VOID -NTAPI -CPortPinWaveRT::SetStreamState( - IN KSSTATE State) -{ - PDEVICE_OBJECT DeviceObject; - PIO_WORKITEM WorkItem; - PSETSTREAM_CONTEXT Context; - - PC_ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL); - - // Has the audio stream resumed? - if (m_IrpQueue->NumMappings() && State == KSSTATE_STOP) - return; - - // Has the audio state already been set? - if (m_State == State) - return; - - // Get device object - DeviceObject = GetDeviceObjectFromPortWaveRT(m_Port); - - // allocate set state context - Context = (PSETSTREAM_CONTEXT)AllocateItem(NonPagedPool, sizeof(SETSTREAM_CONTEXT), TAG_PORTCLASS); - - if (!Context) - return; - - // allocate work item - WorkItem = IoAllocateWorkItem(DeviceObject); - - if (!WorkItem) - { - ExFreePool(Context); - return; - } - - Context->Pin = this; - Context->WorkItem = WorkItem; - Context->State = State; - - // queue the work item - IoQueueWorkItem(WorkItem, SetStreamWorkerRoutine, DelayedWorkQueue, (PVOID)Context); } //================================================================================================================================== @@ -313,7 +228,6 @@ if (m_Format) ExFreePoolWithTag(m_Format, TAG_PORTCLASS); - m_IrpQueue->UpdateFormat((PKSDATAFORMAT)NewDataFormat); m_Format = NewDataFormat; Irp->IoStatus.Information = DataFormat->FormatSize; Irp->IoStatus.Status = STATUS_SUCCESS;
14 years, 9 months
1
0
0
0
[tkreuzer] 45858: - Convert the members of PCI_COMMON_HEADER into a #define to avoid inheritance on C++, which would render the type a non-POD, causing compilation errors. - IoInitializeDpcRequest expects PIO_DPC_ROUTINE as 2nd parameter, fix callers. - While FILE_CHARACTERISTIC_PNP_DEVICE is defined in the DDK/WDK, _SYSTEM_INFORMATION_CLASS is not, fix include guards in ntddk_ex.h - add InterlockedBitTestAndSet64 and InterlockedBitTestAndReset64 for amd64 - Fix definition of NLS_MB_CODE_PAGE_TA
by tkreuzer@svn.reactos.org
Author: tkreuzer Date: Fri Mar 5 05:03:34 2010 New Revision: 45858 URL:
http://svn.reactos.org/svn/reactos?rev=45858&view=rev
Log: - Convert the members of PCI_COMMON_HEADER into a #define to avoid inheritance on C++, which would render the type a non-POD, causing compilation errors. - IoInitializeDpcRequest expects PIO_DPC_ROUTINE as 2nd parameter, fix callers. - While FILE_CHARACTERISTIC_PNP_DEVICE is defined in the DDK/WDK, _SYSTEM_INFORMATION_CLASS is not, fix include guards in ntddk_ex.h - add InterlockedBitTestAndSet64 and InterlockedBitTestAndReset64 for amd64 - Fix definition of NLS_MB_CODE_PAGE_TAG for gcc - Fix parameters of DMA inline functions - remove duplicate IoAllocateAdapterChannel - Everything compiles again -> Amine, your turn :) Modified: branches/header-work/drivers/base/beep/beep.c branches/header-work/drivers/storage/floppy/floppy.c branches/header-work/drivers/storage/ide/uniata/ntddk_ex.h branches/header-work/include/ddk/wdm.h Modified: branches/header-work/drivers/base/beep/beep.c URL:
http://svn.reactos.org/svn/reactos/branches/header-work/drivers/base/beep/b…
============================================================================== --- branches/header-work/drivers/base/beep/beep.c [iso-8859-1] (original) +++ branches/header-work/drivers/base/beep/beep.c [iso-8859-1] Fri Mar 5 05:03:34 2010 @@ -393,7 +393,7 @@ DeviceExtension = DeviceObject->DeviceExtension; DeviceExtension->ReferenceCount = 0; DeviceExtension->TimerActive = FALSE; - IoInitializeDpcRequest(DeviceObject, BeepDPC); + IoInitializeDpcRequest(DeviceObject, (PIO_DPC_ROUTINE)BeepDPC); KeInitializeTimer(&DeviceExtension->Timer); ExInitializeFastMutex(&DeviceExtension->Mutex); Modified: branches/header-work/drivers/storage/floppy/floppy.c URL:
http://svn.reactos.org/svn/reactos/branches/header-work/drivers/storage/flo…
============================================================================== --- branches/header-work/drivers/storage/floppy/floppy.c [iso-8859-1] (original) +++ branches/header-work/drivers/storage/floppy/floppy.c [iso-8859-1] Fri Mar 5 05:03:34 2010 @@ -972,7 +972,7 @@ } /* 3e: Set up the DPC */ - IoInitializeDpcRequest(gControllerInfo[i].DriveInfo[j].DeviceObject, DpcForIsr); + IoInitializeDpcRequest(gControllerInfo[i].DriveInfo[j].DeviceObject, (PIO_DPC_ROUTINE)DpcForIsr); /* 3f: Point the device extension at our DriveInfo struct */ gControllerInfo[i].DriveInfo[j].DeviceObject->DeviceExtension = &gControllerInfo[i].DriveInfo[j]; Modified: branches/header-work/drivers/storage/ide/uniata/ntddk_ex.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/drivers/storage/ide…
============================================================================== --- branches/header-work/drivers/storage/ide/uniata/ntddk_ex.h [iso-8859-1] (original) +++ branches/header-work/drivers/storage/ide/uniata/ntddk_ex.h [iso-8859-1] Fri Mar 5 05:03:34 2010 @@ -8,8 +8,8 @@ #endif #ifndef FILE_CHARACTERISTIC_PNP_DEVICE // DDK 2003 - #define FILE_CHARACTERISTIC_PNP_DEVICE 0x00000800 +#endif // !FILE_CHARACTERISTIC_PNP_DEVICE typedef enum _SYSTEM_INFORMATION_CLASS { SystemBasicInformation, @@ -127,8 +127,6 @@ #endif //__REACTOS__ } SYSTEM_INFORMATION_CLASS; -#endif // !FILE_CHARACTERISTIC_PNP_DEVICE - NTSYSAPI NTSTATUS Modified: branches/header-work/include/ddk/wdm.h URL:
http://svn.reactos.org/svn/reactos/branches/header-work/include/ddk/wdm.h?r…
============================================================================== --- branches/header-work/include/ddk/wdm.h [iso-8859-1] (original) +++ branches/header-work/include/ddk/wdm.h [iso-8859-1] Fri Mar 5 05:03:34 2010 @@ -68,6 +68,7 @@ struct _SCATTER_GATHER_LIST; struct _DRIVE_LAYOUT_INFORMATION; struct _COMPRESSED_DATA_INFO; +struct _IO_RESOURCE_DESCRIPTOR; /* Structures not exposed to drivers */ typedef struct _OBJECT_TYPE *POBJECT_TYPE; @@ -133,7 +134,6 @@ #endif - #define BitScanForward _BitScanForward #define BitScanReverse _BitScanReverse #define BitTest _bittest @@ -142,6 +142,11 @@ #define BitTestAndReset _bittestandreset #define InterlockedBitTestAndSet _interlockedbittestandset #define InterlockedBitTestAndReset _interlockedbittestandreset + +#ifdef _M_AMD64 +#define InterlockedBitTestAndSet64 _interlockedbittestandset64 +#define InterlockedBitTestAndReset64 _interlockedbittestandreset64 +#endif #if !defined(__INTERLOCKED_DECLARED) #define __INTERLOCKED_DECLARED @@ -1363,21 +1368,6 @@ #else #error Unsupported Architecture #endif - -#ifdef _NTSYSTEM_ - -#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag -#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag - -#else - -#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag) -#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag) - -#endif /* _NTSYSTEM_ */ - -extern BOOLEAN NLS_MB_CODE_PAGE_TAG; -extern BOOLEAN NLS_MB_OEM_CODE_PAGE_TAG; /****************************************************************************** @@ -3568,7 +3558,7 @@ ULONGLONG NTAPI RtlIoDecodeMemIoResource ( - IN PIO_RESOURCE_DESCRIPTOR Descriptor, + IN struct _IO_RESOURCE_DESCRIPTOR *Descriptor, OUT PULONGLONG Alignment OPTIONAL, OUT PULONGLONG MinimumAddress OPTIONAL, OUT PULONGLONG MaximumAddress OPTIONAL); @@ -3577,7 +3567,7 @@ NTSTATUS NTAPI RtlIoEncodeMemIoResource( - IN PIO_RESOURCE_DESCRIPTOR Descriptor, + IN struct _IO_RESOURCE_DESCRIPTOR *Descriptor, IN UCHAR Type, IN ULONGLONG Length, IN ULONGLONG Alignment, @@ -3910,7 +3900,6 @@ ******************************************************************************/ /* PCI_COMMON_CONFIG.Command */ - #define PCI_ENABLE_IO_SPACE 0x0001 #define PCI_ENABLE_MEMORY_SPACE 0x0002 #define PCI_ENABLE_BUS_MASTER 0x0004 @@ -3924,7 +3913,6 @@ #define PCI_DISABLE_LEVEL_INTERRUPT 0x0400 /* PCI_COMMON_CONFIG.Status */ - #define PCI_STATUS_INTERRUPT_PENDING 0x0008 #define PCI_STATUS_CAPABILITIES_LIST 0x0010 #define PCI_STATUS_66MHZ_CAPABLE 0x0020 @@ -3939,7 +3927,6 @@ #define PCI_STATUS_DETECTED_PARITY_ERROR 0x8000 /* PCI_COMMON_CONFIG.HeaderType */ - #define PCI_MULTIFUNCTION 0x80 #define PCI_DEVICE_TYPE 0x00 #define PCI_BRIDGE_TYPE 0x01 @@ -3952,7 +3939,6 @@ ((((PPCI_COMMON_CONFIG) (PciData))->HeaderType & PCI_MULTIFUNCTION) != 0) /* PCI device classes */ - #define PCI_CLASS_PRE_20 0x00 #define PCI_CLASS_MASS_STORAGE_CTLR 0x01 #define PCI_CLASS_NETWORK_CTLR 0x02 @@ -3973,12 +3959,10 @@ #define PCI_CLASS_DATA_ACQ_SIGNAL_PROC 0x11 /* PCI device subclasses for class 0 */ - #define PCI_SUBCLASS_PRE_20_NON_VGA 0x00 #define PCI_SUBCLASS_PRE_20_VGA 0x01 /* PCI device subclasses for class 1 (mass storage controllers)*/ - #define PCI_SUBCLASS_MSC_SCSI_BUS_CTLR 0x00 #define PCI_SUBCLASS_MSC_IDE_CTLR 0x01 #define PCI_SUBCLASS_MSC_FLOPPY_CTLR 0x02 @@ -3987,7 +3971,6 @@ #define PCI_SUBCLASS_MSC_OTHER 0x80 /* PCI device subclasses for class 2 (network controllers)*/ - #define PCI_SUBCLASS_NET_ETHERNET_CTLR 0x00 #define PCI_SUBCLASS_NET_TOKEN_RING_CTLR 0x01 #define PCI_SUBCLASS_NET_FDDI_CTLR 0x02 @@ -3996,27 +3979,23 @@ #define PCI_SUBCLASS_NET_OTHER 0x80 /* PCI device subclasses for class 3 (display controllers)*/ - #define PCI_SUBCLASS_VID_VGA_CTLR 0x00 #define PCI_SUBCLASS_VID_XGA_CTLR 0x01 #define PCI_SUBCLASS_VID_3D_CTLR 0x02 #define PCI_SUBCLASS_VID_OTHER 0x80 /* PCI device subclasses for class 4 (multimedia device)*/ - #define PCI_SUBCLASS_MM_VIDEO_DEV 0x00 #define PCI_SUBCLASS_MM_AUDIO_DEV 0x01 #define PCI_SUBCLASS_MM_TELEPHONY_DEV 0x02 #define PCI_SUBCLASS_MM_OTHER 0x80 /* PCI device subclasses for class 5 (memory controller)*/ - #define PCI_SUBCLASS_MEM_RAM 0x00 #define PCI_SUBCLASS_MEM_FLASH 0x01 #define PCI_SUBCLASS_MEM_OTHER 0x80 /* PCI device subclasses for class 6 (bridge device)*/ - #define PCI_SUBCLASS_BR_HOST 0x00 #define PCI_SUBCLASS_BR_ISA 0x01 #define PCI_SUBCLASS_BR_EISA 0x02 @@ -4029,7 +4008,6 @@ #define PCI_SUBCLASS_BR_OTHER 0x80 /* PCI device subclasses for class C (serial bus controller)*/ - #define PCI_SUBCLASS_SB_IEEE1394 0x00 #define PCI_SUBCLASS_SB_ACCESS 0x01 #define PCI_SUBCLASS_SB_SSA 0x02 @@ -4081,13 +4059,11 @@ #define IO_TYPE_CSQ_EX 3 /* IO_RESOURCE_DESCRIPTOR.Option */ - #define IO_RESOURCE_PREFERRED 0x01 #define IO_RESOURCE_DEFAULT 0x02 #define IO_RESOURCE_ALTERNATIVE 0x08 /* DEVICE_OBJECT.Flags */ - #define DO_VERIFY_VOLUME 0x00000002 #define DO_BUFFERED_IO 0x00000004 #define DO_EXCLUSIVE 0x00000008 @@ -4100,7 +4076,6 @@ #define DO_POWER_INRUSH 0x00004000 /* DEVICE_OBJECT.Characteristics */ - #define FILE_REMOVABLE_MEDIA 0x00000001 #define FILE_READ_ONLY_DEVICE 0x00000002 #define FILE_FLOPPY_DISKETTE 0x00000004 @@ -4115,7 +4090,6 @@ #define FILE_CHARACTERISTIC_WEBDAV_DEVICE 0x00002000 /* DEVICE_OBJECT.AlignmentRequirement */ - #define FILE_BYTE_ALIGNMENT 0x00000000 #define FILE_WORD_ALIGNMENT 0x00000001 #define FILE_LONG_ALIGNMENT 0x00000003 @@ -4128,7 +4102,6 @@ #define FILE_512_BYTE_ALIGNMENT 0x000001ff /* DEVICE_OBJECT.DeviceType */ - #define DEVICE_TYPE ULONG #define FILE_DEVICE_BEEP 0x00000001 @@ -4328,91 +4301,94 @@ ULONG SharedDelete; } SHARE_ACCESS, *PSHARE_ACCESS; +/* While MS WDK uses inheritance in C++, we cannot do this with gcc, as + inheritance, even from a struct renders the type non-POD. So we use + this hack */ +#define PCI_COMMON_HEADER_MEMBERS \ + USHORT VendorID; \ + USHORT DeviceID; \ + USHORT Command; \ + USHORT Status; \ + UCHAR RevisionID; \ + UCHAR ProgIf; \ + UCHAR SubClass; \ + UCHAR BaseClass; \ + UCHAR CacheLineSize; \ + UCHAR LatencyTimer; \ + UCHAR HeaderType; \ + UCHAR BIST; \ + union { \ + struct _PCI_HEADER_TYPE_0 { \ + ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; \ + ULONG CIS; \ + USHORT SubVendorID; \ + USHORT SubSystemID; \ + ULONG ROMBaseAddress; \ + UCHAR CapabilitiesPtr; \ + UCHAR Reserved1[3]; \ + ULONG Reserved2; \ + UCHAR InterruptLine; \ + UCHAR InterruptPin; \ + UCHAR MinimumGrant; \ + UCHAR MaximumLatency; \ + } type0; \ + struct _PCI_HEADER_TYPE_1 { \ + ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; \ + UCHAR PrimaryBus; \ + UCHAR SecondaryBus; \ + UCHAR SubordinateBus; \ + UCHAR SecondaryLatency; \ + UCHAR IOBase; \ + UCHAR IOLimit; \ + USHORT SecondaryStatus; \ + USHORT MemoryBase; \ + USHORT MemoryLimit; \ + USHORT PrefetchBase; \ + USHORT PrefetchLimit; \ + ULONG PrefetchBaseUpper32; \ + ULONG PrefetchLimitUpper32; \ + USHORT IOBaseUpper16; \ + USHORT IOLimitUpper16; \ + UCHAR CapabilitiesPtr; \ + UCHAR Reserved1[3]; \ + ULONG ROMBaseAddress; \ + UCHAR InterruptLine; \ + UCHAR InterruptPin; \ + USHORT BridgeControl; \ + } type1; \ + struct _PCI_HEADER_TYPE_2 { \ + ULONG SocketRegistersBaseAddress; \ + UCHAR CapabilitiesPtr; \ + UCHAR Reserved; \ + USHORT SecondaryStatus; \ + UCHAR PrimaryBus; \ + UCHAR SecondaryBus; \ + UCHAR SubordinateBus; \ + UCHAR SecondaryLatency; \ + struct { \ + ULONG Base; \ + ULONG Limit; \ + } Range[PCI_TYPE2_ADDRESSES-1]; \ + UCHAR InterruptLine; \ + UCHAR InterruptPin; \ + USHORT BridgeControl; \ + } type2; \ + } u; + typedef struct _PCI_COMMON_HEADER { - USHORT VendorID; - USHORT DeviceID; - USHORT Command; - USHORT Status; - UCHAR RevisionID; - UCHAR ProgIf; - UCHAR SubClass; - UCHAR BaseClass; - UCHAR CacheLineSize; - UCHAR LatencyTimer; - UCHAR HeaderType; - UCHAR BIST; - union { - struct _PCI_HEADER_TYPE_0 { - ULONG BaseAddresses[PCI_TYPE0_ADDRESSES]; - ULONG CIS; - USHORT SubVendorID; - USHORT SubSystemID; - ULONG ROMBaseAddress; - UCHAR CapabilitiesPtr; - UCHAR Reserved1[3]; - ULONG Reserved2; - UCHAR InterruptLine; - UCHAR InterruptPin; - UCHAR MinimumGrant; - UCHAR MaximumLatency; - } type0; - struct _PCI_HEADER_TYPE_1 { - ULONG BaseAddresses[PCI_TYPE1_ADDRESSES]; - UCHAR PrimaryBus; - UCHAR SecondaryBus; - UCHAR SubordinateBus; - UCHAR SecondaryLatency; - UCHAR IOBase; - UCHAR IOLimit; - USHORT SecondaryStatus; - USHORT MemoryBase; - USHORT MemoryLimit; - USHORT PrefetchBase; - USHORT PrefetchLimit; - ULONG PrefetchBaseUpper32; - ULONG PrefetchLimitUpper32; - USHORT IOBaseUpper16; - USHORT IOLimitUpper16; - UCHAR CapabilitiesPtr; - UCHAR Reserved1[3]; - ULONG ROMBaseAddress; - UCHAR InterruptLine; - UCHAR InterruptPin; - USHORT BridgeControl; - } type1; - struct _PCI_HEADER_TYPE_2 { - ULONG SocketRegistersBaseAddress; - UCHAR CapabilitiesPtr; - UCHAR Reserved; - USHORT SecondaryStatus; - UCHAR PrimaryBus; - UCHAR SecondaryBus; - UCHAR SubordinateBus; - UCHAR SecondaryLatency; - struct { - ULONG Base; - ULONG Limit; - } Range[PCI_TYPE2_ADDRESSES-1]; - UCHAR InterruptLine; - UCHAR InterruptPin; - USHORT BridgeControl; - } type2; - } u; + PCI_COMMON_HEADER_MEMBERS } PCI_COMMON_HEADER, *PPCI_COMMON_HEADER; #ifdef __cplusplus - -typedef struct _PCI_COMMON_CONFIG : PCI_COMMON_HEADER { +typedef struct _PCI_COMMON_CONFIG { + PCI_COMMON_HEADER_MEMBERS UCHAR DeviceSpecific[192]; } PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG; - #else - typedef struct _PCI_COMMON_CONFIG { PCI_COMMON_HEADER DUMMYSTRUCTNAME; UCHAR DeviceSpecific[192]; } PCI_COMMON_CONFIG, *PPCI_COMMON_CONFIG; - #endif typedef enum _CREATE_FILE_TYPE { @@ -6714,7 +6690,7 @@ FORCEINLINE NTSTATUS IoAllocateAdapterChannel( - IN PADAPTER_OBJECT AdapterObject, + IN PDMA_ADAPTER DmaAdapter, IN PDEVICE_OBJECT DeviceObject, IN ULONG NumberOfMapRegisters, IN PDRIVER_CONTROL ExecutionRoutine, @@ -6734,7 +6710,7 @@ FORCEINLINE BOOLEAN IoFlushAdapterBuffers( - IN PADAPTER_OBJECT AdapterObject, + IN PDMA_ADAPTER DmaAdapter, IN PMDL Mdl, IN PVOID MapRegisterBase, IN PVOID CurrentVa, @@ -6749,13 +6725,13 @@ MapRegisterBase, CurrentVa, Length, - WriteToDevice ); + WriteToDevice); } FORCEINLINE VOID IoFreeAdapterChannel( - IN PADAPTER_OBJECT AdapterObject) + IN PDMA_ADAPTER DmaAdapter) { PFREE_ADAPTER_CHANNEL FreeAdapterChannel; FreeAdapterChannel = *(DmaAdapter)->DmaOperations->FreeAdapterChannel; @@ -6766,7 +6742,7 @@ FORCEINLINE VOID IoFreeMapRegisters( - IN PADAPTER_OBJECT AdapterObject, + IN PDMA_ADAPTER DmaAdapter, IN PVOID MapRegisterBase, IN ULONG NumberOfMapRegisters) { @@ -6849,33 +6825,6 @@ InterlockedDecrement(_Count); \ } \ } - -#if defined(USE_DMA_MACROS) && !defined(_NTHAL_) && (defined(_NTDDK_) || defined(_NTDRIVER_)) || defined(_WDM_INCLUDED_) -FORCEINLINE -NTSTATUS -IoAllocateAdapterChannel( - IN PDMA_ADAPTER DmaAdapter, - IN PDEVICE_OBJECT DeviceObject, - IN ULONG NumberOfMapRegisters, - IN PDRIVER_CONTROL ExecutionRoutine, - IN PVOID Context) -{ - PALLOCATE_ADAPTER_CHANNEL allocateAdapterChannel; - NTSTATUS status; - - allocateAdapterChannel = *(DmaAdapter)->DmaOperations->AllocateAdapterChannel; - - ASSERT( allocateAdapterChannel != NULL ); - - status = allocateAdapterChannel( DmaAdapter, - DeviceObject, - NumberOfMapRegisters, - ExecutionRoutine, - Context ); - - return status; -} -#endif #if (NTDDI_VERSION >= NTDDI_WIN2K) @@ -9122,6 +9071,17 @@ #define QUOTA_LIMITS_HARDWS_MAX_DISABLE 0x00000008 #define QUOTA_LIMITS_USE_DEFAULT_LIMITS 0x00000010 +/* HACK HACK HACK - GCC (or perhaps LD) is messing this up */ +#if defined(_NTSYSTEM_) || defined(__GNUC__) +#define NLS_MB_CODE_PAGE_TAG NlsMbCodePageTag +#define NLS_MB_OEM_CODE_PAGE_TAG NlsMbOemCodePageTag +#else +#define NLS_MB_CODE_PAGE_TAG (*NlsMbCodePageTag) +#define NLS_MB_OEM_CODE_PAGE_TAG (*NlsMbOemCodePageTag) +#endif /* _NT_SYSTEM */ +extern BOOLEAN NTSYSAPI NLS_MB_CODE_PAGE_TAG; +extern BOOLEAN NTSYSAPI NLS_MB_OEM_CODE_PAGE_TAG; + #ifdef __cplusplus } #endif
14 years, 9 months
1
0
0
0
← Newer
1
...
74
75
76
77
78
79
80
...
90
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Results per page:
10
25
50
100
200