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

时间:2024-01-23 13:09:08

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

2018-02-03 21:01  eternalwanglu  阅读(4613)  评论(0编辑  收藏  举报

我就是单纯的觉得网线接口插拔太麻烦,所以在淘宝买了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

就是这货,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.0# make  //编译
make -C /lib/modules/4.4.0-109-generic/build SUBDIRS=/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.0 modules
make[1]: Entering directory \'/usr/src/linux-headers-4.4.0-109-generic\'
  CC [M]  /mnt/hgfs/share/LinuxDriver/download/r8152-2.09.0/r8152.o
  Building modules, stage 2.
make[2]: Warning: File \'/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.0/r8152.o\' has modification time 1.5 s in the future
  MODPOST 1 modules
  CC      /mnt/hgfs/share/LinuxDriver/download/r8152-2.09.0/r8152.mod.o
  LD [M]  /mnt/hgfs/share/LinuxDriver/download/r8152-2.09.0/r8152.ko
make[2]: warning:  Clock skew detected.  Your build may be incomplete.
make[1]: Leaving directory \'/usr/src/linux-headers-4.4.0-109-generic\'
root@ubuntu:/mnt/hgfs/share/LinuxDriver/download/r8152-2.09.0# 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.0#  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 0)
[39883.931152] xhci_hcd 0000:03:00.0: Error: Failed finding new dequeue state
[39886.445089] usb 3-2: USB disconnect, device number 5
[39886.445375] pl2303 ttyUSB0: pl2303_set_control_lines - failed: -19
[39886.445379] pl2303 ttyUSB0: error sending break = -19
[39886.446493] pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
[39886.446509] pl2303 3-2:1.0: device disconnected
[40375.871882] r8152: Unknown symbol mii_nway_restart (err 0)

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

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

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

模块加载成功了~

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

 

 

结果还是不能用:

 

 

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

 

 

关于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=0002
[    0.993903] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.993904] usb usb1: Product: EHCI Host Controller
[    0.993905] usb usb1: Manufacturer: Linux 4.4.0-109-generic ehci_hcd
[    0.993905] usb usb1: SerialNumber: 0000:02:03.0
[    0.994658] usb usb2: New USB device found, idVendor=1d6b, idProduct=0001
[    0.994659] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.994660] usb usb2: Product: UHCI Host Controller
[    0.994660] usb usb2: Manufacturer: Linux 4.4.0-109-generic uhci_hcd
[    0.994661] usb usb2: SerialNumber: 0000:02:00.0
[    0.996260] usb usb3: New USB device found, idVendor=1d6b, idProduct=0002
[    0.996262] usb usb3: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.996262] usb usb3: Product: xHCI Host Controller
[    0.996263] usb usb3: Manufacturer: Linux 4.4.0-109-generic xhci-hcd
[    0.996264] usb usb3: SerialNumber: 0000:03: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=0003
[    0.996665] usb usb4: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    0.996666] usb usb4: Product: xHCI Host Controller
[    0.996666] usb usb4: Manufacturer: Linux 4.4.0-109-generic xhci-hcd
[    0.996667] usb usb4: SerialNumber: 0000:03:00.0
[    1.305723] usb 2-2: new full-speed USB device number 2 using uhci_hcd
[    1.305732] usb 3-1: new full-speed USB device number 2 using xhci_hcd
[    1.433287] usb 3-1: New USB device found, idVendor=0e0f, idProduct=0003
[    1.433290] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    1.433291] usb 3-1: Product: VMware Virtual USB Mouse
[    1.433292] usb 3-1: Manufacturer: VMware
[    1.453700] usb 2-2: New USB device found, idVendor=0e0f, idProduct=0002
[    1.453702] usb 2-2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    1.453703] usb 2-2: Product: VMware Virtual USB Hub
[    1.560991] usb 4-1: new SuperSpeed USB device number 2 using xhci_hcd
[    1.621634] usb 4-1: New USB device found, idVendor=0bda, idProduct=0316
[    1.621636] usb 4-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    1.621638] usb 4-1: Product: USB3.0-CRW
[    1.621639] usb 4-1: Manufacturer: Generic
[    1.621639] usb 4-1: SerialNumber: 20120501030900000
[    1.634811] usb-storage 4-1:1.0: USB Mass Storage device detected
[    1.656746] scsi host3: usb-storage 4-1:1.0
[    1.656927] usbcore: registered new interface driver usb-storage
[    1.657906] usbcore: registered new interface driver uas
[    1.705334] usb 3-3: new full-speed USB device number 3 using xhci_hcd
[    1.835739] usb 3-3: New USB device found, idVendor=0e0f, idProduct=0002
[    1.835743] usb 3-3: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    1.835746] usb 3-3: Product: VMware Virtual USB Hub
[    1.835881] usb 3-3: ep 0x81 - rounding interval to 1024 microframes, ep desc says 2040 microframes
[    1.949234] usb 3-4: new high-speed USB device number 4 using xhci_hcd
[    2.078074] usb 3-4: New USB device found, idVendor=0e0f, idProduct=0002
[    2.078078] usb 3-4: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[    2.078079] usb 3-4: 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:00/0000:00:15.0/0000:03:00.0/usb3/3-1/3-1:1.0/0003:0E0F:0003.0001/input/input5
[    2.089833] hid-generic 0003:0E0F:0003.0001: input,hidraw0: USB HID v1.10 Mouse [VMware VMware Virtual USB Mouse] on usb-0000:03:00.0-1/input0
[  454.875729] usb 3-2: new high-speed USB device number 5 using xhci_hcd
[  455.121350] usb 3-2: New USB device found, idVendor=0bda, idProduct=8152
[  455.121355] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  455.121357] usb 3-2: Product: USB 10/100 LAN
[  455.121358] usb 3-2: Manufacturer: Realtek
[  455.121360] usb 3-2: SerialNumber: 00E04C360026
[  455.295699] usbcore: registered new interface driver r8152
[  455.327002] usbcore: registered new interface driver cdc_ether
[  455.447177] usb 3-2: reset high-speed USB device number 5 using xhci_hcd
[  460.675029] usb 3-2: device descriptor read/64, error -110
[  476.309164] usb 3-2: device descriptor read/64, error -110
[  476.640902] usb 3-2: reset high-speed USB device number 5 using xhci_hcd
[  481.862679] usb 3-2: device descriptor read/64, error -110
[  497.193094] usb 3-2: device descriptor read/64, error -110
[  497.525851] usb 3-2: reset high-speed USB device number 5 using xhci_hcd
[ 5086.911092] usb 3-2: USB disconnect, device number 5
[ 5109.766695] usb 3-2: new high-speed USB device number 6 using xhci_hcd
[ 5110.024144] usb 3-2: New USB device found, idVendor=0bda, idProduct=8152
[ 5110.024147] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5110.024148] usb 3-2: Product: USB 10/100 LAN
[ 5110.024149] usb 3-2: Manufacturer: Realtek
[ 5110.024150] usb 3-2: SerialNumber: 00E04C360026
[ 5110.322767] usb 3-2: reset high-speed USB device number 6 using xhci_hcd
[ 5115.546457] usb 3-2: device descriptor read/64, error -110
[ 5130.876795] usb 3-2: device descriptor read/64, error -110
[ 5131.209396] usb 3-2: reset high-speed USB device number 6 using xhci_hcd
[ 5136.436428] usb 3-2: device descriptor read/64, error -110
[ 5151.767965] usb 3-2: device descriptor read/64, error -110
[ 5152.099224] usb 3-2: reset high-speed USB device number 6 using xhci_hcd
[ 5156.378454] usb 3-2: USB disconnect, device number 6
[ 5166.382326] usb 3-2: new full-speed USB device number 7 using xhci_hcd
[ 5166.640807] usb 3-2: New USB device found, idVendor=067b, idProduct=2303
[ 5166.640809] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 5166.640811] usb 3-2: Product: USB-Serial Controller D
[ 5166.640812] usb 3-2: Manufacturer: Prolific Technology Inc. 
[ 5167.090180] usb 3-4.1: new high-speed USB device number 8 using xhci_hcd
[ 5167.298556] usb 3-4.1: New USB device found, idVendor=0bda, idProduct=8152
[ 5167.298564] usb 3-4.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5167.298569] usb 3-4.1: Product: USB 10/100 LAN
[ 5167.298572] usb 3-4.1: Manufacturer: Realtek
[ 5167.298575] usb 3-4.1: SerialNumber: 00E04C360026
[ 5167.517881] usb 3-4.1: reset high-speed USB device number 8 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 3-2: pl2303 converter now attached to ttyUSB0
[ 5172.705723] usb 3-4.1: device descriptor read/64, error -110
[ 5187.996724] usb 3-4.1: device descriptor read/64, error -110
[ 5188.284646] usb 3-4.1: reset high-speed USB device number 8 using xhci_hcd
[ 5193.471942] usb 3-4.1: device descriptor read/64, error -110
[ 5208.762799] usb 3-4.1: device descriptor read/64, error -110
[ 5209.055444] usb 3-4.1: reset high-speed USB device number 8 using xhci_hcd
root@ubuntu:/lib/modules#

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

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