^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) Linux kernel WiMAX stack
^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 basic Linux kernel WiMAX stack to provide a common
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) control API for WiMAX devices, usable from kernel and user space.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 1. Design
^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) The WiMAX stack is designed to provide for common WiMAX control
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) services to current and future WiMAX devices from any vendor.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) Because currently there is only one and we don't know what would be the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) common services, the APIs it currently provides are very minimal.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) However, it is done in such a way that it is easily extensible to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) accommodate future requirements.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) The stack works by embedding a struct wimax_dev in your device's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) control structures. This provides a set of callbacks that the WiMAX
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) stack will call in order to implement control operations requested by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) the user. As well, the stack provides API functions that the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) calls to notify about changes of state in the device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) The stack exports the API calls needed to control the device to user
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) space using generic netlink as a marshalling mechanism. You can access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) them using your own code or use the wrappers provided for your
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) convenience in libwimax (in the wimax-tools package).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) For detailed information on the stack, please see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) include/linux/wimax.h.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) 2. Usage
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) ========
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) For usage in a driver (registration, API, etc) please refer to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) instructions in the header file include/linux/wimax.h.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) When a device is registered with the WiMAX stack, a set of debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) files will appear in /sys/kernel/debug/wimax:wmxX can tweak for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) control.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) 2.1. Obtaining debug information: debugfs entries
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) -------------------------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) The WiMAX stack is compiled, by default, with debug messages that can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) be used to diagnose issues. By default, said messages are disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) The drivers will register debugfs entries that allow the user to tweak
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) debug settings.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) Each driver, when registering with the stack, will cause a debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) directory named wimax:DEVICENAME to be created; optionally, it might
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) create more subentries below it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 2.1.1. Increasing debug output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) ------------------------------
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) The files named *dl_* indicate knobs for controlling the debug output
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) of different submodules of the WiMAX stack::
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) # find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) /sys/kernel/debug/wimax:wmx0/wimax_dl_stack
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) /sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) /sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) /sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) /sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) /sys/kernel/debug/wimax:wmx0/.... # other driver specific files
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) Of course, if debugfs is mounted in a directory other than
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) /sys/kernel/debug, those paths will change.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) By reading the file you can obtain the current value of said debug
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) level; by writing to it, you can set it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) To increase the debug level of, for example, the id-table submodule,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) just write:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) $ echo 3 > /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) Increasing numbers yield increasing debug information; for details of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) what is printed and the available levels, check the source. The code
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) uses 0 for disabled and increasing values until 8.