Commit 5da5ba7e authored by Ping-Ke Shih's avatar Ping-Ke Shih Committed by Kalle Valo

wifi: rtw89: add use of pkt_list offload to debug entry

Driver can prepare pkt_list for firmware that only uses them to send out
the packets in specific situations. To understand the usage of current
status, and to check if there is leakage problem, dump bitmap and the
indices used by certain function.

An example looks like:

  map:
		...
        pkt_ofld:  3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ...
                [SCAN 0]: 3
                [SCAN 1]: 4
                [SCAN 3]: 5
  VIF [0] xx:xx:xx:xx:xx:xx
		...
        pkt_ofld[GENERAL]: 0 1 2
Signed-off-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230123065401.14174-4-pkshih@realtek.com
parent 5c12bb66
......@@ -3354,6 +3354,31 @@ static void rtw89_dump_addr_cam(struct seq_file *m,
}
}
__printf(3, 4)
static void rtw89_dump_pkt_offload(struct seq_file *m, struct list_head *pkt_list,
const char *fmt, ...)
{
struct rtw89_pktofld_info *info;
struct va_format vaf;
va_list args;
if (list_empty(pkt_list))
return;
va_start(args, fmt);
vaf.va = &args;
vaf.fmt = fmt;
seq_printf(m, "%pV", &vaf);
va_end(args);
list_for_each_entry(info, pkt_list, list)
seq_printf(m, "%d ", info->id);
seq_puts(m, "\n");
}
static
void rtw89_vif_ids_get_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
{
......@@ -3364,6 +3389,7 @@ void rtw89_vif_ids_get_iter(void *data, u8 *mac, struct ieee80211_vif *vif)
seq_printf(m, "VIF [%d] %pM\n", rtwvif->mac_id, rtwvif->mac_addr);
seq_printf(m, "\tbssid_cam_idx=%u\n", bssid_cam->bssid_cam_idx);
rtw89_dump_addr_cam(m, &rtwvif->addr_cam);
rtw89_dump_pkt_offload(m, &rtwvif->general_pkt_list, "\tpkt_ofld[GENERAL]: ");
}
static void rtw89_dump_ba_cam(struct seq_file *m, struct rtw89_sta *rtwsta)
......@@ -3402,6 +3428,7 @@ static int rtw89_debug_priv_stations_get(struct seq_file *m, void *v)
struct rtw89_debugfs_priv *debugfs_priv = m->private;
struct rtw89_dev *rtwdev = debugfs_priv->rtwdev;
struct rtw89_cam_info *cam_info = &rtwdev->cam_info;
u8 idx;
mutex_lock(&rtwdev->mutex);
......@@ -3416,6 +3443,15 @@ static int rtw89_debug_priv_stations_get(struct seq_file *m, void *v)
cam_info->sec_cam_map);
seq_printf(m, "\tba_cam: %*ph\n", (int)sizeof(cam_info->ba_cam_map),
cam_info->ba_cam_map);
seq_printf(m, "\tpkt_ofld: %*ph\n", (int)sizeof(rtwdev->pkt_offload),
rtwdev->pkt_offload);
for (idx = NL80211_BAND_2GHZ; idx < NUM_NL80211_BANDS; idx++) {
if (!(rtwdev->chip->support_bands & BIT(idx)))
continue;
rtw89_dump_pkt_offload(m, &rtwdev->scan_info.pkt_list[idx],
"\t\t[SCAN %u]: ", idx);
}
ieee80211_iterate_active_interfaces_atomic(rtwdev->hw,
IEEE80211_IFACE_ITER_NORMAL, rtw89_vif_ids_get_iter, m);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment