|__ Port 1: Dev 4, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 1: Dev 4, If 1, Class=Wireless, Driver=btusb, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M
|__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=usb-storage, 480M
第一个命令lsusb输出的第一个就是网卡了,第二个命令lsusb -tv可以印证,因为是usb-storage嘛,480M表示是usb3.0协议,读写速度,这些不需要过多关心
主要需要关注的是****ID 0bda:1a2b, 利用此ID ,进一步识别网卡信息(注意,usb_modeswitch命令最小化安装没有,需要安装,yum install usb_modeswitch -y):
[root@centos10 ~]# usb_modeswitch -KW -v 0bda -p 1a2b
Take all parameters from the command line
- usb_modeswitch: handle USB devices with multiple modes
- Version 2.5.1 © Josua Dietze 2017
- Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x0bda
DefaultProduct= 0x1a2b
StandardEject=1
Look for default devices …
found USB ID 0bda:1a2b
vendor ID matched
product ID matched
found USB ID 1d6b:0002
found USB ID 0e0f:0008
found USB ID 0e0f:0002
found USB ID 0e0f:0003
found USB ID 1d6b:0001
Found devices in default mode (1)
Access device 002 on bus 001
Get the current device configuration …
Current configuration number is 1
Use interface number 0
with class 8
Use endpoints 0x0b (out) and 0x8a (in)
USB description data (for identification)
Manufacturer: Realtek
Product: DISK
Serial No.: not provided
Sending standard EJECT sequence
Looking for active drivers …
OK, driver detached
Set up interface 0
Use endpoint 0x0b for message sending …
Trying to send message 1 to endpoint 0x0b …
OK, message successfully sent
Read the response to message 1 (CSW) …
Response successfully read (13 bytes), status 1
Trying to send message 2 to endpoint 0x0b …
OK, message successfully sent
Read the response to message 2 (CSW) …
Response reading failed (error -8)
Device is gone, skip any further commands
-> Run lsusb to note any changes. Bye!
[root@centos10 ~]# lsusb
Bus 001 Device 003: ID 0bda:b711 Realtek Semiconductor Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 004: ID 0e0f:0008 VMware, Inc.
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
**再次查看USB信息,可以看到ID改变了,变为****0bda:b711 ,**说明Linux正确识别到了,但是,此时还没有驱动来驱动该硬件
在Linux下查询网卡芯片信息比较困难,其实比较简单的办法是在Windows下查看,见下图:
补充:
如何确定网卡的芯片型号是重中之重,关系到后面的网卡是否能正确识别使用,因此,我补充一下,如何查询网卡芯片型号的问题
芯片对应 列表在这个网站http://www.linux-usb.org/usb.ids,可以查询到两个b711,第二个说的是在切换后,因此确定是8188gu了
b711 EW-7722UAC 802.11a/b/g/n/ac (2x2) Wireless Adapter [MediaTek MT7612U]
b711 RTL8188GU 802.11n WLAN Adapter (After Modeswitch)
我们可以确定该网卡的芯片是8188gu的,在网上寻找此芯片的Linux版本驱动就可以了,本次实验使用的是版本是下面的链接(第一个没有dkms.conf 第二个有dkms.conf ,第二个更加好用一些,如果会dkms的话):
https://github.com/McMCCRU/rtl8188gu
我想这个应该也是可以的:
GitHub - wandercn/RTL8188GU: Realtek RTL8188GU Driver for TP-link TL-WN725N USB wifi
三,
相关资料介绍和驱动安装
驱动和操作系统的内核是密切相关的,因此, 本例中,需要升级内核,据测试,3.10版本的内核不会成功,本例中使用的内核版本是5版本
其次,是我们下载的驱动都是c语言的,因此,gcc的版本也需要比较高,默认的gcc4.8版本经测试也是失败的,本例中使用的gcc是9版本
本例涉及使用的安装包在下面的链接:
链接:https://pan.baidu.com/s/1tQseIUjo_MVCe-kaU8cROA?pwd=kkey
提取码:kkey
1,
升级内核
进入目录
[root@centos10 kernel-lt-5.4.266]# pwd
/root/11/kernel-lt-5.4.266
[root@centos10 kernel-lt-5.4.266]# ll
total 75756
-rw-r–r-- 1 root root 52929208 Jan 15 06:21 kernel-lt-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 13541288 Jan 15 06:21 kernel-lt-devel-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 8626820 Jan 15 06:21 kernel-lt-doc-5.4.266-1.el7.elrepo.noarch.rpm
-rw-r–r-- 1 root root 1401376 Jan 15 06:21 kernel-lt-headers-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 233736 Jan 15 06:21 kernel-lt-tools-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 120376 Jan 15 06:21 kernel-lt-tools-libs-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 97832 Jan 15 06:21 kernel-lt-tools-libs-devel-5.4.266-1.el7.elrepo.x86_64.rpm
-rw-r–r-- 1 root root 603824 Jan 15 06:21 python-perf-5.4.266-1.el7.elrepo.x86_64.rpm
可以强制安装,这个没有什么影响:
[root@centos10 kernel-lt-5.4.266]# rpm -ivh ./* --force --nodeps
warning: ./kernel-lt-5.4.266-1.el7.elrepo.x86_64.rpm: Header V4 DSA/SHA256 Signature, key ID baadae52: NOKEY
Preparing… ################################# [100%]
Updating / installing…
1:kernel-lt-tools-libs-5.4.266-1.el################################# [ 13%]
2:kernel-lt-tools-5.4.266-1.el7.elr################################# [ 25%]
3:kernel-lt-tools-libs-devel-5.4.26################################# [ 38%]
4:python-perf-5.4.266-1.el7.elrepo ################################# [ 50%]
5:kernel-lt-headers-5.4.266-1.el7.e################################# [ 63%]
6:kernel-lt-doc-5.4.266-1.el7.elrep################################# [ 75%]
7:kernel-lt-devel-5.4.266-1.el7.elr################################# [ 88%]
8:kernel-lt-5.4.266-1.el7.elrepo ################################# [100%]
安装完毕后,重启虚拟机ÿ