1. Dell AWCC WMI 接口驱动 (alienware-wmi)

1.1. 简介

WMI 设备 WMAX 已在许多 Alienware 和 Dell G 系列型号上实现。 在这些型号中,已经确定了两种实现方式。 第一种由较旧的系统使用,处理 HDMI、亮度、RGB、放大器和深度睡眠控制。 第二种由较新的系统使用,主要处理散热控制和超频。

据推测,后者由 Alienware Command Center (AWCC) 用于管理制造商预定义的散热配置文件。 alienware-wmi 驱动程序通过平台配置文件 API 公开 Thermal_Information 和 Thermal_Control 方法,以模仿 AWCC 的行为。

这个较新的接口,命名为 AWCCMethodFunction,已经被逆向工程,因为 Dell 没有提供任何官方文档。 我们将尽最大努力描述其已发现的内部工作原理。

注意

以下方法描述可能不完整,并且某些操作在不同设备之间具有不同的实现方式。

1.1.1. WMI 接口描述

可以使用 bmfdec 实用程序从嵌入式二进制 MOF (bmof) 数据中解码 WMI 接口描述

[WMI, Dynamic, Provider("WmiProv"), Locale("MS\\0x409"), Description("WMI Function"), guid("{A70591CE-A997-11DA-B012-B622A1EF5492}")]
class AWCCWmiMethodFunction {
  [key, read] string InstanceName;
  [read] boolean Active;

