From: Richard Röjfors Date: Sun, 16 Nov 2008 03:53:24 +0000 (-0800) Subject: USB: gadget rndis: send notifications X-Git-Tag: v2.6.28-rc6~2^2~2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ff3495052af48f7a2bf7961b131dc9e161dae19c;p=linux-2.6-omap-h63xx.git USB: gadget rndis: send notifications It turns out that atomic_inc_return() returns the *new* value not the original one, so the logic in rndis_response_available() kept the first RNDIS response notification from getting out. This prevented interoperation with MS-Windows (but not Linux). Fix this to make RNDIS behave again. Signed-off-by: Richard Röjfors Signed-off-by: David Brownell Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 8afb14a4a72..428b5993575 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c @@ -302,7 +302,7 @@ static void rndis_response_available(void *_rndis) __le32 *data = req->buf; int status; - if (atomic_inc_return(&rndis->notify_count)) + if (atomic_inc_return(&rndis->notify_count) != 1) return; /* Send RNDIS RESPONSE_AVAILABLE notification; a