rfkill_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– rfkill_alloc(9) β€” the Kernel API Manual, bestie edition πŸ’–

okay so you're reading the Kernel API Manual page for rfkill_alloc(9) and honestly? good instincts. let's get into it ✨


🌸 NAME 🌸

rfkill_alloc β€” allocate an rfkill structure. that's it. that's the whole name. iconic brevity πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct rfkill * rfkill_alloc (const char *name , struct device *parent ,
const enum rfkill_type type , const struct rfkill_ops *ops , void
*ops_data );

like, look at her. five args, returns a pointer to a struct rfkill, main character energy fr fr 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • name β€” the name of the struct. big warning bestie: the string is not copied internally, so it's giving "borrowed reference" not "stored forever". keep that string alive, mkay? πŸ’€
  • parent β€” the device that has the rf switch on it. the parent device. the one holding the switch. 🧚
  • type β€” the type of the switch, and it's one of the RFKILL_TYPE_* values ✨
  • ops β€” the rfkill methods. this is a const struct rfkill_ops *, iykyk.
  • ops_data β€” data passed to each method. every single one. πŸ“

🌈 DESCRIPTION 🌈

so the way that this works is: this function should be called by the transmitter driver to allocate an rfkill structure. that's your job, transmitter driver, no cap.

and if it fails? it returns NULL on failure. not me getting a NULL back and having to actually check it 😭 please check it.


πŸ‘‘ SEE ALSO πŸ‘‘

look at that reading list. go read them. all of them. obsessed πŸ’œ


⭐ so yeah, that's the whole page β€” brought to you by the folks at ./include/linux, vintage October 2026, and it's literally giving kernel documentation slay. mwah, go allocate something responsibly πŸ’…πŸŽ€

πŸ“¦ where this page comes from