linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 14/29] iwlwifi: move ht40 bitmap into config
Date: Wed,  6 Jun 2012 15:21:55 +0200	[thread overview]
Message-ID: <1338988930-11561-14-git-send-email-johannes@sipsolutions.net> (raw)
In-Reply-To: <1338988930-11561-1-git-send-email-johannes@sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

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     |    2 --
 drivers/net/wireless/iwlwifi/dvm/devices.c |   13 -------------
 drivers/net/wireless/iwlwifi/dvm/main.c    |    9 ++++++---
 drivers/net/wireless/iwlwifi/iwl-config.h  |    5 ++++-
 drivers/net/wireless/iwlwifi/pcie/1000.c   |    1 +
 drivers/net/wireless/iwlwifi/pcie/2000.c   |    1 +
 drivers/net/wireless/iwlwifi/pcie/5000.c   |    1 +
 drivers/net/wireless/iwlwifi/pcie/6000.c   |    1 +
 8 files changed, 14 insertions(+), 19 deletions(-)

diff --git a/drivers/net/wireless/iwlwifi/dvm/dev.h b/drivers/net/wireless/iwlwifi/dvm/dev.h
index 2880a0a..af9de95 100644
--- a/drivers/net/wireless/iwlwifi/dvm/dev.h
+++ b/drivers/net/wireless/iwlwifi/dvm/dev.h
@@ -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;
diff --git a/drivers/net/wireless/iwlwifi/dvm/devices.c b/drivers/net/wireless/iwlwifi/dvm/devices.c
index 7d3bb1e..ddf053c 100644
--- a/drivers/net/wireless/iwlwifi/dvm/devices.c
+++ b/drivers/net/wireless/iwlwifi/dvm/devices.c
@@ -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 */
diff --git a/drivers/net/wireless/iwlwifi/dvm/main.c b/drivers/net/wireless/iwlwifi/dvm/main.c
index d67ae99..4411887 100644
--- a/drivers/net/wireless/iwlwifi/dvm/main.c
+++ b/drivers/net/wireless/iwlwifi/dvm/main.c
@@ -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;
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h
index a52818b..af3a461 100644
--- a/drivers/net/wireless/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/iwlwifi/iwl-config.h
@@ -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;
 };
 
 /**
diff --git a/drivers/net/wireless/iwlwifi/pcie/1000.c b/drivers/net/wireless/iwlwifi/pcie/1000.c
index 0cfbf9f..174cf5e 100644
--- a/drivers/net/wireless/iwlwifi/pcie/1000.c
+++ b/drivers/net/wireless/iwlwifi/pcie/1000.c
@@ -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						\
diff --git a/drivers/net/wireless/iwlwifi/pcie/2000.c b/drivers/net/wireless/iwlwifi/pcie/2000.c
index 062c07b..8d4d729 100644
--- a/drivers/net/wireless/iwlwifi/pcie/2000.c
+++ b/drivers/net/wireless/iwlwifi/pcie/2000.c
@@ -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 = {
diff --git a/drivers/net/wireless/iwlwifi/pcie/5000.c b/drivers/net/wireless/iwlwifi/pcie/5000.c
index 92e502e..75d90a9 100644
--- a/drivers/net/wireless/iwlwifi/pcie/5000.c
+++ b/drivers/net/wireless/iwlwifi/pcie/5000.c
@@ -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						\
diff --git a/drivers/net/wireless/iwlwifi/pcie/6000.c b/drivers/net/wireless/iwlwifi/pcie/6000.c
index f9e3961..7b9c02c 100644
--- a/drivers/net/wireless/iwlwifi/pcie/6000.c
+++ b/drivers/net/wireless/iwlwifi/pcie/6000.c
@@ -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 = {
-- 
1.7.10


  parent reply	other threads:[~2012-06-06 13:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-06 13:21 [PATCH 01/29] iwlwifi: Check BSS ctx active before call mac80211 Johannes Berg
2012-06-06 13:21 ` [PATCH 02/29] iwlwifi: handle race condition in ROC flow Johannes Berg
2012-06-06 13:21 ` [PATCH 03/29] iwlwifi: make a lot of functions static Johannes Berg
2012-06-06 13:21 ` [PATCH 04/29] iwlwifi: use mac80211 channel in connection init Johannes Berg
2012-06-06 13:21 ` [PATCH 05/29] iwlwifi: trust mac80211 channel setting Johannes Berg
2012-06-06 13:21 ` [PATCH 06/29] iwlwifi: use mac80211 channels for reset scan Johannes Berg
2012-06-06 13:21 ` [PATCH 07/29] iwlwifi: use mac80211 channel for radar check Johannes Berg
2012-06-06 13:21 ` [PATCH 08/29] iwlwifi: give HT format to mac80211/radiotap Johannes Berg
2012-06-06 13:21 ` [PATCH 09/29] iwlwifi: clear STATUS_SCAN_HW when PAN_PARAMS fails Johannes Berg
2012-06-06 13:21 ` [PATCH 10/29] iwlwifi: move PCIe into subdirectory Johannes Berg
2012-06-06 13:21 ` [PATCH 11/29] iwlwifi: trust mac80211 HT40 setting Johannes Berg
2012-06-06 13:21 ` [PATCH 12/29] iwlwifi: move DVM code into subdirectory Johannes Berg
2012-06-06 13:21 ` [PATCH 13/29] iwlwifi: unify tx_chains_num setting Johannes Berg
2012-06-06 13:21 ` Johannes Berg [this message]
2012-06-06 13:21 ` [PATCH 15/29] iwlwifi: SCD_INT_MSK is obsolete - don't update it Johannes Berg
2012-06-06 13:21 ` [PATCH 16/29] iwlwifi: first config the SCD queues, then activate them Johannes Berg
2012-06-06 13:21 ` [PATCH 17/29] iwlwifi: use iwl_trans_set_wr_ptrs to init the queues Johannes Berg
2012-06-06 13:21 ` [PATCH 18/29] iwlwifi: s/txq_agg_disable/txq_disable Johannes Berg
2012-06-06 13:22 ` [PATCH 19/29] iwlwifi: s/txq_setup/txq_enable Johannes Berg
2012-06-06 13:22 ` [PATCH 20/29] iwlwifi: update mask value for SCD queue config Johannes Berg
2012-06-06 13:22 ` [PATCH 21/29] iwlwifi: allocate Tx cmd pool per device Johannes Berg
2012-06-06 13:22 ` [PATCH 22/29] iwlwifi: add iwl_set_bits_mask Johannes Berg
2012-06-06 13:22 ` [PATCH 23/29] iwlwifi: fix rf configuration Johannes Berg
2012-06-06 13:22 ` [PATCH 24/29] iwlwifi: configure the SKU in the HW Johannes Berg
2012-06-06 13:22 ` [PATCH 25/29] iwlwifi: refactor EEPROM reading/parsing Johannes Berg
2012-06-06 13:22 ` [PATCH 26/29] iwlwifi: fix typo 'IWL_WATCHHDOG_DISABLED' Johannes Berg
2012-06-06 13:22 ` [PATCH 27/29] iwlwifi: configure PHY version for 1000 series Johannes Berg
2012-06-06 13:22 ` [PATCH 28/29] iwlwifi: move RF config into NIC config Johannes Berg
2012-06-06 13:22 ` [PATCH 29/29] iwlwifi: remove extern opmode ops declarations Johannes Berg
2012-06-06 13:27 ` [PATCH 00/29] iwlwifi updates for 3.6 Johannes Berg
2012-06-06 13:28   ` Johannes Berg
2012-06-06 13:36   ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1338988930-11561-14-git-send-email-johannes@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=johannes.berg@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).