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