]> git.itanic.dy.fi Git - linux-stable/commit
usb: gadget: rndis: free response queue during REMOTE_NDIS_RESET_MSG
authorXerox Lin <xerox_lin@htc.com>
Wed, 29 Jun 2016 09:04:21 +0000 (14:34 +0530)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 11 Aug 2016 12:09:48 +0000 (15:09 +0300)
commit207707d8fd48ebc977fb2b2794004a020e1ee08e
treeda09a2fdb3e8a15295a492ea8739f2cbe8d2b970
parent17a1dc5e22d25ba374d8c8dd8d5bf10bd20d3265
usb: gadget: rndis: free response queue during REMOTE_NDIS_RESET_MSG

When rndis data transfer is in progress, some Windows7 Host PC is not
sending the GET_ENCAPSULATED_RESPONSE command for receiving the response
for the previous SEND_ENCAPSULATED_COMMAND processed.

The rndis function driver appends each response for the
SEND_ENCAPSULATED_COMMAND in a queue. As the above process got corrupted,
the Host sends a REMOTE_NDIS_RESET_MSG command to do a soft-reset.
As the rndis response queue is not freed, the previous response is sent
as a part of this REMOTE_NDIS_RESET_MSG's reset response and the Host
block any more Rndis transfers.

Hence free the rndis response queue as a part of this soft-reset so that
the correct response for REMOTE_NDIS_RESET_MSG is sent properly during the
response command.

Signed-off-by: Rajkumar Raghupathy <raghup@codeaurora.org>
Signed-off-by: Xerox Lin <xerox_lin@htc.com>
[AmitP: Cherry-picked this patch and folded other relevant
        fixes from Android common kernel android-4.4]
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/gadget/function/rndis.c