armoury_set_devstate(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 β€” the kobj_attribute that'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, or NULL if 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 slay
  • 0 β€” successful and retval is filled πŸŽ‰ ate and left no crumbs
  • other β€” an error from the WMI call, go investigate πŸ•΅οΈβ€β™€οΈ

🌈 SEE ALSO 🌈


πŸ¦‹ 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