usbnet.c (9d066a252786e1a18484a6283f82614d42a9f4ac) usbnet.c (43daa96b166c3cf5ff30dfac0c5efa2620e4beab)
1/*
2 * USB Network driver infrastructure
3 * Copyright (C) 2000-2005 by David Brownell
4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 381 unchanged lines hidden (view full) ---

390 // no second zero-length packet read wanted after mtu-sized packets
391 if ((ll_mtu % dev->maxpacket) == 0)
392 return -EDOM;
393 net->mtu = new_mtu;
394
395 dev->hard_mtu = net->mtu + net->hard_header_len;
396 if (dev->rx_urb_size == old_hard_mtu) {
397 dev->rx_urb_size = dev->hard_mtu;
1/*
2 * USB Network driver infrastructure
3 * Copyright (C) 2000-2005 by David Brownell
4 * Copyright (C) 2003-2005 David Hollis <dhollis@davehollis.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or

--- 381 unchanged lines hidden (view full) ---

390 // no second zero-length packet read wanted after mtu-sized packets
391 if ((ll_mtu % dev->maxpacket) == 0)
392 return -EDOM;
393 net->mtu = new_mtu;
394
395 dev->hard_mtu = net->mtu + net->hard_header_len;
396 if (dev->rx_urb_size == old_hard_mtu) {
397 dev->rx_urb_size = dev->hard_mtu;
398 if (dev->rx_urb_size > old_rx_urb_size)
398 if (dev->rx_urb_size > old_rx_urb_size) {
399 usbnet_pause_rx(dev);
399 usbnet_unlink_rx_urbs(dev);
400 usbnet_unlink_rx_urbs(dev);
401 usbnet_resume_rx(dev);
402 }
400 }
401
402 /* max qlen depend on hard_mtu and rx_urb_size */
403 usbnet_update_max_qlen(dev);
404
405 return 0;
406}
407EXPORT_SYMBOL_GPL(usbnet_change_mtu);

--- 1095 unchanged lines hidden (view full) ---

1503 if (waitqueue_active(&dev->wait)) {
1504 if (dev->txq.qlen + dev->rxq.qlen + dev->done.qlen == 0)
1505 wake_up_all(&dev->wait);
1506
1507 // or are we maybe short a few urbs?
1508 } else if (netif_running (dev->net) &&
1509 netif_device_present (dev->net) &&
1510 netif_carrier_ok(dev->net) &&
403 }
404
405 /* max qlen depend on hard_mtu and rx_urb_size */
406 usbnet_update_max_qlen(dev);
407
408 return 0;
409}
410EXPORT_SYMBOL_GPL(usbnet_change_mtu);

--- 1095 unchanged lines hidden (view full) ---

1506 if (waitqueue_active(&dev->wait)) {
1507 if (dev->txq.qlen + dev->rxq.qlen + dev->done.qlen == 0)
1508 wake_up_all(&dev->wait);
1509
1510 // or are we maybe short a few urbs?
1511 } else if (netif_running (dev->net) &&
1512 netif_device_present (dev->net) &&
1513 netif_carrier_ok(dev->net) &&
1511 !timer_pending (&dev->delay) &&
1512 !test_bit (EVENT_RX_HALT, &dev->flags)) {
1514 !timer_pending(&dev->delay) &&
1515 !test_bit(EVENT_RX_PAUSED, &dev->flags) &&
1516 !test_bit(EVENT_RX_HALT, &dev->flags)) {
1513 int temp = dev->rxq.qlen;
1514
1515 if (temp < RX_QLEN(dev)) {
1516 if (rx_alloc_submit(dev, GFP_ATOMIC) == -ENOLINK)
1517 return;
1518 if (temp != dev->rxq.qlen)
1519 netif_dbg(dev, link, dev->net,
1520 "rxqlen %d --> %d\n",

--- 748 unchanged lines hidden ---
1517 int temp = dev->rxq.qlen;
1518
1519 if (temp < RX_QLEN(dev)) {
1520 if (rx_alloc_submit(dev, GFP_ATOMIC) == -ENOLINK)
1521 return;
1522 if (temp != dev->rxq.qlen)
1523 netif_dbg(dev, link, dev->net,
1524 "rxqlen %d --> %d\n",

--- 748 unchanged lines hidden ---