  [WmiMethodId(13), Implemented, read, write, Description("Return Overclocking Report.")] void Return_OverclockingReport([out] uint32 argr);
  [WmiMethodId(14), Implemented, read, write, Description("Set OCUIBIOS Control.")] void Set_OCUIBIOSControl([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(15), Implemented, read, write, Description("Clear OC FailSafe Flag.")] void Clear_OCFailSafeFlag([out] uint32 argr);
  [WmiMethodId(19), Implemented, read, write, Description("Get Fan Sensors.")] void GetFanSensors([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(20), Implemented, read, write, Description("Thermal Information.")] void Thermal_Information([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(21), Implemented, read, write, Description("Thermal Control.")] void Thermal_Control([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(23), Implemented, read, write, Description("MemoryOCControl.")] void MemoryOCControl([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(26), Implemented, read, write, Description("System Information.")] void SystemInformation([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(28), Implemented, read, write, Description("Power Information.")] void PowerInformation([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(32), Implemented, read, write, Description("FW Update GPIO toggle.")] void FWUpdateGPIOtoggle([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(33), Implemented, read, write, Description("Read Total of GPIOs.")] void ReadTotalofGPIOs([out] uint32 argr);
  [WmiMethodId(34), Implemented, read, write, Description("Read GPIO pin Status.")] void ReadGPIOpPinStatus([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(35), Implemented, read, write, Description("Read Chassis Color.")] void ReadChassisColor([out] uint32 argr);
  [WmiMethodId(36), Implemented, read, write, Description("Read Platform Properties.")] void ReadPlatformProperties([out] uint32 argr);
  [WmiMethodId(37), Implemented, read, write, Description("Game Shift Status.")] void GameShiftStatus([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(128), Implemented, read, write, Description("Caldera SW installation.")] void CalderaSWInstallation([out] uint32 argr);
  [WmiMethodId(129), Implemented, read, write, Description("Caldera SW is released.")] void CalderaSWReleased([out] uint32 argr);
  [WmiMethodId(130), Implemented, read, write, Description("Caldera Connection Status.")] void CalderaConnectionStatus([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(131), Implemented, read, write, Description("Surprise Unplugged Flag Status.")] void SurpriseUnpluggedFlagStatus([out] uint32 argr);
  [WmiMethodId(132), Implemented, read, write, Description("Clear Surprise Unplugged Flag.")] void ClearSurpriseUnpluggedFlag([out] uint32 argr);
  [WmiMethodId(133), Implemented, read, write, Description("Cancel Undock Request.")] void CancelUndockRequest([out] uint32 argr);
  [WmiMethodId(135), Implemented, read, write, Description("Devices in Caldera.")] void DevicesInCaldera([in] uint32 arg2, [out] uint32 argr);
  [WmiMethodId(136), Implemented, read, write, Description("Notify BIOS for SW ready to disconnect Caldera.")] void NotifyBIOSForSWReadyToDisconnectCaldera([out] uint32 argr);
  [WmiMethodId(160), Implemented, read, write, Description("Tobii SW installation.")] void TobiiSWinstallation([out] uint32 argr);
  [WmiMethodId(161), Implemented, read, write, Description("Tobii SW Released.")] void TobiiSWReleased([out] uint32 argr);
  [WmiMethodId(162), Implemented, read, write, Description("Tobii Camera Power Reset.")] void TobiiCameraPowerReset([out] uint32 argr);
  [WmiMethodId(163), Implemented, read, write, Description("Tobii Camera Power On.")] void TobiiCameraPowerOn([out] uint32 argr);
  [WmiMethodId(164), Implemented, read, write, Description("Tobii Camera Power Off.")] void TobiiCameraPowerOff([out] uint32 argr);
};

以下文档中未描述的方法具有未知的行为。

1.1.2. 参数结构

所有输入参数的类型均为 uint32,并且它们在方法之间的结构非常相似。 通常,第一个字节对应于该方法执行的特定操作,而随后的字节对应于传递给此操作参数。 例如,如果一个操作的代码为 0x01 并且需要 ID 0xA0,那么您将传递给该方法的参数是 0xA001。

1.2. 散热方法

1.2.1. WMI 方法 GetFanSensors([in] uint32 arg2, [out] uint32 argr)

操作 (字节 0)

描述

参数

0x01

获取与风扇 ID 相关的温度传感器数量

  • 字节 1:风扇 ID

0x02

获取与风扇传感器 ID 相关的温度传感器 ID

  • 字节 1:风扇 ID

  • 字节 2:索引

1.2.2. WMI 方法 Thermal_Information([in] uint32 arg2, [out] uint32 argr)

操作 (字节 0)

描述

参数

0x01

未知。

0x02

获取具有以下结构的系统描述编号

  • 字节 0:风扇数量

  • 字节 1:温度传感器数量

  • 字节 2:未知

  • 字节 3:散热配置文件数量

0x03

列出给定索引处的 ID 或资源。 风扇 ID、温度 ID、未知 ID 和散热配置文件 ID 以该确切顺序排列。

操作 0x02 用于了解哪些索引映射到哪些资源。

返回: 给定索引处的 ID

  • 字节 1:索引

0x04

获取给定温度传感器的当前温度。

  • 字节 1:传感器 ID

0x05

获取给定风扇的当前 RPM。

  • 字节 1:风扇 ID

0x06

获取风扇速度百分比。(并非在每个型号中都实现)

  • 字节 1:风扇 ID

0x07

未知。

  • 未知

0x08

获取给定风扇 ID 的最小 RPM。

  • 字节 1:风扇 ID

0x09

获取给定风扇 ID 的最大 RPM。

  • 字节 1:风扇 ID

0x0A

获取平衡散热配置文件 ID。

0x0B

获取当前散热配置文件 ID。

0x0C

获取给定风扇 ID 的当前 boost 值。

  • 字节 1:风扇 ID

1.2.3. WMI 方法 Thermal_Control([in] uint32 arg2, [out] uint32 argr)

操作 (字节 0)

描述

参数

0x01

激活给定的散热配置文件。

  • 字节 1:散热配置文件 ID

0x02

为给定的风扇 ID 设置一个 boost 值。

  • 字节 1:风扇 ID

  • 字节 2:Boost

以下是已知的散热配置文件代码

散热配置文件

类型

ID

自定义

特殊

0x00

G 模式

特殊

0xAB

安静

传统

0x96

平衡

传统

0x97

平衡性能

传统

0x98

性能

传统

0x99

平衡

USTT

0xA0

平衡性能

USTT

0xA1

酷冷

USTT

0xA2

安静

USTT

0xA3

性能

USTT

0xA4

低功耗

USTT

0xA5

如果一个型号支持用户可选散热表 (USTT) 配置文件,它将不支持传统配置文件,反之亦然。

每个型号都支持自定义 (0x00) 散热配置文件。 G 系列笔记本电脑中的 GMODE 取代了性能。

1.2.4. WMI 方法 GameShiftStatus([in] uint32 arg2, [out] uint32 argr)

操作 (字节 0)

描述

参数

0x01

切换游戏变速

0x02

获取游戏变速状态。

游戏变速状态不会改变风扇速度配置文件,但它可能是一种 CPU/GPU 电源配置文件。 尚未进行基准测试。

此方法仅存在于 Dell G 系列笔记本电脑上,它的实现意味着 GMODE 散热配置文件可用,即使 Thermal_Information 的操作 0x03 没有列出它。

Dell G 系列笔记本电脑上的 G 键也会改变游戏变速状态,因此两者直接相关。

1.3. 超频方法

1.3.1. WMI 方法 MemoryOCControl([in] uint32 arg2, [out] uint32 argr)

AWCC 支持内存超频,但此方法非常复杂,尚未被破译。

1.4. GPIO 控制方法

具有 AWCC 接口的 Alienware 和 Dell G 系列设备通常具有带 USB/HID 功能的嵌入式 STM32 RGB 照明控制器。 其供应商 ID 为 187c,而其产品 ID 可能因型号而异。

为了调试目的,该 MCU 的两个 GPIO 引脚的控制被公开为 WMI 方法。

引脚

描述

0

设备固件更新 (DFU) 模式引脚。

HIGH:在下次 MCU 启动时启用 DFU 模式。

LOW:在下次 MCU 启动时禁用 DFU 模式。

1

负复位 (NRST) 引脚。

HIGH:MCU 开启。

LOW:MCU 关闭。

有关此 MCU 的更多信息,请参见 致谢

注意

一些 GPIO 控制方法打破了通常的参数结构,并采用 引脚编号 代替第一个字节上的操作。

1.4.1. WMI 方法 FWUpdateGPIOtoggle([in] uint32 arg2, [out] uint32 argr)

操作 (字节 0)

描述

参数

引脚编号

设置引脚状态

  • 字节 1:引脚状态

1.4.2. WMI 方法 ReadTotalofGPIOs([out] uint32 argr)

操作 (字节 0)

描述

参数

不适用

获取 GPIO 的总数

注意

由于 WMI 方法在固件级别上的实现方式,因此在调用此方法时需要一个虚拟 uint32 输入参数。

1.4.3. WMI 方法 ReadGPIOpPinStatus([in] uint32 arg2, [out] uint32 argr)

操作 (字节 0)

描述

参数

引脚编号

获取引脚状态

注意

在某些笔记本电脑中,已知固件存在一个错误,即读取引脚的状态也会翻转它。

1.5. 其他信息方法

1.5.1. WMI 方法 ReadChassisColor([out] uint32 argr)

返回机箱颜色内部 ID。

1.6. 致谢

感谢

记录和测试此设备的某些功能,从而使其可以推广此驱动程序。