From patchwork Thu Feb 8 22:08:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Bianconi X-Patchwork-Id: 10208073 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 888AC602D8 for ; Thu, 8 Feb 2018 22:08:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 725D0296B7 for ; Thu, 8 Feb 2018 22:08:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 673CD296C6; Thu, 8 Feb 2018 22:08:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EF263296B7 for ; Thu, 8 Feb 2018 22:08:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752429AbeBHWId (ORCPT ); Thu, 8 Feb 2018 17:08:33 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:37962 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752408AbeBHWIc (ORCPT ); Thu, 8 Feb 2018 17:08:32 -0500 Received: by mail-wm0-f66.google.com with SMTP id 141so12708491wme.3 for ; Thu, 08 Feb 2018 14:08:32 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=y7yfLHUdiE9x2EgKPncllCKtElJ4Jmi9jJaF6colomc=; b=jhrP0h0/KqFZHRePr6ZuJ0GD1TA1+AefmqbopiIlxlH4fn55E2wGlhuihW/WPOt+25 vzZdo97NwGsW814CTrm9iy1EG0l1GkkCllKvfpweVZ5acqomsO8Gpe1jbDJuZDLAIfTu iDlwVWfwSnlbocbY+eHHlVCzYcOkuqJMdksbBF6WvEFZPuxj3rz8bdYWZkyebtoC+1ow HLymGkVvIR2Ph/fvPHwdT1ff53SvZsD2eUSG3RAGmGcxYe3BguiFpiH16QQMVtXjgZwc IY0IRLMjeVNS4wLQ1bs3YbpVUZOENfqImsYjoUoZ63Ywo3BxBimS1Th9EQXaS5LTquUr lrVQ== X-Gm-Message-State: APf1xPA5PkmXSqLyzA2lBahJyaEw24rOqtpMOxTXDwpiHGyikvHmV8xu YwoU/lriLl+bcbKAwY97KLIe4w== X-Google-Smtp-Source: AH8x224isb64Fje3RMyLcvDUgQYNbPnOhSTbR6lXVDfay4cBO0ARwgsbmqqod0aA2piZBV90YYEr7A== X-Received: by 10.28.128.136 with SMTP id b130mr358041wmd.68.1518127711617; Thu, 08 Feb 2018 14:08:31 -0800 (PST) Received: from localhost.localdomain.com ([151.66.66.80]) by smtp.gmail.com with ESMTPSA id a18sm1123904wra.56.2018.02.08.14.08.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Feb 2018 14:08:31 -0800 (PST) From: Lorenzo Bianconi To: kubakici@wp.pl Cc: linux-wireless@vger.kernel.org Subject: [PATCH 2/2] mt7601u: set device mac address in mt7601u_add_interface() Date: Thu, 8 Feb 2018 23:08:09 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If mac80211 adds a vif with a different mac address respect to the eeprom one, the device will not be able to connect to the ap since the hw address has not been updated. Fix the issue updating hw mac address in mt7601u_add_interface routine BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1516935 Signed-off-by: Lorenzo Bianconi --- drivers/net/wireless/mediatek/mt7601u/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/mediatek/mt7601u/main.c b/drivers/net/wireless/mediatek/mt7601u/main.c index 43ebd460ba86..3c9ea40d9584 100644 --- a/drivers/net/wireless/mediatek/mt7601u/main.c +++ b/drivers/net/wireless/mediatek/mt7601u/main.c @@ -64,6 +64,9 @@ static int mt7601u_add_interface(struct ieee80211_hw *hw, */ mvif->idx = idx; + if (!ether_addr_equal(dev->macaddr, vif->addr)) + mt7601u_set_macaddr(dev, vif->addr); + if (dev->wcid_mask[wcid / BITS_PER_LONG] & BIT(wcid % BITS_PER_LONG)) return -ENOSPC; dev->wcid_mask[wcid / BITS_PER_LONG] |= BIT(wcid % BITS_PER_LONG);