事務所はもっぱら有線LANを使用しているが、たまに無線wifi adapter経由で仕事もする.
手元に「Buffalo」様の「WI-U3-866DS」がある. &発売時期: 2017年5月 https://www.buffalo.jp/product/detail/wi-u3-866ds.html

これをRocky/Ubuntuに接続して使えるか確かめてみる.

ubuntu20.04

root@e:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.4 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.4 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
root@e:~#

デバイスを刺して確認してみると

root@e:~# lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 002: ID 0411:025d BUFFALO INC. (formerly MelCo., Inc.) WI-U3-866D
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@e:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether d0:50:99:97:56:a1 brd ff:ff:ff:ff:ff:ff
root@e:~#

となってどうも既定では使えないみたい.
だがさすがというべきか、「Software & Updates」から「Additional Drivers」欄を開くとそこには
「BUDDALO INC. (formerly MelCo., Inc.):」とか表示されて「r8812au」のドライバーを用意してくれている.
それを有効にすれば、dkmsで作ってくれて再起動が促されます.
っがこのドライバーは結局使えなかった...

っで調べたらhttps://github.com/gordboy/rtl8812au-5.9.3.2が使えた

root@e:~# git clone https://github.com/gordboy/rtl8812au-5.9.3.2
 
root@e:~# cp -arp rtl8812au-5.9.3.2 /usr/src/rtl8812au-5.9.3.2
root@e:~# dkms add -m rtl8812au -v 5.9.3.2
 
Creating symlink /var/lib/dkms/rtl8812au/5.9.3.2/source ->
                 /usr/src/rtl8812au-5.9.3.2
 
DKMS: add completed.
root@e:~# dkms build -m rtl8812au -v 5.9.3.2
 
Kernel preparation unnecessary for this kernel.  Skipping...
 
Building module:
cleaning build area...
'make' -j4 KVER=5.13.0-48-generic KSRC=/lib/modules/5.13.0-48-generic/build............
Signing module:
 - /var/lib/dkms/rtl8812au/5.9.3.2/5.13.0-48-generic/x86_64/module/8812au.ko
Secure Boot not enabled on this system.
cleaning build area...
 
DKMS: build completed.
root@e:~# dkms install -m rtl8812au -v 5.9.3.2
 
8812au.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.13.0-48-generic/updates/dkms/
 
depmod...
 
DKMS: install completed.
root@e:~# dkms status
rtl8812au, 5.9.3.2, 5.13.0-48-generic, x86_64: installed
root@e:~#

これで「WI-U3-866DS」を差し込むと

root@e:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether d0:50:99:97:56:a1 brd ff:ff:ff:ff:ff:ff
3: wlx50c4ddb3c0e1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000
    link/ether 50:c4:dd:b3:c0:e1 brd ff:ff:ff:ff:ff:ff
root@e:~#

とデバイスが自動的に登録されて、

root@e:~# nmcli dev wifi list
IN-USE  BSSID              SSID              MODE   CHAN  RATE        SIGNAL  BARS  SECURITY
        60:84:XX:XX:XX:XX  Buffalo-G-XXXX    Infra  10    270 Mbit/s  64      ???_  WPA2

とか見える

Rocky

参照先 https://quintrokk.subness.net/?p=2057

[root@e ~]# cat /etc/redhat-release
Rocky Linux release 8.6 (Green Obsidian)
 
[root@e ~]# lsusb
Bus 002 Device 002: ID 8087:8000 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:8008 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 002: ID 0411:025d BUFFALO INC. (formerly MelCo., Inc.)       <--- これ
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
 
[root@e ~]#

一応見えた. っがそのままではnicデバイスとしては見えないみたい

[root@e ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether d0:50:99:97:56:a1 brd ff:ff:ff:ff:ff:ff
[root@e ~]#

やはり既定でカーネルモジュールが用意されていないようで、対応するモジュールをインストールする.
調べると「WI-U3-866DS」の中は「RTL8812au」のようで、このカーネルモジュールを用意いたします.

参照先の通りにhttps://github.com/aircrack-ng/rtl8812auを使います

[root@e ~]# git clone https://github.com/aircrack-ng/rtl8812au
[root@e ~]# cd rtl8812au

ソースコードに修正を施します. ここでは「uname -r」の値が「4.18.0-372.9.1.el8.x86_64」なので「4.18.0」を起点としてます.

--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -460,7 +460,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset,
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
        if (started) {
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0))
                cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false);
 #else
                cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0);
