diff options
Diffstat (limited to 'drivers/net/usb/usbnet.c')
| -rw-r--r-- | drivers/net/usb/usbnet.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 95c41d56631c..069c1cf0fdf7 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
| @@ -387,8 +387,12 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
| 387 | static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) | 387 | static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) |
| 388 | { | 388 | { |
| 389 | if (dev->driver_info->rx_fixup && | 389 | if (dev->driver_info->rx_fixup && |
| 390 | !dev->driver_info->rx_fixup (dev, skb)) | 390 | !dev->driver_info->rx_fixup (dev, skb)) { |
| 391 | goto error; | 391 | /* With RX_ASSEMBLE, rx_fixup() must update counters */ |
| 392 | if (!(dev->driver_info->flags & FLAG_RX_ASSEMBLE)) | ||
| 393 | dev->net->stats.rx_errors++; | ||
| 394 | goto done; | ||
| 395 | } | ||
| 392 | // else network stack removes extra byte if we forced a short packet | 396 | // else network stack removes extra byte if we forced a short packet |
| 393 | 397 | ||
| 394 | if (skb->len) { | 398 | if (skb->len) { |
| @@ -401,8 +405,8 @@ static inline void rx_process (struct usbnet *dev, struct sk_buff *skb) | |||
| 401 | } | 405 | } |
| 402 | 406 | ||
| 403 | netif_dbg(dev, rx_err, dev->net, "drop\n"); | 407 | netif_dbg(dev, rx_err, dev->net, "drop\n"); |
| 404 | error: | ||
| 405 | dev->net->stats.rx_errors++; | 408 | dev->net->stats.rx_errors++; |
| 409 | done: | ||
| 406 | skb_queue_tail(&dev->done, skb); | 410 | skb_queue_tail(&dev->done, skb); |
| 407 | } | 411 | } |
| 408 | 412 | ||
| @@ -1376,7 +1380,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
| 1376 | // else "eth%d" when there's reasonable doubt. userspace | 1380 | // else "eth%d" when there's reasonable doubt. userspace |
| 1377 | // can rename the link if it knows better. | 1381 | // can rename the link if it knows better. |
| 1378 | if ((dev->driver_info->flags & FLAG_ETHER) != 0 && | 1382 | if ((dev->driver_info->flags & FLAG_ETHER) != 0 && |
| 1379 | (net->dev_addr [0] & 0x02) == 0) | 1383 | ((dev->driver_info->flags & FLAG_POINTTOPOINT) == 0 || |
| 1384 | (net->dev_addr [0] & 0x02) == 0)) | ||
| 1380 | strcpy (net->name, "eth%d"); | 1385 | strcpy (net->name, "eth%d"); |
| 1381 | /* WLAN devices should always be named "wlan%d" */ | 1386 | /* WLAN devices should always be named "wlan%d" */ |
| 1382 | if ((dev->driver_info->flags & FLAG_WLAN) != 0) | 1387 | if ((dev->driver_info->flags & FLAG_WLAN) != 0) |
