* [PATCH] rndis_host: Poll status channel before control channel
@ 2010-04-19 23:08 Ben Hutchings
2010-04-28 1:01 ` David Miller
2010-05-13 6:42 ` David Miller
0 siblings, 2 replies; 5+ messages in thread
From: Ben Hutchings @ 2010-04-19 23:08 UTC (permalink / raw)
To: David Brownell, David Miller, John Carr
Cc: netdev, Mark Glassberg, Herton Ronaldo Krzesinski
Some RNDIS devices don't respond on the control channel until polled
on the status channel. In particular, this was reported to be the
case for the 2Wire HomePortal 1000SW.
This is roughly based on a patch by John Carr <john.carr@unrouted.co.uk>
which is reported to be needed for use with some Windows Mobile devices
and which is currently applied by Mandriva.
Reported-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
---
Note that this change hasn't yet been tested with any other RNDIS
devices. John, can you confirm whether this also handles the WinMob
devices?
Ben.
drivers/net/usb/rndis_host.c | 18 ++++++++++++------
1 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index f56dec6..52faca1 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -103,8 +103,10 @@ static void rndis_msg_indicate(struct usbnet *dev, struct rndis_indicate *msg,
int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
{
struct cdc_state *info = (void *) &dev->data;
+ struct usb_cdc_notification notification;
int master_ifnum;
int retval;
+ int partial;
unsigned count;
__le32 rsp;
u32 xid = 0, msg_len, request_id;
@@ -132,13 +134,17 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
if (unlikely(retval < 0 || xid == 0))
return retval;
- // FIXME Seems like some devices discard responses when
- // we time out and cancel our "get response" requests...
- // so, this is fragile. Probably need to poll for status.
+ /* Some devices don't respond on the control channel until
+ * polled on the status channel, so do that first. */
+ retval = usb_interrupt_msg(
+ dev->udev,
+ usb_rcvintpipe(dev->udev, dev->status->desc.bEndpointAddress),
+ ¬ification, sizeof(notification), &partial,
+ RNDIS_CONTROL_TIMEOUT_MS);
+ if (unlikely(retval < 0))
+ return retval;
- /* ignore status endpoint, just poll the control channel;
- * the request probably completed immediately
- */
+ /* Poll the control channel; the request probably completed immediately */
rsp = buf->msg_type | RNDIS_MSG_COMPLETION;
for (count = 0; count < 10; count++) {
memset(buf, 0, CONTROL_BUFFER_SIZE);
--
1.7.0.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] rndis_host: Poll status channel before control channel
2010-04-19 23:08 [PATCH] rndis_host: Poll status channel before control channel Ben Hutchings
@ 2010-04-28 1:01 ` David Miller
2010-05-13 6:42 ` David Miller
1 sibling, 0 replies; 5+ messages in thread
From: David Miller @ 2010-04-28 1:01 UTC (permalink / raw)
To: ben; +Cc: dbrownell, john.carr, netdev, vzeeaxwl, herton
From: Ben Hutchings <ben@decadent.org.uk>
Date: Tue, 20 Apr 2010 00:08:28 +0100
> Some RNDIS devices don't respond on the control channel until polled
> on the status channel. In particular, this was reported to be the
> case for the 2Wire HomePortal 1000SW.
>
> This is roughly based on a patch by John Carr <john.carr@unrouted.co.uk>
> which is reported to be needed for use with some Windows Mobile devices
> and which is currently applied by Mandriva.
>
> Reported-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> Tested-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
> ---
> Note that this change hasn't yet been tested with any other RNDIS
> devices. John, can you confirm whether this also handles the WinMob
> devices?
I haven't seen any other testing for this patch and I'm real hesitant
to apply something like this in that case.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rndis_host: Poll status channel before control channel
2010-04-19 23:08 [PATCH] rndis_host: Poll status channel before control channel Ben Hutchings
2010-04-28 1:01 ` David Miller
@ 2010-05-13 6:42 ` David Miller
2010-05-15 13:37 ` Ben Hutchings
1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2010-05-13 6:42 UTC (permalink / raw)
To: ben; +Cc: dbrownell, john.carr, netdev, vzeeaxwl, herton
From: Ben Hutchings <ben@decadent.org.uk>
Date: Tue, 20 Apr 2010 00:08:28 +0100
> Some RNDIS devices don't respond on the control channel until polled
> on the status channel. In particular, this was reported to be the
> case for the 2Wire HomePortal 1000SW.
>
> This is roughly based on a patch by John Carr <john.carr@unrouted.co.uk>
> which is reported to be needed for use with some Windows Mobile devices
> and which is currently applied by Mandriva.
>
> Reported-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> Tested-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
> ---
> Note that this change hasn't yet been tested with any other RNDIS
> devices. John, can you confirm whether this also handles the WinMob
> devices?
Still waiting for this to get tested. Is there really nobody in the
world with RNDIS devices who can test this patch? If so, maybe that's
a good reason to not apply it :-))))
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rndis_host: Poll status channel before control channel
2010-05-13 6:42 ` David Miller
@ 2010-05-15 13:37 ` Ben Hutchings
2010-05-16 5:54 ` David Miller
0 siblings, 1 reply; 5+ messages in thread
From: Ben Hutchings @ 2010-05-15 13:37 UTC (permalink / raw)
To: David Miller; +Cc: dbrownell, john.carr, netdev, vzeeaxwl, herton
[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]
On Wed, 2010-05-12 at 23:42 -0700, David Miller wrote:
> From: Ben Hutchings <ben@decadent.org.uk>
> Date: Tue, 20 Apr 2010 00:08:28 +0100
>
> > Some RNDIS devices don't respond on the control channel until polled
> > on the status channel. In particular, this was reported to be the
> > case for the 2Wire HomePortal 1000SW.
> >
> > This is roughly based on a patch by John Carr <john.carr@unrouted.co.uk>
> > which is reported to be needed for use with some Windows Mobile devices
> > and which is currently applied by Mandriva.
> >
> > Reported-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > Tested-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
> > ---
> > Note that this change hasn't yet been tested with any other RNDIS
> > devices. John, can you confirm whether this also handles the WinMob
> > devices?
>
> Still waiting for this to get tested. Is there really nobody in the
> world with RNDIS devices who can test this patch? If so, maybe that's
> a good reason to not apply it :-))))
This has been in Debian unstable since 1 May and I haven't seen any
fall-out yet. However I acknowledge that absence of evidence is not
evidence of absence.
Ben.
--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] rndis_host: Poll status channel before control channel
2010-05-15 13:37 ` Ben Hutchings
@ 2010-05-16 5:54 ` David Miller
0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2010-05-16 5:54 UTC (permalink / raw)
To: ben; +Cc: dbrownell, john.carr, netdev, vzeeaxwl, herton
From: Ben Hutchings <ben@decadent.org.uk>
Date: Sat, 15 May 2010 14:37:15 +0100
> On Wed, 2010-05-12 at 23:42 -0700, David Miller wrote:
>> From: Ben Hutchings <ben@decadent.org.uk>
>> Date: Tue, 20 Apr 2010 00:08:28 +0100
>>
>> > Some RNDIS devices don't respond on the control channel until polled
>> > on the status channel. In particular, this was reported to be the
>> > case for the 2Wire HomePortal 1000SW.
>> >
>> > This is roughly based on a patch by John Carr <john.carr@unrouted.co.uk>
>> > which is reported to be needed for use with some Windows Mobile devices
>> > and which is currently applied by Mandriva.
>> >
>> > Reported-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
>> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
>> > Tested-by: Mark Glassberg <vzeeaxwl@myfairpoint.net>
>> > ---
>> > Note that this change hasn't yet been tested with any other RNDIS
>> > devices. John, can you confirm whether this also handles the WinMob
>> > devices?
>>
>> Still waiting for this to get tested. Is there really nobody in the
>> world with RNDIS devices who can test this patch? If so, maybe that's
>> a good reason to not apply it :-))))
>
> This has been in Debian unstable since 1 May and I haven't seen any
> fall-out yet. However I acknowledge that absence of evidence is not
> evidence of absence.
I think I'll toss it into net-next-2.6 and we'll see if any monsters
come out of that.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-05-16 5:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-19 23:08 [PATCH] rndis_host: Poll status channel before control channel Ben Hutchings
2010-04-28 1:01 ` David Miller
2010-05-13 6:42 ` David Miller
2010-05-15 13:37 ` Ben Hutchings
2010-05-16 5:54 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).