ReactOS 0.4.15-dev-5666-gc548b97
CAC97AdapterCommon Class Reference

#include <common.h>

Inheritance diagram for CAC97AdapterCommon:
Collaboration diagram for CAC97AdapterCommon:

Public Member Functions

 DECLARE_STD_UNKNOWN ()
 
 DEFINE_STD_CONSTRUCTOR (CAC97AdapterCommon)
 
 ~CAC97AdapterCommon ()
 
 STDMETHODIMP_ (NTSTATUS) Init(IN PRESOURCELIST ResourceList
 
 STDMETHODIMP_ (BOOL) GetPinConfig(IN TopoPinConfig pin)
 
 STDMETHODIMP_ (void) SetPinConfig(IN TopoPinConfig pin
 
 STDMETHODIMP_ (BOOL) GetNodeConfig(IN TopoNodeConfig node)
 
 STDMETHODIMP_ (void) SetNodeConfig(IN TopoNodeConfig node
 
 STDMETHODIMP_ (AC97Register) GetNodeReg(IN TopoNodes node)
 
 STDMETHODIMP_ (WORD) GetNodeMask(IN TopoNodes node)
 
 STDMETHODIMP_ (NTSTATUS) ReadCodecRegister(_In_range_(0
 
 STDMETHODIMP_ (NTSTATUS) WriteCodecRegister(_In_range_(0
 
 STDMETHODIMP_ (UCHAR) ReadBMControlRegister8(IN ULONG ulOffset)
 
 STDMETHODIMP_ (USHORT) ReadBMControlRegister16(IN ULONG ulOffset)
 
 STDMETHODIMP_ (ULONG) ReadBMControlRegister32(IN ULONG ulOffset)
 
 STDMETHODIMP_ (void) WriteBMControlRegister(IN ULONG ulOffset
 
 STDMETHODIMP_ (void) WriteBMControlRegister(IN ULONG ulOffset
 
 STDMETHODIMP_ (void) WriteBMControlRegister(IN ULONG ulOffset
 
 STDMETHODIMP_ (NTSTATUS) RestoreCodecRegisters()
 
 STDMETHODIMP_ (NTSTATUS) ProgramSampleRate(IN AC97Register Register
 
 STDMETHODIMP_ (void) SetMiniportTopology(PAC97MINIPORTTOPOLOGY topo)
 
 STDMETHODIMP_ (PAC97MINIPORTTOPOLOGY) GetMiniportTopology(void)
 
 STDMETHODIMP_ (void) ReadChannelConfigDefault(PDWORD pdwChannelConfig
 
 STDMETHODIMP_ (void) WriteChannelConfigDefault(DWORD dwChannelConfig)
 

Public Attributes

 IMP_IAdapterPowerManagement
 
IN PDEVICE_OBJECT DeviceObject
 
IN BOOL config
 
AC97REG_INVALID AC97Register Register
 
AC97REG_INVALID AC97Register _Out_ PWORD wData
 
AC97REG_INVALID AC97Register _In_ WORD wData
 
AC97REG_INVALID AC97Register _In_ WORD _In_ WORD wMask
 
IN UCHAR Value
 
IN USHORT Value
 
IN ULONG Value
 
IN DWORD dwSampleRate
 
PWORD pwChannels
 
- Public Attributes inherited from CUnknown
union {
   IUnknown   IUnknown
 
   INonDelegatingUnknown   INonDelegatingUnknown
 
}; 
 
LONG m_ref_count
 
PUNKNOWN m_outer_unknown
 

Private Member Functions

NTSTATUS InitAC97 (void)
 
NTSTATUS ProbeHWConfig (void)
 
NTSTATUS Check6thBitSupport (IN AC97Register, IN TopoNodeConfig)
 
BOOL DisableAC97Pin (IN TopoPinConfig)
 
NTSTATUS SetAC97Default (void)
 
NTSTATUS AcquireCodecSemiphore (void)
 
NTSTATUS PrimaryCodecReady (void)
 
NTSTATUS PowerUpCodec (void)
 
NTSTATUS ReadNABMCtrlRegs (void)
 
NTSTATUS RestoreNABMCtrlRegs (void)
 

Private Attributes

PDEVICE_OBJECT m_pDeviceObject
 
PWORD m_pCodecBase
 
PUCHAR m_pBusMasterBase
 
BOOL m_bDirectRead
 
DEVICE_POWER_STATE m_PowerState
 
PAC97MINIPORTTOPOLOGY m_Topology
 

Static Private Attributes

static tAC97Registers m_stAC97Registers [64]
 
static tHardwareConfig m_stHardwareConfig
 

Friends

NTSTATUS NewAdapterCommon (OUT PADAPTERCOMMON *OutAdapterCommon, IN PRESOURCELIST ResourceList)
 

Detailed Description

Definition at line 87 of file common.h.

Constructor & Destructor Documentation

◆ ~CAC97AdapterCommon()

CAC97AdapterCommon::~CAC97AdapterCommon ( )

Definition at line 235 of file common.cpp.

236{
237 PAGED_CODE ();
238
239 DOUT (DBG_PRINT, ("[CAC97AdapterCommon::~CAC97AdapterCommon]"));
240}
#define PAGED_CODE()
#define DOUT(lvl, strings)
Definition: debug.h:82
#define DBG_PRINT(ppi, ch, level)
Definition: win32kdebug.h:168

Member Function Documentation

◆ AcquireCodecSemiphore()

NTSTATUS CAC97AdapterCommon::AcquireCodecSemiphore ( void  )
private

Definition at line 1062 of file common.cpp.

1063{
1064 PAGED_CODE ();
1065
1066 DOUT (DBG_PRINT, ("[CAC97AdapterCommon::AcquireCodecSemiphore]"));
1067
1068 ULONG ulCount = 0;
1070 {
1071 //
1072 // Do we want to give up??
1073 //
1074 if (ulCount++ > 100)
1075 {
1076 DOUT (DBG_ERROR, ("Cannot acquire semaphore."));
1077 return STATUS_IO_TIMEOUT;
1078 }
1079
1080 //
1081 // Let's wait a little, 40us and then try again.
1082 //
1084 }
1085
1086 return STATUS_SUCCESS;
1087}
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:81
PUCHAR m_pBusMasterBase
Definition: common.h:96
const UCHAR CAS_CAS
Definition: ichreg.h:93
const ULONG CAS
Definition: ichreg.h:44
unsigned int ULONG
Definition: retypes.h:1
#define DBG_ERROR
Definition: nfs41_debug.h:78
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22
#define STATUS_SUCCESS
Definition: shellext.h:65
#define STATUS_IO_TIMEOUT
Definition: udferr_usr.h:163

◆ Check6thBitSupport()

NTSTATUS CAC97AdapterCommon::Check6thBitSupport ( IN AC97Register  AC97Reg,
IN TopoNodeConfig  Config 
)
private

Definition at line 576 of file common.cpp.

581{
582 PAGED_CODE();
583
584 NTSTATUS ntStatus;
585 WORD wCodecReg;
586 WORD wOriginal;
587
588 // Read the current value.
589 ntStatus = ReadCodecRegister (AC97Reg, &wOriginal);
590 if (!NT_SUCCESS (ntStatus))
591 return ntStatus;
592
593 // Write the 6th bit; for mono controls we write 0x20, for stereo
594 // controls 0x2020.
595 ntStatus = WriteCodecRegister (AC97Reg,
596 (AC97Reg == AC97REG_MMONO_VOLUME) ? 0x0020 : 0x2020, 0xFFFF);
597 if (!NT_SUCCESS (ntStatus))
598 return ntStatus;
599
600 // And read back.
601 ntStatus = ReadCodecRegister (AC97Reg, &wCodecReg);
602 if (!NT_SUCCESS (ntStatus))
603 return ntStatus;
604
605 // Check return. For mono 0x20 and for stereo 0x2020.
606 if (((wCodecReg & 0x0020) && (AC97Reg == AC97REG_MMONO_VOLUME)) ||
607 (wCodecReg & 0x2020))
608 {
609 SetNodeConfig (Config, TRUE);
610 }
611 else
612 {
613 SetNodeConfig (Config, FALSE);
614 }
615
616 // Restore original value.
617 WriteCodecRegister (AC97Reg, wOriginal, 0xFFFF);
618
619 return ntStatus;
620}
@ AC97REG_MMONO_VOLUME
Definition: ac97reg.h:21
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:32
unsigned short WORD
Definition: ntddk_ex.h:93
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
Definition: wdfchildlist.h:476

Referenced by ProbeHWConfig().

◆ DECLARE_STD_UNKNOWN()

CAC97AdapterCommon::DECLARE_STD_UNKNOWN ( )

◆ DEFINE_STD_CONSTRUCTOR()

CAC97AdapterCommon::DEFINE_STD_CONSTRUCTOR ( CAC97AdapterCommon  )

◆ DisableAC97Pin()

BOOL CAC97AdapterCommon::DisableAC97Pin ( IN TopoPinConfig  pin)
private

Definition at line 1879 of file common.cpp.

1883{
1884 PAGED_CODE ();
1885
1886 PREGISTRYKEY DriverKey;
1887 PREGISTRYKEY SettingsKey;
1888 UNICODE_STRING sKeyName;
1889 ULONG ulDisposition;
1890 ULONG ulResultLength;
1891 PVOID KeyInfo = NULL;
1892 BOOL bDisable = FALSE;
1893
1894 DOUT (DBG_PRINT, ("[CAC97AdapterCommon::DisableAC97Pin]"));
1895
1896 // open the driver registry key
1897 NTSTATUS ntStatus = PcNewRegistryKey (&DriverKey, // IRegistryKey
1898 NULL, // OuterUnknown
1899 DriverRegistryKey, // Registry key type
1900 KEY_READ, // Access flags
1901 m_pDeviceObject, // Device object
1902 NULL, // Subdevice
1903 NULL, // ObjectAttributes
1904 0, // Create options
1905 NULL); // Disposition
1906 if (NT_SUCCESS (ntStatus))
1907 {
1908 // make a unicode string for the subkey name
1909 RtlInitUnicodeString (&sKeyName, L"Settings");
1910
1911 // open the settings subkey
1912 ntStatus = DriverKey->NewSubKey (&SettingsKey, // Subkey
1913 NULL, // OuterUnknown
1914 KEY_READ, // Access flags
1915 &sKeyName, // Subkey name
1916 REG_OPTION_NON_VOLATILE, // Create options
1917 &ulDisposition);
1918
1919 if (NT_SUCCESS (ntStatus))
1920 {
1921 // allocate data to hold key info
1924 sizeof(BYTE), PoolTag);
1925 if (NULL != KeyInfo)
1926 {
1927 // init key name
1929 Pins[pin].sRegistryName);
1930
1931 // query the value key
1932 ntStatus = SettingsKey->QueryValueKey (&sKeyName,
1934 KeyInfo,
1936 sizeof(BYTE),
1937 &ulResultLength );
1938 if (NT_SUCCESS (ntStatus))
1939 {
1940 PKEY_VALUE_PARTIAL_INFORMATION PartialInfo =
1942
1943 if (PartialInfo->DataLength == sizeof(BYTE))
1944 {
1945 // store the value
1946 if (*(PBYTE)PartialInfo->Data)
1947 bDisable = TRUE;
1948 else
1949 bDisable = FALSE;
1950 }
1951 }
1952
1953 // free the key info
1954 ExFreePoolWithTag (KeyInfo,PoolTag);
1955 }
1956
1957 // release the settings key
1958 SettingsKey->Release ();
1959 }
1960
1961 // release the driver key
1962 DriverKey->Release ();
1963 }
1964
1965 // if one of the stuff above fails we return the default, which is FALSE.
1966 return bDisable;
1967}
static tHardwareConfig m_stHardwareConfig
Definition: common.h:93
PDEVICE_OBJECT m_pDeviceObject
Definition: common.h:94
#define NULL
Definition: types.h:112
NTSTATUS NTAPI PcNewRegistryKey(OUT PREGISTRYKEY *OutRegistryKey, IN PUNKNOWN OuterUnknown OPTIONAL, IN ULONG RegistryKeyType, IN ACCESS_MASK DesiredAccess, IN PVOID DeviceObject OPTIONAL, IN PVOID SubDevice OPTIONAL, IN POBJECT_ATTRIBUTES ObjectAttributes OPTIONAL, IN ULONG CreateOptions OPTIONAL, OUT PULONG Disposition OPTIONAL)
Definition: registry.cpp:268
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
unsigned int BOOL
Definition: ntddk_ex.h:94
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099
@ KeyValuePartialInformation
Definition: nt_native.h:1182
#define KEY_READ
Definition: nt_native.h:1023
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
#define REG_OPTION_NON_VOLATILE
Definition: nt_native.h:1057
struct _KEY_VALUE_PARTIAL_INFORMATION * PKEY_VALUE_PARTIAL_INFORMATION
#define L(x)
Definition: ntvdm.h:50
BYTE * PBYTE
Definition: pedump.c:66
IRegistryKey * PREGISTRYKEY
Definition: portcls.h:1009
@ DriverRegistryKey
Definition: portcls.h:902
Definition: regsvr.c:104
PWCHAR sRegistryName
Definition: common.h:35
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ _Strict_type_match_ POOL_TYPE _In_opt_ ULONG PoolTag
Definition: wdfmemory.h:164
unsigned char BYTE
Definition: xxhash.c:193

Referenced by ProbeHWConfig().

◆ InitAC97()

NTSTATUS CAC97AdapterCommon::InitAC97 ( void  )
private

Definition at line 540 of file common.cpp.

541{
542 PAGED_CODE ();
543
544 DOUT (DBG_PRINT, ("[CAC97AdapterCommon::InitAC97]"));
545
546 //
547 // First check if there is an AC link to the primary CoDec.
548 //
549 NTSTATUS ntStatus = PrimaryCodecReady ();
550 if (NT_SUCCESS (ntStatus))
551 {
552 //
553 // Second, reset this primary CoDec; If this is a AMC97 CoDec, only
554 // the audio registers are reset. If this is a MC97 CoDec, the CoDec
555 // should ignore the reset (according to the spec).
556 //
557 WriteCodecRegister (AC97REG_RESET, 0x00, 0xFFFF);
558
559 ntStatus = PowerUpCodec ();
560 }
561 else
562 {
563 DOUT (DBG_ERROR, ("Initialization of AC97 CoDec failed."));
564 }
565
566 return ntStatus;
567}
@ AC97REG_RESET
Definition: ac97reg.h:18
NTSTATUS PrimaryCodecReady(void)
Definition: common.cpp:1284
NTSTATUS PowerUpCodec(void)
Definition: common.cpp:1331

Referenced by STDMETHODIMP_().

◆ PowerUpCodec()

NTSTATUS CAC97AdapterCommon::PowerUpCodec ( void  )
private

Definition at line 1331 of file common.cpp.

1332{
1333 PAGED_CODE ();
1334
1335 WORD wCodecReg;
1336 NTSTATUS ntStatus;
1337
1338 DOUT (DBG_PRINT, ("[CAC97AdapterCommon::PowerUpCodec]"));
1339
1340 //
1341 // Power up the Codec.
1342 //
1343 WriteCodecRegister (AC97REG_POWERDOWN, 0x00, 0xFFFF);
1344
1345 //
1346 // Wait for the Codec to be powered up.
1347 //
1348 ULONG WaitCycles = 200;
1349 LARGE_INTEGER WaitTime;
1350
1351 WaitTime.QuadPart = (-50000); // wait 5000us (5ms) relative
1352
1353 do
1354 {
1355 //
1356 // Read the power management register.
1357 //
1358 ntStatus = ReadCodecRegister (AC97REG_POWERDOWN, &wCodecReg);
1359 if (!NT_SUCCESS (ntStatus))
1360 {
1361 wCodecReg = 0; // Will cause an error.
1362 break;
1363 }
1364
1365 //
1366 // Check the power state. Should be ready.
1367 //
1368 if ((wCodecReg & 0x0f) == 0x0f)
1369 break;
1370
1371 //
1372 // Let's wait a little, 5ms and then try again.
1373 //
1375 } while (WaitCycles--);
1376
1377 // Check if we timed out.
1378 if ((wCodecReg & 0x0f) != 0x0f)
1379 {
1380 DOUT (DBG_ERROR, ("PowerUpCodec timed out. CoDec not powered up."));
1381 ntStatus = STATUS_DEVICE_NOT_READY;
1382 }
1383
1384 return ntStatus;
1385}
@ AC97REG_POWERDOWN
Definition: ac97reg.h:37
#define KeDelayExecutionThread(mode, foo, t)
Definition: env_spec_w32.h:484
#define KernelMode
Definition: asm.h:34
#define STATUS_DEVICE_NOT_READY
Definition: shellext.h:70
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by InitAC97(), and STDMETHODIMP_().

◆ PrimaryCodecReady()

NTSTATUS CAC97AdapterCommon::PrimaryCodecReady ( void  )
private

Definition at line 1284 of file common.cpp.

1285{
1286 PAGED_CODE ();
1287
1288 DOUT (DBG_PRINT, ("[CAC97AdapterCommon::PrimaryCodecReady]"));
1289
1290
1291 //
1292 // Enable the AC link and raise the reset line.
1293 //
1294 DWORD dwRegValue = ReadBMControlRegister32 (GLOB_CNT);
1295
1296 // If someone enabled GPI Interrupt Enable, then he hopefully handles that
1297 // too.
1298 dwRegValue = (dwRegValue | GLOB_CNT_COLD) & ~(GLOB_CNT_ACLOFF | GLOB_CNT_PRIE);
1299 WriteBMControlRegister (GLOB_CNT, dwRegValue);
1300
1301 //
1302 // Wait for the Codec to be ready.
1303 //
1304 ULONG WaitCycles = 200;
1305 LARGE_INTEGER WaitTime;
1306
1307 WaitTime.QuadPart = (-50000); // wait 5000us (5ms) relative
1308
1309 do
1310 {
1313 {
1314 return STATUS_SUCCESS;
1315 }
1316
1318 } while (WaitCycles--);
1319
1320 DOUT (DBG_ERROR, ("PrimaryCodecReady timed out!"));
1321 return STATUS_IO_TIMEOUT;
1322}
unsigned long DWORD
Definition: ntddk_ex.h:95
ULONG NTAPI READ_PORT_ULONG(IN PULONG Port)
Definition: portio.c:70
const ULONG GLOB_STA_PCR
Definition: ichreg.h:86
const ULONG GLOB_CNT_PRIE
Definition: ichreg.h:68
const ULONG GLOB_CNT
Definition: ichreg.h:42
const ULONG GLOB_CNT_ACLOFF
Definition: ichreg.h:69
const ULONG GLOB_CNT_COLD
Definition: ichreg.h:71
const ULONG GLOB_STA
Definition: ichreg.h:43
unsigned int * PULONG
Definition: retypes.h:1

Referenced by InitAC97(), and ProbeHWConfig().

◆ ProbeHWConfig()

NTSTATUS CAC97AdapterCommon::ProbeHWConfig ( void  )
private

Definition at line 636 of file common.cpp.

637{
638 PAGED_CODE ();
639
640 NTSTATUS ntStatus = STATUS_SUCCESS;
641 DWORD dwGlobalStatus;
642 WORD wCodecID;
643 WORD wCodecReg;
644
645 DOUT (DBG_PRINT, ("[CAC97AdapterCommon::ProbeHWConfig]"));
646
647 //
648 // Wait for the whatever 97 to complete reset and establish a link.
649 //
650 ntStatus = PrimaryCodecReady ();
651 if (!NT_SUCCESS (ntStatus))
652 return ntStatus;
653
654 //
655 // Master volume is one of the supported registers on an AC97
656 //
657 ntStatus = ReadCodecRegister (AC97REG_MASTER_VOLUME, &wCodecReg);
658 if (!NT_SUCCESS (ntStatus))
659 return ntStatus;
660
661 // Default is x8000.
662 if (wCodecReg != 0x8000)
664
665 //
666 // This gives us information about the AC97 CoDec
667 //
668 ntStatus = ReadCodecRegister (AC97REG_RESET, &wCodecID);
669 if (!NT_SUCCESS (ntStatus))
670 return ntStatus;
671
672 //
673 // Fill out the configuration stuff.
674 //
675
676 SetPinConfig (PINC_MICIN_PRESENT, wCodecID & 0x0001);
677
678 // Check if OEM wants to disable MIC record line.
680 SetPinConfig (PINC_MICIN_PRESENT, FALSE);
681
682 // If we still have MIC record line, enable the DAC in ext. audio register.
683 if (GetPinConfig (PINC_MICIN_PRESENT))
684 // Enable ADC MIC.
685 WriteCodecRegister (AC97REG_EXT_AUDIO_CTRL, 0, 0x4000);
686 else
687 // Disable ADC MIC.
688 WriteCodecRegister (AC97REG_EXT_AUDIO_CTRL, 0x4000, 0x4000);
689
690 //
691 // Continue setting configuration information.
692 //
693
694 SetNodeConfig (NODEC_TONE_PRESENT, wCodecID & 0x0004);
695 SetNodeConfig (NODEC_SIMUL_STEREO_PRESENT, wCodecID & 0x0008);
696 SetPinConfig (PINC_HPOUT_PRESENT, wCodecID & 0x0010);
697
698 // Check if OEM wants to disable headphone output.
700 SetPinConfig (PINC_HPOUT_PRESENT, FALSE);
701
702 SetNodeConfig (NODEC_LOUDNESS_PRESENT, wCodecID & 0x0020);
703 SetNodeConfig (NODEC_3D_PRESENT, wCodecID & 0x7C00);
704
705 //
706 // Test for the input pins that are always there but could be disabled
707 // by the HW vender
708 //
709
710 // Check if OEM wants to disable mic input.
712
713 // Check if OEM wants to disable line input.
715
716 // Check if OEM wants to disable CD input.
718
719
720 //
721 // For the rest, we have to probe the registers.
722 //
723
724 //
725 // Test for Mono out.
726 //
727 ntStatus = ReadCodecRegister (AC97REG_MMONO_VOLUME, &wCodecReg);
728 if (!NT_SUCCESS (ntStatus))
729 return ntStatus;
730
731 // Default is x8000.
732 SetPinConfig (PINC_MONOOUT_PRESENT, (wCodecReg == 0x8000));
733
734 // Check if OEM wants to disable mono output.
736 SetPinConfig (PINC_MONOOUT_PRESENT, FALSE);
737
738 //
739 // Test for PC beeper support.
740 //
741 ntStatus = ReadCodecRegister (AC97REG_BEEP_VOLUME, &wCodecReg);
742 if (!NT_SUCCESS (ntStatus))
743 return ntStatus;
744
745 // default is x0 or x8000. If it's 0x8000 then we know for sure that the
746 // CoDec has a PcBeep, otherwise we have to check the register
747 if (wCodecReg == 0x8000)
748 SetPinConfig (PINC_PCBEEP_PRESENT, TRUE);
749 else if (!wCodecReg)
750 {
751 // mute the pc beeper.
752 ntStatus = WriteCodecRegister (AC97REG_BEEP_VOLUME, 0x8000, 0xFFFF);
753 if (!NT_SUCCESS (ntStatus))
754 return ntStatus;
755
756 // read back
757 ntStatus = ReadCodecRegister (AC97REG_BEEP_VOLUME, &wCodecReg);
758 if (!NT_SUCCESS (ntStatus))
759 return ntStatus;
760
761 if (wCodecReg == 0x8000)
762 {
763 // yep, we have support.
764 SetPinConfig (PINC_PCBEEP_PRESENT, TRUE);
765 // reset to default value.
766 WriteCodecRegister (AC97REG_BEEP_VOLUME, 0x0, 0xFFFF);
767 }
768 else
769 // nope, not present
770 SetPinConfig (PINC_PCBEEP_PRESENT, FALSE);
771 }
772 else
773 // any other value then 0x0 and 0x8000.
774 SetPinConfig (PINC_PCBEEP_PRESENT, FALSE);
775
776 // Check if OEM wants to disable beeper support.
778 SetPinConfig (PINC_PCBEEP_PRESENT, FALSE);
779
780 //
781 // Test for phone support.
782 //
783 ntStatus = ReadCodecRegister (AC97REG_PHONE_VOLUME, &wCodecReg);
784 if (!NT_SUCCESS (ntStatus))
785 return ntStatus;
786
787 // Default is x8008.
788 SetPinConfig (PINC_PHONE_PRESENT, (wCodecReg == 0x8008));
789
790 // Check if OEM wants to disable phone input.
792 SetPinConfig (PINC_PHONE_PRESENT, FALSE);
793
794 //
795 // Test for video support.
796 //
797 ntStatus = ReadCodecRegister (AC97REG_VIDEO_VOLUME, &wCodecReg);
798 if (!NT_SUCCESS (ntStatus))
799 return ntStatus;
800
801 // Default is x8808.
802 SetPinConfig (PINC_VIDEO_PRESENT, (wCodecReg == 0x8808));
803
804 // Check if OEM wants to disable video input.
806 SetPinConfig (PINC_VIDEO_PRESENT, FALSE);
807
808 //
809 // Test for Aux support.
810 //
811 ntStatus = ReadCodecRegister (AC97REG_AUX_VOLUME, &wCodecReg);
812 if (!NT_SUCCESS (ntStatus))
813 return ntStatus;
814
815 // Default is 0x8808.
816 SetPinConfig (PINC_AUX_PRESENT, (wCodecReg == 0x8808));
817
818 // Check if OEM wants to disable aux input.
820 SetPinConfig (PINC_AUX_PRESENT, FALSE);
821
822 //
823 // Test for Mic2 source.
824 //
825 ntStatus = ReadCodecRegister (AC97REG_GENERAL, &wCodecReg);
826 if (!NT_SUCCESS (ntStatus))
827 return ntStatus;
828
829 // Test for Mic2 select bit.
830 if (wCodecReg & 0x0100)
831 SetPinConfig (PINC_MIC2_PRESENT, TRUE);
832 else
833 {
834 // Select Mic2 as source.
835 ntStatus = WriteCodecRegister (AC97REG_GENERAL, 0x0100, 0x0100);
836 if (!NT_SUCCESS (ntStatus))
837 return ntStatus;
838
839 // Read back.
840 ntStatus = ReadCodecRegister (AC97REG_GENERAL, &wCodecReg);
841 if (!NT_SUCCESS (ntStatus))
842 return ntStatus;
843
844 if (wCodecReg & 0x0100)
845 {
846 // Yep, we have support so set it to the default value.
847 SetPinConfig (PINC_MIC2_PRESENT, TRUE);
848 // reset to default value.
849 WriteCodecRegister (AC97REG_GENERAL, 0, 0x0100);
850 }
851 else
852 SetPinConfig (PINC_MIC2_PRESENT, FALSE);
853 }
854
855 // Check if OEM wants to disable mic2 input.
857 SetPinConfig (PINC_MIC2_PRESENT, FALSE);
858
859 //
860 // Test the 3D controls.
861 //
862 if (GetNodeConfig (NODEC_3D_PRESENT))
863 {
864 //
865 // First test for fixed 3D controls. Write default value ...
866 //
867 ntStatus = WriteCodecRegister (AC97REG_3D_CONTROL, 0, 0xFFFF);
868 if (!NT_SUCCESS (ntStatus))
869 return ntStatus;
870
871 // Read 3D register. Default is 0 when adjustable, otherwise it is
872 // a fixed value.
873 ntStatus = ReadCodecRegister (AC97REG_3D_CONTROL, &wCodecReg);
874 if (!NT_SUCCESS (ntStatus))
875 return ntStatus;
876
877 //
878 // Check center and depth separately.
879 //
880
881 // For center
882 SetNodeConfig (NODEC_3D_CENTER_ADJUSTABLE, !(wCodecReg & 0x0F00));
883
884 // For depth
885 SetNodeConfig (NODEC_3D_DEPTH_ADJUSTABLE, !(wCodecReg & 0x000F));
886
887 //
888 // Test for adjustable controls.
889 //
890 WriteCodecRegister (AC97REG_3D_CONTROL, 0x0A0A, 0xFFFF);
891
892 // Read 3D register. Now it should be 0x0A0A for adjustable controls,
893 // otherwise it is a fixed control or simply not there.
894 ReadCodecRegister (AC97REG_3D_CONTROL, &wCodecReg);
895
896 // Restore the default value
897 WriteCodecRegister (AC97REG_3D_CONTROL, 0, 0xFFFF);
898
899 // Check the center control for beeing adjustable
900 if (GetNodeConfig (NODEC_3D_CENTER_ADJUSTABLE) &&
901 (wCodecReg & 0x0F00) != 0x0A00)
902 {
903 SetNodeConfig (NODEC_3D_CENTER_ADJUSTABLE, FALSE);
904 }
905
906 // Check the depth control for beeing adjustable
907 if (GetNodeConfig (NODEC_3D_DEPTH_ADJUSTABLE) &&
908 (wCodecReg & 0x000F) != 0x000A)
909 {
910 SetNodeConfig (NODEC_3D_DEPTH_ADJUSTABLE, FALSE);
911 }
912 }
913
914 //
915 // Check for 6th bit support in volume controls. To check the 6th bit,
916 // we first have to write a value (with 6th bit set) and then read it
917 // back. After that, we should restore the register to its default value.
918 //
919
920 //
921 // Start with the master volume.
922 //
924
925 //
926 // Check for a headphone volume control.
927 //
928 if (GetPinConfig (PINC_HPOUT_PRESENT))
929 {
931 }
932
933 //
934 // Mono out there?
935 //
936 if (GetPinConfig (PINC_MONOOUT_PRESENT))
937 {
939 }
940
941 //
942 // Get extended AC97 V2.0 information
943 //
944 ntStatus = ReadCodecRegister (AC97REG_EXT_AUDIO_ID, &wCodecReg);
945 if (!NT_SUCCESS (ntStatus))
946 return ntStatus;
947
948 //
949 // Store the information
950 //
951 SetNodeConfig (NODEC_PCM_VARIABLERATE_SUPPORTED, wCodecReg & 0x0001);
952 SetNodeConfig (NODEC_PCM_DOUBLERATE_SUPPORTED, wCodecReg & 0x0002);
953 SetNodeConfig (NODEC_MIC_VARIABLERATE_SUPPORTED, wCodecReg & 0x0008);
954 SetNodeConfig (NODEC_CENTER_DAC_PRESENT, wCodecReg & 0x0040);
955 SetNodeConfig (NODEC_SURROUND_DAC_PRESENT, wCodecReg & 0x0080);
956 SetNodeConfig (NODEC_LFE_DAC_PRESENT, wCodecReg & 0x0100);
957
958 //
959 // In case we have some features get some more information and program
960 // the codec.
961 //
962 if (wCodecReg)
963 {
964 //
965 // Enable variable sample rate in the control register and disable
966 // double rate. Also enable all DACs.
967 //
968 WriteCodecRegister (AC97REG_EXT_AUDIO_CTRL, wCodecReg & 0x0009, 0x380B);
969
970 //
971 // Check for codecs that have only one sample rate converter. These
972 // codecs will stick registers AC97REG_FRONT_SAMPLERATE and
973 // AC97REG_RECORD_SAMPLERATE together.
974 //
975 if (GetNodeConfig (NODEC_PCM_VARIABLERATE_SUPPORTED))
976 {
977 // The default of the sample rate registers should be 0xBB80.
978 WriteCodecRegister (AC97REG_FRONT_SAMPLERATE, 0xBB80, 0xFFFF);
979
980 // Write 44.1KHz into record VSR, then check playback again.
981 WriteCodecRegister (AC97REG_RECORD_SAMPLERATE, 0xAC44, 0xFFFF);
982 ntStatus = ReadCodecRegister (AC97REG_FRONT_SAMPLERATE, &wCodecReg);
983 WriteCodecRegister (AC97REG_RECORD_SAMPLERATE, 0xBB80, 0xFFFF);
984 if (!NT_SUCCESS (ntStatus))
985 return ntStatus;
986
987 //
988 // Set the flag accordingly
989 //
990 SetNodeConfig (NODEC_PCM_VSR_INDEPENDENT_RATES, (wCodecReg == 0xBB80));
991 }
992
993 //
994 // Check multichanel support on the AC97.
995 //
996 if (GetNodeConfig (NODEC_SURROUND_DAC_PRESENT))
997 {
998 dwGlobalStatus = ReadBMControlRegister32 (GLOB_STA);
999
1000 //
1001 // Codec supports >2 chanel, does AC97 too?
1002 //
1003 if ((GetNodeConfig (NODEC_CENTER_DAC_PRESENT) ||
1004 GetNodeConfig (NODEC_LFE_DAC_PRESENT)) &&
1005 (dwGlobalStatus & GLOB_STA_MC6))
1006 {
1007 SetPinConfig (PINC_CENTER_LFE_PRESENT, TRUE);
1008 }
1009 else
1010 {
1011 SetPinConfig (PINC_CENTER_LFE_PRESENT, FALSE);
1012 }
1013
1014 //
1015 // Do we support at least 4 channels?
1016 //
1017 SetPinConfig (PINC_SURROUND_PRESENT, (dwGlobalStatus & GLOB_STA_MC4));
1018 }
1019 else
1020 {
1021 //
1022 // Only 2 channel (stereo) support.
1023 //
1024 SetPinConfig (PINC_CENTER_LFE_PRESENT, FALSE);
1025 SetPinConfig (PINC_SURROUND_PRESENT, FALSE);
1026 }
1027 }
1028
1029 // Check if OEM wants to disable surround output.
1031 SetPinConfig (PINC_SURROUND_PRESENT, FALSE);
1032
1033 // Check if OEM wants to disable center and LFE output.
1035 SetPinConfig (PINC_CENTER_LFE_PRESENT, FALSE);
1036
1037 //
1038 // Check the 6th bit support for the additional channels.
1039 //
1040 if (GetPinConfig (PINC_SURROUND_PRESENT))
1042
1043 if (GetPinConfig (PINC_CENTER_LFE_PRESENT))
1045
1046 //
1047 // We read these registers because they are dependent on the codec.
1048 //
1049 ReadCodecRegister (AC97REG_VENDOR_ID1, &wCodecReg);
1050 ReadCodecRegister (AC97REG_VENDOR_ID2, &wCodecReg);
1051
1052 return STATUS_SUCCESS;
1053}
@ AC97REG_EXT_AUDIO_CTRL
Definition: ac97reg.h:41
@ AC97REG_AUX_VOLUME
Definition: ac97reg.h:29
@ AC97REG_MASTER_VOLUME
Definition: ac97reg.h:19
@ AC97REG_SURROUND_VOLUME
Definition: ac97reg.h:48
@ AC97REG_VIDEO_VOLUME
Definition: ac97reg.h:28
@ AC97REG_HPHONE_VOLUME
Definition: ac97reg.h:20
@ AC97REG_EXT_AUDIO_ID
Definition: ac97reg.h:40
@ AC97REG_VENDOR_ID1
Definition: ac97reg.h:55
@ AC97REG_GENERAL
Definition: ac97reg.h:34
@ AC97REG_PHONE_VOLUME
Definition: ac97reg.h:24
@ AC97REG_3D_CONTROL
Definition: ac97reg.h:35
@ AC97REG_RECORD_SAMPLERATE
Definition: ac97reg.h:45
@ AC97REG_CENTER_LFE_VOLUME
Definition: ac97reg.h:47
@ AC97REG_BEEP_VOLUME
Definition: ac97reg.h:23
@ AC97REG_VENDOR_ID2
Definition: ac97reg.h:56
@ AC97REG_FRONT_SAMPLERATE
Definition: ac97reg.h:42
NTSTATUS Check6thBitSupport(IN AC97Register, IN TopoNodeConfig)
Definition: common.cpp:577
BOOL DisableAC97Pin(IN TopoPinConfig)
Definition: common.cpp:1880
@ PINC_LINEIN_PRESENT
Definition: shared.h:72
@ PINC_MONOOUT_PRESENT
Definition: shared.h:69
@ PINC_VIDEO_PRESENT
Definition: shared.h:66
@ PINC_MIC2_PRESENT
Definition: shared.h:65
@ PINC_PCBEEP_PRESENT
Definition: shared.h:63
@ PINC_PHONE_PRESENT
Definition: shared.h:64
@ PINC_AUX_PRESENT
Definition: shared.h:67
@ PINC_SURROUND_PRESENT
Definition: shared.h:74
@ PINC_CENTER_LFE_PRESENT
Definition: shared.h:75
@ PINC_HPOUT_PRESENT
Definition: shared.h:68
@ PINC_CD_PRESENT
Definition: shared.h:73
@ PINC_MICIN_PRESENT
Definition: shared.h:70
@ PINC_MIC_PRESENT
Definition: shared.h:71
@ NODEC_6BIT_CENTER_LFE_VOLUME
Definition: shared.h:93
@ NODEC_3D_DEPTH_ADJUSTABLE
Definition: shared.h:95
@ NODEC_PCM_DOUBLERATE_SUPPORTED
Definition: shared.h:98
@ NODEC_TONE_PRESENT
Definition: shared.h:86
@ NODEC_MIC_VARIABLERATE_SUPPORTED
Definition: shared.h:99
@ NODEC_6BIT_HPOUT_VOLUME
Definition: shared.h:90
@ NODEC_SURROUND_DAC_PRESENT
Definition: shared.h:101
@ NODEC_CENTER_DAC_PRESENT
Definition: shared.h:100
@ NODEC_PCM_VARIABLERATE_SUPPORTED
Definition: shared.h:96
@ NODEC_3D_CENTER_ADJUSTABLE
Definition: shared.h:94
@ NODEC_LFE_DAC_PRESENT
Definition: shared.h:102
@ NODEC_LOUDNESS_PRESENT
Definition: shared.h:87
@ NODEC_6BIT_SURROUND_VOLUME
Definition: shared.h:92
@ NODEC_3D_PRESENT
Definition: shared.h:85
@ NODEC_SIMUL_STEREO_PRESENT
Definition: shared.h:88
@ NODEC_6BIT_MONOOUT_VOLUME
Definition: shared.h:91
@ NODEC_6BIT_MASTER_VOLUME
Definition: shared.h:89
@ NODEC_PCM_VSR_INDEPENDENT_RATES
Definition: shared.h:97
const ULONG GLOB_STA_MC4
Definition: ichreg.h:76
const ULONG GLOB_STA_MC6
Definition: ichreg.h:75
#define STATUS_NO_SUCH_DEVICE
Definition: udferr_usr.h:136

Referenced by STDMETHODIMP_().

◆ ReadNABMCtrlRegs()

NTSTATUS CAC97AdapterCommon::ReadNABMCtrlRegs ( void  )
private

◆ RestoreNABMCtrlRegs()

NTSTATUS CAC97AdapterCommon::RestoreNABMCtrlRegs ( void  )
private

◆ SetAC97Default()

NTSTATUS CAC97AdapterCommon::SetAC97Default ( void  )
private

Definition at line 1742 of file common.cpp.

1743{
1744 PAGED_CODE ();
1745
1746 PREGISTRYKEY DriverKey;
1747 PREGISTRYKEY SettingsKey;
1748 UNICODE_STRING sKeyName;
1749 ULONG ulDisposition;
1750 ULONG ulResultLength;
1751 PVOID KeyInfo = NULL;
1752
1753 DOUT (DBG_PRINT, ("[CAC97AdapterCommon::SetAC97Default]"));
1754
1755 // open the driver registry key
1756 NTSTATUS ntStatus = PcNewRegistryKey (&DriverKey, // IRegistryKey
1757 NULL, // OuterUnknown
1758 DriverRegistryKey, // Registry key type
1759 KEY_READ, // Access flags
1760 m_pDeviceObject, // Device object
1761 NULL, // Subdevice
1762 NULL, // ObjectAttributes
1763 0, // Create options
1764 NULL); // Disposition
1765 if (NT_SUCCESS (ntStatus))
1766 {
1767 // make a unicode string for the subkey name
1768 RtlInitUnicodeString (&sKeyName, L"Settings");
1769
1770 // open the settings subkey
1771 ntStatus = DriverKey->NewSubKey (&SettingsKey, // Subkey
1772 NULL, // OuterUnknown
1773 KEY_READ, // Access flags
1774 &sKeyName, // Subkey name
1775 REG_OPTION_NON_VOLATILE, // Create options
1776 &ulDisposition);
1777
1778 if (NT_SUCCESS (ntStatus))
1779 {
1780 // allocate data to hold key info
1783 sizeof(WORD), PoolTag);
1784 if (NULL != KeyInfo)
1785 {
1786 // loop through all mixer settings
1788 i = (AC97Register)(i + 1))
1789 {
1791 {
1792 // init key name
1793 RtlInitUnicodeString (&sKeyName,
1794 m_stAC97Registers[i].sRegistryName);
1795
1796 // query the value key
1797 ntStatus = SettingsKey->QueryValueKey (&sKeyName,
1799 KeyInfo,
1801 sizeof(WORD),
1802 &ulResultLength);
1803 if (NT_SUCCESS (ntStatus))
1804 {
1805 PKEY_VALUE_PARTIAL_INFORMATION PartialInfo =
1807
1808 if (PartialInfo->DataLength == sizeof(WORD))
1809 {
1810 // set mixer register to registry value
1811 WriteCodecRegister
1812 (i, *(PWORD)PartialInfo->Data, 0xFFFF);
1813 }
1814 else // write the hard coded default
1815 {
1816 // if key access failed, set to default
1817 WriteCodecRegister
1818 (i, m_stAC97Registers[i].wWantedDefault, 0xFFFF);
1819 }
1820 }
1821 else // write the hard coded default
1822 {
1823 // if key access failed, set to default
1824 WriteCodecRegister
1825 (i, m_stAC97Registers[i].wWantedDefault, 0xFFFF);
1826 }
1827 }
1828 }
1829
1830 // we want to return status success even if the last QueryValueKey
1831 // failed.
1832 ntStatus = STATUS_SUCCESS;
1833
1834 // free the key info
1835 ExFreePoolWithTag (KeyInfo,PoolTag);
1836 }
1837 else
1838 {
1840 }
1841
1842 // release the settings key
1843 SettingsKey->Release ();
1844 }
1845
1846 // release the driver key
1847 DriverKey->Release ();
1848 }
1849
1850
1851 // in case we did not query the registry (cause of lack of resources)
1852 // restore default values and return insufficient resources.
1853 if (!NT_SUCCESS (ntStatus))
1854 {
1855 // copy hard coded default settings
1857 i = (AC97Register)(i + 1))
1858 {
1860 {
1861 WriteCodecRegister (i, m_stAC97Registers[i].wWantedDefault, 0xFFFF);
1862 }
1863 }
1864 }
1865
1866 return ntStatus;
1867}
AC97Register
Definition: ac97reg.h:17
@ AC97REG_RESERVED2
Definition: ac97reg.h:49
static tAC97Registers m_stAC97Registers[64]
Definition: common.h:92
const WORD SHREG_INIT
Definition: common.h:68
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
WORD * PWORD
Definition: pedump.c:67
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ DWORD _Out_ _In_ WORD wFlags
Definition: wincon.h:531

Referenced by STDMETHODIMP_().

◆ STDMETHODIMP_() [1/21]

CAC97AdapterCommon::STDMETHODIMP_ ( AC97Register  )
inline

Definition at line 240 of file common.h.

243 {
244 return stMapNodeToReg[node].reg;
245 };
const tMapNodeToReg stMapNodeToReg[]
Definition: ac97reg.h:109
AC97Register reg
Definition: ac97reg.h:105
Definition: dlist.c:348

◆ STDMETHODIMP_() [2/21]

CAC97AdapterCommon::STDMETHODIMP_ ( BOOL  )
inline

Definition at line 217 of file common.h.

221 {
222 return m_stHardwareConfig.Nodes[node].bNodeConfig;
223 };
struct tHardwareConfig::@1427 Nodes[NODEC_TOP_ELEMENT]

◆ STDMETHODIMP_() [3/21]

CAC97AdapterCommon::STDMETHODIMP_ ( BOOL  )
inline

Definition at line 194 of file common.h.

198 {
199 return m_stHardwareConfig.Pins[pin].bPinConfig;
200 };
struct tHardwareConfig::@1428 Pins[PINC_TOP_ELEMENT]

◆ STDMETHODIMP_() [4/21]

CAC97AdapterCommon::STDMETHODIMP_ ( NTSTATUS  )

◆ STDMETHODIMP_() [5/21]

CAC97AdapterCommon::STDMETHODIMP_ ( NTSTATUS  )

◆ STDMETHODIMP_() [6/21]

CAC97AdapterCommon::STDMETHODIMP_ ( NTSTATUS  )

◆ STDMETHODIMP_() [7/21]

CAC97AdapterCommon::STDMETHODIMP_ ( NTSTATUS  )

◆ STDMETHODIMP_() [8/21]

CAC97AdapterCommon::STDMETHODIMP_ ( NTSTATUS  )

◆ STDMETHODIMP_() [9/21]

CAC97AdapterCommon::STDMETHODIMP_ ( PAC97MINIPORTTOPOLOGY  )
inline

Definition at line 351 of file common.h.

352 {
353 return m_Topology;
354 };
PAC97MINIPORTTOPOLOGY m_Topology
Definition: common.h:99

◆ STDMETHODIMP_() [10/21]

CAC97AdapterCommon::STDMETHODIMP_ ( UCHAR  )

◆ STDMETHODIMP_() [11/21]

CAC97AdapterCommon::STDMETHODIMP_ ( ULONG  )

◆ STDMETHODIMP_() [12/21]

CAC97AdapterCommon::STDMETHODIMP_ ( USHORT  )

◆ STDMETHODIMP_() [13/21]

CAC97AdapterCommon::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [14/21]

CAC97AdapterCommon::STDMETHODIMP_ ( void  )
inline

Definition at line 343 of file common.h.

344 {
345 m_Topology = topo;
346 };

◆ STDMETHODIMP_() [15/21]

CAC97AdapterCommon::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [16/21]

CAC97AdapterCommon::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [17/21]

CAC97AdapterCommon::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [18/21]

CAC97AdapterCommon::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [19/21]

CAC97AdapterCommon::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [20/21]

CAC97AdapterCommon::STDMETHODIMP_ ( void  )

◆ STDMETHODIMP_() [21/21]

CAC97AdapterCommon::STDMETHODIMP_ ( WORD  )
inline

Definition at line 250 of file common.h.

254 {
255 return stMapNodeToReg[node].mask;
256 };

Friends And Related Function Documentation

◆ NewAdapterCommon

NTSTATUS NewAdapterCommon ( OUT PADAPTERCOMMON OutAdapterCommon,
IN PRESOURCELIST  ResourceList 
)
friend

Member Data Documentation

◆ config

IN BOOL CAC97AdapterCommon::config
Initial value:

Definition at line 208 of file common.h.

Referenced by STDMETHODIMP_().

◆ DeviceObject

IN PDEVICE_OBJECT CAC97AdapterCommon::DeviceObject

Definition at line 188 of file common.h.

Referenced by STDMETHODIMP_().

◆ dwSampleRate

IN DWORD CAC97AdapterCommon::dwSampleRate

Definition at line 337 of file common.h.

◆ IMP_IAdapterPowerManagement

CAC97AdapterCommon::IMP_IAdapterPowerManagement

Definition at line 175 of file common.h.

◆ m_bDirectRead

BOOL CAC97AdapterCommon::m_bDirectRead
private

Definition at line 97 of file common.h.

Referenced by STDMETHODIMP_().

◆ m_pBusMasterBase

PUCHAR CAC97AdapterCommon::m_pBusMasterBase
private

Definition at line 96 of file common.h.

Referenced by AcquireCodecSemiphore(), PrimaryCodecReady(), and STDMETHODIMP_().

◆ m_pCodecBase

PWORD CAC97AdapterCommon::m_pCodecBase
private

Definition at line 95 of file common.h.

Referenced by STDMETHODIMP_().

◆ m_pDeviceObject

PDEVICE_OBJECT CAC97AdapterCommon::m_pDeviceObject
private

Definition at line 94 of file common.h.

Referenced by DisableAC97Pin(), SetAC97Default(), and STDMETHODIMP_().

◆ m_PowerState

DEVICE_POWER_STATE CAC97AdapterCommon::m_PowerState
private

Definition at line 98 of file common.h.

Referenced by STDMETHODIMP_().

◆ m_stAC97Registers

tAC97Registers CAC97AdapterCommon::m_stAC97Registers
staticprivate

Definition at line 92 of file common.h.

Referenced by SetAC97Default().

◆ m_stHardwareConfig

tHardwareConfig CAC97AdapterCommon::m_stHardwareConfig
staticprivate
Initial value:
=
{
{{FALSE}, {FALSE}, {FALSE}, {FALSE}, {FALSE}, {FALSE}, {FALSE}, {FALSE},
{FALSE}, {FALSE}, {FALSE}, {FALSE}, {FALSE}, {FALSE}, {FALSE}, {FALSE},
{FALSE}},
{{FALSE, L"DisablePCBeep"},
{FALSE, L"DisablePhone"},
{FALSE, L"DisableMic2"},
{FALSE, L"DisableVideo"},
{FALSE, L"DisableAUX"},
{FALSE, L"DisableHeadphone"},
{FALSE, L"DisableMonoOut"},
{FALSE, L"DisableMicIn"},
{FALSE, L"DisableMic"},
{FALSE, L"DisableLineIn"},
{FALSE, L"DisableCD"},
{FALSE, L"DisableSurround"},
{FALSE, L"DisableCenterLFE"}}
}

Definition at line 93 of file common.h.

Referenced by DisableAC97Pin(), and STDMETHODIMP_().

◆ m_Topology

PAC97MINIPORTTOPOLOGY CAC97AdapterCommon::m_Topology
private

Definition at line 99 of file common.h.

Referenced by STDMETHODIMP_(), and STDMETHODIMP_().

◆ pwChannels

PWORD CAC97AdapterCommon::pwChannels

Definition at line 363 of file common.h.

◆ Register

AC97REG_INVALID AC97Register CAC97AdapterCommon::Register

Definition at line 263 of file common.h.

◆ Value [1/3]

IN UCHAR CAC97AdapterCommon::Value

Definition at line 307 of file common.h.

◆ Value [2/3]

IN USHORT CAC97AdapterCommon::Value

Definition at line 316 of file common.h.

◆ Value [3/3]

IN ULONG CAC97AdapterCommon::Value

Definition at line 323 of file common.h.

◆ wData [1/2]

AC97REG_INVALID AC97Register _Out_ PWORD CAC97AdapterCommon::wData

Definition at line 264 of file common.h.

◆ wData [2/2]

AC97REG_INVALID AC97Register _In_ WORD CAC97AdapterCommon::wData

Definition at line 273 of file common.h.

◆ wMask

AC97REG_INVALID AC97Register _In_ WORD _In_ WORD CAC97AdapterCommon::wMask

Definition at line 274 of file common.h.


The documentation for this class was generated from the following files: