aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/usbnet.h
diff options
context:
space:
mode:
authorMing Lei <ming.lei@canonical.com>2013-07-25 01:47:53 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-27 23:10:57 -0400
commita88c32ae15f25fcf0a3c9fadd92f840a1abf0e43 (patch)
treeaf3102f094d7e5d842bf204f49bd0f8f99a54616 /include/linux/usb/usbnet.h
parent6680ec68eff47d36f67b4351bc9836fd6cba9532 (diff)
USBNET: centralize computing of max rx/tx qlen
This patch centralizes computing of max rx/tx qlen, because: - RX_QLEN()/TX_QLEN() is called in hot path - computing depends on device's usb speed, now we have ls/fs, hs, ss, so more checks need to be involved - in fact, max rx/tx qlen should not only depend on device USB speed, but also depend on ethernet link speed, so we need to consider that in future. - if SG support is done, max tx qlen may need change too Generally, hard_mtu and rx_urb_size are changed in bind(), reset() and link_reset() callback, and change mtu network operation, this patches introduces the API of usbnet_update_max_qlen(), and calls it in above path. Signed-off-by: Ming Lei <ming.lei@canonical.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/usb/usbnet.h')
-rw-r--r--include/linux/usb/usbnet.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index f18d64129f99..8fbc008e183e 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -34,6 +34,7 @@ struct usbnet {
34 struct mutex phy_mutex; 34 struct mutex phy_mutex;
35 unsigned char suspend_count; 35 unsigned char suspend_count;
36 unsigned char pkt_cnt, pkt_err; 36 unsigned char pkt_cnt, pkt_err;
37 unsigned short rx_qlen, tx_qlen;
37 38
38 /* i/o info: pipes etc */ 39 /* i/o info: pipes etc */
39 unsigned in, out; 40 unsigned in, out;
@@ -253,4 +254,6 @@ extern void usbnet_link_change(struct usbnet *, bool, bool);
253extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags); 254extern int usbnet_status_start(struct usbnet *dev, gfp_t mem_flags);
254extern void usbnet_status_stop(struct usbnet *dev); 255extern void usbnet_status_stop(struct usbnet *dev);
255 256
257extern void usbnet_update_max_qlen(struct usbnet *dev);
258
256#endif /* __LINUX_USB_USBNET_H */ 259#endif /* __LINUX_USB_USBNET_H */