@@ -7735,7 +7735,7 @@ exit:
        return ret;
 }
 
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
 static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy,
                                              struct wireless_dev *wdev,
                                              struct mgmt_frame_regs *upd)
@@ -10187,7 +10187,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE)
        .mgmt_tx = cfg80211_rtw_mgmt_tx,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,18,0))
        .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register,
 #else
        .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,

っでインストール

[root@e rtl8812au]# which gcc
/usr/bin/gcc
 
[root@e rtl8812au]# gcc --version
gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-10)
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
[root@e rtl8812au]# make dkms_install
mkdir: created directory '/usr/src/8812au-5.6.4.2_35491.20191025'
cp -r * /usr/src/8812au-5.6.4.2_35491.20191025
dkms add -m 8812au -v 5.6.4.2_35491.20191025
Creating symlink /var/lib/dkms/8812au/5.6.4.2_35491.20191025/source -> /usr/src/8812au-5.6.4.2_35491.20191025
dkms build -m 8812au -v 5.6.4.2_35491.20191025
 
Building module:
cleaning build area...
'make' -j4 KVER=4.18.0-372.9.1.el8.x86_64 KSRC=/lib/modules/4.18.0-372.9.1.el8.x86_64/build..............
cleaning build area...
dkms install -m 8812au -v 5.6.4.2_35491.20191025
 
88XXau.ko.xz:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.18.0-372.9.1.el8.x86_64/extra/
Adding any weak-modules
depmod....
dkms status -m 8812au
8812au/5.6.4.2_35491.20191025, 4.18.0-372.9.1.el8.x86_64, x86_64: installed
 
[root@e rtl8812au]# dkms status
8812au/5.6.4.2_35491.20191025, 4.18.0-372.9.1.el8.x86_64, x86_64: installed
 :
[root@e rtl8812au]# ls -l /lib/modules/4.18.0-372.9.1.el8.x86_64/extra/
 :
-rw-r--r-- 1 root root   711512 Jun 11 21:01 88XXau.ko.xz
[root@e rtl8812au]#

上手く行った模様. っでこの作った「88XXau.ko.xz」を調べると下記のようになる

[root@e ~]# modinfo 88XXau
filename:       /lib/modules/4.18.0-372.9.1.el8.x86_64/extra/88XXau.ko.xz
version:        v5.6.4.2_35491.20191025
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
rhelversion:    8.6
 :
depends:        cfg80211
name:           88XXau
vermagic:       4.18.0-372.9.1.el8.x86_64 SMP mod_unload modversions
parm:           rtw_wireless_mode:int
parm:           rtw_monitor_overwrite_seqnum:Overwrite the sequence number of injected frames (int)
parm:           rtw_monitor_retransmit:Retransmit injected frames (int)
 :
[root@e ~]#

いろいろな「parm」があるけど、ここらはwindowsPCに差し込んでそれぞれのパラメータの意味を知ってからの定義でしょうか.
ここでは簡単に

[root@e ~]# echo "options 88XXau rtw_switch_usb_mode=1" > /etc/modprobe.d/88XXau.conf

と.
デバイスを定義します. 現状は

[root@e rtl8812au]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether d0:50:99:97:56:a1 brd ff:ff:ff:ff:ff:ff
[root@e rtl8812au]#

これで

[root@e ~]# modprobe 88XXau
[root@e ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether d0:50:99:97:56:a1 brd ff:ff:ff:ff:ff:ff
4: &憧t0u2: <NO-CARRIER,BROADCAST,MULTICAST,UP,LOWER_UP> mtu 2312 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
[root@e ~]#

となるが、文字化けしている...
そして

[root@e ~]# lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
    |__ Port 2: Dev 2, If 0, Class=Vendor Specific Class, Driver=rtl88XXau, 5000M    <--- ここ
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/2p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/6p, 480M
[root@e ~]#

とusb3で行っているみたい


トップ   編集 添付 複製 名前変更     ヘルプ   最終更新のRSS
Last-modified: 2022-06-12 (日) 00:28:25 (69d)