STRUCT STA_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct sta_info(9) πŸŽ€

okay so this is a page from the Kernel API Manual and honestly? it's a whole main-character struct. bestie, we're looking at struct sta_info, which is literally the internal scoop on a station β€” everything mac80211 knows about the peer it's talking to. grab a strawberry drink πŸ“, we're going in.

✨ NAME ✨

struct sta_info β€” STA information. that's it, that's the vibe. πŸ’…

🌸 SYNOPSIS 🌸

here's the whole struct, copied exactly, no cap, don't touch it:

struct sta_info {
    struct list_head list, free_list;
    struct rcu_head rcu_head;
    struct rhlist_head hash_node;
    u8 addr[ETH_ALEN];
    struct ieee80211_local *local;
    struct ieee80211_sub_if_data *sdata;
    struct ieee80211_key *ptk[NUM_DEFAULT_KEYS];
    u8 ptk_idx;
    struct rate_control_ref *rate_ctrl;
    void *rate_ctrl_priv;
    spinlock_t rate_ctrl_lock;
    spinlock_t lock;
    struct ieee80211_fast_tx *fast_tx;
    struct ieee80211_fast_rx *fast_rx;
  #ifdef CONFIG_MAC80211_MESH;
    struct mesh_sta *mesh;
  #endif;
    struct work_struct drv_deliver_wk;
    u16 listen_interval;
    bool dead;
    bool removed;
    bool uploaded;
    enum ieee80211_sta_state sta_state;
    unsigned long _flags;
    spinlock_t ps_lock;
    struct sk_buff_head ps_tx_buf[IEEE80211_NUM_ACS];
    struct sk_buff_head tx_filtered[IEEE80211_NUM_ACS];
    unsigned long driver_buffered_tids;
    unsigned long txq_buffered_tids;
    u64 assoc_at;
    long last_connected;
    __le16 last_seq_ctrl[IEEE80211_NUM_TIDS + 1];
    u16 tid_seq[IEEE80211_QOS_CTL_TID_MASK + 1];
    struct airtime_info airtime[IEEE80211_NUM_ACS];
    u16 airtime_weight;
    struct sta_ampdu_mlme ampdu_mlme;
  #ifdef CONFIG_MAC80211_DEBUGFS;
    struct dentry *debugfs_dir;
  #endif;
    u8 reserved_tid;
    s8 amsdu_mesh_control;
    struct cfg80211_chan_def tdls_chandef;
    struct ieee80211_fragment_cache frags;
    struct ieee80211_sta_aggregates cur;
    struct link_sta_info deflink;
    struct link_sta_info *link[IEEE80211_MLD_MAX_NUM_LINKS];
    struct ieee80211_sta_removed_link_stats rem_link_stats;
    struct ieee80211_sta sta;
};

πŸ¦‹ Members πŸ¦‹

