From: Ivo van Doorn <ivdoorn@gmail.com>
To: linux-wireless@vger.kernel.org
Cc: Helmut Schaa <helmut.schaa@googlemail.com>, stable@kernel.org
Subject: [PATCH 12/13] rt2x00: Fix hw crypto in AP mode for some devices
Date: Thu, 4 Nov 2010 20:42:36 +0100 [thread overview]
Message-ID: <201011042042.37240.IvDoorn@gmail.com> (raw)
In-Reply-To: <201011042041.06812.IvDoorn@gmail.com>
From: Helmut Schaa <helmut.schaa@googlemail.com>
The BSSID register shouldn't be set in AP mode on some older devices (like
rt73usb) as it breaks hw crypto on these. However, rt2800 devices explicitly
need the BSSID register set to the same value as our own MAC address (only
in AP mode).
Hence, don't set the BSSID from rt2x00lib but move it down into rt2800 to
avoid problems on older devices.
This fixes a regression (at least for rt73usb) and avoids a new regression
for rt2800 devices in 2.6.36.
Reported-by: Johannes Stezenbach <js@sig21.net>
Reported-by: Lee <lee-in-berlin@web.de>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt2800lib.c | 13 ++++++++++++-
drivers/net/wireless/rt2x00/rt2x00mac.c | 10 ++--------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
index 6fa6549..a53536d 100644
--- a/drivers/net/wireless/rt2x00/rt2800lib.c
+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -1148,6 +1148,7 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
struct rt2x00intf_conf *conf, const unsigned int flags)
{
u32 reg;
+ bool update_bssid = false;
if (flags & CONFIG_UPDATE_TYPE) {
/*
@@ -1177,6 +1178,16 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
}
if (flags & CONFIG_UPDATE_MAC) {
+ if (flags & CONFIG_UPDATE_TYPE &&
+ conf->sync == TSF_SYNC_AP_NONE) {
+ /*
+ * The BSSID register has to be set to our own mac
+ * address in AP mode.
+ */
+ memcpy(conf->bssid, conf->mac, sizeof(conf->mac));
+ update_bssid = true;
+ }
+
if (!is_zero_ether_addr((const u8 *)conf->mac)) {
reg = le32_to_cpu(conf->mac[1]);
rt2x00_set_field32(®, MAC_ADDR_DW1_UNICAST_TO_ME_MASK, 0xff);
@@ -1187,7 +1198,7 @@ void rt2800_config_intf(struct rt2x00_dev *rt2x00dev, struct rt2x00_intf *intf,
conf->mac, sizeof(conf->mac));
}
- if (flags & CONFIG_UPDATE_BSSID) {
+ if ((flags & CONFIG_UPDATE_BSSID) || update_bssid) {
if (!is_zero_ether_addr((const u8 *)conf->bssid)) {
reg = le32_to_cpu(conf->bssid[1]);
rt2x00_set_field32(®, MAC_BSSID_DW1_BSS_ID_MASK, 3);
diff --git a/drivers/net/wireless/rt2x00/rt2x00mac.c b/drivers/net/wireless/rt2x00/rt2x00mac.c
index 283a8d9..36ddee8 100644
--- a/drivers/net/wireless/rt2x00/rt2x00mac.c
+++ b/drivers/net/wireless/rt2x00/rt2x00mac.c
@@ -283,14 +283,8 @@ int rt2x00mac_add_interface(struct ieee80211_hw *hw,
* invalid behavior in the device.
*/
memcpy(&intf->mac, vif->addr, ETH_ALEN);
- if (vif->type == NL80211_IFTYPE_AP) {
- memcpy(&intf->bssid, vif->addr, ETH_ALEN);
- rt2x00lib_config_intf(rt2x00dev, intf, vif->type,
- intf->mac, intf->bssid);
- } else {
- rt2x00lib_config_intf(rt2x00dev, intf, vif->type,
- intf->mac, NULL);
- }
+ rt2x00lib_config_intf(rt2x00dev, intf, vif->type,
+ intf->mac, NULL);
/*
* Some filters depend on the current working mode. We can force
--
1.7.2.3
next prev parent reply other threads:[~2010-11-04 19:44 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-04 19:36 [PATCH 01/13] rt2x00: Add TXOP_CTRL_CFG register definition Ivo van Doorn
2010-11-04 19:37 ` [PATCH 02/13] rt2x00: Sync Tx and RX ring sizes with legacy drivers Ivo van Doorn
2010-11-04 19:37 ` [PATCH 03/13] rt2x00: Wait up to one second on rt2800 for WPDMA to be ready Ivo van Doorn
2010-11-04 19:38 ` [PATCH 04/13] rt2x00: Reduce tx descriptor size Ivo van Doorn
2010-11-04 19:38 ` [PATCH 05/13] rt2x00: Add unlikely to skb allocation failure check Ivo van Doorn
2010-11-04 19:38 ` [PATCH 06/13] rt2x00: Optimize rt2x00debug_dump_frame when frame dumping is not active Ivo van Doorn
2010-11-04 19:39 ` [PATCH 07/13] rt2x00: Rename rt2x00queue_timeout Ivo van Doorn
2010-11-04 19:39 ` [PATCH 08/13] rt2x00: Remove failsave from rt2x00usb_watchdog_tx_dma Ivo van Doorn
2010-11-04 19:40 ` [PATCH 09/13] rt2x00: Implement flush callback Ivo van Doorn
2010-11-04 19:40 ` [PATCH 10/13] rt2x00: Fix MCU_SLEEP arguments Ivo van Doorn
2010-11-04 19:41 ` [PATCH 11/13] rt2x00: Fix crash on USB unplug Ivo van Doorn
2010-11-04 19:42 ` Ivo van Doorn [this message]
2010-11-04 19:43 ` [PATCH 13/13] rt2x00: Fix comments in rt73usb.h and rt61pci.h Ivo van Doorn
2010-11-04 23:21 ` [PATCH 11/13] rt2x00: Fix crash on USB unplug Julian Calaby
2010-11-05 0:07 ` Blaise Gassend
2010-11-06 12:51 ` Ivo Van Doorn
2010-11-08 19:08 ` Blaise Gassend
2010-11-08 19:13 ` Ivo Van Doorn
2010-11-04 21:32 ` [PATCH 05/13] rt2x00: Add unlikely to skb allocation failure check Christian Lamparter
2010-11-05 7:23 ` Helmut Schaa
2010-11-05 7:52 ` Rafał Miłecki
2010-11-05 8:01 ` Helmut Schaa
2010-11-05 9:44 ` [PATCH 03/13] rt2x00: Wait up to one second on rt2800 for WPDMA to be ready Helmut Schaa
2010-11-05 9:52 ` Ivo Van Doorn
2010-11-05 9:56 ` Helmut Schaa
2010-11-05 10:07 ` Ivo Van Doorn
2010-11-10 19:40 ` John W. Linville
2010-11-13 12:56 ` Ivo Van Doorn
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=201011042042.37240.IvDoorn@gmail.com \
--to=ivdoorn@gmail.com \
--cc=helmut.schaa@googlemail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=stable@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).