forked from tomxue/netlink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
48 lines (41 loc) · 2.08 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
hotplug.c
snl.nl_groups = 1;
disconnect USB-to-COM device and reconnect it once:
root@maemo-desktop:/mnt/hgfs/VMware_share/mycode/netlink# ./hotplug
test errno: Success
remove@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0/ttyUSB0/tty/ttyUSB0
remove@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0/ttyUSB0
remove@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0
remove@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1
add@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1
add@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0
add@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0/ttyUSB0
add@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0/ttyUSB0/tty/ttyUSB0
snl.nl_groups = 3;
disconnect USB-to-COM device and reconnect it once:
inputtedroot@maemo-desktop:/mnt/hgfs/VMware_share/mycode/netlink# ./hotplug
test errno: Success
remove@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0/ttyUSB0/tty/ttyUSB0
remove@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0/ttyUSB0
remove@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0
remove@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1
libudev
libudev
libudev
libudev
add@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1
add@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0
add@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0/ttyUSB0
add@/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.1/2-2.1:1.0/ttyUSB0/tty/ttyUSB0
libudev
libudev
libudev
libudev
Makefile
obj-m += nl_kernel.o
make on BB_Ubuntu:
make ARCH=arm -C /lib/modules/3.0.4-x3/build M=$(pwd) modules
Run
sudo insmod nl_kernel.ko
./nl_user
dmesg | tail