From: Helmut Schaa <helmut.schaa@googlemail.com>
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com,
gwingerde@gmail.com, IvDoorn@gmail.com,
Helmut Schaa <helmut.schaa@googlemail.com>
Subject: [PATCH] rt2x00: Use addr_mask to catch invalid MAC addresses (rt61pci, rt73usb)
Date: Tue, 27 Nov 2012 18:27:05 +0100 [thread overview]
Message-ID: <1354037225-30237-1-git-send-email-helmut.schaa@googlemail.com> (raw)
rt61pci and rt73usb support up to four MAC addresses but only the last
two bits may differ. Hence, tell mac80211 an addr_mask of 0x3.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
drivers/net/wireless/rt2x00/rt61pci.c | 3 +++
drivers/net/wireless/rt2x00/rt73usb.c | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index d6582a2..ee8b44f 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -2771,6 +2771,9 @@ static int rt61pci_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_addr(rt2x00dev,
EEPROM_MAC_ADDR_0));
+ /* Only the last two bits are variable in rt61pci devices. */
+ rt2x00dev->hw->wiphy->addr_mask[ETH_ALEN - 1] = 0x3;
+
/*
* As rt61 has a global fallback table we cannot specify
* more then one tx rate per frame but since the hw will
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 24eec66..6014cfe 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2126,6 +2126,9 @@ static int rt73usb_probe_hw_mode(struct rt2x00_dev *rt2x00dev)
rt2x00_eeprom_addr(rt2x00dev,
EEPROM_MAC_ADDR_0));
+ /* Only the last two bits are variable in rt73usb devices. */
+ rt2x00dev->hw->wiphy->addr_mask[ETH_ALEN - 1] = 0x3;
+
/*
* Initialize hw_mode information.
*/
--
1.7.7
next reply other threads:[~2012-11-27 17:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-27 17:27 Helmut Schaa [this message]
2012-11-28 7:57 ` [PATCH] rt2x00: Use addr_mask to catch invalid MAC addresses (rt61pci, rt73usb) Gertjan van Wingerde
2012-11-28 8:57 ` Helmut Schaa
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=1354037225-30237-1-git-send-email-helmut.schaa@googlemail.com \
--to=helmut.schaa@googlemail.com \
--cc=IvDoorn@gmail.com \
--cc=gwingerde@gmail.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=sgruszka@redhat.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.