summaryrefslogtreecommitdiff
path: root/src/class
AgeCommit message (Collapse)Author
2026-07-19Merge pull request #3750 from dxbjavid/cdc-acm-open-desc-boundsZixun LI
bound cdc-data endpoints against descriptor length in acm_open
2026-07-19add interface desc length checkHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-19improve validation structureHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-19improve pointer arithmetic, check funmctional descriptor bLengthHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-17vendor: deactivate de-selected altsetting's isochronous endpointshathach
vendord_set_alt() aborted bulk/interrupt endpoints of the outgoing altsetting (stall/clear-stall) but only dropped the iso endpoints' tracking: an armed iso transfer stayed live in the dcd with its usbd claim held and no tracked handle to stop it, and its completion fired into an endpoint the class no longer recognizes. Reachable through the usbtest example's alt0 (bulk) <-> alt1 (iso) SET_INTERFACE switching. Track each selected iso endpoint's descriptor (points into the app's static descriptor set) and deactivate on de-selection: with the iso-alloc API re-activation is the abort/scrub primitive (resets ep_status, aborts the stale transfer); without it usbd_edpt_close does, and the next selection re-opens. Iso cannot be stalled like bulk/interrupt, hence the separate path. Build-verified: usbtest for stm32f072disco, ra4m1_ek, raspberry_pi_pico (iso-alloc) and ch32v307v_r1_1v0 (close API).
2026-07-09audio: drop stale EP-busy note in audiod_set_interfacehathach
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
2026-07-09class/vendor: add interrupt/iso endpoint pairs and alt-setting supporthathach
Non-buffered per-type source/sink endpoints (bulk/int/iso) with manual RX arming across altsettings. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01HeF2gZ1M7GWkz6Av4BpKPg
2026-07-07gate acm_open descriptor bounds behind CFG_TUH_VALIDATION_LEVELJavid Khan
add a three-level TUSB_VALIDATION_NONE/BASIC/STRICT knob and default CFG_TUH_VALIDATION_LEVEL to BASIC, then make acm_open the first user so the enumeration bounds checks compile out at NONE for trusted-device setups and stay on by default.
2026-07-05bound rndis data packet offset in handle_incoming_packetJavid Khan
Signed-off-by: Javid Khan <[email protected]>
2026-07-05Merge pull request #3738 from sauloverissimo/fix/midi2-fb-directionZixun LI
feat(midi2): derive function blocks from the GTB descriptor
2026-07-05ensure gtb is validHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-05Merge pull request #3754 from Old-Ding/codex/usbtmc-status-byte-bufferZixun LI
Fix USBTMC status byte interrupt buffer
2026-07-05Merge pull request #3741 from dxbjavid/ncm-ndp-length-boundZixun LI
bound ndp16 wLength against received ntb in recv_validate_datagram
2026-07-05Fix USBTMC status byte notification bufferaineoae86-sys
Queue the USB488 READ_STATUS_BYTE interrupt notification through tud_usbtmc_transmit_notification_data so it uses the class notification endpoint buffer for the asynchronous transfer. Fixes #2928 Generated-by: OpenAI Codex Signed-off-by: aineoae86-sys <[email protected]>
2026-07-05bound acm_open functional descriptor walk against desc_endJavid Khan
2026-07-05fix sizeof(nth16_t) typoHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-07-05Fix USBTMC notification endpoint claimaineoae86-sys
Use usbd_edpt_claim() before queuing USBTMC notification data so the interrupt endpoint is reserved through the normal endpoint ownership path. Release the claim if the notification payload cannot be copied before the transfer is queued. Fixes #2735 Generated-by: OpenAI Codex Signed-off-by: aineoae86-sys <[email protected]>
2026-07-04advance acm_open descriptor walk by fixed struct sizesJavid Khan
2026-07-03guard acm_open endpoint reads against short bLength descriptorsJavid Khan
2026-07-03Merge pull request #3660 from andrewleech/cdch-on-enum-idx-guardZixun LI
cdc_host: fix undeclared 'idx' when only LINE_CONTROL_ON_ENUM is defined
2026-07-02bound cdc-data endpoints against descriptor length in acm_openJavid Khan
2026-07-02license: use SPDX identifiers for src/ headers (#3749)Ha Thach
* license: use SPDX identifiers for src/ headers Replace the full ~20-line MIT license boilerplate on every src/ file with a two-line SPDX tag (SPDX-FileCopyrightText + SPDX-License-Identifier), following the REUSE convention used by CircuitPython and the Linux kernel. Removes ~3500 lines of duplicated boilerplate.
2026-06-28feat(midi2): derive function blocks from the GTB descriptorSaulo Veríssimo
Function Block Info (direction, group span, name) is derived from the GTB descriptor as the single source of truth, so a device can expose multiple Group Terminal Blocks with independent directions. Adds Function Block Name notifications (tud_midi2_fb_name_cb) and an opt-in callback to answer UMP Stream messages from the application (tud_midi2_stream_msg_cb). Ref #3571
2026-06-27bound ndp16 wLength against received ntb in recv_validate_datagramJavid Khan
2026-06-24cap tud_msc_scsi_cb bufsize to endpoint buffer sizedxbjavid
2026-06-23Merge pull request #3698 from dxbjavid/hid-report-desc-boundsZixun LI
bound item size to remaining length in hid report descriptor parser
2026-06-19video: assert usbd_edpt_iso_activate() result in _open_vs_itf()hathach
The isochronous streaming endpoint was activated with the usbd_edpt_iso_activate() return value ignored, unlike every neighbouring open in the same function (usbd_edpt_open() is wrapped in TU_ASSERT on both the non-ISO-alloc fallback and the bulk branch). When a DCD refuses the iso endpoint -- e.g. it has no isochronous support, or the requested packet size does not fit its endpoint buffers -- that failure was silently swallowed and the alternate setting was reported as opened, leaving the host streaming to an endpoint the device never armed. Wrap it in TU_ASSERT so the open fails cleanly and the refusal propagates, matching the adjacent endpoint-open calls. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-19Merge pull request #3709 from morse-cedricvandenbergh/ncm-default-link-state-cbZixun LI
ncm: add weak callback for initial link state
2026-06-18class/audio: remove unused audio20_control_request_thathach
After the UAC2 examples switched to tusb_control_request_t with TU_U16_HIGH/LOW() extraction, audio20_control_request_t is no longer referenced anywhere in the tree. It is a byte-overlay of the setup packet whose bChannelNumber/bControlSelector/bInterface/bEntityID sub-byte fields silently misread on big-endian once wValue/wIndex are converted to host order (tu_le16toh in dcd.h), so leaving it in the public header is a latent BE trap; the BE bitfield guard previously added to its bmRequestType_bit only masked that by guarding byte 0. Drop the struct entirely. Callers should use tusb_control_request_t and TU_U16_LOW/HIGH(wValue|wIndex), matching audio_device.c and the examples. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-18Merge remote-tracking branch 'origin/master' into pr-3618hathach
2026-06-16ncm: add weak callback for initial link stateCedric Van den Bergh
netd_init resets link_is_up to a compile-time default, which is incorrect when the host reboots without power-cycling the device. Add tud_network_default_link_state_cb() so applications can return the actual physical link state. The weak default preserves existing CFG_TUD_NCM_DEFAULT_LINK_UP behaviour.
2026-06-15zero-extend usage page before copying shorter payloaddxbjavid
2026-06-12bound item size to remaining length in hid report descriptor parserdxbjavid
2026-06-06host/cdc: use local control bufferHiFiPhile
2026-06-03refactor(cmake): comment out unused target folder propertieshathach
2026-05-31cdc_host: fix undeclared 'idx' when only LINE_CONTROL_ON_ENUM definedAndrew Leech
idx is used in the ENUM_SET_LINE_CONTROL path guarded by CFG_TUH_CDC_LINE_CONTROL_ON_ENUM, but was declared only under CFG_TUH_CDC_LINE_CODING_ON_ENUM. Defining LINE_CONTROL_ON_ENUM without LINE_CODING_ON_ENUM therefore failed to compile with an undeclared identifier. Guard the declaration under either macro. Signed-off-by: Andrew Leech <[email protected]>
2026-05-30Merge pull request #3658 from wjklimek1/mtp-out-transfer-fixZixun LI
Fix premature MTP phase change after short MTP OUT transfer
2026-05-29Handle OUT transfer completion in MTPWojciech Klimek
Handle OUT transfer differently from IN to not prematurely change MTP phase when host sends short packet that is not end of MTP data phase. Only reaching container length or ZLP should change phase.
2026-05-25chore: resolve .gitignore merge conflict with mastercopilot-swe-agent[bot]
Co-authored-by: HiFiPhile <[email protected]>
2026-05-19midi2_host: convert TX to raw FIFO mirroring midi2_device refactorSaulo Veríssimo
2026-05-18midi2: convert to raw Tx FIFO for better segmentation handling, add count to ↵HiFiPhile
packet api Signed-off-by: HiFiPhile <[email protected]>
2026-05-18midi2: boundary-aware drain in xfer_cb to keep UMP packets intactSaulo Veríssimo
2026-05-17midi2: drain pattern for RX FIFOSaulo Veríssimo
Default RX/TX buffers to EPSIZE for both device and host. Document drain-in-loop on ump_read; example device callback drains until empty.
2026-05-17midi2: scale device buffers with EPSIZESaulo Veríssimo
Match midi2_host pattern. Literal 256 underran HS endpoints (512B).
2026-05-17midi2: per-interface weak callbacks for UMP Stream configSaulo Veríssimo
Lets each instance return different NUM_GROUPS, NUM_FUNCTION_BLOCKS, EP_NAME and PRODUCT_ID. Defaults fall back to the macros.
2026-05-17midi2: peek 4 bytes for MT, restore 256 buffersSaulo Veríssimo
MT is in byte 3 of the UMP word in LE memory, not byte 0. Buffers at mps blocked RX xfer re-arm on partial packets.
2026-05-17midi2: use hwfifo if supportedHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-17midi2: move config to class headerHiFiPhile
Signed-off-by: HiFiPhile <[email protected]>
2026-05-16midi2: prevent UMP packet split across USB transfersSaulo Veríssimo
The edpt_stream auto-flush is byte-oriented and could cut an UMP message in half when the FIFO reached wMaxPacketSize, corrupting the peer's RX context. Pre-flush whole packets before writing one that would cross the boundary on both device (tud_midi2_n_ump_write) and host (tuh_midi2_ump_write) paths. Host write also becomes packet-aware instead of word-by-word. Ref #3571
2026-05-16midi2: reject UMP read/write API on alt setting 0Saulo Veríssimo
Alt 0 carries USB-MIDI 1.0 32-bit Event Packets, not UMP words; calling the UMP API there would misinterpret the stream. Expose MIDI_PROTOCOL_MIDI1 and MIDI_PROTOCOL_MIDI2 in the public header so applications can branch on the negotiated protocol. Ref #3571