From: Zhu Yi <yi.zhu@intel.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,
Tomas Winkler <tomas.winkler@intel.com>,
Zhu Yi <yi.zhu@intel.com>
Subject: [PATCH 7/7] iwlwifi: Endian fix for rate setting in 3945
Date: Tue, 31 Jul 2007 10:56:36 +0800 [thread overview]
Message-ID: <11858506081731-git-send-email-yi.zhu@intel.com> (raw)
In-Reply-To: <11858506062806-git-send-email-yi.zhu@intel.com>
From: Tomas Winkler <tomas.winkler@intel.com>
This patch fixes endianity issue in rate setting in 3945.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
drivers/net/wireless/iwl-3945-hw.h | 4 ++++
drivers/net/wireless/iwl-base.c | 13 ++++++++-----
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/drivers/net/wireless/iwl-3945-hw.h b/drivers/net/wireless/iwl-3945-hw.h
index 81c7263..8fdf9e0 100644
--- a/drivers/net/wireless/iwl-3945-hw.h
+++ b/drivers/net/wireless/iwl-3945-hw.h
@@ -97,4 +97,8 @@ static inline u16 iwl_hw_get_rate_n_flags(__le16 rate_n_flags)
return le16_to_cpu(rate_n_flags);
}
+static inline __le16 iwl_hw_set_rate_n_flags(u8 rate, u16 flags)
+{
+ return cpu_to_le16((u16)rate|flags);
+}
#endif
diff --git a/drivers/net/wireless/iwl-base.c b/drivers/net/wireless/iwl-base.c
index 683f07d..44fc2cb 100644
--- a/drivers/net/wireless/iwl-base.c
+++ b/drivers/net/wireless/iwl-base.c
@@ -382,7 +382,9 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 * bssid, int is_ap, u8 flags)
int index = IWL_INVALID_STATION;
struct iwl_station_entry *station;
unsigned long flags_spin;
-
+#if IWL == 3945
+ u8 rate;
+#endif
spin_lock_irqsave(&priv->sta_lock, flags_spin);
if (is_ap) {
index = IWL_AP_ID;
@@ -426,14 +428,15 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 * bssid, int is_ap, u8 flags)
station->sta.sta.sta_id = i;
station->sta.station_flags = 0;
#if IWL == 3945
- station->sta.rate_n_flags = cpu_to_le16(
- (priv->phymode == MODE_IEEE80211A) ? IWL_RATE_6M_PLCP :
- IWL_RATE_1M_PLCP | priv->hw_setting.cck_flag);
+ rate = (priv->phymode == MODE_IEEE80211A) ? IWL_RATE_6M_PLCP :
+ IWL_RATE_1M_PLCP | priv->hw_setting.cck_flag;
/* Turn on both antennas for the station... */
- station->sta.rate_n_flags |= RATE_MCS_ANT_AB_MSK;
+ station->sta.rate_n_flags =
+ iwl_hw_set_rate_n_flags(rate, RATE_MCS_ANT_AB_MSK);
station->sta.station_flags |= STA_FLG_TX_RATE_MSK;
+
station->current_rate.rate_n_flags = le16_to_cpu(
station->sta.rate_n_flags);
#endif
--
1.5.2
next prev parent reply other threads:[~2007-07-31 2:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <11858505963374-git-send-email-yi.zhu@intel.com>
2007-07-31 2:56 ` [PATCH 1/7] iwlwifi: add IWLWIFI_HT Kconfig option Zhu Yi
2007-07-31 2:56 ` [PATCH 2/7] iwlwifi: fix rate setting in beacon command Zhu Yi
2007-07-31 2:56 ` [PATCH 3/7] iwlwifi: Endianity fix for TX host command Zhu Yi
2007-07-31 2:56 ` [PATCH 4/7] iwlwifi: Endainity fix for rx configuration Zhu Yi
2007-07-31 2:56 ` [PATCH 5/7] iwlwifi: Endianity fixes for 3945 Zhu Yi
2007-07-31 2:56 ` [PATCH 6/7] iwlwifi: Endianity fix for tx configuration Zhu Yi
2007-07-31 2:56 ` Zhu Yi [this message]
2007-07-31 9:48 ` [PATCH 4/7] iwlwifi: Endainity fix for rx configuration Michael Buesch
2007-07-31 10:11 ` Tomas Winkler
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=11858506081731-git-send-email-yi.zhu@intel.com \
--to=yi.zhu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.