STRUCT DVB_USB_DEVICE(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’… struct dvb_usb_device(9) โ€” Kernel API Manual realness โœจ

okay so bestie, this is the manual page for struct dvb_usb_device (that'd be the object of a DVB USB device, iykyk) โ€” straight outta the Kernel API Manual. buckle up, it's giving data-structure lore ๐ŸŽ€


๐ŸŒธ NAME ๐ŸŒธ

struct dvb_usb_device โ€” the object of a DVB USB device. literally the main character of every dvb-usb driver ๐Ÿ’–


โœจ SYNOPSIS โœจ

struct dvb_usb_device {
    struct dvb_usb_device_properties props;
    const struct dvb_usb_device_description *desc;
    struct usb_device *udev;
  #define DVB_USB_STATE_INIT        0x000;
  #define DVB_USB_STATE_I2C         0x001;
  #define DVB_USB_STATE_DVB         0x002;
  #define DVB_USB_STATE_REMOTE      0x004;
    int state;
    int powered;
    struct mutex data_mutex;
    struct mutex usb_mutex;
    struct mutex i2c_mutex;
    struct i2c_adapter i2c_adap;
    int num_adapters_initialized;
    struct dvb_usb_adapter adapter[MAX_NO_OF_ADAPTER_PER_DEVICE];
    struct rc_dev *rc_dev;
    struct input_dev *input_dev;
    char rc_phys[64];
    struct delayed_work rc_query_work;
    u32 last_event;
    int last_state;
    struct module *owner;
    void *priv;
 };

she's long, she's detailed, she's iconic ๐Ÿ‘‘


๐Ÿฆ‹ Members ๐Ÿฆ‹

  • props โ€” a copy of the struct dvb_usb_properties that this device belongs to. like, which family she's from ๐Ÿ’…
  • desc โ€” pointer to the device's struct dvb_usb_device_description.
  • udev โ€” pointer to the device's struct usb_device.
  • state โ€” the initialization and runtime state of the device. the vibe check variable, fr fr ๐Ÿ’ซ
  • powered โ€” says whether the device is powered or not. no cap: powered gets in/decremented on each call to modify the state. it's a lil counter, okay ๐Ÿ˜Œ
  • data_mutex โ€” mutex that protects the data structure used to store URB data ๐Ÿ”’
  • usb_mutex โ€” mutex of USB control messages (reading needs two messages, don't ask ๐Ÿ˜ญ). โš ๏ธ please notice: this mutex is used internally at the generic URB control functions. so if your driver uses dvb_usb_generic_rw and derived functions, do not lock it internally โ€” that's a one-way ticket to deadlock city ๐Ÿ’€
  • i2c_mutex โ€” mutex for i2c-transfers ๐ŸŽ€
  • i2c_adap โ€” the device's i2c_adapter, if it uses I2CoverUSB โœจ
  • num_adapters_initialized โ€” number of initialized adapters. a headcount, basically ๐Ÿงฎ
  • adapter โ€” the adapters themselves ๐Ÿซถ
  • rc_dev โ€” rc device for the remote control (rc-core mode) ๐Ÿ“บ
  • input_dev โ€” input device for the remote control (legacy mode) โ€” yes both modes exist, she's versatile ๐Ÿ’โ€โ™€๏ธ
  • rc_phys โ€” the rc device path ๐ŸŒˆ
  • rc_query_work โ€” a struct work_struct for frequent rc queries. she works hard โญ
  • last_event โ€” the last triggered event ๐Ÿ”ฅ
  • last_state โ€” the last state (no, pressed, repeat) โ€” pick a lane bestie ๐Ÿ’€
  • owner โ€” owner of the dvb_adapter ๐Ÿ‘‘
  • priv โ€” private data of the actual driver. it's allocated by dvb-usb, and the size is defined in size_of_priv of dvb_usb_properties ๐Ÿ™ˆ

๐Ÿ’œ SEE ALSO ๐Ÿ’œ

the whole friend group ๐Ÿซถ โ€” the kernel file ./drivers/media/usb/dvb-usb/dvb-usb.h, plus:

  • struct dvb_usb_device_description(9)
  • struct dvb_usb_adapter_fe_properties(9)
  • struct dvb_rc_legacy(9)
  • struct dvb_rc(9)
  • enum dvb_usb_mode(9)
  • struct dvb_usb_device_properties(9)
  • struct usb_data_stream(9)
  • struct dvb_usb_fe_adapter(9)
  • struct dvb_usb_adapter(9)

reminder bestie: this is kernel API, so treat the mutexes with the respect they deserve or the kernel will humble you ๐Ÿ˜ญ๐Ÿ’…

and that's the page!! sourced from ./drivers/media/usb/dvb-usb, dated October 2026, from the Kernel API Manual โ€” struct dvb_usb_device(9) slayed, no notes, periodt ๐ŸŒŸ๐Ÿฆ‹๐Ÿ’–

๐Ÿ“ฆ where this page comes from