Disable ath0 (wlan) console messages

I redirected most of the console messages to /var/log/console.log but the WLAN message seems does not honor /etc/syslog.conf.
I am still and only getting console messages like "ath0: bb hang detected (0x4), resetting". Is there any way to redirect or suppress them?
 
I am not very familiar with FreeBSD's code. Does it cause any problem?
The following assumes you're running 12.1-RELEASE-p9; for 11.x, the line numbers may be different!
  • Any change, no matter how small, can cause unforseen damage...
  • IMHO the risk is so small that I would try to get rid of it if it bugs me; YMMV.
  • When you run a custom or patched kernel, any changes will be overwritten by freebsd-update(8). Thus you have to save your patch & apply it again after each update:
  1. Prepare your patch: optionally create a new boot environment: beadm create patch and beadm activate patch, reboot.
  2. cd /usr/src, then mv sys/dev/ath/if_ath.c{,.orig}
  3. cp sys/dev/ath/if_ath.c{.orig,}
  4. Edit the desired behaviour: change line 2494 to DPRINTF(sc, ATH_DEBUG_BEACON,
  5. Save your patch: diff -U 5 sys/dev/ath/if_ath.c{.orig,} > ~/quite_ath.patch
  6. Not now, but after each update (freebsd-update(8) will update the source tree if it's installed):
    patch --dry-run -d /usr/src < ~/quite_ath.patch
  7. Build & install your patched kernel: \nohup nice make -C /usr/src {build,install}kernel & and less nohup.out (press G F to follow the build messages flying in, or use sysutils/most, there it's B F)
  8. If it does not work as expected (or doesn't boot at all), boot from kernel.old or switch to your previous boot environment.
Then you should be able to switch that mesage on/off via wlandebug(8) or sysctl dev.ath.0.debug. If it works, consider to file in a bug report, append your patch (also inline in the text of the bug report), and kindly ask the developer to apply such changes for all printf(3)()s, e.g. use a macro IPRINTF() (info printf) like DPRINTF() that can be switched on/off via a sysctl(8) knob dev.<driver>.<num>.info à la dev.<driver>.<num>.debug.
Happy hacking!
 
Back
Top