编译好的USB无线网卡Comfast CF-812AC V2 (1300Mbps双频) debian11.8 驱动

编译好的USB无线网卡Comfast CF-812AC V2 (1300Mbps双频) debian11.8 驱动
2024.1.17

零售价:49 ~ 29 元
(说明:原价 49元。近期 某东/ 某宝 都有优惠,某些店铺都给出了 29元的促销价!值得入手)

官网产品介绍

cf-812ac-v2_mini3

官网驱动下载(含Linux 驱动源码包,需要自行编译)

  • 特别说明:内核 5.15 及以上版本,编译驱动时可能报错:
    net/ipx.h 文件缺失

即:Debian 12 (默认 6.1 内核,backports 升档内核为 6.5),不推荐 使用/购买这款。
(除非自己能找到 处理上面的 net/ipx.h 编译问题 的解决方案,可以编译成功)

个人用了几天,信号接收强,速度也不错。

顺便打了个 Debian 11.8 amd64 的 DEB 包。
适用内核:5.10.0-26-amd64

comfast-cf-812ac-v2-deb11-5.10.0-26-amd64_2023.8.30-kba1_amd64.deb
文件大小:1.4 M
https://url48.ctfile.com/f/30646948-1009297097-119c6d?p=6859
(访问密码: 6859)

