aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ibss.c
diff options
context:
space:
mode:
authorSimon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de>2013-05-16 07:00:36 -0400
committerJohannes Berg <johannes.berg@intel.com>2013-06-18 10:27:25 -0400
commit3aede78aad2a7e39a81b4b0caa771d40254a6787 (patch)
treee913c7366c817c188b5fd8b9979d985333bf3207 /net/mac80211/ibss.c
parent0418a445838749c51cf1e31a9c7ace6685ae87cd (diff)
mac80211: change IBSS channel state to chandef
This should make some parts cleaner and is also required for handling 5/10 MHz properly. Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/ibss.c')
-rw-r--r--net/mac80211/ibss.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
index 3789c85282a0..eaacfd27061c 100644
--- a/net/mac80211/ibss.c
+++ b/net/mac80211/ibss.c
@@ -81,7 +81,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
81 81
82 sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; 82 sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0;
83 83
84 cfg80211_chandef_create(&chandef, chan, ifibss->channel_type); 84 chandef = ifibss->chandef;
85 if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) { 85 if (!cfg80211_reg_can_beacon(local->hw.wiphy, &chandef)) {
86 chandef.width = NL80211_CHAN_WIDTH_20; 86 chandef.width = NL80211_CHAN_WIDTH_20;
87 chandef.center_freq1 = chan->center_freq; 87 chandef.center_freq1 = chan->center_freq;
@@ -516,7 +516,9 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
516 set_sta_flag(sta, WLAN_STA_WME); 516 set_sta_flag(sta, WLAN_STA_WME);
517 517
518 if (sta && elems->ht_operation && elems->ht_cap_elem && 518 if (sta && elems->ht_operation && elems->ht_cap_elem &&
519 sdata->u.ibss.channel_type != NL80211_CHAN_NO_HT) { 519 sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20_NOHT &&
520 sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_5 &&
521 sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_10) {
520 /* we both use HT */ 522 /* we both use HT */
521 struct ieee80211_ht_cap htcap_ie; 523 struct ieee80211_ht_cap htcap_ie;
522 struct cfg80211_chan_def chandef; 524 struct cfg80211_chan_def chandef;
@@ -531,8 +533,8 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
531 * fall back to HT20 if we don't use or use 533 * fall back to HT20 if we don't use or use
532 * the other extension channel 534 * the other extension channel
533 */ 535 */
534 if (cfg80211_get_chandef_type(&chandef) != 536 if (chandef.center_freq1 !=
535 sdata->u.ibss.channel_type) 537 sdata->u.ibss.chandef.center_freq1)
536 htcap_ie.cap_info &= 538 htcap_ie.cap_info &=
537 cpu_to_le16(~IEEE80211_HT_CAP_SUP_WIDTH_20_40); 539 cpu_to_le16(~IEEE80211_HT_CAP_SUP_WIDTH_20_40);
538 540
@@ -571,7 +573,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
571 573
572 /* different channel */ 574 /* different channel */
573 if (sdata->u.ibss.fixed_channel && 575 if (sdata->u.ibss.fixed_channel &&
574 sdata->u.ibss.channel != cbss->channel) 576 sdata->u.ibss.chandef.chan != cbss->channel)
575 goto put_bss; 577 goto put_bss;
576 578
577 /* different SSID */ 579 /* different SSID */
@@ -761,7 +763,7 @@ static void ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata)
761 sdata->drop_unencrypted = 0; 763 sdata->drop_unencrypted = 0;
762 764
763 __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int, 765 __ieee80211_sta_join_ibss(sdata, bssid, sdata->vif.bss_conf.beacon_int,
764 ifibss->channel, ifibss->basic_rates, 766 ifibss->chandef.chan, ifibss->basic_rates,
765 capability, 0, true); 767 capability, 0, true);
766} 768}
767 769
@@ -793,7 +795,7 @@ static void ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata)
793 if (ifibss->fixed_bssid) 795 if (ifibss->fixed_bssid)
794 bssid = ifibss->bssid; 796 bssid = ifibss->bssid;
795 if (ifibss->fixed_channel) 797 if (ifibss->fixed_channel)
796 chan = ifibss->channel; 798 chan = ifibss->chandef.chan;
797 if (!is_zero_ether_addr(ifibss->bssid)) 799 if (!is_zero_ether_addr(ifibss->bssid))
798 bssid = ifibss->bssid; 800 bssid = ifibss->bssid;
799 cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid, 801 cbss = cfg80211_get_bss(local->hw.wiphy, chan, bssid,
@@ -1060,9 +1062,7 @@ int ieee80211_ibss_join(struct ieee80211_sub_if_data *sdata,
1060 1062
1061 sdata->vif.bss_conf.beacon_int = params->beacon_interval; 1063 sdata->vif.bss_conf.beacon_int = params->beacon_interval;
1062 1064
1063 sdata->u.ibss.channel = params->chandef.chan; 1065 sdata->u.ibss.chandef = params->chandef;
1064 sdata->u.ibss.channel_type =
1065 cfg80211_get_chandef_type(&params->chandef);
1066 sdata->u.ibss.fixed_channel = params->channel_fixed; 1066 sdata->u.ibss.fixed_channel = params->channel_fixed;
1067 1067
1068 if (params->ie) { 1068 if (params->ie) {
@@ -1121,7 +1121,7 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1121 if (ifibss->privacy) 1121 if (ifibss->privacy)
1122 capability |= WLAN_CAPABILITY_PRIVACY; 1122 capability |= WLAN_CAPABILITY_PRIVACY;
1123 1123
1124 cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->channel, 1124 cbss = cfg80211_get_bss(local->hw.wiphy, ifibss->chandef.chan,
1125 ifibss->bssid, ifibss->ssid, 1125 ifibss->bssid, ifibss->ssid,
1126 ifibss->ssid_len, WLAN_CAPABILITY_IBSS | 1126 ifibss->ssid_len, WLAN_CAPABILITY_IBSS |
1127 WLAN_CAPABILITY_PRIVACY, 1127 WLAN_CAPABILITY_PRIVACY,