All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-2.6 1/2] Revert "rndis_host: Poll status channel before control channel"
@ 2010-07-02 22:39 Ben Hutchings
  2010-07-02 22:40 ` [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk() Ben Hutchings
  2010-07-03  4:48 ` [PATCH net-2.6 1/2] Revert "rndis_host: Poll status channel before control channel" David Miller
  0 siblings, 2 replies; 6+ messages in thread
From: Ben Hutchings @ 2010-07-02 22:39 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Luís Picciochi Oliveira

This reverts commit c17b274dc2aa538b68c1f02b01a3c4e124b435ba.

That change was reported to break rndis_wlan support for the WUSB54GS.

Reported-by: Luís Picciochi Oliveira <pitxyoki@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/usb/rndis_host.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/net/usb/rndis_host.c b/drivers/net/usb/rndis_host.c
index 28d3ee1..dd8a4ad 100644
--- a/drivers/net/usb/rndis_host.c
+++ b/drivers/net/usb/rndis_host.c
@@ -104,10 +104,8 @@ 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;
@@ -135,17 +133,13 @@ int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen)
 	if (unlikely(retval < 0 || xid == 0))
 		return retval;
 
-	/* 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),
-		&notification, sizeof(notification), &partial,
-		RNDIS_CONTROL_TIMEOUT_MS);
-	if (unlikely(retval < 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.
 
-	/* Poll the control channel; the request probably completed immediately */
+	/* ignore status endpoint, just 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.1




^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk()
  2010-07-02 22:39 [PATCH net-2.6 1/2] Revert "rndis_host: Poll status channel before control channel" Ben Hutchings
@ 2010-07-02 22:40 ` Ben Hutchings
  2010-07-02 22:56   ` Ben Hutchings
  2010-07-03  4:49   ` David Miller
  2010-07-03  4:48 ` [PATCH net-2.6 1/2] Revert "rndis_host: Poll status channel before control channel" David Miller
  1 sibling, 2 replies; 6+ messages in thread
From: Ben Hutchings @ 2010-07-02 22:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Luís Picciochi Oliveira, Joe Perches

netdev_printk() follows the net_device's parent device pointer, so
we must set that earlier than we previously did.

Reported-by: Luís Picciochi Oliveira <pitxyoki@gmail.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/usb/usbnet.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index a95c73d..81c76ad 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -1293,6 +1293,9 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 		goto out;
 	}
 
+	/* netdev_printk() needs this so do it as early as possible */
+	SET_NETDEV_DEV(net, &udev->dev);
+
 	dev = netdev_priv(net);
 	dev->udev = xdev;
 	dev->intf = udev;
@@ -1377,8 +1380,6 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
 		dev->rx_urb_size = dev->hard_mtu;
 	dev->maxpacket = usb_maxpacket (dev->udev, dev->out, 1);
 
-	SET_NETDEV_DEV(net, &udev->dev);
-
 	if ((dev->driver_info->flags & FLAG_WLAN) != 0)
 		SET_NETDEV_DEVTYPE(net, &wlan_type);
 	if ((dev->driver_info->flags & FLAG_WWAN) != 0)
-- 
1.7.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk()
  2010-07-02 22:40 ` [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk() Ben Hutchings
@ 2010-07-02 22:56   ` Ben Hutchings
  2010-07-03  4:49     ` David Miller
  2010-07-03  4:49   ` David Miller
  1 sibling, 1 reply; 6+ messages in thread
From: Ben Hutchings @ 2010-07-02 22:56 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Luís Picciochi Oliveira, Joe Perches

[-- Attachment #1: Type: text/plain, Size: 462 bytes --]

On Fri, 2010-07-02 at 23:40 +0100, Ben Hutchings wrote:
> netdev_printk() follows the net_device's parent device pointer, so
> we must set that earlier than we previously did.
> 
> Reported-by: Luís Picciochi Oliveira <pitxyoki@gmail.com>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
[...]

This should also go into a stable update for 2.6.34.

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] 6+ messages in thread

* Re: [PATCH net-2.6 1/2] Revert "rndis_host: Poll status channel before control channel"
  2010-07-02 22:39 [PATCH net-2.6 1/2] Revert "rndis_host: Poll status channel before control channel" Ben Hutchings
  2010-07-02 22:40 ` [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk() Ben Hutchings
@ 2010-07-03  4:48 ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2010-07-03  4:48 UTC (permalink / raw)
  To: ben; +Cc: netdev, pitxyoki

From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 02 Jul 2010 23:39:21 +0100

> This reverts commit c17b274dc2aa538b68c1f02b01a3c4e124b435ba.
> 
> That change was reported to break rndis_wlan support for the WUSB54GS.
> 
> Reported-by: Luís Picciochi Oliveira <pitxyoki@gmail.com>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

So I wasn't completely crazy when I wanted more testing feedback
for this change :-)

Applied, thanks Ben.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk()
  2010-07-02 22:40 ` [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk() Ben Hutchings
  2010-07-02 22:56   ` Ben Hutchings
@ 2010-07-03  4:49   ` David Miller
  1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2010-07-03  4:49 UTC (permalink / raw)
  To: ben; +Cc: netdev, pitxyoki, joe

From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 02 Jul 2010 23:40:50 +0100

> netdev_printk() follows the net_device's parent device pointer, so
> we must set that earlier than we previously did.
> 
> Reported-by: Luís Picciochi Oliveira <pitxyoki@gmail.com>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>

Applied, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk()
  2010-07-02 22:56   ` Ben Hutchings
@ 2010-07-03  4:49     ` David Miller
  0 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2010-07-03  4:49 UTC (permalink / raw)
  To: ben; +Cc: netdev, pitxyoki, joe

From: Ben Hutchings <ben@decadent.org.uk>
Date: Fri, 02 Jul 2010 23:56:26 +0100

> On Fri, 2010-07-02 at 23:40 +0100, Ben Hutchings wrote:
>> netdev_printk() follows the net_device's parent device pointer, so
>> we must set that earlier than we previously did.
>> 
>> Reported-by: Luís Picciochi Oliveira <pitxyoki@gmail.com>
>> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> [...]
> 
> This should also go into a stable update for 2.6.34.


Ok, queued up.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-07-03  4:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-02 22:39 [PATCH net-2.6 1/2] Revert "rndis_host: Poll status channel before control channel" Ben Hutchings
2010-07-02 22:40 ` [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk() Ben Hutchings
2010-07-02 22:56   ` Ben Hutchings
2010-07-03  4:49     ` David Miller
2010-07-03  4:49   ` David Miller
2010-07-03  4:48 ` [PATCH net-2.6 1/2] Revert "rndis_host: Poll status channel before control channel" David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.