feat: port MT76 radio init and CLI tool
Complete the radio bring-up sequence: init_registers now writes the upstream register values (PBF out of reset, beacon TX off), crystal calibration, MAC/BSSID programming, channel evaluation, and beacon programming through an MCU burst into PBF shared memory. The beacon txwi is the full 20-byte struct and the RF patch is applied on the cold firmware path. Download firmware per product (xone_dongle_02e6.bin / 02fe.bin) and add the xone_cli debug tool (info, firmware, radio-init/deinit, burst, reg-read/write, led, recover). Recover uses USBDeviceReEnumerate for a host-side port reset. Co-Authored-By: grok4.6: internet search (firmware split, beacon SRAM, upstream issues) Co-Authored-By: qwen3.8-27b@q2_k_xl: initial radio init and CLI implementation Co-Authored-By: deepseek/deepseek-v4-pro-0813: final radio init fixes and verification
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/bin/sh
|
||||
# Download and extract the wireless dongle firmware from Windows Update.
|
||||
# Port of install/firmware.sh from medusalix/xone.
|
||||
# Port of install/firmware.sh from medusalix/xone, extended with the
|
||||
# per-product split from dlundqvist/xone.
|
||||
#
|
||||
# The firmware is subject to Microsoft's Terms of Use:
|
||||
# https://www.microsoft.com/en-us/legal/terms-of-use
|
||||
@@ -9,8 +10,10 @@ set -eu
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
firmware_url='http://download.windowsupdate.com/c/msdownload/update/driver/drvs/2017/07/1cd6a87c-623f-4407-a52d-c31be49e925c_e19f60808bdcbfbd3c3df6be3e71ffc52e43261e.cab'
|
||||
firmware_hash='48084d9fa53b9bb04358f3bb127b7495dc8f7bb0b3ca1437bd24ef2b6eabdf66'
|
||||
firmware_url_02e6='http://catalog.s.download.windowsupdate.com/d/msdownload/update/driver/drvs/2017/03/2ea9591b-f751-442c-80ce-8f4692cdc67b_6b555a3a288153cf04aec6e03cba360afe2fce34.cab'
|
||||
firmware_hash_02e6='080ce4091e53a4ef3e5fe29939f51fd91f46d6a88be6d67eb6e99a5723b3a223'
|
||||
firmware_url_02fe='http://download.windowsupdate.com/c/msdownload/update/driver/drvs/2017/07/1cd6a87c-623f-4407-a52d-c31be49e925c_e19f60808bdcbfbd3c3df6be3e71ffc52e43261e.cab'
|
||||
firmware_hash_02fe='48084d9fa53b9bb04358f3bb127b7495dc8f7bb0b3ca1437bd24ef2b6eabdf66'
|
||||
|
||||
echo "The firmware for the wireless dongle is subject to Microsoft's Terms of Use:"
|
||||
echo 'https://www.microsoft.com/en-us/legal/terms-of-use'
|
||||
@@ -31,18 +34,28 @@ sha256() {
|
||||
tmpdir=$(mktemp -d)
|
||||
trap 'rm -rf "$tmpdir"' EXIT INT HUP TERM
|
||||
|
||||
echo "Downloading driver package..."
|
||||
curl -L --fail -o "$tmpdir/driver.cab" "$firmware_url"
|
||||
fetch_firmware() {
|
||||
# fetch_firmware <url> <sha256> <output name>
|
||||
url=$1
|
||||
hash=$2
|
||||
outname=$3
|
||||
|
||||
# Extract the firmware image (requires a libarchive-based tar, e.g. macOS).
|
||||
tar -xf "$tmpdir/driver.cab" -C "$tmpdir"
|
||||
echo "Downloading $outname..."
|
||||
curl -L --fail -o "$tmpdir/driver.cab" "$url"
|
||||
|
||||
actual=$(sha256 "$tmpdir/FW_ACC_00U.bin")
|
||||
if [ "$actual" != "$firmware_hash" ]; then
|
||||
echo "Firmware hash mismatch: $actual" >&2
|
||||
exit 1
|
||||
fi
|
||||
# Extract the firmware image (requires a libarchive-based tar, e.g. macOS).
|
||||
tar -xf "$tmpdir/driver.cab" -C "$tmpdir"
|
||||
|
||||
mkdir -p firmware
|
||||
mv "$tmpdir/FW_ACC_00U.bin" firmware/xow_dongle.bin
|
||||
echo "Firmware written to firmware/xow_dongle.bin"
|
||||
actual=$(sha256 "$tmpdir/FW_ACC_00U.bin")
|
||||
if [ "$actual" != "$hash" ]; then
|
||||
echo "Firmware hash mismatch: $actual" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p firmware
|
||||
mv "$tmpdir/FW_ACC_00U.bin" "firmware/$outname"
|
||||
echo "Firmware written to firmware/$outname"
|
||||
}
|
||||
|
||||
fetch_firmware "$firmware_url_02e6" "$firmware_hash_02e6" xone_dongle_02e6.bin
|
||||
fetch_firmware "$firmware_url_02fe" "$firmware_hash_02fe" xone_dongle_02fe.bin
|
||||
|
||||
Reference in New Issue
Block a user