From patchwork Thu Jul 9 12:46:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 6755881 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 786E49F380 for ; Thu, 9 Jul 2015 12:47:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B8E320742 for ; Thu, 9 Jul 2015 12:47:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AE4222073A for ; Thu, 9 Jul 2015 12:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753840AbbGIMr2 (ORCPT ); Thu, 9 Jul 2015 08:47:28 -0400 Received: from mail-la0-f42.google.com ([209.85.215.42]:35640 "EHLO mail-la0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754443AbbGIMqj (ORCPT ); Thu, 9 Jul 2015 08:46:39 -0400 Received: by labgy5 with SMTP id gy5so93312336lab.2 for ; Thu, 09 Jul 2015 05:46:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=JWvGHr4lbfXoamMSKrhY+fMhCgENdw08t9M/cBxGR/w=; b=wkVaLcUoh4vgJzCJr+G9RwQ4efHLPa8kthAWd2fyf0NQiJA+K4YYLob3Bu5lqVR5Bj JJb7+MD2iGnpQFNZbaaG3AB4kUiNSEHGin56Flbyz23HkUGPuTVFqp96IqepvUgh0Mb7 2VHez91r6dLe+5THwMH1MP8hWt+f/99a1zIUqnNqKU5+fGs6zUlWeRm0lzs3MrZsS8+4 v5IVPgyvRfi9zv6LaSGs1liH98LSsG9KQAeUUERpc8RKh05E/6SG7RRqiACRAgPL0zjN uD89SyE/DZvWglo8Tlvw2YhR7V7RmKmhdSToi/Ix1TzFfgQ01idIp2XgfS+GhX3bYWU2 DL1w== X-Received: by 10.152.87.33 with SMTP id u1mr15005469laz.78.1436445998081; Thu, 09 Jul 2015 05:46:38 -0700 (PDT) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by smtp.gmail.com with ESMTPSA id aj4sm1498998lbd.5.2015.07.09.05.46.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Jul 2015 05:46:37 -0700 (PDT) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Kalle Valo , linux-wireless@vger.kernel.org Cc: Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , brcm80211-dev-list@broadcom.com, =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= Subject: [PATCH] brcmfmac: set wiphy's addr_mask to force using valid MACs Date: Thu, 9 Jul 2015 14:46:20 +0200 Message-Id: <1436445980-22196-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Broadcom's firmware requires every BSS to use MAC address with unique last 2 bits. Otherwise it rejects submitted MAC which results in: brcmfmac: _brcmf_set_mac_address: Setting cur_etheraddr failed, -52 Set addr_mask properly to hint only last 2 bits can be modified. This isn't exactly true as all bits can be changed but that's the only way to force unique values in the last 2 bits. Signed-off-by: Rafa? Mi?ecki --- drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c index d86d1f1..4ab1d92 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/cfg80211.c @@ -6100,6 +6100,11 @@ struct brcmf_cfg80211_info *brcmf_cfg80211_attach(struct brcmf_pub *drvr, return NULL; } memcpy(wiphy->perm_addr, drvr->mac, ETH_ALEN); + /* Firmware requires last 2 bits to contain unique value for every BSS. + * Unfortunately this will also disallow changing other bits (firmware + * supports it as long as last 2 bits are unique) but it's the only way. + */ + wiphy->addr_mask[ETH_ALEN - 1] = 0x02; set_wiphy_dev(wiphy, busdev); cfg = wiphy_priv(wiphy);