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. 致謝

感謝

記錄和測試此裝置的某些功能,從而使其可以推廣此驅動程式。