ReactOS 0.4.16-dev-2293-g4d8327b
fdo.h File Reference
#include "adsp.h"
Include dependency graph for fdo.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

union  baseaddr
 
struct  _PCI_BAR
 
struct  _HDAC_STREAM_CALLBACK
 
struct  _HDAC_ISR_CALLBACK
 
struct  _HDAC_BDLENTRY
 
struct  _HDAC_STREAM
 
struct  _HDAC_RIRB
 
struct  _HDAC_CODEC_XFER
 
struct  _HDAC_RB
 
struct  _GRAPHICSWORKITEM_CONTEXT
 
struct  _GRAPHICSIOTARGET_CONTEXT
 
struct  _FDO_CONTEXT
 

Macros

#define HDA_UNSOL_QUEUE_SIZE   64
 
#define MAX_NOTIF_EVENTS   16
 
#define HDA_MAX_CODECS   16 /* limit by controller side */
 

Typedefs

typedef struct _PCI_BAR PCI_BAR
 
typedef struct _PCI_BARPPCI_BAR
 
typedef struct _HDAC_STREAM_CALLBACK HDAC_STREAM_CALLBACK
 
typedef struct _HDAC_STREAM_CALLBACKPHDAC_STREAM_CALLBACK
 
typedef struct _HDAC_ISR_CALLBACK HDAC_ISR_CALLBACK
 
typedef struct _HDAC_ISR_CALLBACKPHDAC_ISR_CALLBACK
 
typedef struct _HDAC_BDLENTRY HDAC_BDLENTRY
 
typedef struct _HDAC_BDLENTRYPHDAC_BDLENTRY
 
typedef struct _HDAC_STREAM HDAC_STREAM
 
typedef struct _HDAC_STREAMPHDAC_STREAM
 
typedef struct _HDAC_RIRB HDAC_RIRB
 
typedef struct _HDAC_RIRBPHDAC_RIRB
 
typedef struct _HDAC_CODEC_XFER HDAC_CODEC_XFER
 
typedef struct _HDAC_CODEC_XFERPHDAC_CODEC_XFER
 
typedef struct _HDAC_RB HDAC_RB
 
typedef struct _HDAC_RBPHDAC_RB
 
typedef struct _GRAPHICSWORKITEM_CONTEXT GRAPHICSWORKITEM_CONTEXT
 
typedef struct _GRAPHICSWORKITEM_CONTEXTPGRAPHICSWORKITEM_CONTEXT
 
typedef struct _GRAPHICSIOTARGET_CONTEXT GRAPHICSIOTARGET_CONTEXT
 
typedef struct _GRAPHICSIOTARGET_CONTEXTPGRAPHICSIOTARGET_CONTEXT
 
typedef struct _FDO_CONTEXT FDO_CONTEXT
 
typedef struct _FDO_CONTEXTPFDO_CONTEXT
 

Functions

NTSTATUS NTAPI Fdo_Create (_Inout_ PWDFDEVICE_INIT DeviceInit)
 

Macro Definition Documentation

◆ HDA_MAX_CODECS

#define HDA_MAX_CODECS   16 /* limit by controller side */

Definition at line 18 of file fdo.h.

◆ HDA_UNSOL_QUEUE_SIZE

#define HDA_UNSOL_QUEUE_SIZE   64

Definition at line 16 of file fdo.h.

◆ MAX_NOTIF_EVENTS

#define MAX_NOTIF_EVENTS   16

Definition at line 17 of file fdo.h.

Typedef Documentation

◆ FDO_CONTEXT

◆ GRAPHICSIOTARGET_CONTEXT

◆ GRAPHICSWORKITEM_CONTEXT

◆ HDAC_BDLENTRY

◆ HDAC_CODEC_XFER

◆ HDAC_ISR_CALLBACK

◆ HDAC_RB

◆ HDAC_RIRB

◆ HDAC_STREAM

◆ HDAC_STREAM_CALLBACK

◆ PCI_BAR

◆ PFDO_CONTEXT

◆ PGRAPHICSIOTARGET_CONTEXT

◆ PGRAPHICSWORKITEM_CONTEXT

◆ PHDAC_BDLENTRY

◆ PHDAC_CODEC_XFER

◆ PHDAC_ISR_CALLBACK

