Erwan 3f3e37ce46 feat(wifi): unlock SCAN_REQ (ENXIO=6) via getScanManager and implement IO80211Glue WCL scan pipeline (0x8e0 ABI)
Breakthroughs & Reverse-Engineering (BootKernelExtensions.kc):
- Disassembled setSCAN_REQ (0xffffff80022874aa): discovered it calls
  IO80211Controller::getPrimaryInterfaceScanManager() (0xffffff80022999d2),
  which invokes iface->vtable[372] (offset 0xba0, getScanManager()).
  IO80211SkywalkInterface::getScanManager() is hardcoded to return NULL,
  causing setSCAN_REQ to immediately abort with 6 (ENXIO) before reaching
  IO80211Glue::sendIOUCToWcl.
- Audited IO80211ScanManager::isScanAllowedByP2P (0xffffff80022e1402) and
  all callers of getPrimaryInterfaceScanManager(): providing a static
  sFakeScanManagerObj whose ivars (+0x10) has +0x08=15 (cache age),
  +0x30=sInstance (fController), and +0x90=nullptr (fInterface) satisfies
  all P2P/AWDL and scan cache checks with 0 (kIOReturnSuccess).
- Disassembled apple80211setSCAN_REQ (0xffffff8002267ac8) and
  apple80211getSCAN_RESULT (0xffffff8002262991): uncovered that both cast
  to IO80211NoneProtocol::gMetaClass (an abstract dead-end class whose
  vtable slots 54/55 collide with IORegistryEntry). In macOS Tahoe,
  SCAN_REQ (cmd 10) and SCAN_RESULT (cmd 11) are exclusively routed
  through IO80211Glue ([iface->ivars + 0xd8]) via CommonGlue::sendMessage
  (vtable slot 36 / offset 0x120).
- Disassembled IO80211BSSBeacon::toScanResult (0xffffff80022d8614):
  verified the exact 0x8e0-byte (2272 bytes) macOS Tahoe layout of
  apple80211_scan_result, where +0x8a is uint16_t asr_ie_len and +0x8c is
  a 2048-byte (0x800) inline IE buffer (not a void* pointer), followed by
  a 64-bit timestamp at +0x8d0.

Modifications:
- QualcommWifi/QualcommWifi.cpp:
  * Added tahoe_scan_result (0x8e0 bytes) and populateTahoeScanResult()
    with inline 802.11 IEs (SSID, Supported Rates, DS Parameter Set, and
    RSN WPA2-PSK AES-CCMP).
  * Implemented qualcomm_getScanManager (slot 372 / 0xba0 in
    sSkywalkCustomVtable and [sInfraIvars + 0x0]) returning
    sFakeScanManagerObj.
  * Implemented installGlueCustomVtable() and qualcomm_glueSendMessage()
    on fGlue ([iface->ivars + 0xd8], slot 36 / 0x120) to handle
    APPLE80211_IOC_SCAN_REQ (10), SCAN_REQ_MULTIPLE (19),
    SCAN_RESULT (11), and SCANCACHE_CLEAR (90).
- docs/ISSUES_AND_POSTMORTEMS.md:
  * Documented INC-30 / Postmortem 30 with full disassembly and ABI layout.

Validation:
- Built Release kext via ./build_wifi.sh with zero warnings/errors.
- Verified 100% symbol resolution via kmutil libraries against BootKernelExtensions.kc.
- Deployed to /Volumes/EFI/EFI/OC/Kexts/QualcommWifi.kext (MD5: 886b7780a072f2135120ceae4c9f1df4).
2026-10-20 12:39:18 +02:00
2026-10-15 18:07:10 +02:00

QualcommWireless

macOS Tahoe Wi-Fi 7 Bluetooth 5.4 OpenCore Architecture

Pilote unifié haute performance pour les modules Qualcomm FastConnect 7800 (WCN7850) sous macOS Tahoe (26.x / Darwin 25) et macOS Sequoia (15.x / Darwin 24).

Ce projet fournit une prise en charge Wi-Fi 7 native intégrée à la pile réseau sans fil Apple (IO80211Controller / Skywalk), ainsi que l'initialisation complète et le téléversement de microprogramme du sous-système Bluetooth 5.4 via USB.


Sommaire


Présentation du Matériel

Le module Qualcomm FastConnect 7800 (WCN7850) combine deux contrôleurs matériels sur une même carte M.2 :

Composant Interface Bus Identifiants Matériels (VID:PID) Spécifications
Wi-Fi PCI Express Gen3 x1 0x17cb:0x1107 Wi-Fi 7 (802.11be), 2.4/5/6 GHz, 320 MHz, 4096-QAM
Bluetooth USB 2.0 (Bus Interne) 0x0489:0xe10d (Foxconn) Bluetooth 5.4, LE Audio, HCI USB Standard

Fonctionnalités Principales

🌐 Wi-Fi Natif Apple (QualcommWifi)

  • Véritable interface sans fil Apple80211 : Dérive directement de IO80211Controller, compatible avec l'ABI Skywalk de macOS Tahoe 26.x (__IO80211_TARGET=260000, vtable 463 slots), évitant toute émulation Ethernet artificielle.
  • Intégration macOS complète :
    • Détection automatique dans le Centre de Contrôle et la barre des menus.
    • Compatibilité avec le framework CoreWLAN et le daemon système airportd.
    • Scan des réseaux environnants (APPLE80211_IOC_SCAN_REQ_MULTIPLE).
    • Prise en charge des canaux 2.4 GHz (1-14), 5 GHz (UNII-1 à UNII-4) et 6 GHz (UNII-5 à UNII-8).
  • Moteur MHI / BHI & Fenêtrage PCIe :
    • Implémente le protocole Qualcomm MHI (Modem Host Interface).
    • Gestion automatique du registre de fenêtrage BAR0 (0x310c).
    • Chargement des microprogrammes amss.bin, board-2.bin et m3.bin.

