Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jouni Malinen and committed by
Johannes Berg
35eb8f7b bddf5904

+36 -6
+23 -3
include/net/cfg80211.h
··· 1750 1750 * @ie_len: Length of ie buffer in octets 1751 1751 * @use_mfp: Use management frame protection (IEEE 802.11w) in this association 1752 1752 * @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. 1754 1759 * @flags: See &enum cfg80211_assoc_req_flags 1755 1760 * @ht_capa: HT Capabilities over-rides. Values set in ht_capa_mask 1756 1761 * will be used in ht_capa. Un-supported values will be ignored. ··· 1930 1925 * @pbss: if set, connect to a PCP instead of AP. Valid for DMG 1931 1926 * networks. 1932 1927 * @bss_select: criteria to be used for BSS selection. 1933 - * @prev_bssid: previous BSSID, if not %NULL use reassociate frame 1928 + * @prev_bssid: previous BSSID, if not %NULL use reassociate frame. This is used 1929 + * to indicate a request to reassociate within the ESS instead of a request 1930 + * do the initial association with the ESS. When included, this is set to 1931 + * the BSSID of the current association, i.e., to the value that is 1932 + * included in the Current AP address field of the Reassociation Request 1933 + * frame. 1934 1934 */ 1935 1935 struct cfg80211_connect_params { 1936 1936 struct ieee80211_channel *channel; ··· 2387 2377 * @connect: Connect to the ESS with the specified parameters. When connected, 2388 2378 * call cfg80211_connect_result() with status code %WLAN_STATUS_SUCCESS. 2389 2379 * If the connection fails for some reason, call cfg80211_connect_result() 2390 - * with the status from the AP. 2380 + * with the status from the AP. The driver is allowed to roam to other 2381 + * BSSes within the ESS when the other BSS matches the connect parameters. 2382 + * When such roaming is initiated by the driver, the driver is expected to 2383 + * verify that the target matches the configured security parameters and 2384 + * to use Reassociation Request frame instead of Association Request frame. 2385 + * The connect function can also be used to request the driver to perform 2386 + * a specific roam when connected to an ESS. In that case, the prev_bssid 2387 + * parameter is set to the BSSID of the currently associated BSS as an 2388 + * indication of requesting reassociation. In both the driver-initiated and 2389 + * new connect() call initiated roaming cases, the result of roaming is 2390 + * indicated with a call to cfg80211_roamed() or cfg80211_roamed_bss(). 2391 2391 * (invoked with the wireless_dev mutex held) 2392 2392 * @disconnect: Disconnect from the BSS/ESS. 2393 2393 * (invoked with the wireless_dev mutex held)
+13 -3
include/uapi/linux/nl80211.h
··· 429 429 * @NL80211_CMD_ASSOCIATE: association request and notification; like 430 430 * NL80211_CMD_AUTHENTICATE but for Association and Reassociation 431 431 * (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). 433 437 * @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like 434 438 * NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to 435 439 * MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication ··· 483 479 * set of BSSID,frequency parameters is used (i.e., either the enforcing 484 480 * %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict 485 481 * %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT). 482 + * %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within 483 + * the ESS in case the device is already associated and an association with 484 + * a different BSS is desired. 486 485 * Background scan period can optionally be 487 486 * specified in %NL80211_ATTR_BG_SCAN_PERIOD, 488 487 * if not specified default background scan configuration ··· 1294 1287 * @NL80211_ATTR_RESP_IE: (Re)association response information elements as 1295 1288 * sent by peer, for ROAM and successful CONNECT events. 1296 1289 * 1297 - * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used by in ASSOCIATE 1298 - * commands to specify using a reassociate frame 1290 + * @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used in ASSOCIATE and CONNECT 1291 + * commands to specify a request to reassociate within an ESS, i.e., to use 1292 + * Reassociate Request frame (with the value of this attribute in the 1293 + * Current AP address field) instead of Association Request frame which is 1294 + * used for the initial association to an ESS. 1299 1295 * 1300 1296 * @NL80211_ATTR_KEY: key information in a nested attribute with 1301 1297 * %NL80211_KEY_* sub-attributes