diff options
author | Xerox Lin <xerox_lin@htc.com> | 2016-06-29 05:04:21 -0400 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-08-11 08:09:48 -0400 |
commit | 207707d8fd48ebc977fb2b2794004a020e1ee08e (patch) | |
tree | da09a2fdb3e8a15295a492ea8739f2cbe8d2b970 /drivers/usb | |
parent | 17a1dc5e22d25ba374d8c8dd8d5bf10bd20d3265 (diff) |
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>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/function/rndis.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/usb/gadget/function/rndis.c b/drivers/usb/gadget/function/rndis.c index 943c21aafd3b..ab6ac1b74ac0 100644 --- a/drivers/usb/gadget/function/rndis.c +++ b/drivers/usb/gadget/function/rndis.c | |||
@@ -680,6 +680,12 @@ static int rndis_reset_response(struct rndis_params *params, | |||
680 | { | 680 | { |
681 | rndis_reset_cmplt_type *resp; | 681 | rndis_reset_cmplt_type *resp; |
682 | rndis_resp_t *r; | 682 | rndis_resp_t *r; |
683 | u8 *xbuf; | ||
684 | u32 length; | ||
685 | |||
686 | /* drain the response queue */ | ||
687 | while ((xbuf = rndis_get_next_response(params, &length))) | ||
688 | rndis_free_response(params, xbuf); | ||
683 | 689 | ||
684 | r = rndis_add_response(params, sizeof(rndis_reset_cmplt_type)); | 690 | r = rndis_add_response(params, sizeof(rndis_reset_cmplt_type)); |
685 | if (!r) | 691 | if (!r) |