ReactOS 0.4.16-dev-2293-g4d8327b
adsp.cpp File Reference
#include "driver.h"
#include "adsp.h"
Include dependency graph for adsp.cpp:

Go to the source code of this file.

Macros

#define ADSP_DECL   1
 

Functions

NTSTATUS ADSPGetResources (_In_ PVOID _context, _PCI_BAR *hdaBar, _PCI_BAR *adspBar, PVOID *ppcap, PNHLT_INFO nhltInfo, BUS_INTERFACE_STANDARD *pciConfig)
 
NTSTATUS ADSPSetPowerState (_In_ PVOID _context, _In_ DEVICE_POWER_STATE powerState)
 
NTSTATUS ADSPRegisterInterrupt (_In_ PVOID _context, _In_ PADSP_INTERRUPT_CALLBACK callback, _In_ PVOID callbackContext)
 
NTSTATUS ADSPUnregisterInterrupt (_In_ PVOID _context)
 
NTSTATUS ADSPGetRenderStream (_In_ PVOID _context, HDAUDIO_STREAM_FORMAT StreamFormat, PHANDLE Handle, _Out_ UINT8 *streamTag)
 
NTSTATUS ADSPGetCaptureStream (_In_ PVOID _context, HDAUDIO_STREAM_FORMAT StreamFormat, PHANDLE Handle, _Out_ UINT8 *streamTag)
 
NTSTATUS ADSPFreeStream (_In_ PVOID _context, _In_ HANDLE Handle)
 
NTSTATUS ADSPPrepareDSP (_In_ PVOID _context, _In_ HANDLE Handle, _In_ unsigned int ByteSize, _In_ int NumBlocks, _Out_ PVOID *bdlBuf)
 
NTSTATUS ADSPCleanupDSP (_In_ PVOID _context, _In_ HANDLE Handle)
 
void ADSPStartStopDSP (_In_ PVOID _context, _In_ HANDLE Handle, BOOL startStop)
 
void ADSPEnableSPIB (_In_ PVOID _context, _In_ HANDLE Handle, UINT32 value)
 
void ADSPDisableSPIB (_In_ PVOID _context, _In_ HANDLE Handle)
 
UINT32 ADSPStreamPosition (_In_ PVOID _context, _In_ HANDLE Handle)
 
ADSP_BUS_INTERFACE ADSP_BusInterface (PVOID Context)
 

Macro Definition Documentation

◆ ADSP_DECL

#define ADSP_DECL   1

Definition at line 2 of file adsp.cpp.

Function Documentation

◆ ADSP_BusInterface()

ADSP_BUS_INTERFACE ADSP_BusInterface ( PVOID  Context)

Definition at line 369 of file adsp.cpp.

369 {
370 ADSP_BUS_INTERFACE busInterface;
371 RtlZeroMemory(&busInterface, sizeof(ADSP_BUS_INTERFACE));
372
374
375 busInterface.Size = sizeof(ADSP_BUS_INTERFACE);
376 busInterface.Version = 1;
377 busInterface.Context = Context;
380 busInterface.CtlrDevId = devData->CodecIds.CtlrDevId;
381 busInterface.GetResources = ADSPGetResources;
382 busInterface.SetDSPPowerState = ADSPSetPowerState;
385
388 busInterface.FreeStream = ADSPFreeStream;
389 busInterface.PrepareDSP = ADSPPrepareDSP;
390 busInterface.CleanupDSP = ADSPCleanupDSP;
391 busInterface.TriggerDSP = ADSPStartStopDSP;
392 busInterface.StreamPosition = ADSPStreamPosition;
393
394 busInterface.DSPEnableSPIB = ADSPEnableSPIB;
395 busInterface.DSPDisableSPIB = ADSPDisableSPIB;
396
397 return busInterface;
398}
struct _PDO_DEVICE_DATA * PPDO_DEVICE_DATA
NTSTATUS ADSPGetResources(_In_ PVOID _context, _PCI_BAR *hdaBar, _PCI_BAR *adspBar, PVOID *ppcap, PNHLT_INFO nhltInfo, BUS_INTERFACE_STANDARD *pciConfig)
Definition: adsp.cpp:5
NTSTATUS ADSPFreeStream(_In_ PVOID _context, _In_ HANDLE Handle)
Definition: adsp.cpp:192
UINT32 ADSPStreamPosition(_In_ PVOID _context, _In_ HANDLE Handle)
Definition: adsp.cpp:355
void ADSPDisableSPIB(_In_ PVOID _context, _In_ HANDLE Handle)
Definition: adsp.cpp:334
NTSTATUS ADSPUnregisterInterrupt(_In_ PVOID _context)
Definition: adsp.cpp:76
NTSTATUS ADSPCleanupDSP(_In_ PVOID _context, _In_ HANDLE Handle)
Definition: adsp.cpp:274
void ADSPEnableSPIB(_In_ PVOID _context, _In_ HANDLE Handle, UINT32 value)
Definition: adsp.cpp:313
NTSTATUS ADSPPrepareDSP(_In_ PVOID _context, _In_ HANDLE Handle, _In_ unsigned int ByteSize, _In_ int NumBlocks, _Out_ PVOID *bdlBuf)
Definition: adsp.cpp:231
NTSTATUS ADSPGetRenderStream(_In_ PVOID _context, HDAUDIO_STREAM_FORMAT StreamFormat, PHANDLE Handle, _Out_ UINT8 *streamTag)
Definition: adsp.cpp:90
NTSTATUS ADSPRegisterInterrupt(_In_ PVOID _context, _In_ PADSP_INTERRUPT_CALLBACK callback, _In_ PVOID callbackContext)
Definition: adsp.cpp:62
NTSTATUS ADSPGetCaptureStream(_In_ PVOID _context, HDAUDIO_STREAM_FORMAT StreamFormat, PHANDLE Handle, _Out_ UINT8 *streamTag)
Definition: adsp.cpp:141
void ADSPStartStopDSP(_In_ PVOID _context, _In_ HANDLE Handle, BOOL startStop)
Definition: adsp.cpp:296
NTSTATUS ADSPSetPowerState(_In_ PVOID _context, _In_ DEVICE_POWER_STATE powerState)
Definition: adsp.cpp:44
struct _ADSP_BUS_INTERFACE ADSP_BUS_INTERFACE
PREGISTER_ADSP_INTERRUPT RegisterInterrupt
Definition: adsp.h:47
PDSP_SET_POWER_STATE SetDSPPowerState
Definition: adsp.h:46
PDSP_DISABLE_SPIB DSPDisableSPIB
Definition: adsp.h:58
PGET_ADSP_RESOURCES GetResources
Definition: adsp.h:45
PUNREGISTER_ADSP_INTERRUPT UnregisterInterrupt
Definition: adsp.h:48
PDSP_STREAM_POSITION StreamPosition
Definition: adsp.h:55
USHORT Version
Definition: adsp.h:36
PGET_STREAM GetRenderStream
Definition: adsp.h:49
PVOID Context
Definition: adsp.h:37
PDSP_ENABLE_SPIB DSPEnableSPIB
Definition: adsp.h:57
USHORT Size
Definition: adsp.h:35
PINTERFACE_REFERENCE InterfaceReference
Definition: adsp.h:38
PINTERFACE_DEREFERENCE InterfaceDereference
Definition: adsp.h:39
PDSP_CLEANUP_STREAM CleanupDSP
Definition: adsp.h:53
PDSP_PREPARE_STREAM PrepareDSP
Definition: adsp.h:52
UINT16 CtlrDevId
Definition: adsp.h:44
PGET_STREAM GetCaptureStream
Definition: adsp.h:50
PDSP_START_STOP_STREAM TriggerDSP
Definition: adsp.h:54
PFREE_STREAM FreeStream
Definition: adsp.h:51
UINT16 CtlrDevId
Definition: buspdo.h:18
CODEC_IDS CodecIds
Definition: buspdo.h:51
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
FORCEINLINE VOID NTAPI WdfDeviceInterfaceReferenceNoOp(_In_ PVOID Context)
FORCEINLINE VOID NTAPI WdfDeviceInterfaceDereferenceNoOp(_In_ PVOID Context)

