Thread (15 messages) 15 messages, 2 authors, 2021-12-01

Re: [PATCH v3 08/11] mt76: mt7915: update rx rate reporting for mt7916

From: Felix Fietkau <nbd@nbd.name>
Date: 2021-12-01 12:40:32
Also in: linux-mediatek

On 2021-11-23 08:49, Bo Jiao wrote:
quoted hunk ↗ jump to hunk
diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index 057ab27..0650140 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -969,11 +969,14 @@ static void mt7915_sta_statistics(struct ieee80211_hw *hw,
  	struct mt7915_phy *phy = mt7915_hw_phy(hw);
  	struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv;
  	struct rate_info *txrate = &msta->wcid.rate;
-	struct rate_info rxrate = {};
  
-	if (!mt7915_mcu_get_rx_rate(phy, vif, sta, &rxrate)) {
-		sinfo->rxrate = rxrate;
-		sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE);
+	if (is_mt7915(&phy->dev->mt76)) {
+		struct rate_info rxrate = {};
+
+		if (!mt7915_mcu_get_rx_rate(phy, vif, sta, &rxrate)) {
+			sinfo->rxrate = rxrate;
+			sinfo->filled |= BIT_ULL(NL80211_STA_INFO_RX_BITRATE);
+		}
  	}
  
  	if (!txrate->legacy && !txrate->flags)
You can simplify this part by leaving the code as-is and only changing 
the if condition like this:

if (is_mt7915(&phy->dev->mt76) &&
     !mt7915_mcu_get_rx_rate(phy, vif, sta, &rxrate) {
	...
}
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help