17 PVOID NotificationStruct,
50 WdfDeviceInitSetPnpPowerEventCallbacks(
DeviceInit, &pnpPowerCallbacks);
75 config.EvtChildListIdentificationDescriptionDuplicate =
83 config.EvtChildListIdentificationDescriptionCompare =
92 config.EvtChildListIdentificationDescriptionCleanup =
99 WdfFdoInitSetDefaultChildListConfig(
DeviceInit,
107 "WdfDriverCreate failed %x\n",
status);
127 WdfDeviceSetDeviceState(wdfDevice, &deviceState);
130 fdoCtx = Fdo_GetContext(wdfDevice);
155 device = FdoCtx->WdfDevice;
168 status = WdfInterruptCreate(
177 "Error creating WDF interrupt object - %!STATUS!",
188 "Error creating WDF wait lock - %!STATUS!",
199 "Error creating WDF collection - %!STATUS!",
224 fdoCtx = Fdo_GetContext(
Device);
235 for (
ULONG i = 0;
i < resourceCount;
i++)
239 pDescriptor = WdfCmResourceListGetDescriptor(
242 switch (pDescriptor->
Type)
246 if (fBar0Found ==
FALSE) {
248 "Found BAR0: 0x%llx (size 0x%lx)\n", pDescriptor->
u.
Memory.Start.QuadPart, pDescriptor->
u.
Memory.Length);
257 else if (fBar4Found ==
FALSE) {
259 "Found BAR4: 0x%llx (size 0x%lx)\n", pDescriptor->
u.
Memory.Start.QuadPart, pDescriptor->
u.
Memory.Length);
286 unsigned int cur_cap;
292#define HDAC_MAX_CAPS 10
299 "Capability version: 0x%x\n",
303 "HDA capability ID: 0x%x\n",
306 if (cur_cap == (
unsigned int)-1) {
308 "Invalid capability reg read\n");
315 "Found ML capability\n");
321 "Found GTS capability offset=%x\n",
offset);
327 "Found PP capability offset=%x\n",
offset);
334 "Found SPB capability\n");
341 "Found DRSM capability\n");
345 SklHdAudBusPrint(DEBUG_LEVEL_ERROR, DBG_INIT,
"Unknown capability %d\n", cur_cap);
353 SklHdAudBusPrint(DEBUG_LEVEL_ERROR, DBG_INIT,
"We exceeded HDAC capabilities!!!\n");
393 UINT8 streamTags[2] = { 0, 0 };
403 UINT8 tag = ++streamTags[isCapture];
409 stream->FdoContext = fdoCtx;
434 "Stream tag (idx %d): %d\n",
i,
tag);
453 if (nhltAddr != 0 && nhltSz != 0) {
493 fdoCtx = Fdo_GetContext(
Device);
567 fdoCtx = Fdo_GetContext(
Device);
577 val =
val & ~INTEL_HDA_CGCTL_MISCBDCGE;
610 "hda bus initialized\n");
628 fdoCtx = Fdo_GetContext(
Device);
647 SklHdAudBusPrint(DEBUG_LEVEL_ERROR, DBG_INIT,
"Warning: Failed to wake up codec %d: 0x%x",
addr, status2);
668 fdoCtx = Fdo_GetContext(
Device);
687 ULONG funcType = 0, vendorDevice, subsysId, revId, nodeCount;
700 UINT8 startID = (nodeCount >> 16) & 0xFF;
701 nodeCount = (nodeCount & 0x7FFF);
712 switch (funcType & 0xFF) {
745 description.CodecIds.FunctionGroupStartNode = startID;
750 description.CodecIds.VenId = (vendorDevice >> 16) & 0xFFFF;
751 description.CodecIds.DevId = vendorDevice & 0xFFFF;
753 description.CodecIds.RevId = (revId >> 8) & 0xFFFF;
766 WdfChildListAddOrUpdateChildDescriptionAsPresent(
780 fdoCtx = Fdo_GetContext(
Device);
782 WdfChildListBeginScan(WdfFdoGetDefaultChildList(
Device));
801 (
PVOID)&GUID_DEVINTERFACE_GRAPHICSPOWER,
802 WdfDriverWdmGetDriverObject(WdfDeviceGetDriver(fdoCtx->
WdfDevice)),
805 &fdoCtx->GraphicsNotificationHandle
841 status = WdfChildListAddOrUpdateChildDescriptionAsPresent(
846 WdfChildListEndScan(WdfFdoGetDefaultChildList(
Device));
849 "hda scan complete\n");
#define ExAllocatePoolUninitialized
COMPILER_DEPENDENT_UINT64 UINT64
BOOLEAN NTAPI Bus_EvtChildListIdentificationDescriptionCompare(WDFCHILDLIST DeviceList, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER FirstIdentificationDescription, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER SecondIdentificationDescription)
VOID NTAPI Bus_EvtChildListIdentificationDescriptionCleanup(_In_ WDFCHILDLIST DeviceList, _Inout_ PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER IdentificationDescription)
NTSTATUS NTAPI Bus_EvtDeviceListCreatePdo(WDFCHILDLIST DeviceList, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER IdentificationDescription, PWDFDEVICE_INIT ChildInit)
NTSTATUS NTAPI Bus_EvtChildListIdentificationDescriptionDuplicate(WDFCHILDLIST DeviceList, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER SourceIdentificationDescription, PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER DestinationIdentificationDescription)
PVOID NTAPI MmAllocateContiguousMemory(IN SIZE_T NumberOfBytes, IN PHYSICAL_ADDRESS HighestAcceptableAddress)
VOID NTAPI MmFreeContiguousMemory(IN PVOID BaseAddress)
#define NT_SUCCESS(StatCode)
#define SKLHDAUDBUS_POOL_TAG
#define SklHdAudBusPrint(dbglevel, fmt,...)
#define KeInitializeEvent(pEvt, foo, foo2)
struct _HDAC_STREAM * PHDAC_STREAM
struct _HDAC_BDLENTRY * PHDAC_BDLENTRY
GLenum const GLvoid * addr
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
#define NVIDIA_HDA_OSTRM_COH
#define NVIDIA_HDA_ENABLE_COHBIT
#define NVIDIA_HDA_ISTRM_COH
#define HDA_CAP_HDR_NXT_PTR_MASK
#define INTEL_HDA_CGCTL_MISCBDCGE
#define ATI_SB450_HDAUDIO_ENABLE_SNOOP
#define ATI_SB450_HDAUDIO_MISC_CNTR2_ADDR
#define HDA_CAP_HDR_VER_OFF
#define HDA_CAP_HDR_ID_OFF
#define NVIDIA_HDA_TRANSREG_ADDR
#define HDA_CAP_HDR_VER_MASK
#define HDA_CAP_HDR_ID_MASK
#define AC_VERB_GET_SUBSYSTEM_ID
#define AC_PAR_NODE_COUNT
#define AC_PAR_FUNCTION_TYPE
#define AC_VERB_PARAMETERS
void NTAPI hda_dpc(WDFINTERRUPT Interrupt, WDFOBJECT AssociatedObject)
NTSTATUS GetHDACapabilities(PFDO_CONTEXT fdoCtx)
NTSTATUS StopHDAController(PFDO_CONTEXT fdoCtx)
NTSTATUS RunSingleHDACmd(PFDO_CONTEXT fdoCtx, ULONG val, ULONG *res)
BOOLEAN NTAPI hda_interrupt(WDFINTERRUPT Interrupt, ULONG MessageID)
NTSTATUS StartHDAController(PFDO_CONTEXT fdoCtx)
NTSTATUS NTAPI Fdo_Initialize(_In_ PFDO_CONTEXT FdoCtx)
EVT_WDF_DEVICE_RELEASE_HARDWARE Fdo_EvtDeviceReleaseHardware
NTSTATUS NTAPI Fdo_Create(_Inout_ PWDFDEVICE_INIT DeviceInit)
EVT_WDF_DEVICE_SELF_MANAGED_IO_INIT Fdo_EvtDeviceSelfManagedIoInit
EVT_WDF_DEVICE_PREPARE_HARDWARE Fdo_EvtDevicePrepareHardware
void CheckHDAGraphicsRegistryKeys(PFDO_CONTEXT fdoCtx)
NTSTATUS NTAPI HDAGraphicsPowerInterfaceCallback(PVOID NotificationStruct, PVOID Context)
void NTAPI Fdo_EnumerateCodec(PFDO_CONTEXT fdoCtx, UINT8 addr)
EVT_WDF_DEVICE_D0_ENTRY Fdo_EvtDeviceD0Entry
EVT_WDF_DEVICE_D0_EXIT Fdo_EvtDeviceD0Exit
EVT_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED Fdo_EvtDeviceD0EntryPostInterrupts
VOID NTAPI MmUnmapIoSpace(IN PVOID BaseAddress, IN SIZE_T NumberOfBytes)
PVOID NTAPI MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
#define ExFreePoolWithTag(_P, _T)
FORCEINLINE PVOID ExAllocatePoolZero(ULONG PoolType, SIZE_T NumberOfBytes, ULONG Tag)
NTSTATUS NHLTCheckSupported(_In_ WDFDEVICE FxDevice)
NTSTATUS NHLTQueryTableAddress(_In_ WDFDEVICE FxDevice, UINT64 *nhltAddr, UINT64 *nhltSz)
#define UNREFERENCED_PARAMETER(P)
NTSTATUS NTAPI IoRegisterPlugPlayNotification(_In_ IO_NOTIFICATION_EVENT_CATEGORY EventCategory, _In_ ULONG EventCategoryFlags, _In_opt_ PVOID EventCategoryData, _In_ PDRIVER_OBJECT DriverObject, _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, _Inout_opt_ PVOID Context, _Out_ PVOID *NotificationEntry)
NTSTATUS NTAPI IoUnregisterPlugPlayNotification(_In_ PVOID NotificationEntry)
static void pci_write_cfg_dword(PBUS_INTERFACE_STANDARD pciInterface, UINT reg, UINT32 data)
#define hda_update32(ctx, reg, mask, val)
#define hda_read16(ctx, reg)
static void pci_read_cfg_dword(PBUS_INTERFACE_STANDARD pciInterface, UINT reg, UINT32 *data)
static UINT32 read32(PVOID addr)
static void update_pci_byte(PBUS_INTERFACE_STANDARD pciInterface, UINT reg, BYTE mask, BYTE val)
#define CmResourceTypeMemory
NTSTATUS GetSOFTplg(_In_ WDFDEVICE FxDevice, SOF_TPLG *sofTplg)
PGET_SET_DEVICE_DATA GetBusData
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@382::@387 Memory
PVOID GraphicsNotificationHandle
struct _PDO_DEVICE_DATA * codecs[HDA_MAX_CODECS]
ULONG GraphicsCodecAddress
WDFCOLLECTION GraphicsDevicesCollection
BUS_INTERFACE_STANDARD BusInterface
PADSP_INTERRUPT_CALLBACK dspInterruptCallback
DXGK_GRAPHICSPOWER_REGISTER_OUTPUT graphicsPowerRegisterOutput
KEVENT xferEvent[HDA_MAX_CODECS]
WDF_TRI_STATE NotDisableable
PFN_WDF_DEVICE_D0_ENTRY EvtDeviceD0Entry
PFN_WDF_DEVICE_SELF_MANAGED_IO_INIT EvtDeviceSelfManagedIoInit
PFN_WDF_DEVICE_D0_EXIT EvtDeviceD0Exit
PFN_WDF_DEVICE_PREPARE_HARDWARE EvtDevicePrepareHardware
PFN_WDF_DEVICE_D0_ENTRY_POST_INTERRUPTS_ENABLED EvtDeviceD0EntryPostInterruptsEnabled
PFN_WDF_DEVICE_RELEASE_HARDWARE EvtDeviceReleaseHardware
#define FIELD_OFFSET(t, f)
#define RtlCopyMemory(Destination, Source, Length)
#define RtlZeroMemory(Destination, Length)
FORCEINLINE VOID WDF_CHILD_LIST_CONFIG_INIT(_Out_ PWDF_CHILD_LIST_CONFIG Config, _In_ ULONG IdentificationDescriptionSize, _In_ PFN_WDF_CHILD_LIST_CREATE_DEVICE EvtChildListCreateDevice)
_Must_inspect_result_ _In_ WDFDEVICE Device
FORCEINLINE VOID WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER_INIT(_Out_ PWDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER Header, _In_ ULONG IdentificationDescriptionSize)
_In_ PWDFDEVICE_INIT DeviceInit
_In_ WDF_POWER_DEVICE_STATE PreviousState
FORCEINLINE VOID WDF_DEVICE_STATE_INIT(_Out_ PWDF_DEVICE_STATE PnpDeviceState)
enum _WDF_POWER_DEVICE_STATE WDF_POWER_DEVICE_STATE
_In_ WDFCMRESLIST _In_ WDFCMRESLIST ResourcesTranslated
FORCEINLINE VOID WDF_PNPPOWER_EVENT_CALLBACKS_INIT(_Out_ PWDF_PNPPOWER_EVENT_CALLBACKS Callbacks)
_In_ WDF_POWER_DEVICE_STATE TargetState
_In_ WDFCMRESLIST ResourcesRaw
FORCEINLINE VOID WDF_INTERRUPT_CONFIG_INIT(_Out_ PWDF_INTERRUPT_CONFIG Configuration, _In_ PFN_WDF_INTERRUPT_ISR EvtInterruptIsr, _In_opt_ PFN_WDF_INTERRUPT_DPC EvtInterruptDpc)
#define WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(_attributes, _contexttype)
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
#define WDF_NO_OBJECT_ATTRIBUTES
#define PCI_BUS_INTERFACE_STANDARD_VERSION
#define PCI_WHICHSPACE_CONFIG
@ EventCategoryDeviceInterfaceChange
_In_ USHORT _In_ UCHAR RevisionID
#define PNPNOTIFY_DEVICE_INTERFACE_INCLUDE_EXISTING_INTERFACES