Commit f46ad73a authored by Oliver Neukum's avatar Oliver Neukum Committed by David S. Miller

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: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent df32dd20
...@@ -71,18 +71,19 @@ static void usbnet_cdc_update_filter(struct usbnet *dev) ...@@ -71,18 +71,19 @@ static void usbnet_cdc_update_filter(struct usbnet *dev)
{ {
struct cdc_state *info = (void *) &dev->data; struct cdc_state *info = (void *) &dev->data;
struct usb_interface *intf = info->control; struct usb_interface *intf = info->control;
struct net_device *net = dev->net;
u16 cdc_filter = u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED
USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | | USB_CDC_PACKET_TYPE_BROADCAST;
USB_CDC_PACKET_TYPE_BROADCAST;
if (dev->net->flags & IFF_PROMISC) /* filtering on the device is an optional feature and not worth
cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS; * the hassle so we just roughly care about snooping and if any
* multicast is requested, we take every multicast
/* FIXME cdc-ether has some multicast code too, though it complains
* in routine cases. info->ether describes the multicast support.
* Implement that here, manipulating the cdc filter as needed.
*/ */
if (net->flags & IFF_PROMISC)
cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS;
if (!netdev_mc_empty(net) || (net->flags & IFF_ALLMULTI))
cdc_filter |= USB_CDC_PACKET_TYPE_ALL_MULTICAST;
usb_control_msg(dev->udev, usb_control_msg(dev->udev,
usb_sndctrlpipe(dev->udev, 0), usb_sndctrlpipe(dev->udev, 0),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment