Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp230376pxu; Fri, 4 Dec 2020 01:40:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9ymS16KuzJCtGCALROSWm32NQTKlIuCLyLjTrXxOcceveypyus0324nhmMaDomtBDHiL6 X-Received: by 2002:a17:906:2642:: with SMTP id i2mr6059681ejc.493.1607074852881; Fri, 04 Dec 2020 01:40:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607074852; cv=none; d=google.com; s=arc-20160816; b=jULfBRETiPpqTj4DMioYCqCTOPv/yOQw3elx9BqFJzcSTOQtbdnD+2GoXiRUDvX1VP dZENjKnrl7wWQ4w43FBFIFJaZjE7UlWFCAKGnUisOZgSIocbe4x2JBamjH4u7XSzvKjJ TGLXIH7mUNFdkdyi3d6lh0/kyIjtVxXQ8bjRMoXzTE2sYktx/JRk1cHpYhMn3zCMVC71 NUorGtqYhAFwpp0o88GaSOmoFR/MLonbkrvTuOrhYVTWgxWRlRbfXC12EP8BDRkUEYck vTIRjqmJIrHPIkVM6yA9wSDJW0Od/e93Qqzr4+QcxSg832Kgt1ijCXYCZq4BrqLxUZWN Dybw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=A047l8qcG2RoQNk3dQcJNdQ1U00gWkmtcJcWcf1vd6E=; b=TyDVJP0qW+XILHSksuDCWvPYfuPccsaY22r1u8qLCjZkCsx3wR+XZ3IWePFOsa7M/Z 4ZaxDA6lCBWS/P8loZDyasIlf1cu66UJy9m8L1vckEiURknt1mQ+YTzMjQzymhwRbK86 0UVXsHupTQhMgDkHOSHNRiyfUDfv6hxKoRiUZAfGu5u8mdlK/ZaWFhM7yBm5Gwecqim1 nB9F30V6eJWL0ezReuqacppCweyyC9Rt7vw1qANYnbu4oY44GliOUjsUv9yTN65Jio9o l3P2CO8y4MFhsdUbK22Ccz3qi4oTMjfhzJJBXK890v++QtzlNhjXVFf2d29Sh3OTB6+C CFTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk23si2504604edb.17.2020.12.04.01.40.29; Fri, 04 Dec 2020 01:40:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387594AbgLDJiB (ORCPT + 99 others); Fri, 4 Dec 2020 04:38:01 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:54808 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726986AbgLDJh6 (ORCPT ); Fri, 4 Dec 2020 04:37:58 -0500 X-UUID: f05a887e5ade4e24b087576f3c91cb82-20201204 X-UUID: f05a887e5ade4e24b087576f3c91cb82-20201204 Received: from mtkcas10.mediatek.inc [(172.21.101.39)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1690865228; Fri, 04 Dec 2020 17:37:12 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 4 Dec 2020 17:37:07 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 4 Dec 2020 17:37:08 +0800 From: Shayne Chen To: Felix Fietkau CC: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek , Shayne Chen Subject: [PATCH 1/5] mt76: mt7915: add partial add_bss_info command on testmode init Date: Fri, 4 Dec 2020 17:36:55 +0800 Message-ID: <20201204093659.20384-1-shayne.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org This is a preliminary patch for DBDC and ipg config support in testmode. The wmm_idx of band1 should be configured by this command to make band1 Tx work normally. Also, for setting ipg, FW needs a non-empty bss_info structure to do edca parameters update. Signed-off-by: Shayne Chen Acked-by: Ryder Lee --- .../net/wireless/mediatek/mt76/mt7915/mcu.c | 20 ++++++++++++++----- .../wireless/mediatek/mt76/mt7915/testmode.c | 2 ++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c index 6097653abda4..623b7b6d9e83 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c @@ -674,6 +674,7 @@ mt7915_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif, switch (vif->type) { case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_AP: + case NL80211_IFTYPE_MONITOR: break; case NL80211_IFTYPE_STATION: /* TODO: enable BSS_INFO_UAPSD & BSS_INFO_PM */ @@ -702,16 +703,21 @@ mt7915_mcu_bss_basic_tlv(struct sk_buff *skb, struct ieee80211_vif *vif, } bss = (struct bss_info_basic *)tlv; - memcpy(bss->bssid, vif->bss_conf.bssid, ETH_ALEN); - bss->bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int); bss->network_type = cpu_to_le32(type); - bss->dtim_period = vif->bss_conf.dtim_period; bss->bmc_wcid_lo = to_wcid_lo(wlan_idx); bss->bmc_wcid_hi = to_wcid_hi(wlan_idx); - bss->phy_mode = mt7915_get_phy_mode(phy->dev, vif, band, NULL); bss->wmm_idx = mvif->wmm_idx; bss->active = enable; + if (vif->type != NL80211_IFTYPE_MONITOR) { + memcpy(bss->bssid, vif->bss_conf.bssid, ETH_ALEN); + bss->bcn_interval = cpu_to_le16(vif->bss_conf.beacon_int); + bss->dtim_period = vif->bss_conf.dtim_period; + bss->phy_mode = mt7915_get_phy_mode(phy->dev, vif, band, NULL); + } else { + memcpy(bss->bssid, phy->mt76->macaddr, ETH_ALEN); + } + return 0; } @@ -727,6 +733,7 @@ mt7915_mcu_bss_omac_tlv(struct sk_buff *skb, struct ieee80211_vif *vif) tlv = mt7915_mcu_add_tlv(skb, BSS_INFO_OMAC, sizeof(*omac)); switch (vif->type) { + case NL80211_IFTYPE_MONITOR: case NL80211_IFTYPE_MESH_POINT: case NL80211_IFTYPE_AP: type = CONNECTION_INFRA_AP; @@ -996,6 +1003,9 @@ int mt7915_mcu_add_bss_info(struct mt7915_phy *phy, mt7915_mcu_bss_basic_tlv(skb, vif, phy, enable); + if (vif->type == NL80211_IFTYPE_MONITOR) + goto out; + if (enable) { mt7915_mcu_bss_rfch_tlv(skb, vif, phy); mt7915_mcu_bss_bmc_tlv(skb, phy); @@ -1009,7 +1019,7 @@ int mt7915_mcu_add_bss_info(struct mt7915_phy *phy, mvif->omac_idx < REPEATER_BSSID_START) mt7915_mcu_bss_ext_tlv(skb, mvif); } - +out: return mt76_mcu_skb_send_msg(&phy->dev->mt76, skb, MCU_EXT_CMD_BSS_INFO_UPDATE, true); } diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c index 9ee82e2d262c..fe56ab18e974 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c @@ -192,6 +192,8 @@ mt7915_tm_init(struct mt7915_dev *dev) mt7915_tm_mode_ctrl(dev, en); mt7915_tm_reg_backup_restore(dev, &dev->phy); mt7915_tm_set_trx(dev, &dev->phy, TM_MAC_TXRX, !en); + + mt7915_mcu_add_bss_info(&dev->phy, dev->phy.monitor_vif, en); } static void -- 2.17.1