lwmi_cd_alloc(9)
π lwmi_cd_alloc(9) β Kernel API Manual β¨
okay so bestie, we're in the Kernel API Manual today and the star of the show is lwmi_cd_alloc(9). yes it's a real function in the kernel, yes it sounds like a wifi password, no we're not scared of it π
πΈ NAME πΈ
lwmi_cd_alloc β allocate a cd_list struct in drvdata π
β SYNOPSIS β
int lwmi_cd_alloc (struct lwmi_cd_priv *priv , enum lwmi_cd_type type );
that's the whole vibe. two args, one int coming back at you π«Ά
π¦ ARGUMENTS π¦
privβ the lenovo-wmi-capdata driver data. that's its whole job, it's just the driver data holding it down πtypeβ the type of capability data. yeah. which flavour of capdata we're dealing with β¨
π DESCRIPTION π
so what does it actually do. it allocates a cd_list struct β and not just any size, bestie, it makes it large enough to contain data from all WMI data blocks provided by the interface. like it's not out here guessing, it's sizing the thing to fit everything the interface hands over π₯
it's giving "measure twice, allocate once" energy fr fr π
π RETURN π
0 on success, or an error. that's it. that's the contract. if you get 0 you're slaying, anything else is a whole situation π
π SEE ALSO π
the kernel file lives right here in all its glory:
Kernel file ./drivers/platform/x86/lenovo/wmi-capdata.c
and the whole friend group, no cap, every single one:
lwmi_cd_match(9)lwmi_cd_match_add_all(9)lwmi_cd_call_master_cb(9)lwmi_cd_component_bind(9)lwmi_cd_component_unbind(9)lwmi_cd_sub_master_bind(9)lwmi_cd_sub_master_unbind(9)lwmi_cd_sub_master_add(9)lwmi_cd_sub_master_del(9)lwmi_cd_sub_component_bind(9)lwmi_cd00_show(9)lwmi_cd01_show(9)lwmi_cd_fan_show(9)lwmi_cd_debugfs_show(9)lwmi_cd_debugfs_add(9)lwmi_cd_debugfs_remove(9)lwmi_cd_cache(9)lwmi_cd_fan_list_alloc_cache(9)lwmi_cd_setup(9)lwmi_cd01_notifier_call(9)lwmi_cd01_unregister(9)
π¦ and that's the page!! this came out of ./drivers/platform/x86/lenovo, dated October 2026, and it's filed under lwmi_cd_alloc(9) β mwah, go forth and allocate responsibly π
πβ¨
π¦ 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