Files
RedBear-OS/local
vasilito ab65678bb3 feat(iwlwifi): wire Rust MLD into live mac80211 dispatch path
The Rust MldState state machine was comprehensive but entirely dead
code -- never instantiated, never called. The C mac80211 ops vtable
(iwl_ops_* in linux_port.c) intercepted all callbacks and handled
them entirely in C.

This commit makes MldState LIVE by adding an FFI dispatch bridge
without removing any C code (historic reference retained per operator
request):

mld/dispatch.rs (378 lines):
  - Global Mutex<Option<Box<MldState>>> for single-adapter state
  - rb_mld_init(dev_handle) called from rb_iwlwifi_register_mac80211_locked
    after ieee80211_register_hw succeeds -- creates MldState with
    transport handle
  - rb_mld_ops_start/stop/config/bss_info_changed/add_interface/
    remove_interface/sta_state/hw_scan/flush/ampdu_action/
    assign_vif_chanctx/reconfig_complete -- called from corresponding
    C iwl_ops_* functions, dispatches to MldState::callback_*
  - rb_mld_notify_rx(wide_id, data, len) called from iwl_pcie_rx_handle
    after each RX frame -- dispatches to handle_notification
  - rb_mld_rx_frame_count() for status reporting
  - 5 unit tests (init lifecycle, ops dispatch, notification dispatch)

linux_mld.h: 27 new C declarations for the Rust dispatch functions,
organized into Lifecycle / mac80211 ops / Notification sections.

linux_port.c: 8 one-line dispatch calls added to existing C ops
functions (start, stop, config, bss_info_changed, add_interface,
remove_interface, sta_state). rb_mld_init after mac80211 registration.
rb_mld_notify_rx after each RX frame. All C logic remains intact.

mld/mod.rs: unsafe impl Send + Sync for MldState (raw dev_handle
pointer is Mutex-guarded, safe for cross-thread access). pub mod dispatch.

quirks.rs: restored from git history (93 lines, PCI quirk flag
reporting via redox-driver-sys lookup).

57 tests pass (51 + 5 new dispatch tests + 1 integration).
2026-07-26 01:49:36 +09:00
..