hp_wmi_perform_query(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’» hp_wmi_perform_query(9) β€” the kernel API manpage, but make it make sense ✨

Okay bestie, so this one's a Kernel API Manual page (yes, man 9 girlies rise πŸ’…) for hp_wmi_perform_query. It's the HP WMI ✨query-performing✨ function, and it's lowkey the whole plumbing behind how the kernel talks WMI queries to your HP box. Let's get into it 🫢


πŸ“› NAME

hp_wmi_perform_query β€”

...and that's literally it. The manpage gives the function name and then just a dash, no description, ndthing. Not me leaving it blank on purpose β€” that's genuinely what the original says, fr fr 😭 So just know: it's hp_wmi_perform_query, and the name section is giving minimalist icon energy. Periodt.


πŸ“œ SYNOPSIS

int hp_wmi_perform_query (int query , enum hp_wmi_command command , void
*buffer , u32 insize , u32 outsize );

It returns an int, bestie. That's the main character of the whole page. 🌟


πŸŽ€ ARGUMENTS

  • query β€” the commandtype, and it's an enum hp_wmi_commandtype πŸ‘‘ that's your which query am I even doing argument, okay.
  • command β€” the command, type enum hp_wmi_command πŸ’« like, the actual verb of the operation.
  • buffer β€” the buffer used as input and/or output πŸ” yes, and/or, it does both jobs, multi-talented queen.
  • insize β€” size of the input buffer, u32, don't forget her πŸ“
  • outsize β€” size of the output buffer, also u32, also important 🧚

πŸ” DESCRIPTION

Okay so here's the return-value tea, and it's a whole little flowchart β˜• Let's break it down because the original runs it all together and we're better than that:

  • it returns zero on success βœ… iconic, no notes
  • an HP WMI query specific error code β€” and heads up: that one is positive ⚠️ so like, don't assume "non-zero = negative errno", okay?
  • -EINVAL if the query was not successful at all πŸ’€
  • -EINVAL if the output buffer size exceeds buffersize πŸ™ˆ yes, same error code for two different situations, that's just how it is, I don't make the rules
⚠️ Warning-ish vibe: two completely different failure modes both hand you back -EINVAL, so if you're debugging, don't assume it's only one thing. That's real, that's in the original, write it down ✍️

🧠 NOTE

The buffersize must at least be the maximum of the input and output size β€” like, the bigger of the two, not the sum, not the input, the max πŸ”₯ Write that on your forehead.

Real example from the page: the Battery info query is defined to have 1 byte input and 128 byte output. So the caller would do:

buffer = kzalloc(128, GFP_KERNEL);
ret = hp_wmi_perform_query(HPWMI_BATTERY_QUERY, HPWMI_READ, buffer, 1, 128);

See how 128 is the max of 1 and 128? That's the whole bit πŸ’‘ obsessed with the consistency honestly.


πŸ‘€ SEE ALSO

Go read those next, iykyk πŸ’œ


🌈 cute sign-off

That's the whole page bestie πŸŽ€ β€” brought to you by source ./drivers/platform/x86/hp/hp-b..., dated October 2026, and yeah, the footer is the same hp_wmi_perform_query(9) as the top because symmetry slays πŸ’…βœ¨ Go forth and pass the right outsize, ily, bye 🫢

πŸ“¦ where this page comes from