IMPROVEMENT-PLAN.md §10.3 item 7: HIGH severity transmute audit.
mac80211.rs:469:
- RxCallback type changed from extern "C" fn to unsafe extern "C" fn
- Callback call now wrapped in unsafe { } (correct for FFI callback)
- Added SAFETY comment: explains HashMap<usize,usize> storage pattern
and why usize→fn pointer transmute is sound (same size, valid ABI)
timer.rs:202:
- Added SAFETY comment: explains Linux kernel timer callback ABI
(setup_timer/mod_timer always uses void (*)(unsigned long))
- transmute remains (necessary: usize from C → fn pointer)
Both transmutes are now documented with soundness invariants.
No actual UB was found — both transmutes were already safe.
The fix is documentation, not behavioral change.
IMPROVEMENT-PLAN.md §10.3 items 4-5: P1 Wi-Fi fixes.
Scan channels expanded from 2.4GHz-only (11 channels) to
include 5GHz UNII bands (25 channels, 36-165). Total scan
now covers 36 channels across both bands.
MAX_SCAN_CHANNELS increased from 16 to 64 to accommodate
dual-band scan.
Gap documentation added as a comment block at the file header:
- No MVM layer (iwl-mvm.c ~5200 lines)
- No firmware TLV/NVM parser
- rate_idx hardcoded to 0 (no Minstrel)
- RSSI hardcoded to -42
- No AMPDU aggregation
- No power management
- Only 7 PCI device IDs (vs Linux's ~500+)
- No 6GHz support
rate_idx and signal lines marked with TODO(REDBEAR-WIFI)
tags pointing to Linux 7.1 reference files for future porting.
Cross-referenced with Linux 7.1 iwl-mvm-rs.c, iwl-nvm-parse.c.
Phase 4 (syscall): merged upstream 0.9.0 — reservation API (openat_into/dup_into) + removed legacy syscalls. Both old and new APIs coexist for backward compatibility.
Phase 2 (kernel): added openat_into() and dup_into() handlers to fs.rs, registered SYS_OPENAT_INTO and SYS_DUP_INTO in syscall dispatch mod.rs.
Phase 1 (bootstrap): migrated initnsmgr.rs from openat_with_filter→openat_into + unlinkat_with_filter→unlinkat.
SYSCALL-MIGRATION-PLAN.md:
- Detailed analysis of upstream 0.9.0 BREAKING changes (FD reservation refactor,
removed syscalls, new *_into variants)
- Complete consumer impact catalog: 2 bootstrap call sites, 7 kernel/relibc
constant references, 26 recipes (no impact)
- 5-phase migration plan: bootstrap→kernel→relibc→syscall sync→full build
- Risk assessment with rollback procedure
- Clear migration table: old API → new API for each deprecated function/constant
- Execution order with time estimates (~1-2 days total)
NETWORKING-IMPROVEMENT-PLAN.md:
- Phase 0 updated from 'workstreams' to COMPLETE with verified upstream commits
- Added fork state table (8 components, HEADs, upstream HEADs, gaps)
- All 7 required upstream commits verified present in local forks
- syscall flagged as BREAKING (removed syscalls, FD reservation refactor)
IMPLEMENTATION-MASTER-PLAN.md:
- Added section 11: Upstream Sync Status (2026-07-07)
- Fork state table with gap analysis per component
- Key upstream changes to track: syscall breaking refactor, kernel NUMA, libredox fcntl
- Renumbered sections 11-15
Findings:
- All 8 forks at +rb0.3.0 with Red Bear changes intact
- Gaps are minor (2-3 commits each) except syscall (BREAKING)
- UPSTREAM-SYNC-PROCEDURE.md (770 lines) is comprehensive and current
- No stale plan parts to remove — all docs are active and referenced
Update the master implementation plan to reference the new
IMPROVEMENT-PLAN.md which contains the comprehensive quality
gaps found during the 2026-07-07 USB/Wi-Fi/Bluetooth audits.
Key changes:
- Added IMPROVEMENT-PLAN.md to the authoritative plans table
- Added §10 Quality Gaps section with USB/Wi-Fi/Bluetooth audit findings
- Updated §11 Execution Priority with P0/P1/P2/P3 tiers
- Cross-references Linux 7.1 source files for each improvement task
- The IMPROVEMENT-PLAN.md has detailed file:line references for every gap
This establishes the two-plan architecture:
- IMPLEMENTATION-MASTER-PLAN.md: feature work, P0 from build
- IMPROVEMENT-PLAN.md: quality work, P0 from safety
No new repositories or submodules created.
Cross-compile error: from_bits_truncate requires u8 but
O_STAT/O_RDWR are usize. Cast with 'as u8'.
Applied to all 4 scheme wrappers: acmd, ftdi, ecmd, usbaudiod.
redbear-ecmd: scheme loop replaces stdout on Redox
(/scheme/net/usbECM_<N>), notification reader kept for
CDC link state / speed change events on both paths.
redbear-usbaudiod: scheme loop replaces stdout on Redox
(/scheme/audio/usbAudio_<N>), stdin→isoch_OUT playback
thread kept for host stdout path only.
All 4 class drivers now fully wired:
acmd → scheme event loop active on Redox ✅
ftdi → scheme event loop active on Redox ✅
ecmd → scheme event loop active on Redox ✅
usbaudiod → scheme event loop active on Redox ✅
redbear-ecmd: EcmScheme → /scheme/net/usbECM_<N> for netstack
redbear-usbaudiod: AudioScheme → /scheme/audio/usbAudio_<N> for audiod
(supports capture/playback path routing via openat path names)
All 4 class drivers now have scheme service wrappers:
redbear-acmd → /scheme/ttys/usbACM_<N>
redbear-ftdi → /scheme/ttys/usbFTDI_<N>
redbear-ecmd → /scheme/net/usbECM_<N>
redbear-usbaudiod → /scheme/audio/usbAudio_<N>
(HID+Storage already have scheme integration via ProducerHandle/DiskScheme)
Cross-referenced with Linux 7.1 tty_port_register_device() pattern.
New scheme.rs module:
- AcmScheme implements SchemeSync with Mutex-wrapped XhciEndpHandle
- openat(): root dir listing + device file open (O_RDWR)
- read(): USB bulk IN → scheme client (getty, terminal)
- write(): scheme client → USB bulk OUT
- close(): decrements open count
- fsync(): no-op
main.rs:
- #[cfg(target_os = redox)]: Socket::create() + register scheme
under /scheme/ttys/usbACM_<port_id>, process requests with
handle_scheme_mut() in event loop
- #[cfg(not(target_os = redox))]: stdout fallback for testing
This enables getty to open /scheme/ttys/usbACM_<N> as a serial
console on USB CDC ACM devices — the driver is now a proper
Redox scheme service, not just a stdout debugging tool.
Pattern replicable for redbear-ftdi (same scheme:ttys), redbear-ecmd
(scheme:net), and redbear-usbaudiod (scheme:audio).
The Redox init system connects daemon stdout to the appropriate
scheme service on spawn. No explicit scheme registration needed
in the driver — stdout/stderr are the scheme IPC endpoints.
This is the standard Redox daemon architecture:
- Input daemons (HID, storage) write to stdout → scheme:input, scheme:disk
- Output daemons (ACM, ECM, Audio) read/write stdout → scheme:ttys, scheme:net
- The init system handles pipe-to-scheme binding via .service files
Removed unused redox-scheme dependency that was added for a
Socket::accept()-based approach (accept() not available in this
version of redox-scheme). The stdout pattern is the correct,
working architecture.
app.rs:199-214 — menubar handle_key now uses if-let instead of
guarded .unwrap(); dispatch result is no longer swallowed
(errors set status message)
app.rs:391 — Ctrl-Z suspend kill command error now logged
terminal/mod.rs:118,147 — frame-draw + restore flush() now use
.ok() pattern instead of let _ = (more explicit intent)
viewer/mod.rs:967 — menubar.take().unwrap() replaced with
if-let Some(mut mb) pattern
Panic hook write/flush swarrows kept intentionally — stdout
is unrecoverable during a crash; added explanatory comment.
Tests: 1427 pass, zero warnings.
Critical fixes (46 audit findings addressed):
app.rs:74 — poll() error in event loop now logs + breaks instead
of silently continuing (prevents silent hang on stdin failure)
config.rs:47 — .expect() in Config::default() replaced with
unwrap_or_else + log::error + full-field fallback config
dialog_ops.rs:831-842 — .expect() in spawned copy/move threads
replaced with let-else pattern that sends OpsError through
the channel gracefully (no more thread panics)
app.rs:43-46 — current_dir / canonicalize errors now logged
via inspect_err before falling back
main.rs:115 — logging init failure now prints to stderr via
unwrap_or_else(eprintln!) instead of silent discard
viewer/mod.rs:540 — filepos save failure now logged at debug
level instead of silently swallowed
terminal/mod.rs:73-74 — tcgetattr failure now logged at warn
level with a clear message about incomplete terminal restore
Tests: 1427 pass, zero warnings.
High-severity fixes:
- Replace 2× unreachable!('mkdir not spawned with progress') in
dialog_ops.rs:855,869 with graceful Ok(()) returns — prevents
runtime panic if MkDir ever gains progress support
Documentation fixes:
- Update outdated 'open_file was the Phase 0 stub' comment in
viewer/mod.rs to reflect current state (standalone tlcview binary)
- Update usermenu.rs CK_EditUserMenu TODO — feature already
implemented in dispatch_editor_cmd
- Update PLAN.md retry description — progress-dialog retry IS
functional; only background-jobs retry is state-only
Tests: 1427 pass, zero warnings.