diff options
author | Oliver Neukum <oneukum@suse.de> | 2014-11-06 09:19:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-07 15:17:45 -0500 |
commit | f46ad73ac6965f71d1a2ba217c4eb5b644e62949 (patch) | |
tree | ebd282b43aa8427a79284448748df195dac08993 /drivers/net/usb/cdc_ether.c | |
parent | df32dd2054b6edcbdfd3a31aec24e7fd0edba2ac (diff) |
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>
Diffstat (limited to 'drivers/net/usb/cdc_ether.c')
-rw-r--r-- | drivers/net/usb/cdc_ether.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index d3920b54a92c..9311a08565be 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -71,18 +71,19 @@ static void usbnet_cdc_update_filter(struct usbnet *dev) | |||
71 | { | 71 | { |
72 | struct cdc_state *info = (void *) &dev->data; | 72 | struct cdc_state *info = (void *) &dev->data; |
73 | struct usb_interface *intf = info->control; | 73 | struct usb_interface *intf = info->control; |
74 | struct net_device *net = dev->net; | ||
74 | 75 | ||
75 | u16 cdc_filter = | 76 | u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED |
76 | USB_CDC_PACKET_TYPE_ALL_MULTICAST | USB_CDC_PACKET_TYPE_DIRECTED | | 77 | | USB_CDC_PACKET_TYPE_BROADCAST; |
77 | USB_CDC_PACKET_TYPE_BROADCAST; | ||
78 | 78 | ||
79 | if (dev->net->flags & IFF_PROMISC) | 79 | /* filtering on the device is an optional feature and not worth |
80 | cdc_filter |= USB_CDC_PACKET_TYPE_PROMISCUOUS; | 80 | * the hassle so we just roughly care about snooping and if any |
81 | 81 | * multicast is requested, we take every multicast | |
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. | ||
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 | usb_control_msg(dev->udev, | 88 | usb_control_msg(dev->udev, |
88 | usb_sndctrlpipe(dev->udev, 0), | 89 | usb_sndctrlpipe(dev->udev, 0), |