Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp593171pxu; Wed, 14 Oct 2020 08:51:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwevJRqKKKHJKvGqEF4ooMNo1n/vCqYLtgRszQiHck+47HADR2M3JrHHrray8W7ZCGSLX+U X-Received: by 2002:a50:ccc4:: with SMTP id b4mr5818035edj.250.1602690671812; Wed, 14 Oct 2020 08:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602690671; cv=none; d=google.com; s=arc-20160816; b=Qa/6ggEVHTydg4hyW6FN7iok0u6Nrp056zK89zQmyOfdx/CJNff7Q7N9pMvBQhCRjj cUO5jKWt2j/zz5Bjhq5r3vmfyjB0cQkPJV9zufRZmAu536C3Y4gDT2vjFWArLY6pvxIt 8biHwxN4P+FIFh4ySSDxhaQES9gI1t960pRrbcIhzV3kzM5XCG9Rkh1/G2mqHpqDJqe2 /L7R9K9PkSQ6oDnC53qPukgjP4YKri651FJfxZ5OoXtuJdQ6DqH7vHPCy6+r0Cyj2Svl NPkBO03s6Ax53MP7Vj/aBFpuulyhGQo/296Adp5ih0SkSkFcFEXcezQJMNl/0tagAfu9 20pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to:dkim-signature; bh=opmjH3ZyRO0Bff677ZBbUzYgvMkp277MTfGEMgeatCU=; b=cfFJdHFVZCPmzVneG1g4W4iZiwczKbYbwUxv0o2BU89/BBFPslIL4W1hptT+PDHue0 oIYdHjYKooF/Lp5SL4yyHaB+BpOd+a66HaSsnIRygVVs9g8oN53OLVgN1fIoY3syXDt2 lYq0UcAynaKNYYpwP851ttFfWtEvmCnkWmzRsHXsfhQggIi0Dhq1YlVqgrpU56frflIM NZpMZuch0Ft2H3dD8aecM6GiqiIUbscao1iG11u3CZQtMvroj3N8kQbSli97HdlCcv97 84bnYbLY2RSmkxrbTdAmzrq9lp+31tPyvEnKMilmusTkUqU3CEve7aILtKlIzeSb3AXF xCJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=dOhmbIhM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si24601ejd.424.2020.10.14.08.50.47; Wed, 14 Oct 2020 08:51:11 -0700 (PDT) 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; dkim=fail header.i=@nbd.name header.s=20160729 header.b=dOhmbIhM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727445AbgJNKXJ (ORCPT + 99 others); Wed, 14 Oct 2020 06:23:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726493AbgJNKXJ (ORCPT ); Wed, 14 Oct 2020 06:23:09 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B09C061755 for ; Wed, 14 Oct 2020 03:23:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:Subject:From:References:Cc:To:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=opmjH3ZyRO0Bff677ZBbUzYgvMkp277MTfGEMgeatCU=; b=dOhmbIhMtzC/KSlYzY59O9AsWA ligtv8fOtHVF8xYckjShbCe4xOMbHtDT7PJ3PX89GRAFa7kfLY2Ntuz0tty/hwvhx4FAg2eaHasi1 lAxLgFOwVbkRSqsEHQqV/hXD8eAymrw1gwW4q3/KCAFKNzzqDNh91AezOfd8M0/+glmI=; Received: from p54ae9462.dip0.t-ipconnect.de ([84.174.148.98] helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1kSdvx-0003kZ-J4; Wed, 14 Oct 2020 12:23:01 +0200 To: Shayne Chen Cc: linux-wireless , Lorenzo Bianconi , Ryder Lee , Evelyn Tsai , linux-mediatek References: <20201012125403.8608-1-shayne.chen@mediatek.com> <20201012125403.8608-8-shayne.chen@mediatek.com> From: Felix Fietkau Subject: Re: [PATCH v3 08/10] mt76: mt7915: implement testmode rx support Message-ID: Date: Wed, 14 Oct 2020 12:23:00 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: <20201012125403.8608-8-shayne.chen@mediatek.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-10-12 14:54, Shayne Chen wrote: > Support testmode rx and display rx statistic by parsing RXV packet > type, which is currently only enabled in testmode. > > Reviewed-by: Ryder Lee > Signed-off-by: Shayne Chen > --- > v2: change last_snr to u8 > v3: use nla_put_u8 for MT76_TM_RX_ATTR_SNR > change snr variable type to u8 in mt7915_mac_fill_rx_vector > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c > index 5d95766..acab268 100644 > --- a/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c > +++ b/drivers/net/wireless/mediatek/mt76/mt7915/testmode.c > @@ -113,6 +113,31 @@ mt7915_tm_reg_backup_restore(struct mt7915_dev *dev, struct mt7915_phy *phy) > mt76_clear(dev, MT_TMAC_TCR0(0), MT_TMAC_TCR0_TBTT_STOP_CTRL); > } > > +static int > +mt7915_tm_config_rx_filter(struct mt7915_dev *dev, bool en) > +{ > + struct mt7915_tm_cmd req = { > + .testmode_en = 1, > + .param_idx = MCU_ATE_SET_RX_FILTER, > + .param.filter.report_en = en, > + .param.filter.band = 0, /* TODO: support dbdc */ > + }; > + __le32 mask = RX_FILTER_NOT_OWN_BTIM | > + RX_FILTER_NOT_OWN_UCAST | > + RX_FILTER_RTS | RX_FILTER_CTS | > + RX_FILTER_CTRL_RSV | > + RX_FILTER_BC_MC_BSSID_A2 | > + RX_FILTER_BC_MC_BSSID_A3 | > + RX_FILTER_BC_MC_OMAC_A3 | > + RX_FILTER_PROTOCOL_VERSION | > + RX_FILTER_FCS_ERR; > + > + req.param.filter.mask = cpu_to_le32(mask); > + > + return mt76_mcu_send_msg(&dev->mt76, MCU_EXT_CMD_ATE_CTRL, &req, > + sizeof(req), false); Why do we need this? In order to use testmode you have to set up a monitor mode interface, which should configure the rx filter settings properly already. - Felix