📶 Bluetooth 5.4 LE Audio (QualcommWireless)

  • Initialisation & Patching du Firmware USB :
    • Vérification de l'état QCA (QCA_CHECK_STATUS, QCA_GET_TARGET_VERSION).
    • Téléversement séquentiel du RAMPATCH (rampatch_usb_00190200_bin) et du NVM via les pipes de contrôle EP0 et Bulk OUT EP2.
    • Réinitialisation matérielle propre (HCI_Reset) et interception Shadow VTable de IOUSBHostDevice::deviceRequest (slot 374 / 0x176).
  • Compatibilité Apple :
    • Connexion fluide des périphériques Apple (Magic Mouse 2, Magic Keyboard, Magic Trackpad).
    • Audio Bluetooth (A2DP, HFP/HSP) et profils GATT/BLE.

Architecture du Pilote

graph TD
    subgraph macOS["macOS Tahoe 26.x (Darwin 25) / Sequoia 15.x"]
        UI["Centre de Contrôle / Barre de Menus"]
        AirportD["airportd / CoreWLAN.framework"]
        BtD["bluetoothd / IOBluetoothFamily"]
        IO80211["com.apple.iokit.IO80211Family"]
        IOUSB["com.apple.iokit.IOUSBHostFamily"]
    end

    subgraph Kext["QualcommWireless.kext"]
        QWifi["QualcommWifi (IO80211Controller)\n• handleCardSpecific / Skywalk\n• BHI/MHI Pipeline\n• BAR0 Windowing"]
        QBt["QualcommWireless (IOService)\n• DFU Firmware Upload\n• RAMPATCH + NVM\n• Shadow VTable & Registry Spoofing"]
    end

    subgraph Hardware["Puce Qualcomm WCN7850"]
        PCIe["Bus PCIe (0x17cb:0x1107)\nWi-Fi 7 (AMSS)"]
        USB["Bus USB (0x0489:0xe10d)\nBluetooth 5.4 HCI"]
    end

    UI --> AirportD
    AirportD --> IO80211
    IO80211 --> QWifi
    QWifi --> PCIe

    BtD --> IOUSB
    IOUSB --> QBt
    QBt --> USB

Documentation Technique

Le dossier docs/ contient une documentation technique exhaustive :

  • 📐 ARCHITECTURE.md : Détail complet des interactions logicielles et matérielles, pipelines firmware et topologies de bus.
  • 🔵 BLUETOOTH.md : Analyse post-mortem du crash L2CAP au démarrage de session, séquence DFU et configuration bluetoothd sous Sequoia et Tahoe.
  • 📡 NATIVE_WIFI.md : Implémentation du pilote IO80211Controller, vtable Skywalk macOS Tahoe et table des IOCTLs Apple80211.
  • 🛠️ BUILD.md : Guide de compilation, injection dans l'EFI OpenCore et commandes de diagnostic.

Compilation

Prérequis

  • Xcode 26+ (ex. Xcode 26.6 avec SDK macOS 26.5) sous macOS Tahoe, ou Xcode 16+ sous macOS Sequoia.
  • Outils en ligne de commande Xcode (xcode-select --install).

Lancer la compilation

Dans le terminal, exécutez la commande suivante à la racine du projet :

xcodebuild -project QualcommWireless.xcodeproj -configuration Release

Le bundle kext final est généré dans : build/Release/QualcommWireless.kext

Il s'agit d'un binaire universel supportant nativement x86_64 (Hackintosh Intel/AMD) et arm64e (Apple Silicon).


Installation avec OpenCore

  1. Copier le Kext : Montez votre partition EFI et copiez QualcommWireless.kext dans EFI/OC/Kexts/.

  2. Ajouter dans config.plist : Dans la section Kernel -> Add :

    <dict>
        <key>Arch</key>
        <string>Any</string>
        <key>BundlePath</key>
        <string>QualcommWireless.kext</string>
        <key>Comment</key>
        <string>Qualcomm FastConnect 7800 Wi-Fi & Bluetooth</string>
        <key>Enabled</key>
        <true/>
        <key>ExecutablePath</key>
        <string>Contents/MacOS/QualcommWireless</string>
        <key>MaxKernel</key>
        <string></string>
        <key>MinKernel</key>
        <string></string>
        <key>PlistPath</key>
        <string>Contents/Info.plist</string>
    </dict>
    
  3. Arguments de démarrage recommandés (NVRAM -> boot-args) :

    -btlfxallowanyaddr -btlfxnvramcheck
    

Résolution des Problèmes & Bonnes Pratiques

Caution

Règle d'or : JAMAIS d'IntelBTPatcher.kext !

Le kext tiers IntelBTPatcher.kext est conçu uniquement pour les puces Intel. Sous macOS 15 Sequoia (Darwin 24), il installe des hooks défaillants dans IOBluetoothFamily qui provoquent un Kernel Panic systématique lors du chargement de la session utilisateur (IOBluetoothL2CAPChannel corrupted the registry).

Assurez-vous qu'IntelBTPatcher.kext est totalement désactivé et supprimé de votre EFI.

Important

Conservation de BlueToolFixup.kext

Le kext BlueToolFixup.kext (issu de la suite Acidanthera) reste nécessaire et doit être conservé dans votre EFI afin de permettre à bluetoothd de prendre en charge les contrôleurs Bluetooth tiers.


Licence

Ce projet est distribué sous les termes de la licence BSD-3-Clause. Tous droits réservés.

S
Description
No description provided
Readme
6.7 MiB
0 Stars 1 Watchers 0 Forks
Languages
C++ 52.2%
C 31.1%
Objective-C 16.6%