ENUM NL80211_COMMANDS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Okay bestie, buckle up πŸ’– this is enum nl80211_commands(9) β€” straight from the Kernel API Manual β€” and it’s literally the master list of supported nl80211 commands. Think of it as the group-chat roster for wireless stuff: every NL80211_CMD_* is a different message you can send. No cap, it’s long, so we’re doing it in chunks.

🌸 NAME 🌸

enum nl80211_commands β€” supported nl80211 commands, periodt.

✨ SYNOPSIS ✨

       enum nl80211_commands {
           NL80211_CMD_UNSPEC ,
           NL80211_CMD_GET_WIPHY ,
           NL80211_CMD_SET_WIPHY ,
           NL80211_CMD_NEW_WIPHY ,
           NL80211_CMD_DEL_WIPHY ,
           NL80211_CMD_GET_INTERFACE ,
           NL80211_CMD_SET_INTERFACE ,
           NL80211_CMD_NEW_INTERFACE ,
           NL80211_CMD_DEL_INTERFACE ,
           NL80211_CMD_GET_KEY ,
           NL80211_CMD_SET_KEY ,
           NL80211_CMD_NEW_KEY ,
           NL80211_CMD_DEL_KEY ,
           NL80211_CMD_GET_BEACON ,
           NL80211_CMD_SET_BEACON ,
           NL80211_CMD_START_AP ,
           NL80211_CMD_NEW_BEACON ,
           NL80211_CMD_STOP_AP ,
           NL80211_CMD_DEL_BEACON ,
           NL80211_CMD_GET_STATION ,
           NL80211_CMD_SET_STATION ,
           NL80211_CMD_NEW_STATION ,
           NL80211_CMD_DEL_STATION ,
           NL80211_CMD_GET_MPATH ,
           NL80211_CMD_SET_MPATH ,
           NL80211_CMD_NEW_MPATH ,
           NL80211_CMD_DEL_MPATH ,
           NL80211_CMD_SET_BSS ,
           NL80211_CMD_SET_REG ,
           NL80211_CMD_REQ_SET_REG ,
           NL80211_CMD_GET_MESH_CONFIG ,
           NL80211_CMD_SET_MESH_CONFIG ,
           NL80211_CMD_SET_MGMT_EXTRA_IE ,
           NL80211_CMD_GET_REG ,
           NL80211_CMD_GET_SCAN ,
           NL80211_CMD_TRIGGER_SCAN ,
           NL80211_CMD_NEW_SCAN_RESULTS ,
           NL80211_CMD_SCAN_ABORTED ,
           NL80211_CMD_REG_CHANGE ,
           NL80211_CMD_AUTHENTICATE ,
           NL80211_CMD_ASSOCIATE ,
           NL80211_CMD_DEAUTHENTICATE ,
           NL80211_CMD_DISASSOCIATE ,
           NL80211_CMD_MICHAEL_MIC_FAILURE ,
           NL80211_CMD_REG_BEACON_HINT ,
           NL80211_CMD_JOIN_IBSS ,
           NL80211_CMD_LEAVE_IBSS ,
           NL80211_CMD_TESTMODE ,
           NL80211_CMD_CONNECT ,
           NL80211_CMD_ROAM ,
           NL80211_CMD_DISCONNECT ,
           NL80211_CMD_SET_WIPHY_NETNS ,
           NL80211_CMD_GET_SURVEY ,
           NL80211_CMD_NEW_SURVEY_RESULTS ,
           NL80211_CMD_SET_PMKSA ,
           NL80211_CMD_DEL_PMKSA ,
           NL80211_CMD_FLUSH_PMKSA ,
           NL80211_CMD_REMAIN_ON_CHANNEL ,
           NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL ,
           NL80211_CMD_SET_TX_BITRATE_MASK ,
           NL80211_CMD_REGISTER_FRAME ,
           NL80211_CMD_REGISTER_ACTION ,
           NL80211_CMD_FRAME ,
           NL80211_CMD_ACTION ,
           NL80211_CMD_FRAME_TX_STATUS ,
           NL80211_CMD_ACTION_TX_STATUS ,
           NL80211_CMD_SET_POWER_SAVE ,
           NL80211_CMD_GET_POWER_SAVE ,
           NL80211_CMD_SET_CQM ,
           NL80211_CMD_NOTIFY_CQM ,
           NL80211_CMD_SET_CHANNEL ,
           NL80211_CMD_SET_WDS_PEER ,
           NL80211_CMD_FRAME_WAIT_CANCEL ,
           NL80211_CMD_JOIN_MESH ,
           NL80211_CMD_LEAVE_MESH ,
           NL80211_CMD_UNPROT_DEAUTHENTICATE ,
           NL80211_CMD_UNPROT_DISASSOCIATE ,
           NL80211_CMD_NEW_PEER_CANDIDATE ,
           NL80211_CMD_GET_WOWLAN ,
           NL80211_CMD_SET_WOWLAN ,
           NL80211_CMD_START_SCHED_SCAN ,
           NL80211_CMD_STOP_SCHED_SCAN ,
           NL80211_CMD_SCHED_SCAN_RESULTS ,
           NL80211_CMD_SCHED_SCAN_STOPPED ,
           NL80211_CMD_SET_REKEY_OFFLOAD ,
           NL80211_CMD_PMKSA_CANDIDATE ,
           NL80211_CMD_TDLS_OPER ,
           NL80211_CMD_TDLS_MGMT ,
           NL80211_CMD_UNEXPECTED_FRAME ,
           NL80211_CMD_PROBE_PEER ,
           NL80211_CMD_REGISTER_BEACONS ,
           NL80211_CMD_UNEXPECTED_4ADDR_FRAME ,
           NL80211_CMD_SET_NOACK_MAP ,
           NL80211_CMD_CH_SWITCH_NOTIFY ,
           NL80211_CMD_START_P2P_DEVICE ,
           NL80211_CMD_STOP_P2P_DEVICE ,
           NL80211_CMD_CONN_FAILED ,
           NL80211_CMD_SET_MCAST_RATE ,
           NL80211_CMD_SET_MAC_ACL ,
           NL80211_CMD_RADAR_DETECT ,
           NL80211_CMD_GET_PROTOCOL_FEATURES ,
           NL80211_CMD_UPDATE_FT_IES ,
           NL80211_CMD_FT_EVENT ,
           NL80211_CMD_CRIT_PROTOCOL_START ,
           NL80211_CMD_CRIT_PROTOCOL_STOP ,
           NL80211_CMD_GET_COALESCE ,
           NL80211_CMD_SET_COALESCE ,
           NL80211_CMD_CHANNEL_SWITCH ,
           NL80211_CMD_VENDOR ,
           NL80211_CMD_SET_QOS_MAP ,
           NL80211_CMD_ADD_TX_TS ,
           NL80211_CMD_DEL_TX_TS ,
           NL80211_CMD_GET_MPP ,
           NL80211_CMD_JOIN_OCB ,
           NL80211_CMD_LEAVE_OCB ,
           NL80211_CMD_CH_SWITCH_STARTED_NOTIFY ,
           NL80211_CMD_TDLS_CHANNEL_SWITCH ,
           NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH ,
           NL80211_CMD_WIPHY_REG_CHANGE ,
           NL80211_CMD_ABORT_SCAN ,
           NL80211_CMD_START_NAN ,
           NL80211_CMD_STOP_NAN ,
           NL80211_CMD_ADD_NAN_FUNCTION ,
           NL80211_CMD_DEL_NAN_FUNCTION ,
           NL80211_CMD_CHANGE_NAN_CONFIG ,
           NL80211_CMD_NAN_MATCH ,
           NL80211_CMD_SET_MULTICAST_TO_UNICAST ,
           NL80211_CMD_UPDATE_CONNECT_PARAMS ,
           NL80211_CMD_SET_PMK ,
           NL80211_CMD_DEL_PMK ,
           NL80211_CMD_PORT_AUTHORIZED ,
           NL80211_CMD_RELOAD_REGDB ,
           NL80211_CMD_EXTERNAL_AUTH ,
           NL80211_CMD_STA_OPMODE_CHANGED ,
           NL80211_CMD_CONTROL_PORT_FRAME ,
           NL80211_CMD_GET_FTM_RESPONDER_STATS ,
           NL80211_CMD_PEER_MEASUREMENT_START ,
           NL80211_CMD_PEER_MEASUREMENT_RESULT ,
           NL80211_CMD_PEER_MEASUREMENT_COMPLETE ,
           NL80211_CMD_NOTIFY_RADAR ,
           NL80211_CMD_UPDATE_OWE_INFO ,
           NL80211_CMD_PROBE_MESH_LINK ,
           NL80211_CMD_SET_TID_CONFIG ,
           NL80211_CMD_UNPROT_BEACON ,
           NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS ,
           NL80211_CMD_SET_SAR_SPECS ,
           NL80211_CMD_OBSS_COLOR_COLLISION ,
           NL80211_CMD_COLOR_CHANGE_REQUEST ,
           NL80211_CMD_COLOR_CHANGE_STARTED ,
           NL80211_CMD_COLOR_CHANGE_ABORTED ,
           NL80211_CMD_COLOR_CHANGE_COMPLETED ,
           NL80211_CMD_SET_FILS_AAD ,
           NL80211_CMD_ASSOC_COMEBACK ,
           NL80211_CMD_ADD_LINK ,
           NL80211_CMD_REMOVE_LINK ,
           NL80211_CMD_ADD_LINK_STA ,
           NL80211_CMD_MODIFY_LINK_STA ,
           NL80211_CMD_REMOVE_LINK_STA ,
           NL80211_CMD_SET_HW_TIMESTAMP ,
           NL80211_CMD_LINKS_REMOVED ,
           NL80211_CMD_SET_TID_TO_LINK_MAPPING ,
           NL80211_CMD_ASSOC_MLO_RECONF ,
           NL80211_CMD_EPCS_CFG ,
           NL80211_CMD_NAN_NEXT_DW_NOTIFICATION ,
           NL80211_CMD_NAN_CLUSTER_JOINED ,
           NL80211_CMD_INCUMBENT_SIGNAL_DETECT ,
           NL80211_CMD_NAN_SET_LOCAL_SCHED ,
           NL80211_CMD_NAN_SCHED_UPDATE_DONE ,
           NL80211_CMD_NAN_SET_PEER_SCHED ,
           NL80211_CMD_NAN_ULW_UPDATE ,
           NL80211_CMD_NAN_CHANNEL_EVAC ,
           NL80211_CMD_START_PD ,
           NL80211_CMD_STOP_PD ,
           __NL80211_CMD_AFTER_LAST ,
           NL80211_CMD_MAX

       };

πŸŽ€ Constants πŸŽ€

