tx: programmatic runtime TX-mode API; drop DEVOURER_TX_HT_MCS gate#111
Merged
Conversation
send_packet only honoured a radiotap HT-MCS index when DEVOURER_TX_HT_MCS was set in the environment, so a valid HT radiotap silently fell back to the MGN_1M (1M CCK / 6M-legacy-at-5G) default. A library deciding TX behaviour from a CLI env var, and an ignored-by-default radiotap, were both wrong. - Radiotap is now authoritative per-packet: the HT-MCS index is honoured unconditionally (gate removed). - New devourer::TxMode struct (src/TxMode.h) + RtlJaguarDevice::SetTxMode / ClearTxMode: a runtime default applied when a frame's radiotap carries no rate, replacing the hardcoded MGN_1M. Mirrors the SetTxPowerOverride pattern. - Consolidate the per-knob DEVOURER_TX_MCS/_VHT/_VHT_MCS/_VHT_NSS/_LDPC/_STBC/_BW env vars into one DEVOURER_TX_RATE string (<rate>[/<bw>][/SGI][/LDPC][/STBC]), parsed by RadiotapBuilder::parse_tx_mode_env into a TxMode. StreamRateCfg -> TxMode; the txdemo sends a rate-less beacon and drives the mode via SetTxMode. - Migrate regress.py / bench_onair.py / thermal_gain_sweep.py and the docs to DEVOURER_TX_RATE; correct the precoder note about send_packet ignoring HT MCS. Verified: build + ctest green; on air (8812 -> 8814 monitor, ch6) MCS7 decodes as 11n 65 Mb/s MCS 7 and an unset rate as 6 Mb/s 11g — both with no DEVOURER_TX_HT_MCS. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
RtlJaguarDevice::send_packetonly wired a radiotap HT-MCS index into the on-air rate whenDEVOURER_TX_HT_MCSwas set in the environment. Without it, a correctly-formed HT radiotap silently fell back to theMGN_1Mdefault (1 Mbps CCK, clamped to 6 Mbps legacy at 5 GHz). Two things wrong: a library deciding TX behaviour from a CLI env var, and a valid radiotap being ignored by default. The demo compounded it by hand-patching radiotap bytes through a swarm of per-knob env vars.Change
DEVOURER_TX_HT_MCSgate is removed).devourer::TxMode(src/TxMode.h) +RtlJaguarDevice::SetTxMode()/ClearTxMode(). The mode is a configurable default, applied only when a frame's radiotap carries no rate (replacing the hardcodedMGN_1M); per-packet radiotap always wins. Mirrors the existingSetTxPowerOverridepattern (pure state, no USB I/O).DEVOURER_TX_MCS/_VHT/_VHT_MCS/_VHT_NSS/_LDPC/_STBC/_BWenv vars collapse into one string:parse_tx_mode_env()into aTxMode. e.g.MCS7/40/SGI,VHT2SS_MCS3/80/LDPC,6M.StreamRateCfg→devourer::TxMode;WiFiDriverTxDemosends a rate-less beacon and drives the mode viaSetTxMode. Stream demos migrated.tests/regress.py,tests/bench_onair.py,tests/thermal_gain_sweep.pyand the docs migrated toDEVOURER_TX_RATE; corrected the precoder note that claimedsend_packetnever reads the HT MCS index.DEVOURER_TX_PAYLOAD_BYTESandDEVOURER_TX_PWR_*are unchanged (size / power, not mode).Verification
cmake --build build -jclean across all targets;ctestpasses (stream_stdin_binary).DEVOURER_TX_HT_MCS):DEVOURER_TX_RATE=MCS7→ witness decodes11n … 65.0 Mb/s MCS 7 20 MHz.6.0 Mb/s … 11g(theTxModedefault, not 1M CCK).🤖 Generated with Claude Code