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

Felix Fietkau nbd at nbd.name
Wed Dec 1 04:40:26 PST 2021


On 2021-11-23 08:49, Bo Jiao wrote:
> 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) {
	...
}



More information about the Linux-mediatek mailing list