diff options
author | Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> | 2012-03-13 19:15:09 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-04-12 17:19:39 -0400 |
commit | 5edc565d6081b115fa78eb6c0c4f77f646e95aaa (patch) | |
tree | 9eb7b7ba99efcf57321d9a611bf0487b525d2b49 /drivers/net/wireless | |
parent | a297d95d53882dce49097b9bbfac7cf8934e2227 (diff) |
iwlwifi: move iwl_is_ht40_tx_allowed out of iwl-core.c
This is really something determined by
station parameters, so move it to
iwl-agn-sta.c.
Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 44 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 44 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 3 |
4 files changed, 47 insertions, 47 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c index 79cbaab79ddd..42af9f94d7d9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-sta.c | |||
@@ -170,6 +170,50 @@ int iwl_send_add_sta(struct iwl_priv *priv, | |||
170 | return cmd.handler_status; | 170 | return cmd.handler_status; |
171 | } | 171 | } |
172 | 172 | ||
173 | static bool iwl_is_channel_extension(struct iwl_priv *priv, | ||
174 | enum ieee80211_band band, | ||
175 | u16 channel, u8 extension_chan_offset) | ||
176 | { | ||
177 | const struct iwl_channel_info *ch_info; | ||
178 | |||
179 | ch_info = iwl_get_channel_info(priv, band, channel); | ||
180 | if (!is_channel_valid(ch_info)) | ||
181 | return false; | ||
182 | |||
183 | if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_ABOVE) | ||
184 | return !(ch_info->ht40_extension_channel & | ||
185 | IEEE80211_CHAN_NO_HT40PLUS); | ||
186 | else if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_BELOW) | ||
187 | return !(ch_info->ht40_extension_channel & | ||
188 | IEEE80211_CHAN_NO_HT40MINUS); | ||
189 | |||
190 | return false; | ||
191 | } | ||
192 | |||
193 | bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv, | ||
194 | struct iwl_rxon_context *ctx, | ||
195 | struct ieee80211_sta_ht_cap *ht_cap) | ||
196 | { | ||
197 | if (!ctx->ht.enabled || !ctx->ht.is_40mhz) | ||
198 | return false; | ||
199 | |||
200 | /* | ||
201 | * We do not check for IEEE80211_HT_CAP_SUP_WIDTH_20_40 | ||
202 | * the bit will not set if it is pure 40MHz case | ||
203 | */ | ||
204 | if (ht_cap && !ht_cap->ht_supported) | ||
205 | return false; | ||
206 | |||
207 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
208 | if (priv->disable_ht40) | ||
209 | return false; | ||
210 | #endif | ||
211 | |||
212 | return iwl_is_channel_extension(priv, priv->band, | ||
213 | le16_to_cpu(ctx->staging.channel), | ||
214 | ctx->ht.extension_chan_offset); | ||
215 | } | ||
216 | |||
173 | static void iwl_sta_calc_ht_flags(struct iwl_priv *priv, | 217 | static void iwl_sta_calc_ht_flags(struct iwl_priv *priv, |
174 | struct ieee80211_sta *sta, | 218 | struct ieee80211_sta *sta, |
175 | struct iwl_rxon_context *ctx, | 219 | struct iwl_rxon_context *ctx, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index 3b66e30f3ee9..90b1f3a7ac37 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -261,6 +261,9 @@ int iwl_add_sta_callback(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb, | |||
261 | int iwl_sta_update_ht(struct iwl_priv *priv, struct iwl_rxon_context *ctx, | 261 | int iwl_sta_update_ht(struct iwl_priv *priv, struct iwl_rxon_context *ctx, |
262 | struct ieee80211_sta *sta); | 262 | struct ieee80211_sta *sta); |
263 | 263 | ||
264 | bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv, | ||
265 | struct iwl_rxon_context *ctx, | ||
266 | struct ieee80211_sta_ht_cap *ht_cap); | ||
264 | 267 | ||
265 | static inline int iwl_sta_id(struct ieee80211_sta *sta) | 268 | static inline int iwl_sta_id(struct ieee80211_sta *sta) |
266 | { | 269 | { |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index e1129dccb33a..42b5f90acd0a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -43,50 +43,6 @@ | |||
43 | 43 | ||
44 | const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; | 44 | const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; |
45 | 45 | ||
46 | static bool iwl_is_channel_extension(struct iwl_priv *priv, | ||
47 | enum ieee80211_band band, | ||
48 | u16 channel, u8 extension_chan_offset) | ||
49 | { | ||
50 | const struct iwl_channel_info *ch_info; | ||
51 | |||
52 | ch_info = iwl_get_channel_info(priv, band, channel); | ||
53 | if (!is_channel_valid(ch_info)) | ||
54 | return false; | ||
55 | |||
56 | if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_ABOVE) | ||
57 | return !(ch_info->ht40_extension_channel & | ||
58 | IEEE80211_CHAN_NO_HT40PLUS); | ||
59 | else if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_BELOW) | ||
60 | return !(ch_info->ht40_extension_channel & | ||
61 | IEEE80211_CHAN_NO_HT40MINUS); | ||
62 | |||
63 | return false; | ||
64 | } | ||
65 | |||
66 | bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv, | ||
67 | struct iwl_rxon_context *ctx, | ||
68 | struct ieee80211_sta_ht_cap *ht_cap) | ||
69 | { | ||
70 | if (!ctx->ht.enabled || !ctx->ht.is_40mhz) | ||
71 | return false; | ||
72 | |||
73 | /* | ||
74 | * We do not check for IEEE80211_HT_CAP_SUP_WIDTH_20_40 | ||
75 | * the bit will not set if it is pure 40MHz case | ||
76 | */ | ||
77 | if (ht_cap && !ht_cap->ht_supported) | ||
78 | return false; | ||
79 | |||
80 | #ifdef CONFIG_IWLWIFI_DEBUGFS | ||
81 | if (priv->disable_ht40) | ||
82 | return false; | ||
83 | #endif | ||
84 | |||
85 | return iwl_is_channel_extension(priv, priv->band, | ||
86 | le16_to_cpu(ctx->staging.channel), | ||
87 | ctx->ht.extension_chan_offset); | ||
88 | } | ||
89 | |||
90 | static void _iwl_set_rxon_ht(struct iwl_priv *priv, | 46 | static void _iwl_set_rxon_ht(struct iwl_priv *priv, |
91 | struct iwl_ht_config *ht_conf, | 47 | struct iwl_ht_config *ht_conf, |
92 | struct iwl_rxon_context *ctx) | 48 | struct iwl_rxon_context *ctx) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 5cbe609de84c..eb0e78587a51 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -85,9 +85,6 @@ void iwl_set_flags_for_band(struct iwl_priv *priv, | |||
85 | enum ieee80211_band band, | 85 | enum ieee80211_band band, |
86 | struct ieee80211_vif *vif); | 86 | struct ieee80211_vif *vif); |
87 | void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf); | 87 | void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf); |
88 | bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv, | ||
89 | struct iwl_rxon_context *ctx, | ||
90 | struct ieee80211_sta_ht_cap *ht_cap); | ||
91 | void iwl_connection_init_rx_config(struct iwl_priv *priv, | 88 | void iwl_connection_init_rx_config(struct iwl_priv *priv, |
92 | struct iwl_rxon_context *ctx); | 89 | struct iwl_rxon_context *ctx); |
93 | void iwl_set_rate(struct iwl_priv *priv); | 90 | void iwl_set_rate(struct iwl_priv *priv); |