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:
Petteri Aimonen authored and Alan Carvalho de Assis committed 2021-03-24 14:44:23 -03:00
1 parent f13adbe4bb
commit 4f66624ea3
1 file changed
+58 -35
+58 -35
View File
File diff suppressed because it is too large. Load diff