Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) .. include:: <isonum.txt>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3) ====================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4) Driver for the Intel Wireless Wimax Connection 2400m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5) ====================================================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7) :Copyright: |copy| 2008 Intel Corporation < linux-wimax@intel.com >
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)    This provides a driver for the Intel Wireless WiMAX Connection 2400m
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)    and a basic Linux kernel WiMAX stack.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12) 1. Requirements
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13) ===============
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)      * Linux installation with Linux kernel 2.6.22 or newer (if building
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)        from a separate tree)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)      * Intel i2400m Echo Peak or Baxter Peak; this includes the Intel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)        Wireless WiMAX/WiFi Link 5x50 series.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)      * build tools:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)           + Linux kernel development package for the target kernel; to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)             build against your currently running kernel, you need to have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23)             the kernel development package corresponding to the running
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24)             image installed (usually if your kernel is named
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25)             linux-VERSION, the development package is called
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26)             linux-dev-VERSION or linux-headers-VERSION).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27)           + GNU C Compiler, make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) 2. Compilation and installation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30) ===============================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32) 2.1. Compilation of the drivers included in the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33) ------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35)    Configure the kernel; to enable the WiMAX drivers select Drivers >
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36)    Networking Drivers > WiMAX device support. Enable all of them as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)    modules (easier).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)    If USB or SDIO are not enabled in the kernel configuration, the options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)    to build the i2400m USB or SDIO drivers will not show. Enable said
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)    subsystems and go back to the WiMAX menu to enable the drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43)    Compile and install your kernel as usual.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) 2.2. Compilation of the drivers distributed as an standalone module
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) -------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)    To compile::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) 	$ cd source/directory
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) 	$ make
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)    Once built you can load and unload using the provided load.sh script;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)    load.sh will load the modules, load.sh u will unload them.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56)    To install in the default kernel directories (and enable auto loading
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57)    when the device is plugged)::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59) 	$ make install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) 	$ depmod -a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)    If your kernel development files are located in a non standard
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)    directory or if you want to build for a kernel that is not the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)    currently running one, set KDIR to the right location::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66) 	$ make KDIR=/path/to/kernel/dev/tree
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68)    For more information, please contact linux-wimax@intel.com.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 3. Installing the firmware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) --------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73)    The firmware can be obtained from http://linuxwimax.org or might have
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74)    been supplied with your hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)    It has to be installed in the target system::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78) 	$ cp FIRMWAREFILE.sbcf /lib/firmware/i2400m-fw-BUSTYPE-1.3.sbcf
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)      * NOTE: if your firmware came in an .rpm or .deb file, just install
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)        it as normal, with the rpm (rpm -i FIRMWARE.rpm) or dpkg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82)        (dpkg -i FIRMWARE.deb) commands. No further action is needed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83)      * BUSTYPE will be usb or sdio, depending on the hardware you have.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84)        Each hardware type comes with its own firmware and will not work
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85)        with other types.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 4. Design
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) =========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90)    This package contains two major parts: a WiMAX kernel stack and a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91)    driver for the Intel i2400m.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)    The WiMAX stack is designed to provide for common WiMAX control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)    services to current and future WiMAX devices from any vendor; please
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)    see README.wimax for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)    The i2400m kernel driver is broken up in two main parts: the bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)    generic driver and the bus-specific drivers. The bus generic driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)    forms the drivercore and contain no knowledge of the actual method we
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)    use to connect to the device. The bus specific drivers are just the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)    glue to connect the bus-generic driver and the device. Currently only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)    USB and SDIO are supported. See drivers/net/wimax/i2400m/i2400m.h for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)    more information.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105)    The bus generic driver is logically broken up in two parts: OS-glue and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)    hardware-glue. The OS-glue interfaces with Linux. The hardware-glue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107)    interfaces with the device on using an interface provided by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108)    bus-specific driver. The reason for this breakup is to be able to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109)    easily reuse the hardware-glue to write drivers for other OSes; note
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)    the hardware glue part is written as a native Linux driver; no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111)    abstraction layers are used, so to port to another OS, the Linux kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)    API calls should be replaced with the target OS's.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) 5. Usage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)    To load the driver, follow the instructions in the install section;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)    once the driver is loaded, plug in the device (unless it is permanently
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)    plugged in). The driver will enumerate the device, upload the firmware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120)    and output messages in the kernel log (dmesg, /var/log/messages or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)    /var/log/kern.log) such as::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	i2400m_usb 5-4:1.0: firmware interface version 8.0.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	i2400m_usb 5-4:1.0: WiMAX interface wmx0 (00:1d:e1:01:94:2c) ready
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127)    At this point the device is ready to work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)    Current versions require the Intel WiMAX Network Service in userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)    to make things work. See the network service's README for instructions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)    on how to scan, connect and disconnect.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) 5.1. Module parameters
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) ----------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)    Module parameters can be set at kernel or module load time or by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137)    echoing values::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	$ echo VALUE > /sys/module/MODULENAME/parameters/PARAMETERNAME
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141)    To make changes permanent, for example, for the i2400m module, you can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)    also create a file named /etc/modprobe.d/i2400m containing::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) 	options i2400m idle_mode_disabled=1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)    To find which parameters are supported by a module, run::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) 	$ modinfo path/to/module.ko
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)    During kernel bootup (if the driver is linked in the kernel), specify
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151)    the following to the kernel command line::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	i2400m.PARAMETER=VALUE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 5.1.1. i2400m: idle_mode_disabled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)    The i2400m module supports a parameter to disable idle mode. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)    parameter, once set, will take effect only when the device is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)    reinitialized by the driver (eg: following a reset or a reconnect).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) 5.2. Debug operations: debugfs entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) --------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165)    The driver will register debugfs entries that allow the user to tweak
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)    debug settings. There are three main container directories where
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)    entries are placed, which correspond to the three blocks a i2400m WiMAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168)    driver has:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170)      * /sys/kernel/debug/wimax:DEVNAME/ for the generic WiMAX stack
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)        controls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)      * /sys/kernel/debug/wimax:DEVNAME/i2400m for the i2400m generic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)        driver controls
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)      * /sys/kernel/debug/wimax:DEVNAME/i2400m-usb (or -sdio) for the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)        bus-specific i2400m-usb or i2400m-sdio controls).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)    Of course, if debugfs is mounted in a directory other than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178)    /sys/kernel/debug, those paths will change.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) 5.2.1. Increasing debug output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)    The files named *dl_* indicate knobs for controlling the debug output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)    of different submodules::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) 	# find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) 	/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_tx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) 	/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_rx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) 	/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_notif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) 	/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_fw
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	/sys/kernel/debug/wimax:wmx0/i2400m-usb/dl_usb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) 	/sys/kernel/debug/wimax:wmx0/i2400m/dl_tx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 	/sys/kernel/debug/wimax:wmx0/i2400m/dl_rx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) 	/sys/kernel/debug/wimax:wmx0/i2400m/dl_rfkill
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) 	/sys/kernel/debug/wimax:wmx0/i2400m/dl_netdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) 	/sys/kernel/debug/wimax:wmx0/i2400m/dl_fw
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) 	/sys/kernel/debug/wimax:wmx0/i2400m/dl_debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) 	/sys/kernel/debug/wimax:wmx0/i2400m/dl_driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) 	/sys/kernel/debug/wimax:wmx0/i2400m/dl_control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) 	/sys/kernel/debug/wimax:wmx0/wimax_dl_stack
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) 	/sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) 	/sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 	/sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) 	/sys/kernel/debug/wimax:wmx0/wimax_dl_id_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	/sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207)    By reading the file you can obtain the current value of said debug
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208)    level; by writing to it, you can set it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)    To increase the debug level of, for example, the i2400m's generic TX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211)    engine, just write::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 	$ echo 3 > /sys/kernel/debug/wimax:wmx0/i2400m/dl_tx
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)    Increasing numbers yield increasing debug information; for details of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216)    what is printed and the available levels, check the source. The code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)    uses 0 for disabled and increasing values until 8.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 5.2.2. RX and TX statistics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) ^^^^^^^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222)    The i2400m/rx_stats and i2400m/tx_stats provide statistics about the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223)    data reception/delivery from the device::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 	$ cat /sys/kernel/debug/wimax:wmx0/i2400m/rx_stats
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 	45 1 3 34 3104 48 480
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228)    The numbers reported are:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)      * packets/RX-buffer: total, min, max
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231)      * RX-buffers: total RX buffers received, accumulated RX buffer size
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232)        in bytes, min size received, max size received
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234)    Thus, to find the average buffer size received, divide accumulated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235)    RX-buffer / total RX-buffers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237)    To clear the statistics back to 0, write anything to the rx_stats file::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) 	$ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m_rx_stats
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241)    Likewise for TX.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243)    Note the packets this debug file refers to are not network packet, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244)    packets in the sense of the device-specific protocol for communication
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)    to the host. See drivers/net/wimax/i2400m/tx.c.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) 5.2.3. Tracing messages received from user space
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250)    To echo messages received from user space into the trace pipe that the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251)    i2400m driver creates, set the debug file i2400m/trace_msg_from_user to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)    1::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) 	$ echo 1 > /sys/kernel/debug/wimax:wmx0/i2400m/trace_msg_from_user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) 5.2.4. Performing a device reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)    By writing a 0, a 1 or a 2 to the file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260)    /sys/kernel/debug/wimax:wmx0/reset, the driver performs a warm (without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)    disconnecting from the bus), cold (disconnecting from the bus) or bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262)    (bus specific) reset on the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) 5.2.5. Asking the device to enter power saving mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)    By writing any value to the /sys/kernel/debug/wimax:wmx0 file, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268)    device will attempt to enter power saving mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) 6. Troubleshooting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) ==================
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) 6.1. Driver complains about ``i2400m-fw-usb-1.2.sbcf: request failed``
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) ----------------------------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276)    If upon connecting the device, the following is output in the kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277)    log::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) 	i2400m_usb 5-4:1.0: fw i2400m-fw-usb-1.3.sbcf: request failed: -2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)    This means that the driver cannot locate the firmware file named
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282)    /lib/firmware/i2400m-fw-usb-1.2.sbcf. Check that the file is present in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283)    the right location.