every single field, bestie, in order, zero skips:

  • list, free_list β€” list is the global linked list entry; free_list is the list entry for keeping track of stations to free. two lists, two jobs, both iconic.
  • rcu_head β€” the RCU head used for freeing this station struct. cleanup era ✨
  • hash_node β€” hash node for rhashtable.
  • addr β€” station's MAC address β€” duplicated from public part to let the hash table work with just a single cacheline. efficiency queen πŸ‘‘
  • local β€” pointer to the global information.
  • sdata β€” the virtual interface this station belongs to.
  • ptk β€” peer keys negotiated with this station, if any.
  • ptk_idx β€” last installed peer key index.
  • rate_ctrl β€” rate control algorithm reference.
  • rate_ctrl_priv β€” rate control private per-STA pointer.
  • rate_ctrl_lock β€” spinlock used to protect rate control data (data inside the algorithm, so it serializes calls there).
  • lock β€” used for locking all fields that require locking, see comments in the header file. πŸ‘€ go read the header, i'm serious.
  • fast_tx β€” TX fastpath information.
  • fast_rx β€” RX fastpath information.
  • mesh β€” mesh STA information. (only exists when CONFIG_MAC80211_MESH is in the chat)
  • drv_deliver_wk β€” used for delivering frames after driver PS unblocking.
  • listen_interval β€” listen interval of this station, when we're acting as AP.
  • dead β€” set to true when sta is unlinked. πŸ’€ literally
  • removed β€” set to true when sta is being removed from sta_list.
  • uploaded β€” set to true when sta is uploaded to the driver.
  • sta_state β€” duplicates information about station state (for debug).
  • _flags β€” STA flags, see enum ieee80211_sta_info_flags, do not use directly. 🚨 bestie do NOT touch this one directly, i'm begging
  • ps_lock β€” used for powersave (when mac80211 is the AP) related locking.
  • ps_tx_buf β€” buffers (per AC) of frames to transmit to this station when it leaves power saving state or polls.
  • tx_filtered β€” buffers (per AC) of frames we already tried to transmit but were filtered by hardware due to STA having entered power saving state, these are also delivered to the station when it leaves powersave or polls for frames.
  • driver_buffered_tids β€” bitmap of TIDs the driver has data buffered on.
  • txq_buffered_tids β€” bitmap of TIDs that mac80211 has txq data buffered on.
  • assoc_at β€” clock boottime (in ns) of last association.
  • last_connected β€” time (in seconds) when a station got connected. 🫢 memories
  • last_seq_ctrl β€” last received seq/frag number from this STA (per TID plus one for non-QoS frames).
  • tid_seq β€” per-TID sequence numbers for sending to this STA.
  • airtime β€” per-AC struct airtime_info describing airtime statistics for this station.
  • airtime_weight β€” station weight for airtime fairness calculation purposes. fair and balanced, we love to see it ⭐
  • ampdu_mlme β€” A-MPDU state machine state.
  • debugfs_dir β€” debug filesystem directory dentry. (only when CONFIG_MAC80211_DEBUGFS is enabled)
  • reserved_tid β€” reserved TID (if any, otherwise IEEE80211_TID_UNRESERVED).
  • amsdu_mesh_control β€” track the mesh A-MSDU format used by the peer: (the values it can take are listed down in Description, keep scrolling 🧚)
  • tdls_chandef β€” a TDLS peer can have a wider chandef that is compatible to the BSS one.
  • frags β€” fragment cache.
  • cur β€” storage for aggregation data; struct ieee80211_sta points either here or to deflink.agg.
  • deflink β€” This is the default link STA information, for non MLO STA all link specific STA information is accessed through deflink or through link[0] which points to address of deflink. For MLO Link STA the first added link STA will point to deflink.
  • link β€” reference to Link Sta entries. For Non MLO STA, except 1st link, i.e link[0] all links would be assigned to NULL by default and would access link information via deflink or link[0]. For MLO STA, first link STA being added will point its link pointer to deflink address and remaining would be allocated and the address would be assigned to link[link_id] where link_id is the id assigned by the AP.
  • rem_link_stats β€” accumulated removed link stats.
  • sta β€” station information we share with the driver. 🀝

πŸ’œ Description πŸ’œ

This structure collects information about a station that mac80211 is communicating with. that's the whole point, that's the assignment, it ate and left no crumbs.

and for the A-MSDU mesh control values, the page gives you this little legend:

  • -1: not yet known
  • 0: non-mesh A-MSDU length field
  • 1: big-endian mesh A-MSDU length field
  • 2: little-endian mesh A-MSDU length field

🌈 SEE ALSO 🌈

go read these next, i'm obsessed with cross-references: Kernel file ./net/mac80211/sta_info.h, enum ieee80211_sta_info_flags(9), struct tid_ampdu_tx(9), struct tid_ampdu_rx(9), struct sta_ampdu_mlme(9), struct ieee80211_fast_tx(9), struct ieee80211_fast_rx(9), struct mesh_sta(9), struct link_sta_info(9), struct ieee80211_sta_removed_link_stats(9), __sta_info_flush(9), sta_info_flush(9).


and that's the page, bestie πŸŽ€ sign-off time: this one comes from ./net/mac80211, dated October 2026, and it's filed under struct sta_info(9). slay, go read some kernel source πŸ’–

πŸ“¦ where this page comes from