aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
diff options
context:
space:
mode:
authorSujith Manoharan <Sujith.Manoharan@atheros.com>2011-04-13 01:55:35 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-04-13 15:23:46 -0400
commitd67ee5339363608adce786ec8fd62a0fb2b66116 (patch)
treed7e93c33d076806df49a8ec1e349348fc2eb08b9 /drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
parent8e86a54715c4102a8ed697939de9ebd9715dc59c (diff)
ath9k_htc: Introduce new HTC API
A new routine that takes an endpoint explicitly is introduced. The normal htc_send() now retrieves the endpoint from the packet's private data. This would be useful in TX completion when the endpoint ID would be required. While at it, use a helper function to map the queue to endpoint. Data/mgmt/beacon packets use htc_send(), while WMI comamnds pass the endpoint to HTC. Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/htc_drv_txrx.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_txrx.c56
1 files changed, 32 insertions, 24 deletions
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
index 1cbe194179ab..d17662fa604a 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_txrx.c
@@ -76,6 +76,34 @@ void ath9k_htc_check_wake_queues(struct ath9k_htc_priv *priv)
76 spin_unlock_bh(&priv->tx.tx_lock); 76 spin_unlock_bh(&priv->tx.tx_lock);
77} 77}
78 78
79static enum htc_endpoint_id get_htc_epid(struct ath9k_htc_priv *priv,
80 u16 qnum)
81{
82 enum htc_endpoint_id epid;
83
84 switch (qnum) {
85 case 0:
86 TX_QSTAT_INC(WME_AC_VO);
87 epid = priv->data_vo_ep;
88 break;
89 case 1:
90 TX_QSTAT_INC(WME_AC_VI);
91 epid = priv->data_vi_ep;
92 break;
93 case 2:
94 TX_QSTAT_INC(WME_AC_BE);
95 epid = priv->data_be_ep;
96 break;
97 case 3:
98 default:
99 TX_QSTAT_INC(WME_AC_BK);
100 epid = priv->data_bk_ep;
101 break;
102 }
103
104 return epid;
105}
106
79int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum, 107int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
80 struct ath9k_tx_queue_info *qinfo) 108 struct ath9k_tx_queue_info *qinfo)
81{ 109{
@@ -113,7 +141,6 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
113 struct ath9k_htc_sta *ista; 141 struct ath9k_htc_sta *ista;
114 struct ath9k_htc_vif *avp = NULL; 142 struct ath9k_htc_vif *avp = NULL;
115 struct ath9k_htc_tx_ctl *tx_ctl; 143 struct ath9k_htc_tx_ctl *tx_ctl;
116 enum htc_endpoint_id epid;
117 u16 qnum; 144 u16 qnum;
118 __le16 fc; 145 __le16 fc;
119 u8 *tx_fhdr; 146 u8 *tx_fhdr;
@@ -197,31 +224,12 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
197 224
198 if (is_cab) { 225 if (is_cab) {
199 CAB_STAT_INC; 226 CAB_STAT_INC;
200 epid = priv->cab_ep; 227 tx_ctl->epid = priv->cab_ep;
201 goto send; 228 goto send;
202 } 229 }
203 230
204 qnum = skb_get_queue_mapping(skb); 231 qnum = skb_get_queue_mapping(skb);
205 232 tx_ctl->epid = get_htc_epid(priv, qnum);
206 switch (qnum) {
207 case 0:
208 TX_QSTAT_INC(WME_AC_VO);
209 epid = priv->data_vo_ep;
210 break;
211 case 1:
212 TX_QSTAT_INC(WME_AC_VI);
213 epid = priv->data_vi_ep;
214 break;
215 case 2:
216 TX_QSTAT_INC(WME_AC_BE);
217 epid = priv->data_be_ep;
218 break;
219 case 3:
220 default:
221 TX_QSTAT_INC(WME_AC_BK);
222 epid = priv->data_bk_ep;
223 break;
224 }
225 } else { 233 } else {
226 struct tx_mgmt_hdr mgmt_hdr; 234 struct tx_mgmt_hdr mgmt_hdr;
227 235
@@ -251,10 +259,10 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
251 259
252 tx_fhdr = skb_push(skb, sizeof(mgmt_hdr)); 260 tx_fhdr = skb_push(skb, sizeof(mgmt_hdr));
253 memcpy(tx_fhdr, (u8 *) &mgmt_hdr, sizeof(mgmt_hdr)); 261 memcpy(tx_fhdr, (u8 *) &mgmt_hdr, sizeof(mgmt_hdr));
254 epid = priv->mgmt_ep; 262 tx_ctl->epid = priv->mgmt_ep;
255 } 263 }
256send: 264send:
257 return htc_send(priv->htc, skb, epid); 265 return htc_send(priv->htc, skb);
258} 266}
259 267
260static bool ath9k_htc_check_tx_aggr(struct ath9k_htc_priv *priv, 268static bool ath9k_htc_check_tx_aggr(struct ath9k_htc_priv *priv,