blob: 25d2c84a0b5fd6587cc2e865c37d8ecab6a0e8be [file] [log] [blame]
From e8e17022a0af4f32da84885c4920ffebe64469cf Mon Sep 17 00:00:00 2001
From: "Henry.Yen" <henry.yen@mediatek.com>
Date: Mon, 8 Jan 2024 17:19:01 +0800
Subject: [PATCH 08/15] wifi: mt76: mt7915: add support for realtime Rx rate
updates
Add support for realtime Rx rate updates.
Currently, Rx rate is updated according to packet-triggered RxV
parsing flow, i.e., mt76_connac2_mac_fill_rx_rate(). However, whenever
the session enters hardware acceleration, driver layer won't have
any clue about what the current Rx rate is. So we make use of MCU
CMD to obtain Rx rate instead.
Signed-off-by: Henry.Yen <henry.yen@mediatek.com>
---
mt76_connac.h | 6 ++++++
mt7915/main.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/mt76_connac.h b/mt76_connac.h
index 98d64d3d..1be41d66 100644
--- a/mt76_connac.h
+++ b/mt76_connac.h
@@ -255,6 +255,12 @@ static inline bool is_connac_v1(struct mt76_dev *dev)
return is_mt7615(dev) || is_mt7663(dev) || is_mt7622(dev);
}
+static inline bool is_connac_v2(struct mt76_dev *dev)
+{
+ return is_mt7915(dev) || is_mt7916(dev) ||
+ is_mt7981(dev) || is_mt7986(dev);
+}
+
static inline bool is_mt76_fw_txp(struct mt76_dev *dev)
{
switch (mt76_chip(dev)) {
diff --git a/mt7915/main.c b/mt7915/main.c
index dfaee4cc..b84c6664 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1114,7 +1114,7 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
struct rate_info *txrate = &msta->wcid.rate;
struct rate_info rxrate = {};
- if (is_mt7915(&phy->dev->mt76) &&
+ if (is_connac_v2(&phy->dev->mt76) &&
!mt7915_mcu_get_rx_rate(phy, vif, sta, &rxrate)) {
sinfo->rxrate = rxrate;
sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE);
--
2.18.0