RADIO(9)
πΈ RADIO(9) πΈ
okay so this is the Kernel Developer's Manual page for radio and bestie, it's literally the glow-up guide for FM radio drivers π
β¨ NAME β¨
radio β the interface between low- and high-level FM radio drivers π
π¦ SYNOPSIS π¦
#include <dev/radio_if.h>
device_t
radio_attach_mi(const struct radio_hw_if *rhwp, void *hdlp,
device_t dev);
π DESCRIPTION π
so the radio layer is the whole support system for digitally programmable FM radio tuners β¨ like, it's giving backstage crew for your tuner's main character moment.
It's split into two parts, no cap:
- a machine independent, high-level part whose whole job is managing device files π
- the low-level hardware drivers π§
The high-level radio driver attaches to the low-level driver when the latter calls radio_attach_mi(). that's the meet-cute fr fr π«Ά
The radio_hw_if struct holds pointers to functions that the low-level driver provides. The hdlp argument is a handle to a low-level driver's softc structure β it gets sent as the first argument to all the functions in radio_hw_if whenever the high-level driver calls them, every single time, no exceptions π And dev is the device struct for the hardware device.
The fields of radio_hw_if get described in a lil more detail right below π
struct radio_hw_if {
int (*open)(void *, int, int, struct lwp *);
int (*close)(void *, int, int, struct lwp *);
int (*get_info)(void *, struct radio_info *);
int (*set_info)(void *, struct radio_info *);
int (*search)(void *, int);
};
π the function pointers, one by one
(*open)(sc, flags, fmt, lwp)β gets called when the radio device is opened πͺ Optionally, if there's genuinely no need to call a driver's function when the device file is opened, passNULLin this field. Returns0on success, otherwise an error code.(*close)(sc, flags, fmt, lwp)β gets called when the radio device is closed πͺβ¨ Optionally, if there's no need to call a driver's function when the device file is closed, passNULLin this field. Returns0on success, otherwise an error code.(*get_info)(sc, ri)β fills theradio_infostruct π This one is used to obtain the current state of a hardware device. It runs as a result of callingRIOCGINFOon a device file managed by the high-level driver. Returns0on success, otherwise an error code.(*set_info)(sc, ri)β sets values from theradio_infostruct π₯ This one is used to modify the current state of a hardware device (enable/disable various modes and parameters). It runs as a result of callingRIOCSINFOon a device file managed by the high-level driver. Returns0on success, otherwise an error code.(*search)(sc, ri)β kicks off the automatic search for the radio station π»β¨ It runs as a result of callingRIOCSSRCHon a device file managed by the high-level driver. Returns0on success, otherwise an error code.
friendly reminder bestie: every single one of these returns 0 on success, and an error code otherwise. that part is not optional, it's the vibe check π
π SEE ALSO π
π AUTHORS π
The radio API was written by Vladimir Popov and Maxim Tsyplakov for OpenBSD, and ported to NetBSD by Lennart Augustsson. legends only ππ
okay that's the whole page, bestie β go forth and slay those tuners π»β¨
this lil treasure came from the Debian edition, dated July 9, 2018 β mwah, sign-off complete ππ
π¦ where this page comes from
- nixpkgs unstable: netbsd-source 11.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms