ReactOS 0.4.15-dev-6663-gd1e9fe1
miniport.cpp File Reference
#include "wavepciminiport.h"
Include dependency graph for miniport.cpp:

Go to the source code of this file.

Macros

#define STR_MODULENAME   "AC97 Miniport: "
 

Functions

 DEFINE_PCAUTOMATION_TABLE_PROP (AutomationDAC, PropertiesDAC)
 
 STDMETHODIMP_ (NTSTATUS) CMiniport
 
 STDMETHODIMP_ (void) CMiniport
 
void __fastcall obj_AddRef (PUNKNOWN obj, void **ppvObject)
 
void __fastcall obj_Release (void **ppvObject)
 

Variables

static KSDATARANGE_AUDIO PinDataRangesPCMStreamRender [WAVE_SAMPLERATES_TESTED]
 
static KSDATARANGE_AUDIO PinDataRangesPCMStreamCapture [WAVE_SAMPLERATES_TESTED]
 
static KSDATARANGE_AUDIO PinDataRangesMicStream [MIC_SAMPLERATES_TESTED]
 
static KSDATARANGE PinDataRangesAnalogBridge []
 
static PKSDATARANGE PinDataRangePointersPCMStreamRender [WAVE_SAMPLERATES_TESTED]
 
static PKSDATARANGE PinDataRangePointersPCMStreamCapture [WAVE_SAMPLERATES_TESTED]
 
static PKSDATARANGE PinDataRangePointersMicStream [MIC_SAMPLERATES_TESTED]
 
static PKSDATARANGE PinDataRangePointersAnalogBridge []
 
static PCPIN_DESCRIPTOR MiniportPins []
 
static PCPROPERTY_ITEM PropertiesDAC []
 
static PCNODE_DESCRIPTOR MiniportNodes []
 
static PCCONNECTION_DESCRIPTOR MiniportConnections []
 
static PCFILTER_DESCRIPTOR MiniportFilterDescriptor
 

Macro Definition Documentation

◆ STR_MODULENAME

#define STR_MODULENAME   "AC97 Miniport: "

Definition at line 2 of file miniport.cpp.

Function Documentation

◆ DEFINE_PCAUTOMATION_TABLE_PROP()

DEFINE_PCAUTOMATION_TABLE_PROP ( AutomationDAC  ,
PropertiesDAC   
)

◆ obj_AddRef()

void __fastcall obj_AddRef ( PUNKNOWN  obj,
void **  ppvObject 
)

Definition at line 1264 of file miniport.cpp.

1265{
1266 if(ppvObject) {
1267 *ppvObject = obj;
1268 if(obj) obj->AddRef();
1269 }
1270}
_In_ void _In_ PCCERT_CONTEXT _In_opt_ LPFILETIME _In_ DWORD _In_ DWORD _Outptr_opt_ void ** ppvObject
Definition: wincrypt.h:6082

Referenced by CMiniportStream::Init().

◆ obj_Release()

void __fastcall obj_Release ( void **  ppvObject)

Definition at line 1273 of file miniport.cpp.

1274{
1275 if(ppvObject) {
1277 *ppvObject = NULL;
1278 if(obj) obj->Release();
1279 }
1280}
IUnknown * PUNKNOWN
Definition: com_apitest.h:45
#define NULL
Definition: types.h:112

Referenced by CMiniport::~CMiniport(), and CMiniportStream::~CMiniportStream().

◆ STDMETHODIMP_() [1/2]

STDMETHODIMP_ ( NTSTATUS  )

Definition at line 544 of file miniport.cpp.

548{
549 PAGED_CODE ();
550
551 ASSERT (OutFilterDescriptor);
552
553 DOUT (DBG_PRINT, ("[CMiniport::GetDescription]"));
554
555 *OutFilterDescriptor = &MiniportFilterDescriptor;
556
557
558 return STATUS_SUCCESS;
559}
#define PAGED_CODE()
static PCFILTER_DESCRIPTOR MiniportFilterDescriptor
Definition: miniport.cpp:287
#define DOUT(lvl, strings)
Definition: debug.h:82
#define ASSERT(a)
Definition: mode.c:44
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DBG_PRINT(ppi, ch, level)
Definition: win32kdebug.h:168

◆ STDMETHODIMP_() [2/2]