Referenced by Bus_CreatePdo().

◆ ADSPCleanupDSP()

NTSTATUS ADSPCleanupDSP ( _In_ PVOID  _context,
_In_ HANDLE  Handle 
)

Definition at line 274 of file adsp.cpp.

274 {
275 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
276 if (!devData->FdoContext) {
278 }
279
281 if (!stream || stream->PdoContext != devData) {
283 }
284
285 WdfInterruptAcquireLock(devData->FdoContext->Interrupt);
286
287 stream_write32(stream, SD_BDLPL, 0);
288 stream_write32(stream, SD_BDLPU, 0);
289 stream_write32(stream, SD_CTL, 0);
290
291 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
292
293 return STATUS_SUCCESS;
294}
#define STATUS_INVALID_HANDLE
Definition: d3dkmdt.h:40
struct _HDAC_STREAM * PHDAC_STREAM
ULONG Handle
Definition: gdb_input.c:15
#define stream_write32(ctx, reg, data)
Definition: regfuncs.h:70
#define STATUS_SUCCESS
Definition: shellext.h:65
WDFINTERRUPT Interrupt
Definition: fdo.h:124
PFDO_CONTEXT FdoContext
Definition: buspdo.h:49
Definition: parse.h:23
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136

Referenced by ADSP_BusInterface().

◆ ADSPDisableSPIB()

void ADSPDisableSPIB ( _In_ PVOID  _context,
_In_ HANDLE  Handle 
)

Definition at line 334 of file adsp.cpp.

334 {
335 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
336 if (!devData->FdoContext) {
337 return;
338 }
339
341 if (!stream || stream->PdoContext != devData) {
342 return;
343 }
344
345 if (!devData->FdoContext->spbcap) {
346 return;
347 }
348
349 UINT32 mask = (1 << stream->idx);
351
352 write32(stream->spib_addr, 0);
353}
GLenum GLint GLuint mask
Definition: glext.h:6028
#define HDA_REG_SPB_SPBFCCTL
static void write32(PVOID addr, UINT32 data)
Definition: regfuncs.h:21
#define hdac_update32(addr, reg, mask, val)
Definition: regfuncs.h:74
UINT8 * spbcap
Definition: fdo.h:136
uint32_t UINT32
Definition: typedefs.h:59

Referenced by ADSP_BusInterface().

◆ ADSPEnableSPIB()

void ADSPEnableSPIB ( _In_ PVOID  _context,
_In_ HANDLE  Handle,
UINT32  value 
)

Definition at line 313 of file adsp.cpp.

313 {
314 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
315 if (!devData->FdoContext) {
316 return;
317 }
318
320 if (!stream || stream->PdoContext != devData) {
321 return;
322 }
323
324 if (!devData->FdoContext->spbcap) {
325 return;
326 }
327
328 UINT32 mask = (1 << stream->idx);
330
331 write32(stream->spib_addr, value);
332}
Definition: pdh_main.c:96

Referenced by ADSP_BusInterface().

◆ ADSPFreeStream()

NTSTATUS ADSPFreeStream ( _In_ PVOID  _context,
_In_ HANDLE  Handle 
)

Definition at line 192 of file adsp.cpp.

