Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340484
b: refs/heads/master
c: 3898cdf
h: refs/heads/master
v: v3
  • Loading branch information
Ming Lei authored and David S. Miller committed Oct 26, 2012
1 parent c90a05d commit 07577ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 50 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 24b1042c4eb20980a689a0440590a61a0842021f
refs/heads/master: 3898cdf9ab7ffbb022a737b57b0c1cd539eb96bd
52 changes: 3 additions & 49 deletions trunk/drivers/net/usb/int51x1.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,23 +116,8 @@ static struct sk_buff *int51x1_tx_fixup(struct usbnet *dev,
return skb;
}

static void int51x1_async_cmd_callback(struct urb *urb)
{
struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
int status = urb->status;

if (status < 0)
dev_warn(&urb->dev->dev, "async callback failed with %d\n", status);

kfree(req);
usb_free_urb(urb);
}

static void int51x1_set_multicast(struct net_device *netdev)
{
struct usb_ctrlrequest *req;
int status;
struct urb *urb;
struct usbnet *dev = netdev_priv(netdev);
u16 filter = PACKET_TYPE_DIRECTED | PACKET_TYPE_BROADCAST;

Expand All @@ -149,40 +134,9 @@ static void int51x1_set_multicast(struct net_device *netdev)
netdev_dbg(dev->net, "receive own packets only\n");
}

urb = usb_alloc_urb(0, GFP_ATOMIC);
if (!urb) {
netdev_warn(dev->net, "Error allocating URB\n");
return;
}

req = kmalloc(sizeof(*req), GFP_ATOMIC);
if (!req) {
netdev_warn(dev->net, "Error allocating control msg\n");
goto out;
}

req->bRequestType = USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE;
req->bRequest = SET_ETHERNET_PACKET_FILTER;
req->wValue = cpu_to_le16(filter);
req->wIndex = 0;
req->wLength = 0;

usb_fill_control_urb(urb, dev->udev, usb_sndctrlpipe(dev->udev, 0),
(void *)req, NULL, 0,
int51x1_async_cmd_callback,
(void *)req);

status = usb_submit_urb(urb, GFP_ATOMIC);
if (status < 0) {
netdev_warn(dev->net, "Error submitting control msg, sts=%d\n",
status);
goto out1;
}
return;
out1:
kfree(req);
out:
usb_free_urb(urb);
usbnet_write_cmd_async(dev, SET_ETHERNET_PACKET_FILTER,
USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
filter, 0, NULL, 0);
}

static const struct net_device_ops int51x1_netdev_ops = {
Expand Down

0 comments on commit 07577ce

Please sign in to comment.