Merge pull request #115 from NomDeTom/irate/debug-logging

Keep patch-table entries and dropped 4-address frame dumps behind the driver's aicwf_dbg_level DEBUG bit, with concise summaries at INFO. Consolidate the documentation around the Radxa-aligned ERROR-only defaults, including runtime and startup diagnostic settings and restoration.

Validation: all three integrated modules build against Linux 6.17 headers. No additional hardware testing was performed for this integration.
This commit is contained in:
MinQ authored and GitHub committed 2026-10-23 17:29:57 +08:00
commit f9ab418223
5 files changed
+38 -5

No files matched your search

+11 -1
View File
@@ -191,6 +191,17 @@ Both `aic8800_fdrv` and `aic_load_fw` default to `aicwf_dbg_level=1`
This changes the driver's log mask; it does not remove the detailed log
statements or suppress direct `printk()` / `dev_err()` output.
Enabling INFO (`0x2`) adds concise Wi-Fi diagnostics:
- A firmware patch-table summary with the file name and number of entries written.
- For builds without `CONFIG_SUPPORT_4ADDR`, a count of dropped 4-address frames:
the first at once, then at most once a minute as more frames arrive.
These routine summaries are hidden at the ERROR-only default. DEBUG (`0x8`)
adds each patch-table entry and each dropped 4-address frame, including its
hex dump. Both use `aicwf_dbg_level`; kernel dynamic debug support and a
module rebuild are not required. Existing error reports retain `LOGERROR`.
Some chip-revision, firmware-version and initialization messages use
`LOGINFO`. Enable detailed logging before reproducing a startup failure or
checking `chip_mcu_id` for branch selection. Messages suppressed earlier
@@ -283,4 +294,3 @@ The Wi-Fi-reset recovery behavior tracked in
[issue #53](https://github.com/shenmintao/aic8800d80/issues/53) remains a known
limitation: after an airplane-mode or hotspot reset, Bluetooth may require a
physical unplug/replug of the adapter.
@@ -176,16 +176,21 @@ int aicwf_plat_patch_table_load_8800d80n(struct rwnx_hw *rwnx_hw)
AICWFDBG(LOGINFO, "tbl size = %d \n", size);
if (!err) {
int written = 0;
for (i = 0; i < (size / 4); i += 2) {
if ((dst[i] == 0x0) || (dst[i] == 0xFFFFFFFF)) {
break; // end of tbl
}
AICWFDBG(LOGERROR, "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]);
if (!err)
written++;
}
if (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) {
@@ -2748,13 +2748,18 @@ int aicwf_patch_table_load(struct rwnx_hw *rwnx_hw, char *filename)
}
if (!err && (i < size)) {
int written = 0;
for (i =(128/4); i < (size/4); i +=2) {
AICWFDBG(LOGERROR, "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]);
if (!err)
written++;
}
if (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) {
+4
View File
@@ -935,6 +935,10 @@ struct rwnx_hw {
ktime_t last_time;
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);
+11 -2
View File
@@ -2427,8 +2427,17 @@ check_len_update:
#ifndef CONFIG_SUPPORT_4ADDR
if (hw_rxhdr->flags_is_4addr) {
dev_err(rwnx_hw->dev, "4addr Frame received (%d), skb->len:%u\n", hw_rxhdr->flags_vif_idx, skb->len);
print_hex_dump(KERN_ERR,"4addr ",DUMP_PREFIX_NONE, 16, 1, skb->data, skb->len, false);
rwnx_hw->fouraddr_dropped++;
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);
goto end;
}