Patch "wifi: mac80211_hwsim: fix debugfs attribute ps with rc table support" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    wifi: mac80211_hwsim: fix debugfs attribute ps with rc table support

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     wifi-mac80211_hwsim-fix-debugfs-attribute-ps-with-rc.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3680ea324b9e9b5bc98d57b4399a1fbb750f298f
Author: Jonas Jelonek <jelonek.jonas@xxxxxxxxx>
Date:   Fri Oct 14 16:54:39 2022 +0200

    wifi: mac80211_hwsim: fix debugfs attribute ps with rc table support
    
    [ Upstream commit 69188df5f6e4cecc6b76b958979ba363cd5240e8 ]
    
    Fixes a warning that occurs when rc table support is enabled
    (IEEE80211_HW_SUPPORTS_RC_TABLE) in mac80211_hwsim and the PS mode
    is changed via the exported debugfs attribute.
    
    When the PS mode is changed, a packet is broadcasted via
    hwsim_send_nullfunc by creating and transmitting a plain skb with only
    header initialized. The ieee80211 rate array in the control buffer is
    zero-initialized. When ratetbl support is enabled, ieee80211_get_tx_rates
    is called for the skb with sta parameter set to NULL and thus no
    ratetbl can be used. The final rate array then looks like
    [-1,0; 0,0; 0,0; 0,0] which causes the warning in ieee80211_get_tx_rate.
    
    The issue is fixed by setting the count of the first rate with idx '0'
    to 1 and hence ieee80211_get_tx_rates won't overwrite it with idx '-1'.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas@xxxxxxxxx>
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 3a3a5a570694..f80b1d57d6c3 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -663,6 +663,7 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,
 	struct hwsim_vif_priv *vp = (void *)vif->drv_priv;
 	struct sk_buff *skb;
 	struct ieee80211_hdr *hdr;
+	struct ieee80211_tx_info *cb;
 
 	if (!vp->assoc)
 		return;
@@ -684,6 +685,10 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,
 	memcpy(hdr->addr2, mac, ETH_ALEN);
 	memcpy(hdr->addr3, vp->bssid, ETH_ALEN);
 
+	cb = IEEE80211_SKB_CB(skb);
+	cb->control.rates[0].count = 1;
+	cb->control.rates[1].idx = -1;
+
 	rcu_read_lock();
 	mac80211_hwsim_tx_frame(data->hw, skb,
 				rcu_dereference(vif->chanctx_conf)->def.chan);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux