From: greearb@candelatech.com
To: linux-wireless@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>
Subject: [PATCH 4/6] wifi: mt76: mt7915: Adjust MDP_RCFR1 in monitor mode.
Date: Fri, 28 Apr 2023 13:49:58 -0700 [thread overview]
Message-ID: <20230428205000.2647945-4-greearb@candelatech.com> (raw)
In-Reply-To: <20230428205000.2647945-1-greearb@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
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 <greearb@candelatech.com>
---
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
next prev parent reply other threads:[~2023-04-28 20:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 20:49 [PATCH 1/6] wifi: mt76: mt7915: Support vht mu-mimo sniffer feature greearb
2023-04-28 20:49 ` [PATCH 2/6] wifi: mt76: mt7915: Move rxfilter logic into central location greearb
2023-04-28 21:39 ` Ryder Lee
2023-04-28 20:49 ` [PATCH 3/6] wifi: mt76: mt7915: Support setting aid when in monitor mode greearb
2023-04-28 21:59 ` Ryder Lee
2023-04-28 20:49 ` greearb [this message]
2023-04-28 20:49 ` [PATCH 5/6] wifi: mt76: mt7915: Improve monitor-mode flags settings greearb
2023-04-28 21:48 ` Ryder Lee
2023-04-28 22:06 ` Ben Greear
2023-04-29 2:33 ` Ryder Lee
2023-04-29 14:42 ` Ben Greear
2023-04-30 18:02 ` Ryder Lee
2023-04-28 20:50 ` [PATCH 6/6] wifi: mt76: mt7915: support enabling rx group-5 status greearb
2023-04-28 21:17 ` [PATCH 1/6] wifi: mt76: mt7915: Support vht mu-mimo sniffer feature Ryder Lee
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230428205000.2647945-4-greearb@candelatech.com \
--to=greearb@candelatech.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).