Skip to contentSkip to conversation

Revert "rndis_host: Poll status channel before control channel"

PATCH Applied Ben Hutchings 2 participants 6 messages Jul 2, 2010 – Jul 3, 2010

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Revert "rndis_host: Poll status channel before control channel"

This reverts commit c17b274dc2aa538b68c1f02b01a3c4e124b435ba.

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

---
 drivers/net/usb/rndis_host.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)
drivers/net/usb/rndis_host.c +6 -12
index 28d3ee1..dd8a4ad 100644
@@ -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);
Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/2 usbnet: Set parent device early for netdev_printk()

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

---
 drivers/net/usb/usbnet.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/usb/usbnet.c +3 -2
index a95c73d..81c76ad 100644
@@ -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)
Signature · 1 line
1.7.1
#2 lore raw

Re: [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk()

Quoted 5 lines · Ben Hutchings

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

[...]

This should also go into a stable update for 2.6.34.

Ben.

Signature · 2 lines
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
maintainer
#3 lore raw

Re: [PATCH net-2.6 2/2] usbnet: Set parent device early for netdev_printk()

From: Ben Hutchings <[email protected]>
Date: Fri, 02 Jul 2010 23:56:26 +0100

Quoted 9 lines · Ben Hutchings
Quoted 5 lines

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

[...]

This should also go into a stable update for 2.6.34.

Ok, queued up.

maintainer Applied
#5 lore raw
In reply to Ben Hutchings

From: Ben Hutchings <[email protected]>
Date: Fri, 02 Jul 2010 23:39:21 +0100

Quoted 6 lines

This reverts commit c17b274dc2aa538b68c1f02b01a3c4e124b435ba.

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

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

Applied, thanks Ben.