Author: janderwald
Date: Mon Jan 12 12:37:02 2009
New Revision: 38731
URL:
http://svn.reactos.org/svn/reactos?rev=38731&view=rev
Log:
- Implement IPortTopology::NewRegistryKey, IPortWavePci::NewRegistryKey
- Implement PcRegisterPhysicalConnection, PcRegisterPhysicalConnectionFromExternal,
PcRegisterPhysicalConnectionToExternal- Implement PcRequestNewPowerState
Added:
trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c (with props)
Modified:
trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/port_wavepci.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
trunk/reactos/drivers/wdm/audio/backpln/portcls/power.c
trunk/reactos/drivers/wdm/audio/backpln/portcls/private.h
trunk/reactos/drivers/wdm/audio/backpln/portcls/stubs.c
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/adapter.c [iso-8859-1] Mon Jan 12
12:37:02 2009
@@ -168,7 +168,8 @@
RtlZeroMemory(portcls_ext, sizeof(PCExtension));
portcls_ext->PhysicalDeviceObject = PhysicalDeviceObject;
portcls_ext->StartDevice = StartDevice;
- InitializeListHead(&portcls_ext->SubDeviceList);
+ InitializeListHead(&portcls_ext->SubDeviceList);
+ InitializeListHead(&portcls_ext->PhysicalConnectionList);
status = KsAllocateDeviceHeader(&portcls_ext->KsDeviceHeader, 0, NULL);
if (!NT_SUCCESS(status))
Added: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c (added)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c [iso-8859-1] Mon Jan 12
12:37:02 2009
@@ -1,0 +1,43 @@
+
+
+NTSTATUS
+NewIrpStreamPhysical(
+ OUT IIrpStreamPhysical ** OutIIrpStreamPhysical,
+ IN IUnknown *OuterUnknown)
+{
+ return STATUS_UNSUCCESSFUL;
+}
+
+
+/*
+ * @implemented
+ */
+
+NTSTATUS
+NTAPI
+PcNewIrpStreamPhysical(
+ OUT IIrpStreamPhysical ** OutIrpStreamPhysical,
+ IN IUnknown * OuterUnknown,
+ IN BOOLEAN Wait,
+ IN KSPIN_CONNECT *ConnectDetails,
+ IN PDEVICE_OBJECT DeviceObject,
+ IN PDMA_ADAPTER DmaAdapter)
+{
+ NTSTATUS Status;
+ IIrpStreamPhysical * Irp;
+
+ Status = NewIrpStreamPhysical(&Irp, OuterUnknown);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+
+ Status = Irp->lpVtbl->Init(Irp, Wait, ConnectDetails, DeviceObject,
DmaAdapter);
+ if (!NT_SUCCESS(Status))
+ {
+ Irp->lpVtbl->Release(Irp);
+ return Status;
+ }
+
+ *OutIrpStreamPhysical = Irp;
+ return Status;
+}
Propchange: trunk/reactos/drivers/wdm/audio/backpln/portcls/irpstream.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/port_topology.c [iso-8859-1] Mon Jan
12 12:37:02 2009
@@ -187,7 +187,15 @@
DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initialized\n");
return STATUS_UNSUCCESSFUL;
}
- return STATUS_UNSUCCESSFUL;
+ return PcNewRegistryKey(OutRegistryKey,
+ OuterUnknown,
+ RegistryKeyType,
+ DesiredAccess,
+ This->pDeviceObject,
+ NULL,//FIXME
+ ObjectAttributes,
+ CreateOptions,
+ Disposition);
}
static IPortTopologyVtbl vt_IPortTopology =
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 12
12:37:02 2009
@@ -247,7 +247,23 @@
IN ULONG CreateOptions OPTIONAL,
OUT PULONG Disposition OPTIONAL)
{
- return STATUS_UNSUCCESSFUL;
+ IPortWavePciImpl * This = (IPortWavePciImpl*)iface;
+
+ if (!This->bInitialized)
+ {
+ DPRINT("IPortWaveCyclic_fnNewRegistryKey called w/o initiazed\n");
+ return STATUS_UNSUCCESSFUL;
+ }
+
+ return PcNewRegistryKey(OutRegistryKey,
+ OuterUnknown,
+ RegistryKeyType,
+ DesiredAccess,
+ This->pDeviceObject,
+ NULL,//FIXME
+ ObjectAttributes,
+ CreateOptions,
+ Disposition);
}
NTSTATUS
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild [iso-8859-1]
(original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/portcls.rbuild [iso-8859-1] Mon Jan 12
12:37:02 2009
@@ -11,6 +11,7 @@
<library>rtl</library>
<library>hal</library>
<file>api.c</file>
+ <file>connection.c</file>
<file>dll.c</file>
<file>dma_slave.c</file>
<file>drm_port.c</file>
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/power.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/power.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/power.c [iso-8859-1] Mon Jan 12
12:37:02 2009
@@ -36,3 +36,50 @@
DeviceExt->AdapterPowerManagement = pPower;
return STATUS_SUCCESS;
}
+
+
+static
+VOID
+NTAPI
+PwrCompletionCallback(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN UCHAR MinorFunction,
+ IN POWER_STATE PowerState,
+ IN PVOID Context,
+ IN PIO_STATUS_BLOCK IoStatus)
+{
+ KeSetEvent((PRKEVENT)Context, IO_NO_INCREMENT, FALSE);
+}
+
+/*
+ * @implemented
+ */
+NTSTATUS NTAPI
+PcRequestNewPowerState(
+ IN PDEVICE_OBJECT DeviceObject,
+ IN DEVICE_POWER_STATE RequestedNewState)
+{
+ KEVENT Event;
+ NTSTATUS Status;
+ POWER_STATE PowerState;
+ PCExtension* DeviceExt;
+
+ if (!DeviceObject || !RequestedNewState)
+ return STATUS_INVALID_PARAMETER;
+
+ DeviceExt = (PCExtension*)DeviceObject->DeviceExtension;
+ KeInitializeEvent(&Event, SynchronizationEvent, FALSE);
+
+ PowerState.DeviceState = RequestedNewState;
+ PowerState.SystemState = PowerSystemUnspecified;
+
+ Status = PoRequestPowerIrp(DeviceExt->PhysicalDeviceObject, IRP_MN_SET_POWER,
PowerState, PwrCompletionCallback, (PVOID)&Event, NULL);
+ if (NT_SUCCESS(Status))
+ {
+ KeWaitForSingleObject((PVOID)&Event, Executive, KernelMode, FALSE, NULL);
+ }
+
+
+ return Status;
+}
+
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 12
12:37:02 2009
@@ -15,6 +15,7 @@
#include <dmusicks.h>
#include "interfaces.h"
+#include <ks.h>
#define TAG(A, B, C, D) (ULONG)(((A)<<0) + ((B)<<8) + ((C)<<16) +
((D)<<24))
#define TAG_PORTCLASS TAG('P', 'C', 'L', 'S')
@@ -86,6 +87,17 @@
KSOBJECT_HEADER ObjectHeader;
}SUBDEVICE_ENTRY;
+typedef struct
+{
+ LIST_ENTRY Entry;
+ ISubdevice * FromSubDevice;
+ LPWSTR FromUnicodeString;
+ ULONG FromPin;
+ ISubdevice * ToSubDevice;
+ LPWSTR ToUnicodeString;
+ ULONG ToPin;
+}PHYSICAL_CONNECTION;
+
typedef struct
{
@@ -96,6 +108,7 @@
IResourceList* resources;
LIST_ENTRY SubDeviceList;
+ LIST_ENTRY PhysicalConnectionList;
} PCExtension;
Modified: trunk/reactos/drivers/wdm/audio/backpln/portcls/stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/wdm/audio/backpln/…
==============================================================================
--- trunk/reactos/drivers/wdm/audio/backpln/portcls/stubs.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/wdm/audio/backpln/portcls/stubs.c [iso-8859-1] Mon Jan 12
12:37:02 2009
@@ -11,29 +11,6 @@
#include "private.h"
#include <portcls.h>
-
-/*
- Factory Stubs
-*/
-
-
-
-/* ===============================================================
- Power Management
-*/
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcRequestNewPowerState(
- IN PDEVICE_OBJECT pDeviceObject,
- IN DEVICE_POWER_STATE RequestedNewState)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
-
/* ===============================================================
Properties
@@ -51,60 +28,3 @@
return STATUS_UNSUCCESSFUL;
}
-/* ===============================================================
- Physical Connections
-*/
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcRegisterPhysicalConnection(
- IN PDEVICE_OBJECT DeviceObject,
- IN PUNKNOWN FromUnknown,
- IN ULONG FromPin,
- IN PUNKNOWN ToUnknown,
- IN ULONG ToPin)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcRegisterPhysicalConnectionFromExternal(
- IN PDEVICE_OBJECT DeviceObject,
- IN PUNICODE_STRING FromString,
- IN ULONG FromPin,
- IN PUNKNOWN ToUnknown,
- IN ULONG ToPin)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
-
-/*
- * @unimplemented
- */
-NTSTATUS NTAPI
-PcRegisterPhysicalConnectionToExternal(
- IN PDEVICE_OBJECT DeviceObject,
- IN PUNKNOWN FromUnknown,
- IN ULONG FromPin,
- IN PUNICODE_STRING ToString,
- IN ULONG ToPin)
-{
- UNIMPLEMENTED;
- return STATUS_UNSUCCESSFUL;
-}
-
-
-/* ===============================================================
- Misc
-*/
-
-/*
- * @unimplemented
- */