This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 09f09daeab5 Author: shichunma <[email protected]> Date: Thu Jan 15 
07:24:08 2026 +0800
09f09daeab5 is described below

commit 09f09daeab591f71cdca3dcf95356ec553740a64
Author: masc <[email protected]>
AuthorDate: Fri Jan 23 10:34:38 2026 +0800

    Author: shichunma <[email protected]> Date: Thu Jan 15 07:24:08 2026 +0800
    
    drivers/usbdev/rndis: after client send notication, host can't read msg 
timely
    
    rndis use intr ep to notify host to read RNDIS message from client, it 
should
    read all the messages cached. Need notify host to read again if there is 
msg left.
    
    Signed-off-by: Jerry Ma <[email protected]>
---
 drivers/usbdev/rndis.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/usbdev/rndis.c b/drivers/usbdev/rndis.c
index ab39b2ccff9..e8b7aa754d6 100644
--- a/drivers/usbdev/rndis.c
+++ b/drivers/usbdev/rndis.c
@@ -1845,6 +1845,7 @@ static void usbclass_ep0incomplete(FAR struct usbdev_ep_s 
*ep,
         priv->response_queue_words -= len_words;
         memcpy(priv->response_queue, priv->response_queue + len_words,
                priv->response_queue_words * sizeof(uint32_t));
+        rndis_send_encapsulated_response(priv, 0);
       }
     }
 }
@@ -2604,15 +2605,17 @@ static int usbclass_setup(FAR struct 
usbdevclass_driver_s *driver,
                   }
                 else
                   {
-                    /* Retrieve a single reply from the response queue to
-                     * control request buffer.
+                    /* Reply info as many as possible, if host read less than
+                     * cached, just send one msg to avoid msg truncation
                      */
 
                     FAR struct rndis_response_header *hdr =
                       (struct rndis_response_header *)priv->response_queue;
-                    memcpy(ctrlreq->buf, hdr, hdr->msglen);
+                    ret = priv->response_queue_words * sizeof(uint32_t);
+                    if (ret > len)
+                      ret = hdr->msglen;
+                    memcpy(ctrlreq->buf, hdr, ret);
                     ctrlreq->priv = priv;
-                    ret = hdr->msglen;
                   }
               }
           }

Reply via email to