Okay so each constant is a command, and here’s what each one does. I’m keeping every attribute name exactly as-is because they matter, bestie.

  • NL80211_CMD_UNSPEC β€” unspecified command to catch errors. It’s basically the β€œoops, something went wrong” sentinel.
  • NL80211_CMD_GET_WIPHY β€” request information about a wiphy, or a dump request to get a list of all present wiphys. You can ask about one or dump them all, iconic.
  • NL80211_CMD_SET_WIPHY β€” set wiphy parameters, bestie. It needs NL80211_ATTR_WIPHY or NL80211_ATTR_IFINDEX, and it can be used to set NL80211_ATTR_WIPHY_NAME, NL80211_ATTR_WIPHY_TXQ_PARAMS, NL80211_ATTR_WIPHY_FREQ, NL80211_ATTR_WIPHY_FREQ_OFFSET (and the attributes determining the channel width; this is used for setting monitor mode channel), NL80211_ATTR_WIPHY_RETRY_SHORT, NL80211_ATTR_WIPHY_RETRY_LONG, NL80211_ATTR_WIPHY_FRAG_THRESHOLD, and/or NL80211_ATTR_WIPHY_RTS_THRESHOLD. But lowkey, for setting the channel, see NL80211_CMD_SET_CHANNEL instead β€” the support here is for backward compatibility only.
  • NL80211_CMD_NEW_WIPHY β€” newly created wiphy, response to get request or rename notification. It has attributes NL80211_ATTR_WIPHY and NL80211_ATTR_WIPHY_NAME.
  • NL80211_CMD_DEL_WIPHY β€” wiphy deleted. It has attributes NL80211_ATTR_WIPHY and NL80211_ATTR_WIPHY_NAME.
  • NL80211_CMD_GET_INTERFACE β€” request an interface’s configuration; either a dump request for all interfaces or a specific get with a single NL80211_ATTR_IFINDEX is supported.
  • NL80211_CMD_SET_INTERFACE β€” set type of a virtual interface. It requires NL80211_ATTR_IFINDEX and NL80211_ATTR_IFTYPE.
  • NL80211_CMD_NEW_INTERFACE β€” newly created virtual interface or response to NL80211_CMD_GET_INTERFACE. It has NL80211_ATTR_IFINDEX, NL80211_ATTR_WIPHY and NL80211_ATTR_IFTYPE attributes. It can also be sent from userspace to request creation of a new virtual interface, and then it requires attributes NL80211_ATTR_WIPHY, NL80211_ATTR_IFTYPE and NL80211_ATTR_IFNAME.
  • NL80211_CMD_DEL_INTERFACE β€” virtual interface was deleted, and it has attributes NL80211_ATTR_IFINDEX and NL80211_ATTR_WIPHY. It can also be sent from userspace to request deletion of a virtual interface, and then it requires attribute NL80211_ATTR_IFINDEX. If multiple BSSID advertisements are enabled using NL80211_ATTR_MBSSID_CONFIG, NL80211_ATTR_MBSSID_ELEMS, and if this command is used for the transmitting interface, then all the non-transmitting interfaces are deleted as well. Slay.
  • NL80211_CMD_GET_KEY β€” get sequence counter information for a key specified by NL80211_ATTR_KEY_IDX and/or NL80211_ATTR_MAC. NL80211_ATTR_MAC represents peer’s MLD address for MLO pairwise key. For MLO group key, the link is identified by NL80211_ATTR_MLO_LINK_ID.
  • NL80211_CMD_SET_KEY β€” set key attributes NL80211_ATTR_KEY_DEFAULT, NL80211_ATTR_KEY_DEFAULT_MGMT, or NL80211_ATTR_KEY_THRESHOLD. For MLO connection, the link to set default key is identified by NL80211_ATTR_MLO_LINK_ID.
  • NL80211_CMD_NEW_KEY β€” add a key with given NL80211_ATTR_KEY_DATA, NL80211_ATTR_KEY_IDX, NL80211_ATTR_MAC, NL80211_ATTR_KEY_CIPHER, and NL80211_ATTR_KEY_SEQ attributes. NL80211_ATTR_MAC represents peer’s MLD address for MLO pairwise key. The link to add MLO group key is identified by NL80211_ATTR_MLO_LINK_ID.
  • NL80211_CMD_DEL_KEY β€” delete a key identified by NL80211_ATTR_KEY_IDX or NL80211_ATTR_MAC. NL80211_ATTR_MAC represents peer’s MLD address for MLO pairwise key. The link to delete group key is identified by NL80211_ATTR_MLO_LINK_ID.
  • NL80211_CMD_GET_BEACON β€” (not used). Literally not used, bestie.
  • NL80211_CMD_SET_BEACON β€” change the beacon on an access point interface using the NL80211_ATTR_BEACON_HEAD and NL80211_ATTR_BEACON_TAIL attributes. For drivers that generate the beacon and probe responses internally, the following attributes must be provided: NL80211_ATTR_IE, NL80211_ATTR_IE_PROBE_RESP and NL80211_ATTR_IE_ASSOC_RESP.

πŸ’– NL80211_CMD_START_AP

Okay so this one literally starts an AP operation on an AP interface β€” main character behaviour fr. The parameters are like the ones for NL80211_CMD_SET_BEACON, and on top of that you pass the stuff that doesn't change, and those are:

  • NL80211_ATTR_BEACON_INTERVAL
  • NL80211_ATTR_DTIM_PERIOD
  • NL80211_ATTR_SSID
  • NL80211_ATTR_HIDDEN_SSID
  • NL80211_ATTR_CIPHER_SUITES_PAIRWISE
  • NL80211_ATTR_CIPHER_SUITE_GROUP
  • NL80211_ATTR_WPA_VERSIONS
  • NL80211_ATTR_AKM_SUITES
  • NL80211_ATTR_PRIVACY
  • NL80211_ATTR_AUTH_TYPE
  • NL80211_ATTR_INACTIVITY_TIMEOUT
  • NL80211_ATTR_ACL_POLICY
  • NL80211_ATTR_MAC_ADDRS

The channel you wanna use can be set on the interface itself, or you can hand it over with NL80211_ATTR_WIPHY_FREQ and NL80211_ATTR_WIPHY_FREQ_OFFSET, plus the attributes that determine channel width. Slay, that's the whole vibe. ✨

🌸 NL80211_CMD_NEW_BEACON

old alias for NL80211_CMD_START_AP β€” literally just the vintage edition, iykyk

πŸŽ€ NL80211_CMD_STOP_AP

Stop AP operation on the given interface. That's it, that's the whole thing. Bye bestie πŸ‘‹

πŸ¦‹ NL80211_CMD_DEL_BEACON

old alias for NL80211_CMD_STOP_AP β€” the retro name, still valid, still serving

⭐ NL80211_CMD_GET_STATION

Get station attributes for the station identified by NL80211_ATTR_MAC on the interface identified by NL80211_ATTR_IFINDEX. Two attributes, one station, no cap. πŸ’…

πŸ’œ NL80211_CMD_SET_STATION

Set station attributes for the station identified by NL80211_ATTR_MAC on the interface identified by NL80211_ATTR_IFINDEX. Same deal as above but you're writing now, we love a glow-up.

✨ NL80211_CMD_NEW_STATION

Add a station with the given attributes to the interface identified by NL80211_ATTR_IFINDEX. New station just dropped, welcome to the group chat bestie 🫢

πŸ”₯ NL80211_CMD_DEL_STATION

Remove a station identified by NL80211_ATTR_MAC β€” or, if you don't give a MAC address, all the stations β€” on the interface identified by NL80211_ATTR_IFINDEX.

For an MLD station, the MLD address is what gets used in NL80211_ATTR_MAC.