◆ PHDAC_RB

◆ PHDAC_RIRB

◆ PHDAC_STREAM

◆ PHDAC_STREAM_CALLBACK

◆ PPCI_BAR

Function Documentation

◆ Fdo_Create()

NTSTATUS NTAPI Fdo_Create ( _Inout_ PWDFDEVICE_INIT  DeviceInit)

Definition at line 29 of file fdo.cpp.

32{
34 WDF_OBJECT_ATTRIBUTES attributes;
35 WDF_PNPPOWER_EVENT_CALLBACKS pnpPowerCallbacks;
36 PFDO_CONTEXT fdoCtx;
37 WDFDEVICE wdfDevice;
39
40 SklHdAudBusPrint(DEBUG_LEVEL_INFO, DBG_INIT,
41 "%s\n", __func__);
42
43 WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&pnpPowerCallbacks);
46 pnpPowerCallbacks.EvtDeviceD0Entry = Fdo_EvtDeviceD0Entry;
48 pnpPowerCallbacks.EvtDeviceD0Exit = Fdo_EvtDeviceD0Exit;
50 WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &pnpPowerCallbacks);
51
52 //
53 // WDF_ DEVICE_LIST_CONFIG describes how the framework should handle
54 // dynamic child enumeration on behalf of the driver writer.
55 // Since we are a bus driver, we need to specify identification description
56 // for our child devices. This description will serve as the identity of our
57 // child device. Since the description is opaque to the framework, we
58 // have to provide bunch of callbacks to compare, copy, or free
59 // any other resources associated with the description.
60 //
63 Bus_EvtDeviceListCreatePdo // callback to create a child device.
64 );
65
66 //
67 // This function pointer will be called when the framework needs to copy a
68 // identification description from one location to another. An implementation
69 // of this function is only necessary if the description contains description
70 // relative pointer values (like LIST_ENTRY for instance) .
71 // If set to NULL, the framework will use RtlCopyMemory to copy an identification .
72 // description. In this sample, it's not required to provide these callbacks.
73 // they are added just for illustration.
74 //
75 config.EvtChildListIdentificationDescriptionDuplicate =
77
78 //
79 // This function pointer will be called when the framework needs to compare
80 // two identificaiton descriptions. If left NULL a call to RtlCompareMemory
81 // will be used to compare two identificaiton descriptions.
82 //
83 config.EvtChildListIdentificationDescriptionCompare =
85 //
86 // This function pointer will be called when the framework needs to free a
87 // identification description. An implementation of this function is only
88 // necessary if the description contains dynamically allocated memory
89 // (by the driver writer) that needs to be freed. The actual identification
90 // description pointer itself will be freed by the framework.
91 //
92 config.EvtChildListIdentificationDescriptionCleanup =
94
95 //
96 // Tell the framework to use the built-in childlist to track the state
97 // of the device based on the configuration we just created.
98 //
99 WdfFdoInitSetDefaultChildListConfig(DeviceInit,
100 &config,
102
104 status = WdfDeviceCreate(&DeviceInit, &attributes, &wdfDevice);
105 if (!NT_SUCCESS(status)) {
106 SklHdAudBusPrint(DEBUG_LEVEL_ERROR, DBG_INIT,
107 "WdfDriverCreate failed %x\n", status);
108 goto Exit;
109 }
110
111 /*{
112 WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS IdleSettings;
113
114 WDF_DEVICE_POWER_POLICY_IDLE_SETTINGS_INIT(&IdleSettings, IdleCannotWakeFromS0);
115 IdleSettings.IdleTimeoutType = SystemManagedIdleTimeoutWithHint;
116 IdleSettings.IdleTimeout = 1000;
117 IdleSettings.UserControlOfIdleSettings = IdleDoNotAllowUserControl;
118
119 WdfDeviceAssignS0IdleSettings(wdfDevice, &IdleSettings);
120 }*/
121
122 {
123 WDF_DEVICE_STATE deviceState;
124 WDF_DEVICE_STATE_INIT(&deviceState);
125
126 deviceState.NotDisableable = WdfFalse;
127 WdfDeviceSetDeviceState(wdfDevice, &deviceState);
128 }
129
130 fdoCtx = Fdo_GetContext(wdfDevice);
131 fdoCtx->WdfDevice = wdfDevice;
132
133 status = Fdo_Initialize(fdoCtx);
134 if (!NT_SUCCESS(status))
135 {
136 goto Exit;
137 }
138
140
141Exit:
142 return status;
143}
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI Bus_EvtChildListIdentificationDescriptionCompare(WDFCHILDLIST DeviceList, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER FirstIdentificationDescription, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER SecondIdentificationDescription)
Definition: buspdo.cpp:60
VOID NTAPI Bus_EvtChildListIdentificationDescriptionCleanup(_In_ WDFCHILDLIST DeviceList, _Inout_ PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER IdentificationDescription)
Definition: buspdo.cpp:100
NTSTATUS NTAPI Bus_EvtDeviceListCreatePdo(WDFCHILDLIST DeviceList, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER IdentificationDescription, PWDFDEVICE_INIT ChildInit)
Definition: buspdo.cpp:121
NTSTATUS NTAPI Bus_EvtChildListIdentificationDescriptionDuplicate(WDFCHILDLIST DeviceList, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER SourceIdentificationDescription, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER DestinationIdentificationDescription)
Definition: buspdo.cpp:13
struct config_s config
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define SklHdAudBusPrint(dbglevel, fmt,...)
Definition: driver.h:111
NTSTATUS NTAPI Fdo_Initialize(_In_ PFDO_CONTEXT FdoCtx)
Definition: fdo.cpp:147
EVT_WDF_DEVICE_RELEASE_HARDWARE Fdo_EvtDeviceReleaseHardware
Definition: fdo.cpp:6
EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT Fdo_EvtDeviceSelfManagedIoInit
Definition: fdo.cpp:10
EVT_WDF_DEVICE_PREPARE_HARDWARE Fdo_EvtDevicePrepareHardware
Definition: fdo.cpp:5
void CheckHDAGraphicsRegistryKeys(PFDO_CONTEXT fdoCtx)
Definition: sgpc.cpp:313
EVT_WDF_DEVICE_D0_ENTRY Fdo_EvtDeviceD0Entry
Definition: fdo.cpp:7
EVT_WDF_DEVICE_D0_EXIT Fdo_EvtDeviceD0Exit
Definition: fdo.cpp:9
EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED Fdo_EvtDeviceD0EntryPostInterrupts
Definition: fdo.cpp:8
static void Exit(void)
Definition: sock.c:1330
WDFDEVICE WdfDevice
Definition: fdo.h:115
WDF_TRI_STATE NotDisableable
Definition: wdfdevice.h:1477
PFN_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry
Definition: wdfdevice.h:1164
PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT EvtDeviceSelfManagedIoInit
Definition: wdfdevice.h:1172
PFN_WDF_DEVICE_D0_EXIT EvtDeviceD0Exit
Definition: wdfdevice.h:1166
PFN_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware
Definition: wdfdevice.h:1168
PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED EvtDeviceD0EntryPostInterruptsEnabled
Definition: wdfdevice.h:1165
PFN_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware
Definition: wdfdevice.h:1169
Definition: ps.c:97
FORCEINLINE VOID WDF_CHILD_LIST_CONFIG_INIT(_Out_ PWDF_CHILD_LIST_CONFIG Config, _In_ ULONG IdentificationDescriptionSize, _In_ PFN_WDF_CHILD_LIST_CREATE_DEVICE EvtChildListCreateDevice)
Definition: wdfchildlist.h:415
_In_ PWDFDEVICE_INIT DeviceInit
Definition: wdfcontrol.h:113
FORCEINLINE VOID WDF_DEVICE_STATE_INIT(_Out_ PWDF_DEVICE_STATE PnpDeviceState)
Definition: wdfdevice.h:1496
FORCEINLINE VOID WDF_PNPPOWER_EVENT_CALLBACKS_INIT(_Out_ PWDF_PNPPOWER_EVENT_CALLBACKS Callbacks)
Definition: wdfdevice.h:1214
#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype)
Definition: wdfobject.h:170
@ WdfFalse
Definition: wdftypes.h:87
#define WDF_NO_OBJECT_ATTRIBUTES
Definition: wdftypes.h:105

Referenced by SklHdAudBusEvtDeviceAdd().