Author: janderwald
Date: Mon Jan 5 18:44:16 2009
New Revision: 38595
URL:
http://svn.reactos.org/svn/reactos?rev=38595&view=rev
Log:
- Implement IPortWaveCyclic::NewMasterDmaChannel, IPortWaveCyclic::NewDmaChannelSlave,
IPortWavePci_fnNewMasterDmaChannel
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/api.c [iso-8859-1] Mon Jan 5 18:44:16
2009
@@ -74,7 +74,9 @@
return STATUS_SUCCESS;
}
-
+/*
+ * @implemented
+ */
NTSTATUS
NTAPI
PcDmaMasterDescription(
@@ -104,7 +106,9 @@
return STATUS_SUCCESS;
}
-
+/*
+ * @implemented
+ */
NTSTATUS
NTAPI
PcDmaSlaveDescription(
@@ -112,7 +116,7 @@
IN ULONG DmaIndex,
IN BOOL DemandMode,
IN ULONG AutoInitialize,
- IN DMA_SPEED DmaSpeed
+ IN DMA_SPEED DmaSpeed,
IN ULONG MaximumLength,
IN ULONG DmaPort,
OUT PDEVICE_DESCRIPTION DeviceDescription)
@@ -127,4 +131,4 @@
DeviceDescription->DmaPort = DmaPort;
return STATUS_SUCCESS;
-}
+}
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavecyclic.c [iso-8859-1] Mon Jan
5 18:44:16 2009
@@ -26,6 +26,7 @@
const GUID IID_IIrpTarget;
const GUID IID_IPinCount;
const GUID IID_IPowerNotify;
+const GUID IID_IDmaChannelSlave;
const GUID GUID_DEVCLASS_SOUND; //FIXME
//---------------------------------------------------------------
@@ -250,14 +251,30 @@
IN DMA_WIDTH DmaWidth,
IN DMA_SPEED DmaSpeed)
{
- return STATUS_UNSUCCESSFUL;
+ NTSTATUS Status;
+ DEVICE_DESCRIPTION DeviceDescription;
+ IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
+
+ if (!This->bInitialized)
+ {
+ DPRINT("IPortWaveCyclic_fnNewSlaveDmaChannel called w/o
initialized\n");
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ Status = PcDmaMasterDescription(ResourceList, (Dma32BitAddresses |
Dma64BitAddresses), Dma32BitAddresses, 0, Dma64BitAddresses, DmaWidth, DmaSpeed,
MaximumLength, 0, &DeviceDescription);
+ if (NT_SUCCESS(Status))
+ {
+ return PcNewDmaChannel(DmaChannel, OuterUnknown, NonPagedPool,
&DeviceDescription, This->pDeviceObject);
+ }
+
+ return Status;
}
NTSTATUS
NTAPI
IPortWaveCyclic_fnNewSlaveDmaChannel(
IN IPortWaveCyclic * iface,
- OUT PDMACHANNELSLAVE* DmaChannel,
+ OUT PDMACHANNELSLAVE* OutDmaChannel,
IN PUNKNOWN OuterUnknown,
IN PRESOURCELIST ResourceList OPTIONAL,
IN ULONG DmaIndex,
@@ -265,12 +282,9 @@
IN BOOL DemandMode,
IN DMA_SPEED DmaSpeed)
{
- DEVICE_DESCRIPTION DeviceDesc;
- INTERFACE_TYPE BusType;
- ULONG ResultLength;
+ DEVICE_DESCRIPTION DeviceDescription;
+ PDMACHANNEL DmaChannel;
NTSTATUS Status;
- ULONG MapRegisters;
- PDMA_ADAPTER Adapter;
IPortWaveCyclicImpl * This = (IPortWaveCyclicImpl*)iface;
@@ -280,34 +294,22 @@
return STATUS_UNSUCCESSFUL;
}
- Status = IoGetDeviceProperty(This->pDeviceObject, DevicePropertyLegacyBusType,
sizeof(BusType), (PVOID)&BusType, &ResultLength);
- if (!NT_SUCCESS(Status))
- {
- DPRINT("IoGetDeviceProperty failed with %x\n", Status);
- return Status;
- }
-
- RtlZeroMemory(&DeviceDesc, sizeof(DeviceDesc));
- DeviceDesc.Version = DEVICE_DESCRIPTION_VERSION;
- DeviceDesc.Master = FALSE;
- DeviceDesc.InterfaceType = BusType;
- DeviceDesc.MaximumLength = MaximumLength;
- DeviceDesc.DemandMode = DemandMode;
- DeviceDesc.DmaSpeed = DmaSpeed;
- DeviceDesc.DmaChannel = DmaIndex;
-
- Adapter = IoGetDmaAdapter(This->pDeviceObject, &DeviceDesc,
&MapRegisters);
- if (!Adapter)
- {
- DPRINT("IoGetDmaAdapter failed\n");
- return STATUS_INSUFFICIENT_RESOURCES;
- }
-
- return NewDmaChannelSlave(&DeviceDesc, Adapter, MapRegisters, DmaChannel);
-
-
-
- return STATUS_UNSUCCESSFUL;
+ // FIXME
+ // Check for F-Type DMA Support
+ //
+
+ Status = PcDmaSlaveDescription(ResourceList, DmaIndex, DemandMode, TRUE, DmaSpeed,
MaximumLength, 0, &DeviceDescription);
+ if (NT_SUCCESS(Status))
+ {
+ Status = PcNewDmaChannel(&DmaChannel, OuterUnknown, NonPagedPool,
&DeviceDescription, This->pDeviceObject);
+ if (NT_SUCCESS(Status))
+ {
+ Status = DmaChannel->lpVtbl->QueryInterface(DmaChannel,
&IID_IDmaChannelSlave, (PVOID*)OutDmaChannel);
+ DmaChannel->lpVtbl->Release(DmaChannel);
+ }
+ }
+
+ return Status;
}
VOID
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c [iso-8859-1] Mon Jan 5
18:44:16 2009
@@ -275,19 +275,30 @@
NTAPI
IPortWavePci_fnNewMasterDmaChannel(
IN IPortWavePci * iface,
- OUT PDMACHANNEL* DmaChannel,
- IN PUNKNOWN OuterUnknown,
- IN POOL_TYPE PoolType,
- IN PRESOURCELIST ResourceList OPTIONAL,
- IN BOOL ScatterGather,
- IN BOOL Dma32BitAddresses,
- IN BOOL Dma64BitAddresses,
- IN DMA_WIDTH DmaWidth,
- IN DMA_SPEED DmaSpeed,
- IN ULONG MaximumLength,
- IN ULONG DmaPort)
-{
- return STATUS_UNSUCCESSFUL;
+ OUT PDMACHANNEL *DmaChannel,
+ IN PUNKNOWN OuterUnknown OPTIONAL,
+ IN POOL_TYPE PoolType,
+ IN PRESOURCELIST ResourceList OPTIONAL,
+ IN BOOLEAN ScatterGather,
+ IN BOOLEAN Dma32BitAddresses,
+ IN BOOLEAN Dma64BitAddresses,
+ IN BOOLEAN IgnoreCount,
+ IN DMA_WIDTH DmaWidth,
+ IN DMA_SPEED DmaSpeed,
+ IN ULONG MaximumLength,
+ IN ULONG DmaPort)
+{
+ NTSTATUS Status;
+ DEVICE_DESCRIPTION DeviceDescription;
+ IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
+
+ Status = PcDmaMasterDescription(ResourceList, ScatterGather, Dma32BitAddresses,
IgnoreCount, Dma64BitAddresses, DmaWidth, DmaSpeed, MaximumLength, DmaPort,
&DeviceDescription);
+ if (NT_SUCCESS(Status))
+ {
+ return PcNewDmaChannel(DmaChannel, OuterUnknown, PoolType,
&DeviceDescription, This->pDeviceObject);
+ }
+
+ return Status;
}
VOID
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h [iso-8859-1] Mon Jan 5
18:44:16 2009
@@ -106,7 +106,31 @@
} PCExtension;
+NTSTATUS
+NTAPI
+PcDmaMasterDescription(
+ IN PRESOURCELIST ResourceList OPTIONAL,
+ IN BOOLEAN ScatterGather,
+ IN BOOLEAN Dma32BitAddresses,
+ IN BOOLEAN IgnoreCount,
+ IN BOOLEAN Dma64BitAddresses,
+ IN DMA_WIDTH DmaWidth,
+ IN DMA_SPEED DmaSpeed,
+ IN ULONG MaximumLength,
+ IN ULONG DmaPort,
+ OUT PDEVICE_DESCRIPTION DeviceDescription);
+NTSTATUS
+NTAPI
+PcDmaSlaveDescription(
+ IN PRESOURCELIST ResourceList OPTIONAL,
+ IN ULONG DmaIndex,
+ IN BOOL DemandMode,
+ IN ULONG AutoInitialize,
+ IN DMA_SPEED DmaSpeed,
+ IN ULONG MaximumLength,
+ IN ULONG DmaPort,
+ OUT PDEVICE_DESCRIPTION DeviceDescription);