aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>2014-05-27 07:45:46 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-05-29 13:10:30 -0400
commit5bb6423e8f23b755cb20c21aa896cc4d4baf6bc5 (patch)
tree543713b062d9d2578ca36beef10ce21105950442
parentfc219eed079eb0b11d93ed1adf4fa58f2b465215 (diff)
wil6210: inline functions for vring hi/lo watermarks
Provide clear definition of the watermarks for the vring descriptor space. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/wil6210/txrx.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c
index c8c547457eb4..82140e0e75d2 100644
--- a/drivers/net/wireless/ath/wil6210/txrx.c
+++ b/drivers/net/wireless/ath/wil6210/txrx.c
@@ -64,6 +64,22 @@ static inline int wil_vring_avail_tx(struct vring *vring)
64 return vring->size - used - 1; 64 return vring->size - used - 1;
65} 65}
66 66
67/**
68 * wil_vring_wmark_low - low watermark for available descriptor space
69 */
70static inline int wil_vring_wmark_low(struct vring *vring)
71{
72 return vring->size/8;
73}
74
75/**
76 * wil_vring_wmark_high - high watermark for available descriptor space
77 */
78static inline int wil_vring_wmark_high(struct vring *vring)
79{
80 return vring->size/4;
81}
82
67static int wil_vring_alloc(struct wil6210_priv *wil, struct vring *vring) 83static int wil_vring_alloc(struct wil6210_priv *wil, struct vring *vring)
68{ 84{
69 struct device *dev = wil_to_dev(wil); 85 struct device *dev = wil_to_dev(wil);
@@ -1007,7 +1023,7 @@ netdev_tx_t wil_start_xmit(struct sk_buff *skb, struct net_device *ndev)
1007 rc = wil_tx_vring(wil, vring, skb); 1023 rc = wil_tx_vring(wil, vring, skb);
1008 1024
1009 /* do we still have enough room in the vring? */ 1025 /* do we still have enough room in the vring? */
1010 if (wil_vring_avail_tx(vring) < vring->size/8) 1026 if (wil_vring_avail_tx(vring) < wil_vring_wmark_low(vring))
1011 netif_tx_stop_all_queues(wil_to_ndev(wil)); 1027 netif_tx_stop_all_queues(wil_to_ndev(wil));
1012 1028
1013 switch (rc) { 1029 switch (rc) {
@@ -1116,7 +1132,7 @@ int wil_tx_complete(struct wil6210_priv *wil, int ringid)
1116 done++; 1132 done++;
1117 } 1133 }
1118 } 1134 }
1119 if (wil_vring_avail_tx(vring) > vring->size/4) 1135 if (wil_vring_avail_tx(vring) > wil_vring_wmark_high(vring))
1120 netif_tx_wake_all_queues(wil_to_ndev(wil)); 1136 netif_tx_wake_all_queues(wil_to_ndev(wil));
1121 1137
1122 return done; 1138 return done;