usb: acknowledge SET_LINE_CODING in the serial driver

rockbox-gerrit-noreply--- via rockbox-cvs <[email protected]>
Newsgroups gmane.comp.systems.archos.rockbox.cvs
Message-ID <[email protected]>
commit 6ad1fd074a284d934de4a8d0bbef02c1d6865506
Author: Michael McAllister <[email protected]>
Date:   Sun Aug 9 23:21:48 2026 +0100

    usb: acknowledge SET_LINE_CODING in the serial driver
    
    usb_serial_control_request() copies the line coding and returns handled = true without calling usb_core_control_response(). usb_core only answers requests a driver declines, so returning handled makes the status stage the driver's responsibility and nothing sends it. The host sees the request accepted and then times out waiting for status.
    
    Every other branch in this function already responds but this one was missed.
    
    Affects any target building USB_ENABLE_SERIAL. The symptom is a CDC console that enumerates and then stalls when a terminal opens it and sets the line rate.
    
    Change-Id: Icd97805971c68ce3a599cf01e9f6aa103c61c2ec
    Co-Authored-By: Claude Opus 4.8

diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c
index 4820d66d62..a9c06ff34d 100644
--- a/firmware/usbstack/usb_serial.c
+++ b/firmware/usbstack/usb_serial.c
@@ -288,6 +288,7 @@ static bool usb_serial_control_request(struct usb_ctrlrequest* req, uint8_t* req
             {
                 /* Receive line coding into local copy */
                 memcpy(line_coding.raw, reqdata, sizeof(struct cdc_line_coding));
+                usb_core_control_response(USB_CONTROL_ACK, NULL, 0);
                 handled = true;
             }
         }
-- 
rockbox-cvs mailing list
[email protected]
https://lists.haxx.se/mailman/listinfo/rockbox-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.