2011-08-04 03:35:20 +03:00
|
|
|
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
2012-06-15 00:36:05 +03:00
|
|
|
@@ -244,6 +244,7 @@ struct ath_atx_tid {
|
2011-08-04 03:35:20 +03:00
|
|
|
struct ath_node *an;
|
|
|
|
struct ath_atx_ac *ac;
|
|
|
|
unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)];
|
|
|
|
+ int buf_pending;
|
2012-02-07 13:28:11 +02:00
|
|
|
int bar_index;
|
2011-08-04 03:35:20 +03:00
|
|
|
u16 seq_start;
|
|
|
|
u16 seq_next;
|
2012-06-15 00:36:05 +03:00
|
|
|
@@ -290,6 +291,9 @@ struct ath_tx_control {
|
2011-08-04 03:35:20 +03:00
|
|
|
* (axq_qnum).
|
|
|
|
*/
|
|
|
|
struct ath_tx {
|
|
|
|
+ u32 qlen_single;
|
|
|
|
+ u32 qlen_aggr;
|
|
|
|
+
|
|
|
|
u16 seq_no;
|
|
|
|
u32 txqsetup;
|
|
|
|
spinlock_t txbuflock;
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -1647,6 +1647,10 @@ int ath9k_init_debug(struct ath_hw *ah)
|
2012-02-28 00:56:05 +02:00
|
|
|
&fops_interrupt);
|
2011-08-04 03:35:20 +03:00
|
|
|
debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc,
|
|
|
|
&fops_xmit);
|
|
|
|
+ debugfs_create_u32("qlen_single", S_IRUSR | S_IWUSR,
|
|
|
|
+ sc->debug.debugfs_phy, &sc->tx.qlen_single);
|
|
|
|
+ debugfs_create_u32("qlen_aggr", S_IRUSR | S_IWUSR,
|
|
|
|
+ sc->debug.debugfs_phy, &sc->tx.qlen_aggr);
|
|
|
|
debugfs_create_file("stations", S_IRUSR, sc->debug.debugfs_phy, sc,
|
|
|
|
&fops_stations);
|
|
|
|
debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc,
|
|
|
|
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
|
|
|
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
2012-05-30 04:01:06 +03:00
|
|
|
@@ -393,6 +393,14 @@ static void ath_tx_count_frames(struct a
|
2011-08-04 03:35:20 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
+static struct ath_atx_tid *ath_get_tid(struct ath_node *an, struct sk_buff *skb)
|
|
|
|
+{
|
|
|
|
+ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
|
|
|
+ u8 tidno;
|
|
|
|
+
|
|
|
|
+ tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK;
|
|
|
|
+ return ATH_AN_2_TID(an, tidno);
|
|
|
|
+}
|
|
|
|
|
|
|
|
static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
|
|
|
|
struct ath_buf *bf, struct list_head *bf_q,
|
2012-05-30 04:01:06 +03:00
|
|
|
@@ -487,6 +495,8 @@ static void ath_tx_complete_aggr(struct
|
2011-08-04 03:35:20 +03:00
|
|
|
__skb_queue_head_init(&bf_pending);
|
|
|
|
|
|
|
|
ath_tx_count_frames(sc, bf, ts, txok, &nframes, &nbad);
|
|
|
|
+ tid->buf_pending -= nframes;
|
|
|
|
+
|
|
|
|
while (bf) {
|
2011-08-28 00:57:07 +03:00
|
|
|
u16 seqno = bf->bf_state.seqno;
|
|
|
|
|
2012-05-30 04:01:06 +03:00
|
|
|
@@ -885,6 +895,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_
|
2011-08-28 00:57:07 +03:00
|
|
|
ath_tx_addto_baw(sc, tid, seqno);
|
2011-09-15 20:55:16 +03:00
|
|
|
bf->bf_state.ndelim = ndelim;
|
2011-08-04 03:35:20 +03:00
|
|
|
|
|
|
|
+ tid->buf_pending++;
|
|
|
|
__skb_unlink(skb, &tid->buf_q);
|
|
|
|
list_add_tail(&bf->list, bf_q);
|
2011-09-15 20:55:16 +03:00
|
|
|
if (bf_prev)
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -1728,6 +1739,8 @@ static void ath_tx_send_ampdu(struct ath
|
2011-08-28 00:57:07 +03:00
|
|
|
/* Add sub-frame to BAW */
|
|
|
|
ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
|
2011-08-04 03:35:20 +03:00
|
|
|
|
|
|
|
+ tid->buf_pending++;
|
|
|
|
+
|
|
|
|
/* Queue to h/w without aggregation */
|
|
|
|
TX_STAT_INC(txctl->txq->axq_qnum, a_queued_hw);
|
|
|
|
bf->bf_lastbf = bf;
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -1878,22 +1891,11 @@ error:
|
2011-08-04 03:35:20 +03:00
|
|
|
|
|
|
|
/* FIXME: tx power */
|
2011-08-28 00:57:07 +03:00
|
|
|
static void ath_tx_start_dma(struct ath_softc *sc, struct sk_buff *skb,
|
2011-08-04 03:35:20 +03:00
|
|
|
- struct ath_tx_control *txctl)
|
|
|
|
+ struct ath_tx_control *txctl,
|
|
|
|
+ struct ath_atx_tid *tid)
|
|
|
|
{
|
|
|
|
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
|
|
|
|
- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
|
|
|
|
- struct ath_atx_tid *tid = NULL;
|
2011-08-28 00:57:07 +03:00
|
|
|
struct ath_buf *bf;
|
2011-08-04 03:35:20 +03:00
|
|
|
- u8 tidno;
|
2012-02-07 13:28:11 +02:00
|
|
|
-
|
2012-04-17 00:08:41 +03:00
|
|
|
- if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) && txctl->an &&
|
2011-08-04 03:35:20 +03:00
|
|
|
- ieee80211_is_data_qos(hdr->frame_control)) {
|
|
|
|
- tidno = ieee80211_get_qos_ctl(hdr)[0] &
|
|
|
|
- IEEE80211_QOS_CTL_TID_MASK;
|
|
|
|
- tid = ATH_AN_2_TID(txctl->an, tidno);
|
|
|
|
-
|
|
|
|
- WARN_ON(tid->ac->txq != txctl->txq);
|
|
|
|
- }
|
|
|
|
|
|
|
|
if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && tid) {
|
|
|
|
/*
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -1925,6 +1927,7 @@ int ath_tx_start(struct ieee80211_hw *hw
|
2011-08-04 03:35:20 +03:00
|
|
|
struct ieee80211_vif *vif = info->control.vif;
|
|
|
|
struct ath_softc *sc = hw->priv;
|
|
|
|
struct ath_txq *txq = txctl->txq;
|
|
|
|
+ struct ath_atx_tid *tid = NULL;
|
|
|
|
int padpos, padsize;
|
|
|
|
int frmlen = skb->len + FCS_LEN;
|
2011-08-28 00:57:07 +03:00
|
|
|
int q;
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -1967,6 +1970,24 @@ int ath_tx_start(struct ieee80211_hw *hw
|
2011-08-04 03:35:20 +03:00
|
|
|
|
|
|
|
setup_frame_info(hw, skb, frmlen);
|
|
|
|
|
2012-04-17 00:08:41 +03:00
|
|
|
+ if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) && txctl->an &&
|
2011-08-04 03:35:20 +03:00
|
|
|
+ ieee80211_is_data_qos(hdr->frame_control)) {
|
|
|
|
+ tid = ath_get_tid(txctl->an, skb);
|
|
|
|
+
|
|
|
|
+ WARN_ON(tid->ac->txq != txq);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if ((info->flags & IEEE80211_TX_CTL_AMPDU) && tid) {
|
|
|
|
+ if (sc->tx.qlen_aggr > 0 && skb_queue_len(&tid->buf_q) +
|
|
|
|
+ tid->buf_pending >= sc->tx.qlen_aggr)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+ } else {
|
|
|
|
+ if (sc->tx.qlen_single > 0 &&
|
|
|
|
+ txq->axq_depth - txq->axq_ampdu_depth >=
|
|
|
|
+ sc->tx.qlen_single)
|
|
|
|
+ return -ENOMEM;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
/*
|
|
|
|
* At this point, the vif, hw_key and sta pointers in the tx control
|
|
|
|
* info are no longer valid (overwritten by the ath_frame_info data.
|
2012-06-18 04:26:36 +03:00
|
|
|
@@ -1981,7 +2002,7 @@ int ath_tx_start(struct ieee80211_hw *hw
|
2012-02-07 13:28:11 +02:00
|
|
|
txq->stopped = true;
|
2011-08-04 03:35:20 +03:00
|
|
|
}
|
|
|
|
|
2011-08-28 00:57:07 +03:00
|
|
|
- ath_tx_start_dma(sc, skb, txctl);
|
|
|
|
+ ath_tx_start_dma(sc, skb, txctl, tid);
|
2012-02-07 13:28:11 +02:00
|
|
|
|
|
|
|
ath_txq_unlock(sc, txq);
|
2011-08-28 00:57:07 +03:00
|
|
|
|