From patchwork Tue Apr 21 05:20:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 215906 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_BASE64_TEXT, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 53BBAC54FC9 for ; Tue, 21 Apr 2020 05:20:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C0FA208E4 for ; Tue, 21 Apr 2020 05:20:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="bK3bvDV+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726024AbgDUFUn (ORCPT ); Tue, 21 Apr 2020 01:20:43 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:13648 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725730AbgDUFUn (ORCPT ); Tue, 21 Apr 2020 01:20:43 -0400 X-UUID: 5a3a076786c84c8d9a66f7de46457447-20200421 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=xl04sGst5RWKqj6KRI3YoPG+MmLEAdUG9UGxqBx1emY=; b=bK3bvDV+irIB7SYH3X5F1e/BhdLU1w01yFWbry2c8yC72ADhH2biX2v9Tz0lsPie5kxeAjVJ1LpA7V/2ocYC1/lXegx47Qo4sR4w7ebaY3dpDaGWzH2S0w1OAwGmGIC9n/lvGuBPjR9qASiQrhmeVsrcDJJbnY+rK9jZVZQPbAY=; X-UUID: 5a3a076786c84c8d9a66f7de46457447-20200421 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 2033385352; Tue, 21 Apr 2020 13:20:40 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 21 Apr 2020 13:20:27 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 21 Apr 2020 13:20:26 +0800 From: To: , CC: , , , , Soul Huang , Lorenzo Bianconi Subject: [PATCH 2/3] mt76: mt7615: add missing code for providing aid info to the mcu Date: Tue, 21 Apr 2020 13:20:22 +0800 Message-ID: <0292e088e934199434f0ea06598274f57a24f3d9.1587445885.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1467d47fd111b5711fa74410833153bdc9e01b72.1587445885.git.sean.wang@mediatek.com> References: <1467d47fd111b5711fa74410833153bdc9e01b72.1587445885.git.sean.wang@mediatek.com> MIME-Version: 1.0 X-MTK: N Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang Parameters in station record should be kept as up to date as BSS being updated. Fixes: a90b4ba1f134 ("mt76: mt7615: provide aid info to the mcu") Suggested-by: YF Luo Suggested-by: Lucy Hsu Co-developed-by: Soul Huang Signed-off-by: Soul Huang Co-developed-by: Lorenzo Bianconi Signed-off-by: Lorenzo Bianconi Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7615/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index cdc8babca85a..e5012ad680bb 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -497,9 +497,19 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw, mutex_lock(&dev->mt76.mutex); - if (changed & BSS_CHANGED_ASSOC) + if (changed & BSS_CHANGED_ASSOC) { + struct ieee80211_sta *sta; + mt7615_mcu_add_bss_info(phy, vif, info->assoc); + rcu_read_lock(); + sta = ieee80211_find_sta(vif, vif->bss_conf.bssid); + rcu_read_unlock(); + + if (sta) + mt7615_mcu_sta_add(dev, vif, sta, info->assoc); + } + if (changed & BSS_CHANGED_ERP_SLOT) { int slottime = info->use_short_slot ? 9 : 20; @@ -557,7 +567,8 @@ int mt7615_mac_sta_add(struct mt76_dev *mdev, struct ieee80211_vif *vif, mt7615_mac_wtbl_update(dev, idx, MT_WTBL_UPDATE_ADM_COUNT_CLEAR); - mt7615_mcu_sta_add(dev, vif, sta, true); + if (vif->type != NL80211_IFTYPE_STATION) + mt7615_mcu_sta_add(dev, vif, sta, true); return 0; } From patchwork Tue Apr 21 05:20:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 215907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_BASE64_TEXT, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5CFC1C2BA19 for ; Tue, 21 Apr 2020 05:20:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 36C092076C for ; Tue, 21 Apr 2020 05:20:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="P/rADJw9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725926AbgDUFUd (ORCPT ); Tue, 21 Apr 2020 01:20:33 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:6048 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725730AbgDUFUd (ORCPT ); Tue, 21 Apr 2020 01:20:33 -0400 X-UUID: 582fc3bab3764b5fae37b843ff0d2f77-20200421 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=HnBBAl5ApGkX57RqSlJeWzPnI68bVoLjmJ43j6pkVuk=; b=P/rADJw9p8J1AUs2H49qs426RjD8jtFtT2KY0Kxbatu8esBbEb7zKX590k407uFoiRsYlC5oQ9mJlfNrrhkFdlejJF74RB0J1wzZA5wLjST8uxpdmSIxIxDJUKKIXrdEeGyZvJS018lI/F6zxd70eUVd/e7YJUAvG4qPl4PLGkA=; X-UUID: 582fc3bab3764b5fae37b843ff0d2f77-20200421 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 573305182; Tue, 21 Apr 2020 13:20:29 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 21 Apr 2020 13:20:27 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 21 Apr 2020 13:20:27 +0800 From: To: , CC: , , , , Soul Huang Subject: [PATCH 3/3] mt76: mt7663: fix up BMC entry indicated to unicmd firmware Date: Tue, 21 Apr 2020 13:20:23 +0800 Message-ID: <99b919b29ad60437749d5f30dc8c68ccb3df89f3.1587445885.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1467d47fd111b5711fa74410833153bdc9e01b72.1587445885.git.sean.wang@mediatek.com> References: <1467d47fd111b5711fa74410833153bdc9e01b72.1587445885.git.sean.wang@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 9B03E7B10743E9A1174ED658E4FA1FEFCC51863DC180DF2666E119831E7EE7A92000:8 X-MTK: N Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Sean Wang BMC entry for MT7663 unicmd firmware should be a broadcast/multicast entry, not a unicast entry, that is GTK rekey offload would rely on. Fixes: 138860679b2a ("mt76: mt7615: add more uni mcu commands") Cc: Soul Huang Suggested-by: YF Luo Co-developed-by: Ryder Lee Signed-off-by: Ryder Lee Signed-off-by: Sean Wang --- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index 045bde7f554d..e8caa2c7981e 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -1339,7 +1339,7 @@ mt7615_mcu_uni_add_bss(struct mt7615_phy *phy, .short_st = true, }, }; - u8 idx, tx_wlan_idx = 0; + u8 idx, tx_wlan_idx = mvif->sta.wcid.idx; int err; idx = mvif->omac_idx > EXT_BSSID_START ? HW_BSSID_0 : mvif->omac_idx; @@ -1349,10 +1349,9 @@ mt7615_mcu_uni_add_bss(struct mt7615_phy *phy, case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_AP: basic_req.basic.conn_type = cpu_to_le32(CONNECTION_INFRA_AP); - tx_wlan_idx = mvif->sta.wcid.idx; break; case NL80211_IFTYPE_STATION: - if (enable) { + if (enable && !is_mt7663(&dev->mt76)) { struct ieee80211_sta *sta; struct mt7615_sta *msta;