NL80211_ATTR_MGMT_SUBTYPE and NL80211_ATTR_REASON_CODE can optionally be used to specify which type of disconnection indication should be sent to the station (that's a Deauthentication or Disassociation frame, and the reason code for that frame).

NL80211_ATTR_MLO_LINK_ID can optionally be used to remove stations that are connected and using at least that link as one of their links. Multi-link girlies, this one's for you 🌈

🧚 NL80211_CMD_GET_MPATH

Get mesh path attributes for the mesh path to destination NL80211_ATTR_MAC on the interface identified by NL80211_ATTR_IFINDEX. Mesh networking said "let me introduce myself" 🌸

πŸ“ NL80211_CMD_SET_MPATH

Set mesh path attributes for the mesh path to destination NL80211_ATTR_MAC on the interface identified by NL80211_ATTR_IFINDEX. Same path, but now you're editing it, periodt.

πŸ’« NL80211_CMD_NEW_MPATH

Create a new mesh path for the destination given by NL80211_ATTR_MAC via NL80211_ATTR_MPATH_NEXT_HOP. New path, who dis πŸ¦‹

🌟 NL80211_CMD_DEL_MPATH

Delete a mesh path to the destination given by NL80211_ATTR_MAC. Rip bozo, the path is gone πŸ’€


πŸ‘‘ NL80211_CMD_SET_BSS

Set BSS attributes for the BSS identified by NL80211_ATTR_IFINDEX. Simple, iconic, does exactly what it says on the tin.

πŸŽ€ NL80211_CMD_SET_REG

Set the current regulatory domain. So here's the lore: CRDA sends this command after being queried by the kernel. CRDA replies by sending a regulatory domain structure, which consists of NL80211_ATTR_REG_ALPHA set to our current alpha2 if it found a match. It also provides NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules.

Each regulatory rule is a nested set of attributes given by NL80211_ATTR_REG_RULE_FREQ_[START|END] and NL80211_ATTR_FREQ_RANGE_MAX_BW, with an attached power rule given by NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and NL80211_ATTR_REG_RULE_POWER_MAX_EIRP. Nested attributes, we love a structure bestie πŸ’œ

⭐ NL80211_CMD_REQ_SET_REG

Ask the wireless core to set the regulatory domain to the specified ISO/IEC 3166-1 alpha2 country code. The core will store this as a valid request and then query userspace for it. So it's like, "noted πŸ“, I'll ask the humans."

🌈 NL80211_CMD_GET_MESH_CONFIG

Get mesh networking properties for the interface identified by NL80211_ATTR_IFINDEX

🌸 NL80211_CMD_SET_MESH_CONFIG

Set mesh networking properties for the interface identified by NL80211_ATTR_IFINDEX

πŸ¦‹ NL80211_CMD_SET_MGMT_EXTRA_IE

Set extra IEs for management frames. The interface is identified with NL80211_ATTR_IFINDEX and the management frame subtype with NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be added to the end of the specified management frame is specified with NL80211_ATTR_IE.

If the command succeeds, the requested data will be added to all specified management frames generated by kernel/firmware/driver. Little bonus IEs, a cheeky extra garnish ✨

πŸ’… NL80211_CMD_GET_REG

Ask the wireless core to send us its currently set regulatory domain. Here's the nuance, pay attention bestie:

  • If NL80211_ATTR_WIPHY is specified and the device has a private regulatory domain, that one gets returned. Otherwise, the global regdomain gets returned.
  • A device will have a private regulatory domain if it uses the regulatory_hint API.
  • Even when a private regdomain is used, the channel information will still be mended according to further hints from the regulatory core to help with compliance.
  • A dump version of this API is now available which will returns the global regdomain as well as all private regdomains of present wiphys (for those that have it).
  • If a wiphy is self-managed (NL80211_ATTR_WIPHY_SELF_MANAGED_REG), then its private regdomain is the only valid one for it. The regulatory core is not used to help with compliance in this case.
That last bit is the "you're on your own, bestie" clause β€” no regulatory core backup when a wiphy is self-managed. 😭

πŸŽ€ NL80211_CMD_GET_SCAN

get scan results

πŸ”₯ NL80211_CMD_TRIGGER_SCAN

Trigger a new scan with the given parameters. NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the probe requests at CCK rate or not.

NL80211_ATTR_BSSID can be used to specify a BSSID to scan for; if it's not included, the wildcard BSSID will be used. Go find your network bestie πŸ”

✨ NL80211_CMD_NEW_SCAN_RESULTS

scan notification (as a reply to NL80211_CMD_GET_SCAN and on the "scan" multicast group)

πŸ¦‹ NL80211_CMD_SCAN_ABORTED

scan was aborted, for unspecified reasons, partial scan results may be available. The scan said "nvm" mid-way 😭 β€” partial results are still possibly there though, so don't fully panic.

πŸ’œ NL80211_CMD_REG_CHANGE

Indicates to userspace that the regulatory domain has been changed, and provides the details of the request info that caused the change, such as:

  • who initiated the regulatory request (NL80211_ATTR_REG_INITIATOR)
  • the wiphy_idx (NL80211_ATTR_REG_ALPHA2) on which the request was made from, if the initiator was NL80211_REGDOM_SET_BY_COUNTRY_IE or NL80211_REGDOM_SET_BY_DRIVER
  • the type of regulatory domain set (NL80211_ATTR_REG_TYPE)
  • if the type of regulatory domain is NL80211_REG_TYPE_COUNTRY, the alpha2 to which we have moved on to (NL80211_ATTR_REG_ALPHA2)

It's giving "regulatory receipts" πŸ’…

🌟 NL80211_CMD_AUTHENTICATE

authentication request and notification. This command is used both as a command (request to authenticate) and as an event on the "mlme" multicast group indicating completion of the authentication process. Double duty, main character energy πŸ‘‘

When it's used as a command:

  • NL80211_ATTR_IFINDEX is used to identify the interface.
  • NL80211_ATTR_MAC is used to specify PeerSTAAddress (and BSSID in case of station mode).
  • NL80211_ATTR_SSID is used to specify the SSID (mainly for association, but is included in the authentication request, too, to help BSS selection).
  • NL80211_ATTR_WIPHY_FREQ + NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequency of the channel in MHz.
  • NL80211_ATTR_AUTH_TYPE is used to specify the authentication type.
  • NL80211_ATTR_IE is used to define IEs (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added to the frame.

When it's used as an event, it reports reception of an Authentication frame in station and IBSS modes when the local MLME processed the frame β€” i.e., it was for the local STA and was received in correct state. This is similar to the MLME-AUTHENTICATE.confirm primitive in the MLME SAP interface (kernel providing MLME, userspace SME).

The included NL80211_ATTR_FRAME attribute contains the management frame (including both the header and frame body, but not FCS).

This event is also used to indicate if the authentication attempt timed out. In that case the NL80211_ATTR_FRAME attribute is replaced with a NL80211_ATTR_TIMED_OUT flag (and NL80211_ATTR_MAC to indicate which pending authentication timed out). So if you see NL80211_ATTR_TIMED_OUT, that auth said "not today" πŸ˜­πŸ’€

πŸ“ NL80211_CMD_ASSOCIATE

association request and notification; like NL80211_CMD_AUTHENTICATE but for Association and Reassociation (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request, MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).

The NL80211_ATTR_PREV_BSSID attribute is used to specify whether the request is for the initial association to an ESS (that attribute not included) or for reassociation within the ESS (that attribute is included). So: no NL80211_ATTR_PREV_BSSID = first time, with it = we've been here before, bestie 🫢

πŸ’« NL80211_CMD_DEAUTHENTICATE

deauthentication request and notification; like NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication primitives). The breakup text of the 802.11 world πŸ’”

🌈 NL80211_CMD_DISASSOCIATE

disassociation request and notification; like NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives). We're leaving the group chat, no hard feelings 🌸

NL80211_CMD_MICHAEL_MIC_FAILURE

Okay so this one is a notification, bestie β€” it fires when a Michael MIC failure gets detected locally. And if you know TKIP, you know the MIC is that integrity-check thing living inside it. πŸ’…

It's sent on the "mlme" multicast group, and the event is packing:

  • NL80211_ATTR_MAC β€” the source MAC address of the frame that had the invalid MIC
  • NL80211_ATTR_KEY_TYPE β€” the key type
  • NL80211_ATTR_KEY_IDX β€” the key identifier
  • NL80211_ATTR_KEY_SEQ β€” the TSC value of that frame

And this event matches with the MLME-MICHAELMICFAILURE.indication primitive. Slay, consistent naming. ✨


NL80211_CMD_REG_BEACON_HINT

This one tells userspace that an AP beacon has been found while world roaming β€” which means you can now do active scan, or literally any mode of operation that initiates TX (beacons) on a channel where we would not have been able to do either before. The glow-up is real. 🌈

As an example: if you're world roaming (regulatory domain set to world, or your driver is using a custom world roaming regulatory domain) and while doing a passive scan on the 5 GHz band you find an AP there (if not on a DFS channel), you'll now be able to actively scan for that AP or use AP mode on your card on that same channel. Iconic.

Note that this will never be used for channels 1-11 on the 2 GHz band, because they are always enabled world wide. No cap.

This beacon hint is only sent if your device had either disabled active scanning or beaconing on a channel. What we send to userspace:

  • the wiphy on which we removed a restriction β€” NL80211_ATTR_WIPHY
  • the channel on which this occurred before β€” NL80211_ATTR_FREQ_BEFORE
  • and after β€” NL80211_ATTR_FREQ_AFTER

…the beacon hint being processed, obviously. πŸ’–


NL80211_CMD_JOIN_IBSS