附、编译好的无线网卡驱动程序文件位置
.
/lib/modules/*/kernel/drivers/net/wireless/88x2cu.ko

  • 使用注意事项:
    .
  1. 安装驱动时,尽可能把 USB 无线网卡插上,这样系统能更好地识别到芯片。
    .
  2. 启动电脑时,电脑的 USB 接口上,尽可能“不要”插“带有 USB 分区”的无线网卡(即
    通常产品宣传资料包含“免驱”字样的型号)!否则启动时,USB 无线网卡,可能会被电脑错误
    识别为“USB启动盘”,导致无法进入系统或 Grub 启动界面!
    .
    (如果遇到这种故障,只需要 取下 USB 无线网卡,再重新启动电脑,就能正常进入系统。)
    .
    可以在电脑启动、进入系统后,再插上 USB 无线网卡使用。

编译相关的技术细节

  1. ubuntu linux内核版本>5.15安装usb无线网卡驱动

    清风扫冷月 2022-06-26

    ————————————————

    版权声明:本文为CSDN博主「清风扫冷月」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。

    原文链接:ubuntu linux内核版本>5.15安装usb无线网卡驱动_net/ipx.h-CSDN博客

  2. 在Debian12上安装TL-WDN5200H USB无线网卡驱动

    大杨 2023-10-15

    在Debian12上安装TL-WDN5200H USB无线网卡驱动 - 知乎

虽然注意的点可能有点偏,但是我还是想问:这个打包好学吗?

1 个赞

问题主要是内核 API 变动,相关版本号宏可能写的不够准确,如果有问题请予以修正。
另外本人没有该网卡,无法确定在高版本内核上是否工作正常,仅在 Debian 12(kernel 6.1)上编译通过(进入源码目录运行 make)。

(有些厂商维护的 kernel 有一些 backport,可能需要特别处理)

相关的修改主要是集中在 802.11 新功能 MLO 上。该网卡只支持 802.11ac,所以补丁将相关参数忽略或设为不支持。

原始厂商驱动文件:

20230830104840964.zip
sha256: 0345dd97b8197f9adfd5e4c3e6f6127b0735ab1d8be384c1275e46c2d1ac52c8

2024.01.27

补丁版本 2:

该补丁正确的处理了 REGULATORY_IGNORE_STALE_KICKOFF 相关的内容(至少它编译能过 :innocent:),这个值不是个宏,用 #ifdef 检查完全是那天昏了头… 幸运的是因为这个宏不存在,恰好这个分支也不应该生效,所以旧补丁编译能过。

相关参考链接:


2024.01.21

旧版本补丁:

不要再使用该旧补丁,此处保留原始链接供参考:https://pastebin.com/1czMcHMG


使用方法:

$ ls 
rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/
patch.diff

$ patch --directory=rtl88x2CU_WiFi_linux_v5.14.0.3-2-gba458274c.20220418_COEX20211210-2727/ --strip=1 < patch.diff

不太确定如何上传文件,好在修改不多。

想学正统的 deb 打包,规则较多,不适用新手。

如果只是一些简单的壁纸,图标主题,字体,单个命令,文档模板等等,
dpkg -b 命令也可以做到。特别适合有意向、有兴趣、愿意认真去学习的朋友。

网上搜一下,教程很好找。

有个很好用的工具叫 equivs,可以用来简单几步创建你自己的 元包,而不用填充任何实际内容,不但可以制作自己的 “软件精选集”,还有更多的其它功能。

你可以试试用用这个。虽然和实际的打包工作无关。

果然是 业内高手!多谢!我试试补丁。
我现在手上能试机的老旧电脑有3台,包括

  • Debian 10.13 amd64 (主线内核 4.19, backports 5.10)

  • Debian 11.8 amd64 (主线内核 5.10.0-27-amd64, backports 6.1)

  • Debian 12.4 amd64 (主线内核 6.1.0-13-amd64, backports 6.5)

我再用你提供的 patch 试下 6.1 和 6.5 内核。应该是可行的。

顺便说一个,现在国内 realtek 芯片的 无线网卡驱动,很多厂商提供的 Linux 驱动,都是较早(2022年,甚至是 2020 年的),稍微新点的内核,可能编译就会较多报错。

某些网卡的商品宣传页面,通常也只是模糊地说 “支持 Linux” ,没有明示有效的内核版本号。一般用户,踩坑的机会相当大。

抱歉,补丁不小心混进去一个无用文件,怪不得这么长…忘了认真检查。

正在修改…

也可以把修改后的几个文件,直接打包,放网盘。给出网盘链接也可。

修好了。不该半夜弄这个…

1 个赞

好的

$ lsb_release -ds
Debian GNU/Linux 11 (bullseye)

$ uname -r
6.1.0-0.deb11.13-amd64


Debian 11.8 amd64, 6.1 内核,编译成功!

感谢大神!

稍后 我再验证下 Debian 12.4 amd64 的 backports 升档内核 6.5。

已知问题:
编译生成 88x2cu.ko 驱动文件后,复制到
/lib/modules/6.1.0-0.deb11.13-amd64/kernel/drivers/net/wireless/
目录下,再编写一个 conf 文件
/etc/modprobe.d/rtl88x2cu.conf
options 88x2cu rtw_power_mgnt=0 rtw_enusbss=0

运行
sudo depmod -a $(uname -r)$


sudo modprobe -v 88x2cu

测速环境:

  • 中国移动宽带,100 Mbps,
  • 路由器在一楼。测试用的笔记本在二楼

实测速度:

  • 下载:13.75 Mbps

  • 上传:7.57 Mbps

  • 阿里云 镜像下载速度:3.8 MB/s (这个下载速度,比较满意了。直接拉网线,也才 10 MB 多一点的速度)

附图:

恭喜,不过 6.5 可能会包含更多的内核 API 变更,所以我不确定能否正常工作 :confused:

另外测试网速其实可以用 rsync / sftp 传输文件来测,这个更简单方便

1 个赞
  • debian 12.4 amd64, 6.1 主线内核编译成功。已知缺陷:
  • 下载速度还算快,但上传速度很慢。在“测速网”测速时,2次都在测试“上传速度”时挂起,无法显示数据。打开网页速度慢;登陆 linux QQ,弹出二维码界面时,长时间无法显示,导致无法扫码登录。
  • debian 12.4 amd64, 6.5 backports 内核编译失败。附 make.log

建议:

  • 暂不推荐在 Debian 11.8 amd64, 6.1 的 backports 内核上,
    使用这款无线网卡(芯片 Realtek RTL88x2CU, ID 0bda:c812);
    (原因:上传速度慢)

  • 暂不推荐在 Debian 12.4 amd64, 6.1 的 主线内核上,
    使用这款无线网卡(原因:上传速度慢);

  • 暂不推荐在 Debian 12.4 amd64, 6.5 的 backports (升档)内核上,
    使用这款无线网卡(原因:驱动编译失败);

  • 2024-01-22 编译(失败)
  • Debian 12.4 amd64,
  • kernel 6.5.0-0.deb12.4-amd64

DKMS make.log for rtl88x2cu-5.14.0.3-2~k6.1 for kernel 6.5.0-0.deb12.4-amd64 (x86_64)
Mon Jan 22 21:46:15 CST 2024
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/6.5.0-0.deb12.4-amd64/build M=/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build modules
make[1]: Entering directory ‘/usr/src/linux-headers-6.5.0-0.deb12.4-amd64’
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_cmd.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_security.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_debug.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_io.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_ioctl_query.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_ioctl_set.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_ieee80211.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_mlme.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_mlme_ext.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_mi.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_wlan_util.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_vht.o
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_vht.c: In function ‘rtw_reattach_vht_ies’:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_vht.c:1269:27: warning: the comparison will always evaluate as ‘true’ for the address of ‘IEs’ will never be NULL [-Waddress]
1269 | if (pnetwork->IEs != NULL) {
| ^~
In file included from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/drv_types.h:29,
from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_vht.c:17:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/wlan_bssdef.h:244:13: note: ‘IEs’ declared here
244 | u8 IEs[MAX_IE_SZ]; /* (timestamp, beacon interval, and capability information) /
| ^~~
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_pwrctrl.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_rf.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_chplan.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/monitor/rtw_radiotap.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_recv.o
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_recv.c: In function ‘validate_mp_recv_frame’:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_recv.c:3898:25: warning: this ‘for’ clause does not guard… [-Wmisleading-indentation]
3898 | for (i = 0; i < precv_frame->u.hdr.len; i = i + 8)
| ^~~
In file included from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/drv_types.h:60,
from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_recv.c:17:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/rtw_debug.h:167:9: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
167 | do {
| ^~
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_recv.c:3901:33: note: in expansion of macro ‘RTW_INFO’
3901 | RTW_INFO(“#############################\n”);
| ^~~~~~~~
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_sta_mgt.o
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_sta_mgt.c: In function ‘rtw_mfree_stainfo’:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_sta_mgt.c:393:25: warning: the comparison will always evaluate as ‘true’ for the address of ‘lock’ will never be NULL [-Waddress]
393 | if (&psta->lock != NULL)
| ^~
In file included from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/drv_types.h:112,
from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_sta_mgt.c:17:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/sta_info.h:269:17: note: ‘lock’ declared here
269 | _lock lock;
| ^~~~
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_ap.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/wds/rtw_wds.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/mesh/rtw_mesh.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/mesh/rtw_mesh_pathtbl.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/mesh/rtw_mesh_hwmp.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_xmit.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_p2p.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_rson.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_tdls.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_br_ext.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_iol.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_sreset.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_btcoex_wifionly.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_btcoex.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_beamforming.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_odm.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_rm.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_rm_fsm.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_ft.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_wnm.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_mbo.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_rm_util.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/efuse/rtw_efuse.o
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/efuse/rtw_efuse.c: In function ‘rtw_efuse_analyze’:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/efuse/rtw_efuse.c:971:17: warning: this ‘if’ clause does not guard… [-Wmisleading-indentation]
971 | if (i % 16 == 0)
| ^~
In file included from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/drv_types.h:60,
from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/efuse/rtw_efuse.c:17:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/rtw_debug.h:261:9: note: …this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
261 | do {
| ^~
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/efuse/rtw_efuse.c:973:25: note: in expansion of macro ‘_RTW_PRINT_SEL’
973 | _RTW_PRINT_SEL(RTW_DBGDUMP, “%02X%s”
| ^~~~~~~~~~~~~~
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_roch.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/aes-internal.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/aes-internal-enc.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/aes-gcm.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/aes-ccm.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/aes-omac1.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/ccmp.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/gcmp.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/aes-siv.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/aes-ctr.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/sha256-internal.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/sha256.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/sha256-prf.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/crypto/rtw_crypto_wrap.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/core/rtw_swcrypto.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/osdep_service.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/os_intfs.o
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/os_intfs.c: In function ‘rtw_net_set_mac_address’:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/os_intfs.c:1707:28: warning: passing argument 1 of ‘_rtw_memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
1707 | _rtw_memcpy(pnetdev->dev_addr, sa->sa_data, ETH_ALEN); /
set mac addr to net_device */
| ~^~~~
In file included from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/drv_types.h:27,
from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/os_intfs.c:17:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/osdep_service.h:321:35: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
321 | extern void _rtw_memcpy(void *dec, const void *sour, u32 sz);
| ^
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/os_intfs.c: In function ‘rtw_os_ndev_register’:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/os_intfs.c:2225:25: warning: passing argument 1 of ‘_rtw_memcpy’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
2225 | _rtw_memcpy(ndev->dev_addr, adapter_mac_addr(adapter), ETH_ALEN);
| ^
~
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/osdep_service.h:321:35: note: expected ‘void *’ but argument is of type ‘const unsigned char *’
321 | extern void _rtw_memcpy(void *dec, const void *sour, u32 sz);
| ^
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/usb_intf.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/usb_ops_linux.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/ioctl_linux.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/xmit_linux.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/mlme_linux.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/recv_linux.o
CC [M] /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/ioctl_cfg80211.o
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/ioctl_cfg80211.c: In function ‘rtw_cfg80211_ch_switch_notify’:
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/ioctl_cfg80211.c:496:17: error: too few arguments to function ‘cfg80211_ch_switch_started_notify’
496 | cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
| ^
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/osdep_service_linux.h:98,
from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/osdep_service.h:59,
from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/include/drv_types.h:27,
from /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/ioctl_cfg80211.c:17:
/usr/src/linux-headers-6.5.0-0.deb12.4-common/include/net/cfg80211.h:8594:6: note: declared here
8594 | void cfg80211_ch_switch_started_notify(struct net_device *dev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/ioctl_cfg80211.c:520:9: error: too few arguments to function ‘cfg80211_ch_switch_notify’
520 | cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/linux-headers-6.5.0-0.deb12.4-common/include/net/cfg80211.h:8577:6: note: declared here
8577 | void cfg80211_ch_switch_notify(struct net_device *dev,
| ^~~~~~~~~~~~~~~~~~~~~~~~~
make[3]: *** [/usr/src/linux-headers-6.5.0-0.deb12.4-common/scripts/Makefile.build:248: /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build/os_dep/linux/ioctl_cfg80211.o] Error 1
make[2]: *** [/usr/src/linux-headers-6.5.0-0.deb12.4-common/Makefile:2059: /var/lib/dkms/rtl88x2cu/5.14.0.3-2~k6.1/build] Error 2
make[1]: *** [/usr/src/linux-headers-6.5.0-0.deb12.4-common/Makefile:246: __sub-make] Error 2
make[1]: Leaving directory ‘/usr/src/linux-headers-6.5.0-0.deb12.4-amd64’
make: *** [Makefile:2489: modules] Error 2

看上去还是最新 WiFi 规范新加的功能导致的 API 变动。不过 backports 的内核版本号一直在变动,我也没有这张网卡,所以就懒得改了…

6.5 不是 LTS 内核。没必要太折腾。

顺便说一句:Linux 的内核版本,真的太太太多了。难怪硬件厂商没兴致提供驱动。
工作量太大了。

我都准备换个 openBSD 7.4 试试了。听说 openBSD 对 Wi-Fi 无线网卡的支持不错,不知道支持到哪个程度了。

1 个赞

重新试了一下 你 2024-01-27 更新过的补丁。

测试环境:Debian 11 (bullseye), 6.1.0-0.deb11.13-amd64

打补丁的输出:相对上一版补丁,输出很清爽:

patching file core/rtw_br_ext.c
patching file os_dep/linux/ioctl_cfg80211.c
patching file os_dep/linux/os_intfs.c
patching file os_dep/linux/rtw_proc.c
patching file os_dep/linux/wifi_regd.c
patching file os_dep/osdep_service.c

(上一版的补丁,似乎有7个左右的 reject )

  • 又重新编译,并验证了新的驱动文件 88x2cu.ko

有非常明显的改善:

  • 打开网页,不再卡顿!

  • Linux QQ 现在也可以正常打开、运行!

等几天,我再验证下 Debian 12.4 amd64, kernel 6.1 的编译和使用效果。

再次致敬、感谢!

不应该有 reject 的。应该只有这几个文件而且都成功应用了补丁。

听起来上一个补丁没有正确应用成功?但是实际上两个版本几乎没有差异…

这几天在 Debian 11.8 am64, backports (升档) 内核 6.1.0-0.deb11.13-amd64

测试网速时,又确认了一个技术细节:

在编写 无线网卡驱动配置 conf 文件时
/etc/modprobe.d/rtl88x2cu.conf

1. 如果 USB 无线网卡是 迷你型的,或者是“内置天线”型的,在WiFi 信号不稳定

(比如距离较远,或者信号有穿墙、障碍物、或有金属层屏蔽时),配置文件需要多写几组参数,

否则,可能经常断网!
典型症状:在 测速网 进行测速时,经常出现这种情况:

  • 测试 “下载” 速度时,正常;
  • 而在测试 “上传” 速度时,经常断网。

示例:

options 88x2cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1 rtw_low_power=0

如果信号较好,或者是本身带有“外置天线”的 USB 无线网卡,通常只需要写2组参数就够用了:

options 88x2cu rtw_power_mgnt=0 rtw_enusbss=0

附、Realtek 无线网卡 驱动配置文件相关参数说明


#rtw_power_mgnt=0|1|2

0 = disable power saving/禁用省电

1 = power saving on, minPS/省电,最小

2 = power saving on, maxPS/省电,最大

#rtw_enusbss=0|1

0 = disable auto suspend/禁用自动睡眠

1 = enable auto suspend/启用自动睡眠

#rtw_hwpwrp_detect=0|1

0 = disable HW power pin detection/禁用硬件电源引脚检测

1 = enable HW power pin detection/启用硬件电源引脚检测

#rtw_ips_mode=0|1

0 = low power, IPS_NORMAL/低功耗,IPS_NORMAL

1 = higher power, IPS_LEVEL2/更高的功率,IPS_LEVEL2

#rtw_low_power=

0 = 禁用低功耗模式