195 {
196 SklHdAudBusPrint(DEBUG_LEVEL_VERBOSE, DBG_IOCTL, "%s called!\n", __func__);
197
198 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
199 if (!devData->FdoContext) {
201 }
202
204 if (!stream || stream->PdoContext != devData) {
206 }
207
208 WdfInterruptAcquireLock(devData->FdoContext->Interrupt);
209
210 if (stream->running) {
211 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
213 }
214
215 PFDO_CONTEXT fdoContext = devData->FdoContext;
216 int mask = HDA_PPCTL_PROCEN(stream->idx);
217 UINT32 val = 0;
218 val = read16(fdoContext->ppcap + HDA_REG_PP_PPCTL) & mask;
219
220 if (val) {
221 hdac_update32(fdoContext->ppcap, HDA_REG_PP_PPCTL, mask, 0);
222 }
223
224 stream->PdoContext = NULL;
225 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
227
228 return STATUS_SUCCESS;
229}
#define NULL
Definition: types.h:112
#define SklHdAudBusPrint(dbglevel, fmt,...)
Definition: driver.h:111
GLuint GLfloat * val
Definition: glext.h:7180
#define HDA_REG_PP_PPCTL
#define HDA_PPCTL_PROCEN(_X_)
static UINT16 read16(PVOID addr)
Definition: regfuncs.h:9
WDFDEVICE WdfDevice
Definition: fdo.h:115
UINT8 * ppcap
Definition: fdo.h:135
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define WdfDeviceResumeIdle(Device)
Definition: wdfdevice.h:1983

Referenced by ADSP_BusInterface().

◆ ADSPGetCaptureStream()

NTSTATUS ADSPGetCaptureStream ( _In_ PVOID  _context,
HDAUDIO_STREAM_FORMAT  StreamFormat,
PHANDLE  Handle,
_Out_ UINT8 streamTag 
)

Definition at line 141 of file adsp.cpp.

141 {
142 if (!_context)
144
145 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
146 if (!devData->FdoContext) {
148 }
149
150 PFDO_CONTEXT fdoContext = devData->FdoContext;
151
153 if (!NT_SUCCESS(status)) {
154 return status;
155 }
156
157 WdfInterruptAcquireLock(devData->FdoContext->Interrupt);
158 for (UINT32 i = 0; i < fdoContext->captureStreams; i++) {
159 int tag = fdoContext->captureIndexOff + i;
160 PHDAC_STREAM stream = &fdoContext->streams[tag];
161 if (stream->PdoContext != NULL) {
162 continue;
163 }
164
165 stream->stripe = FALSE;
166 stream->PdoContext = devData;
167 stream->running = FALSE;
168 stream->streamFormat = StreamFormat;
169
170 int mask = HDA_PPCTL_PROCEN(stream->idx);
171 UINT32 val = 0;
172 val = read16(fdoContext->ppcap + HDA_REG_PP_PPCTL) & mask;
173
174 if (!val) {
176 }
177
178 if (Handle)
179 *Handle = (HANDLE)stream;
180 if (streamTag)
181 *streamTag = stream->streamTag;
182
183 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
184 return STATUS_SUCCESS;
185 }
186
187 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
190}
LONG NTSTATUS
Definition: precomp.h:26
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
UINT32 captureIndexOff
Definition: fdo.h:143
PHDAC_STREAM streams
Definition: fdo.h:149
UINT32 captureStreams
Definition: fdo.h:145
Definition: ps.c:97
Definition: ecma_167.h:138
PVOID HANDLE
Definition: typedefs.h:73
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define WdfDeviceStopIdle(Device, WaitForD0)
Definition: wdfdevice.h:1977

Referenced by ADSP_BusInterface().

◆ ADSPGetRenderStream()

NTSTATUS ADSPGetRenderStream ( _In_ PVOID  _context,
HDAUDIO_STREAM_FORMAT  StreamFormat,
PHANDLE  Handle,
_Out_ UINT8 streamTag 
)

Definition at line 90 of file adsp.cpp.