Join a new IBSS, bestie. You give it at least an SSID and a FREQ attribute (that's for the initial frequency if no peer can be found), plus optionally a MAC (as BSSID) and a FREQ_FIXED attribute if those should be fixed rather than automatically determined. 🫢

Can only be executed on a network interface that is UP, and fixed BSSID/FREQ may be rejected.

Another optional parameter is the beacon interval, given in the NL80211_ATTR_BEACON_INTERVAL attribute β€” and if you don't give it, it defaults to 100 TU (102.4ms). Cute default, honestly.


NL80211_CMD_LEAVE_IBSS

Leave the IBSS. That's it. No special arguments β€” the IBSS is determined by the network interface. Lowkey the easiest command on this whole page. 😌


NL80211_CMD_TESTMODE

The testmode command. It takes a wiphy (or ifindex) attribute to identify the device, and the TESTDATA blob attribute to pass through to the driver. Straight through, no detours. πŸ¦‹


NL80211_CMD_CONNECT

OK so this is the big one β€” it's both a connection request and a notification. The command asks to connect to a specified network, but without separating the auth and assoc steps. One shot, no crumbs. πŸ’…

For this you need to specify the SSID in a NL80211_ATTR_SSID attribute. And you can optionally specify:

  • the association IEs in NL80211_ATTR_IE
  • NL80211_ATTR_AUTH_TYPE
  • NL80211_ATTR_USE_MFP
  • NL80211_ATTR_MAC
  • NL80211_ATTR_WIPHY_FREQ
  • NL80211_ATTR_WIPHY_FREQ_OFFSET
  • NL80211_ATTR_CONTROL_PORT
  • NL80211_ATTR_CONTROL_PORT_ETHERTYPE
  • NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT
  • NL80211_ATTR_CONTROL_PORT_OVER_NL80211
  • NL80211_ATTR_MAC_HINT
  • NL80211_ATTR_WIPHY_FREQ_HINT

Now the ✨lore✨ on those:

  • If included, NL80211_ATTR_MAC and NL80211_ATTR_WIPHY_FREQ are restrictions on BSS selection β€” i.e., they effectively prevent roaming within the ESS. Very "you WILL stay here" energy.
  • NL80211_ATTR_MAC_HINT and NL80211_ATTR_WIPHY_FREQ_HINT can be included to give a recommendation of the initial BSS, while still allowing the driver to roam to other BSSes within the ESS β€” and also to ignore this recommendation if the indicated BSS is not ideal. Way more chill.
  • Only one set of BSSID,frequency parameters is used (i.e., either the enforcing NL80211_ATTR_MAC,NL80211_ATTR_WIPHY_FREQ or the less strict NL80211_ATTR_MAC_HINT and NL80211_ATTR_WIPHY_FREQ_HINT). Pick a lane, bestie.
  • The driver shall not modify the IEs specified through NL80211_ATTR_IE if NL80211_ATTR_MAC is included. However, if NL80211_ATTR_MAC_HINT is included, these IEs through NL80211_ATTR_IE are specified by the user space based on the best possible BSS selected. So if the driver ends up selecting a different BSS, it can modify these IEs accordingly (e.g. userspace asks the driver to perform PMKSA caching with BSS1 and the driver ends up selecting BSS2 with a different PMKSA cache entry; RSNIE has to get updated with the apt PMKID). Whole lotta teamwork going on there. 🫱🫲

NL80211_ATTR_PREV_BSSID can be used to request a reassociation within the ESS, in case the device is already associated and an association with a different BSS is desired.

Background scan period can optionally be specified in NL80211_ATTR_BG_SCAN_PERIOD. If it's not specified, the default background scan configuration in the driver is used; and if the period value is 0, bg scan will be disabled. This attribute is ignored if the driver does not support roam scan. πŸ™ˆ

Now for the event side: it's also sent as an event, with the BSSID and response IEs, when the connection is established β€” or when it failed to be established. You can tell which by the NL80211_ATTR_STATUS_CODE attribute (0 = success, non-zero = failure). If NL80211_ATTR_TIMED_OUT is included in the event, the connection attempt failed due to not being able to initiate authentication/association or not receiving a response from the AP. A non-zero NL80211_ATTR_STATUS_CODE value is indicated in that case as well, to remain backwards compatible. King behavior tbh. πŸ‘‘


NL80211_CMD_ROAM

A notification telling you the card/driver roamed by itself. Main character energy β€” it did that on its own. πŸ¦‹

When a security association was established on an 802.1X network using fast transition, this event should be followed by an NL80211_CMD_PORT_AUTHORIZED event.

Also: following an NL80211_CMD_ROAM event, userspace can issue NL80211_CMD_GET_SCAN in order to obtain the scan information for the new BSS the card/driver roamed to. Go get your receipts, bestie. πŸŽ€


NL80211_CMD_DISCONNECT

Drop a given connection. It's also used to notify userspace that a connection was dropped by the AP or due to other reasons β€” and for that, the NL80211_ATTR_DISCONNECTED_BY_AP and NL80211_ATTR_REASON_CODE attributes are used. 😭


NL80211_CMD_SET_WIPHY_NETNS

Set a wiphy's netns.

Note that all devices associated with this wiphy must be down, and will follow. No stragglers. πŸ’€

NL80211_CMD_GET_SURVEY

Get survey results β€” e.g. channel occupation or noise level. The vibes check, but for your channel. ✨


NL80211_CMD_NEW_SURVEY_RESULTS

Survey data notification β€” it comes as a reply to NL80211_CMD_GET_SURVEY and on the "scan" multicast group. πŸŽ€


NL80211_CMD_SET_PMKSA

Add a PMKSA cache entry, using NL80211_ATTR_MAC (for the BSSID), NL80211_ATTR_PMKID, and optionally NL80211_ATTR_PMK (PMK is used for PTKSA derivation in case of FILS shared key offload).

Or, alternatively, using NL80211_ATTR_SSID, NL80211_ATTR_FILS_CACHE_ID, NL80211_ATTR_PMKID, and NL80211_ATTR_PMK in case of FILS authentication β€” where NL80211_ATTR_FILS_CACHE_ID is the identifier advertised by a FILS capable AP identifying the scope of PMKSA in an ESS. Two paths, both valid. πŸ’…


NL80211_CMD_DEL_PMKSA

Delete a PMKSA cache entry, using NL80211_ATTR_MAC (for the BSSID) and NL80211_ATTR_PMKID β€” or using NL80211_ATTR_SSID, NL80211_ATTR_FILS_CACHE_ID, and NL80211_ATTR_PMKID in case of FILS authentication. πŸ—‘οΈ

Additionally, in case of SAE offload and OWE offloads, the PMKSA entry can be deleted using NL80211_ATTR_SSID.


NL80211_CMD_FLUSH_PMKSA

Flush all PMKSA cache entries. Every single one. Goodbye besties. πŸ’€βœ¨


NL80211_CMD_REMAIN_ON_CHANNEL

Request to remain awake on the specified channel for the specified amount of time. This is how you do off-channel operations β€” like transmit a Public Action frame and wait for a response while being associated to an AP on another channel. Multitasking queen. πŸ‘‘

The attributes, bestie:

  • NL80211_ATTR_IFINDEX β€” used to specify which interface (and thus radio) is used
  • NL80211_ATTR_WIPHY_FREQ β€” used to specify the frequency for the operation
  • NL80211_ATTR_DURATION β€” used to specify the duration in milliseconds to remain on the channel

This command is also used as an event to notify when the requested duration starts β€” and it may take a while for the driver to schedule this time due to other concurrent needs for the radio. Be patient, it's busy. 😭

An optional attribute, NL80211_ATTR_MAC, can be used to filter incoming frames during remain-on-channel, such that frames addressed to the specified destination MAC are reported. 🎯

When called, this operation returns a cookie (NL80211_ATTR_COOKIE) that will be included with any events pertaining to this request β€” and the cookie is also used to cancel the request. Save your cookie, it's your receipt. πŸͺ


NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL

This command can be used to cancel a pending remain-on-channel duration if the desired operation has been completed prior to the expiration of the originally requested duration. Early finish, we love to see it. ✨

NL80211_ATTR_WIPHY or NL80211_ATTR_IFINDEX is used to specify the radio. The NL80211_ATTR_COOKIE attribute must be given as well, to uniquely identify the request. No cookie, no cancellation. πŸͺ

This command is also used as an event to notify when a requested remain-on-channel duration has expired.


NL80211_CMD_SET_TX_BITRATE_MASK

Set the mask of rates to be used in TX rate selection. NL80211_ATTR_IFINDEX is used to specify the interface, and NL80211_ATTR_TX_RATES is the set of allowed rates. Rate selection, but make it fashion. πŸ’…πŸ”₯

  • NL80211_CMD_REGISTER_FRAME β€” bestie, this one signs you up to receive certain mgmt frames (they show up via NL80211_CMD_FRAME) so you can process them in userspace. ✨ It needs an interface index, a frame type attribute (this one's optional for backward-compatibility reasons β€” if you don't give it, it just assumes action frames), and a match attribute holding the first few bytes of the frame that should match. Like, literally a single byte if you only want a category match, or four bytes for vendor frames including the OUI. πŸŽ€ Heads up: the registration cannot be dropped, but it does get removed automatically when the netlink socket is closed. Multiple registrations can be made, so go off. πŸ’… The NL80211_ATTR_RECEIVE_MULTICAST flag attribute can be given if NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS is available β€” in which case you can also just modify the registration to include/exclude the flag instead of having to unregister to change it. So convenient, honestly.
  • NL80211_CMD_REGISTER_ACTION β€” alias for NL80211_CMD_REGISTER_FRAME for backward compatibility. That's it. That's the whole vibe. πŸ¦‹
  • NL80211_CMD_FRAME β€” the main character πŸ‘‘: management frame TX request and RX notification, same command, two moods. It's used both as a request to transmit a management frame and as an event saying "hey, a frame arrived that wasn't processed in kernel code but it's for us" (i.e., it may need to be handled in a user space application).

NL80211_ATTR_FRAME specifies the frame contents (including the header). NL80211_ATTR_WIPHY_FREQ tells you which channel the frame is to be transmitted on or was received on. If that channel isn't the current channel (remain-on-channel or the operational channel), the device will switch to the given channel and transmit the frame β€” optionally waiting for a response for the time specified using NL80211_ATTR_DURATION. ⏳ When called, this operation returns a cookie (NL80211_ATTR_COOKIE) that gets included with the TX status event for that TX request. NL80211_ATTR_TX_NO_CCK_RATE decides whether to send the management frames at CCK rate or not in the 2GHz band. NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA counters which will be updated to the current value β€” this attribute is used during the CSA period.

For TX on an MLD, the frequency can be omitted and the link ID specified instead β€” or, if you're transmitting to a known peer MLD (with MLD addresses in the frame), both can be omitted and the link will be selected by lower layers. 🧚

For RX notification, NL80211_ATTR_RX_HW_TIMESTAMP may be included to indicate the frame RX timestamp, and NL80211_ATTR_TX_HW_TIMESTAMP may be included to indicate the ack TX timestamp.

  • NL80211_CMD_ACTION β€” alias for NL80211_CMD_FRAME for backward compatibility. Vintage, but make it fashion. πŸŽ€
  • NL80211_CMD_FRAME_TX_STATUS β€” reports the TX status of a management frame that was transmitted with NL80211_CMD_FRAME. NL80211_ATTR_COOKIE identifies the TX command and NL80211_ATTR_FRAME includes the contents of the frame. The NL80211_ATTR_ACK flag is included if the recipient acknowledged the frame. NL80211_ATTR_TX_HW_TIMESTAMP may be included to indicate the tx timestamp, and NL80211_ATTR_RX_HW_TIMESTAMP may be included to indicate the ack RX timestamp. Receipts, basically. πŸ’…
  • NL80211_CMD_ACTION_TX_STATUS β€” alias for NL80211_CMD_FRAME_TX_STATUS for backward compatibility. πŸ¦‹
  • NL80211_CMD_SET_POWER_SAVE β€” set powersave, using NL80211_ATTR_PS_STATE. Battery is gonna eat. πŸ”‹βœ¨
  • NL80211_CMD_GET_POWER_SAVE β€” get powersave status in NL80211_ATTR_PS_STATE. Simple as that.
  • NL80211_CMD_SET_CQM β€” connection quality monitor configuration. This command configures the connection quality monitoring notification trigger levels. πŸ“Ά
  • NL80211_CMD_NOTIFY_CQM β€” connection quality monitor notification. Used as an event to indicate that a trigger level was reached. ⚠️
  • NL80211_CMD_SET_CHANNEL β€” sets the channel (using NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width) that the given interface (identified by NL80211_ATTR_IFINDEX) shall operate on. If multiple channels are supported by the device, the mechanism with which it switches channels is implementation-defined. πŸ‘€ When a monitor interface is given, it can only switch channel while no other interfaces are operating β€” that's to avoid disturbing the operation of any other interfaces β€” and other interfaces will again take precedence when they are used. Respect the hierarchy, fr.
  • NL80211_CMD_SET_WDS_PEER β€” sets the MAC address of the peer on a WDS interface. And no cap: no longer supported. πŸ’€ Don't come for me, I'm just the messenger.
  • NL80211_CMD_FRAME_WAIT_CANCEL β€” when an off-channel TX was requested, you can use this command with the corresponding cookie to cancel the wait time if you know it's no longer necessary. ✨ This command is also sent as an event whenever the driver has completed the off-channel wait time.
  • NL80211_CMD_JOIN_MESH β€” join a mesh. The mesh ID must be given, and initial mesh config parameters may be given. πŸ•ΈοΈ squad up
  • NL80211_CMD_LEAVE_MESH β€” leave the mesh network. No special arguments needed β€” the network is determined by the network interface. Bye bestie πŸ‘‹
  • NL80211_CMD_UNPROT_DEAUTHENTICATE β€” unprotected deauthentication frame notification. This event indicates that an unprotected deauthentication frame was dropped when MFP is in use. πŸ›‘οΈ
  • NL80211_CMD_UNPROT_DISASSOCIATE β€” unprotected disassociation frame notification. This event indicates that an unprotected disassociation frame was dropped when MFP is in use. Same shield energy. πŸ›‘οΈ
  • NL80211_CMD_NEW_PEER_CANDIDATE β€” notification on the reception of a beacon or probe response from a compatible mesh peer. πŸ¦‹ This is only sent while no station information (sta_info) exists for the new peer candidate, and when NL80211_MESH_SETUP_USERSPACE_AUTH, NL80211_MESH_SETUP_USERSPACE_AMPE, or NL80211_MESH_SETUP_USERSPACE_MPM is set. On reception of this notification, userspace may decide to create a new station (NL80211_CMD_NEW_STATION). To stop this notification from reoccurring, the userspace authentication daemon may want to create the new station with the AUTHENTICATED flag unset and maybe change it later depending on the authentication result. Strategic.
  • NL80211_CMD_GET_WOWLAN β€” get Wake-on-Wireless-LAN (WoWLAN) settings. 😴 magical sleepy wifi
  • NL80211_CMD_SET_WOWLAN β€” set Wake-on-Wireless-LAN (WoWLAN) settings. Since wireless is more complex than wired ethernet, it supports various triggers, and these triggers can be configured through this command with the NL80211_ATTR_WOWLAN_TRIGGERS attribute. For more background information, see https://wireless.wiki.kernel.org/en/users/Documentation/WoWLAN. πŸ”—

The NL80211_CMD_SET_WOWLAN command can also be used as a notification from the driver reporting the wakeup reason. In that case, the NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason for the wakeup, if it was caused by wireless. If it's not present in the wakeup notification, the wireless device didn't cause the wakeup but reports that it was woken up. iykyk 😴

  • NL80211_CMD_START_SCHED_SCAN β€” start a scheduled scan at certain intervals and a certain number of cycles, as specified by NL80211_ATTR_SCHED_SCAN_PLANS. πŸ” If NL80211_ATTR_SCHED_SCAN_PLANS is not specified and only NL80211_ATTR_SCHED_SCAN_INTERVAL is specified, the scheduled scan will run in an infinite loop with the specified interval. These attributes are mutually exclusive, i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if NL80211_ATTR_SCHED_SCAN_PLANS is defined. ⚠️

If for some reason the scheduled scan is aborted by the driver, all scan plans are canceled (including scan plans that did not start yet). Like with normal scans, if SSIDs (NL80211_ATTR_SCAN_SSIDS) are passed, they are used in the probe requests. For broadcast, a broadcast SSID must be passed (ie. an empty string). If no SSID is passed, no probe requests are sent and a passive scan is performed.

NL80211_ATTR_SCAN_FREQUENCIES, if passed, defines which channels should be scanned; if not passed, all channels allowed for the current regulatory domain are used. Extra IEs can also be passed from userspace by using the NL80211_ATTR_IE attribute. The first cycle of the scheduled scan can be delayed by NL80211_ATTR_SCHED_SCAN_DELAY being supplied. ⏳ If the device supports multiple concurrent scheduled scans, it will allow such when the caller provides the flag attribute NL80211_ATTR_SCHED_SCAN_MULTI to indicate user-space support for it. Multi-scan? We love to see it. πŸ’…

  • NL80211_CMD_STOP_SCHED_SCAN β€” stop a scheduled scan. Returns -ENOENT if a scheduled scan is not running. The caller may assume that as soon as the call returns, it's safe to start a new scheduled scan again. βœ…
  • NL80211_CMD_SCHED_SCAN_RESULTS β€” indicates that there are scheduled scan results available. 🎁
  • NL80211_CMD_SCHED_SCAN_STOPPED β€” indicates that the scheduled scan has stopped. The driver may issue this event at any time during a scheduled scan. One reason for stopping the scan is if the hardware does not support starting an association or a normal scan while running a scheduled scan. This event is also sent when the NL80211_CMD_STOP_SCHED_SCAN command is received, or when the interface is brought down while a scheduled scan was running. πŸ›‘

NL80211_CMD_SET_REKEY_OFFLOAD

okay so this one is literally you handing the driver everything it needs to do GTK rekey offload πŸ’… β€” and bestie, this feature is typically used during WoWLAN (wake-on-wireless-LAN, yes, the sleepy-time magic). The config data lives in NL80211_ATTR_REKEY_DATA, which is nested and holds the actual data in sub-attributes. And plot twist: after rekeying happened, this same command may also be sent by the driver as an MLME event, to inform userspace of the new replay counter. so it's giving both directions, iconic πŸŽ€

NL80211_CMD_PMKSA_CANDIDATE

This is used as an event to inform userspace of PMKSA caching candidates. that's it, that's the whole vibe ✨

NL80211_CMD_TDLS_OPER

Perform a high-level TDLS command (e.g. link setup). Plus β€” and this is the fun part β€” it can also be used as an event to request userspace to take actions on TDLS links: either set up a new link or tear down an existing one 😭 In such events, NL80211_ATTR_TDLS_OPERATION indicates the requested operation, NL80211_ATTR_MAC contains the peer MAC address, and NL80211_ATTR_REASON_CODE the reason code to be used (only with NL80211_TDLS_TEARDOWN). no cap, all three, every time 🫢

NL80211_CMD_TDLS_MGMT

Send a TDLS management frame, bestie πŸ¦‹ The NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be sent. Now here's the tea: Public Action codes (802.11-2012 8.1.5.1) will be sent as 802.11 management frames, while TDLS action codes (802.11-2012 8.5.13.1) will be encapsulated and sent as data frames. The currently supported Public Action code is WLAN_PUB_ACTION_TDLS_DISCOVER_RES, and the currently supported TDLS action codes are given in enum ieee80211_tdls_actioncode. slay, documented and everything πŸ’…

NL80211_CMD_UNEXPECTED_FRAME

Used by an application controlling an AP (or GO) interface (i.e. hostapd) to ask for unexpected frames β€” the whole point being to implement sending deauth to stations that send unexpected class 3 frames. Rude little frames, honestly πŸ’€

For NAN_DATA interfaces, this is used to report frames from unknown peers (A2 not assigned to any active NDP). Also used as the event sent by the kernel when such a frame is received 🌸 For the event, the NL80211_ATTR_MAC attribute carries the TA, and other attributes like the interface index are present.

If used as the command it must have an interface index, and you can only unsubscribe from the event by closing the socket. no take-backs, no unsubscribe button, just πŸšͺ

Subscription is also for NL80211_CMD_UNEXPECTED_4ADDR_FRAME events. two-for-one, we love to see it.

NL80211_CMD_PROBE_PEER

Probe a connected peer by sending a null data frame and reporting when the frame is acknowledged πŸ‘‘ In AP/GO mode, NL80211_ATTR_MAC is required to identify the client. In STA/P2P-client mode, NL80211_ATTR_MAC must be omitted (the AP is implied); the driver must advertise NL80211_EXT_FEATURE_PROBE_AP. Don't skip that part, fr fr πŸ™ˆ

The command returns a direct reply with an NL80211_ATTR_COOKIE that is later used to match up the event with the request. The event includes the same data and has NL80211_ATTR_ACK set if the frame was ACKed. matching cookies like a lil friendship bracelet πŸ“

NL80211_CMD_REGISTER_BEACONS

Register this socket to receive beacons from other BSSes when any interfaces are in AP mode. This helps implement OLBC handling in hostapd. Beacons are reported in NL80211_CMD_FRAME messages πŸ“‘

Note that per PHY only one application may register. one. single. app. per PHY. don't be greedy 😀

NL80211_CMD_UNEXPECTED_4ADDR_FRAME

Sent as an event indicating that the associated station identified by NL80211_ATTR_MAC sent a 4addr frame and wasn't already in a 4-addr VLAN. The event will be sent similarly to the NL80211_CMD_UNEXPECTED_FRAME event, to the same listener β€” like, it already knows you, it's not gonna re-introduce itself πŸ’œ

NL80211_CMD_SET_NOACK_MAP

sets a bitmap for the individual TIDs whether No Acknowledgement Policy should be applied. short, sweet, bitmap-coded πŸŽ€

NL80211_CMD_CH_SWITCH_NOTIFY

An AP or GO may decide to switch channels independently of the userspace SME, and then it sends this event indicating NL80211_ATTR_IFINDEX is now on NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. main character energy, going off and doing its own thing 😭

This indication may also be sent when a remotely-initiated switch (e.g., when a STA receives a CSA from the remote AP) is completed; (yes, the original sentence ends on that semicolon, and honestly? mood.)

NL80211_CMD_START_P2P_DEVICE

Start the given P2P Device, identified by its NL80211_ATTR_WDEV identifier. Important: it must have been created with NL80211_CMD_NEW_INTERFACE previously β€” no starting a device that doesn't exist yet, bestie, that's not how any of this works πŸ™ˆ After it has been started, the P2P Device can be used for P2P operations, e.g. remain-on-channel and public action frame TX πŸ”₯

NL80211_CMD_STOP_P2P_DEVICE

Stop the given P2P Device, identified by its NL80211_ATTR_WDEV identifier. That's the whole thing. goodbye lil device πŸ¦‹

NL80211_CMD_CONN_FAILED

connection request to an AP failed; used to notify userspace that the AP has rejected the connection request from a station, due to particular reason πŸ’€ NL80211_ATTR_CONN_FAILED_REASON is used for this. at least it tells you why, which is more than some people do.

NL80211_CMD_SET_MCAST_RATE

Change the rate used to send multicast frames for IBSS or MESH vif. multicast rate glow-up ✨

NL80211_CMD_SET_MAC_ACL

sets ACL for MAC address based access control. This is to be used with the drivers advertising the support of MAC address based access control πŸŽ€ List of MAC addresses is passed in NL80211_ATTR_MAC_ADDRS and ACL policy is passed in NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it is not already done. The new list will replace any existing list. Driver will clear its ACL when the list of MAC addresses passed is empty. This command is used in AP/P2P GO mode.

Driver has to make sure to clear its ACL list during NL80211_CMD_STOP_AP. that's not optional, that's the assignment 🫢

NL80211_CMD_RADAR_DETECT

Start a Channel availability check (CAC) πŸ‘‘ Once a radar is detected or the channel availability scan (CAC) has finished or was aborted, or a radar was detected, usermode will be notified with this event. This command is also used to notify userspace about radars while operating on this channel. NL80211_ATTR_RADAR_EVENT is used to inform about the type of the event 🌈

NL80211_CMD_GET_PROTOCOL_FEATURES

Get global nl80211 protocol features, i.e. features for the nl80211 protocol rather than device features. big distinction, don't mix them up bestie πŸ’… Returns the features in the NL80211_ATTR_PROTOCOL_FEATURES bitmap.

NL80211_CMD_UPDATE_FT_IES

Pass down the most up-to-date Fast Transition Information Element to the WLAN driver. fresh IEs, fresh out the oven πŸ“

NL80211_CMD_FT_EVENT

Send a Fast transition event from the WLAN driver to the supplicant. This will carry the target AP's MAC address along with the relevant Information Elements πŸ¦‹ This event is used to report received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE). look at all those acronyms, we ate πŸ”₯

NL80211_CMD_CRIT_PROTOCOL_START

Indicates user-space will start running a critical protocol that needs more reliability in the connection to complete. treat it gently, it's critical πŸ’…

NL80211_CMD_CRIT_PROTOCOL_STOP

Indicates the connection reliability can return back to normal. and we're back, no big deal 😌

NL80211_CMD_GET_COALESCE

Get currently supported coalesce rules. that's it, that's the ask πŸŽ€

NL80211_CMD_SET_COALESCE

Configure coalesce rules or clear existing rules. both directions, we contain multitudes ✨

NL80211_CMD_CHANNEL_SWITCH

Perform a channel switch by announcing the new channel information (Channel Switch Announcement - CSA) in the beacon for some time (as defined in the NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the new channel 🌸 Userspace provides the new channel information (using NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width). NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform other station that transmission must be blocked until the channel switch is complete πŸ”₯ it's giving "we're moving, pack your things, nobody transmits until I say so."

NL80211_CMD_VENDOR

Vendor-specified command/event πŸ‘‘ The command is specified by the NL80211_ATTR_VENDOR_ID attribute and a sub-command in NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in NL80211_ATTR_VENDOR_DATA. For feature advertisement, the NL80211_ATTR_VENDOR_DATA attribute is used in the wiphy data as a nested attribute containing descriptions (struct nl80211_vendor_cmd_info) of the supported vendor commands. This may also be sent as an event with the same attributes πŸ¦‹ vendor-coded, both ways.

NL80211_CMD_SET_QOS_MAP

Set Interworking QoS mapping for IP DSCP values. The QoS mapping information is included in NL80211_ATTR_QOS_MAP. If that attribute is not included, QoS mapping is disabled πŸ™ˆ Since this QoS mapping is relevant for IP packets, it is only valid during an association. This is cleared on disassociation and AP restart πŸ’€ so like, temporary, contextual, we respect that.

NL80211_CMD_ADD_TX_TS

Ask the kernel to add a traffic stream for the given NL80211_ATTR_TSID and NL80211_ATTR_MAC with NL80211_ATTR_USER_PRIO and NL80211_ATTR_ADMITTED_TIME parameters πŸŽ€

Note that the action frame handshake with the AP shall be handled by userspace via the normal management RX/TX framework β€” this only sets up the TX TS in the driver/device. don't come for the kernel about handshakes it never agreed to do πŸ’…

If the admitted time attribute is not added then the request just checks if a subsequent setup could be successful, the intent is to use this to avoid setting up a session with the AP when local restrictions would make that impossible 😭 good intentions, honestly. However, the subsequent "real" setup may still fail even if the check was successful. yeah. it's giving "the vibe check passed but the date still went badly" 🫠

NL80211_CMD_DEL_TX_TS

Remove an existing TS with the NL80211_ATTR_TSID and NL80211_ATTR_MAC parameters πŸ¦‹ It isn't necessary to call this before removing a station entry entirely, or before disassociating or similar, cleanup will happen in the driver/device in this case. so like, don't stress about it, the driver's got a mop 🌈

NL80211_CMD_GET_MPP

Bestie, this one's for the mesh girlies πŸ•ΈοΈ β€” it grabs the mesh path attributes for the mesh proxy path heading to the destination NL80211_ATTR_MAC, on whichever interface is named by NL80211_ATTR_IFINDEX. That's the whole vibe.

NL80211_CMD_JOIN_OCB

Join the OCB network, periodt. You gotta hand over the center frequency and the bandwidth of a channel β€” no channel deets, no entry, it's giving strict πŸ’….

NL80211_CMD_LEAVE_OCB

Leave the OCB network β€” and honestly? no special arguments needed, iconic. The network is determined by the network interface itself, so she already knows the way out πŸšͺ✨.

NL80211_CMD_CH_SWITCH_STARTED_NOTIFY

A lil notification that a channel switch has started on an interface β€” and it does not care who started it, like at all. Whether it was requested from a remote device or initiated on our own, same energy. It tells you that NL80211_ATTR_IFINDEX will be sitting on NL80211_ATTR_WIPHY_FREQ after NL80211_ATTR_CH_SWITCH_COUNT TBTT's. Userspace may then decide to react to this indication by asking other interfaces to change channel too β€” group project energy 🫢.

NL80211_CMD_TDLS_CHANNEL_SWITCH

Start channel-switching with a TDLS peer, who's identified by the NL80211_ATTR_MAC parameter. The target channel comes in via NL80211_ATTR_WIPHY_FREQ plus other attributes that determine channel width/type, and the target operating class is given via NL80211_ATTR_OPER_CLASS. The driver is the main character here: she's responsible for continually initiating channel-switching operations and returning to the base channel so we can still talk to the AP πŸ”₯.

NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH

Stop channel-switching with a TDLS peer given by NL80211_ATTR_MAC. Small but important detail: both peers must be on the base channel when this command completes β€” no stragglers, we all come home together πŸ’€.

NL80211_CMD_WIPHY_REG_CHANGE

Similar to NL80211_CMD_REG_CHANGE, but used as an event to indicate changes for devices with wiphy-specific regdom management. Same family, different lane 🌈.

NL80211_CMD_ABORT_SCAN

Stop an ongoing scan, simple as. Returns -ENOENT if a scan is not even running (ngl, nothing to abort, bestie 😭). The driver indicates the status of the scan through cfg80211_scan_done.

NL80211_CMD_START_NAN

Start NAN operation, identified by its NL80211_ATTR_WDEV interface. Heads up: this interface must have been previously created with NL80211_CMD_NEW_INTERFACE β€” you can't just spawn one out of nowhere. After it's been started, the NAN interface will create or join a cluster. This command must have a valid NL80211_ATTR_NAN_MASTER_PREF attribute and optional NL80211_ATTR_BANDS attributes. If NL80211_ATTR_BANDS is omitted or set to 0, it means don't-care and the device will decide what to use β€” letting her cook πŸ‘‘. Additional cluster configuration may be optionally provided with NL80211_ATTR_NAN_CONFIG. After this command, NAN functions can be added.

NL80211_CMD_STOP_NAN

Stop the NAN operation, identified by its NL80211_ATTR_WDEV interface. Clean exit, we love to see it ✨.

NL80211_CMD_ADD_NAN_FUNCTION

Add a NAN function, and the function is defined with the NL80211_ATTR_NAN_FUNC nested attribute. When called, this operation returns the strictly positive and unique instance id (NL80211_ATTR_NAN_FUNC_INST_ID) and a cookie (NL80211_ATTR_COOKIE) of the function upon success. Since instance ID's can be re-used, this cookie is the right way to identify the function β€” that's the whole point, bestie. It avoids races when a termination event is handled by the user space after it has already added a new function that got the same instance id from the kernel as the one which just terminated. And listen: this cookie may be used in NAN events even before the command returns, so userspace shouldn't process NAN events until it processes the response to this command. Do not skip ahead 😀. Look at NL80211_ATTR_SOCKET_OWNER as well.

NL80211_CMD_DEL_NAN_FUNCTION

Delete a NAN function by cookie πŸͺ. This command is also used as a notification sent when a NAN function is terminated, and it will contain a NL80211_ATTR_NAN_FUNC_INST_ID and NL80211_ATTR_COOKIE attributes.

NL80211_CMD_CHANGE_NAN_CONFIG

Change current NAN configuration. NAN must be operational first (NL80211_CMD_START_NAN was executed) β€” no editing a config that doesn't exist yet. It must contain at least one of the following attributes: NL80211_ATTR_NAN_MASTER_PREF, NL80211_ATTR_BANDS. If NL80211_ATTR_BANDS is omitted, the current configuration is not changed. If it is present but set to zero, the configuration is changed to don't-care (i.e. the device can decide what to do). Additional parameters may be provided with NL80211_ATTR_NAN_CONFIG. And this one's a classic gotcha: user space should provide all previously configured nested attributes under NL80211_ATTR_NAN_CONFIG, even if only a subset was changed. Yeah. All of them. Fr fr πŸ™ˆ.

NL80211_CMD_NAN_MATCH

Notification sent when a match is reported 🎯. This will contain a NL80211_ATTR_NAN_MATCH nested attribute and NL80211_ATTR_COOKIE.

NL80211_CMD_SET_MULTICAST_TO_UNICAST

Configure if this AP should perform multicast to unicast conversion. When enabled, all multicast packets with ethertype ARP, IPv4 or IPv6 (possibly within an 802.1Q header) will be sent out to each station once with the destination (multicast) MAC address replaced by the station's MAC address. Cute trick, but read the fine print bestie:

Note that this may break certain expectations of the receiver, e.g. the ability to drop unicast IP packets encapsulated in multicast L2 frames, or the ability to not send destination unreachable messages in such cases. Okay? Okay πŸ’€.

This can only be toggled per BSS. Configure this on an interface of type NL80211_IFTYPE_AP. It applies to all its VLAN interfaces (NL80211_IFTYPE_AP_VLAN), except for those in 4addr (WDS) mode. And if NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED is not present with this command, the feature is disabled β€” absence = off, no debate.

NL80211_CMD_UPDATE_CONNECT_PARAMS

Update one or more connect parameters for subsequent roaming cases, but only if the driver or firmware uses internal BSS selection. This command can be issued only while connected, and it does not result in a change for the current association β€” she's updating vibes for later, not now. Currently, only the NL80211_ATTR_IE data is used and updated with this command.

NL80211_CMD_SET_PMK

For offloaded 4-Way handshake πŸ”, set the PMK or PMK-R0 for the given authenticator address (specified with NL80211_ATTR_MAC). When NL80211_ATTR_PMKR0_NAME is set, NL80211_ATTR_PMK specifies the PMK-R0, otherwise it specifies the PMK. Conditional queen πŸ‘‘.

NL80211_CMD_DEL_PMK

For offloaded 4-Way handshake, delete the previously configured PMK for the authenticator address identified by NL80211_ATTR_MAC. Bye bye key 🫑.

NL80211_CMD_PORT_AUTHORIZED

An event that indicates the port is authorized and open for regular data traffic 🚦. For STA/P2P-client, this event is sent with the AP MAC address; for AP/P2P-GO, the event carries the STA/P2P-client MAC address. Drivers that support 4 way handshake offload should send this event for STA/P2P-client after successful 4-way HS or after 802.1X FT following NL80211_CMD_CONNECT or NL80211_CMD_ROAM. Drivers using AP/P2P-GO 4-way handshake offload should send this event on successful completion of 4-way handshake with the peer (STA/P2P-client). Everyone gets their moment ✨.

NL80211_CMD_RELOAD_REGDB

Request that the regdb firmware file is reloaded. That's it. That's the command πŸŒ€.

NL80211_CMD_EXTERNAL_AUTH

This interface is exclusively defined for host drivers that do not define separate commands for authentication and association, but rely on user space for the authentication to happen. She's doing double duty, honestly: this interface acts both as the event request (driver to user space) to trigger the authentication and the command response (userspace to driver) to indicate the authentication status. Multi-talented, main character energy πŸ’….

NL80211_CMD_STA_OPMODE_CHANGED

An event that notifies that a station's HT opmode or VHT opmode changed, using any of NL80211_ATTR_SMPS_MODE, NL80211_ATTR_CHANNEL_WIDTH, NL80211_ATTR_NSS attributes with its address (specified in NL80211_ATTR_MAC). Small caveat so you're not confused later: note that 80+80 and 160 MHz might not be differentiated, i.e. may report NL80211_CHAN_WIDTH_160 instead of NL80211_CHAN_WIDTH_80P80. Not a bug, just how she reports πŸ™ˆ.

NL80211_CMD_CONTROL_PORT_FRAME

Control Port (e.g. PAE) frame TX request and RX notification β€” both in one icon. This command is used both as a request to transmit a control port frame and as a notification that a control port frame has been received. NL80211_ATTR_FRAME is used to specify the frame contents, and the frame is the raw EAPoL data, without ethernet or 802.11 headers β€” keep it bare, no extra layers πŸ’….

For an MLD transmitter, the NL80211_ATTR_MLO_LINK_ID may be given and its effect will depend on the destination:

  • If the destination is known to be an MLD, this will be used as a hint to select the link to transmit the frame on.
  • If the destination is not an MLD, this will select both the link to transmit on and the source address will be set to the link address of that link.

When used as an event indication, NL80211_ATTR_CONTROL_PORT_ETHERTYPE, NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and NL80211_ATTR_MAC are added indicating the protocol type of the received frame; whether the frame was received unencrypted; and the MAC address of the peer respectively. Receipts, in attribute form 🧾✨.

NL80211_CMD_GET_FTM_RESPONDER_STATS

Retrieve FTM responder statistics, and they land in the NL80211_ATTR_FTM_RESPONDER_STATS attribute. Stats girlies stay winning πŸ“ŠπŸ’–.

  • NL80211_CMD_PEER_MEASUREMENT_START β€” kicks off a (set of) peer measurement(s) with all the parameters you pass, and those params are encapsulated inside the nested NL80211_ATTR_PEER_MEASUREMENTS attribute ✨ Optionally you can enable and configure MAC address randomization by specifying the NL80211_ATTR_MAC and NL80211_ATTR_MAC_MASK attributes. If you want a timeout, use NL80211_ATTR_TIMEOUT. A u64 cookie gets returned in the netlink extended ack message so you can use it later as NL80211_ATTR_COOKIE πŸ’…
  • NL80211_CMD_PEER_MEASUREMENT_RESULT β€” and this command number is what's used for the result notification coming from the driver back to the requesting socket πŸŽ€
  • NL80211_CMD_PEER_MEASUREMENT_COMPLETE β€” notification only, bestie, nothing to send β€” it just says the measurement completed, using the measurement cookie (NL80211_ATTR_COOKIE) βœ…
  • NL80211_CMD_NOTIFY_RADAR β€” tells the kernel that a radar signal was detected and reported by a neighboring device on the channel indicated by NL80211_ATTR_WIPHY_FREQ plus the other attributes that determine the width and type πŸ“‘
  • NL80211_CMD_UPDATE_OWE_INFO β€” this interface lets the host driver offload OWE processing to user space 🫢 The whole point is to support OWE AKM by host drivers that implement SME but rely on user space for the cryptographic/DH IE processing in AP mode.
  • NL80211_CMD_PROBE_MESH_LINK β€” okay so the requirement for mesh link metric refreshing is that from one mesh point we need to be able to send some data frames to other mesh points which are not currently selected as a primary traffic path, but which are only 1 hop away 🌸 Since there's no primary path to the chosen node, we gotta apply some form of marking on a chosen packet stream so the packets can be properly steered to the selected node for testing, and not by the regular mesh path lookup. And further β€” the packets must be of type data, so that the rate control (often embedded in firmware) is used for rate selection, iykyk πŸ’œ
  • NL80211_CMD_SET_TID_CONFIG β€” data frame TID specific configuration gets passed using the NL80211_ATTR_TID_CONFIG attribute πŸŽ€
  • NL80211_CMD_UNPROT_BEACON β€” unprotected or incorrectly protected Beacon frame πŸ’€ This event is used to indicate that a received Beacon frame was dropped because it did not include a valid MME MIC while beacon protection was enabled (BIGTK configured in station mode).
  • NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS β€” reports the TX status of a control port frame transmitted with NL80211_CMD_CONTROL_PORT_FRAME πŸ“¬ NL80211_ATTR_COOKIE identifies the TX command and NL80211_ATTR_FRAME includes the contents of the frame. The NL80211_ATTR_ACK flag is included if the recipient acknowledged the frame βœ…
  • NL80211_CMD_SET_SAR_SPECS β€” SAR power limitation configuration gets passed using NL80211_ATTR_SAR_SPEC. And NL80211_ATTR_WIPHY is used to specify the wiphy index to be applied to πŸ”₯
  • NL80211_CMD_OBSS_COLOR_COLLISION β€” this notification goes out whenever mac80211/drv detects a bss color collision 🎨
  • NL80211_CMD_COLOR_CHANGE_REQUEST β€” this command is used to indicate that userspace wants to change the BSS color πŸ¦‹
  • NL80211_CMD_COLOR_CHANGE_STARTED β€” notifies userland that a color change has started ⭐
  • NL80211_CMD_COLOR_CHANGE_ABORTED β€” notifies userland that the color change has been aborted 😭
  • NL80211_CMD_COLOR_CHANGE_COMPLETED β€” notifies userland that the color change has completed πŸŽ‰
  • NL80211_CMD_SET_FILS_AAD β€” sets FILS AAD data to the driver using:
    • NL80211_ATTR_MAC β€” for the STA MAC address
    • NL80211_ATTR_FILS_KEK β€” for the KEK
    • NL80211_ATTR_FILS_NONCES β€” for the FILS Nonces (STA Nonce 16 bytes followed by AP Nonce 16 bytes) πŸ”
  • NL80211_CMD_ASSOC_COMEBACK β€” notification about an association temporal rejection with comeback ⏳ The event includes NL80211_ATTR_MAC to describe the BSSID address of the AP and NL80211_ATTR_TIMEOUT to specify the timeout value.
  • NL80211_CMD_ADD_LINK β€” adds a new link to an interface πŸ–‡οΈ The NL80211_ATTR_MLO_LINK_ID attribute is used for the new link.
  • NL80211_CMD_REMOVE_LINK β€” removes a link from an interface. Lowkey this one may come without NL80211_ATTR_MLO_LINK_ID as an easy way to remove all links in preparation for e.g. roaming to a regular (non-MLO) AP πŸ‘‹
  • NL80211_CMD_ADD_LINK_STA β€” add a link to an MLD station 🫢
  • NL80211_CMD_MODIFY_LINK_STA β€” modify a link of an MLD station ✨
  • NL80211_CMD_REMOVE_LINK_STA β€” remove a link of an MLD station πŸ’…
  • NL80211_CMD_SET_HW_TIMESTAMP β€” enable/disable HW timestamping of Timing measurement and Fine timing measurement frames ⏱️ If NL80211_ATTR_MAC is included, enable/disable HW timestamping only for frames to/from the specified MAC address. Otherwise, enable/disable HW timestamping for all TM/FTM frames (including ones that were enabled with a specific MAC address). If NL80211_ATTR_HW_TIMESTAMP_ENABLED is not included, disable HW timestamping. The number of peers that HW timestamping can be enabled for concurrently is indicated by NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS πŸ‘‘
  • NL80211_CMD_LINKS_REMOVED β€” notifies userspace about the removal of STA MLD setup links due to the AP MLD removing the corresponding affiliated APs with Multi-Link reconfiguration. NL80211_ATTR_MLO_LINKS is used to provide information about the removed STA MLD setup links 🧚
  • NL80211_CMD_SET_TID_TO_LINK_MAPPING β€” sets the TID to Link Mapping for a non-AP MLD station. The NL80211_ATTR_MLO_TTLM_DLINK and NL80211_ATTR_MLO_TTLM_ULINK attributes are used to specify the TID to Link mapping for downlink/uplink traffic πŸ”€
  • NL80211_CMD_ASSOC_MLO_RECONF β€” for a non-AP MLD station, this requests to add/remove links to/from the association πŸ’« To indicate link reconfiguration request results from the driver, this command is also used as an event to notify userspace about the added links information. For notifying the removed links information, the existing NL80211_CMD_LINKS_REMOVED command is used. This command is also used to notify userspace about newly added links for the current connection in case of AP-initiated link recommendation requests, received via a BTM (BSS Transition Management) request or a link reconfig notify frame, where the driver handles the link recommendation offload 🌈
  • NL80211_CMD_EPCS_CFG β€” EPCS configuration for a station πŸŽ€ Used by userland to control EPCS configuration. Also used to notify userland on the current state of EPCS.
  • NL80211_CMD_NAN_NEXT_DW_NOTIFICATION β€” this command notifies user space about the next NAN Discovery Window (DW) πŸͺŸ User space may use it to prepare frames to be sent in the next DW. NL80211_ATTR_WIPHY_FREQ is used to indicate the frequency of the next DW. SDF transmission should be requested with NL80211_CMD_FRAME, and the device/driver shall take care of the actual transmission timing. Heads up: this notification is only sent to the NAN interface owning socket (see the NL80211_ATTR_SOCKET_OWNER flag) πŸ’Œ
  • NL80211_CMD_NAN_CLUSTER_JOINED β€” notifies user space that the NAN new cluster has been joined 🌸 The cluster ID is indicated by NL80211_ATTR_MAC.
  • NL80211_CMD_INCUMBENT_SIGNAL_DETECT β€” once any incumbent signal is detected on the operating channel in the 6 GHz band, userspace gets notified with the signal interference bitmap using NL80211_ATTR_INCUMBENT_SIGNAL_INTERFERENCE_BITMAP πŸ“Ά The current channel definition is also sent.
  • NL80211_CMD_NAN_SET_LOCAL_SCHED β€” sets the local NAN schedule πŸ—“οΈ NAN must be operational (NL80211_CMD_START_NAN was executed). Must contain NL80211_ATTR_NAN_TIME_SLOTS and NL80211_ATTR_NAN_AVAIL_BLOB, but NL80211_ATTR_NAN_CHANNEL is optional (for example in case of a channel removal, that channel won't be provided). If NL80211_ATTR_NAN_SCHED_DEFERRED is set, the command is a request from the device to perform an announced schedule update β€” see NL80211_ATTR_NAN_SCHED_DEFERRED for more details. If it's not set, the schedule should be applied immediately ⚑
  • NL80211_CMD_NAN_SCHED_UPDATE_DONE β€” event sent to user space to notify that a deferred local NAN schedule update (requested with NL80211_CMD_NAN_SET_LOCAL_SCHED and NL80211_ATTR_NAN_SCHED_DEFERRED) has been completed 🎯 The presence of NL80211_ATTR_NAN_SCHED_UPDATE_SUCCESS indicates that the update was successful βœ…
  • NL80211_CMD_NAN_SET_PEER_SCHED β€” okay so this one sets the peer NAN schedule πŸ’…. NAN has to actually be operational for this (NL80211_CMD_START_NAN was executed, no cap). Required attributes: NL80211_ATTR_MAC (that's the peer NMI address) and NL80211_ATTR_NAN_COMMITTED_DW. Optionally, the full schedule can be provided by including all of: NL80211_ATTR_NAN_SEQ_ID, NL80211_ATTR_NAN_CHANNEL (one or more, like, plural), and NL80211_ATTR_NAN_PEER_MAPS (see enum nl80211_nan_peer_map_attrs). ⚠️ And if any of these three optional attributes is provided, all three must be provided β€” they're a package deal, periodt. Each peer channel must be compatible with at least one local channel set by NL80211_CMD_SET_LOCAL_NAN_SCHED. Different maps must not contain compatible channels. For single-radio devices (n_radio <= 1), different maps must not schedule the same time slot, because the device literally cannot operate on multiple channels simultaneously 😭. When updating an existing peer schedule, the full new schedule must be provided β€” partial updates are not supported, that's just the rules. The new schedule will completely replace the previous one. Also the peer schedule is automatically removed when the NMI station is removed. Slay.
  • NL80211_CMD_NAN_ULW_UPDATE β€” a notification from the driver to user space with the updated ULW blob of the device πŸ¦‹. User space can use this blob to attach to frames sent to peers. This notification contains NL80211_ATTR_NAN_ULW with the ULW blob.
  • NL80211_CMD_NAN_CHANNEL_EVAC β€” notification to indicate that a NAN channel has been evacuated due to resource conflicts with other interfaces 😀. This can happen when another interface sharing the channel resource with NAN needs to move to a different channel (e.g., channel switch or link switch on a BSS interface). The notification contains the NL80211_ATTR_NAN_CHANNEL attribute identifying the evacuated channel. User space may reconfigure the local schedule in response to this notification.
  • NL80211_CMD_START_PD β€” start PD operation, identified by its NL80211_ATTR_WDEV interface ✨. This interface must have been previously created with NL80211_CMD_NEW_INTERFACE β€” no shortcuts, bestie.
  • NL80211_CMD_STOP_PD β€” stop the PD operation, identified by its NL80211_ATTR_WDEV interface. That's it, that's the whole vibe.
  • __NL80211_CMD_AFTER_LAST β€” internal use πŸ™ˆ nothing to see here.
  • NL80211_CMD_MAX β€” highest used command number πŸ‘‘.

πŸ“ Note

Okay so heads up 🫢 β€” this command has been removed and it is only reserved at this point to avoid re-using the existing command number. The functionality this command was planned for has been provided with a cleaner design, with the option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN, NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE, NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE. So like, it's a museum piece now πŸ›οΈ.


πŸ” Description

User space uses the NL80211_CMD_CONNECT command to the host driver to trigger a connection. The host driver selects a BSS and further uses this interface to offload only the authentication part to user space πŸ’–. Authentication frames are passed between the driver and user space through the NL80211_CMD_FRAME interface. Host driver proceeds further with the association after getting successful authentication status. User space indicates the authentication status through the NL80211_ATTR_STATUS_CODE attribute in the NL80211_CMD_EXTERNAL_AUTH command interface.

Now the MLO part, and this is the main character energy πŸ‘‘ β€” host driver sends the MLD address of the AP with NL80211_ATTR_MLD_ADDR in the NL80211_CMD_EXTERNAL_AUTH event to indicate to user space to enable MLO during the authentication offload in STA mode while connecting to MLD APs. Host driver should check the NL80211_ATTR_MLO_SUPPORT flag capability in NL80211_CMD_CONNECT to know whether the user space supports enabling MLO during the authentication offload or not. User space should enable MLO during the authentication only when it receives the AP MLD address in the authentication offload request. And user space shouldn't enable MLO when the authentication offload request doesn't indicate the AP MLD address, even if the AP is MLO capable β€” no guessing, fr fr πŸ™…. User space should use NL80211_ATTR_MLD_ADDR as peer's MLD address and the interface address identified by NL80211_ATTR_IFINDEX as self MLD address. User space and host driver use MLD addresses in the RA, TA and BSSID fields of the frames between them, and the host driver translates the MLD addresses to/from link addresses based on the link chosen for the authentication.

Host driver reports this status on an authentication failure to the user space through the connect result, since the user space would have initiated the connection through the connect request.

Measurement tea β˜• β€” to cancel a measurement, close the socket that requested it. Iconic, honestly.

Measurement results are reported to the socket that requested the measurement using NL80211_CMD_PEER_MEASUREMENT_RESULT when they become available, so applications must ensure a large enough socket buffer size (lowkey this matters, don't skip it 😭).

Depending on driver support it may or may not be possible to start multiple concurrent measurements.

And the mesh bit πŸ•ΈοΈ β€” here the NL80211_ATTR_MAC attribute is used to specify the connected mesh peer MAC address and NL80211_ATTR_FRAME is used to specify the frame content. The frame is ethernet data.


🌈 SEE ALSO

The whole squad, in order, no one left behind πŸ’œ β€” starting with the source file ./include/uapi/linux/nl80211.h:

  • Station handling(9)
  • Frame transmission/registration support(9)
  • Virtual interface / concurrency capabilities(9)
  • packet coalesce support(9)
  • WPA/WPA2 EAPOL handshake offload(9)
  • FILS shared key authentication offload(9)
  • SAE authentication offload(9)
  • VLAN offload support for setting group keys and binding STAs to VLANs(9)
  • TID configuration(9)
  • FILS shared key crypto offload(9)
  • Multi-Link Operation(9)
  • OWE DH IE handling offload(9)
  • enum nl80211_attrs(9)
  • enum nl80211_iftype(9)
  • enum nl80211_sta_flags(9)
  • enum nl80211_sta_p2p_ps_status(9)
  • struct nl80211_sta_flag_update(9)
  • enum nl80211_he_gi(9)
  • enum nl80211_he_ltf(9)
  • enum nl80211_he_ru_alloc(9)
  • enum nl80211_eht_gi(9)
  • enum nl80211_eht_ltf(9)
  • enum nl80211_eht_ru_alloc(9)
  • enum nl80211_rate_info(9)
  • enum nl80211_sta_bss_param(9)
  • enum nl80211_sta_info(9)
  • enum nl80211_tid_stats(9)
  • enum nl80211_txq_stats(9)
  • enum nl80211_mpath_flags(9)
  • enum nl80211_mpath_info(9)
  • enum nl80211_band_iftype_attr(9)
  • enum nl80211_band_attr(9)
  • enum nl80211_nan_phy_cap_attr(9)
  • enum nl80211_wmm_rule(9)
  • enum nl80211_frequency_attr(9)
  • enum nl80211_bitrate_attr(9)
  • enum nl80211_reg_initiator(9)
  • enum nl80211_reg_type(9)
  • enum nl80211_reg_rule_attr(9)
  • enum nl80211_sched_scan_match_attr(9)
  • enum nl80211_reg_rule_flags(9)
  • enum nl80211_dfs_regions(9)
  • enum nl80211_user_reg_hint_type(9)
  • enum nl80211_survey_info(9)
  • enum nl80211_mntr_flags(9)
  • enum nl80211_mesh_power_mode(9)
  • enum nl80211_meshconf_params(9)
  • enum nl80211_mesh_setup_params(9)
  • enum nl80211_txq_attr(9)
  • enum nl80211_channel_type(9)
  • enum nl80211_key_mode(9)
  • enum nl80211_chan_width(9)
  • enum nl80211_bss_scan_width(9)
  • enum nl80211_bss_use_for(9)
  • enum nl80211_bss_cannot_use_reasons(9)
  • enum nl80211_bss(9)
  • enum nl80211_bss_status(9)
  • enum nl80211_auth_type(9)
  • enum nl80211_key_type(9)
  • enum nl80211_mfp(9)
  • enum nl80211_key_default_types(9)
  • enum nl80211_key_attributes(9)
  • enum nl80211_tx_rate_attributes(9)
  • struct nl80211_txrate_vht(9)
  • struct nl80211_txrate_he(9)
  • struct nl80211_txrate_eht(9)
  • enum nl80211_band(9)
  • enum nl80211_ps_state(9)
  • enum nl80211_attr_cqm(9)
  • enum nl80211_cqm_rssi_threshold_event(9)
  • enum nl80211_tx_power_setting(9)
  • enum nl80211_tid_config(9)
  • enum nl80211_packet_pattern_attr(9)
  • struct nl80211_pattern_support(9)
  • enum nl80211_wowlan_triggers(9)
  • TCP connection wakeup(9)
  • struct nl80211_wowlan_tcp_data_seq(9)
  • struct nl80211_wowlan_tcp_data_token(9)
  • struct nl80211_wowlan_tcp_data_token_feature(9)
  • enum nl80211_wowlan_tcp_attrs(9)
  • struct nl80211_coalesce_rule_support(9)
  • enum nl80211_attr_coalesce_rule(9)
  • enum nl80211_coalesce_condition(9)
  • enum nl80211_iface_limit_attrs(9)
  • enum nl80211_if_combination_attrs(9)
  • enum nl80211_plink_state(9)
  • enum nl80211_plink_action(9)
  • enum nl80211_rekey_data(9)
  • enum nl80211_hidden_ssid(9)
  • enum nl80211_sta_wme_attr(9)
  • enum nl80211_pmksa_candidate_attr(9)
  • enum nl80211_tdls_operation(9)
  • enum nl80211_ap_sme_features(9)
  • enum nl80211_feature_flags(9)
  • enum nl80211_ext_feature_index(9)
  • enum nl80211_probe_resp_offload_support_attr(9)
  • enum nl80211_connect_failed_reason(9)
  • enum nl80211_timeout_reason(9)
  • enum nl80211_scan_flags(9)
  • enum nl80211_acl_policy(9)
  • enum nl80211_smps_mode(9)
  • enum nl80211_radar_event(9)
  • enum nl80211_dfs_state(9)
  • enum nl80211_protocol_features(9)
  • enum nl80211_crit_proto_id(9)
  • enum nl80211_rxmgmt_flags(9)
  • struct nl80211_vendor_cmd_info(9)
  • enum nl80211_tdls_peer_capability(9)
  • enum nl80211_sched_scan_plan(9)
  • struct nl80211_bss_select_rssi_adjust(9)
  • enum nl80211_bss_select_attr(9)
  • enum nl80211_nan_function_type(9)
  • enum nl80211_nan_publish_type(9)
  • enum nl80211_nan_func_term_reason(9)
  • enum nl80211_nan_func_attributes(9)
  • enum nl80211_nan_srf_attributes(9)
  • enum nl80211_nan_match_attributes(9)
  • enum nl80211_nan_band_conf_attributes(9)
  • enum nl80211_nan_conf_attributes(9)
  • enum nl80211_external_auth_action(9)
  • enum nl80211_ftm_responder_attributes(9)
  • enum nl80211_preamble(9)
  • enum nl80211_peer_measurement_type(9)
  • enum nl80211_peer_measurement_status(9)
  • enum nl80211_peer_measurement_req(9)
  • enum nl80211_peer_measurement_resp(9)
  • enum nl80211_peer_measurement_ftm_req_type(9)
  • enum nl80211_peer_measurement_peer_attrs(9)
  • enum nl80211_peer_measurement_attrs(9)
  • enum nl80211_peer_measurement_ftm_capa(9)
  • enum nl80211_peer_measurement_ftm_type_capa(9)
  • enum nl80211_peer_measurement_ftm_req(9)
  • enum nl80211_peer_measurement_ftm_failure_reasons(9)
  • enum nl80211_peer_measurement_ftm_resp(9)
  • enum nl80211_obss_pd_attributes(9)
  • enum nl80211_bss_color_attributes(9)
  • enum nl80211_iftype_akm_attributes(9)
  • enum nl80211_fils_discovery_attributes(9)
  • enum nl80211_unsol_bcast_probe_resp_attributes(9)
  • enum nl80211_sae_pwe_mechanism(9)
  • enum nl80211_sar_type(9)
  • enum nl80211_sar_attrs(9)
  • enum nl80211_sar_specs_attrs(9)
  • enum nl80211_mbssid_config_attributes(9)
  • enum nl80211_ap_settings_flags(9)
  • enum nl80211_wiphy_radio_attrs(9)
  • enum nl80211_wiphy_radio_freq_range(9)
  • enum nl80211_s1g_short_beacon_attrs(9)
  • enum nl80211_nan_capabilities(9)
  • enum nl80211_nan_peer_map_attrs(9)

Okay bestie, that's the whole page, start to finish πŸŽ€ and that's a wrap on part 8! This lil' beauty lives in ./include/uapi/linux, it's the enum nl80211_commands(9) page, and it was dated October 2026 β€” yes, from the future, she's ahead of her time β­πŸ’…. Go forth and configure your wireless, you absolute icon πŸ¦‹πŸ’–

πŸ“¦ where this page comes from