11#define STR_MODULENAME "AC97 Property handler: "
24#pragma code_seg("PAGE")
51 that->stNodeCache[Mute].bLeftValid)
56 that->stNodeCache[Mute].lLeft;
58 ntStatus = that->AdapterCommon->WriteCodecRegister (
59 that->AdapterCommon->GetNodeReg (Mute),
61 that->AdapterCommon->GetNodeMask (Mute));
96 that->stNodeCache[
Volume].bLeftValid &&
97 that->stNodeCache[
Volume].bRightValid)
102 lLevel = that->stNodeCache[
Volume].lLeft +
118 wRegister = (
WORD)(((
lMaximum + uStep / 2) - lLevel) / uStep) << 8;
121 lLevel = that->stNodeCache[
Volume].lRight +
129 wRegister += (
WORD)(((
lMaximum + uStep / 2) - lLevel) / uStep);
132 ntStatus = that->AdapterCommon->WriteCodecRegister (
133 that->AdapterCommon->GetNodeReg (
Volume),
135 that->AdapterCommon->GetNodeMask (
Volume));
138 that->stNodeCache[
Volume].lLeft +
202 *plMinimum = 0xFFA18000;
203 *puStep = 0x00018000;
209 *plMinimum = 0xFFD18000;
210 *puStep = 0x00018000;
218 *plMinimum = 0xFFD18000;
219 *puStep = 0x00018000;
224 *plMinimum = 0xFFD30000;
225 *puStep = 0x00030000;
240 *plMaximum = 0x000C0000;
241 *plMinimum = 0xFFDD8000;
242 *puStep = 0x00018000;
255 *plMaximum = 0x00168000;
257 *puStep = 0x00018000;
262 *plMaximum = 0x000A8000;
263 *plMinimum = 0xFFF58000;
264 *puStep = 0x00018000;
276 *plMaximum = 0x000F0000;
277 *plMinimum = 0x00000000;
278 *puStep = 0x00010000;
284 *plMaximum = 0x000F0000;
285 *plMinimum = 0x00000000;
286 *puStep = 0x00010000;
305 *plMaximum = (
DWORD)(-wRegister) << 16;
306 *plMinimum = (
DWORD)(-wRegister) << 16;
307 *puStep = 0x00010000;
351 DOUT (
DBG_PRINT, (
"[CAC97MiniportTopology::PropertyHandler_OnOff]"));
354 if (PropertyRequest->Node == (
ULONG)-1)
364 if ((PropertyRequest->InstanceSize <
sizeof(
LONG)) ||
365 (PropertyRequest->ValueSize <
sizeof(
BOOL)))
369 channel = *(
PLONG)PropertyRequest->Instance;
462 DOUT (
DBG_ERROR, (
"PropertyHandler_OnOff: Invalid node requested."));
502 PropertyRequest->ValueSize =
sizeof(
BOOL);
588 DOUT (
DBG_PRINT, (
"[CAC97MiniportTopology::BasicSupportHandler]"));
633 &
Range->Bounds.SignedMinimum,
634 &
Range->Bounds.SignedMaximum,
635 &
Range->SteppingDelta);
646 Range->Bounds.SignedMaximum,
Range->Bounds.SignedMinimum,
647 Range->SteppingDelta));
657 else if (PropertyRequest->ValueSize >=
sizeof(
ULONG))
667 PropertyRequest->ValueSize =
sizeof(
ULONG);
697 DOUT (
DBG_PRINT, (
"[CAC97MiniportTopology::PropertyHandler_Level]"));
711 if (PropertyRequest->Node == (
ULONG)-1)
721 if ((PropertyRequest->InstanceSize <
sizeof(
LONG)) ||
722 (PropertyRequest->ValueSize <
sizeof(
LONG)))
726 channel = *((
PLONG)PropertyRequest->Instance);
807 DOUT (
DBG_ERROR, (
"PropertyHandler_Level: Invalid node requested."));
837 wRegister = (wRegister & (that->
AdapterCommon->GetNodeMask (NodeDef)
927 PropertyRequest->ValueSize =
sizeof(
LONG);
1040 wRegister = (
WORD)(((lLevel + uStep / 2) -
lMinimum) / uStep);
1064 wRegister = (
WORD)(((
lMaximum + uStep / 2) - lLevel) / uStep);
1182 ASSERT (PropertyRequest);
1184 DOUT (
DBG_PRINT, (
"[CAC97MiniportTopology::PropertyHandler_Tone]"));
1197 if (PropertyRequest->Node == (
ULONG)-1)
1207 if ((PropertyRequest->InstanceSize <
sizeof(
LONG)) ||
1208 (PropertyRequest->ValueSize <
sizeof(
LONG)))
1251 DOUT (
DBG_ERROR, (
"PropertyHandler_Tone: Invalid node requested."));
1290 if (wRegister == 0x000F)
1309 PropertyRequest->ValueSize =
sizeof(
LONG);
1332 wRegister = (
WORD)(((lLevel + uStep / 2) -
lMinimum) / uStep);
1337 wRegister = (
WORD)(((
lMaximum + uStep / 2) - lLevel) / uStep);
1386 ASSERT (PropertyRequest);
1388 DOUT (
DBG_PRINT, (
"[CAC97MiniportTopology::PropertyHandler_Ulong]"));
1402 if (PropertyRequest->Node == (
ULONG)-1)
1410 if (PropertyRequest->ValueSize <
sizeof(
ULONG))
1431 DOUT (
DBG_ERROR, (
"PropertyHandler_Tone: Invalid node requested."));
1468 PropertyRequest->ValueSize =
sizeof(
LONG);
1477 ULONG ulSelect = *PropValue;
1483 if ((ulSelect < 1) || (ulSelect > 2))
1488 if ((ulSelect < 1) || (ulSelect > 8))
1506 wRegister = (
WORD)(ulSelect - 1) * 257;
1548 wRegister = (
WORD)(((
lMaximum + uStep / 2) - lLevel) / uStep);
1550 wRegister = (
WORD)(((lLevel + uStep / 2) -
lMinimum) / uStep);
1563 wRegister = (
WORD)(((
lMaximum + uStep / 2) - lLevel) / uStep);
1565 wRegister = (
WORD)(((lLevel + uStep / 2) -
lMinimum) / uStep);
1638 ASSERT (PropertyRequest);
1640 DOUT (
DBG_PRINT, (
"[CAC97MiniportTopology::PropertyHandler_CpuResources]"));
1649 if (PropertyRequest->Node == (
ULONG)-1)
1660 if (PropertyRequest->ValueSize >=
sizeof(
LONG))
1663 PropertyRequest->ValueSize =
sizeof(
LONG);
1675#ifdef INCLUDE_PRIVATE_PROPERTY
1684NTSTATUS CAC97MiniportTopology::PropertyHandler_Private
1691 ASSERT (PropertyRequest);
1693 DOUT (
DBG_PRINT, (
"[CAC97MiniportTopology::PropertyHandler_Private]"));
1708 if (PropertyRequest->PropertyItem->Id != KSPROPERTY_AC97_FEATURES)
1712 if (PropertyRequest->ValueSize <
sizeof (tAC97Features))
1716 tAC97Features *pAC97Features = (tAC97Features *) PropertyRequest->Value;
1727 pAC97Features->MasterVolume = Volume5bit;
1729 pAC97Features->MasterVolume = Volume6bit;
1731 pAC97Features->HeadphoneVolume = Volume5bit;
1733 pAC97Features->HeadphoneVolume = VolumeDisabled;
1735 pAC97Features->HeadphoneVolume = Volume6bit;
1737 pAC97Features->MonoOutVolume = Volume5bit;
1739 pAC97Features->MonoOutVolume = VolumeDisabled;
1741 pAC97Features->MonoOutVolume = Volume6bit;
1756 pAC97Features->DAC = Resolution16bit;
1757 if (wCodecID & 0x0040)
1758 pAC97Features->DAC = Resolution18bit;
1759 if (wCodecID & 0x0080)
1760 pAC97Features->DAC = Resolution20bit;
1763 pAC97Features->ADC = Resolution16bit;
1764 if (wCodecID & 0x0100)
1765 pAC97Features->ADC = Resolution18bit;
1766 if (wCodecID & 0x0200)
1767 pAC97Features->ADC = Resolution20bit;
1770 pAC97Features->n3DTechnique = ((wCodecID & 0x7C00) >> 10);
1794 PropertyRequest->ValueSize =
sizeof (tAC97Features);
1799#ifdef PROPERTY_SHOW_SET
1806 if (PropertyRequest->PropertyItem->Id != KSPROPERTY_AC97_SAMPLE_SET)
1814 DWORD *pTimerTick = (
DWORD *)PropertyRequest->Value;
1821 DOUT (
DBG_ALL, (
"This computer is already %d ms running Windows!", *pTimerTick));
tNodeCache stNodeCache[NODE_TOP_ELEMENT]
static NTSTATUS GetDBValues(IN PADAPTERCOMMON, IN TopoNodes Node, OUT LONG *plMinimum, OUT LONG *plMaximum, OUT ULONG *puStep)
TopoNodes TransNodeNrToNodeDef(IN int Node)
static NTSTATUS SetMultichannelMute(IN CAC97MiniportTopology *that, IN TopoNodes Mute)
PADAPTERCOMMON AdapterCommon
static NTSTATUS NTAPI PropertyHandler_Ulong(IN PPCPROPERTY_REQUEST PropertyRequest)
static NTSTATUS BasicSupportHandler(IN PPCPROPERTY_REQUEST PropertyRequest)
static NTSTATUS NTAPI PropertyHandler_Level(IN PPCPROPERTY_REQUEST PropertyRequest)
static NTSTATUS SetMultichannelVolume(IN CAC97MiniportTopology *that, IN TopoNodes Volume)
void UpdateRecordMute(void)
static NTSTATUS NTAPI PropertyHandler_Tone(IN PPCPROPERTY_REQUEST PropertyRequest)
static NTSTATUS NTAPI PropertyHandler_OnOff(IN PPCPROPERTY_REQUEST PropertyRequest)
static NTSTATUS NTAPI PropertyHandler_CpuResources(IN PPCPROPERTY_REQUEST PropertyRequest)
#define NT_SUCCESS(StatCode)
#define DOUT(lvl, strings)
@ PINC_CENTER_LFE_PRESENT
@ NODE_VIRT_MASTER_INPUT_VOLUME1
@ NODE_VIRT_MONOOUT_VOLUME1
@ NODE_VIRT_MONOOUT_VOLUME2
@ NODE_VIRT_MASTER_INPUT_VOLUME3
@ NODE_VIRT_MASTER_INPUT_VOLUME8
@ NODE_VIRT_MASTERMONO_MUTE
@ NODE_VIRT_WAVEOUT_3D_BYPASS
@ NODE_VIRT_MASTER_INPUT_VOLUME2
@ NODE_VIRT_MASTER_INPUT_VOLUME6
@ NODE_VIRT_MASTER_INPUT_VOLUME5
@ NODE_VIRT_MASTER_INPUT_VOLUME7
@ NODE_VIRT_MASTERMONO_VOLUME
@ NODE_VIRT_MASTER_INPUT_VOLUME4
@ NODEC_6BIT_CENTER_LFE_VOLUME
@ NODEC_3D_DEPTH_ADJUSTABLE
@ NODEC_PCM_DOUBLERATE_SUPPORTED
@ NODEC_MIC_VARIABLERATE_SUPPORTED
@ NODEC_6BIT_HPOUT_VOLUME
@ NODEC_SURROUND_DAC_PRESENT
@ NODEC_CENTER_DAC_PRESENT
@ NODEC_PCM_VARIABLERATE_SUPPORTED
@ NODEC_3D_CENTER_ADJUSTABLE
@ NODEC_6BIT_SURROUND_VOLUME
@ NODEC_6BIT_MONOOUT_VOLUME
@ NODEC_6BIT_MASTER_VOLUME
IAC97AdapterCommon * PADAPTERCOMMON
#define KSPROPERTY_TYPE_SET
#define KSPROPERTY_TYPE_BASICSUPPORT
#define KSPROPERTY_TYPE_GET
#define KSPROPERTY_MEMBER_STEPPEDRANGES
#define KSPROPTYPESETID_General
struct KSPROPERTY_STEPPING_LONG * PKSPROPERTY_STEPPING_LONG
struct KSPROPERTY_DESCRIPTION * PKSPROPERTY_DESCRIPTION
struct KSPROPERTY_MEMBERSHEADER * PKSPROPERTY_MEMBERSHEADER
const WORD AC97REG_MASK_RIGHT
const WORD AC97REG_MASK_MUTE
const WORD AC97REG_MASK_LEFT
const long PROP_MOST_NEGATIVE
#define STATUS_BUFFER_TOO_SMALL
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_INVALID_PARAMETER
#define DBG_PRINT(ppi, ch, level)
_IRQL_requires_same_ typedef _In_ ULONG _In_ UCHAR Level
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList