Skip to content

Commit

Permalink
update mt_wifi firmware option for WiFi driver
Browse files Browse the repository at this point in the history
  • Loading branch information
lgs2007m committed Oct 24, 2024
1 parent c2549e6 commit cd8578d
Show file tree
Hide file tree
Showing 7 changed files with 96 additions and 36 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/JDCloud-AX6000-Baili-hanwckf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@ on:
WIFI_DRIVER:
description: 'Choose WiFi Driver'
required: true
default: 'v7.6.7.2'
default: 'v7.6.7.2-fw-20240823(recommend)'
type: choice
options:
- v7.6.7.2
- v7.6.6.1
- v7.6.7.2-fw-20240823(recommend)
- v7.6.6.1-fw-20230808(recommend)
- v7.6.7.2-fw-default
- v7.6.6.1-fw-default
- v7.6.6.1-fw-20221208
- v7.6.6.1-fw-20230421
- v7.6.6.1-fw-20231024
SW_DRIVER:
description: 'Choose Switch Driver'
required: true
Expand Down Expand Up @@ -148,18 +153,25 @@ jobs:
- name: 设置WiFi驱动版本
run: |
cd openwrt
if [ ${{ github.event.inputs.WIFI_DRIVER }} == 'v7.6.6.1' ]; then
wifi_driver=$(echo "${{ github.event.inputs.WIFI_DRIVER }}" | sed -E 's/^(v[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/')
firmware=$(echo "${{ github.event.inputs.WIFI_DRIVER }}" | sed -E 's/^.*-fw-([0-9]{8}).*/\1/')
if [ "$wifi_driver" == "v7.6.6.1" ]; then
sed -i 's/CONFIG_MTK_MT_WIFI_DRIVER_VERSION_7672=y/CONFIG_MTK_MT_WIFI_DRIVER_VERSION_7661=y/g' .config
echo "Use WiFi Driver: v7.6.6.1"
if [ "$firmware" != "default" ]; then
sed -i "/CONFIG_MTK_MT_WIFI_DRIVER_VERSION/a CONFIG_MTK_MT_WIFI_MT7986_${firmware}=y" .config
fi
else
echo "Use WiFi Driver: v7.6.7.2"
if [ "$firmware" != "default" ]; then
cp $GITHUB_WORKSPACE/JDCloud-AX6000-Baili-hanwckf/mt79xx_20231229-4012a0_mt7986-fw-20240823.tar.xz dl/mt79xx_20231229-4012a0.tar.xz
fi
fi
echo "Use WiFi Driver: $wifi_driver-fw-$firmware"
- name: 设置交换机驱动
run: |
cd openwrt
if [ ${{ github.event.inputs.SW_DRIVER }} == 'DSA' ]; then
cp JDCloud-AX6000-Baili-hanwckf/mt7986a-dsa-jdcloud-re-cp-03.dts openwrt/target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-jdcloud-re-cp-03.dts
cd openwrt
cp $GITHUB_WORKSPACE/JDCloud-AX6000-Baili-hanwckf/mt7986a-dsa-jdcloud-re-cp-03.dts target/linux/mediatek/files-5.4/arch/arm64/boot/dts/mediatek/mt7986a-jdcloud-re-cp-03.dts
sed -i '/jdcloud,re-cp-03)/ {n; /eth0/ {s/eth0/lan1 lan2 lan3 lan4/; n; /ucidef_add_switch/ d}}' target/linux/mediatek/mt7986/base-files/etc/board.d/02_network
echo "Use Switch Driver: DSA"
else
Expand Down Expand Up @@ -262,11 +274,7 @@ jobs:
echo "- 使用源码:${{ env.REPO_URL }}" >> release.txt
echo "- 使用分支:${{ env.REPO_BRANCH }}" >> release.txt
echo "- 登录地址:${{ env.IP_ADDR }}" >> release.txt
if [[ "${{ env.WIFI_VERSION }}" == '-v7661' ]]; then
echo "- 使用WiFi驱动版本v7.6.6.1" >> release.txt
else
echo "- 使用WiFi驱动版本v7.6.7.2" >> release.txt
fi
echo "- 使用WiFi驱动${{ github.event.inputs.WIFI_DRIVER }}" >> release.txt
if [[ "${{ env.SWITCH }}" == '-gsw' ]]; then
echo "- 使用GSW交换机驱动(非DSA)" >> release.txt
else
Expand Down
45 changes: 30 additions & 15 deletions .github/workflows/RAX3000M-eMMC_XR30-eMMC-hanwckf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ on:
WIFI_DRIVER:
description: 'Choose WiFi Driver'
required: true
default: 'v7.6.7.2'
default: 'v7.6.7.2-fw-20240823(recommend)'
type: choice
options:
- v7.6.7.2
- v7.6.6.1
- v7.6.7.2-fw-20240823(recommend)
- v7.6.6.1-fw-20230306(recommend)
- v7.6.7.2-fw-default
- v7.6.6.1-fw-default
- v7.6.6.1-fw-20230330
- v7.6.6.1-fw-20230411
- v7.6.6.1-fw-20230717
- v7.6.6.1-fw-20231024
EEPROM:
description: 'Use nx30pro eeprom and fixed WiFi MAC address'
required: true
Expand Down Expand Up @@ -155,22 +161,35 @@ jobs:
- name: 设置WiFi驱动版本
run: |
cd openwrt
if [ ${{ github.event.inputs.WIFI_DRIVER }} == 'v7.6.6.1' ]; then
wifi_driver=$(echo "${{ github.event.inputs.WIFI_DRIVER }}" | sed -E 's/^(v[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/')
firmware=$(echo "${{ github.event.inputs.WIFI_DRIVER }}" | sed -E 's/^.*-fw-([0-9]{8}).*/\1/')
if [ "$wifi_driver" == "v7.6.6.1" ]; then
sed -i 's/CONFIG_MTK_MT_WIFI_DRIVER_VERSION_7672=y/CONFIG_MTK_MT_WIFI_DRIVER_VERSION_7661=y/g' .config
echo "Use WiFi Driver: v7.6.6.1"
if [ "$firmware" != "default" ]; then
sed -i "/CONFIG_MTK_MT_WIFI_DRIVER_VERSION/a CONFIG_MTK_MT_WIFI_MT7981_${firmware}=y" .config
fi
else
echo "Use WiFi Driver: v7.6.7.2"
if [ "$firmware" != "default" ]; then
cp $GITHUB_WORKSPACE/RAX3000M-eMMC_XR30-eMMC-hanwckf/mt79xx_20231229-4012a0_mt7981-fw-20240823.tar.xz dl/mt79xx_20231229-4012a0.tar.xz
fi
fi
echo "Use WiFi Driver: $wifi_driver-fw-$firmware"
- name: 使用nx30pro的高功率eeprom并固定WiFi MAC地址
if: github.event.inputs.EEPROM == 'true'
run: |
if [ ${{ github.event.inputs.WIFI_DRIVER }} == 'v7.6.6.1' ]; then
cp RAX3000M-eMMC_XR30-eMMC-hanwckf/nx30pro_eeprom.bin openwrt/package/mtk/drivers/mt_wifi/files-7661/bin/mt7981/rebb/MT7981_iPAiLNA_EEPROM.bin
cd openwrt
wifi_driver=$(echo "${{ github.event.inputs.WIFI_DRIVER }}" | sed -E 's/^(v[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+).*/\1/')
firmware=$(echo "${{ github.event.inputs.WIFI_DRIVER }}" | sed -E 's/^.*-fw-([0-9]{8}).*/\1/')
if [ "$wifi_driver" == "v7.6.6.1" ]; then
cp $GITHUB_WORKSPACE/RAX3000M-eMMC_XR30-eMMC-hanwckf/nx30pro_eeprom.bin package/mtk/drivers/mt_wifi/files-7661/bin/mt7981/rebb/MT7981_iPAiLNA_EEPROM.bin
else
cp RAX3000M-eMMC_XR30-eMMC-hanwckf/mt79xx_20231229-4012a0_nx30pro_eeprom.tar.xz openwrt/dl/mt79xx_20231229-4012a0.tar.xz
if [ "$firmware" != "default" ]; then
cp $GITHUB_WORKSPACE/RAX3000M-eMMC_XR30-eMMC-hanwckf/mt79xx_20231229-4012a0_mt7981-fw-20240823_eeprom.tar.xz dl/mt79xx_20231229-4012a0.tar.xz
else
cp $GITHUB_WORKSPACE/RAX3000M-eMMC_XR30-eMMC-hanwckf/mt79xx_20231229-4012a0_eeprom.tar.xz dl/mt79xx_20231229-4012a0.tar.xz
fi
fi
cd openwrt
## 创建一个辅助文件。文件内容是写入MAC地址到dat文件,固定wifi MAC地址
echo -e "\t\tlocal wifi0_mac=\"\$(mmc_get_mac_binary factory 0x04)\"
\t\tsed -i \"/^MacAddress=.*/ {s/.*/MacAddress=\$wifi0_mac/;b;}; \\\$aMacAddress=\$wifi0_mac\" /etc/wireless/mediatek/mt7981.dbdc.b0.dat
Expand Down Expand Up @@ -277,11 +296,7 @@ jobs:
echo "- 使用源码:${{ env.REPO_URL }}" >> release.txt
echo "- 使用分支:${{ env.REPO_BRANCH }}" >> release.txt
echo "- 登录地址:${{ env.IP_ADDR }}" >> release.txt
if [[ "${{ env.WIFI_VERSION }}" == '-v7661' ]]; then
echo "- 使用WiFi驱动版本v7.6.6.1" >> release.txt
else
echo "- 使用WiFi驱动版本v7.6.7.2" >> release.txt
fi
echo "- 使用WiFi驱动${{ github.event.inputs.WIFI_DRIVER }}" >> release.txt
if [[ "${{ env.EEPROM }}" == '-eeprom' ]]; then
echo "- 使用nx30pro高功率eeprom并固定WiFi MAC地址" >> release.txt
else
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
53 changes: 45 additions & 8 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,37 @@
设置LAN IP地址(路由器登录地址),默认192.168.1.1。

- #### 2. Choose WiFi Driver
默认使用WiFi驱动版本v7.6.7.2,可选旧版驱动v7.6.6.1。
SSH查看WiFi驱动版本:
默认使用WiFi驱动版本v7.6.7.2-fw-20240823(recommend)。mt_wifi的firmware可选,warp默认使用驱动自带,不可选。
驱动版本v7.6.7.2-fw-default不建议使用,我使用5G无线,电脑打CS2同时手机刷视频,CS2会延迟增高卡顿。
v7.6.7.2-fw-20240823(recommend) 推荐,使用[mtk-openwrt-feeds(20240823)](https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/0fdbc0e6d84bbc0216da2842a494bdf01f745c6c)
v7.6.6.1-fw-20230808(recommend) 推荐,使用提取自TP-XDR6088固件的fw-20230808
v7.6.7.2-fw-default 使用驱动包自带firmware fw-20231229
v7.6.6.1-fw-default 使用驱动包自带firmware fw-20220906
v7.6.6.1-fw-20221208 使用mt7986-7.6.7.0-20221209-b9c02f-obj驱动包的fw-20221208
v7.6.6.1-fw-20230421 使用mtk-openwrt-feeds(20230421)的fw-20230421
v7.6.6.1-fw-20231024 使用mtk-openwrt-feeds(20231024)的fw-20231024
```
iwpriv rax0 get_driverinfo
# SSH查看内核版本
uname -a
# 查看WiFi驱动版本
iwpriv ra0 get_driverinfo
# 查看WiFi驱动mt_wifi mt7986 firmware版本
strings /lib/firmware/7986_WACPU_RAM_CODE_release.bin | grep -E '202[0-9]{6}'
strings /lib/firmware/mt7986_patch_e1_hdr.bin | grep -E '202[0-9]{6}'
strings /lib/firmware/mt7986_patch_e1_hdr_mt7975.bin | grep -E '202[0-9]{6}'
strings /lib/firmware/WIFI_RAM_CODE_MT7986.bin | grep -E '202[0-9]{6}'
strings /lib/firmware/WIFI_RAM_CODE_MT7986_MT7975.bin | grep -E '202[0-9]{6}'
# 查看WiFi驱动warp mt7986 firmware版本
strings /lib/firmware/7986_WOCPU0_RAM_CODE_release.bin | grep -E '202[0-9]{6}'
strings /lib/firmware/7986_WOCPU1_RAM_CODE_release.bin | grep -E '202[0-9]{6}'
```

- #### 3. Choose Switch Driver
默认使用GSW交换机驱动,可选DSA交换机驱动。
GSW:Gigabit Switch swconfig 模式,有交换机配置插件,不过京东云百里AX6000的WAN是单独接CPU的2.5G PHY RTL8221B,不接在MT7531交换机上,所以WAN不支持在交换机配置插件中设置VLAN。
DSA:Distributed Switch Architecture 分布式交换架构模式,DSA没有单独的交换机配置插件,但在“网口”-“接口”-“设备”选项卡中的br-lan设备中的网桥VLAN过滤中可以查看网口状态设置VLAN。
百里原厂固件使用的是DSA,hanwckf大佬源码中百里的交换机驱动先前是DSA,在WAN、LAN互换时硬件加速可能失效。
目前hanwckf大佬源码中百里已改为使用GSW,使用GSW在WAN、LAN互换时硬件加速正常。
百里原厂固件使用的是DSA,hanwckf大佬源码中百里的交换机驱动先前是DSA,听说在WAN、LAN互换时硬件加速可能失效,但是我测试了是正常的
目前hanwckf大佬源码中百里已改为使用GSW,使用GSW在WAN、LAN互换时硬件加速正常,所以DSA、GSW随便用吧
两者具体区别可以参考OpenWrt社区资料:[converting-to-dsa](https://openwrt.org/docs/guide-user/network/dsa/converting-to-dsa) [dsa-mini-tutorial](https://openwrt.org/docs/guide-user/network/dsa/dsa-mini-tutorial)

- #### 4. Use luci-app-mtk wifi config
Expand Down Expand Up @@ -96,10 +115,28 @@ RAX3000Z增强版(XR30-eMMC)的eMMC默认使用52MHz频率
设置LAN IP地址(路由器登录地址),默认192.168.1.1。

- #### 2. Choose WiFi Driver
默认使用WiFi驱动版本v7.6.7.2,可选旧版驱动v7.6.6.1。
SSH查看WiFi驱动版本:
默认使用WiFi驱动版本v7.6.7.2-fw-20240823(recommend)。mt_wifi的firmware可选,warp默认使用驱动自带,不可选。
驱动版本v7.6.7.2-fw-default在mt7986机子上,我使用5G无线,电脑打CS2同时手机刷视频,CS2会延迟增高卡顿。
【mt7981的机子上未测试,建议直接使用推荐的选项。】
v7.6.7.2-fw-20240823(recommend) 推荐,使用[mtk-openwrt-feeds(20240823)](https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/0fdbc0e6d84bbc0216da2842a494bdf01f745c6c)
v7.6.6.1-fw-20230306(recommend) 推荐,使用提取自H3C-NX30Pro固件的fw-20230306
v7.6.7.2-fw-default 使用驱动包自带firmware fw-20231229
v7.6.6.1-fw-default 使用驱动包自带firmware fw-20220906
v7.6.6.1-fw-20230330 使用提取自TP-XDR3030固件的fw-20230330
v7.6.6.1-fw-20230411 使用提取自H3C-NX30Pro固件的fw-20230411
v7.6.6.1-fw-20230717 使用提取自Xiaomi-AX3000T固件的fw-20230717
v7.6.6.1-fw-20231024 使用mtk-openwrt-feeds(20231024)的fw-20231024
```
iwpriv rax0 get_driverinfo
# SSH查看内核版本
uname -a
# 查看WiFi驱动版本
iwpriv ra0 get_driverinfo
# 查看WiFi驱动mt_wifi mt7981 firmware版本
strings /lib/firmware/7981_WACPU_RAM_CODE_release.bin | grep -E '202[0-9]{6}'
strings /lib/firmware/mt7981_patch_e1_hdr.bin | grep -E '202[0-9]{6}'
strings /lib/firmware/WIFI_RAM_CODE_MT7981.bin | grep -E '202[0-9]{6}'
# 查看WiFi驱动warp mt7981 firmware版本
strings /lib/firmware/7981_WOCPU0_RAM_CODE_release.bin | grep -E '202[0-9]{6}'
```

- #### 3. Use nx30pro eeprom and fixed WiFi MAC address
Expand Down

0 comments on commit cd8578d

Please sign in to comment.