达尔稳usb转RJ45的接口转换器(usb2.0接口)在ubuntu16.04中驱动(r8152)编译安装与使用

我就是单纯的觉得网线接口插拔太麻烦,所以在淘宝买了usb转RJ45的接口转换器:https://detail.tmall.com/item.htm?id=524808012954&ali_refid=a3_430582_1006:1105586579:N:USB%E6%97%A0%E7%BA%BF%E7%BD%91%E5%8D%A1%20%E7%AC%94%E8%AE%B0%E6%9C%AC:eb696d88976cbb7272321d0ffa0bb488&ali_trackid=1_eb696d88976cbb7272321d0ffa0bb488&spm=a230r.1.14.1

达尔稳usb转RJ45的接口转换器(usb2.0接口)在ubuntu16.04中驱动(r8152)编译安装与使用

就是这货,ubuntu中使用还没有驱动~问了客服,表示可以自己下载驱动:

驱动链接:http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=3&PNid=13&PFid=56&Level=5&Conn=4&DownTypeID=3&GetDown=false

但是,直接make后ismod模块还报错!

安装驱动时报错Unknown symbol in module解决方案

root@ubuntu:/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.# make  //编译
make -C /lib/modules/4.4.--generic/build SUBDIRS=/mnt/hgfs/share/LinuxDriver/download/r8152-2.09. modules
make[]: Entering directory '/usr/src/linux-headers-4.4.0-109-generic'
CC [M] /mnt/hgfs/share/LinuxDriver/download/r8152-2.09./r8152.o
Building modules, stage .
make[]: Warning: File '/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.0/r8152.o' has modification time 1.5 s in the future
MODPOST modules
CC /mnt/hgfs/share/LinuxDriver/download/r8152-2.09./r8152.mod.o
LD [M] /mnt/hgfs/share/LinuxDriver/download/r8152-2.09./r8152.ko
make[]: warning: Clock skew detected. Your build may be incomplete.
make[]: Leaving directory '/usr/src/linux-headers-4.4.0-109-generic'
root@ubuntu:/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.# insmod r8152.ko //安装
insmod: ERROR: could not insert module r8152.ko: Unknown symbol in module

参考:http://blog.csdn.net/zhang_danf/article/details/17758669

dmesg | tail 看输出信息中的Unknown symbol,加载上这些模块就好。我的输出信息是:

root@ubuntu:/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.#  dmesg | tail
[38227.073922] IPv6: ADDRCONF(NETDEV_UP): ens33: link is not ready
[38227.073934] IPv6: ADDRCONF(NETDEV_CHANGE): ens33: link becomes ready
[38448.591972] r8152: Unknown symbol mii_nway_restart (err )
[39883.931152] xhci_hcd ::00.0: Error: Failed finding new dequeue state
[39886.445089] usb -: USB disconnect, device number
[39886.445375] pl2303 ttyUSB0: pl2303_set_control_lines - failed: -
[39886.445379] pl2303 ttyUSB0: error sending break = -
[39886.446493] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[39886.446509] pl2303 -:1.0: device disconnected
[40375.871882] r8152: Unknown symbol mii_nway_restart (err )

估计是由于模块依赖的其他模块没有加载导致的。

直接用modinfo  ./r8152.ko | grep depend命令查找模块的依赖,结果如下:

root@ubuntu:/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.# modinfo  ./r8152.ko | grep depend
depends: mii
root@ubuntu:/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.# modprobe mii
root@ubuntu:/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.# insmod r8152.ko
root@ubuntu:/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.#

模块加载成功了~

如果这样就能用,似乎太简单了:

达尔稳usb转RJ45的接口转换器(usb2.0接口)在ubuntu16.04中驱动(r8152)编译安装与使用

结果还是不能用:

达尔稳usb转RJ45的接口转换器(usb2.0接口)在ubuntu16.04中驱动(r8152)编译安装与使用

然后,重启虚拟机,再拔出usb转RJ45转接器重新插上,Vmware就可以识别了:

达尔稳usb转RJ45的接口转换器(usb2.0接口)在ubuntu16.04中驱动(r8152)编译安装与使用

关于dmesg命令,这个写的很清楚:

https://linux.cn/article-3587-1.html

问题又出现了,虽然驱动安装成功,但是实际测试并不能用啊:通过dmesg | grep usb 查看内核打印信息错误是device descriptor read/64, error -110:

