mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-07 03:40:15 +00:00
Ported drivers list and extract all needed source files. This decouples ports according to contrib sources and also enables us to revert lxip to Linux version 3.9, while staying with 3.14 for usb. Fixes #1285
44 lines
1.0 KiB
Diff
44 lines
1.0 KiB
Diff
commit e500c61c5fce23cf3a44bdd45fded0a3f34cf4f0
|
|
Author: Sebastian Sumpf <sebastian.sumpf@genode-labs.com>
|
|
Date: Mon Jun 2 13:35:56 2014 +0200
|
|
|
|
usbnet.patch
|
|
|
|
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
|
|
index 31d8b12..f5e3054 100644
|
|
--- a/drivers/net/usb/usbnet.c
|
|
+++ b/drivers/net/usb/usbnet.c
|
|
@@ -63,8 +63,30 @@
|
|
* the equation.
|
|
*/
|
|
#define MAX_QUEUE_MEMORY (60 * 1518)
|
|
-#define RX_QLEN(dev) ((dev)->rx_qlen)
|
|
-#define TX_QLEN(dev) ((dev)->tx_qlen)
|
|
+
|
|
+inline unsigned RX_QLEN(struct usbnet *dev)
|
|
+{
|
|
+ switch(dev->udev->speed) {
|
|
+ case USB_SPEED_HIGH:
|
|
+ return MAX_QUEUE_MEMORY/dev->rx_urb_size;
|
|
+ case USB_SPEED_SUPER:
|
|
+ return 16;
|
|
+ default:
|
|
+ return 4;
|
|
+ }
|
|
+}
|
|
+
|
|
+inline unsigned TX_QLEN(struct usbnet *dev)
|
|
+{
|
|
+ switch(dev->udev->speed) {
|
|
+ case USB_SPEED_HIGH:
|
|
+ return MAX_QUEUE_MEMORY/dev->hard_mtu;
|
|
+ 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)
|