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

mac80211: remove SSID driver code

Remove the SSID from the driver API since now there is no
driver that requires knowing the SSID and I think it's
unlikely that any hardware design that does require the
SSID will play well with mac80211.

This also removes support for setting the SSID in master
mode which will require a patch to hostapd to not try.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Johannes Berg and committed by
John W. Linville
41bb73ee b23f99bc

+4 -69
-7
drivers/net/wireless/iwlwifi/iwl-agn.c
··· 2957 2957 return rc; 2958 2958 } 2959 2959 2960 - if ((priv->iw_mode == NL80211_IFTYPE_AP) && 2961 - (!conf->ssid_len)) { 2962 - IWL_DEBUG_MAC80211 2963 - ("Leaving in AP mode because HostAPD is not ready.\n"); 2964 - return 0; 2965 - } 2966 - 2967 2960 if (!iwl_is_alive(priv)) 2968 2961 return -EAGAIN; 2969 2962
-7
drivers/net/wireless/iwlwifi/iwl3945-base.c
··· 6743 6743 6744 6744 /* XXX: this MUST use conf->mac_addr */ 6745 6745 6746 - if ((priv->iw_mode == NL80211_IFTYPE_AP) && 6747 - (!conf->ssid_len)) { 6748 - IWL_DEBUG_MAC80211 6749 - ("Leaving in AP mode because HostAPD is not ready.\n"); 6750 - return 0; 6751 - } 6752 - 6753 6746 if (!iwl3945_is_alive(priv)) 6754 6747 return -EAGAIN; 6755 6748
+1 -10
include/net/mac80211.h
··· 616 616 * enum ieee80211_if_conf_change - interface config change flags 617 617 * 618 618 * @IEEE80211_IFCC_BSSID: The BSSID changed. 619 - * @IEEE80211_IFCC_SSID: The SSID changed. 620 619 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed 621 620 * (currently AP and MESH only), use ieee80211_beacon_get(). 622 621 */ 623 622 enum ieee80211_if_conf_change { 624 623 IEEE80211_IFCC_BSSID = BIT(0), 625 - IEEE80211_IFCC_SSID = BIT(1), 626 - IEEE80211_IFCC_BEACON = BIT(2), 624 + IEEE80211_IFCC_BEACON = BIT(1), 627 625 }; 628 626 629 627 /** ··· 629 631 * 630 632 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. 631 633 * @bssid: BSSID of the network we are associated to/creating. 632 - * @ssid: used (together with @ssid_len) by drivers for hardware that 633 - * generate beacons independently. The pointer is valid only during the 634 - * config_interface() call, so copy the value somewhere if you need 635 - * it. 636 - * @ssid_len: length of the @ssid field. 637 634 * 638 635 * This structure is passed to the config_interface() callback of 639 636 * &struct ieee80211_hw. ··· 636 643 struct ieee80211_if_conf { 637 644 u32 changed; 638 645 u8 *bssid; 639 - u8 *ssid; 640 - size_t ssid_len; 641 646 }; 642 647 643 648 /**
-3
net/mac80211/ieee80211_i.h
··· 212 212 213 213 struct list_head vlans; 214 214 215 - u8 ssid[IEEE80211_MAX_SSID_LEN]; 216 - size_t ssid_len; 217 - 218 215 /* yes, this looks ugly, but guarantees that we can later use 219 216 * bitmap_empty :) 220 217 * NB: don't touch this bitmap, use sta_info_{set,clear}_tim_bit */
+3 -12
net/mac80211/main.c
··· 171 171 conf.changed = changed; 172 172 173 173 if (sdata->vif.type == NL80211_IFTYPE_STATION || 174 - sdata->vif.type == NL80211_IFTYPE_ADHOC) { 174 + sdata->vif.type == NL80211_IFTYPE_ADHOC) 175 175 conf.bssid = sdata->u.sta.bssid; 176 - conf.ssid = sdata->u.sta.ssid; 177 - conf.ssid_len = sdata->u.sta.ssid_len; 178 - } else if (sdata->vif.type == NL80211_IFTYPE_AP) { 176 + else if (sdata->vif.type == NL80211_IFTYPE_AP) 179 177 conf.bssid = sdata->dev->dev_addr; 180 - conf.ssid = sdata->u.ap.ssid; 181 - conf.ssid_len = sdata->u.ap.ssid_len; 182 - } else if (ieee80211_vif_is_mesh(&sdata->vif)) { 178 + else if (ieee80211_vif_is_mesh(&sdata->vif)) { 183 179 u8 zero[ETH_ALEN] = { 0 }; 184 180 conf.bssid = zero; 185 - conf.ssid = zero; 186 - conf.ssid_len = 0; 187 181 } else { 188 182 WARN_ON(1); 189 183 return -EINVAL; 190 184 } 191 185 192 186 if (WARN_ON(!conf.bssid && (changed & IEEE80211_IFCC_BSSID))) 193 - return -EINVAL; 194 - 195 - if (WARN_ON(!conf.ssid && (changed & IEEE80211_IFCC_SSID))) 196 187 return -EINVAL; 197 188 198 189 return local->ops->config_interface(local_to_hw(local),
-14
net/mac80211/mlme.c
··· 2416 2416 int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size_t len) 2417 2417 { 2418 2418 struct ieee80211_if_sta *ifsta; 2419 - int res; 2420 2419 2421 2420 if (len > IEEE80211_MAX_SSID_LEN) 2422 2421 return -EINVAL; ··· 2427 2428 memcpy(ifsta->ssid, ssid, len); 2428 2429 ifsta->ssid_len = len; 2429 2430 ifsta->flags &= ~IEEE80211_STA_PREV_BSSID_SET; 2430 - 2431 - res = 0; 2432 - /* 2433 - * Hack! MLME code needs to be cleaned up to have different 2434 - * entry points for configuration and internal selection change 2435 - */ 2436 - if (netif_running(sdata->dev)) 2437 - res = ieee80211_if_config(sdata, IEEE80211_IFCC_SSID); 2438 - if (res) { 2439 - printk(KERN_DEBUG "%s: Failed to config new SSID to " 2440 - "the low-level driver\n", sdata->dev->name); 2441 - return res; 2442 - } 2443 2431 } 2444 2432 2445 2433 if (len)
-16
net/mac80211/wext.c
··· 407 407 return 0; 408 408 } 409 409 410 - if (sdata->vif.type == NL80211_IFTYPE_AP) { 411 - memcpy(sdata->u.ap.ssid, ssid, len); 412 - memset(sdata->u.ap.ssid + len, 0, 413 - IEEE80211_MAX_SSID_LEN - len); 414 - sdata->u.ap.ssid_len = len; 415 - return ieee80211_if_config(sdata, IEEE80211_IFCC_SSID); 416 - } 417 410 return -EOPNOTSUPP; 418 411 } 419 412 ··· 430 437 return res; 431 438 } 432 439 433 - if (sdata->vif.type == NL80211_IFTYPE_AP) { 434 - len = sdata->u.ap.ssid_len; 435 - if (len > IW_ESSID_MAX_SIZE) 436 - len = IW_ESSID_MAX_SIZE; 437 - memcpy(ssid, sdata->u.ap.ssid, len); 438 - data->length = len; 439 - data->flags = 1; 440 - return 0; 441 - } 442 440 return -EOPNOTSUPP; 443 441 } 444 442