STDMETHODIMP_ ( void  )

Definition at line 987 of file miniport.cpp.

991{
992 PAGED_CODE ();
993 NTSTATUS ntStatus = STATUS_SUCCESS;
994
995 DOUT (DBG_PRINT, ("[CMiniport::PowerChangeNotify]"));
996
997 //
998 // Check to see if this is the current power state.
999 //
1000 if (NewState.DeviceState == m_PowerState)
1001 {
1002 DOUT (DBG_POWER, ("New device state equals old state."));
1003 return;
1004 }
1005
1006 //
1007 // Check the new device state.
1008 //
1009 if ((NewState.DeviceState < PowerDeviceD0) ||
1010 (NewState.DeviceState > PowerDeviceD3))
1011 {
1012 DOUT (DBG_ERROR, ("Unknown device state: D%d.",
1013 (ULONG)NewState.DeviceState - (ULONG)PowerDeviceD0));
1014 return;
1015 }
1016
1017 DOUT (DBG_POWER, ("Changing state to D%d.", (ULONG)NewState.DeviceState -
1019
1020 //
1021 // In case we return to D0 power state from a D3 state, restore the
1022 // interrupt connection.
1023 //
1024 if (NewState.DeviceState == PowerDeviceD0)
1025 {
1026 ntStatus = InterruptSync->Connect ();
1027 if (!NT_SUCCESS (ntStatus))
1028 {
1029 DOUT (DBG_ERROR, ("Failed to connect the ISR with InterruptSync!"));
1030 // We can do nothing else than just continue ...
1031 }
1032 }
1033
1034 //
1035 // Call the stream routine which takes care of the DMA engine.
1036 // That's all we have to do.
1037 //
1038 for (int loop = PIN_WAVEOUT_OFFSET; loop < PIN_MICIN_OFFSET; loop++)
1039 {
1040 if (Streams[loop])
1041 {
1042 Streams[loop]->PowerChangeNotify (NewState);
1043 }
1044 }
1045
1046 //
1047 // In case we go to any sleep state we disconnect the interrupt service
1048 // reoutine from the interrupt.
1049 // Normally this is not required to do, but for some reason this fixes
1050 // a problem where we won't have any interrupts on specific motherboards
1051 // after resume.
1052 //
1053 if (NewState.DeviceState != PowerDeviceD0)
1054 {
1055 InterruptSync->Disconnect ();
1056 }
1057
1058 //
1059 // Save the new state. This local value is used to determine when to
1060 // cache property accesses and when to permit the driver from accessing
1061 // the hardware.
1062 //
1063 m_PowerState = NewState.DeviceState;
1064 DOUT (DBG_POWER, ("Entering D%d",
1065 (ULONG)m_PowerState - (ULONG)PowerDeviceD0));
1066}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
const int DBG_POWER
Definition: debug.h:23
const int PIN_MICIN_OFFSET
Definition: miniport.h:23
const int PIN_WAVEOUT_OFFSET
Definition: miniport.h:21
#define DBG_ERROR
Definition: nfs41_debug.h:78
@ PowerDeviceD0
Definition: ntpoapi.h:49
@ PowerDeviceD3
Definition: ntpoapi.h:52
uint32_t ULONG
Definition: typedefs.h:59

Variable Documentation

◆ MiniportConnections

PCCONNECTION_DESCRIPTOR MiniportConnections[]
static
Initial value:
=
{
}
@ PIN_MICIN
Definition: shared.h:322
@ PIN_WAVEOUT
Definition: shared.h:318
@ PIN_WAVEOUT_BRIDGE
Definition: shared.h:319
@ PIN_WAVEIN_BRIDGE
Definition: shared.h:321
@ PIN_WAVEIN
Definition: shared.h:320
@ PIN_MICIN_BRIDGE
Definition: shared.h:323
@ NODE_WAVEOUT_DAC
Definition: shared.h:331
@ NODE_MICIN_ADC
Definition: shared.h:333
@ NODE_WAVEIN_ADC
Definition: shared.h:332
#define PCFILTER_NODE
Definition: portcls.h:154

Definition at line 264 of file miniport.cpp.

◆ MiniportFilterDescriptor

PCFILTER_DESCRIPTOR MiniportFilterDescriptor
static
Initial value:
=
{
0,
NULL,
sizeof(PCPIN_DESCRIPTOR),
0,
}
#define SIZEOF_ARRAY(ar)
Definition: cdrom.h:1482
static PCPIN_DESCRIPTOR MiniportPins[]
Definition: miniport.cpp:79
static PCNODE_DESCRIPTOR MiniportNodes[]
Definition: miniport.cpp:228
static PCCONNECTION_DESCRIPTOR MiniportConnections[]
Definition: miniport.cpp:264

Definition at line 287 of file miniport.cpp.

◆ MiniportNodes

PCNODE_DESCRIPTOR MiniportNodes[]
static
Initial value:
=
{
{
0,
&AutomationDAC,
},
{
0,
NULL,
},
{
0,
NULL,
}
}
#define KSNODETYPE_ADC
Definition: ksmedia.h:262
#define KSNODETYPE_DAC
Definition: ksmedia.h:287

Definition at line 228 of file miniport.cpp.

◆ MiniportPins

PCPIN_DESCRIPTOR MiniportPins[]
static

Definition at line 79 of file miniport.cpp.

◆ PinDataRangePointersAnalogBridge

PKSDATARANGE PinDataRangePointersAnalogBridge[]
static
Initial value:
=
{
}
static KSDATARANGE PinDataRangesAnalogBridge[]
Definition: miniport.cpp:20
union KSDATAFORMAT * PKSDATARANGE

Definition at line 49 of file miniport.cpp.

Referenced by CAC97MiniportTopology::BuildPinDescriptors().

◆ PinDataRangePointersMicStream

PKSDATARANGE PinDataRangePointersMicStream[MIC_SAMPLERATES_TESTED]
static

Definition at line 42 of file miniport.cpp.

Referenced by CMiniport::BuildDataRangeInformation().

◆ PinDataRangePointersPCMStreamCapture

PKSDATARANGE PinDataRangePointersPCMStreamCapture[WAVE_SAMPLERATES_TESTED]
static

Definition at line 41 of file miniport.cpp.

Referenced by CMiniport::BuildDataRangeInformation().

◆ PinDataRangePointersPCMStreamRender

PKSDATARANGE PinDataRangePointersPCMStreamRender[WAVE_SAMPLERATES_TESTED]
static

Definition at line 40 of file miniport.cpp.

Referenced by CMiniport::BuildDataRangeInformation().

◆ PinDataRangesAnalogBridge

KSDATARANGE PinDataRangesAnalogBridge[]
static
Initial value:
=
{
{
sizeof(KSDATARANGE),
0,
0,
0,
}
}
#define STATICGUIDOF(guid)
Definition: dmksctrl.h:25
union KSDATAFORMAT KSDATARANGE
#define KSDATAFORMAT_SUBTYPE_ANALOG
Definition: ksmedia.h:993
#define KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:983

Definition at line 20 of file miniport.cpp.

◆ PinDataRangesMicStream

KSDATARANGE_AUDIO PinDataRangesMicStream[MIC_SAMPLERATES_TESTED]
static

Definition at line 18 of file miniport.cpp.

Referenced by CMiniport::BuildDataRangeInformation().

◆ PinDataRangesPCMStreamCapture

KSDATARANGE_AUDIO PinDataRangesPCMStreamCapture[WAVE_SAMPLERATES_TESTED]
static

Definition at line 17 of file miniport.cpp.

Referenced by CMiniport::BuildDataRangeInformation().

◆ PinDataRangesPCMStreamRender

KSDATARANGE_AUDIO PinDataRangesPCMStreamRender[WAVE_SAMPLERATES_TESTED]
static

Definition at line 16 of file miniport.cpp.

Referenced by CMiniport::BuildDataRangeInformation().

◆ PropertiesDAC

PCPROPERTY_ITEM PropertiesDAC[]
static
Initial value:
=
{
{
}
}
static NTSTATUS NTAPI PropertyChannelConfig(IN PPCPROPERTY_REQUEST PropertyRequest)
Definition: miniport.cpp:314
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
@ KSPROPERTY_AUDIO_CHANNEL_CONFIG
Definition: ksmedia.h:1056
#define KSPROPSETID_Audio
Definition: ksmedia.h:1051

Definition at line 206 of file miniport.cpp.