iwlwifi: move iwl_is_ht40_tx_allowed out of iwl-core.c
authorMeenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Tue, 13 Mar 2012 23:15:09 +0000 (16:15 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Thu, 12 Apr 2012 21:19:39 +0000 (14:19 -0700)
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>
drivers/net/wireless/iwlwifi/iwl-agn-sta.c
drivers/net/wireless/iwlwifi/iwl-agn.h
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-core.h

index 79cbaab79dddb010a673053ab6ca1f2967ba4a8a..42af9f94d7d98aba646e69cafc06c69317635b51 100644 (file)
@@ -170,6 +170,50 @@ int iwl_send_add_sta(struct iwl_priv *priv,
        return cmd.handler_status;
 }
 
+static bool iwl_is_channel_extension(struct iwl_priv *priv,
+                                    enum ieee80211_band band,
+                                    u16 channel, u8 extension_chan_offset)
+{
+       const struct iwl_channel_info *ch_info;
+
+       ch_info = iwl_get_channel_info(priv, band, channel);
+       if (!is_channel_valid(ch_info))
+               return false;
+
+       if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_ABOVE)
+               return !(ch_info->ht40_extension_channel &
+                                       IEEE80211_CHAN_NO_HT40PLUS);
+       else if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_BELOW)
+               return !(ch_info->ht40_extension_channel &
+                                       IEEE80211_CHAN_NO_HT40MINUS);
+
+       return false;
+}
+
+bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
+                           struct iwl_rxon_context *ctx,
+                           struct ieee80211_sta_ht_cap *ht_cap)
+{
+       if (!ctx->ht.enabled || !ctx->ht.is_40mhz)
+               return false;
+
+       /*
+        * We do not check for IEEE80211_HT_CAP_SUP_WIDTH_20_40
+        * the bit will not set if it is pure 40MHz case
+        */
+       if (ht_cap && !ht_cap->ht_supported)
+               return false;
+
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+       if (priv->disable_ht40)
+               return false;
+#endif
+
+       return iwl_is_channel_extension(priv, priv->band,
+                       le16_to_cpu(ctx->staging.channel),
+                       ctx->ht.extension_chan_offset);
+}
+
 static void iwl_sta_calc_ht_flags(struct iwl_priv *priv,
                                  struct ieee80211_sta *sta,
                                  struct iwl_rxon_context *ctx,
index 3b66e30f3ee971d3ae7cb69a27733346f1ab3916..90b1f3a7ac372896d00789fa5df8d77e4fdb1f5e 100644 (file)
@@ -261,6 +261,9 @@ int iwl_add_sta_callback(struct iwl_priv *priv, struct iwl_rx_cmd_buffer *rxb,
 int iwl_sta_update_ht(struct iwl_priv *priv, struct iwl_rxon_context *ctx,
                      struct ieee80211_sta *sta);
 
+bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
+                           struct iwl_rxon_context *ctx,
+                           struct ieee80211_sta_ht_cap *ht_cap);
 
 static inline int iwl_sta_id(struct ieee80211_sta *sta)
 {
index e1129dccb33aa19ceaf3c4034aa5a3121ef1b528..42b5f90acd0a9e0ae92e4164293a217bbceb1a6e 100644 (file)
 
 const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
 
-static bool iwl_is_channel_extension(struct iwl_priv *priv,
-                                    enum ieee80211_band band,
-                                    u16 channel, u8 extension_chan_offset)
-{
-       const struct iwl_channel_info *ch_info;
-
-       ch_info = iwl_get_channel_info(priv, band, channel);
-       if (!is_channel_valid(ch_info))
-               return false;
-
-       if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_ABOVE)
-               return !(ch_info->ht40_extension_channel &
-                                       IEEE80211_CHAN_NO_HT40PLUS);
-       else if (extension_chan_offset == IEEE80211_HT_PARAM_CHA_SEC_BELOW)
-               return !(ch_info->ht40_extension_channel &
-                                       IEEE80211_CHAN_NO_HT40MINUS);
-
-       return false;
-}
-
-bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
-                           struct iwl_rxon_context *ctx,
-                           struct ieee80211_sta_ht_cap *ht_cap)
-{
-       if (!ctx->ht.enabled || !ctx->ht.is_40mhz)
-               return false;
-
-       /*
-        * We do not check for IEEE80211_HT_CAP_SUP_WIDTH_20_40
-        * the bit will not set if it is pure 40MHz case
-        */
-       if (ht_cap && !ht_cap->ht_supported)
-               return false;
-
-#ifdef CONFIG_IWLWIFI_DEBUGFS
-       if (priv->disable_ht40)
-               return false;
-#endif
-
-       return iwl_is_channel_extension(priv, priv->band,
-                       le16_to_cpu(ctx->staging.channel),
-                       ctx->ht.extension_chan_offset);
-}
-
 static void _iwl_set_rxon_ht(struct iwl_priv *priv,
                             struct iwl_ht_config *ht_conf,
                             struct iwl_rxon_context *ctx)
index 5cbe609de84c6f79fa19c58ffbb816223f307215..eb0e78587a51b0a3c82fdc6d1e22120fe1875101 100644 (file)
@@ -85,9 +85,6 @@ void iwl_set_flags_for_band(struct iwl_priv *priv,
                            enum ieee80211_band band,
                            struct ieee80211_vif *vif);
 void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf);
-bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
-                           struct iwl_rxon_context *ctx,
-                           struct ieee80211_sta_ht_cap *ht_cap);
 void iwl_connection_init_rx_config(struct iwl_priv *priv,
                                   struct iwl_rxon_context *ctx);
 void iwl_set_rate(struct iwl_priv *priv);