From patchwork Tue Nov 27 17:27:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 1812071 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id D42823FC54 for ; Tue, 27 Nov 2012 17:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755689Ab2K0R1N (ORCPT ); Tue, 27 Nov 2012 12:27:13 -0500 Received: from mail-wi0-f174.google.com ([209.85.212.174]:45228 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755450Ab2K0R1N (ORCPT ); Tue, 27 Nov 2012 12:27:13 -0500 Received: by mail-wi0-f174.google.com with SMTP id hm9so4737886wib.1 for ; Tue, 27 Nov 2012 09:27:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=QUI7Jw+kXp+IFuLkIpGnVIaAlEP+RuS4WbMpMwsp1so=; b=oCkUM265jt1vE0U6g+RIpffZp+ACTqJqX6F2l1vhYrjnUe/UFMdf+H4YrYWxWpIVlz etPBt0rdmkG33+7WClcBt5SiNclNS0/i4KbAPIEW3xdJj5vL7570FBx26ft8v/whwGPz 4gZw4glRQteoD6FWw4gz5wJn4LZ/xi53K2abgAmuDDjUmy/GABCdN55sxCdXqW/EXYpQ yUVK724GahEeUCaaT/RtuL0hPUz50JjHuJP1sUZExk0fWQs/bOamsbe5rDT0ngfFUuTv EJThI51CMNTje+hZme3wfEuWLWhoVqPNiHmKnT3srRZ78wMv5jIROeHLwUGV2nbkOGHg uwqw== Received: by 10.180.109.132 with SMTP id hs4mr24869123wib.1.1354037232133; Tue, 27 Nov 2012 09:27:12 -0800 (PST) Received: from localhost.localdomain (port-92-198-130-130.static.qsc.de. [92.198.130.130]) by mx.google.com with ESMTPS id p3sm3375225wic.8.2012.11.27.09.27.11 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 27 Nov 2012 09:27:11 -0800 (PST) From: Helmut Schaa To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, sgruszka@redhat.com, gwingerde@gmail.com, IvDoorn@gmail.com, Helmut Schaa Subject: [PATCH] rt2x00: Use addr_mask to catch invalid MAC addresses (rt61pci, rt73usb) Date: Tue, 27 Nov 2012 18:27:05 +0100 Message-Id: <1354037225-30237-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.7 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- 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. */