linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
	Tomas Winkler <tomas.winkler@intel.com>,
	Gregory Greenman <gregory.greenman@intel.com>,
	Zhu Yi <yi.zhu@intel.com>
Subject: [PATCH 15/28] iwlwifi: Endianity fix for rxon host commands
Date: Wed,  8 Aug 2007 15:33:32 +0800	[thread overview]
Message-ID: <11865584603865-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <11865584583336-git-send-email-yi.zhu@intel.com>

From: Tomas Winkler <tomas.winkler@intel.com>

This patch fixes left over endianity issues in rxon host command.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
 drivers/net/wireless/iwl-4965-hw.h |   21 +++++++++++----------
 drivers/net/wireless/iwl-4965.c    |   10 ++++++----
 2 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/net/wireless/iwl-4965-hw.h b/drivers/net/wireless/iwl-4965-hw.h
index 106f7c0..bb814cf 100644
--- a/drivers/net/wireless/iwl-4965-hw.h
+++ b/drivers/net/wireless/iwl-4965-hw.h
@@ -229,20 +229,21 @@ struct iwl_channel_switch_notif {
 /********************* END TXPOWER *****************************************/
 
 /* HT flags */
-#define RXON_FLG_CONTROL_CHANNEL_LOCATION_MSK	0x400000
-#define RXON_FLG_CONTROL_CHANNEL_LOC_LOW_MSK	0x000000
-#define RXON_FLG_CONTROL_CHANNEL_LOC_HIGH_MSK	0x400000
+#define RXON_FLG_CONTROL_CHANNEL_LOCATION_POS	(22)
+#define RXON_FLG_CONTROL_CHANNEL_LOCATION_MSK	__constant_cpu_to_le32(0x1<<22)
+#define RXON_FLG_CONTROL_CHANNEL_LOC_LOW_MSK	__constant_cpu_to_le32(0x0<<22)
+#define RXON_FLG_CONTROL_CHANNEL_LOC_HIGH_MSK	__constant_cpu_to_le32(0x1<<22)
 
 #define RXON_FLG_HT_OPERATING_MODE_POS		(23)
-/*yshevet - bug fix */
-#define RXON_FLG_HT_PROT_MSK			0x800000
-#define RXON_FLG_FAT_PROT_MSK			0x1000000
+
+#define RXON_FLG_HT_PROT_MSK			__constant_cpu_to_le32(0x1<<23)
+#define RXON_FLG_FAT_PROT_MSK			__constant_cpu_to_le32(0x2<<23)
 
 #define RXON_FLG_CHANNEL_MODE_POS		(25)
-#define RXON_FLG_CHANNEL_MODE_MSK		0x06000000
-#define RXON_FLG_CHANNEL_MODE_LEGACY_MSK	0x00000000
-#define RXON_FLG_CHANNEL_MODE_PURE_40_MSK	0x02000000
-#define RXON_FLG_CHANNEL_MODE_MIXED_MSK		0x04000000
+#define RXON_FLG_CHANNEL_MODE_MSK		__constant_cpu_to_le32(0x3<<25)
+#define RXON_FLG_CHANNEL_MODE_LEGACY_MSK	__constant_cpu_to_le32(0x0<<25)
+#define RXON_FLG_CHANNEL_MODE_PURE_40_MSK	__constant_cpu_to_le32(0x1<<25)
+#define RXON_FLG_CHANNEL_MODE_MIXED_MSK		__constant_cpu_to_le32(0x2<<25)
 
 #define RXON_RX_CHAIN_DRIVER_FORCE_MSK		__constant_cpu_to_le16(0x1<<0)
 #define RXON_RX_CHAIN_VALID_MSK			__constant_cpu_to_le16(0x7<<1)
diff --git a/drivers/net/wireless/iwl-4965.c b/drivers/net/wireless/iwl-4965.c
index 0cbe798..5999be5 100644
--- a/drivers/net/wireless/iwl-4965.c
+++ b/drivers/net/wireless/iwl-4965.c
@@ -79,7 +79,7 @@ const struct iwl_rate_info iwl_rates[IWL_RATE_COUNT] = {
 	IWL_DECLARE_RATE_INFO(60, 60, 48, INV, 48, INV, 48, INV),/* 60mbps */
 };
 
-static int is_fat_channel(u32 rxon_flags)
+static int is_fat_channel(__le32 rxon_flags)
 {
 	return (rxon_flags & RXON_FLG_CHANNEL_MODE_PURE_40_MSK) ||
 		(rxon_flags & RXON_FLG_CHANNEL_MODE_MIXED_MSK);
@@ -2859,12 +2859,14 @@ void iwl4965_set_rxon_chain(struct iwl_priv *priv)
 	 * Just after first association, iwl4965_noise_calibration()
 	 *    checks which antennas actually *are* connected. */
 	priv->staging_rxon.rx_chain |=
-	    (priv->valid_antenna << RXON_RX_CHAIN_VALID_POS);
+	    cpu_to_le16(priv->valid_antenna << RXON_RX_CHAIN_VALID_POS);
 
 	/* How many receivers should we use? */
 	iwl4965_get_rx_chain_counter(priv, &idle_state, &rx_state);
-	priv->staging_rxon.rx_chain |= (rx_state << RXON_RX_CHAIN_MIMO_CNT_POS);
-	priv->staging_rxon.rx_chain |= (idle_state << RXON_RX_CHAIN_CNT_POS);
+	priv->staging_rxon.rx_chain |=
+		cpu_to_le16(rx_state << RXON_RX_CHAIN_MIMO_CNT_POS);
+	priv->staging_rxon.rx_chain |=
+		cpu_to_le16(idle_state << RXON_RX_CHAIN_CNT_POS);
 
 	if (!is_single && !(priv->status & STATUS_POWER_PMI) && (rx_state >= 2))
 		priv->staging_rxon.rx_chain |= RXON_RX_CHAIN_MIMO_FORCE_MSK;
-- 
1.5.2

  reply	other threads:[~2007-08-08  7:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <11865584251026-git-send-email-yi.zhu@intel.com>
2007-08-08  7:33 ` [PATCH 01/28] iwlwifi: fix a lot of checkpatch.pl warnings Zhu Yi
2007-08-08  7:33   ` [PATCH 02/28] iwlwifi: add more Kconfig options Zhu Yi
2007-08-08  7:33     ` [PATCH 03/28] iwlwifi: Endianity fix for 4965 rate scaling Zhu Yi
2007-08-08  7:33       ` [PATCH 04/28] iwlwifi: Endianity fix for 4965 rx chain selection Zhu Yi
2007-08-08  7:33         ` [PATCH 05/28] iwlwifi: optimize iwl_queue_{inc|dec}_wrap implementation Zhu Yi
2007-08-08  7:33           ` [PATCH 06/28] iwlwifi: use mask operation to replace '%' for index calculation Zhu Yi
2007-08-08  7:33             ` [PATCH 07/28] iwlwifi: make local functions static Zhu Yi
2007-08-08  7:33               ` [PATCH 08/28] iwlwifi: some coding styles cleanup Zhu Yi
2007-08-08  7:33                 ` [PATCH 09/28] iwlwifi: replace unnecessary GFP_ATOMIC with GFP_KERNEL Zhu Yi
2007-08-08  7:33                   ` [PATCH 10/28] iwlwifi: remove priv stuff zeroing in iwl_pci_probe Zhu Yi
2007-08-08  7:33                     ` [PATCH 11/28] iwlwifi: add name for some PCI configuration space registers Zhu Yi
2007-08-08  7:33                       ` [PATCH 12/28] iwlwifi: shorten some structure and function names Zhu Yi
2007-08-08  7:33                         ` [PATCH 13/28] iwlwifi: define iwl_rx_reply_scan only when CONFIG_IWLWIFI_DEBUG enabled Zhu Yi
2007-08-08  7:33                           ` [PATCH 14/28] iwlwifi: remove redundant quotes Zhu Yi
2007-08-08  7:33                             ` Zhu Yi [this message]
2007-08-08  7:33                               ` [PATCH 16/28] iwlwifi: Endianity fix for beacon host command Zhu Yi
2007-08-08  7:33                                 ` [PATCH 17/28] iwlwifi: Endianity fix for channel number Zhu Yi
2007-08-08  7:33                                   ` [PATCH 18/28] iwlwifi: shorten more function names Zhu Yi
2007-08-08  7:33                                     ` [PATCH 19/28] iwlwifi: make iwl_get_bits inline function from macro Zhu Yi
2007-08-08  7:33                                       ` [PATCH 20/28] iwlwifi: remove BIT_FMT and BIT_ARG Zhu Yi
2007-08-08  7:33                                         ` [PATCH 21/28] iwlwifi: remove WLAN_FC_GET_TYPE macros Zhu Yi
2007-08-08  7:33                                           ` [PATCH 22/28] iwlwifi: replace private snprint_line with common hex_dump_xxx Zhu Yi
2007-08-08  7:33                                             ` [PATCH 23/28] iwlwifi: Endianity fix for frame control Zhu Yi
2007-08-08  7:33                                               ` [PATCH 24/28] iwlwifi: Endianity fix for ct kill configuration Zhu Yi
2007-08-08  7:33                                                 ` [PATCH 25/28] iwlwifi: remove unused snprint_line Zhu Yi
2007-08-08  7:33                                                   ` [PATCH 26/28] iwlwifi: Enhance ISR/RX/CMD debug messages Zhu Yi
2007-08-08  7:33                                                     ` [PATCH 27/28] iwlwifi: Correct missing hardware detection in iwl_isr() Zhu Yi
2007-08-08  7:33                                                       ` [PATCH 28/28] iwlwifi: Streamline irq_tasklet() when ISR debug not used Zhu Yi

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=11865584603865-git-send-email-yi.zhu@intel.com \
    --to=yi.zhu@intel.com \
    --cc=gregory.greenman@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=tomas.winkler@intel.com \
    /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).