blob: c17f0f461f672dda8231b98ffe977826aee42f9b [file] [log] [blame]
From 0e87f52e13e654b144c12e3aad968fbc3da5ac1b 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/14] 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 91987bd..4871857 100644
--- a/mt76_connac.h
+++ b/mt76_connac.h
@@ -260,6 +260,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 71e0d55..5d31f5a 100644
--- a/mt7915/main.c
+++ b/mt7915/main.c
@@ -1118,7 +1118,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