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 11:25:35 +0530
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)
downloadkernel_samsung_smdk4412-d67ee5339363608adce786ec8fd62a0fb2b66116.zip
kernel_samsung_smdk4412-d67ee5339363608adce786ec8fd62a0fb2b66116.tar.gz
kernel_samsung_smdk4412-d67ee5339363608adce786ec8fd62a0fb2b66116.tar.bz2
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 1cbe194..d17662f 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)
spin_unlock_bh(&priv->tx.tx_lock);
}
+static enum htc_endpoint_id get_htc_epid(struct ath9k_htc_priv *priv,
+ u16 qnum)
+{
+ enum htc_endpoint_id epid;
+
+ switch (qnum) {
+ case 0:
+ TX_QSTAT_INC(WME_AC_VO);
+ epid = priv->data_vo_ep;
+ break;
+ case 1:
+ TX_QSTAT_INC(WME_AC_VI);
+ epid = priv->data_vi_ep;
+ break;
+ case 2:
+ TX_QSTAT_INC(WME_AC_BE);
+ epid = priv->data_be_ep;
+ break;
+ case 3:
+ default:
+ TX_QSTAT_INC(WME_AC_BK);
+ epid = priv->data_bk_ep;
+ break;
+ }
+
+ return epid;
+}
+
int ath_htc_txq_update(struct ath9k_htc_priv *priv, int qnum,
struct ath9k_tx_queue_info *qinfo)
{
@@ -113,7 +141,6 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
struct ath9k_htc_sta *ista;
struct ath9k_htc_vif *avp = NULL;
struct ath9k_htc_tx_ctl *tx_ctl;
- enum htc_endpoint_id epid;
u16 qnum;
__le16 fc;
u8 *tx_fhdr;
@@ -197,31 +224,12 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
if (is_cab) {
CAB_STAT_INC;
- epid = priv->cab_ep;
+ tx_ctl->epid = priv->cab_ep;
goto send;
}
qnum = skb_get_queue_mapping(skb);
-
- switch (qnum) {
- case 0:
- TX_QSTAT_INC(WME_AC_VO);
- epid = priv->data_vo_ep;
- break;
- case 1:
- TX_QSTAT_INC(WME_AC_VI);
- epid = priv->data_vi_ep;
- break;
- case 2:
- TX_QSTAT_INC(WME_AC_BE);
- epid = priv->data_be_ep;
- break;
- case 3:
- default:
- TX_QSTAT_INC(WME_AC_BK);
- epid = priv->data_bk_ep;
- break;
- }
+ tx_ctl->epid = get_htc_epid(priv, qnum);
} else {
struct tx_mgmt_hdr mgmt_hdr;
@@ -251,10 +259,10 @@ int ath9k_htc_tx_start(struct ath9k_htc_priv *priv,
tx_fhdr = skb_push(skb, sizeof(mgmt_hdr));
memcpy(tx_fhdr, (u8 *) &mgmt_hdr, sizeof(mgmt_hdr));
- epid = priv->mgmt_ep;
+ tx_ctl->epid = priv->mgmt_ep;
}
send:
- return htc_send(priv->htc, skb, epid);
+ return htc_send(priv->htc, skb);
}
static bool ath9k_htc_check_tx_aggr(struct ath9k_htc_priv *priv,