Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cdc-ether: implement MULTICAST flag on the device

Olivier having laid the groundwork this patch transmits the
multicast flag to the device to save some bus traffic.

Signed-off-by: Oliver Neukum <oneukum@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Oliver Neukum and committed by
David S. Miller
f46ad73a df32dd20

+10 -9
+10 -9
drivers/net/usb/cdc_ether.c
··· 71 71 { 72 72 struct cdc_state *info = (void *) &dev->data; 73 73 struct usb_interface *intf = info->control; 74 + struct net_device *net = dev->net; 74 75 75 - u16 cdc_filter = 76 - USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | 77 - USB_CDC_PACKET_TYPE_BROADCAST; 76 + u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED 77 + | USB_CDC_PACKET_TYPE_BROADCAST; 78 78 79 - if (dev->net->flags & IFF_PROMISC) 80 - cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS; 81 - 82 - /* FIXME cdc-ether has some multicast code too, though it complains 83 - * in routine cases. info->ether describes the multicast support. 84 - * Implement that here, manipulating the cdc filter as needed. 79 + /* filtering on the device is an optional feature and not worth 80 + * the hassle so we just roughly care about snooping and if any 81 + * multicast is requested, we take every multicast 85 82 */ 83 + if (net->flags & IFF_PROMISC) 84 + cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS; 85 + if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI)) 86 + cdc_filter |= USB_CDC_PACKET_TYPE_ALL_MULTICAST; 86 87 87 88 usb_control_msg(dev->udev, 88 89 usb_sndctrlpipe(dev->udev, 0),