aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2011-09-04 04:11:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-14 13:56:26 -0400
commit7827493b886c307bc497a669305207f8a5b36eb2 (patch)
treee7d109fc3a2e78ee4f8ff56d79704d6280dc1c22
parent28e3181a7717b7e7934391c29e21c5302324479c (diff)
mac80211: add ssid config to bss information in AP-mode
Set SSID information from nl80211 beacon parameters. Advertise changes in SSID to low level drivers. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--include/net/mac80211.h8
-rw-r--r--net/mac80211/cfg.c19
-rw-r--r--net/mac80211/util.c2
3 files changed, 28 insertions, 1 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index fc4806c6097f..643e1291a1e8 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -164,6 +164,7 @@ struct ieee80211_low_level_stats {
164 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note 164 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note
165 * that it is only ever disabled for station mode. 165 * that it is only ever disabled for station mode.
166 * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. 166 * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface.
167 * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode)
167 */ 168 */
168enum ieee80211_bss_change { 169enum ieee80211_bss_change {
169 BSS_CHANGED_ASSOC = 1<<0, 170 BSS_CHANGED_ASSOC = 1<<0,
@@ -181,6 +182,7 @@ enum ieee80211_bss_change {
181 BSS_CHANGED_ARP_FILTER = 1<<12, 182 BSS_CHANGED_ARP_FILTER = 1<<12,
182 BSS_CHANGED_QOS = 1<<13, 183 BSS_CHANGED_QOS = 1<<13,
183 BSS_CHANGED_IDLE = 1<<14, 184 BSS_CHANGED_IDLE = 1<<14,
185 BSS_CHANGED_SSID = 1<<15,
184 186
185 /* when adding here, make sure to change ieee80211_reconfig */ 187 /* when adding here, make sure to change ieee80211_reconfig */
186}; 188};
@@ -254,6 +256,9 @@ enum ieee80211_rssi_event {
254 * @idle: This interface is idle. There's also a global idle flag in the 256 * @idle: This interface is idle. There's also a global idle flag in the
255 * hardware config which may be more appropriate depending on what 257 * hardware config which may be more appropriate depending on what
256 * your driver/device needs to do. 258 * your driver/device needs to do.
259 * @ssid: The SSID of the current vif. Only valid in AP-mode.
260 * @ssid_len: Length of SSID given in @ssid.
261 * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode.
257 */ 262 */
258struct ieee80211_bss_conf { 263struct ieee80211_bss_conf {
259 const u8 *bssid; 264 const u8 *bssid;
@@ -280,6 +285,9 @@ struct ieee80211_bss_conf {
280 bool arp_filter_enabled; 285 bool arp_filter_enabled;
281 bool qos; 286 bool qos;
282 bool idle; 287 bool idle;
288 u8 ssid[IEEE80211_MAX_SSID_LEN];
289 size_t ssid_len;
290 bool hidden_ssid;
283}; 291};
284 292
285/** 293/**
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 5c0d8fab0e88..b57ddf941e59 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -455,6 +455,20 @@ static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
455 return ret; 455 return ret;
456} 456}
457 457
458static void ieee80211_config_ap_ssid(struct ieee80211_sub_if_data *sdata,
459 struct beacon_parameters *params)
460{
461 struct ieee80211_bss_conf *bss_conf = &sdata->vif.bss_conf;
462
463 bss_conf->ssid_len = params->ssid_len;
464
465 if (params->ssid_len)
466 memcpy(bss_conf->ssid, params->ssid, params->ssid_len);
467
468 bss_conf->hidden_ssid =
469 (params->hidden_ssid != NL80211_HIDDEN_SSID_NOT_IN_USE);
470}
471
458/* 472/*
459 * This handles both adding a beacon and setting new beacon info 473 * This handles both adding a beacon and setting new beacon info
460 */ 474 */
@@ -548,8 +562,11 @@ static int ieee80211_config_beacon(struct ieee80211_sub_if_data *sdata,
548 562
549 kfree(old); 563 kfree(old);
550 564
565 ieee80211_config_ap_ssid(sdata, params);
566
551 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | 567 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED |
552 BSS_CHANGED_BEACON); 568 BSS_CHANGED_BEACON |
569 BSS_CHANGED_SSID);
553 return 0; 570 return 0;
554} 571}
555 572
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 1c1080274730..4b1466d5b6a1 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1077,6 +1077,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1077 changed |= BSS_CHANGED_IBSS; 1077 changed |= BSS_CHANGED_IBSS;
1078 /* fall through */ 1078 /* fall through */
1079 case NL80211_IFTYPE_AP: 1079 case NL80211_IFTYPE_AP:
1080 changed |= BSS_CHANGED_SSID;
1081 /* fall through */
1080 case NL80211_IFTYPE_MESH_POINT: 1082 case NL80211_IFTYPE_MESH_POINT:
1081 changed |= BSS_CHANGED_BEACON | 1083 changed |= BSS_CHANGED_BEACON |
1082 BSS_CHANGED_BEACON_ENABLED; 1084 BSS_CHANGED_BEACON_ENABLED;