rfkill_alloc(9)
π 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 theRFKILL_TYPE_*values β¨opsβ the rfkill methods. this is aconst 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 π
- Kernel file
./include/linux/rfkill.h struct rfkill_ops(9)rfkill_register(9)rfkill_pause_polling(9)rfkill_resume_polling(9)rfkill_unregister(9)rfkill_destroy(9)rfkill_set_hw_state_reason(9)rfkill_set_hw_state(9)rfkill_set_sw_state(9)rfkill_init_sw_state(9)rfkill_set_states(9)rfkill_blocked(9)rfkill_soft_blocked(9)rfkill_find_type(9)rfkill_get_led_trigger_name(9)rfkill_set_led_trigger_name(9)
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
- 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