All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] wifi: mt76: mt7915: fix tlv length of mt7915_mcu_get_chan_mib_info
@ 2023-07-26 18:35 Ryder Lee
  2023-07-26 18:35 ` [PATCH 2/2] wifi: mt76: mt7915: fix power-limits while chan_switch Ryder Lee
  0 siblings, 1 reply; 2+ messages in thread
From: Ryder Lee @ 2023-07-26 18:35 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless
  Cc: Lorenzo Bianconi, Shayne Chen, Evelyn Tsai, linux-mediatek, Ryder Lee

Correct per-device TLV lengths to avoid invalid operation in firmware.
(  64.040375:28:STATS-E)statsGetSingleHWCounter: MIB counter index = 65472 not supported.
This happens on mt7916/mt7986.

Fixes: b0bfa00595be ("wifi: mt76: mt7915: improve accuracy of time_busy calculation")
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/mcu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
index bb8ec0d1d01c..a318487c1e84 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/mcu.c
@@ -3035,7 +3035,7 @@ int mt7915_mcu_get_chan_mib_info(struct mt7915_phy *phy, bool chan_switch)
 	}
 
 	ret = mt76_mcu_send_and_get_msg(&dev->mt76, MCU_EXT_CMD(GET_MIB_INFO),
-					req, sizeof(req), true, &skb);
+					req, len * sizeof(req[0]), true, &skb);
 	if (ret)
 		return ret;
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH 2/2] wifi: mt76: mt7915: fix power-limits while chan_switch
  2023-07-26 18:35 [PATCH 1/2] wifi: mt76: mt7915: fix tlv length of mt7915_mcu_get_chan_mib_info Ryder Lee
@ 2023-07-26 18:35 ` Ryder Lee
  0 siblings, 0 replies; 2+ messages in thread
From: Ryder Lee @ 2023-07-26 18:35 UTC (permalink / raw)
  To: Felix Fietkau, linux-wireless
  Cc: Lorenzo Bianconi, Shayne Chen, Evelyn Tsai, linux-mediatek,
	Ryder Lee, Allen Ye

If user changes the channel without completely disabling the interface the
txpower_sku values reported track the old channel the device was operating on.
If user bounces the interface the correct power tables are applied.

mt7915_sku_group_len array gets updated before the channel switch happens so it
uses data from the old channel.

Fixes: ecb187a74e18 ("mt76: mt7915: rework the flow of txpower setting")
Fixes: f1d962369d56 ("mt76: mt7915: implement HE per-rate tx power support")
Reported-By: Chad Monroe <chad.monroe@smartrg.com>
Tested-by: Chad Monroe <chad.monroe@smartrg.com>
Signed-off-by: Allen Ye <allen.ye@mediatek.com>
Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
---
 drivers/net/wireless/mediatek/mt76/mt7915/main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7915/main.c b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
index db3fc74f0f49..f8d6323bd42d 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c
@@ -470,7 +470,8 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
 		ieee80211_wake_queues(hw);
 	}
 
-	if (changed & IEEE80211_CONF_CHANGE_POWER) {
+	if (changed & (IEEE80211_CONF_CHANGE_POWER |
+		       IEEE80211_CONF_CHANGE_CHANNEL)) {
 		ret = mt7915_mcu_set_txpower_sku(phy);
 		if (ret)
 			return ret;
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-26 18:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-26 18:35 [PATCH 1/2] wifi: mt76: mt7915: fix tlv length of mt7915_mcu_get_chan_mib_info Ryder Lee
2023-07-26 18:35 ` [PATCH 2/2] wifi: mt76: mt7915: fix power-limits while chan_switch Ryder Lee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.