18c2ecf20Sopenharmony_ci.. include:: <isonum.txt>
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ci========================
48c2ecf20Sopenharmony_ciLinux kernel WiMAX stack
58c2ecf20Sopenharmony_ci========================
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci:Copyright: |copy| 2008 Intel Corporation < linux-wimax@intel.com >
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci   This provides a basic Linux kernel WiMAX stack to provide a common
108c2ecf20Sopenharmony_ci   control API for WiMAX devices, usable from kernel and user space.
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci1. Design
138c2ecf20Sopenharmony_ci=========
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci   The WiMAX stack is designed to provide for common WiMAX control
168c2ecf20Sopenharmony_ci   services to current and future WiMAX devices from any vendor.
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci   Because currently there is only one and we don't know what would be the
198c2ecf20Sopenharmony_ci   common services, the APIs it currently provides are very minimal.
208c2ecf20Sopenharmony_ci   However, it is done in such a way that it is easily extensible to
218c2ecf20Sopenharmony_ci   accommodate future requirements.
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci   The stack works by embedding a struct wimax_dev in your device's
248c2ecf20Sopenharmony_ci   control structures. This provides a set of callbacks that the WiMAX
258c2ecf20Sopenharmony_ci   stack will call in order to implement control operations requested by
268c2ecf20Sopenharmony_ci   the user. As well, the stack provides API functions that the driver
278c2ecf20Sopenharmony_ci   calls to notify about changes of state in the device.
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci   The stack exports the API calls needed to control the device to user
308c2ecf20Sopenharmony_ci   space using generic netlink as a marshalling mechanism. You can access
318c2ecf20Sopenharmony_ci   them using your own code or use the wrappers provided for your
328c2ecf20Sopenharmony_ci   convenience in libwimax (in the wimax-tools package).
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci   For detailed information on the stack, please see
358c2ecf20Sopenharmony_ci   include/linux/wimax.h.
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci2. Usage
388c2ecf20Sopenharmony_ci========
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci   For usage in a driver (registration, API, etc) please refer to the
418c2ecf20Sopenharmony_ci   instructions in the header file include/linux/wimax.h.
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_ci   When a device is registered with the WiMAX stack, a set of debugfs
448c2ecf20Sopenharmony_ci   files will appear in /sys/kernel/debug/wimax:wmxX can tweak for
458c2ecf20Sopenharmony_ci   control.
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci2.1. Obtaining debug information: debugfs entries
488c2ecf20Sopenharmony_ci-------------------------------------------------
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_ci   The WiMAX stack is compiled, by default, with debug messages that can
518c2ecf20Sopenharmony_ci   be used to diagnose issues. By default, said messages are disabled.
528c2ecf20Sopenharmony_ci
538c2ecf20Sopenharmony_ci   The drivers will register debugfs entries that allow the user to tweak
548c2ecf20Sopenharmony_ci   debug settings.
558c2ecf20Sopenharmony_ci
568c2ecf20Sopenharmony_ci   Each driver, when registering with the stack, will cause a debugfs
578c2ecf20Sopenharmony_ci   directory named wimax:DEVICENAME to be created; optionally, it might
588c2ecf20Sopenharmony_ci   create more subentries below it.
598c2ecf20Sopenharmony_ci
608c2ecf20Sopenharmony_ci2.1.1. Increasing debug output
618c2ecf20Sopenharmony_ci------------------------------
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_ci   The files named *dl_* indicate knobs for controlling the debug output
648c2ecf20Sopenharmony_ci   of different submodules of the WiMAX stack::
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci	# find /sys/kernel/debug/wimax\:wmx0 -name \*dl_\*
678c2ecf20Sopenharmony_ci	/sys/kernel/debug/wimax:wmx0/wimax_dl_stack
688c2ecf20Sopenharmony_ci	/sys/kernel/debug/wimax:wmx0/wimax_dl_op_rfkill
698c2ecf20Sopenharmony_ci	/sys/kernel/debug/wimax:wmx0/wimax_dl_op_reset
708c2ecf20Sopenharmony_ci	/sys/kernel/debug/wimax:wmx0/wimax_dl_op_msg
718c2ecf20Sopenharmony_ci	/sys/kernel/debug/wimax:wmx0/wimax_dl_id_table
728c2ecf20Sopenharmony_ci	/sys/kernel/debug/wimax:wmx0/wimax_dl_debugfs
738c2ecf20Sopenharmony_ci	/sys/kernel/debug/wimax:wmx0/.... # other driver specific files
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci   NOTE:
768c2ecf20Sopenharmony_ci       Of course, if debugfs is mounted in a directory other than
778c2ecf20Sopenharmony_ci       /sys/kernel/debug, those paths will change.
788c2ecf20Sopenharmony_ci
798c2ecf20Sopenharmony_ci   By reading the file you can obtain the current value of said debug
808c2ecf20Sopenharmony_ci   level; by writing to it, you can set it.
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci   To increase the debug level of, for example, the id-table submodule,
838c2ecf20Sopenharmony_ci   just write:
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci	$ echo 3 > /sys/kernel/debug/wimax:wmx0/wimax_dl_id_table
868c2ecf20Sopenharmony_ci
878c2ecf20Sopenharmony_ci   Increasing numbers yield increasing debug information; for details of
888c2ecf20Sopenharmony_ci   what is printed and the available levels, check the source. The code
898c2ecf20Sopenharmony_ci   uses 0 for disabled and increasing values until 8.
90