JODY-W2 - System integration manual
UBX-18068879 - R14
Software
Page 57 of 84
C1 - Public
3.12
Driver debugging
Driver debugging is provided through the kernel print function
printk
and the
proc
file system. The
driver states are recorded and can be retrieved through the proc file system during runtime. The
following files containing the debug information are provided (the actual location is dependent on the
Linux kernel version):
•
/proc/mwlan/config or /proc/net/mwlan/config
•
/proc/mwlan/mlanX/info or /proc/net/mwlan/mlanX/info
•
/proc/mwlan/mlanX/debug or /proc/net/mwlan/mlanX/debug
☞
mlanX is the name of the device node created at runtime. Other possibilities are uapX and wfdX
for the access point and Wi-Fi Direct interfaces respectively.
The debug messages are also printed to the kernel ring buffer through printk calls. These messages
can be accessed using the
/proc/kmsg
interface or by the
dmesg
command. Alternatively, this can also
be handled by more advanced logging facilities.
Compile-time debug options
The extent to which the debug messages are available to be printed at runtime is controlled by the
CONFIG_DEBUG
variable in the driver
makefile
. The
CONFIG_DEBUG
variable can have the following values:
•
n: Debug messages are disabled and not compiled into the driver module
•
1: All kinds of debug messages can be configured except for
MENTRY
,
MWARN
and
MINFO
. By default,
MMSG
,
MFATAL
and
MERROR
are enabled.
•
2: All kinds of debug messages can be configured
Runtime debug options
Once debugging is enabled in the
makefile
, debug messages can be selectively enabled or disabled at
runtime by setting or clearing the corresponding bits of the
drvdbg
parameter:
The value of
drvdbg
can be given as a module parameter when the driver is loaded, by writing to the
proc file system’s
debug
file or by setting it through the
iwpriv
or
mlanutl
tool.
bit 0: MMSG PRINTM(MMSG,...)
bit 1: MFATAL PRINTM(MFATAL,...)
bit 2: MERROR PRINTM(MERROR,...)
bit 3: MDATA PRINTM(MDATA,...)
bit 4: MCMND PRINTM(MCMND,...)
bit 5: MEVENT PRINTM(MEVENT,...)
bit 6: MINTR PRINTM(MINTR,...)
bit 7: MIOCTL PRINTM(MIOCTL,...)
...
bit 16: MDAT_D PRINTM(MDAT_D,...), DBG_HEXDUMP(MDAT_D,...)
bit 17: MCMD_D PRINTM(MCMD_D,...), DBG_HEXDUMP(MCMD_D,...)
bit 18: MEVT_D PRINTM(MEVT_D,...), DBG_HEXDUMP(MEVT_D,...)
bit 19: MFW_D PRINTM(MFW_D,...), DBG_HEXDUMP(MFW_D,...)
bit 20: MIF_D PRINTM(MIF_D,...), DBG_HEXDUMP(MIF_D,...)
...
bit 28: MENTRY PRINTM(MENTRY,...), ENTER(), LEAVE()
bit 29: MWARN PRINTM(MWARN,...)
bit 30: MINFO PRINTM(MINFO,...)
iwpriv mlan0 drvdbg # Get the current driver debug mask
iwpriv mlan0 drvdbg 0 # Disable all debug messages
echo "drvdbg=0x7" > /proc/mwlan/mlan0/debug # enable MMSG, MFATAL and MERROR
mlanutl mlan0 drvdbg -1 # Enable all debug messages