Skip to content

Commit c472ab6

Browse files
Oliver Neukumdavem330
authored andcommitted
cdc-ether: clean packet filter upon probe
There are devices that don't do reset all the way. So the packet filter should be set to a sane initial value. Failure to do so leads to intermittent failures of DHCP on some systems under some conditions. Signed-off-by: Oliver Neukum <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 20fbe3a commit c472ab6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/net/usb/cdc_ether.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,22 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
341341
usb_driver_release_interface(driver, info->data);
342342
return -ENODEV;
343343
}
344+
345+
/* Some devices don't initialise properly. In particular
346+
* the packet filter is not reset. There are devices that
347+
* don't do reset all the way. So the packet filter should
348+
* be set to a sane initial value.
349+
*/
350+
usb_control_msg(dev->udev,
351+
usb_sndctrlpipe(dev->udev, 0),
352+
USB_CDC_SET_ETHERNET_PACKET_FILTER,
353+
USB_TYPE_CLASS | USB_RECIP_INTERFACE,
354+
USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | USB_CDC_PACKET_TYPE_BROADCAST,
355+
intf->cur_altsetting->desc.bInterfaceNumber,
356+
NULL,
357+
0,
358+
USB_CTRL_SET_TIMEOUT
359+
);
344360
return 0;
345361

346362
bad_desc:

0 commit comments

Comments
 (0)