diff options
author | Marek Puzyniak <marek.puzyniak@tieto.com> | 2013-04-10 07:19:13 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-04-10 14:24:18 -0400 |
commit | 0ca54f6c5fd4ce58aa044d1fc7f00d7f6cf2801c (patch) | |
tree | c28fc0f42e866621bab9a7745ea1e2ee76b74c3a | |
parent | a21a4d3e8ad4d513f5a6eefc91510febb205f601 (diff) |
mac80211: provide SSID in IBSS mode
Some drivers need SSID in AP and IBSS mode. AP SSID is provided
through BSS_CHANGED_SSID notification. There was no easy way to
do the same for IBSS. In IBSS mode SSID is known but was not
stored in BSS configuration. Extend the AP-mode functionality
to also work in IBSS mode.
Signed-off-by: Marek Puzyniak <marek.puzyniak@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r-- | include/net/mac80211.h | 4 | ||||
-rw-r--r-- | net/mac80211/ibss.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 64faf015dd1e..0dde213dd3b6 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -209,7 +209,7 @@ struct ieee80211_chanctx_conf { | |||
209 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note | 209 | * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note |
210 | * that it is only ever disabled for station mode. | 210 | * that it is only ever disabled for station mode. |
211 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. | 211 | * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface. |
212 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | 212 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP and IBSS mode) |
213 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) | 213 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) |
214 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) | 214 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) |
215 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface | 215 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface |
@@ -326,7 +326,7 @@ enum ieee80211_rssi_event { | |||
326 | * your driver/device needs to do. | 326 | * your driver/device needs to do. |
327 | * @ps: power-save mode (STA only). This flag is NOT affected by | 327 | * @ps: power-save mode (STA only). This flag is NOT affected by |
328 | * offchannel/dynamic_ps operations. | 328 | * offchannel/dynamic_ps operations. |
329 | * @ssid: The SSID of the current vif. Only valid in AP-mode. | 329 | * @ssid: The SSID of the current vif. Valid in AP and IBSS mode. |
330 | * @ssid_len: Length of SSID given in @ssid. | 330 | * @ssid_len: Length of SSID given in @ssid. |
331 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | 331 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
332 | * @txpower: TX power in dBm | 332 | * @txpower: TX power in dBm |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 2a0b2186d98f..b7bf6d76f1d9 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -209,6 +209,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
209 | sdata->vif.bss_conf.enable_beacon = true; | 209 | sdata->vif.bss_conf.enable_beacon = true; |
210 | sdata->vif.bss_conf.beacon_int = beacon_int; | 210 | sdata->vif.bss_conf.beacon_int = beacon_int; |
211 | sdata->vif.bss_conf.basic_rates = basic_rates; | 211 | sdata->vif.bss_conf.basic_rates = basic_rates; |
212 | sdata->vif.bss_conf.ssid_len = ifibss->ssid_len; | ||
213 | memcpy(sdata->vif.bss_conf.ssid, ifibss->ssid, ifibss->ssid_len); | ||
212 | bss_change = BSS_CHANGED_BEACON_INT; | 214 | bss_change = BSS_CHANGED_BEACON_INT; |
213 | bss_change |= ieee80211_reset_erp_info(sdata); | 215 | bss_change |= ieee80211_reset_erp_info(sdata); |
214 | bss_change |= BSS_CHANGED_BSSID; | 216 | bss_change |= BSS_CHANGED_BSSID; |
@@ -217,6 +219,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
217 | bss_change |= BSS_CHANGED_BASIC_RATES; | 219 | bss_change |= BSS_CHANGED_BASIC_RATES; |
218 | bss_change |= BSS_CHANGED_HT; | 220 | bss_change |= BSS_CHANGED_HT; |
219 | bss_change |= BSS_CHANGED_IBSS; | 221 | bss_change |= BSS_CHANGED_IBSS; |
222 | bss_change |= BSS_CHANGED_SSID; | ||
220 | 223 | ||
221 | /* | 224 | /* |
222 | * In 5 GHz/802.11a, we can always use short slot time. | 225 | * In 5 GHz/802.11a, we can always use short slot time. |
@@ -1159,6 +1162,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) | |||
1159 | sdata->vif.bss_conf.ibss_joined = false; | 1162 | sdata->vif.bss_conf.ibss_joined = false; |
1160 | sdata->vif.bss_conf.ibss_creator = false; | 1163 | sdata->vif.bss_conf.ibss_creator = false; |
1161 | sdata->vif.bss_conf.enable_beacon = false; | 1164 | sdata->vif.bss_conf.enable_beacon = false; |
1165 | sdata->vif.bss_conf.ssid_len = 0; | ||
1162 | clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); | 1166 | clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state); |
1163 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | | 1167 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | |
1164 | BSS_CHANGED_IBSS); | 1168 | BSS_CHANGED_IBSS); |