diff options
author | Sujith Manoharan <c_manoha@qti.qualcomm.com> | 2012-10-12 08:05:45 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2012-10-18 03:01:53 -0400 |
commit | c13a765bd96f4e2f52d218ee6e5c0715380eeeb8 (patch) | |
tree | eb785098f0a3e3eb4217d9943e9dcd26180ad6b8 /net/mac80211/ibss.c | |
parent | cd2bb512cda58f1efb922ad6dc29013ea5d5d9d0 (diff) |
mac80211: Notify new IBSS network creation
Initialization of beacon transmission in IBSS mode depends
on whether a new BSS is being created or joined. When joining
an existing IBSS network, beaconing has to start only after
a TSF-sync has happened - this is explained in 11.1.4.
Introduce a new parameter in the BSS information structure to
indicate creator/joiner mode.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r-- | net/mac80211/ibss.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index c6b1448224f2..3d5332e367f8 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -38,7 +38,8 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
38 | const u8 *bssid, const int beacon_int, | 38 | const u8 *bssid, const int beacon_int, |
39 | struct ieee80211_channel *chan, | 39 | struct ieee80211_channel *chan, |
40 | const u32 basic_rates, | 40 | const u32 basic_rates, |
41 | const u16 capability, u64 tsf) | 41 | const u16 capability, u64 tsf, |
42 | bool creator) | ||
42 | { | 43 | { |
43 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; | 44 | struct ieee80211_if_ibss *ifibss = &sdata->u.ibss; |
44 | struct ieee80211_local *local = sdata->local; | 45 | struct ieee80211_local *local = sdata->local; |
@@ -71,6 +72,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
71 | /* if merging, indicate to driver that we leave the old IBSS */ | 72 | /* if merging, indicate to driver that we leave the old IBSS */ |
72 | if (sdata->vif.bss_conf.ibss_joined) { | 73 | if (sdata->vif.bss_conf.ibss_joined) { |
73 | sdata->vif.bss_conf.ibss_joined = false; | 74 | sdata->vif.bss_conf.ibss_joined = false; |
75 | sdata->vif.bss_conf.ibss_creator = false; | ||
74 | netif_carrier_off(sdata->dev); | 76 | netif_carrier_off(sdata->dev); |
75 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IBSS); | 77 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_IBSS); |
76 | } | 78 | } |
@@ -197,6 +199,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
197 | bss_change |= BSS_CHANGED_HT; | 199 | bss_change |= BSS_CHANGED_HT; |
198 | bss_change |= BSS_CHANGED_IBSS; | 200 | bss_change |= BSS_CHANGED_IBSS; |
199 | sdata->vif.bss_conf.ibss_joined = true; | 201 | sdata->vif.bss_conf.ibss_joined = true; |
202 | sdata->vif.bss_conf.ibss_creator = creator; | ||
200 | ieee80211_bss_info_change_notify(sdata, bss_change); | 203 | ieee80211_bss_info_change_notify(sdata, bss_change); |
201 | 204 | ||
202 | ieee80211_sta_def_wmm_params(sdata, sband->n_bitrates, supp_rates); | 205 | ieee80211_sta_def_wmm_params(sdata, sband->n_bitrates, supp_rates); |
@@ -249,7 +252,8 @@ static void ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
249 | cbss->channel, | 252 | cbss->channel, |
250 | basic_rates, | 253 | basic_rates, |
251 | cbss->capability, | 254 | cbss->capability, |
252 | cbss->tsf); | 255 | cbss->tsf, |
256 | false); | ||
253 | } | 257 | } |
254 | 258 | ||
255 | static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta, | 259 | static struct sta_info *ieee80211_ibss_finish_sta(struct sta_info *sta, |
@@ -734,7 +738,7 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata) | |||
734 | 738 | ||
735 | __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int, | 739 | __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int, |
736 | ifibss->channel, ifibss->basic_rates, | 740 | ifibss->channel, ifibss->basic_rates, |
737 | capability, 0); | 741 | capability, 0, true); |
738 | } | 742 | } |
739 | 743 | ||
740 | /* | 744 | /* |
@@ -1198,6 +1202,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata) | |||
1198 | lockdep_is_held(&sdata->u.ibss.mtx)); | 1202 | lockdep_is_held(&sdata->u.ibss.mtx)); |
1199 | RCU_INIT_POINTER(sdata->u.ibss.presp, NULL); | 1203 | RCU_INIT_POINTER(sdata->u.ibss.presp, NULL); |
1200 | sdata->vif.bss_conf.ibss_joined = false; | 1204 | sdata->vif.bss_conf.ibss_joined = false; |
1205 | sdata->vif.bss_conf.ibss_creator = false; | ||
1201 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | | 1206 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON_ENABLED | |
1202 | BSS_CHANGED_IBSS); | 1207 | BSS_CHANGED_IBSS); |
1203 | synchronize_rcu(); | 1208 | synchronize_rcu(); |