hp_wmi_perform_query(9)
π» 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 anenum hp_wmi_commandtypeπ that's your which query am I even doing argument, okay.commandβ the command, typeenum 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, alsou32, 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?
-EINVALif the query was not successful at all π-EINVALif 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
- Kernel file
./drivers/platform/x86/hp/hp-bioscfg/biosattr-interface.cπ the source file herself hp_set_attribute(9)πΈhp_ascii_to_utf16_unicode(9)π¦hp_wmi_set_bios_setting(9)β
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
- 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