[USBAUDIO]
[reactos.git] / reactos / drivers / usb / usbaudio / usbaudio.h
index 33b911c..813ac59 100644 (file)
@@ -32,6 +32,8 @@
 #define USB_AUDIO_SUBWOOFER_TERMINAL_TYPE (0x0307)
 #define USB_AUDIO_UNDEFINED_TERMINAL_TYPE (0xFFFF)
 
+#define USB_AUDIO_INPUT_TERMINAL (0x02)
+#define USB_AUDIO_OUTPUT_TERMINAL (0x03)
 
 #include <pshpack1.h>
 
@@ -72,6 +74,30 @@ typedef struct
     UCHAR iChannelNames;
     UCHAR iTerminal;
 }USB_AUDIO_CONTROL_INPUT_TERMINAL_DESCRIPTOR, *PUSB_AUDIO_CONTROL_INPUT_TERMINAL_DESCRIPTOR;
+
+typedef struct
+{
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    UCHAR bDescriptorSubtype;
+    UCHAR bTerminalLink;
+    UCHAR bDelay;
+    USHORT wFormatTag;
+}USB_AUDIO_STREAMING_INTERFACE_DESCRIPTOR, *PUSB_AUDIO_STREAMING_INTERFACE_DESCRIPTOR;
+
+typedef struct
+{
+    UCHAR bLength;
+    UCHAR bDescriptorType;
+    UCHAR bDescriptorSubtype;
+    UCHAR bFormatType;
+    UCHAR bNrChannels;
+    UCHAR bSubframeSize;
+    UCHAR bBitResolution;
+    UCHAR bSamFreqType;
+    UCHAR tSamFreq[1];
+}USB_AUDIO_STREAMING_FORMAT_TYPE_DESCRIPTOR, *PUSB_AUDIO_STREAMING_FORMAT_TYPE_DESCRIPTOR;
+
 #include <poppack.h>
 
 typedef struct __DEVICE_EXTENSION__
@@ -84,6 +110,26 @@ typedef struct __DEVICE_EXTENSION__
 
 }DEVICE_EXTENSION, *PDEVICE_EXTENSION;
 
+typedef struct
+{
+    PDEVICE_EXTENSION DeviceExtension;                           /* device extension */
+    PDEVICE_OBJECT LowerDevice;                                  /* lower device*/
+
+}FILTER_CONTEXT, *PFILTER_CONTEXT;
+
+typedef struct
+{
+    PDEVICE_EXTENSION DeviceExtension;                           /* device extension */
+    PDEVICE_OBJECT LowerDevice;                                  /* lower device*/
+    LIST_ENTRY IrpListHead;                                      /* irp list*/
+    LIST_ENTRY DoneIrpListHead;                                  /* irp done list head */
+    KSPIN_LOCK IrpListLock;                                      /* irp list lock*/
+    PUCHAR Buffer;                                               /* iso buffer*/
+    ULONG BufferSize;                                            /* iso buffer size */
+    PUSB_INTERFACE_DESCRIPTOR InterfaceDescriptor;               /* interface descriptor */
+
+}PIN_CONTEXT, *PPIN_CONTEXT;
+
 /* filter.c */
 
 NTSTATUS
@@ -104,6 +150,11 @@ FreeFunction(
 
 /* usbaudio.c */
 
+NTSTATUS
+SubmitUrbSync(
+    IN PDEVICE_OBJECT Device,
+    IN PURB Urb);
+
 NTSTATUS
 NTAPI
 USBAudioAddDevice(
@@ -196,3 +247,44 @@ USBAudioPnPSetPower(
   _In_ DEVICE_POWER_STATE To,
   _In_ DEVICE_POWER_STATE From
 );
+
+/* pin.c*/
+
+NTSTATUS
+NTAPI
+USBAudioPinCreate(
+    _In_ PKSPIN Pin,
+    _In_ PIRP Irp);
+
+NTSTATUS
+NTAPI
+USBAudioPinClose(
+    _In_ PKSPIN Pin,
+    _In_ PIRP Irp);
+
+NTSTATUS
+NTAPI
+USBAudioPinProcess(
+    _In_ PKSPIN Pin);
+
+VOID
+NTAPI
+USBAudioPinReset(
+    _In_ PKSPIN Pin);
+
+NTSTATUS
+NTAPI
+USBAudioPinSetDataFormat(
+    _In_ PKSPIN Pin,
+    _In_opt_ PKSDATAFORMAT OldFormat,
+    _In_opt_ PKSMULTIPLE_ITEM OldAttributeList,
+    _In_ const KSDATARANGE* DataRange,
+    _In_opt_ const KSATTRIBUTE_LIST* AttributeRange);
+
+NTSTATUS
+NTAPI
+USBAudioPinSetDeviceState(
+    _In_ PKSPIN Pin,
+    _In_ KSSTATE ToState,
+    _In_ KSSTATE FromState);
+