STRUCT WIRELESS_DEV(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐ŸŒธ NAME ๐ŸŒธ

okay so this page is struct wireless_dev(9) from the Kernel API Manual, and it's literally wireless device state โ€” that's the whole name, bestie ๐Ÿ’…

โœจ SYNOPSIS โœจ

here's the entire struct, no cap. every field, every semicolon, exactly as it appears:

       struct wireless_dev {
           struct wiphy *wiphy;
           enum nl80211_iftype iftype;
           struct list_head list;
           struct net_device *netdev;
           u32 identifier;
           struct list_head mgmt_registrations;
           u8 mgmt_registrations_need_update:1;
           bool use_4addr, is_running, registered, registering;
           u8 address[ETH_ALEN];
           struct cfg80211_conn *conn;
           struct cfg80211_cached_keys *connect_keys;
           enum ieee80211_bss_type conn_bss_type;
           u32 conn_owner_nlportid;
           struct wiphy_work disconnect_wk;
           u8 disconnect_bssid[ETH_ALEN];
           struct list_head event_list;
           spinlock_t event_lock;
           u8 connected:1;
           bool ps;
           int ps_timeout;
           u32 unexpected_nlportid;
           u32 owner_nlportid;
           bool nl_owner_dead;
         #ifdef CONFIG_CFG80211_WEXT;
           struct {
             struct cfg80211_ibss_params ibss;
             struct cfg80211_connect_params connect;
             struct cfg80211_cached_keys *keys;
             const u8 *ie;
             size_t ie_len;
             u8 bssid[ETH_ALEN];
             u8 prev_bssid[ETH_ALEN];
             u8 ssid[IEEE80211_MAX_SSID_LEN];
             s8 default_key, default_mgmt_key;
             bool prev_bssid_valid;
           } wext;
         #endif;
           struct wiphy_work cqm_rssi_work;
           struct cfg80211_cqm_config *cqm_config;
           struct list_head pmsr_list;
           spinlock_t pmsr_lock;
           struct wiphy_work pmsr_free_wk;
           unsigned long unprot_beacon_reported;
           union {
             struct {
               u8 connected_addr[ETH_ALEN];
               u8 ssid[IEEE80211_MAX_SSID_LEN];
               u8 ssid_len;
             } client;
             struct {
               int beacon_interval;
               struct cfg80211_chan_def preset_chandef;
               struct cfg80211_chan_def chandef;
               u8 id[IEEE80211_MAX_MESH_ID_LEN];
               u8 id_len, id_up_len;
             } mesh;
             struct {
               struct cfg80211_chan_def preset_chandef;
               u8 ssid[IEEE80211_MAX_SSID_LEN];
               u8 ssid_len;
             } ap;
             struct {
               struct cfg80211_internal_bss *current_bss;
               struct cfg80211_chan_def chandef;
               int beacon_interval;
               u8 ssid[IEEE80211_MAX_SSID_LEN];
               u8 ssid_len;
             } ibss;
             struct {
               struct cfg80211_chan_def chandef;
             } ocb;
             struct {
               u8 cluster_id[ETH_ALEN];
               u8 n_channels;
               struct cfg80211_chan_def *chandefs;
               bool sched_update_pending;
             } nan;
           } u;
           struct {
             u8 addr[ETH_ALEN];
             union {
               struct {
                 unsigned int beacon_interval;
                 struct cfg80211_chan_def chandef;
               } ap;
               struct {
                 struct cfg80211_internal_bss *current_bss;
               } client;
             };
             bool cac_started;
             unsigned long cac_start_time;
             unsigned int cac_time_ms;
           } links[IEEE80211_MLD_MAX_NUM_LINKS];
           u16 valid_links;
           u32 radio_mask;
        };

๐Ÿงฉ Members ๐Ÿงฉ

okay bestie, here's the field-by-field tour โ€” yes there are a lot, so hydrate first ๐Ÿ’–

  • wiphy โ€” pointer to hardware description.
  • iftype โ€” interface type.
  • list โ€” (private) used to collect the interfaces.
  • netdev โ€” (private) used to reference back to the netdev; it may be NULL.
  • identifier โ€” (private) identifier used in nl80211 to identify this wireless device if it has no netdev.
  • mgmt_registrations โ€” list of registrations for management frames.
  • mgmt_registrations_need_update โ€” mgmt registrations were updated, and the update needs to be propagated to the driver.
  • use_4addr โ€” indicates 4addr mode is used on this interface. It must be set by the driver (if supported) on add_interface BEFORE registering the netdev, and may otherwise be used by the driver read-only; cfg80211 will update it on change_interface.
  • is_running โ€” true if this is a non-netdev device that has been started, e.g. the P2P Device.
  • registered โ€” is this wdev already registered with cfg80211?
  • registering โ€” indicates we're doing registration under wiphy lock for the notifier.
  • address โ€” the address for this device, valid only if netdev is NULL.
  • conn โ€” (private) cfg80211 software SME connection state machine data.
  • connect_keys โ€” (private) keys to set after connection is established.
  • conn_bss_type โ€” connecting/connected BSS type.
  • conn_owner_nlportid โ€” (private) connection owner socket port ID.
  • disconnect_wk โ€” (private) auto-disconnect work.
  • disconnect_bssid โ€” (private) the BSSID to use for auto-disconnect.
  • event_list โ€” (private) list for internal event processing.
  • event_lock โ€” (private) lock for event list.
  • connected โ€” indicates if connected or not (STA mode).
  • ps โ€” powersave mode is enabled.
  • ps_timeout โ€” dynamic powersave timeout.
  • unexpected_nlportid โ€” (private) netlink port ID of application registered for unexpected frames (AP mode or NAN_DATA mode).
  • owner_nlportid โ€” (private) owner socket port ID.
  • nl_owner_dead โ€” (private) owner socket went away.
  • wext โ€” (private) used by the internal wireless extensions compat code.
    • wext.ibss โ€” (private) IBSS data part of wext handling.
    • wext.connect โ€” (private) connection handling data.
    • wext.keys โ€” (private) (WEP) key data.
    • wext.ie โ€” (private) extra elements for association.
    • wext.ie_len โ€” (private) length of extra elements.
    • wext.bssid โ€” (private) selected network BSSID.
    • wext.prev_bssid โ€” (private) previous BSSID for reassociation.
    • wext.ssid โ€” (private) selected network SSID.
    • wext.default_key โ€” (private) selected default key index.
    • wext.default_mgmt_key โ€” (private) selected default management key index.
    • wext.prev_bssid_valid โ€” (private) previous BSSID validity.
  • cqm_rssi_work โ€” (private) CQM RSSI reporting work.
  • cqm_config โ€” (private) nl80211 RSSI monitor state.
  • pmsr_list โ€” (private) peer measurement requests.
  • pmsr_lock โ€” (private) peer measurements requests/results lock.
  • pmsr_free_wk โ€” (private) peer measurements cleanup work.
  • unprot_beacon_reported โ€” (private) timestamp of last unprotected beacon report.
  • u โ€” union containing data specific to iftype.
  • links โ€” array of IEEE80211_MLD_MAX_NUM_LINKS elements containing addr, ap, and client for each link.
    • {unnamed_union} โ€” anonymous.
    • links.cac_started โ€” true if DFS channel availability check has been started.
    • links.cac_start_time โ€” timestamp (jiffies) when the dfs state was entered.
    • links.cac_time_ms โ€” CAC time in ms.
  • valid_links โ€” bitmap describing what elements of links are valid.
  • radio_mask โ€” bitmask of radios that this interface is allowed to operate on.

๐Ÿ’ฌ Description ๐Ÿ’ฌ

for netdevs, this structure must be allocated by the driver that uses the ieee80211_ptr field in struct net_device. that's intentional, bestie โ€” it means the struct can be allocated along with the netdev ๐Ÿซถ

it need not be registered then, because netdev registration will be intercepted by cfg80211 so it can see the new wireless device. HOWEVER โ€” drivers must lock the wiphy before registering or unregistering netdevs if they pre-create any netdevs. in ops called from cfg80211, the wiphy is already locked, so that part is handled.

โš ๏ธ the wiphy lock rule is not a vibe suggestion: drivers must lock the wiphy before registering or unregistering netdevs if they pre-create any netdevs.

for non-netdev uses, it must also be allocated by the driver in response to the cfg80211 callbacks that require it. since there's no netdev registration in that case, it may not be allocated outside of callback operations that return it. periodt ๐Ÿ’…

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

okay bestie, this is the part where the page just flexes its entire social circle ๐Ÿ’… like genuinely, this SEE ALSO is not a list, it's a group chat with 359 members and everyone's talking at once. Buckle in. We're going one by one, in order, no skipping, no cap.

First up, the place you actually open before any of this makes sense โ€” the kernel file itself:

  • ./include/net/cfg80211.h

and the two big-picture pages that set the whole scene:

then we get into the channel / rate / capability era of the list, and honestly it's giving "collect the whole set" energy โœจ


the "Actions and configuration" arc โ€” this is the main character section, fr fr, it goes on forever and every single one of these deserves its own moment ๐ŸŽ€

then the survey + crypto + beacon/AP batch rolls in like a whole friend group arriving at the function ๐Ÿฆ‹

  • enum survey_info_flags(9)
  • struct survey_info(9)
  • struct cfg80211_crypto_settings(9)
  • struct cfg80211_mbssid_config(9)
  • struct cfg80211_mbssid_elems(9)
  • struct cfg80211_rnr_elems(9)
  • struct cfg80211_beacon_data(9)
  • struct cfg80211_acl_data(9)
  • struct cfg80211_fils_discovery(9)
  • struct cfg80211_unsol_bcast_probe_resp(9)
  • struct cfg80211_s1g_short_beacon(9)
  • struct cfg80211_ap_settings(9)
  • struct cfg80211_ap_update(9)
  • struct cfg80211_csa_settings(9)
  • struct cfg80211_color_change_settings(9)
  • struct iface_combination_params(9)

and now the station-adjacent era of the list, where the names get long and lowkey iconic for it:

  • enum station_parameters_apply_mask(9)
  • struct sta_txpwr(9)
  • struct link_station_parameters(9)
  • struct link_station_del_parameters(9)
  • struct cfg80211_ttlm_params(9)
  • struct station_parameters(9)
  • struct station_del_parameters(9)
  • enum cfg80211_station_type(9)
  • cfg80211_check_station_change(9)
  • enum rate_info_flags(9)
  • enum rate_info_bw(9)
  • struct rate_info(9)
  • enum bss_param_flags(9)
  • struct sta_bss_parameters(9)
  • struct cfg80211_txq_stats(9)
  • struct cfg80211_tid_stats(9)
  • struct link_station_info(9)
  • struct station_info(9)
  • struct cfg80211_sar_sub_specs(9)
  • struct cfg80211_sar_specs(9)
  • struct cfg80211_sar_freq_ranges(9)
  • struct cfg80211_sar_capa(9)
  • cfg80211_get_station(9)
  • enum monitor_flags(9)
  • enum mpath_info_flags(9)
  • struct mpath_info(9)
  • enum wiphy_bss_param_flags(9)
  • struct bss_parameters(9)
  • struct mesh_config(9)
  • struct mesh_setup(9)
  • struct ocb_setup(9)
  • struct ieee80211_txq_params(9)

Scanning and BSS list handling โ€” okay this one ate, no notes ๐Ÿ”ฅ the entire scan/auth/assoc/connect drama lives here:

  • Scanning and BSS list handling(9)
  • struct cfg80211_ssid(9)
  • struct cfg80211_scan_info(9)
  • struct cfg80211_scan_6ghz_params(9)
  • struct cfg80211_scan_request(9)
  • struct cfg80211_match_set(9)
  • struct cfg80211_sched_scan_plan(9)
  • struct cfg80211_bss_select_adjust(9)
  • struct cfg80211_sched_scan_request(9)
  • enum cfg80211_signal_type(9)
  • struct cfg80211_inform_bss(9)
  • struct cfg80211_bss_ies(9)
  • struct cfg80211_bss(9)
  • ieee80211_bss_get_elem(9)
  • ieee80211_bss_get_ie(9)
  • struct cfg80211_auth_request(9)
  • struct cfg80211_assoc_link(9)
  • struct cfg80211_ml_reconf_req(9)
  • enum cfg80211_assoc_req_flags(9)
  • struct cfg80211_assoc_request(9)
  • struct cfg80211_deauth_request(9)
  • struct cfg80211_disassoc_request(9)
  • struct cfg80211_ibss_params(9)
  • struct cfg80211_bss_selection(9)
  • struct cfg80211_connect_params(9)
  • enum cfg80211_connect_params_changed(9)
  • enum wiphy_params_flags(9)
  • struct cfg80211_pmksa(9)
  • struct cfg80211_pkt_pattern(9)
  • struct cfg80211_wowlan_tcp(9)
  • struct cfg80211_wowlan(9)
  • struct cfg80211_coalesce_rules(9)
  • struct cfg80211_coalesce(9)
  • struct cfg80211_wowlan_nd_match(9)
  • struct cfg80211_wowlan_nd_info(9)
  • struct cfg80211_wowlan_wakeup(9)
  • struct cfg80211_gtk_rekey_data(9)
  • struct cfg80211_update_ft_ies_params(9)
  • struct cfg80211_mgmt_tx_params(9)
  • struct cfg80211_dscp_exception(9)
  • struct cfg80211_dscp_range(9)
  • struct cfg80211_qos_map(9)

Neighbor Awareness Networking (NAN) โ€” the section name is a whole mouthful and we respect it ๐Ÿ’…

  • Neighbor Awareness Networking (NAN)(9)
  • struct cfg80211_nan_band_config(9)
  • struct cfg80211_nan_conf(9)
  • struct cfg80211_nan_channel(9)
  • struct cfg80211_nan_local_sched(9)
  • struct cfg80211_nan_peer_map(9)
  • struct cfg80211_nan_peer_sched(9)
  • enum cfg80211_nan_conf_changes(9)
  • struct cfg80211_nan_func_filter(9)
  • struct cfg80211_nan_func(9)

and then back into the general struct parade, bestie there is no break, we go straight through:

  • struct cfg80211_pmk_conf(9)
  • struct cfg80211_external_auth_params(9)
  • struct cfg80211_ftm_responder_stats(9)
  • struct cfg80211_pmsr_ftm_result(9)
  • struct cfg80211_pmsr_result(9)
  • struct cfg80211_pmsr_ftm_request_peer(9)
  • struct cfg80211_pmsr_request_peer(9)
  • struct cfg80211_pmsr_request(9)
  • struct cfg80211_update_owe_info(9)
  • struct mgmt_frame_regs(9)

the wiphy era โ€” this is where it gets REAL. struct cfg80211_ops shows up and then it's just wiphy everything for the next hundred lines ๐Ÿ˜ญ


Utility functions โ€” the little helpers that make everything else possible, we stan ๐ŸŒธ


Data path helpers</purl> โ€” okay so these are the ones dealing with the actual frame-shuffling, and the list is lowkey huge:


Regulatory enforcement infrastructure โ€” the "please don't transmit where you're not allowed" department, genuinely important, no games ๐Ÿ’€

and the Internal regulatory db functions flavor right after it:


back to the cfg80211 function parade, and this stretch is long bestie, like genuinely buckle in ๐Ÿซถ


RFkill integration โ€” only three entries and honestly? concise queen โญ

Vendor commands โ€” the "your hardware vendor does its own thing" corner, iykyk:

Test mode โ€” four entries, tiny, cute, does exactly what it says ๐ŸŽ€


and then the biggest run of the whole list starts, and it does NOT let up ๐Ÿ˜ญ connection stuff, roaming, stations, mgmt frames, notifications, all of it:

okay so the cross-reference section keeps going, and honestly? it's giving phone book but make it networking ๐Ÿ’… โ€” here's the whole rest of the list, no cap, nothing skipped:


and that's the whole page, bestie, start to finish, not one reference left behind ๐Ÿ’– go read one of them, i'll wait. this one lives at ./include/net, it's the October 2026 edition, and it's all about struct wireless_dev(9) โ€” periodt. ๐ŸŒธ๐Ÿ‘‘

๐Ÿ“ฆ where this page comes from