wlan-ap-Telecominfraproject/feeds/ipq95xx/mac80211/patches/qca/834-wifi-mac80211-change-BUG_ON-to-conditional-BUG_ON-in.patch
John Crispin 144c5d00f4 ipq95xx/mac80211: update to ATH12.3-CS
Signed-off-by: John Crispin <john@phrozen.org>
2024-02-28 18:56:21 +01:00

62 lines
2.1 KiB
Diff

From 8ad16ba799eba47eb487b3620cb1b188811507c6 Mon Sep 17 00:00:00 2001
From: Hari Chandrakanthan <quic_haric@quicinc.com>
Date: Sun, 24 Sep 2023 12:51:32 +0530
Subject: [PATCH] wifi: mac80211: change BUG_ON to conditional BUG_ON in ieee80211_rx_data_set_sta
change BUG_ON to conditional BUG_ON in ieee80211_rx_data_set_sta
as the link_id < 0 case is hit very often.
Signed-off-by: Hari Chandrakanthan <quic_haric@quicinc.com>
---
net/mac80211/mlme.c | 5 +++++
net/mac80211/rx.c | 10 +++++++---
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 480b516af933..a64323edb3d1 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -66,6 +66,11 @@ module_param(beacon_loss_count, int, 0644);
MODULE_PARM_DESC(beacon_loss_count,
"Number of beacon intervals before we decide beacon was lost.");
+int debug_param = 0;
+module_param(debug_param, int, 0644);
+MODULE_PARM_DESC(debug_param,
+ "Debug module param to debug link id < 0");
+
/*
* Time the connection can be idle before we probe
* it to see if we can still talk to the AP.
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index abbe4aa4606d..17836ee5324f 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -33,6 +33,8 @@
#include "wme.h"
#include "rate.h"
+extern int debug_param;
+
static inline void ieee80211_rx_stats(struct net_device *dev, u32 len)
{
struct pcpu_sw_netstats *tstats = this_cpu_ptr(netdev_tstats(dev));
@@ -4338,9 +4340,11 @@ static bool ieee80211_rx_data_set_sta(struct ieee80211_rx_data *rx,
}
if (link_id < 0) {
- pr_err("link id %d sta addr : %pM", link_id, sta ? sta->addr : NULL);
- print_hex_dump(KERN_ERR, "skb_data : ", DUMP_PREFIX_ADDRESS, 16, 1, rx->skb->data, rx->skb->len, true);
- BUG_ON(1);
+ if (debug_param) {
+ pr_err("link id %d sta addr : %pM", link_id, sta ? sta->addr : NULL);
+ print_hex_dump(KERN_ERR, "skb_data : ", DUMP_PREFIX_ADDRESS, 16, 1, rx->skb->data, rx->skb->len, true);
+ BUG_ON(1);
+ }
rx->link = &rx->sdata->deflink;
} else if (!ieee80211_rx_data_set_link(rx, link_id))
return false;
--
2.7.4