Skip to content

rtl8733b, jaguar1: use the shared bulk-boundary helpers (follow-up to #592) - #596

Closed
snokvist wants to merge 2 commits into
OpenIPC:masterfrom
snokvist:fix/rtl8733b-bulk-helpers
Closed

snokvist wants to merge 2 commits into
OpenIPC:masterfrom
snokvist:fix/rtl8733b-bulk-helpers

Conversation

@snokvist

@snokvist snokvist commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

What this is

Follow-up to the first non-blocking note on #592: Rtl8733bDevice::send_packet already applied the bulk-boundary pad, but with its own copy of the speed-to-MPS expression. So did the agg limits in send_packets. Both now call usb_bulk_mps() and single_block_pkt_offset() from TxAggPlan.h.

What changed

  • src/rtl8733b/Rtl8733bDevice.cpp: two inline expressions become helper calls (+3 / −10). The RTL8733B is USB-only, so it needs no is_usb() guard.
  • src/jaguar1/RtlJaguarDevice.cpp: its agg limits held the last hand-written copy of the speed-to-MPS expression; it now calls usb_bulk_mps() (+1 / −3).

The values are the same for every speed (the helper uses the same thresholds; unknown speeds give 64).

Verification

8733BU sender (USB2, so MPS 512; descriptor 40 bytes) to an 8812BU, ch36, MCS4, 60 s. Every 50th frame is cut to a 984-byte MPDU (40 + 984 = 1024).

Build Frames cut to 984 B Lost
this branch 658 0
this branch with the offset forced to 0 (negative control) 652 637
  • The 8733B has the same fault as Jaguar2/3, and the pad it already had prevents it.
  • ctest 92/92; no new warnings.
  • Jaguar1: build and ctest only. The 8812AU single-frame bulk-boundary test is still to run.

Not covered

🤖 Generated with Claude Code

)

send_packet and the agg limits carried their own copies of the
speed-to-MPS expression and the PKT_OFFSET boundary test. Use
usb_bulk_mps() and single_block_pkt_offset() from TxAggPlan.h instead.
Same values on every speed; the RTL8733B is USB-only, so no PCIe guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dReg158JQxkhEWGPBro5f
@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

RTL8733B: reuse shared USB bulk-boundary helpers

✨ Enhancement 🕐 Less than 10 minutes

Grey Divider

AI Description

• Replace duplicated USB speed-to-packet-size calculations in single-frame and aggregated TX.
• Reuse the shared boundary-offset helper without changing padding behavior.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 0 capabilities

  • No production behavior changes identified.
Behavioral complexity 🟢 Low 🧩 Assessed behavior

  • No production behavior changes identified.
Potential damage 🟢 Low 🩹 Assessed behavior

  • No production behavior changes identified.
Assessed commit 33a64b5
Diagram

graph TD
  Speed["USB speed"] --> MPS["Bulk MPS helper"] --> Offset["Offset helper"] --> Single["Single-frame TX"]
  MPS --> Limits["Aggregate limits"] --> Planner["TX aggregation planner"]
Loading
High-Level Assessment

Reusing the existing helpers is the appropriate approach: it removes duplicated boundary logic while preserving the current USB-only transmit behavior. Keeping the inline expressions would retain unnecessary duplication.

Files changed (1) +3 / -10

Refactor (1) +3 / -10
Rtl8733bDevice.cppUse shared bulk-size and padding helpers in RTL8733B TX +3/-10

Use shared bulk-size and padding helpers in RTL8733B TX

• Single-frame TX now calls 'single_block_pkt_offset()' with 'usb_bulk_mps()' instead of calculating the boundary offset inline. Aggregated TX uses 'usb_bulk_mps()' for its bulk-size limit. The intended packet sizes and padding decisions are unchanged.

src/rtl8733b/Rtl8733bDevice.cpp

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can add REVIEW.md to your repo root and Qodo follows it on every PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

The last hand-written copy of the speed-to-MPS expression. Same values on
every speed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011dReg158JQxkhEWGPBro5f
@snokvist snokvist changed the title rtl8733b: use the shared bulk-boundary helpers (follow-up to #592) rtl8733b, jaguar1: use the shared bulk-boundary helpers (follow-up to #592) Nov 21, 2026
@josephnef

Copy link
Copy Markdown
Collaborator

This one is superseded: #594 landed the same three changes on master (Rtl8733bDevice.cpp single-frame offset and agg limits, RtlJaguarDevice.cpp agg limits now all call usb_bulk_mps() / single_block_pkt_offset()), which is why the branch shows as conflicting. A rebase would leave an empty diff, so I'd suggest closing it.

The 8733BU negative control in the description (0 of 658 lost with the pad, 637 of 652 with the offset forced to 0) is the one thing here master doesn't record — useful evidence that the RTL8733B has the same fault as Jaguar2/3 and that its existing pad is what prevents it.

@josephnef

Copy link
Copy Markdown
Collaborator

Closing as superseded by #594 (see the comment above); the same changes are on master.

@josephnef josephnef closed this Nov 21, 2026
@snokvist
snokvist deleted the fix/rtl8733b-bulk-helpers branch November 21, 2026 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants