/********/
/* VIFs */
-@@ -658,11 +661,10 @@ enum sc_op_flags {
+@@ -410,6 +413,7 @@ struct ath_beacon {
+ struct ath_descdma bdma;
+ struct ath_txq *cabq;
+ struct list_head bbuf;
++ int cabq_dur;
+
+ bool tx_processed;
+ bool tx_last;
+@@ -658,11 +662,10 @@ enum sc_op_flags {
struct ath_rate_table;
struct ath9k_vif_iter_data {
info.type = get_hw_packet_type(skb);
if (bf->bf_next)
-@@ -1142,6 +1146,18 @@ static void ath_tx_fill_desc(struct ath_
+@@ -1142,6 +1146,21 @@ static void ath_tx_fill_desc(struct ath_
else
info.link = 0;
+ info.flags |= ATH9K_TXDESC_LDPC;
+
+ ath_buf_set_rate(sc, bf, &info, len);
++
++ if (txq == sc->beacon.cabq)
++ sc->beacon.cabq_dur += info.rates[0].PktDuration;
+ }
+
info.buf_addr[0] = bf->bf_buf_addr;
info.buf_len[0] = skb->len;
info.pkt_len = fi->framelen;
-@@ -1151,7 +1167,7 @@ static void ath_tx_fill_desc(struct ath_
+@@ -1151,7 +1170,7 @@ static void ath_tx_fill_desc(struct ath_
if (aggr) {
if (bf == bf_first)
info.aggr = AGGR_BUF_FIRST;
info.aggr = AGGR_BUF_LAST;
else
info.aggr = AGGR_BUF_MIDDLE;
-@@ -1160,6 +1176,9 @@ static void ath_tx_fill_desc(struct ath_
+@@ -1160,6 +1179,9 @@ static void ath_tx_fill_desc(struct ath_
info.aggr_len = len;
}
ath9k_hw_set_txdesc(ah, bf->bf_desc, &info);
bf = bf->bf_next;
}
-@@ -1224,9 +1243,6 @@ int ath_tx_aggr_start(struct ath_softc *
+@@ -1224,9 +1246,6 @@ int ath_tx_aggr_start(struct ath_softc *
an = (struct ath_node *)sta->drv_priv;
txtid = ATH_AN_2_TID(an, tid);
/* update ampdu factor/density, they may have changed. This may happen
* in HT IBSS when a beacon with HT-info is received after the station
* has already been added.
-@@ -1238,7 +1254,7 @@ int ath_tx_aggr_start(struct ath_softc *
+@@ -1238,7 +1257,7 @@ int ath_tx_aggr_start(struct ath_softc *
an->mpdudensity = density;
}
txtid->paused = true;
*ssn = txtid->seq_start = txtid->seq_next;
txtid->bar_index = -1;
-@@ -1255,28 +1271,9 @@ void ath_tx_aggr_stop(struct ath_softc *
+@@ -1255,28 +1274,9 @@ void ath_tx_aggr_stop(struct ath_softc *
struct ath_atx_tid *txtid = ATH_AN_2_TID(an, tid);
struct ath_txq *txq = txtid->ac->txq;
ath_tx_flush_tid(sc, txtid);
ath_txq_unlock_complete(sc, txq);
}
-@@ -1342,18 +1339,92 @@ void ath_tx_aggr_wakeup(struct ath_softc
+@@ -1342,18 +1342,92 @@ void ath_tx_aggr_wakeup(struct ath_softc
}
}
}
/********************/
-@@ -1709,8 +1780,9 @@ static void ath_tx_txqaddbuf(struct ath_
+@@ -1709,8 +1783,9 @@ static void ath_tx_txqaddbuf(struct ath_
}
}
{
struct ath_frame_info *fi = get_frame_info(skb);
struct list_head bf_head;
-@@ -1723,26 +1795,28 @@ static void ath_tx_send_ampdu(struct ath
+@@ -1723,26 +1798,28 @@ static void ath_tx_send_ampdu(struct ath
* - seqno is not within block-ack window
* - h/w queue depth exceeds low water mark
*/
bf->bf_state.bf_type = BUF_AMPDU;
INIT_LIST_HEAD(&bf_head);
list_add(&bf->list, &bf_head);
-@@ -1751,10 +1825,10 @@ static void ath_tx_send_ampdu(struct ath
+@@ -1751,10 +1828,10 @@ static void ath_tx_send_ampdu(struct ath
ath_tx_addto_baw(sc, tid, bf->bf_state.seqno);
/* Queue to h/w without aggregation */
}
static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq,
-@@ -1892,49 +1966,6 @@ static struct ath_buf *ath_tx_setup_buff
+@@ -1892,49 +1969,6 @@ static struct ath_buf *ath_tx_setup_buff
return bf;
}
/* Upon failure caller should free skb */
int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
struct ath_tx_control *txctl)
-@@ -1945,8 +1976,11 @@ int ath_tx_start(struct ieee80211_hw *hw
+@@ -1945,8 +1979,11 @@ int ath_tx_start(struct ieee80211_hw *hw
struct ieee80211_vif *vif = info->control.vif;
struct ath_softc *sc = hw->priv;
struct ath_txq *txq = txctl->txq;
int q;
/* NOTE: sta can be NULL according to net/mac80211.h */
-@@ -2002,8 +2036,47 @@ int ath_tx_start(struct ieee80211_hw *hw
+@@ -2002,8 +2039,47 @@ int ath_tx_start(struct ieee80211_hw *hw
txq->stopped = true;
}
ath_txq_unlock(sc, txq);
return 0;
-@@ -2054,7 +2127,12 @@ static void ath_tx_complete(struct ath_s
+@@ -2054,7 +2130,12 @@ static void ath_tx_complete(struct ath_s
}
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
if (txq == sc->tx.txq_map[q]) {
if (WARN_ON(--txq->pending_frames < 0))
txq->pending_frames = 0;
-@@ -2065,8 +2143,6 @@ static void ath_tx_complete(struct ath_s
+@@ -2065,8 +2146,6 @@ static void ath_tx_complete(struct ath_s
txq->stopped = false;
}
}
}
static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
-@@ -2408,12 +2484,10 @@ void ath_tx_node_init(struct ath_softc *
+@@ -2408,12 +2487,10 @@ void ath_tx_node_init(struct ath_softc *
tid->baw_head = tid->baw_tail = 0;
tid->sched = false;
tid->paused = false;
}
for (acno = 0, ac = &an->ac[acno];
-@@ -2450,9 +2524,9 @@ void ath_tx_node_cleanup(struct ath_soft
+@@ -2450,9 +2527,9 @@ void ath_tx_node_cleanup(struct ath_soft
}
ath_tid_drain(sc, txq, tid);
}
/*
+--- a/drivers/net/wireless/ath/ath9k/beacon.c
++++ b/drivers/net/wireless/ath/ath9k/beacon.c
+@@ -204,9 +204,15 @@ static struct ath_buf *ath9k_beacon_gene
+ }
+
+ ath9k_beacon_setup(sc, vif, bf, info->control.rates[0].idx);
++ sc->beacon.cabq_dur = 0;
+
+ while (skb) {
+ ath9k_tx_cabq(hw, skb);
++
++ if (sc->beacon.cabq_dur / 1000 - 1 >
++ sc->cur_beacon_conf.beacon_interval / ATH_BCBUF)
++ break;
++
+ skb = ieee80211_get_buffered_bc(hw, vif);
+ }
+