90 {
91 if (!_context)
93
94 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
95 if (!devData->FdoContext) {
97 }
98
99 PFDO_CONTEXT fdoContext = devData->FdoContext;
100
102 if (!NT_SUCCESS(status)) {
103 return status;
104 }
105
106 WdfInterruptAcquireLock(devData->FdoContext->Interrupt);
107 for (UINT32 i = 0; i < fdoContext->playbackStreams; i++) {
108 int tag = fdoContext->playbackIndexOff + i;
109 PHDAC_STREAM stream = &fdoContext->streams[tag];
110 if (stream->PdoContext != NULL) {
111 continue;
112 }
113
114 stream->stripe = FALSE;
115 stream->PdoContext = devData;
116 stream->running = FALSE;
117 stream->streamFormat = StreamFormat;
118
119 int mask = HDA_PPCTL_PROCEN(stream->idx);
120 UINT32 val = 0;
121 val = read16(fdoContext->ppcap + HDA_REG_PP_PPCTL) & mask;
122
123 if (!val) {
125 }
126
127 if (Handle)
128 *Handle = (HANDLE)stream;
129 if (streamTag)
130 *streamTag = stream->streamTag;
131
132 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
133 return STATUS_SUCCESS;
134 }
135
136 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
139}
UINT32 playbackStreams
Definition: fdo.h:146
UINT32 playbackIndexOff
Definition: fdo.h:144

Referenced by ADSP_BusInterface().

◆ ADSPGetResources()

NTSTATUS ADSPGetResources ( _In_ PVOID  _context,
_PCI_BAR hdaBar,
_PCI_BAR adspBar,
PVOID ppcap,
PNHLT_INFO  nhltInfo,
BUS_INTERFACE_STANDARD pciConfig 
)

Definition at line 5 of file adsp.cpp.

5 {
6 if (!_context)
8
9 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
10 if (!devData->FdoContext) {
12 }
13
14 if (hdaBar) {
15 *hdaBar = devData->FdoContext->m_BAR0;
16 }
17
18 if (adspBar) {
19 *adspBar = devData->FdoContext->m_BAR4;
20 }
21
22 if (ppcap) {
23 *ppcap = devData->FdoContext->ppcap;
24 }
25
26 if (nhltInfo) {
27 if (devData->FdoContext->nhlt) {
28 nhltInfo->nhlt = devData->FdoContext->nhlt;
29 nhltInfo->nhltSz = devData->FdoContext->nhltSz;
30 }
31 else if (devData->FdoContext->sofTplg) {
32 nhltInfo->nhlt = devData->FdoContext->sofTplg;
33 nhltInfo->nhltSz = devData->FdoContext->sofTplgSz;
34 }
35 }
36
37 if (pciConfig) {
38 *pciConfig = devData->FdoContext->BusInterface;
39 }
40
41 return STATUS_SUCCESS;
42}
UINT64 sofTplgSz
Definition: fdo.h:157
PVOID sofTplg
Definition: fdo.h:156
BUS_INTERFACE_STANDARD BusInterface
Definition: fdo.h:123
PCI_BAR m_BAR4
Definition: fdo.h:122
PCI_BAR m_BAR0
Definition: fdo.h:121
PVOID nhlt
Definition: fdo.h:154
UINT64 nhltSz
Definition: fdo.h:155
PVOID nhlt
Definition: adsp.h:12
UINT64 nhltSz
Definition: adsp.h:13

Referenced by ADSP_BusInterface().

◆ ADSPPrepareDSP()

NTSTATUS ADSPPrepareDSP ( _In_ PVOID  _context,
_In_ HANDLE  Handle,
_In_ unsigned int  ByteSize,
_In_ int  NumBlocks,
_Out_ PVOID bdlBuf 
)

Definition at line 231 of file adsp.cpp.

