From 94bf169f64394537d04b7a02dfc388acf610a16b Mon Sep 17 00:00:00 2001 From: merge Date: Mon, 19 Jan 2009 23:03:59 +0000 Subject: =?UTF-8?q?MERGE-via-pending-tracking-hist-subject-usb-gadget-rndi?= =?UTF-8?q?s-send-=20pending-tracking-hist=20top=20was=20subject-usb-gadge?= =?UTF-8?q?t-rndis-send-=20/=203c29888770bfa8ce3a5e2ed590c3edb97ca4abaf=20?= =?UTF-8?q?...=20parent=20commitmessage:=20From:=20Richard=20R=C3=83=C2=B6?= =?UTF-8?q?jfors=20=20Subject:=20USB:=20gadget?= =?UTF-8?q?=20rndis:=20send=20notifications?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Git-Tag: v2.6.28-rc6~2^2~2 X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=ff3495052af48f7a2bf7961b131dc9e161dae19c;hp=9c264521a9f836541c122b00f505cfd60cc5bbb5 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 --- drivers/usb/gadget/f_rndis.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/usb') diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c index 659b3d9671c..428b5993575 100644 --- a/drivers/usb/gadget/f_rndis.c +++ b/drivers/usb/gadget/f_rndis.c @@ -172,7 +172,6 @@ static struct usb_interface_descriptor rndis_data_intf __initdata = { .bDescriptorType = USB_DT_INTERFACE, /* .bInterfaceNumber = DYNAMIC */ - .bAlternateSetting = 1, .bNumEndpoints = 2, .bInterfaceClass = USB_CLASS_CDC_DATA, .bInterfaceSubClass = 0, @@ -303,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 -- cgit v1.2.3