STRUCT STA_INFO(9)
π 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βlistis the global linked list entry;free_listis 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 whenCONFIG_MAC80211_MESHis 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. π literallyremovedβ set to true when sta is being removed fromsta_list.uploadedβ set to true when sta is uploaded to the driver.sta_stateβ duplicates information about station state (for debug)._flagsβ STA flags, seeenum ieee80211_sta_info_flags, do not use directly. π¨ bestie do NOT touch this one directly, i'm beggingps_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. π«Ά memorieslast_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-ACstruct airtime_infodescribing 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 whenCONFIG_MAC80211_DEBUGFSis enabled)reserved_tidβ reserved TID (if any, otherwiseIEEE80211_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_stapoints either here or todeflink.agg.deflinkβ This is the default link STA information, for non MLO STA all link specific STA information is accessed throughdeflinkor throughlink[0]which points to address ofdeflink. For MLO Link STA the first added link STA will point todeflink.linkβ reference to Link Sta entries. For Non MLO STA, except 1st link, i.elink[0]all links would be assigned toNULLby default and would access link information viadeflinkorlink[0]. For MLO STA, first link STA being added will point its link pointer todeflinkaddress and remaining would be allocated and the address would be assigned tolink[link_id]wherelink_idis 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
- 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