mirror of
https://github.com/shenmintao/aic8800d80.git
synced 2026-11-10 16:49:17 +00:00
fix(usb): a short summary by default, the detail at debug level, both by aicwf_dbg_level
From review (shenmintao/aic8800d80#115): the default log keeps enough to read a first bug report. - The patch table: each entry at LOGDEBUG, as before this series' first change; one line at LOGINFO (the default) with the file and the number of entries written; a failure at LOGERROR, as before. - 4-address frames dropped by a build without CONFIG_SUPPORT_4ADDR: counted per device and said at LOGINFO, the first at once and then at most once a minute; each frame and its dump at LOGDEBUG, by aicwf_dbg_level, in place of dev_dbg() and print_hex_dump_debug(), which need dynamic debug or DEBUG and were compiled out otherwise. - The README says how to turn the detail on and off, at run time and before the driver loads (the patch table is written when the adapter starts).
This commit is contained in:
1 parent
188be4589c
commit
97f8077fd7
5 files changed
+54
-2
No files matched your search
@@ -229,3 +229,32 @@ The Wi-Fi-reset recovery behavior tracked in
|
|||||||
limitation: after an airplane-mode or hotspot reset, Bluetooth may require a
|
limitation: after an airplane-mode or hotspot reset, Bluetooth may require a
|
||||||
physical unplug/replug of the adapter.
|
physical unplug/replug of the adapter.
|
||||||
|
|
||||||
|
|
||||||
|
### Debug Logging
|
||||||
|
|
||||||
|
The Wi-Fi driver's log is set by its `aicwf_dbg_level` parameter, a mask. The default, `0x203`, logs errors
|
||||||
|
(`0x1`), information (`0x2`) and firmware messages (`0x200`). Add `0x8` for debug detail: `0x20b`.
|
||||||
|
|
||||||
|
At the default level the log keeps a summary of what is routine:
|
||||||
|
|
||||||
|
- the firmware patch table: one line with the number of entries written, and any failure;
|
||||||
|
- 4-address frames that a build without `CONFIG_SUPPORT_4ADDR` drops: the first at once, then a count at most
|
||||||
|
once a minute.
|
||||||
|
|
||||||
|
With `0x8` it also logs each patch-table entry, and each dropped 4-address frame with a dump of it.
|
||||||
|
|
||||||
|
To set it for the running driver (back to the default with `0x203`):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo 0x20b | sudo tee /sys/module/aic8800_fdrv/parameters/aicwf_dbg_level
|
||||||
|
```
|
||||||
|
|
||||||
|
The patch table is written when the adapter starts, so to log its entries, set the level before the driver loads,
|
||||||
|
then load it or plug the adapter in:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
echo 'options aic8800_fdrv aicwf_dbg_level=0x20b' | sudo tee /etc/modprobe.d/aic8800-debug.conf
|
||||||
|
sudo modprobe -r aic8800_fdrv && sudo modprobe aic8800_fdrv
|
||||||
|
```
|
||||||
|
|
||||||
|
Remove that file to go back to the default at the next load.
|
||||||
@@ -176,16 +176,21 @@ int aicwf_plat_patch_table_load_8800d80n(struct rwnx_hw *rwnx_hw)
|
|||||||
AICWFDBG(LOGINFO, "tbl size = %d \n", size);
|
AICWFDBG(LOGINFO, "tbl size = %d \n", size);
|
||||||
|
|
||||||
if (!err) {
|
if (!err) {
|
||||||
|
int written = 0;
|
||||||
|
|
||||||
for (i = 0; i < (size / 4); i += 2) {
|
for (i = 0; i < (size / 4); i += 2) {
|
||||||
if ((dst[i] == 0x0) || (dst[i] == 0xFFFFFFFF)) {
|
if ((dst[i] == 0x0) || (dst[i] == 0xFFFFFFFF)) {
|
||||||
break; // end of tbl
|
break; // end of tbl
|
||||||
}
|
}
|
||||||
AICWFDBG(LOGDEBUG, "patch_tbl: %x %x\n", dst[i], dst[i+1]);
|
AICWFDBG(LOGDEBUG, "patch_tbl: %x %x\n", dst[i], dst[i+1]);
|
||||||
err = rwnx_send_dbg_mem_write_req(rwnx_hw, dst[i], dst[i+1]);
|
err = rwnx_send_dbg_mem_write_req(rwnx_hw, dst[i], dst[i+1]);
|
||||||
|
if (!err)
|
||||||
|
written++;
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
AICWFDBG(LOGERROR, "tbl bin upload fail: %x, err:%d\r\n", dst[i], err);
|
AICWFDBG(LOGERROR, "tbl bin upload fail: %x, err:%d\r\n", dst[i], err);
|
||||||
}
|
}
|
||||||
|
AICWFDBG(LOGINFO, "patch_tbl: %s: %d entries written (each at debug level)\n", filename, written);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst) {
|
if (dst) {
|
||||||
|
|||||||
@@ -2748,13 +2748,18 @@ int aicwf_patch_table_load(struct rwnx_hw *rwnx_hw, char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!err && (i < size)) {
|
if (!err && (i < size)) {
|
||||||
|
int written = 0;
|
||||||
|
|
||||||
for (i =(128/4); i < (size/4); i +=2) {
|
for (i =(128/4); i < (size/4); i +=2) {
|
||||||
AICWFDBG(LOGDEBUG, "patch_tbl: %x %x\n", dst[i], dst[i+1]);
|
AICWFDBG(LOGDEBUG, "patch_tbl: %x %x\n", dst[i], dst[i+1]);
|
||||||
err = rwnx_send_dbg_mem_write_req(rwnx_hw, dst[i], dst[i+1]);
|
err = rwnx_send_dbg_mem_write_req(rwnx_hw, dst[i], dst[i+1]);
|
||||||
|
if (!err)
|
||||||
|
written++;
|
||||||
}
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
AICWFDBG(LOGERROR, "bin upload fail: %x, err:%d\r\n", dst[i], err);
|
AICWFDBG(LOGERROR, "bin upload fail: %x, err:%d\r\n", dst[i], err);
|
||||||
}
|
}
|
||||||
|
AICWFDBG(LOGINFO, "patch_tbl: %s: %d entries written (each at debug level)\n", filename, written);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dst) {
|
if (dst) {
|
||||||
|
|||||||
@@ -935,6 +935,10 @@ struct rwnx_hw {
|
|||||||
ktime_t last_time;
|
ktime_t last_time;
|
||||||
char last_alpha2[3];
|
char last_alpha2[3];
|
||||||
|
|
||||||
|
/* 4-address frames dropped (a build without CONFIG_SUPPORT_4ADDR): counted, and said at most once a minute. */
|
||||||
|
unsigned int fouraddr_dropped;
|
||||||
|
unsigned long fouraddr_said;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
u8 *rwnx_build_bcn(struct rwnx_bcn *bcn, struct cfg80211_beacon_data *new);
|
u8 *rwnx_build_bcn(struct rwnx_bcn *bcn, struct cfg80211_beacon_data *new);
|
||||||
|
|||||||
@@ -2427,8 +2427,17 @@ check_len_update:
|
|||||||
|
|
||||||
#ifndef CONFIG_SUPPORT_4ADDR
|
#ifndef CONFIG_SUPPORT_4ADDR
|
||||||
if (hw_rxhdr->flags_is_4addr) {
|
if (hw_rxhdr->flags_is_4addr) {
|
||||||
dev_dbg(rwnx_hw->dev, "4addr Frame received (%d), skb->len:%u\n", hw_rxhdr->flags_vif_idx, skb->len);
|
rwnx_hw->fouraddr_dropped++;
|
||||||
print_hex_dump_debug("4addr ", DUMP_PREFIX_NONE, 16, 1, skb->data, skb->len, false);
|
if (!rwnx_hw->fouraddr_said || time_after(jiffies, rwnx_hw->fouraddr_said + 60 * HZ)) {
|
||||||
|
AICWFDBG(LOGINFO, "4addr frames dropped (this build has no CONFIG_SUPPORT_4ADDR): %u since the last count; "
|
||||||
|
"aicwf_dbg_level with 0x8 (debug) logs each one\n", rwnx_hw->fouraddr_dropped);
|
||||||
|
rwnx_hw->fouraddr_dropped = 0;
|
||||||
|
rwnx_hw->fouraddr_said = jiffies ? jiffies : 1;
|
||||||
|
}
|
||||||
|
if (aicwf_dbg_level & LOGDEBUG) {
|
||||||
|
AICWFDBG(LOGDEBUG, "4addr Frame received (%d), skb->len:%u\n", hw_rxhdr->flags_vif_idx, skb->len);
|
||||||
|
print_hex_dump(KERN_DEBUG, "4addr ", DUMP_PREFIX_NONE, 16, 1, skb->data, skb->len, false);
|
||||||
|
}
|
||||||
dev_kfree_skb(skb);
|
dev_kfree_skb(skb);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user