Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2666341rwr; Fri, 28 Apr 2023 13:56:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+LZgt2FLb6WLCcyMifHa53EPjuRVkzUSJcYwXdZAiM45BEaQa7WEoxyBvjBc4u1QevABK X-Received: by 2002:a05:6a00:886:b0:63d:5de3:b3f2 with SMTP id q6-20020a056a00088600b0063d5de3b3f2mr10187427pfj.18.1682715393096; Fri, 28 Apr 2023 13:56:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682715393; cv=none; d=google.com; s=arc-20160816; b=UX8gm2Q7f6Tw7EoeXuMO37K558GzY6EazVIxv0n/cM4mOUl5GXqBFDlk4NJzwXl4FC Pwq8ddv9avxsrNrlbJhDE7/QbFKNhGFc0t7o14UpEEhciLHcXV5vUx3DDd0J6sd04via SXNuDnIn5AuJ7733ZrPzSZBA9JYU/PXt5/M15kmG189FrrVI1P3nDO2I0FDPYNlm6Ios 2QceVfnAxJjHO9r4OxU50FpLoTvlgu3E+Huifhdd/wP2W8Dfdrm1GEd2h797ghA9OzP2 bNEo12GzngynQoH299XRgDvvoN7tQRgSfXjdFwjKwseLsjElc8PoXJtRj9arPMyGOyOu JsNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=yF8zsXzWzQEkzm545WTwN17yCV34GZXODAyCp2SrfpQ=; b=TEWAWW7dTHoFJ9MMs3C9LfDJs19S6yV4f6oTEeD55u3UjBkRvlwKcVhSBja48rSiG5 PHTWJ9stKzjmR4MkHP93r+xfKM7LQ67VEL00ybNr37RoOvBlbgmNh6MCWda3JpvFnAx+ YbRFDqFDKvyWQKJfc6tYfzkxNKy591p7ggTf6Oh7nC2k5Wm5hqGPWmPU7stV93ArzTNL P4a5pk9wD9pz/busiZIFInEbqwdHd8aDut3YXZkxK9/G4nVuO//ncnmeoZ9H0wJngJN3 hHl4GcDlQ+q9HQE78JXSU1Q3+9HauNcHcs0gTnXOVJ4Tv6OM4lDh2aOLicuD+IIc8QDP JM2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=T1Qu8B7P; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v64-20020a638943000000b00513f070aa97si23122098pgd.832.2023.04.28.13.56.23; Fri, 28 Apr 2023 13:56:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@candelatech.com header.s=default header.b=T1Qu8B7P; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=candelatech.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346746AbjD1UuP (ORCPT + 62 others); Fri, 28 Apr 2023 16:50:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346739AbjD1UuL (ORCPT ); Fri, 28 Apr 2023 16:50:11 -0400 Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43938422C for ; Fri, 28 Apr 2023 13:50:10 -0700 (PDT) X-Virus-Scanned: Proofpoint Essentials engine Received: from mail3.candelatech.com (mail2.candelatech.com [208.74.158.173]) by mx1-us1.ppe-hosted.com (PPE Hosted ESMTP Server) with ESMTP id 95D2B10006E for ; Fri, 28 Apr 2023 20:50:07 +0000 (UTC) Received: from ben-dt5.candelatech.com (50-251-239-81-static.hfc.comcastbusiness.net [50.251.239.81]) by mail3.candelatech.com (Postfix) with ESMTP id 2663413C2B4; Fri, 28 Apr 2023 13:50:07 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 mail3.candelatech.com 2663413C2B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=candelatech.com; s=default; t=1682715007; bh=FHmGUQZAyB2eVrcYTkl622ztuQ6UFsn9zy3AvPM4VtI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T1Qu8B7PTv9o6pTPCVZFcZ2wCdRNZ6rB8J4bDIl+VX1VqmFikZe4xHHlckh4hElqb ZG+i3IjC9GrE51i1sGJ63hv2BNoW7ie+XwluwfGsz/M6U0cc3WV+dWWvmNjUZ9Lg5A D5NQjyTnQXJgmtFmMpkBR7+G0B1ruYzjxcq2coLc= From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: Ben Greear Subject: [PATCH 4/6] wifi: mt76: mt7915: Adjust MDP_RCFR1 in monitor mode. Date: Fri, 28 Apr 2023 13:49:58 -0700 Message-Id: <20230428205000.2647945-4-greearb@candelatech.com> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230428205000.2647945-1-greearb@candelatech.com> References: <20230428205000.2647945-1-greearb@candelatech.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-MDID: 1682715008-gL8F3DMtOtOl X-MDID-O: us5;ut7;1682715008;gL8F3DMtOtOl;;f7146c1849a4b08a52804beb1c1cdf45 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Ben Greear Request to pass some otherwise dropped frames to host when in monitor mode. Change initialization logic to use a better name (but values actually set in the register during init does not change) Signed-off-by: Ben Greear --- drivers/net/wireless/mediatek/mt76/mt7915/init.c | 4 ++-- drivers/net/wireless/mediatek/mt76/mt7915/main.c | 9 +++++++++ drivers/net/wireless/mediatek/mt76/mt7915/regs.h | 6 ++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/init.c b/drivers/net/wireless/mediatek/mt76/mt7915/init.c index bea75615872f..cd98a1e1e63c 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c @@ -469,8 +469,8 @@ mt7915_mac_init_band(struct mt7915_dev *dev, u8 band) MT_MDP_RCFR1_RX_DROPPED_UCAST | MT_MDP_RCFR1_RX_DROPPED_MCAST; set = FIELD_PREP(MT_MDP_RCFR1_MCU_RX_BYPASS, MT_MDP_TO_HIF) | - FIELD_PREP(MT_MDP_RCFR1_RX_DROPPED_UCAST, MT_MDP_TO_HIF) | - FIELD_PREP(MT_MDP_RCFR1_RX_DROPPED_MCAST, MT_MDP_TO_HIF); + FIELD_PREP(MT_MDP_RCFR1_RX_DROPPED_UCAST, MT_MDP_PFD_DROP) | + FIELD_PREP(MT_MDP_RCFR1_RX_DROPPED_MCAST, MT_MDP_PFD_DROP); mt76_rmw(dev, MT_MDP_BNRCFR1(band), mask, set); mt76_rmw_field(dev, MT_DMA_DCR0(band), MT_DMA_DCR0_MAX_RX_LEN, 0x680); diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c index fec30cf26855..64c14fc303a2 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c +++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c @@ -566,6 +566,9 @@ static void __mt7915_configure_filter(struct ieee80211_hw *hw, u32 flags = 0; bool is_promisc = *total_flags & FIF_CONTROL || phy->monitor_vif || phy->monitor_enabled; + u32 mdp_rcfr1_mask = MT_MDP_RCFR1_RX_DROPPED_UCAST | + MT_MDP_RCFR1_RX_DROPPED_MCAST; + u32 mdp_rcfr1_set; #define MT76_FILTER(_flag, _hw) do { \ flags |= *total_flags & FIF_##_flag; \ @@ -610,11 +613,17 @@ static void __mt7915_configure_filter(struct ieee80211_hw *hw, mt76_set(dev, MT_WF_RMAC_TOP_TF_PARSER(band), MT_WF_RMAC_TOP_TF_SNIFFER); mt7915_check_apply_monitor_config(phy); + + mdp_rcfr1_set = FIELD_PREP(MT_MDP_RCFR1_RX_DROPPED_UCAST, MT_MDP_PFD_TO_HIF) | + FIELD_PREP(MT_MDP_RCFR1_RX_DROPPED_MCAST, MT_MDP_PFD_TO_HIF); } else { mt76_set(dev, MT_WF_RFCR1(band), ctl_flags); mt76_clear(dev, MT_WF_RMAC_TOP_TF_PARSER(band), MT_WF_RMAC_TOP_TF_SNIFFER); + mdp_rcfr1_set = FIELD_PREP(MT_MDP_RCFR1_RX_DROPPED_UCAST, MT_MDP_PFD_DROP) | + FIELD_PREP(MT_MDP_RCFR1_RX_DROPPED_MCAST, MT_MDP_PFD_DROP); } + mt76_rmw(dev, MT_MDP_BNRCFR1(band), mdp_rcfr1_mask, mdp_rcfr1_set); } static void mt7915_configure_filter(struct ieee80211_hw *hw, diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/regs.h b/drivers/net/wireless/mediatek/mt76/mt7915/regs.h index 252e5f1405cf..db81c9902832 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7915/regs.h +++ b/drivers/net/wireless/mediatek/mt76/mt7915/regs.h @@ -189,6 +189,12 @@ enum offs_rev { #define MT_MDP_RCFR1_RX_DROPPED_MCAST GENMASK(30, 29) #define MT_MDP_TO_HIF 0 #define MT_MDP_TO_WM 1 +/* For UCDP2MH, BMCDP2MH in RCFR1 */ +#define MT_MDP_PFD_DROP 0 +#define MT_MDP_PFD_TO_MCU 1 +#define MT_MDP_PFD_TO_HIF 2 +#define MT_MDP_PFD_TO_HIF2 3 + /* TRB: band 0(0x820e1000), band 1(0x820f1000) */ #define MT_WF_TRB_BASE(_band) ((_band) ? 0x820f1000 : 0x820e1000) -- 2.40.0