diff --git a/README.md b/README.md index c5e3546..fb35b95 100644 --- a/README.md +++ b/README.md @@ -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. - diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800d80n.c b/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800d80n.c index c737b37..9995af3 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800d80n.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800d80n.c @@ -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) { diff --git a/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800dc.c b/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800dc.c index 8cfd915..b622382 100644 --- a/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800dc.c +++ b/drivers/aic8800/aic8800_fdrv/aicwf_compat_8800dc.c @@ -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) { diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_defs.h b/drivers/aic8800/aic8800_fdrv/rwnx_defs.h index 3363bcc..1a38654 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_defs.h +++ b/drivers/aic8800/aic8800_fdrv/rwnx_defs.h @@ -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); diff --git a/drivers/aic8800/aic8800_fdrv/rwnx_rx.c b/drivers/aic8800/aic8800_fdrv/rwnx_rx.c index 6287682..2e6bd64 100644 --- a/drivers/aic8800/aic8800_fdrv/rwnx_rx.c +++ b/drivers/aic8800/aic8800_fdrv/rwnx_rx.c @@ -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; }