mirror of
https://github.com/apache/nuttx.git
synced 2026-05-12 01:42:49 +08:00
Author: shichunma <masc2008@gmail.com> 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 <shichunma@bestechnic.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user