root@ubuntu:/lib/modules# dmesg | grep usb
No command 'dmesh' found, did you mean:
Command 'admesh' from package 'admesh' (universe)
Command 'dmesg' from package 'util-linux' (main)
dmesh: command not found
root@ubuntu:/lib/modules# dmesg | grep usb
[ 0.272527] usbcore: registered new interface driver usbfs
[ 0.272532] usbcore: registered new interface driver hub
[ 0.272549] usbcore: registered new device driver usb
[ 0.993902] usb usb1: New USB device found, idVendor=1d6b, idProduct=
[ 0.993903] usb usb1: New USB device strings: Mfr=, Product=, SerialNumber=
[ 0.993904] usb usb1: Product: EHCI Host Controller
[ 0.993905] usb usb1: Manufacturer: Linux 4.4.--generic ehci_hcd
[ 0.993905] usb usb1: SerialNumber: ::03.0
[ 0.994658] usb usb2: New USB device found, idVendor=1d6b, idProduct=
[ 0.994659] usb usb2: New USB device strings: Mfr=, Product=, SerialNumber=
[ 0.994660] usb usb2: Product: UHCI Host Controller
[ 0.994660] usb usb2: Manufacturer: Linux 4.4.--generic uhci_hcd
[ 0.994661] usb usb2: SerialNumber: ::00.0
[ 0.996260] usb usb3: New USB device found, idVendor=1d6b, idProduct=
[ 0.996262] usb usb3: New USB device strings: Mfr=, Product=, SerialNumber=
[ 0.996262] usb usb3: Product: xHCI Host Controller
[ 0.996263] usb usb3: Manufacturer: Linux 4.4.--generic xhci-hcd
[ 0.996264] usb usb3: SerialNumber: ::00.0
[ 0.996655] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[ 0.996664] usb usb4: New USB device found, idVendor=1d6b, idProduct=
[ 0.996665] usb usb4: New USB device strings: Mfr=, Product=, SerialNumber=
[ 0.996666] usb usb4: Product: xHCI Host Controller
[ 0.996666] usb usb4: Manufacturer: Linux 4.4.--generic xhci-hcd
[ 0.996667] usb usb4: SerialNumber: ::00.0
[ 1.305723] usb -: new full-speed USB device number using uhci_hcd
[ 1.305732] usb -: new full-speed USB device number using xhci_hcd
[ 1.433287] usb -: New USB device found, idVendor=0e0f, idProduct=
[ 1.433290] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[ 1.433291] usb -: Product: VMware Virtual USB Mouse
[ 1.433292] usb -: Manufacturer: VMware
[ 1.453700] usb -: New USB device found, idVendor=0e0f, idProduct=
[ 1.453702] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[ 1.453703] usb -: Product: VMware Virtual USB Hub
[ 1.560991] usb -: new SuperSpeed USB device number using xhci_hcd
[ 1.621634] usb -: New USB device found, idVendor=0bda, idProduct=
[ 1.621636] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[ 1.621638] usb -: Product: USB3.-CRW
[ 1.621639] usb -: Manufacturer: Generic
[ 1.621639] usb -: SerialNumber:
[ 1.634811] usb-storage -:1.0: USB Mass Storage device detected
[ 1.656746] scsi host3: usb-storage -:1.0
[ 1.656927] usbcore: registered new interface driver usb-storage
[ 1.657906] usbcore: registered new interface driver uas
[ 1.705334] usb -: new full-speed USB device number using xhci_hcd
[ 1.835739] usb -: New USB device found, idVendor=0e0f, idProduct=
[ 1.835743] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[ 1.835746] usb -: Product: VMware Virtual USB Hub
[ 1.835881] usb -: ep 0x81 - rounding interval to microframes, ep desc says microframes
[ 1.949234] usb -: new high-speed USB device number using xhci_hcd
[ 2.078074] usb -: New USB device found, idVendor=0e0f, idProduct=
[ 2.078078] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[ 2.078079] usb -: Product: VMware Virtual USB Hub
[ 2.087762] usbcore: registered new interface driver usbhid
[ 2.087764] usbhid: USB HID core driver
[ 2.089529] input: VMware VMware Virtual USB Mouse as /devices/pci0000:/::15.0/::00.0/usb3/-/-:1.0/:0E0F:0003.0001/input/input5
[ 2.089833] hid-generic :0E0F:0003.0001: input,hidraw0: USB HID v1. Mouse [VMware VMware Virtual USB Mouse] on usb-::00.0-/input0
[ 454.875729] usb -: new high-speed USB device number using xhci_hcd
[ 455.121350] usb -: New USB device found, idVendor=0bda, idProduct=
[ 455.121355] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[ 455.121357] usb -: Product: USB / LAN
[ 455.121358] usb -: Manufacturer: Realtek
[ 455.121360] usb -: SerialNumber: 00E04C360026
[ 455.295699] usbcore: registered new interface driver r8152
[ 455.327002] usbcore: registered new interface driver cdc_ether
[ 455.447177] usb -: reset high-speed USB device number using xhci_hcd
[ 460.675029] usb -: device descriptor read/, error -
[ 476.309164] usb -: device descriptor read/, error -
[ 476.640902] usb -: reset high-speed USB device number using xhci_hcd
[ 481.862679] usb -: device descriptor read/, error -
[ 497.193094] usb -: device descriptor read/, error -
[ 497.525851] usb -: reset high-speed USB device number using xhci_hcd
[ 5086.911092] usb -: USB disconnect, device number
[ 5109.766695] usb -: new high-speed USB device number using xhci_hcd
[ 5110.024144] usb -: New USB device found, idVendor=0bda, idProduct=
[ 5110.024147] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[ 5110.024148] usb -: Product: USB / LAN
[ 5110.024149] usb -: Manufacturer: Realtek
[ 5110.024150] usb -: SerialNumber: 00E04C360026
[ 5110.322767] usb -: reset high-speed USB device number using xhci_hcd
[ 5115.546457] usb -: device descriptor read/, error -
[ 5130.876795] usb -: device descriptor read/, error -
[ 5131.209396] usb -: reset high-speed USB device number using xhci_hcd
[ 5136.436428] usb -: device descriptor read/, error -
[ 5151.767965] usb -: device descriptor read/, error -
[ 5152.099224] usb -: reset high-speed USB device number using xhci_hcd
[ 5156.378454] usb -: USB disconnect, device number
[ 5166.382326] usb -: new full-speed USB device number using xhci_hcd
[ 5166.640807] usb -: New USB device found, idVendor=067b, idProduct=
[ 5166.640809] usb -: New USB device strings: Mfr=, Product=, SerialNumber=
[ 5166.640811] usb -: Product: USB-Serial Controller D
[ 5166.640812] usb -: Manufacturer: Prolific Technology Inc.
[ 5167.090180] usb -4.1: new high-speed USB device number using xhci_hcd
[ 5167.298556] usb -4.1: New USB device found, idVendor=0bda, idProduct=
[ 5167.298564] usb -4.1: New USB device strings: Mfr=, Product=, SerialNumber=
[ 5167.298569] usb -4.1: Product: USB / LAN
[ 5167.298572] usb -4.1: Manufacturer: Realtek
[ 5167.298575] usb -4.1: SerialNumber: 00E04C360026
[ 5167.517881] usb -4.1: reset high-speed USB device number using xhci_hcd
[ 5167.717060] usbcore: registered new interface driver usbserial
[ 5167.717291] usbcore: registered new interface driver usbserial_generic
[ 5167.717367] usbserial: USB Serial support registered for generic
[ 5167.720502] usbcore: registered new interface driver pl2303
[ 5167.720590] usbserial: USB Serial support registered for pl2303
[ 5167.728177] usb -: pl2303 converter now attached to ttyUSB0
[ 5172.705723] usb -4.1: device descriptor read/, error -
[ 5187.996724] usb -4.1: device descriptor read/, error -
[ 5188.284646] usb -4.1: reset high-speed USB device number using xhci_hcd
[ 5193.471942] usb -4.1: device descriptor read/, error -
[ 5208.762799] usb -4.1: device descriptor read/, error -
[ 5209.055444] usb -4.1: reset high-speed USB device number using xhci_hcd
root@ubuntu:/lib/modules#

查看内核错误码发现问题是连接超时:为啥会连接超时??这也不算是找到根源啊,没法解决~

达尔稳usb转RJ45的接口转换器(usb2.0接口)在ubuntu16.04中驱动(r8152)编译安装与使用

经过一番百度,受文章启示(如下图说明)(问题链接:http://www.ceus-now.com/ubuntu-can-t-read-my-usb-device-descriptor-read-64-error-110/)感觉有可能是硬件问题,电压问题还是啥的反正没搞明白,按照他说的操作,把虚拟机和笔记本电脑都重启了同时把usb转RJ45的接口转换器插到usb扩展接口的另外一个接口,然后就可以正常使用了~

达尔稳usb转RJ45的接口转换器(usb2.0接口)在ubuntu16.04中驱动(r8152)编译安装与使用

上一篇:【转】 探索UDP套接字编程


下一篇:BPM SharePoint解决方案分享