mac80211: add the real compat-wireless version + openwrt revision to the compat_version
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 571-ath9k_beacon_fix.patch
1 --- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
2 +++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
3 @@ -326,7 +326,6 @@ static bool ar9003_hw_get_isr(struct ath
4 static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds,
5 struct ath_tx_status *ts)
6 {
7 - struct ar9003_txc *txc = (struct ar9003_txc *) ds;
8 struct ar9003_txs *ads;
9 u32 status;
10
11 @@ -336,11 +335,7 @@ static int ar9003_hw_proc_txdesc(struct
12 if ((status & AR_TxDone) == 0)
13 return -EINPROGRESS;
14
15 - ts->qid = MS(ads->ds_info, AR_TxQcuNum);
16 - if (!txc || (MS(txc->info, AR_TxQcuNum) == ts->qid))
17 - ah->ts_tail = (ah->ts_tail + 1) % ah->ts_size;
18 - else
19 - return -ENOENT;
20 + ah->ts_tail = (ah->ts_tail + 1) % ah->ts_size;
21
22 if ((MS(ads->ds_info, AR_DescId) != ATHEROS_VENDOR_ID) ||
23 (MS(ads->ds_info, AR_TxRxDesc) != 1)) {
24 @@ -354,6 +349,7 @@ static int ar9003_hw_proc_txdesc(struct
25 ts->ts_seqnum = MS(status, AR_SeqNum);
26 ts->tid = MS(status, AR_TxTid);
27
28 + ts->qid = MS(ads->ds_info, AR_TxQcuNum);
29 ts->desc_id = MS(ads->status1, AR_TxDescId);
30 ts->ts_tstamp = ads->status4;
31 ts->ts_status = 0;
32 --- a/drivers/net/wireless/ath/ath9k/beacon.c
33 +++ b/drivers/net/wireless/ath/ath9k/beacon.c
34 @@ -91,7 +91,7 @@ static void ath_beacon_setup(struct ath_
35 info.txpower = MAX_RATE_POWER;
36 info.keyix = ATH9K_TXKEYIX_INVALID;
37 info.keytype = ATH9K_KEY_TYPE_CLEAR;
38 - info.flags = ATH9K_TXDESC_NOACK;
39 + info.flags = ATH9K_TXDESC_NOACK | ATH9K_TXDESC_INTREQ;
40
41 info.buf_addr[0] = bf->bf_buf_addr;
42 info.buf_len[0] = roundup(skb->len, 4);
43 @@ -355,7 +355,6 @@ void ath_beacon_tasklet(unsigned long da
44 struct ath_common *common = ath9k_hw_common(ah);
45 struct ath_buf *bf = NULL;
46 struct ieee80211_vif *vif;
47 - struct ath_tx_status ts;
48 bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
49 int slot;
50 u32 bfaddr, bc = 0;
51 @@ -462,11 +461,6 @@ void ath_beacon_tasklet(unsigned long da
52 ath9k_hw_txstart(ah, sc->beacon.beaconq);
53
54 sc->beacon.ast_be_xmit += bc; /* XXX per-vif? */
55 - if (edma) {
56 - spin_lock_bh(&sc->sc_pcu_lock);
57 - ath9k_hw_txprocdesc(ah, bf->bf_desc, (void *)&ts);
58 - spin_unlock_bh(&sc->sc_pcu_lock);
59 - }
60 }
61 }
62
63 --- a/drivers/net/wireless/ath/ath9k/mac.c
64 +++ b/drivers/net/wireless/ath/ath9k/mac.c
65 @@ -745,7 +745,11 @@ int ath9k_hw_beaconq_setup(struct ath_hw
66 qi.tqi_aifs = 1;
67 qi.tqi_cwmin = 0;
68 qi.tqi_cwmax = 0;
69 - /* NB: don't enable any interrupts */
70 +
71 + if (ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
72 + qi.tqi_qflags = TXQ_FLAG_TXOKINT_ENABLE |
73 + TXQ_FLAG_TXERRINT_ENABLE;
74 +
75 return ath9k_hw_setuptxqueue(ah, ATH9K_TX_QUEUE_BEACON, &qi);
76 }
77 EXPORT_SYMBOL(ath9k_hw_beaconq_setup);
78 --- a/drivers/net/wireless/ath/ath9k/main.c
79 +++ b/drivers/net/wireless/ath/ath9k/main.c
80 @@ -2303,6 +2303,7 @@ static int ath9k_tx_last_beacon(struct i
81 struct ath_vif *avp;
82 struct ath_buf *bf;
83 struct ath_tx_status ts;
84 + bool edma = !!(ah->caps.hw_caps & ATH9K_HW_CAP_EDMA);
85 int status;
86
87 vif = sc->beacon.bslot[0];
88 @@ -2313,7 +2314,7 @@ static int ath9k_tx_last_beacon(struct i
89 if (!avp->is_bslot_active)
90 return 0;
91
92 - if (!sc->beacon.tx_processed) {
93 + if (!sc->beacon.tx_processed && !edma) {
94 tasklet_disable(&sc->bcon_tasklet);
95
96 bf = avp->av_bcbuf;
97 --- a/drivers/net/wireless/ath/ath9k/xmit.c
98 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
99 @@ -2317,9 +2317,12 @@ void ath_tx_edma_tasklet(struct ath_soft
100 break;
101 }
102
103 - /* Skip beacon completions */
104 - if (ts.qid == sc->beacon.beaconq)
105 + /* Process beacon completions separately */
106 + if (ts.qid == sc->beacon.beaconq) {
107 + sc->beacon.tx_processed = true;
108 + sc->beacon.tx_last = !(ts.ts_status & ATH9K_TXERR_MASK);
109 continue;
110 + }
111
112 txq = &sc->tx.txq[ts.qid];
113