Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5350052ybi; Wed, 12 Jun 2019 00:43:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqz+9JU2WLSQfvGO8Uu5JIbP98e+BduxvPKU66I759AXKs8LrSW8YRczT6TWRF5ZclElkf/1 X-Received: by 2002:a63:484d:: with SMTP id x13mr15127521pgk.448.1560325420369; Wed, 12 Jun 2019 00:43:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560325420; cv=none; d=google.com; s=arc-20160816; b=PnU+IWtMYgPN+lD0cmR5kY1p6GYS6xI3nMzpjGBvBw8xlFdGecoeXaD1e4rGjFMob3 U/b0RWxJdPjva5tLSqpy4SfY3Y8z73oJQKeSilE5yOnAFIf+I0L6LHTwJ9YhnfMd2DGW ahkzjWmD648nZsv13FtlYSMbW5sFW2gRrA3gh+C44vBcwo6YhMCKfyFDnL0iPD7muYsV ntunvz0mfe1F3piWoabRP+pPqVJEJMYQ9aRxJPmp4ANnOuW/ZhZBs1GEAy16QBNaleMe +0q/8RLrcQcLG6Q/6q0R4HDmN/2JxmY8jSdzHKGrJOGxJNcBkuj1o07utA7Plj38/bV8 q5IQ== 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=45Gvw03nOiFoCfCe/sjOBkKKZin6hBFq+nlDqEyH9IY=; b=fs5NbCjHFMJJ9lMkY4YyBPsT0tc35zkS7yO4Y53b7p7lQniw/4RfM9aFGp4TMVpoU9 p0X6bIDq98+ntNNcQzJDWHe01CRs6uZEeAXI2X3GDlJqs2DtSZvY+StYG5nJAjk+kfx3 O8cvgHp6IeyPZ/RI3/XacEQyGZO7JxCxWDWDJKPnZ8jofEPvmEQjqiASqR4YgE+a7122 FEwAqprpKhLjx+xUsUVUxswWdQiqQqBYgI2B0x7AxrSY9xodwUxMFqpj24nDLeMcREZW vgzUQzUVRY9pjfNMcTlAXauwqtT7mLtvK0L2Ity52Dxw1ViEVaf1Vmrd9aOHdCcHz/b2 Yv1g== 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 m2si14919275pgd.256.2019.06.12.00.43.20; Wed, 12 Jun 2019 00:43:40 -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 S2408571AbfFLDNB (ORCPT + 99 others); Tue, 11 Jun 2019 23:13:01 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:28867 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2406872AbfFLDNA (ORCPT ); Tue, 11 Jun 2019 23:13:00 -0400 X-UUID: dfb021c722e34194afb53bd68c7cfd93-20190612 X-UUID: dfb021c722e34194afb53bd68c7cfd93-20190612 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 174732528; Wed, 12 Jun 2019 11:12:47 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs08n2.mediatek.inc (172.21.101.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 12 Jun 2019 11:12:40 +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; Wed, 12 Jun 2019 11:12:40 +0800 From: Ryder Lee To: Felix Fietkau , Lorenzo Bianconi CC: Roy Luo , YF Luo , Yiwei Chung , Sean Wang , , , , Ryder Lee Subject: [PATCH 2/2] mt76: mt7615: update peer's bssid when state transition changes Date: Wed, 12 Jun 2019 11:12:34 +0800 Message-ID: <449fee28c558b6f02b62275f9beefaab02b47efc.1560221172.git.ryder.lee@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <3065a01998dfa04a5d2d680e820a17cb5c110d0f.1560221172.git.ryder.lee@mediatek.com> References: <3065a01998dfa04a5d2d680e820a17cb5c110d0f.1560221172.git.ryder.lee@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 3F5B734C7013F11341551BE8410EA107F2318531696F13E719DF083F3416BACF2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Driver should update peer's bssid and bss information when state transition changes. Signed-off-by: Ryder Lee --- .../net/wireless/mediatek/mt76/mt7615/main.c | 5 +- .../net/wireless/mediatek/mt76/mt7615/mcu.c | 49 ++++++++++--------- 2 files changed, 27 insertions(+), 27 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..8fc12cd37906 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -741,17 +741,6 @@ int mt7615_mcu_set_bss_info(struct mt7615_dev *dev, u8 *buf, *data, tx_wlan_idx = 0; struct req_hdr *hdr; - if (en) { - len += sizeof(struct bss_info_omac); - features |= BIT(BSS_INFO_OMAC); - if (mvif->omac_idx > EXT_BSSID_START) { - len += sizeof(struct bss_info_ext_bss); - features |= BIT(BSS_INFO_EXT_BSS); - ntlv++; - } - ntlv++; - } - switch (vif->type) { case NL80211_IFTYPE_AP: case NL80211_IFTYPE_MESH_POINT: @@ -759,22 +748,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: @@ -782,6 +772,17 @@ int mt7615_mcu_set_bss_info(struct mt7615_dev *dev, break; } + if (en) { + len += sizeof(struct bss_info_omac); + features |= BIT(BSS_INFO_OMAC); + if (mvif->omac_idx > EXT_BSSID_START) { + len += sizeof(struct bss_info_ext_bss); + features |= BIT(BSS_INFO_EXT_BSS); + ntlv++; + } + ntlv++; + } + buf = kzalloc(len, GFP_KERNEL); if (!buf) return -ENOMEM; -- 2.18.0