Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7105064ybi; Thu, 13 Jun 2019 09:37:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqzX96sup2R19M0tf0H/6agdhDQsby7bA9qLBI4EJSZ4Lrkme0MmoIB3PklCr5X/9veHXHru X-Received: by 2002:aa7:8394:: with SMTP id u20mr82247417pfm.252.1560443874398; Thu, 13 Jun 2019 09:37:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560443874; cv=none; d=google.com; s=arc-20160816; b=k/R0bpZiQ+cMFfD4KgeNfqeQ/khX7p3rENvXgBw9SoJ0qFBEid87905ARbf7fZ2XIl gSAYi+JKyKgc61a9drCjD3fGWW7Vd+mazH+PfMcc8Lel8PRHAyv26iD/z3IA264IQDKj KUXLlxKuqAWcXKq6/9YdetqvjPYBDBq27IVI3V4sX9RkLKa+vPFdUQnY1ulPb5Y0Wzzo dqVFq7FRp1YxgkZBF9P5TdopeUfnjErBe1ixCScVi6tZ888Mju5kmlkg6vbfxMBFAUGX pNSicbXQ7DZXz9pzkYdQrqwIFse036W9dVjNfiZIDOX49AQ/8pjEKoIDCjWzRNoAP2TM vLog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=oVfigjavBkLxRVD9iLHpMsW9+mre1f/o/GiWPruRmLs=; b=GFLlb3aZ4pbksRSwoC5b12g4zOI7bG/yy7srvpDdf45dG55HDaWWtbxKif9U0MHg5Q pTJZY8CWxlHrBYPk3KdXZHUf1ffWEZzMUA2Z4Jn3eDJr7+JMJIQLeq/IjTqSkIDl/9Za +SJa/54T8CNIDm8m/Bra1hLULp+91ZQHDatw1T8WEhAiIBwJVt9B16dk3x6XctHqQO3z 78hduUJuC23qLpnrqNwzRAIHLczxKzLjptApde/bwsxSka+9GL0dudupHRm1QSwpkQ8B ZrosY7ArA0T5vKS9hIbLOs8z8JaetmrHors/o6K8zU+tIvexBNxkMRltETJqVWP75aPH Gc/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j14si4277pfe.183.2019.06.13.09.37.39; Thu, 13 Jun 2019 09:37:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392648AbfFMQhc (ORCPT + 99 others); Thu, 13 Jun 2019 12:37:32 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:5006 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730637AbfFMHNv (ORCPT ); Thu, 13 Jun 2019 03:13:51 -0400 X-UUID: 51f25e94249049ff921656c0b66ba1cc-20190613 X-UUID: 51f25e94249049ff921656c0b66ba1cc-20190613 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1922256054; Thu, 13 Jun 2019 15:13:36 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n1.mediatek.inc (172.21.101.55) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 13 Jun 2019 15:13:34 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 13 Jun 2019 15:13:34 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Roy Luo , YF Luo , Yiwei Chung , Sean Wang , , , , Ryder Lee Subject: [PATCH v2 2/2] mt76: mt7615: update peer's bssid when state transition occurs Date: Thu, 13 Jun 2019 15:13:31 +0800 Message-ID: <75f5e467c6e7fc4187572977a8e1f5d4238d6354.1560330906.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <3065a01998dfa04a5d2d680e820a17cb5c110d0f.1560330906.git.ryder.lee@mediatek.com> References: <3065a01998dfa04a5d2d680e820a17cb5c110d0f.1560330906.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This makes sure that the driver update peer's bssid when state transition occurs. Signed-off-by: Ryder Lee --- Changes since v2 - remove unnecessary changes --- .../net/wireless/mediatek/mt76/mt7615/main.c | 5 ++-- .../net/wireless/mediatek/mt76/mt7615/mcu.c | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/main.c b/drivers/net/wireless/mediatek/mt76/mt7615/main.c index d21407ddda31..e0824392c019 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/main.c @@ -283,9 +283,8 @@ static void mt7615_bss_info_changed(struct ieee80211_hw *hw, mutex_lock(&dev->mt76.mutex); - /* TODO: sta mode connect/disconnect - * BSS_CHANGED_ASSOC | BSS_CHANGED_BSSID - */ + if (changed & BSS_CHANGED_ASSOC) + mt7615_mcu_set_bss_info(dev, vif, info->assoc); /* TODO: update beacon content * BSS_CHANGED_BEACON diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index e82086eb8aa4..52d89f3533bf 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -759,22 +759,23 @@ int mt7615_mcu_set_bss_info(struct mt7615_dev *dev, conn_type = CONNECTION_INFRA_AP; break; case NL80211_IFTYPE_STATION: { - struct ieee80211_sta *sta; - struct mt7615_sta *msta; - - rcu_read_lock(); - - sta = ieee80211_find_sta(vif, vif->bss_conf.bssid); - if (!sta) { + /* TODO: enable BSS_INFO_UAPSD & BSS_INFO_PM */ + if (en) { + struct ieee80211_sta *sta; + struct mt7615_sta *msta; + + rcu_read_lock(); + sta = ieee80211_find_sta(vif, vif->bss_conf.bssid); + if (!sta) { + rcu_read_unlock(); + return -EINVAL; + } + + msta = (struct mt7615_sta *)sta->drv_priv; + tx_wlan_idx = msta->wcid.idx; rcu_read_unlock(); - return -EINVAL; } - - msta = (struct mt7615_sta *)sta->drv_priv; - tx_wlan_idx = msta->wcid.idx; conn_type = CONNECTION_INFRA_STA; - - rcu_read_unlock(); break; } default: -- 2.18.0