summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2024-05-26 19:34:45 +0100
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>2025-04-04 15:29:08 +0100
commitc405c0b577fb4627c11cf6145c05e95debe4d66b (patch)
tree8bb870f9ea79d7b53590e4838f8ee29ffb3a993b
parent270eab0a7439421b981cfafb0af81d4dd6f7c4df (diff)
net: wlcore: dump firmware queued packets
Dump some information about the firmware queued packets that have not flushed. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/wireless/ti/wlcore/debugfs.c11
-rw-r--r--drivers/net/wireless/ti/wlcore/tx.c36
2 files changed, 41 insertions, 6 deletions
diff --git a/drivers/net/wireless/ti/wlcore/debugfs.c b/drivers/net/wireless/ti/wlcore/debugfs.c
index 9432aeb4902e..effd81e9f6cc 100644
--- a/drivers/net/wireless/ti/wlcore/debugfs.c
+++ b/drivers/net/wireless/ti/wlcore/debugfs.c
@@ -423,7 +423,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
char *buf;
struct wl12xx_vif *wlvif;
-#define DRIVER_STATE_BUF_LEN 2048
+#define DRIVER_STATE_BUF_LEN 4096
buf = kmalloc(DRIVER_STATE_BUF_LEN, GFP_KERNEL);
if (!buf)
@@ -511,6 +511,7 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
{
struct wl1271_tx_hw_descr *tx_desc;
+ struct ieee80211_hdr *hdr;
struct sk_buff *skb;
u32 start, end;
u16 lt;
@@ -522,13 +523,17 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
continue;
tx_desc = (struct wl1271_tx_hw_descr *)skb->data;
+ hdr = (void *)(tx_desc + 1);
start = le32_to_cpu(tx_desc->start_time);
lt = le16_to_cpu(tx_desc->life_time);
end = start + 1024 * lt;
res += scnprintf(buf + res, DRIVER_STATE_BUF_LEN - res,
- "tx_frames[%2u] hlid = %2u st %10u lt %u et %10u\n",
- id, tx_desc->hlid, start, lt, end);
+ "tx_frames[%2u] hlid %2u st %10u lt %u et %10u SA %pM DA %pM FC %04x\n",
+ id, tx_desc->hlid, start, lt, end,
+ ieee80211_get_SA(hdr),
+ ieee80211_get_DA(hdr),
+ hdr->frame_control);
}
}
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index 9d6b5115db09..3a5b3fad028f 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -1221,9 +1221,39 @@ void wl1271_tx_flush_sta(struct wl1271 *wl, struct ieee80211_sta *sta)
mutex_lock(&wl->mutex);
}
- if (frames_queued)
- wl1271_warning("Unable to flush all frames for station %pM\n",
- sta->addr);
+ if (frames_queued) {
+ dev_warn(wl->dev,
+ "Unable to flush all frames for station %pM hlid %u\n",
+ sta->addr, hlid);
+ dev_warn(wl->dev, "FW time: %u", wl->fw_status->fw_localtime);
+
+ for (i = 0; i < WLCORE_MAX_TX_DESCRIPTORS; i++) {
+ struct wl1271_tx_hw_descr *desc;
+ struct ieee80211_hdr *hdr;
+ struct sk_buff *skb;
+ u32 start;
+ u16 lt;
+
+ skb = wl->tx_frames[i];
+ if (!skb)
+ continue;
+
+ desc = (struct wl1271_tx_hw_descr *)skb->data;
+ if (desc->hlid != hlid)
+ continue;
+
+ /* The IEEE 802.11 header follows the TX descriptor */
+ hdr = (void *)(desc + 1);
+
+ start = le32_to_cpu(desc->start_time);
+ lt = le16_to_cpu(desc->life_time);
+
+ dev_warn(wl->dev,
+ " Frame %d: expires %u MAC %pM FC 0x%04x\n",
+ i, start + 1024 * lt,
+ hdr->addr1, hdr->frame_control);
+ }
+ }
mutex_unlock(&wl->mutex);
}