2016-05-18 16:51:11 +00:00
|
|
|
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
|
|
|
|
index 6237370..8339402 100644
|
2014-06-02 11:50:17 +00:00
|
|
|
--- a/drivers/net/usb/usbnet.c
|
|
|
|
+++ b/drivers/net/usb/usbnet.c
|
2016-05-18 16:51:11 +00:00
|
|
|
@@ -64,8 +64,30 @@
|
2014-06-02 11:50:17 +00:00
|
|
|
* the equation.
|
2013-06-17 08:34:30 +00:00
|
|
|
*/
|
2014-06-02 11:50:17 +00:00
|
|
|
#define MAX_QUEUE_MEMORY (60 * 1518)
|
|
|
|
-#define RX_QLEN(dev) ((dev)->rx_qlen)
|
|
|
|
-#define TX_QLEN(dev) ((dev)->tx_qlen)
|
|
|
|
+
|
2013-06-17 08:34:30 +00:00
|
|
|
+inline unsigned RX_QLEN(struct usbnet *dev)
|
|
|
|
+{
|
|
|
|
+ switch(dev->udev->speed) {
|
|
|
|
+ case USB_SPEED_HIGH:
|
2014-06-02 11:50:17 +00:00
|
|
|
+ return MAX_QUEUE_MEMORY/dev->rx_urb_size;
|
2013-06-17 08:34:30 +00:00
|
|
|
+ case USB_SPEED_SUPER:
|
|
|
|
+ return 16;
|
|
|
|
+ default:
|
|
|
|
+ return 4;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+inline unsigned TX_QLEN(struct usbnet *dev)
|
|
|
|
+{
|
|
|
|
+ switch(dev->udev->speed) {
|
|
|
|
+ case USB_SPEED_HIGH:
|
2014-06-02 11:50:17 +00:00
|
|
|
+ return MAX_QUEUE_MEMORY/dev->hard_mtu;
|
2013-06-17 08:34:30 +00:00
|
|
|
+ case USB_SPEED_SUPER:
|
|
|
|
+ return 16;
|
|
|
|
+ default:
|
|
|
|
+ return 4;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
|
|
|
|
// reawaken network queue this soon after stopping; else watchdog barks
|
|
|
|
#define TX_TIMEOUT_JIFFIES (5*HZ)
|