237 {
238 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
239 if (!devData->FdoContext) {
241 }
242
244 if (!stream || stream->PdoContext != devData) {
246 }
247
248 WdfInterruptAcquireLock(devData->FdoContext->Interrupt);
249
250 if (stream->running) {
251 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
252 return STATUS_DEVICE_BUSY;
253 }
254
255 WdfInterruptReleaseLock(devData->FdoContext->Interrupt);
256
257 stream->mdlBuf = NULL;
258 stream->bufSz = ByteSize;
259 stream->numBlocks = (UINT16)NumBlocks;
260
262
263 /* reset BDL address */
264 stream_write32(stream, SD_BDLPL, 0);
265 stream_write32(stream, SD_BDLPU, 0);
266
268
269 if (bdlBuf)
270 *bdlBuf = stream->bdl;
271 return STATUS_SUCCESS;
272}
unsigned short UINT16
Definition: actypes.h:129
void hdac_stream_reset(PHDAC_STREAM stream)
Definition: hdac_stream.cpp:37
void hdac_stream_setup(PHDAC_STREAM stream)
#define STATUS_DEVICE_BUSY
Definition: udferr_usr.h:129
_IRQL_requires_same_ _In_ CLONG ByteSize
Definition: rtltypes.h:412

Referenced by ADSP_BusInterface().

◆ ADSPRegisterInterrupt()

NTSTATUS ADSPRegisterInterrupt ( _In_ PVOID  _context,
_In_ PADSP_INTERRUPT_CALLBACK  callback,
_In_ PVOID  callbackContext 
)

Definition at line 62 of file adsp.cpp.

62 {
63 if (!_context)
65
66 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
67 if (!devData->FdoContext) {
69 }
70
72 devData->FdoContext->dspInterruptContext = callbackContext;
73 return STATUS_SUCCESS;
74}
static IPrintDialogCallback callback
Definition: printdlg.c:326
PVOID dspInterruptContext
Definition: fdo.h:153
PADSP_INTERRUPT_CALLBACK dspInterruptCallback
Definition: fdo.h:152

Referenced by ADSP_BusInterface().

◆ ADSPSetPowerState()

NTSTATUS ADSPSetPowerState ( _In_ PVOID  _context,
_In_ DEVICE_POWER_STATE  powerState 
)

Definition at line 44 of file adsp.cpp.

44 {
45 if (!_context)
47
48 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
49 if (!devData->FdoContext) {
51 }
52
54 if (powerState == PowerDeviceD3) {
56 } else if (powerState == PowerDeviceD0) {
58 }
59 return status;
60}
@ PowerDeviceD0
Definition: ntpoapi.h:49
@ PowerDeviceD3
Definition: ntpoapi.h:52

Referenced by ADSP_BusInterface().

◆ ADSPStartStopDSP()

void ADSPStartStopDSP ( _In_ PVOID  _context,
_In_ HANDLE  Handle,
BOOL  startStop 
)

Definition at line 296 of file adsp.cpp.

296 {
297 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
298 if (!devData->FdoContext) {
299 return;
300 }
301
303 if (!stream || stream->PdoContext != devData) {
304 return;
305 }
306
307 if (startStop)
309 else
311}
void hdac_stream_stop(PHDAC_STREAM stream)
Definition: hdac_stream.cpp:30
void hdac_stream_start(PHDAC_STREAM stream)
Definition: hdac_stream.cpp:3

Referenced by ADSP_BusInterface().

◆ ADSPStreamPosition()

UINT32 ADSPStreamPosition ( _In_ PVOID  _context,
_In_ HANDLE  Handle 
)

Definition at line 355 of file adsp.cpp.

355 {
356 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
357 if (!devData->FdoContext) {
358 return 0;
359 }
360
362 if (!stream || stream->PdoContext != devData) {
363 return 0;
364 }
365
366 return *stream->posbuf;
367}

Referenced by ADSP_BusInterface().

◆ ADSPUnregisterInterrupt()

NTSTATUS ADSPUnregisterInterrupt ( _In_ PVOID  _context)

Definition at line 76 of file adsp.cpp.

76 {
77 if (!_context)
79
80 PPDO_DEVICE_DATA devData = (PPDO_DEVICE_DATA)_context;
81 if (!devData->FdoContext) {
83 }
84
87 return STATUS_SUCCESS;
88}

Referenced by ADSP_BusInterface().