mirror of
https://github.com/apache/nuttx.git
synced 2026-11-09 08:39:29 +08:00
USBDEV RNDIS: Fix occasional disconnections due to race condition
Sometimes Windows would send RNDIS_KEEPALIVE_MSG and RNDIS_QUERY_MSG close to each other. This would cause the latter command to overwrite the reply for the prior command. This in turn will cause Windows to drop the connection after a 20 second timeout. Easy way to reproduce the issue is to open the Windows "Adapter Status" dialog that shows the realtime TX/RX byte counts. This causes multiple RNDIS_QUERY_MSGs per second, and the connection will drop in less than an hour. This commit fixes this issue, and other potential race conditions (such as USB descriptor read in middle on RNDIS query) by using a separate queue for the reply packets.
This commit is contained in:
1 parent
f13adbe4bb
commit
4f66624ea3
1 file changed
+58
-35