Skip to content

Commit 35eb8f7

Browse files
jmalinenjmberg-intel
authored andcommitted
cfg80211: Improve Connect/Associate command documentation
The roaming cases for the Connect command were not fully covered and neither Connect nor Associate command uses of the prev_bssid parameter were very clear. Add details to describe how the prev_bssid argument is supposed to be used and when the driver should use association or reassociation. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent bddf590 commit 35eb8f7

2 files changed

Lines changed: 36 additions & 6 deletions

File tree

‎include/net/cfg80211.h‎

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,7 +1750,12 @@ enum cfg80211_assoc_req_flags {
17501750
* @ie_len: Length of ie buffer in octets
17511751
* @use_mfp: Use management frame protection (IEEE 802.11w) in this association
17521752
* @crypto: crypto settings
1753-
* @prev_bssid: previous BSSID, if not %NULL use reassociate frame
1753+
* @prev_bssid: previous BSSID, if not %NULL use reassociate frame. This is used
1754+
* to indicate a request to reassociate within the ESS instead of a request
1755+
* do the initial association with the ESS. When included, this is set to
1756+
* the BSSID of the current association, i.e., to the value that is
1757+
* included in the Current AP address field of the Reassociation Request
1758+
* frame.
17541759
* @flags: See &enum cfg80211_assoc_req_flags
17551760
* @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask
17561761
* will be used in ht_capa. Un-supported values will be ignored.
@@ -1925,7 +1930,12 @@ struct cfg80211_bss_selection {
19251930
* @pbss: if set, connect to a PCP instead of AP. Valid for DMG
19261931
* networks.
19271932
* @bss_select: criteria to be used for BSS selection.
1928-
* @prev_bssid: previous BSSID, if not %NULL use reassociate frame
1933+
* @prev_bssid: previous BSSID, if not %NULL use reassociate frame. This is used
1934+
* to indicate a request to reassociate within the ESS instead of a request
1935+
* do the initial association with the ESS. When included, this is set to
1936+
* the BSSID of the current association, i.e., to the value that is
1937+
* included in the Current AP address field of the Reassociation Request
1938+
* frame.
19291939
*/
19301940
struct cfg80211_connect_params {
19311941
struct ieee80211_channel *channel;
@@ -2377,7 +2387,17 @@ struct cfg80211_qos_map {
23772387
* @connect: Connect to the ESS with the specified parameters. When connected,
23782388
* call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS.
23792389
* If the connection fails for some reason, call cfg80211_connect_result()
2380-
* with the status from the AP.
2390+
* with the status from the AP. The driver is allowed to roam to other
2391+
* BSSes within the ESS when the other BSS matches the connect parameters.
2392+
* When such roaming is initiated by the driver, the driver is expected to
2393+
* verify that the target matches the configured security parameters and
2394+
* to use Reassociation Request frame instead of Association Request frame.
2395+
* The connect function can also be used to request the driver to perform
2396+
* a specific roam when connected to an ESS. In that case, the prev_bssid
2397+
* parameter is set to the BSSID of the currently associated BSS as an
2398+
* indication of requesting reassociation. In both the driver-initiated and
2399+
* new connect() call initiated roaming cases, the result of roaming is
2400+
* indicated with a call to cfg80211_roamed() or cfg80211_roamed_bss().
23812401
* (invoked with the wireless_dev mutex held)
23822402
* @disconnect: Disconnect from the BSS/ESS.
23832403
* (invoked with the wireless_dev mutex held)

‎include/uapi/linux/nl80211.h‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,11 @@
429429
* @NL80211_CMD_ASSOCIATE: association request and notification; like
430430
* NL80211_CMD_AUTHENTICATE but for Association and Reassociation
431431
* (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
432-
* MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives).
432+
* MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives). The
433+
* %NL80211_ATTR_PREV_BSSID attribute is used to specify whether the
434+
* request is for the initial association to an ESS (that attribute not
435+
* included) or for reassociation within the ESS (that attribute is
436+
* included).
433437
* @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
434438
* NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
435439
* MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
@@ -479,6 +483,9 @@
479483
* set of BSSID,frequency parameters is used (i.e., either the enforcing
480484
* %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
481485
* %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
486+
* %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within
487+
* the ESS in case the device is already associated and an association with
488+
* a different BSS is desired.
482489
* Background scan period can optionally be
483490
* specified in %NL80211_ATTR_BG_SCAN_PERIOD,
484491
* if not specified default background scan configuration
@@ -1287,8 +1294,11 @@ enum nl80211_commands {
12871294
* @NL80211_ATTR_RESP_IE: (Re)association response information elements as
12881295
* sent by peer, for ROAM and successful CONNECT events.
12891296
*
1290-
* @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE
1291-
* commands to specify using a reassociate frame
1297+
* @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used in ASSOCIATE and CONNECT
1298+
* commands to specify a request to reassociate within an ESS, i.e., to use
1299+
* Reassociate Request frame (with the value of this attribute in the
1300+
* Current AP address field) instead of Association Request frame which is
1301+
* used for the initial association to an ESS.
12921302
*
12931303
* @NL80211_ATTR_KEY: key information in a nested attribute with
12941304
* %NL80211_KEY_* sub-attributes

0 commit comments

Comments
 (0)