make scripts
必须提取更新证书,否则会报错停止。
 make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- -C /root/arm64debian/linux-4.19.149 M=/root/arm64debian/linux-4.19.149/usbWLAN/DPO  modules -I ./include

export RT28xx_DIR=/root/arm64debian/linux-4.19.149/usbWLAN/DPO
直接修改Makefile文件内的RT28xx_DIR
make  -I /root/arm64debian/linux-4.19.149/usbWLAN/DPO/include

文件内添加:
/root/arm64debian/linux-4.19.149/usbWLAN/DPO/include/

/root/arm64debian/linux-4.19.149/usbWLAN/DPO/include/rt_config.h

~/arm64debian/linux-4.19.149/usbWLAN/DPO/sta/assoc.c  文件内有引用rt_config.h

rt_config.h报错用这个解决:
https://blog.csdn.net/qq160816/article/details/52293826
os/linux/config.mk中添加了下一句
ifeq ($(PLATFORM),ARM64)  
EXTRA_CFLAGS := -D__KERNEL__ -DMODULE $(WFLAGS)  
export EXTRA_CFLAGS  
endif 


报错:./include/cfg80211.h:   struct ieee80211_supported_band Cfg80211_bands[IEEE80211_NUM_BANDS];
解决办法:
 vi /root/arm64debian/linux-4.19.149/usbWLAN/DPO/include/cfg80211.h
-               struct ieee80211_supported_band sbands[IEEE80211_NUM_BANDS];
+               struct ieee80211_supported_band sbands[NUM_NL80211_BANDS];



报错:
Current patch tested with 3.15.4, which fixes an incorrect type usage and removes the __DATE__ and __TIME__ macro usage (they prevent repeated builds from making identical output).

/DPO/sta/sta_cfg.c
-            snprintf(extra, size, "Driver version-%s, %s %s\n", STA_DRIVER_VERSION, __DATE__, __TIME__ );
+            snprintf(extra, size, "Driver version-%s, \n", STA_DRIVER_VERSION);

ap模式:
 -     /*DBGPRINT(RT_DEBUG_OFF, ("driver version: %s (%s %s) .\n", AP_DRIVER_VERSION, __DATE__, __TIME__));*/
   +     DBGPRINT(RT_DEBUG_OFF, (Driver version-%s, \n", STA_DRIVER_VERSION));

/root/arm64debian/linux-4.19.149/usbWLAN/DPO/include/mlme.h文件报错: error: unknown type name ‘BSS_2040_COEXIST_IE

增加函数:
https://www.spinics.net/lists/linux-wireless/msg123434.html



这个时一个补丁文件
https://gridlox.net/diff/rt5592sta_fix_64bit_3.15.patch



交叉编译关机配置:  make menuconfig时候要带上平台,和编译器名
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- menuconfig


编译8192cu
如果内核选择了CONFIG_MODVERSIONS选项,你的模块的Makefile要增加以下几行
CFLAGS += -DMODVERSIONS -include /usr/src/linux/include/linux/modversions.h

AI提示在编译命令中插入禁用
在这个 Makefile 中,我们使用了 KBUILD_MODVERSIONS=n 来禁用 MODVERSIONS,确保编译的 .ko 文件不包含版本信息。

make KBUILD_MODVERSIONS=n  用这命令编译测试:成功。  编译结果没有modversions,在源码目录下配置过menuconfig,禁用了modversions
Symbol: MODVERSIONS [=y]                                                                                                   x
  x Type  : bool                                                                                                               x
  x Prompt: Module versioning support                                                                                          x
  x   Location:                                                                                                                x
  x (5) -> Enable loadable module support (MODULES [=y])                                                                       x
  x   Defined at init/Kconfig:1824                                                                                             x
  x   Depends on: MODULES [=y]                                                                                                 x
  x   Selected by [n]:                                                                                                         x
  x   - GCC_PLUGIN_RANDSTRUCT [=n] && GCC_PLUGINS [=n] && MODULES [=y]



内核编译到这里终止:
  CC [M]  kernel/torture.o
make[1]: *** No rule to make target 'debian/canonical-certs.pem', needed by 'certs/x509_certificate_list'.  Stop.
make: *** [Makefile:1074: certs] Error 2

直接运行这个命令:
scripts/config --disable SYSTEM_TRUSTED_KEYS

其他报错needed by 'certs/x509_revocation_list解决办法:
scripts/config --disable SYSTEM_REVOCATION_KEYS

原有参数源码路径在build目录内,我修改为内核下载路径测试正常:
LINUX_SRC = /root/arm64debian/linux-4.19.149

测试3:
https://github.com/caruofc/MT7612U-Driver

思科驱动:不同型号可以兼容:
https://launchpad.net/~thopiekar/+archive/ubuntu/mt7601 7601的驱动
https://askubuntu.com/questions/641724/how-to-install-rt2870-rt3070-wireless-driver
https://github.com/torvalds/linux/tree/master/drivers/net/wireless/mediatek/mt7601u 
here's a ppa repo for this - MT7601 STA driver. I have tested it for RT2870 driver and it worked for me.

Plug your USB adapter in and run the following commands:

sudo add-apt-repository ppa:thopiekar/mt7601
sudo apt-get update
sudo apt-get install mt7601-sta-dkms
When the installation completes, click on the wi-fi network icon and you should see the USB adapter network interface.