lwmi_cd_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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:


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