Commit 0226009c authored by Miguel Rodríguez Pérez's avatar Miguel Rodríguez Pérez Committed by David S. Miller

net: cdc_ether: use dev->intf to get interface information

usbnet_cdc_update_filter was getting the interface number from the
usb_interface struct in cdc_state->control. However, cdc_ncm does
not initialize that structure in its bind function, but uses
cdc_ncm_ctx instead. Getting intf directly from struct usbnet solves
the problem.
Signed-off-by: default avatarMiguel Rodríguez Pérez <miguel@det.uvigo.gal>
Signed-off-by: default avatarBjørn Mork <bjorn@mork.no>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eac87c41
...@@ -65,8 +65,6 @@ static const u8 mbm_guid[16] = { ...@@ -65,8 +65,6 @@ static const u8 mbm_guid[16] = {
static void usbnet_cdc_update_filter(struct usbnet *dev) static void usbnet_cdc_update_filter(struct usbnet *dev)
{ {
struct cdc_state *info = (void *) &dev->data;
struct usb_interface *intf = info->control;
struct net_device *net = dev->net; struct net_device *net = dev->net;
u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED u16 cdc_filter = USB_CDC_PACKET_TYPE_DIRECTED
...@@ -86,7 +84,7 @@ static void usbnet_cdc_update_filter(struct usbnet *dev) ...@@ -86,7 +84,7 @@ static void usbnet_cdc_update_filter(struct usbnet *dev)
USB_CDC_SET_ETHERNET_PACKET_FILTER, USB_CDC_SET_ETHERNET_PACKET_FILTER,
USB_TYPE_CLASS | USB_RECIP_INTERFACE, USB_TYPE_CLASS | USB_RECIP_INTERFACE,
cdc_filter, cdc_filter,
intf->cur_altsetting->desc.bInterfaceNumber, dev->intf->cur_altsetting->desc.bInterfaceNumber,
NULL, NULL,
0, 0,
USB_CTRL_SET_TIMEOUT USB_CTRL_SET_TIMEOUT
......
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