From patchwork Wed Nov 28 09:28:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Helmut Schaa X-Patchwork-Id: 1814571 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 91735DF26F for ; Wed, 28 Nov 2012 09:29:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753601Ab2K1J27 (ORCPT ); Wed, 28 Nov 2012 04:28:59 -0500 Received: from mail-we0-f174.google.com ([74.125.82.174]:56932 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752569Ab2K1J26 (ORCPT ); Wed, 28 Nov 2012 04:28:58 -0500 Received: by mail-we0-f174.google.com with SMTP id d7so4379401wer.19 for ; Wed, 28 Nov 2012 01:28:57 -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:in-reply-to:references; bh=bujcXSENOMX97LL2Q1Oiz5/LbLcaerwpfkyLQGhJQIk=; b=INbthrvwMvXRbNAHZNvWs0Zo9/BpflZNvLF5k8GzJrVwKkLRNyTd9Dpzl3GA7SfXoH TeXdGAKZEkBH/CiHxvj9Ep5KbzxaLrQiSZzr+hSjMVop27zzODED/JI8pKLoS3EhZEKu s+FobFGuiDQpgNCpceL/GUvsOfVZzzfzSNnxYErKNTB2/36iZrEn0L9kSyUmdbkBbfTR EXKdzaMT5ey83w/7ueXXTUYM120MJBbBjdbVHSTrx0Z+joT6EegQQW67y8AJKXS9T3BW XU5tgdR6MzWCz/Oo8GMCFEFcUY4mP7rNyExxpYek/8DkhYBYZBnE6sUUFoQA5EFewx/p 2Pcg== Received: by 10.180.99.5 with SMTP id em5mr28061947wib.8.1354094937166; Wed, 28 Nov 2012 01:28:57 -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 y3sm6166621wix.6.2012.11.28.01.28.56 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 28 Nov 2012 01:28:56 -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: [PATCHv2] rt2x00: Use addr_mask to disallow invalid MAC addresses in mutli-bssid mode Date: Wed, 28 Nov 2012 10:28:52 +0100 Message-Id: <1354094932-15703-1-git-send-email-helmut.schaa@googlemail.com> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1354031236-8191-1-git-send-email-helmut.schaa@googlemail.com> References: <1354031236-8191-1-git-send-email-helmut.schaa@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Reported-by: Petr Stetiar Signed-off-by: Helmut Schaa Acked-by: Gertjan van Wingerde Acked-by: Ivo van Doorn --- drivers/net/wireless/rt2x00/rt2x00dev.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c index 69097d1..f9d9754 100644 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c @@ -1182,6 +1182,13 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev) rt2x00dev->hw->vif_data_size = sizeof(struct rt2x00_intf); /* + * rt2x00 devices can only use the last n bits of the MAC address + * for virtual interfaces. + */ + rt2x00dev->hw->wiphy->addr_mask[ETH_ALEN - 1] = + (rt2x00dev->ops->max_ap_intf - 1); + + /* * Determine which operating modes are supported, all modes * which require beaconing, depend on the availability of * beacon entries.