aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-05-08 14:47:39 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-11 15:23:57 -0400
commit9ed6bcce77f75d98af6ee07069deac6041948bee (patch)
tree9fff3d257612ed049b28a80681fbd987f4de3ec4
parent5a9940118a616266183c53a9ee4352feadb9c2e8 (diff)
mac80211: move HT operation mode BSS info
There really is no need to have a separate struct for a single variable. The fact that it exists is due to the code legacy, but we can remove that now. Very simple. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c4
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c2
-rw-r--r--drivers/net/wireless/mwl8k.c2
-rw-r--r--include/net/mac80211.h12
-rw-r--r--net/mac80211/mlme.c11
5 files changed, 11 insertions, 20 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 77f4b43b9b74..a9a4fcef7e42 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2225,9 +2225,9 @@ static void iwl_ht_conf(struct iwl_priv *priv,
2225 2225
2226 iwl_conf->tx_chan_width = iwl_conf->supported_chan_width != 0; 2226 iwl_conf->tx_chan_width = iwl_conf->supported_chan_width != 0;
2227 iwl_conf->ht_protection = 2227 iwl_conf->ht_protection =
2228 bss_conf->ht.operation_mode & IEEE80211_HT_OP_MODE_PROTECTION; 2228 bss_conf->ht_operation_mode & IEEE80211_HT_OP_MODE_PROTECTION;
2229 iwl_conf->non_GF_STA_present = 2229 iwl_conf->non_GF_STA_present =
2230 !!(bss_conf->ht.operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); 2230 !!(bss_conf->ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
2231 2231
2232 rcu_read_unlock(); 2232 rcu_read_unlock();
2233 2233
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index b1213b6a6b9f..61a4ad7cc1c2 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -642,7 +642,7 @@ static void mac80211_hwsim_bss_info_changed(struct ieee80211_hw *hw,
642 if (changed & BSS_CHANGED_HT) { 642 if (changed & BSS_CHANGED_HT) {
643 printk(KERN_DEBUG " %s: HT: op_mode=0x%x\n", 643 printk(KERN_DEBUG " %s: HT: op_mode=0x%x\n",
644 wiphy_name(hw->wiphy), 644 wiphy_name(hw->wiphy),
645 info->ht.operation_mode); 645 info->ht_operation_mode);
646 } 646 }
647 647
648 if (changed & BSS_CHANGED_BASIC_RATES) { 648 if (changed & BSS_CHANGED_BASIC_RATES) {
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 46b288dc8f4d..a263d5c84c08 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -2369,7 +2369,7 @@ static int mwl8k_cmd_set_aid(struct ieee80211_hw *hw,
2369 if (info->use_cts_prot) { 2369 if (info->use_cts_prot) {
2370 prot_mode = MWL8K_FRAME_PROT_11G; 2370 prot_mode = MWL8K_FRAME_PROT_11G;
2371 } else { 2371 } else {
2372 switch (info->ht.operation_mode & 2372 switch (info->ht_operation_mode &
2373 IEEE80211_HT_OP_MODE_PROTECTION) { 2373 IEEE80211_HT_OP_MODE_PROTECTION) {
2374 case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ: 2374 case IEEE80211_HT_OP_MODE_PROTECTION_20MHZ:
2375 prot_mode = MWL8K_FRAME_PROT_11N_HT_40MHZ_ONLY; 2375 prot_mode = MWL8K_FRAME_PROT_11N_HT_40MHZ_ONLY;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 38dc1cd10270..03591fcf519c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -171,14 +171,6 @@ enum ieee80211_bss_change {
171}; 171};
172 172
173/** 173/**
174 * struct ieee80211_bss_ht_conf - BSS's changing HT configuration
175 * @operation_mode: HT operation mode (like in &struct ieee80211_ht_info)
176 */
177struct ieee80211_bss_ht_conf {
178 u16 operation_mode;
179};
180
181/**
182 * struct ieee80211_bss_conf - holds the BSS's changing parameters 174 * struct ieee80211_bss_conf - holds the BSS's changing parameters
183 * 175 *
184 * This structure keeps information about a BSS (and an association 176 * This structure keeps information about a BSS (and an association
@@ -203,6 +195,8 @@ struct ieee80211_bss_ht_conf {
203 * the current band. 195 * the current band.
204 * @bssid: The BSSID for this BSS 196 * @bssid: The BSSID for this BSS
205 * @enable_beacon: whether beaconing should be enabled or not 197 * @enable_beacon: whether beaconing should be enabled or not
198 * @ht_operation_mode: HT operation mode (like in &struct ieee80211_ht_info).
199 * This field is only valid when the channel type is one of the HT types.
206 */ 200 */
207struct ieee80211_bss_conf { 201struct ieee80211_bss_conf {
208 const u8 *bssid; 202 const u8 *bssid;
@@ -219,7 +213,7 @@ struct ieee80211_bss_conf {
219 u16 assoc_capability; 213 u16 assoc_capability;
220 u64 timestamp; 214 u64 timestamp;
221 u32 basic_rates; 215 u32 basic_rates;
222 struct ieee80211_bss_ht_conf ht; 216 u16 ht_operation_mode;
223}; 217};
224 218
225/** 219/**
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index c5445bae9d6c..a1f2332a6fed 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -95,16 +95,14 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
95 struct ieee80211_local *local = sdata->local; 95 struct ieee80211_local *local = sdata->local;
96 struct ieee80211_supported_band *sband; 96 struct ieee80211_supported_band *sband;
97 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 97 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
98 struct ieee80211_bss_ht_conf ht;
99 struct sta_info *sta; 98 struct sta_info *sta;
100 u32 changed = 0; 99 u32 changed = 0;
100 u16 ht_opmode;
101 bool enable_ht = true, ht_changed; 101 bool enable_ht = true, ht_changed;
102 enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT; 102 enum nl80211_channel_type channel_type = NL80211_CHAN_NO_HT;
103 103
104 sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; 104 sband = local->hw.wiphy->bands[local->hw.conf.channel->band];
105 105
106 memset(&ht, 0, sizeof(ht));
107
108 /* HT is not supported */ 106 /* HT is not supported */
109 if (!sband->ht_cap.ht_supported) 107 if (!sband->ht_cap.ht_supported)
110 enable_ht = false; 108 enable_ht = false;
@@ -148,19 +146,18 @@ static u32 ieee80211_enable_ht(struct ieee80211_sub_if_data *sdata,
148 IEEE80211_RC_HT_CHANGED); 146 IEEE80211_RC_HT_CHANGED);
149 147
150 rcu_read_unlock(); 148 rcu_read_unlock();
151
152 } 149 }
153 150
154 /* disable HT */ 151 /* disable HT */
155 if (!enable_ht) 152 if (!enable_ht)
156 return 0; 153 return 0;
157 154
158 ht.operation_mode = le16_to_cpu(hti->operation_mode); 155 ht_opmode = le16_to_cpu(hti->operation_mode);
159 156
160 /* if bss configuration changed store the new one */ 157 /* if bss configuration changed store the new one */
161 if (memcmp(&sdata->vif.bss_conf.ht, &ht, sizeof(ht))) { 158 if (sdata->vif.bss_conf.ht_operation_mode != ht_opmode) {
162 changed |= BSS_CHANGED_HT; 159 changed |= BSS_CHANGED_HT;
163 sdata->vif.bss_conf.ht = ht; 160 sdata->vif.bss_conf.ht_operation_mode = ht_opmode;
164 } 161 }
165 162
166 return changed; 163 return changed;