STRUCT DATA_QUEUE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct data_queue(9) πŸ’–

okay so this is the struct data_queue manpage from the Kernel API Manual, and bestie, it's literally the blueprint for how a data queue is built in the rt2x00 wireless drivers. it's giving foundational. it's giving "read me before you touch anything." let's get into it ✨


🌸 NAME 🌸

struct data_queue β€” the Data queue itself, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole struct, character for character, because we do not paraphrase code in this house:

struct data_queue {
    struct rt2x00_dev *rt2x00dev;
    struct queue_entry *entries;
    enum data_queue_qid qid;
    unsigned long flags;
    struct mutex status_lock;
    spinlock_t tx_lock;
    spinlock_t index_lock;
    unsigned int count;
    unsigned short limit;
    unsigned short threshold;
    unsigned short length;
    unsigned short index[Q_INDEX_MAX];
    unsigned short wd_count;
    unsigned int wd_idx;
    unsigned short txop;
    unsigned short aifs;
    unsigned short cw_min;
    unsigned short cw_max;
    unsigned short data_size;
    unsigned char  desc_size;
    unsigned char  winfo_size;
    unsigned short priv_size;
    unsigned short usb_endpoint;
    unsigned short usb_maxpacket;
 };

like, look at her. every field is a little main character 🫢


πŸ‘‘ Members πŸ‘‘

one by one, no skips, we're being thorough today:

  • rt2x00dev β€” pointer to the main struct rt2x00dev that this queue belongs to. her home base, her origin story πŸ’«
  • entries β€” base address of the struct queue_entry things that are part of this queue. the actual squad.
  • qid β€” the queue identification, peep enum data_queue_qid for the deets.
  • flags β€” entry flags, check enum queue_entry_flags. iykyk.
  • status_lock β€” the mutex protecting the start/stop/flush handling on this queue. she's the bouncer for that whole operation 🚧
  • tx_lock β€” spinlock that serializes tx operations on this queue. one at a time, bestie, no shoving.
  • index_lock β€” spinlock protecting index handling. ⚠️ real talk: whenever index, index_done or index_crypt needs to be changed, you should grab this lock to prevent index corruption due to concurrency. don't skip it. that's a corruption warning, fr fr.
  • count β€” number of frames handled in the queue.
  • limit β€” maximum number of entries in the queue. the cap. the ceiling. the "no more room at the inn."
  • threshold β€” minimum number of free entries before the queue is kicked by force. yes, by force.
  • length β€” number of frames in the queue.
  • index β€” index pointers to entry positions in the queue; use enum queue_index to get a specific index field.
  • wd_count β€” watchdog counter, i.e. the number of times an entry does change in the queue. the watchdog is watching πŸ‘€
  • wd_idx β€” index of the queue entry saved by the watchdog.
  • txop β€” maximum burst time.
  • aifs β€” the aifs value for outgoing frames (this field is ignored in the RX queue πŸ™ˆ).
  • cw_min β€” the cw min value for outgoing frames (also ignored in the RX queue πŸ™ˆ).
  • cw_max β€” the cw max value for outgoing frames (ignored in the RX queue too πŸ™ˆ).
  • data_size β€” maximum data size for the frames in this queue.
  • desc_size β€” hardware descriptor size for the data in this queue.
  • priv_size β€” size of the per-queue_entry private data.
  • usb_endpoint β€” device endpoint used for communication (USB only). usb girlies only πŸ’…
  • usb_maxpacket β€” max packet size for the given endpoint (USB only). same, usb-only energy πŸ¦‹

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, linked exactly as listed β€” go say hi:

Kernel file ./drivers/net/wireless/ralink/rt2x00/rt2x00queue.h Entry frame size(9), enum data_queue_qid(9), enum skb_frame_desc_flags(9), struct skb_frame_desc(9), get_skb_frame_desc(9), enum rxdone_entry_desc_flags(9), RXDONE_SIGNAL_MASK(9), struct rxdone_entry_desc(9), enum txdone_entry_desc_flags(9), struct txdone_entry_desc(9), enum txentry_desc_flags(9), struct txentry_desc(9), enum queue_entry_flags(9), struct queue_entry(9), enum queue_index(9), enum data_queue_flags(9), queue_end(9), tx_queue_end(9), queue_next(9), queue_loop(9), queue_for_each(9), tx_queue_for_each(9), txall_queue_for_each(9), rt2x00queue_for_each_entry(9), rt2x00queue_empty(9), rt2x00queue_full(9), rt2x00queue_threshold(9), rt2x00queue_dma_timeout(9), _rt2x00_desc_read(9), rt2x00_desc_read(9), rt2x00_desc_write(9)


okay and for the sign-off πŸŽ€: this page lives at ./drivers/net/wireless/ralink/... and it's dated October 2026, version struct data_queue(9). that's the whole thing, bestie β€” go forth and queue your data responsibly πŸ’œβœ¨πŸ”₯

πŸ“¦ where this page comes from