iwlwifi: move ht40 bitmap into config
authorJohannes Berg <johannes.berg@intel.com>
Mon, 21 May 2012 18:03:01 +0000 (20:03 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 6 Jun 2012 11:21:16 +0000 (13:21 +0200)
There's no need to dynamically fill the HT40
band bitmap as it's a device parameter, just
put it into the HT configuration.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/iwlwifi/dvm/dev.h
drivers/net/wireless/iwlwifi/dvm/devices.c
drivers/net/wireless/iwlwifi/dvm/main.c
drivers/net/wireless/iwlwifi/iwl-config.h
drivers/net/wireless/iwlwifi/pcie/1000.c
drivers/net/wireless/iwlwifi/pcie/2000.c
drivers/net/wireless/iwlwifi/pcie/5000.c
drivers/net/wireless/iwlwifi/pcie/6000.c

index 2880a0a3da68e9083e8220b2175e71678cd60bc8..af9de95429224af9c5c88cf48a66bb5778d65c4c 100644 (file)
@@ -635,7 +635,6 @@ enum iwl_scan_type {
  * @rx_chains_num: Number of RX chains
  * @valid_tx_ant: usable antennas for TX
  * @valid_rx_ant: usable antennas for RX
- * @ht40_channel: is 40MHz width possible: BIT(IEEE80211_BAND_XXX)
  * @sku: sku read from EEPROM
  * @ct_kill_threshold: temperature threshold - in hw dependent unit
  * @ct_kill_exit_threshold: when to reeable the device - in hw dependent unit
@@ -648,7 +647,6 @@ struct iwl_hw_params {
        u8  rx_chains_num;
        u8  valid_tx_ant;
        u8  valid_rx_ant;
-       u8  ht40_channel;
        bool use_rts_for_aggregation;
        u16 sku;
        u32 ct_kill_threshold;
index 7d3bb1e2d19610944a0f539ed903ba9a2c95d1b9..ddf053c5713dbde7c9a3a8b4f15ddd3deaf5e166 100644 (file)
@@ -171,8 +171,6 @@ static const struct iwl_sensitivity_ranges iwl1000_sensitivity = {
 
 static void iwl1000_hw_set_hw_params(struct iwl_priv *priv)
 {
-       priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ);
-
        iwl1000_set_ct_threshold(priv);
 
        /* Set initial sensitivity parameters */
@@ -244,8 +242,6 @@ static const struct iwl_sensitivity_ranges iwl2000_sensitivity = {
 
 static void iwl2000_hw_set_hw_params(struct iwl_priv *priv)
 {
-       priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ);
-
        iwl2000_set_ct_threshold(priv);
 
        /* Set initial sensitivity parameters */
@@ -389,9 +385,6 @@ static void iwl5000_set_ct_threshold(struct iwl_priv *priv)
 
 static void iwl5000_hw_set_hw_params(struct iwl_priv *priv)
 {
-       priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
-                                       BIT(IEEE80211_BAND_5GHZ);
-
        iwl5000_set_ct_threshold(priv);
 
        /* Set initial sensitivity parameters */
@@ -400,9 +393,6 @@ static void iwl5000_hw_set_hw_params(struct iwl_priv *priv)
 
 static void iwl5150_hw_set_hw_params(struct iwl_priv *priv)
 {
-       priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
-                                       BIT(IEEE80211_BAND_5GHZ);
-
        iwl5150_set_ct_threshold(priv);
 
        /* Set initial sensitivity parameters */
@@ -594,9 +584,6 @@ static const struct iwl_sensitivity_ranges iwl6000_sensitivity = {
 
 static void iwl6000_hw_set_hw_params(struct iwl_priv *priv)
 {
-       priv->hw_params.ht40_channel =  BIT(IEEE80211_BAND_2GHZ) |
-                                       BIT(IEEE80211_BAND_5GHZ);
-
        iwl6000_set_ct_threshold(priv);
 
        /* Set initial sensitivity parameters */
index d67ae99c00b9f99e487f5c379cf4428a8f90ca7f..441188725985c63c66be2ca3348cf14f2b2b340e 100644 (file)
@@ -1157,16 +1157,19 @@ static void iwl_init_ht_hw_capab(const struct iwl_priv *priv,
        u8 tx_chains_num = priv->hw_params.tx_chains_num;
 
        ht_info->cap = 0;
+       ht_info->ht_supported = false;
        memset(&ht_info->mcs, 0, sizeof(ht_info->mcs));
 
+       if (!priv->cfg->ht_params)
+               return;
+
        ht_info->ht_supported = true;
 
-       if (priv->cfg->ht_params &&
-           priv->cfg->ht_params->ht_greenfield_support)
+       if (priv->cfg->ht_params->ht_greenfield_support)
                ht_info->cap |= IEEE80211_HT_CAP_GRN_FLD;
        ht_info->cap |= IEEE80211_HT_CAP_SGI_20;
        max_bit_rate = MAX_BIT_RATE_20_MHZ;
-       if (priv->hw_params.ht40_channel & BIT(band)) {
+       if (priv->cfg->ht_params->ht40_bands & BIT(band)) {
                ht_info->cap |= IEEE80211_HT_CAP_SUP_WIDTH_20_40;
                ht_info->cap |= IEEE80211_HT_CAP_SGI_40;
                ht_info->mcs.rx_mask[4] = 0x01;
index a52818bbfe98c1c911ef2498f7a93d8f5a87b4e1..af3a46126f01e507b0c52736f94b547f489cc482 100644 (file)
@@ -182,13 +182,16 @@ struct iwl_bt_params {
        bool bt_sco_disable;
        bool bt_session_2;
 };
+
 /*
  * @use_rts_for_aggregation: use rts/cts protection for HT traffic
+ * @ht40_bands: bitmap of bands (using %IEEE80211_BAND_*) that support HT40
  */
 struct iwl_ht_params {
+       enum ieee80211_smps_mode smps_mode;
        const bool ht_greenfield_support; /* if used set to true */
        bool use_rts_for_aggregation;
-       enum ieee80211_smps_mode smps_mode;
+       u8 ht40_bands;
 };
 
 /**
index 0cfbf9fb74d5292fd3ba709fced192d5e12cc332..174cf5e38962b47e8f6dedcf5fead2300cbae692 100644 (file)
@@ -71,6 +71,7 @@ static const struct iwl_base_params iwl1000_base_params = {
 static const struct iwl_ht_params iwl1000_ht_params = {
        .ht_greenfield_support = true,
        .use_rts_for_aggregation = true, /* use rts/cts protection */
+       .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
 };
 
 #define IWL_DEVICE_1000                                                \
index 062c07b17056195048952d3424010adc2bbd7e45..8d4d7295aa462d29113ceaaa0c1b71b9306648fe 100644 (file)
@@ -104,6 +104,7 @@ static const struct iwl_base_params iwl2030_base_params = {
 static const struct iwl_ht_params iwl2000_ht_params = {
        .ht_greenfield_support = true,
        .use_rts_for_aggregation = true, /* use rts/cts protection */
+       .ht40_bands = BIT(IEEE80211_BAND_2GHZ),
 };
 
 static const struct iwl_bt_params iwl2030_bt_params = {
index 92e502e6e7e55fec7c2bac30bd357c931e98041e..75d90a9c184a1875a376b63f92219cd8f848267a 100644 (file)
@@ -69,6 +69,7 @@ static const struct iwl_base_params iwl5000_base_params = {
 
 static const struct iwl_ht_params iwl5000_ht_params = {
        .ht_greenfield_support = true,
+       .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
 };
 
 #define IWL_DEVICE_5000                                                \
index f9e396182ef38b4fe43c6a58542be13c5cee2b13..7b9c02cc67e535783a7572c8355039f3bf282d19 100644 (file)
@@ -124,6 +124,7 @@ static const struct iwl_base_params iwl6000_g2_base_params = {
 static const struct iwl_ht_params iwl6000_ht_params = {
        .ht_greenfield_support = true,
        .use_rts_for_aggregation = true, /* use rts/cts protection */
+       .ht40_bands = BIT(IEEE80211_BAND_2GHZ) | BIT(IEEE80211_BAND_5GHZ),
 };
 
 static const struct iwl_bt_params iwl6000_bt_params = {