You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This progresses the USB-first portion of #233. It does not auto-close that issue because narrowband RF validation and combo-module/coexistence work remain outside this PR.
Why a separate backend
RTL8733B is HALMAC 87xx, not a Jaguar2/3 variant. Its power, firmware, MAC, RX/TX descriptor and PHY paths therefore remain isolated under src/rtl8733b/.
Both reviewed vendor trees describe this device as 1SS 802.11b/g/n with a 20/40 MHz capability mask. The 2024 tree also contains a later Fix VHT flags commit that removes the accidentally enabled VHT flag. This PR consequently does not adopt #233's provisional VHT/80 MHz/2T2R assumptions.
Firmware and tables are pinned to libc0607/rtl8733bu-20230626 commit 9e5f6845b4e3393207720fc1886668bc80b6af1c. The implementation was compared with libc0607/rtl8733bu-20240806 commit 2ec19e154cffbc2abd98d43d59278dffa6e50d49, but the already hardware-validated artifacts were not silently replaced.
Hardware tested
Test device: one 0bda:f72b, RTL8733B cut D, USB high speed.
Verified through the normal WiFiDriver / IRtlDevice path:
USB discovery/endpoints, repeated power/firmware/MAC/BB/RF bring-up, stable EFUSE reads and permanent MAC extraction.
Ambient monitor RX on channels 6 and 36, descriptor aggregation, PHY status, CRC reporting and clean stop.
Raw TX captured by an independent receiver on both bands: legacy OFDM and HT MCS0-7 at 20 MHz, plus HT 40 MHz. BCC was forced throughout.
Warm reinitialization, concurrent RX/TX, bounded sustained TX, malformed-input rejection, teardown during active work and post-run health checks.
Current post-rebase smoke: 10 sampled ambient packets and 0 rx.parse_abort events in 10 seconds.
Current adapter-doctor run: HEALTHY; 4/4 identical EFUSE reads, firmware ready, 23 clean + 6 corrupt frames in 3 seconds.
Final explicit card-disable readback: RF_CTRL=0x00, CR=0xea.
Checks
Full default build: passed.
Full CTest matrix: 53/53 passed.
RTL8733B-only build (all other chip options disabled): passed.
RTL8733B-only CTest matrix: 49/49 passed.
Firmware extractor --check: reproduced both checked-in NIC images byte-for-byte.
Table extractor --check: reproduced all checked-in MAC/BB/AGC/RF/RFK arrays byte-for-byte.
Rebased onto current OpenIPC/devourer:master (da06ccc) before the final build and hardware smoke.
Explicitly not tested or claimed
No SDR equipment was available. Occupied bandwidth, spectral mask, EVM, absolute output power and SDR duty measurements were not performed.
Experimental 5/10 MHz has register-readback and normal-path RX evidence only. Narrowband TX and independent narrowband-peer decode are deferred; narrowband_ok remains false.
No physical 0bda:b733 combo module was available. Its ID is from the vendor table; Bluetooth/coexistence is not implemented or claimed.
SGI, STBC, LDPC, CCK TX, VHT, 80 MHz, ACK/BlockAck, A-MPDU, fast retune and throughput are not claimed.
The hub cannot switch VBUS, so automated repeated true-cold boots were not possible; physical replug and warm reinitialization were tested.
A vendor-kernel-driver cross-test was attempted with the 2024 tree on Linux 6.14. Its build first omitted required include paths, then failed on incompatible MODULE_IMPORT_NS syntax and missing platform_ops.h. No vendor module was loaded, so no vendor-driver parity result is claimed.
An RTL8731BU-labelled f72b passed early identity/EFUSE/firmware checks, but later stopped enumerating and overheated while attached to a custom power supply. It is excluded from all radio-validation claims.
The full tested/deferred matrix and provenance are in docs/rtl8733b.md.
RTL8733B capability reporting currently excludes 5/10 MHz narrowband (and does not advertise
FastRetune), contrary to the narrowband/FastRetune requirement. This prevents the expected
narrowband long-range mode from being enabled/verified through the normal capability surfaces.
+ return g == ChipGeneration::Rtl8733b ? (kBw20 | kBw40)+ : g == ChipGeneration::Jaguar1 ? ac
: g == ChipGeneration::Unknown ? 0
: (ac | kBw5 | kBw10);
Evidence
PR Compliance ID 7 expects RTL8733B narrowband 5/10 MHz support (and FastRetune). The PR sets
RTL8733B bandwidth mask to only 20/40 MHz, and GetTxCaps() explicitly documents that 5/10 MHz is
omitted; no RTL8733B caps path marks FastRetune as supported.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
PR Compliance ID 7 requires RTL8733B narrowband 5/10 MHz support plus FastRetune behavior. Current RTL8733B capability reporting excludes 5/10 MHz and does not surface FastRetune support, so narrowband cannot be enabled/validated via the standard capability path.
## Issue Context
- `bw_mask_for_generation(ChipGeneration::Rtl8733b)` currently returns only 20/40.
- `Rtl8733bDevice::GetTxCaps()` explicitly states 5/10 MHz is omitted.
- `AdapterCaps::fastretune_ok` remains at its default (`false`) for RTL8733B.
## Fix Focus Areas
- src/AdapterCaps.h[77-86]
- src/rtl8733b/Rtl8733bDevice.cpp[529-559]
- src/AdapterCaps.h[213-218]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
RTL8733B GetAdapterCaps() does not set narrowband_ok (or fastretune_ok) and hard-codes chain
counts rather than runtime-detecting them, which violates the RTL8733B adapter capability reporting
requirement. This causes demos/telemetry to misrepresent RTL8733B feature availability.
PR Compliance ID 8 requires RTL8733B capability reporting (including narrowband capability and
correct feature flags). In the added RTL8733B backend, GetAdapterCaps() never assigns
narrowband_ok/fastretune_ok (so they remain false per the struct defaults) and sets chain
counts as fixed constants rather than runtime-derived.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
PR Compliance ID 8 requires RTL8733B `AdapterCaps` to correctly surface identity and feature flags, including narrowband capability, and to avoid misreporting RF chain capabilities.
## Issue Context
- `AdapterCaps::narrowband_ok` and `AdapterCaps::fastretune_ok` default to `false`.
- `Rtl8733bDevice::GetAdapterCaps()` populates identity/bands/`bw_mask`, but does not set `narrowband_ok`/`fastretune_ok` and hard-codes `tx_chains`/`rx_chains`.
## Fix Focus Areas
- src/rtl8733b/Rtl8733bDevice.cpp[539-559]
- src/AdapterCaps.h[118-120]
- src/AdapterCaps.h[213-218]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
3. UB shift in txdesc✓ Resolved🐞 Bug≡ Correctness
Description
rtl8733b::txdesc_set_bits uses (1u << width) which is undefined behavior for width==32, so encoding
a 32-bit field would produce unpredictable masks and corrupt the TX descriptor. Because this helper
is header-only and reusable, a future call site can trigger this silently.
The TX helper computes its mask via 1u << width without guarding width == 32, which is UB. The
nearby RTL8733B RX helper (rx_bits) explicitly special-cases width == 32, demonstrating the
expected safe handling pattern in this repo.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`txdesc_set_bits()` builds its bitmask with `1u << width`; when `width == 32` this is undefined behavior in C/C++ and can generate an incorrect mask/descriptor.
### Issue Context
The RTL8733B TX descriptor encoder is intended to be a generic bitfield writer; the RX-side helper already special-cases `width == 32`, suggesting 32-bit fields are a known boundary in this codebase.
### Fix Focus Areas
- src/rtl8733b/TxDescriptor8733b.h[47-52]
### Suggested fix
- Special-case `width == 32` (and validate `bit == 0`) or compute the mask using a 64-bit intermediate (`1ull << width`) and validate `bit + width <= 32` before shifting.
- Consider explicitly handling `width == 0` as a no-op to avoid accidental full-clear patterns.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Rtl8733bDevice increments malformed on any RX parse failure even when the remainder is all-zero
padding (which emit_rx_parse_abort explicitly treats as benign). This inflates/poisons the RX
summary counters and makes troubleshooting RX parser regressions harder.
+ frame)) {+ ++malformed;+ devourer::emit_rx_parse_abort(+ _logger->events(), data + offset,
Evidence
The RX loop counts every parse failure as malformed. However, emit_rx_parse_abort explicitly
excludes all-zero remainder padding, and parse_rx_8733b returns false when frame_len==0—the
decode result you’d get from a zero-filled padded descriptor region—so benign padding can be counted
as malformed.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
The RX loop increments the `malformed` counter before determining whether the parse failure is a real abort or just benign all-zero aggregate padding.
### Issue Context
`emit_rx_parse_abort()` is explicitly designed to suppress events for all-zero remainder padding. Separately, `parse_rx_8733b()` returns `false` when `frame_len == 0`, which is exactly what an all-zero padded “descriptor” would decode as.
### Fix Focus Areas
- src/rtl8733b/Rtl8733bDevice.cpp[170-189]
- src/rtl8733b/FrameParser8733b.h[96-103]
- src/RxParseAbort.h[19-37]
### Suggested fix
- Before incrementing `malformed`, detect the benign-padding case (all-zero remainder) and break without counting it as malformed.
- Alternatively, restructure as:
- detect `all_zero` remainder locally (even when event sink is disabled),
- only then increment `malformed` + emit `rx.parse_abort` for non-zero remainder.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
Tip of the day
💡 Did you know, you can reply 'qodo' on any finding to push back, ask questions, or dig deeper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a dedicated userspace HALMAC 87xx backend for the RTL8731BU/RTL8733BU Wi-Fi function.
0bda:f72band0bda:b733, while requiring live RTL8733B chip ID0x16.rtl8733bprobe, adapter-doctor integration and capability documentation.rx.parse_aborttelemetry added in rx.parse_abort: count the abandoned-aggregate RX loss on every generation #387.This progresses the USB-first portion of #233. It does not auto-close that issue because narrowband RF validation and combo-module/coexistence work remain outside this PR.
Why a separate backend
RTL8733B is HALMAC 87xx, not a Jaguar2/3 variant. Its power, firmware, MAC, RX/TX descriptor and PHY paths therefore remain isolated under
src/rtl8733b/.Both reviewed vendor trees describe this device as 1SS 802.11b/g/n with a 20/40 MHz capability mask. The 2024 tree also contains a later
Fix VHT flagscommit that removes the accidentally enabled VHT flag. This PR consequently does not adopt #233's provisional VHT/80 MHz/2T2R assumptions.Firmware and tables are pinned to libc0607/rtl8733bu-20230626 commit
9e5f6845b4e3393207720fc1886668bc80b6af1c. The implementation was compared with libc0607/rtl8733bu-20240806 commit2ec19e154cffbc2abd98d43d59278dffa6e50d49, but the already hardware-validated artifacts were not silently replaced.Hardware tested
Test device: one
0bda:f72b, RTL8733B cut D, USB high speed.Verified through the normal
WiFiDriver/IRtlDevicepath:rx.parse_abortevents in 10 seconds.RF_CTRL=0x00,CR=0xea.Checks
--check: reproduced both checked-in NIC images byte-for-byte.--check: reproduced all checked-in MAC/BB/AGC/RF/RFK arrays byte-for-byte.OpenIPC/devourer:master(da06ccc) before the final build and hardware smoke.Explicitly not tested or claimed
narrowband_okremains false.0bda:b733combo module was available. Its ID is from the vendor table; Bluetooth/coexistence is not implemented or claimed.MODULE_IMPORT_NSsyntax and missingplatform_ops.h. No vendor module was loaded, so no vendor-driver parity result is claimed.f72bpassed early identity/EFUSE/firmware checks, but later stopped enumerating and overheated while attached to a custom power supply. It is excluded from all radio-validation claims.The full tested/deferred matrix and provenance are in
docs/rtl8733b.md.