armoury_set_devstate(9)
β¨ armoury_set_devstate(9) β¨
okay bestie, welcome to armoury_set_devstate β it's from the Kernel API Manual and it's the function that actually sets your WMI function state π like it's the whole vibe check for writing values, no cap.
πΈ NAME πΈ
armoury_set_devstate β set the WMI function state, periodt.
π SYNOPSIS π
int armoury_set_devstate (struct kobj_attribute *attr , u32 value , u32
*retval , u32 dev_id );
π¦ ARGUMENTS π¦
attrβ thekobj_attributethat's tied to the WMI function being called. it's giving "the handle for the thing you're poking" π«Άvalueβ the shiny new value you wanna set β¨retvalβ where you stash the value coming back from WMI, orNULLif you literally don't care. your call bestie πdev_idβ the WMI method ID to call β the actual address of the function, iykyk π
π DESCRIPTION π
so the intended usage is from the sysfs attribute setting that's associated with the WMI function. and before you call this, you gotta check that the function is even present first β vibe check the function before you use it, fr fr π₯
every single WMI write MUST go through this function to enforce the safety checks. not "most", not "usually" β every. no skipping, no shortcuts, no "not me" energy π this is the main character of WMI writes π
and here's the tea β: a result of !1 is usually considered a fail by ASUS. usually. but some WMI methods (like eGPU or CPU cores, iconic exceptions that they are) do use > 1 to return a status code or similar. in these cases the caller is interested in the actual return value and should perform the relevant checks themselves π
so like, read the room and check what your method does.
β RETURN β
-EINVALβ attempt to set a dangerous or unsupported value π like bestie no, that's not allowed-EIOβ the WMI function returned an error π it did not slay0β successful andretvalis filled π ate and left no crumbs- other β an error from the WMI call, go investigate π΅οΈββοΈ
π SEE ALSO π
- Kernel file
./drivers/platform/x86/asus-armoury.cβ the source, go read it π§ armoury_has_devstate(9)armoury_get_devstate(9)is_power_tunable_attr(9)has_valid_limit(9)
π¦ okay that's the whole page bestie, you're officially educated. this lil cutie lives in ./drivers/platform/x86 and the version tag says October 2026 β go forth, set those devstates safely, and remember: presence check first, always ππβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms