diff --git a/dde_linux/patches/ax88179.patch b/dde_linux/patches/ax88179.patch new file mode 100644 index 000000000..814e4c60c --- /dev/null +++ b/dde_linux/patches/ax88179.patch @@ -0,0 +1,11 @@ +diff -r e55abb7f4c0a drivers/net/usb/ax88179_178a.c +--- a/drivers/net/usb/ax88179_178a.c Thu Jun 20 18:17:35 2013 +0200 ++++ b/drivers/net/usb/ax88179_178a.c Thu Jun 20 18:18:13 2013 +0200 +@@ -1022,6 +1022,7 @@ + dev->net->netdev_ops = &ax88179_netdev_ops; + dev->net->ethtool_ops = &ax88179_ethtool_ops; + dev->net->needed_headroom = 8; ++ dev->net->net_ip_align = 1; + + /* Initialize MII structure */ + dev->mii.dev = dev->net; diff --git a/dde_linux/src/lib/usb/include/lx_emul.h b/dde_linux/src/lib/usb/include/lx_emul.h index 9d2defbdb..5144ca122 100644 --- a/dde_linux/src/lib/usb/include/lx_emul.h +++ b/dde_linux/src/lib/usb/include/lx_emul.h @@ -3212,6 +3212,7 @@ struct net_device int watchdog_timeo; /* used by dev_watchdog() */ struct device dev; void *priv; + unsigned net_ip_align; struct phy_device *phydev; }; diff --git a/dde_linux/src/lib/usb/nic/nic.cc b/dde_linux/src/lib/usb/nic/nic.cc index aaf9cd743..c5f78fa17 100644 --- a/dde_linux/src/lib/usb/nic/nic.cc +++ b/dde_linux/src/lib/usb/nic/nic.cc @@ -99,7 +99,7 @@ class Skb /* wait until some SKBs are freed */ _wait_free = false; - PDBG("wait for free skbs ..."); + //PDBG("wait for free skbs ..."); _wait_event(_wait_free); return alloc(); @@ -164,8 +164,9 @@ class Nic_device : public Nic::Device struct usbnet *dev = (usbnet *)netdev_priv(_ndev); /* initialize skb allocators */ - skb_rx(64, dev->rx_urb_size); - skb_tx(64, dev->rx_urb_size); + unsigned urb_cnt = dev->rx_urb_size <= 2048 ? 128 : 64; + skb_rx(urb_cnt, dev->rx_urb_size); + skb_tx(urb_cnt, dev->rx_urb_size); if (!burst()) return; @@ -404,8 +405,10 @@ struct sk_buff *alloc_skb(unsigned int size, gfp_t priority) struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, unsigned int length) { struct sk_buff *s = _alloc_skb(length + NET_IP_ALIGN, false); - s->data += NET_IP_ALIGN; - s->tail += NET_IP_ALIGN; + if (dev->net_ip_align) { + s->data += NET_IP_ALIGN; + s->tail += NET_IP_ALIGN; + } return s; }