readme.txt
来自「USb in User space, a kernel module that 」· 文本 代码 · 共 46 行
TXT
46 行
usu: USb in User space, a kernel module that use usb layer. Expose usb device as file without seek() and assuming as model 1-reader, many-writer (more similar to pipe than file)=== COMPILE ===Open 'Makefile' and set variable 'LINUX_SRC' to place where kernel src was present, then:make=== CUSTOMIZE MODULE=== (es usb bluetooth dongle) ... static struct LinkT topol[]={ {{0x00, 6}}, /* (OUTPUT, CONTROL). Never pass under our probe() because already created.*/ {{0x81, 6}}, /* (INPUT, INTERRUPT) endpoint.*/ {{0x02, 7}}, /* (OUTPUT, BULK) endpoint.*/ {{0x82, 7}}, /* (INPUT, BULK) endpoint.*/ {{0x03, 10}},/* (OUTPUT, ISOC) endpoint.*/ {{0x83, 10}},/* (INPUT, ISOC) endpoint.*/ }; struct usb_device_id idta[] = { {USB_DEVICE(0x50d,0x012)}, /* Belkin.*/ {USB_DEVICE(0xa12,0x001)}, /* Surecom.*/ {USB_DEVICE(1131,1001)}, /* Sitel.*/ /* {USB_DEVICE(0xea0,0x2168)}, * UsbPen.*/ {} }; ...1) Fill 'topol[]' array with (endpointId, instanceId) - endpointId: is endpoint number that you found in /proc/bus/usb/devices.txt - instanceId: indentify instance that'll manage such endpoint. 0..9 : instance of class 'BuffRead' 10..19 : instance of class 'DoubleBuff' 'BuffRead' class: can manage interrup, control, bulk I/O endpoint. 'DoubleBuff' class: can manage isoc endpoint. Input endpoint are used during read() Output endpoint are used during write() 2) Fill 'idta[]' array with idVendor, idProduct, see /proc/bus/usb/devices.txt=== KNOWN PROBLEMS/COMMON MISTAKES === - setting non standard usb interfaces require custom code. TODO: Perhaps some option could be put in file name?
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?