iwlwifi: clean up ht config a little
authorJohannes Berg <johannes@sipsolutions.net>
Fri, 11 Sep 2009 17:38:13 +0000 (10:38 -0700)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 7 Oct 2009 20:39:32 +0000 (16:39 -0400)
is_ht can be bool instead of u8, and there's
no need to use IWL_CHANNEL_WIDTH_* constants
in supported_chan_width when that could just
be named is_40mhz instead.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-dev.h

index 484d5c1a7312053121ac09ac75d39b435492701a..c09475105c5245ed86b9bbb28e6fb7dffaaf897f 100644 (file)
@@ -636,8 +636,7 @@ u8 iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
 {
        struct iwl_ht_info *iwl_ht_conf = &priv->current_ht_config;
 
-       if ((!iwl_ht_conf->is_ht) ||
-           (iwl_ht_conf->supported_chan_width != IWL_CHANNEL_WIDTH_40MHZ))
+       if (!iwl_ht_conf->is_ht || !iwl_ht_conf->is_40mhz)
                return 0;
 
        /* We do not check for IEEE80211_HT_CAP_SUP_WIDTH_20_40
@@ -2619,21 +2618,18 @@ int iwl_mac_config(struct ieee80211_hw *hw, u32 changed)
                        if (conf_is_ht40_minus(conf)) {
                                ht_conf->extension_chan_offset =
                                        IEEE80211_HT_PARAM_CHA_SEC_BELOW;
-                               ht_conf->supported_chan_width =
-                                       IWL_CHANNEL_WIDTH_40MHZ;
+                               ht_conf->is_40mhz = true;
                        } else if (conf_is_ht40_plus(conf)) {
                                ht_conf->extension_chan_offset =
                                        IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
-                               ht_conf->supported_chan_width =
-                                       IWL_CHANNEL_WIDTH_40MHZ;
+                               ht_conf->is_40mhz = true;
                        } else {
                                ht_conf->extension_chan_offset =
                                        IEEE80211_HT_PARAM_CHA_SEC_NONE;
-                               ht_conf->supported_chan_width =
-                                       IWL_CHANNEL_WIDTH_20MHZ;
+                               ht_conf->is_40mhz = false;
                        }
                } else
-                       ht_conf->supported_chan_width = IWL_CHANNEL_WIDTH_20MHZ;
+                       ht_conf->is_40mhz = false;
                /* Default to no protection. Protection mode will later be set
                 * from BSS config in iwl_ht_conf */
                ht_conf->ht_protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
index 028d50599550127f0effe21beacd5442fed0a0af..961d534400346399fb899474195fda67b6244a4a 100644 (file)
@@ -504,8 +504,8 @@ union iwl_ht_rate_supp {
 
 struct iwl_ht_info {
        /* self configuration data */
-       u8 is_ht;
-       u8 supported_chan_width;
+       bool is_ht;
+       bool is_40mhz;
        u8 sm_ps;
        struct ieee80211_mcs_info mcs;
        /* BSS related data */
@@ -726,9 +726,6 @@ struct iwl_dma_ptr {
        size_t size;
 };
 
-#define IWL_CHANNEL_WIDTH_20MHZ   0
-#define IWL_CHANNEL_WIDTH_40MHZ   1
-
 #define IWL_OPERATION_MODE_AUTO     0
 #define IWL_OPERATION_MODE_HT_ONLY  1
 #define IWL_OPERATION_MODE_MIXED    2