parent
e430c864f4
commit
ea63948914
@ -1,11 +1,11 @@ |
||||
--- a/config.mk
|
||||
+++ b/config.mk
|
||||
@@ -259,7 +259,7 @@ CONFIG_ATH9K_COMMON=m
|
||||
@@ -261,7 +261,7 @@ CONFIG_ATH9K_COMMON=m
|
||||
# as default once we get minstrel properly tested and blessed by
|
||||
# our systems engineering team. CCK rates also need to be used
|
||||
# for long range considerations.
|
||||
-CONFIG_ATH9K_RATE_CONTROL=y
|
||||
+# CONFIG_ATH9K_RATE_CONTROL=y
|
||||
|
||||
# PCI Drivers
|
||||
ifdef CONFIG_PCI
|
||||
CONFIG_ATH9K_BTCOEX_SUPPORT=y
|
||||
|
||||
|
@ -1,44 +0,0 @@ |
||||
Do not activate the mac80211 tracing by default as it does not work with
|
||||
kernel <= 2.6.32. Compat also includes include/trace/define_trace.h over
|
||||
include/trace/events/module.h which makes this not compiling any more.
|
||||
|
||||
--- a/net/mac80211/Makefile
|
||||
+++ b/net/mac80211/Makefile
|
||||
@@ -24,8 +24,7 @@ mac80211-y := \
|
||||
util.o \
|
||||
wme.o \
|
||||
event.o \
|
||||
- chan.o \
|
||||
- driver-trace.o
|
||||
+ chan.o
|
||||
|
||||
mac80211-$(CONFIG_MAC80211_LEDS) += led.o
|
||||
mac80211-$(CONFIG_MAC80211_DEBUGFS) += \
|
||||
@@ -42,6 +41,7 @@ mac80211-$(CONFIG_MAC80211_MESH) += \
|
||||
|
||||
mac80211-$(CONFIG_PM) += pm.o
|
||||
|
||||
+mac80211-$(CONFIG_MAC80211_DRIVER_API_TRACER) += driver-trace.o
|
||||
CFLAGS_driver-trace.o := -I$(src)
|
||||
|
||||
# objects for PID algorithm
|
||||
--- a/net/mac80211/driver-trace.h
|
||||
+++ b/net/mac80211/driver-trace.h
|
||||
@@ -5,6 +5,17 @@
|
||||
#include <net/mac80211.h>
|
||||
#include "ieee80211_i.h"
|
||||
|
||||
+#if !defined(CONFIG_MAC80211_DRIVER_API_TRACER) || defined(__CHECKER__)
|
||||
+#undef TRACE_EVENT
|
||||
+#define TRACE_EVENT(name, proto, ...) \
|
||||
+static inline void trace_ ## name(proto) {}
|
||||
+#undef DECLARE_EVENT_CLASS
|
||||
+#define DECLARE_EVENT_CLASS(...)
|
||||
+#undef DEFINE_EVENT
|
||||
+#define DEFINE_EVENT(evt_class, name, proto, ...) \
|
||||
+static inline void trace_ ## name(proto) {}
|
||||
+#endif
|
||||
+
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM mac80211
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,62 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -264,14 +264,17 @@ static void ath_tid_drain(struct ath_sof
|
||||
}
|
||||
|
||||
static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq,
|
||||
- struct sk_buff *skb)
|
||||
+ struct sk_buff *skb, int count)
|
||||
{
|
||||
struct ath_frame_info *fi = get_frame_info(skb);
|
||||
struct ath_buf *bf = fi->bf;
|
||||
struct ieee80211_hdr *hdr;
|
||||
+ int prev = fi->retries;
|
||||
|
||||
TX_STAT_INC(txq->axq_qnum, a_retries);
|
||||
- if (fi->retries++ > 0)
|
||||
+ fi->retries += count;
|
||||
+
|
||||
+ if (prev > 0)
|
||||
return;
|
||||
|
||||
hdr = (struct ieee80211_hdr *)skb->data;
|
||||
@@ -387,6 +390,7 @@ static void ath_tx_complete_aggr(struct
|
||||
int nframes;
|
||||
u8 tidno;
|
||||
bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH);
|
||||
+ int i, retries;
|
||||
|
||||
skb = bf->bf_mpdu;
|
||||
hdr = (struct ieee80211_hdr *)skb->data;
|
||||
@@ -395,6 +399,10 @@ static void ath_tx_complete_aggr(struct
|
||||
|
||||
memcpy(rates, tx_info->control.rates, sizeof(rates));
|
||||
|
||||
+ retries = ts->ts_longretry + 1;
|
||||
+ for (i = 0; i < ts->ts_rateindex; i++)
|
||||
+ retries += rates[i].count;
|
||||
+
|
||||
rcu_read_lock();
|
||||
|
||||
sta = ieee80211_find_sta_by_ifaddr(hw, hdr->addr1, hdr->addr2);
|
||||
@@ -481,7 +489,8 @@ static void ath_tx_complete_aggr(struct
|
||||
txpending = 1;
|
||||
} else if (fi->retries < ATH_MAX_SW_RETRIES) {
|
||||
if (txok || !an->sleeping)
|
||||
- ath_tx_set_retry(sc, txq, bf->bf_mpdu);
|
||||
+ ath_tx_set_retry(sc, txq, bf->bf_mpdu,
|
||||
+ retries);
|
||||
|
||||
txpending = 1;
|
||||
} else {
|
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -546,7 +546,7 @@ struct ath_ant_comb {
|
||||
#define DEFAULT_CACHELINE 32
|
||||
#define ATH_REGCLASSIDS_MAX 10
|
||||
#define ATH_CABQ_READY_TIME 80 /* % of beacon interval */
|
||||
-#define ATH_MAX_SW_RETRIES 10
|
||||
+#define ATH_MAX_SW_RETRIES 20
|
||||
#define ATH_CHAN_MAX 255
|
||||
|
||||
#define ATH_TXPOWER_MAX 100 /* .5 dBm units */
|
@ -1,6 +1,6 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1006,16 +1006,26 @@ void ath9k_hw_init_global_settings(struc
|
||||
@@ -1005,16 +1005,26 @@ void ath9k_hw_init_global_settings(struc
|
||||
|
||||
if (IS_CHAN_HALF_RATE(chan)) {
|
||||
eifs = 175;
|
@ -1,6 +1,6 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1007,31 +1007,35 @@ void ath9k_hw_init_global_settings(struc
|
||||
@@ -1006,31 +1006,35 @@ void ath9k_hw_init_global_settings(struc
|
||||
if (IS_CHAN_HALF_RATE(chan)) {
|
||||
eifs = 175;
|
||||
|
@ -1,240 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -159,6 +159,9 @@ void ath_descdma_cleanup(struct ath_soft
|
||||
/* return block-ack bitmap index given sequence and starting sequence */
|
||||
#define ATH_BA_INDEX(_st, _seq) (((_seq) - (_st)) & (IEEE80211_SEQ_MAX - 1))
|
||||
|
||||
+/* return the seqno for _start + _offset */
|
||||
+#define ATH_BA_INDEX2SEQ(_seq, _offset) (((_seq) + (_offset)) & (IEEE80211_SEQ_MAX - 1))
|
||||
+
|
||||
/* returns delimiter padding required given the packet length */
|
||||
#define ATH_AGGR_GET_NDELIM(_len) \
|
||||
(((_len) >= ATH_AGGR_MINPLEN) ? 0 : \
|
||||
@@ -253,9 +256,9 @@ struct ath_atx_tid {
|
||||
struct ath_node {
|
||||
#ifdef CONFIG_ATH9K_DEBUGFS
|
||||
struct list_head list; /* for sc->nodes */
|
||||
+#endif
|
||||
struct ieee80211_sta *sta; /* station struct we're part of */
|
||||
struct ieee80211_vif *vif; /* interface with which we're associated */
|
||||
-#endif
|
||||
struct ath_atx_tid tid[WME_NUM_TID];
|
||||
struct ath_atx_ac ac[WME_NUM_AC];
|
||||
int ps_key;
|
||||
@@ -277,7 +280,6 @@ struct ath_tx_control {
|
||||
};
|
||||
|
||||
#define ATH_TX_ERROR 0x01
|
||||
-#define ATH_TX_BAR 0x02
|
||||
|
||||
/**
|
||||
* @txq_map: Index is mac80211 queue number. This is
|
||||
--- a/drivers/net/wireless/ath/ath9k/main.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
||||
@@ -644,9 +644,9 @@ static void ath_node_attach(struct ath_s
|
||||
spin_lock(&sc->nodes_lock);
|
||||
list_add(&an->list, &sc->nodes);
|
||||
spin_unlock(&sc->nodes_lock);
|
||||
+#endif
|
||||
an->sta = sta;
|
||||
an->vif = vif;
|
||||
-#endif
|
||||
if (sc->sc_flags & SC_OP_TXAGGR) {
|
||||
ath_tx_node_init(sc, an);
|
||||
an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
|
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -53,7 +53,7 @@ static void ath_tx_complete(struct ath_s
|
||||
int tx_flags, struct ath_txq *txq);
|
||||
static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
|
||||
struct ath_txq *txq, struct list_head *bf_q,
|
||||
- struct ath_tx_status *ts, int txok, int sendbar);
|
||||
+ struct ath_tx_status *ts, int txok);
|
||||
static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
|
||||
struct list_head *head, bool internal);
|
||||
static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
|
||||
@@ -150,6 +150,12 @@ static struct ath_frame_info *get_frame_
|
||||
return (struct ath_frame_info *) &tx_info->rate_driver_data[0];
|
||||
}
|
||||
|
||||
+static void ath_send_bar(struct ath_atx_tid *tid, u16 seqno)
|
||||
+{
|
||||
+ ieee80211_send_bar(tid->an->vif, tid->an->sta->addr, tid->tidno,
|
||||
+ seqno << IEEE80211_SEQ_SEQ_SHIFT);
|
||||
+}
|
||||
+
|
||||
static void ath_tx_flush_tid(struct ath_softc *sc, struct ath_atx_tid *tid)
|
||||
{
|
||||
struct ath_txq *txq = tid->ac->txq;
|
||||
@@ -158,6 +164,7 @@ static void ath_tx_flush_tid(struct ath_
|
||||
struct list_head bf_head;
|
||||
struct ath_tx_status ts;
|
||||
struct ath_frame_info *fi;
|
||||
+ bool sendbar = false;
|
||||
|
||||
INIT_LIST_HEAD(&bf_head);
|
||||
|
||||
@@ -172,7 +179,8 @@ static void ath_tx_flush_tid(struct ath_
|
||||
if (bf && fi->retries) {
|
||||
list_add_tail(&bf->list, &bf_head);
|
||||
ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
|
||||
- ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 1);
|
||||
+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
|
||||
+ sendbar = true;
|
||||
} else {
|
||||
ath_tx_send_normal(sc, txq, NULL, skb);
|
||||
}
|
||||
@@ -185,6 +193,9 @@ static void ath_tx_flush_tid(struct ath_
|
||||
}
|
||||
|
||||
spin_unlock_bh(&txq->axq_lock);
|
||||
+
|
||||
+ if (sendbar)
|
||||
+ ath_send_bar(tid, tid->seq_start);
|
||||
}
|
||||
|
||||
static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
|
||||
@@ -255,7 +266,7 @@ static void ath_tid_drain(struct ath_sof
|
||||
ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
|
||||
|
||||
spin_unlock(&txq->axq_lock);
|
||||
- ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
|
||||
+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
|
||||
spin_lock(&txq->axq_lock);
|
||||
}
|
||||
|
||||
@@ -381,7 +392,7 @@ static void ath_tx_complete_aggr(struct
|
||||
struct ath_buf *bf_next, *bf_last = bf->bf_lastbf;
|
||||
struct list_head bf_head;
|
||||
struct sk_buff_head bf_pending;
|
||||
- u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0;
|
||||
+ u16 seq_st = 0, acked_cnt = 0, txfail_cnt = 0, seq_first;
|
||||
u32 ba[WME_BA_BMP_SIZE >> 5];
|
||||
int isaggr, txfail, txpending, sendbar = 0, needreset = 0, nbad = 0;
|
||||
bool rc_update = true;
|
||||
@@ -391,6 +402,7 @@ static void ath_tx_complete_aggr(struct
|
||||
u8 tidno;
|
||||
bool flush = !!(ts->ts_status & ATH9K_TX_FLUSH);
|
||||
int i, retries;
|
||||
+ int bar_index = -1;
|
||||
|
||||
skb = bf->bf_mpdu;
|
||||
hdr = (struct ieee80211_hdr *)skb->data;
|
||||
@@ -416,8 +428,7 @@ static void ath_tx_complete_aggr(struct
|
||||
if (!bf->bf_stale || bf_next != NULL)
|
||||
list_move_tail(&bf->list, &bf_head);
|
||||
|
||||
- ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
|
||||
- 0, 0);
|
||||
+ ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, 0);
|
||||
|
||||
bf = bf_next;
|
||||
}
|
||||
@@ -427,6 +438,7 @@ static void ath_tx_complete_aggr(struct
|
||||
an = (struct ath_node *)sta->drv_priv;
|
||||
tidno = ieee80211_get_qos_ctl(hdr)[0] & IEEE80211_QOS_CTL_TID_MASK;
|
||||
tid = ATH_AN_2_TID(an, tidno);
|
||||
+ seq_first = tid->seq_start;
|
||||
|
||||
/*
|
||||
* The hardware occasionally sends a tx status for the wrong TID.
|
||||
@@ -495,8 +507,9 @@ static void ath_tx_complete_aggr(struct
|
||||
txpending = 1;
|
||||
} else {
|
||||
txfail = 1;
|
||||
- sendbar = 1;
|
||||
txfail_cnt++;
|
||||
+ bar_index = max_t(int, bar_index,
|
||||
+ ATH_BA_INDEX(seq_first, seqno));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -525,7 +538,7 @@ static void ath_tx_complete_aggr(struct
|
||||
}
|
||||
|
||||
ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
|
||||
- !txfail, sendbar);
|
||||
+ !txfail);
|
||||
} else {
|
||||
/* retry the un-acked ones */
|
||||
if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) {
|
||||
@@ -545,8 +558,10 @@ static void ath_tx_complete_aggr(struct
|
||||
|
||||
ath_tx_complete_buf(sc, bf, txq,
|
||||
&bf_head,
|
||||
- ts, 0,
|
||||
- !flush);
|
||||
+ ts, 0);
|
||||
+ bar_index = max_t(int, bar_index,
|
||||
+ ATH_BA_INDEX(seq_first,
|
||||
+ seqno));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -564,6 +579,9 @@ static void ath_tx_complete_aggr(struct
|
||||
bf = bf_next;
|
||||
}
|
||||
|
||||
+ if (bar_index >= 0)
|
||||
+ ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1));
|
||||
+
|
||||
/* prepend un-acked frames to the beginning of the pending frame queue */
|
||||
if (!skb_queue_empty(&bf_pending)) {
|
||||
if (an->sleeping)
|
||||
@@ -1452,7 +1470,7 @@ static void ath_drain_txq_list(struct at
|
||||
ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, 0,
|
||||
retry_tx);
|
||||
else
|
||||
- ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0, 0);
|
||||
+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
|
||||
spin_lock_bh(&txq->axq_lock);
|
||||
}
|
||||
}
|
||||
@@ -1967,9 +1985,6 @@ static void ath_tx_complete(struct ath_s
|
||||
|
||||
ath_dbg(common, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb);
|
||||
|
||||
- if (tx_flags & ATH_TX_BAR)
|
||||
- tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
|
||||
-
|
||||
if (!(tx_flags & ATH_TX_ERROR))
|
||||
/* Frame was ACKed */
|
||||
tx_info->flags |= IEEE80211_TX_STAT_ACK;
|
||||
@@ -2013,16 +2028,13 @@ static void ath_tx_complete(struct ath_s
|
||||
|
||||
static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
|
||||
struct ath_txq *txq, struct list_head *bf_q,
|
||||
- struct ath_tx_status *ts, int txok, int sendbar)
|
||||
+ struct ath_tx_status *ts, int txok)
|
||||
{
|
||||
struct sk_buff *skb = bf->bf_mpdu;
|
||||
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
|
||||
unsigned long flags;
|
||||
int tx_flags = 0;
|
||||
|
||||
- if (sendbar)
|
||||
- tx_flags = ATH_TX_BAR;
|
||||
-
|
||||
if (!txok)
|
||||
tx_flags |= ATH_TX_ERROR;
|
||||
|
||||
@@ -2129,7 +2141,7 @@ static void ath_tx_process_buffer(struct
|
||||
|
||||
if (!bf_isampdu(bf)) {
|
||||
ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok);
|
||||
- ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok, 0);
|
||||
+ ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok);
|
||||
} else
|
||||
ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok, true);
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/debug.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/debug.c
|
||||
@@ -856,7 +856,7 @@ void ath_debug_stat_tx(struct ath_softc
|
||||
sc->debug.stats.txstats[qnum].tx_bytes_all += bf->bf_mpdu->len;
|
||||
|
||||
if (bf_isampdu(bf)) {
|
||||
- if (flags & ATH_TX_BAR)
|
||||
+ if (flags & ATH_TX_ERROR)
|
||||
TX_STAT_INC(qnum, a_xretries);
|
||||
else
|
||||
TX_STAT_INC(qnum, a_completed);
|
@ -1,159 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -490,27 +490,25 @@ static void ath_tx_complete_aggr(struct
|
||||
} else if (!isaggr && txok) {
|
||||
/* transmit completion */
|
||||
acked_cnt++;
|
||||
+ } else if ((tid->state & AGGR_CLEANUP) || !retry) {
|
||||
+ /*
|
||||
+ * cleanup in progress, just fail
|
||||
+ * the un-acked sub-frames
|
||||
+ */
|
||||
+ txfail = 1;
|
||||
+ } else if (flush) {
|
||||
+ txpending = 1;
|
||||
+ } else if (fi->retries < ATH_MAX_SW_RETRIES) {
|
||||
+ if (txok || !an->sleeping)
|
||||
+ ath_tx_set_retry(sc, txq, bf->bf_mpdu,
|
||||
+ retries);
|
||||
+
|
||||
+ txpending = 1;
|
||||
} else {
|
||||
- if ((tid->state & AGGR_CLEANUP) || !retry) {
|
||||
- /*
|
||||
- * cleanup in progress, just fail
|
||||
- * the un-acked sub-frames
|
||||
- */
|
||||
- txfail = 1;
|
||||
- } else if (flush) {
|
||||
- txpending = 1;
|
||||
- } else if (fi->retries < ATH_MAX_SW_RETRIES) {
|
||||
- if (txok || !an->sleeping)
|
||||
- ath_tx_set_retry(sc, txq, bf->bf_mpdu,
|
||||
- retries);
|
||||
-
|
||||
- txpending = 1;
|
||||
- } else {
|
||||
- txfail = 1;
|
||||
- txfail_cnt++;
|
||||
- bar_index = max_t(int, bar_index,
|
||||
- ATH_BA_INDEX(seq_first, seqno));
|
||||
- }
|
||||
+ txfail = 1;
|
||||
+ txfail_cnt++;
|
||||
+ bar_index = max_t(int, bar_index,
|
||||
+ ATH_BA_INDEX(seq_first, seqno));
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -541,32 +539,29 @@ static void ath_tx_complete_aggr(struct
|
||||
!txfail);
|
||||
} else {
|
||||
/* retry the un-acked ones */
|
||||
- if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)) {
|
||||
- if (bf->bf_next == NULL && bf_last->bf_stale) {
|
||||
- struct ath_buf *tbf;
|
||||
-
|
||||
- tbf = ath_clone_txbuf(sc, bf_last);
|
||||
- /*
|
||||
- * Update tx baw and complete the
|
||||
- * frame with failed status if we
|
||||
- * run out of tx buf.
|
||||
- */
|
||||
- if (!tbf) {
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
- ath_tx_update_baw(sc, tid, seqno);
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
-
|
||||
- ath_tx_complete_buf(sc, bf, txq,
|
||||
- &bf_head,
|
||||
- ts, 0);
|
||||
- bar_index = max_t(int, bar_index,
|
||||
- ATH_BA_INDEX(seq_first,
|
||||
- seqno));
|
||||
- break;
|
||||
- }
|
||||
+ if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) &&
|
||||
+ bf->bf_next == NULL && bf_last->bf_stale) {
|
||||
+ struct ath_buf *tbf;
|
||||
|
||||
- fi->bf = tbf;
|
||||
+ tbf = ath_clone_txbuf(sc, bf_last);
|
||||
+ /*
|
||||
+ * Update tx baw and complete the
|
||||
+ * frame with failed status if we
|
||||
+ * run out of tx buf.
|
||||
+ */
|
||||
+ if (!tbf) {
|
||||
+ spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_tx_update_baw(sc, tid, seqno);
|
||||
+ spin_unlock_bh(&txq->axq_lock);
|
||||
+
|
||||
+ ath_tx_complete_buf(sc, bf, txq,
|
||||
+ &bf_head, ts, 0);
|
||||
+ bar_index = max_t(int, bar_index,
|
||||
+ ATH_BA_INDEX(seq_first, seqno));
|
||||
+ break;
|
||||
}
|
||||
+
|
||||
+ fi->bf = tbf;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -654,24 +649,26 @@ static u32 ath_lookup_rate(struct ath_so
|
||||
max_4ms_framelen = ATH_AMPDU_LIMIT_MAX;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
- if (rates[i].count) {
|
||||
- int modeidx;
|
||||
- if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) {
|
||||
- legacy = 1;
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
|
||||
- modeidx = MCS_HT40;
|
||||
- else
|
||||
- modeidx = MCS_HT20;
|
||||
+ int modeidx;
|
||||
|
||||
- if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
|
||||
- modeidx++;
|
||||
+ if (!rates[i].count)
|
||||
+ continue;
|
||||
|
||||
- frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx];
|
||||
- max_4ms_framelen = min(max_4ms_framelen, frmlen);
|
||||
+ if (!(rates[i].flags & IEEE80211_TX_RC_MCS)) {
|
||||
+ legacy = 1;
|
||||
+ break;
|
||||
}
|
||||
+
|
||||
+ if (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
|
||||
+ modeidx = MCS_HT40;
|
||||
+ else
|
||||
+ modeidx = MCS_HT20;
|
||||
+
|
||||
+ if (rates[i].flags & IEEE80211_TX_RC_SHORT_GI)
|
||||
+ modeidx++;
|
||||
+
|
||||
+ frmlen = ath_max_4ms_framelen[modeidx][rates[i].idx];
|
||||
+ max_4ms_framelen = min(max_4ms_framelen, frmlen);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1598,11 +1595,9 @@ void ath_txq_schedule(struct ath_softc *
|
||||
break;
|
||||
}
|
||||
|
||||
- if (!list_empty(&ac->tid_q)) {
|
||||
- if (!ac->sched) {
|
||||
- ac->sched = true;
|
||||
- list_add_tail(&ac->list, &txq->axq_acq);
|
||||
- }
|
||||
+ if (!list_empty(&ac->tid_q) && !ac->sched) {
|
||||
+ ac->sched = true;
|
||||
+ list_add_tail(&ac->list, &txq->axq_acq);
|
||||
}
|
||||
|
||||
if (ac == last_ac ||
|
@ -1,13 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -1742,10 +1742,6 @@ static void ath_tx_send_normal(struct at
|
||||
list_add_tail(&bf->list, &bf_head);
|
||||
bf->bf_state.bf_type = 0;
|
||||
|
||||
- /* update starting sequence number for subsequent ADDBA request */
|
||||
- if (tid)
|
||||
- INCR(tid->seq_start, IEEE80211_SEQ_MAX);
|
||||
-
|
||||
bf->bf_lastbf = bf;
|
||||
ath_tx_fill_desc(sc, bf, txq, fi->framelen);
|
||||
ath_tx_txqaddbuf(sc, txq, &bf_head, false);
|
@ -1,214 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -169,13 +169,11 @@ static void ath_tx_flush_tid(struct ath_
|
||||
INIT_LIST_HEAD(&bf_head);
|
||||
|
||||
memset(&ts, 0, sizeof(ts));
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
|
||||
while ((skb = __skb_dequeue(&tid->buf_q))) {
|
||||
fi = get_frame_info(skb);
|
||||
bf = fi->bf;
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
if (bf && fi->retries) {
|
||||
list_add_tail(&bf->list, &bf_head);
|
||||
ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
|
||||
@@ -184,7 +182,6 @@ static void ath_tx_flush_tid(struct ath_
|
||||
} else {
|
||||
ath_tx_send_normal(sc, txq, NULL, skb);
|
||||
}
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
}
|
||||
|
||||
if (tid->baw_head == tid->baw_tail) {
|
||||
@@ -192,8 +189,6 @@ static void ath_tx_flush_tid(struct ath_
|
||||
tid->state &= ~AGGR_CLEANUP;
|
||||
}
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
-
|
||||
if (sendbar)
|
||||
ath_send_bar(tid, tid->seq_start);
|
||||
}
|
||||
@@ -254,9 +249,7 @@ static void ath_tid_drain(struct ath_sof
|
||||
bf = fi->bf;
|
||||
|
||||
if (!bf) {
|
||||
- spin_unlock(&txq->axq_lock);
|
||||
ath_tx_complete(sc, skb, ATH_TX_ERROR, txq);
|
||||
- spin_lock(&txq->axq_lock);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -265,9 +258,7 @@ static void ath_tid_drain(struct ath_sof
|
||||
if (fi->retries)
|
||||
ath_tx_update_baw(sc, tid, bf->bf_state.seqno);
|
||||
|
||||
- spin_unlock(&txq->axq_lock);
|
||||
ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
|
||||
- spin_lock(&txq->axq_lock);
|
||||
}
|
||||
|
||||
tid->seq_next = tid->seq_start;
|
||||
@@ -525,9 +516,7 @@ static void ath_tx_complete_aggr(struct
|
||||
* complete the acked-ones/xretried ones; update
|
||||
* block-ack window
|
||||
*/
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
ath_tx_update_baw(sc, tid, seqno);
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
|
||||
if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
|
||||
memcpy(tx_info->control.rates, rates, sizeof(rates));
|
||||
@@ -550,9 +539,7 @@ static void ath_tx_complete_aggr(struct
|
||||
* run out of tx buf.
|
||||
*/
|
||||
if (!tbf) {
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
ath_tx_update_baw(sc, tid, seqno);
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
|
||||
ath_tx_complete_buf(sc, bf, txq,
|
||||
&bf_head, ts, 0);
|
||||
@@ -582,7 +569,6 @@ static void ath_tx_complete_aggr(struct
|
||||
if (an->sleeping)
|
||||
ieee80211_sta_set_buffered(sta, tid->tidno, true);
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
skb_queue_splice(&bf_pending, &tid->buf_q);
|
||||
if (!an->sleeping) {
|
||||
ath_tx_queue_tid(txq, tid);
|
||||
@@ -590,7 +576,6 @@ static void ath_tx_complete_aggr(struct
|
||||
if (ts->ts_status & ATH9K_TXERR_FILT)
|
||||
tid->ac->clear_ps_filter = true;
|
||||
}
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
}
|
||||
|
||||
if (tid->state & AGGR_CLEANUP)
|
||||
@@ -1190,9 +1175,9 @@ void ath_tx_aggr_stop(struct ath_softc *
|
||||
txtid->state |= AGGR_CLEANUP;
|
||||
else
|
||||
txtid->state &= ~AGGR_ADDBA_COMPLETE;
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
|
||||
ath_tx_flush_tid(sc, txtid);
|
||||
+ spin_unlock_bh(&txq->axq_lock);
|
||||
}
|
||||
|
||||
void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
|
||||
@@ -1434,8 +1419,6 @@ static bool bf_is_ampdu_not_probing(stru
|
||||
|
||||
static void ath_drain_txq_list(struct ath_softc *sc, struct ath_txq *txq,
|
||||
struct list_head *list, bool retry_tx)
|
||||
- __releases(txq->axq_lock)
|
||||
- __acquires(txq->axq_lock)
|
||||
{
|
||||
struct ath_buf *bf, *lastbf;
|
||||
struct list_head bf_head;
|
||||
@@ -1462,13 +1445,11 @@ static void ath_drain_txq_list(struct at
|
||||
if (bf_is_ampdu_not_probing(bf))
|
||||
txq->axq_ampdu_depth--;
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
if (bf_isampdu(bf))
|
||||
ath_tx_complete_aggr(sc, txq, bf, &bf_head, &ts, 0,
|
||||
retry_tx);
|
||||
else
|
||||
ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1847,8 +1828,6 @@ static void ath_tx_start_dma(struct ath_
|
||||
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
|
||||
struct ath_buf *bf;
|
||||
|
||||
- spin_lock_bh(&txctl->txq->axq_lock);
|
||||
-
|
||||
if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && tid) {
|
||||
/*
|
||||
* Try aggregation if it's a unicast data frame
|
||||
@@ -1858,7 +1837,7 @@ static void ath_tx_start_dma(struct ath_
|
||||
} else {
|
||||
bf = ath_tx_setup_buffer(sc, txctl->txq, tid, skb);
|
||||
if (!bf)
|
||||
- goto out;
|
||||
+ return;
|
||||
|
||||
bf->bf_state.bfs_paprd = txctl->paprd;
|
||||
|
||||
@@ -1867,9 +1846,6 @@ static void ath_tx_start_dma(struct ath_
|
||||
|
||||
ath_tx_send_normal(sc, txctl->txq, tid, skb);
|
||||
}
|
||||
-
|
||||
-out:
|
||||
- spin_unlock_bh(&txctl->txq->axq_lock);
|
||||
}
|
||||
|
||||
/* Upon failure caller should free skb */
|
||||
@@ -1949,15 +1925,19 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
*/
|
||||
|
||||
q = skb_get_queue_mapping(skb);
|
||||
+
|
||||
spin_lock_bh(&txq->axq_lock);
|
||||
+
|
||||
if (txq == sc->tx.txq_map[q] &&
|
||||
++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) {
|
||||
ieee80211_stop_queue(sc->hw, q);
|
||||
txq->stopped = 1;
|
||||
}
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
|
||||
ath_tx_start_dma(sc, skb, txctl, tid);
|
||||
+
|
||||
+ spin_unlock_bh(&txq->axq_lock);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -2003,7 +1983,6 @@ static void ath_tx_complete(struct ath_s
|
||||
|
||||
q = skb_get_queue_mapping(skb);
|
||||
if (txq == sc->tx.txq_map[q]) {
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
if (WARN_ON(--txq->pending_frames < 0))
|
||||
txq->pending_frames = 0;
|
||||
|
||||
@@ -2011,7 +1990,6 @@ static void ath_tx_complete(struct ath_s
|
||||
ieee80211_wake_queue(sc->hw, q);
|
||||
txq->stopped = 0;
|
||||
}
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
}
|
||||
|
||||
ieee80211_tx_status(hw, skb);
|
||||
@@ -2117,8 +2095,6 @@ static void ath_tx_rc_status(struct ath_
|
||||
static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq,
|
||||
struct ath_tx_status *ts, struct ath_buf *bf,
|
||||
struct list_head *bf_head)
|
||||
- __releases(txq->axq_lock)
|
||||
- __acquires(txq->axq_lock)
|
||||
{
|
||||
int txok;
|
||||
|
||||
@@ -2128,16 +2104,12 @@ static void ath_tx_process_buffer(struct
|
||||
if (bf_is_ampdu_not_probing(bf))
|
||||
txq->axq_ampdu_depth--;
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
-
|
||||
if (!bf_isampdu(bf)) {
|
||||
ath_tx_rc_status(sc, bf, ts, 1, txok ? 0 : 1, txok);
|
||||
ath_tx_complete_buf(sc, bf, txq, bf_head, ts, txok);
|
||||
} else
|
||||
ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok, true);
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
-
|
||||
if (sc->sc_flags & SC_OP_TXAGGR)
|
||||
ath_txq_schedule(sc, txq);
|
||||
}
|
@ -1,82 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -242,6 +242,7 @@ struct ath_atx_tid {
|
||||
struct ath_atx_ac *ac;
|
||||
unsigned long tx_buf[BITS_TO_LONGS(ATH_TID_MAX_BUFS)];
|
||||
int buf_pending;
|
||||
+ int bar_index;
|
||||
u16 seq_start;
|
||||
u16 seq_next;
|
||||
u16 baw_size;
|
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -206,6 +206,8 @@ static void ath_tx_update_baw(struct ath
|
||||
while (tid->baw_head != tid->baw_tail && !test_bit(tid->baw_head, tid->tx_buf)) {
|
||||
INCR(tid->seq_start, IEEE80211_SEQ_MAX);
|
||||
INCR(tid->baw_head, ATH_TID_MAX_BUFS);
|
||||
+ if (tid->bar_index >= 0)
|
||||
+ tid->bar_index--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -263,6 +265,7 @@ static void ath_tid_drain(struct ath_sof
|
||||
|
||||
tid->seq_next = tid->seq_start;
|
||||
tid->baw_tail = tid->baw_head;
|
||||
+ tid->bar_index = -1;
|
||||
}
|
||||
|
||||
static void ath_tx_set_retry(struct ath_softc *sc, struct ath_txq *txq,
|
||||
@@ -561,8 +564,12 @@ static void ath_tx_complete_aggr(struct
|
||||
bf = bf_next;
|
||||
}
|
||||
|
||||
- if (bar_index >= 0)
|
||||
+ if (bar_index >= 0) {
|
||||
+ u16 bar_seq = ATH_BA_INDEX2SEQ(seq_first, bar_index);
|
||||
ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1));
|
||||
+ if (BAW_WITHIN(tid->seq_start, tid->baw_size, bar_seq))
|
||||
+ tid->bar_index = ATH_BA_INDEX(tid->seq_start, bar_seq);
|
||||
+ }
|
||||
|
||||
/* prepend un-acked frames to the beginning of the pending frame queue */
|
||||
if (!skb_queue_empty(&bf_pending)) {
|
||||
@@ -789,8 +796,6 @@ static enum ATH_AGGR_STATUS ath_tx_form_
|
||||
|
||||
bf->bf_state.bf_type = BUF_AMPDU | BUF_AGGR;
|
||||
seqno = bf->bf_state.seqno;
|
||||
- if (!bf_first)
|
||||
- bf_first = bf;
|
||||
|
||||
/* do not step over block-ack window */
|
||||
if (!BAW_WITHIN(tid->seq_start, tid->baw_size, seqno)) {
|
||||
@@ -798,6 +803,21 @@ static enum ATH_AGGR_STATUS ath_tx_form_
|
||||
break;
|
||||
}
|
||||
|
||||
+ if (tid->bar_index > ATH_BA_INDEX(tid->seq_start, seqno)) {
|
||||
+ struct ath_tx_status ts = {};
|
||||
+ struct list_head bf_head;
|
||||
+
|
||||
+ INIT_LIST_HEAD(&bf_head);
|
||||
+ list_add(&bf->list, &bf_head);
|
||||
+ __skb_unlink(skb, &tid->buf_q);
|
||||
+ ath_tx_update_baw(sc, tid, seqno);
|
||||
+ ath_tx_complete_buf(sc, bf, txq, &bf_head, &ts, 0);
|
||||
+ continue;
|
||||
+ }
|
||||
+
|
||||
+ if (!bf_first)
|
||||
+ bf_first = bf;
|
||||
+
|
||||
if (!rl) {
|
||||
aggr_limit = ath_lookup_rate(sc, bf, tid);
|
||||
rl = 1;
|
||||
@@ -1141,6 +1161,7 @@ int ath_tx_aggr_start(struct ath_softc *
|
||||
txtid->state |= AGGR_ADDBA_PROGRESS;
|
||||
txtid->paused = true;
|
||||
*ssn = txtid->seq_start = txtid->seq_next;
|
||||
+ txtid->bar_index = -1;
|
||||
|
||||
memset(txtid->tx_buf, 0, sizeof(txtid->tx_buf));
|
||||
txtid->baw_head = txtid->baw_tail = 0;
|
@ -1,299 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -104,6 +104,29 @@ static int ath_max_4ms_framelen[4][32] =
|
||||
/* Aggregation logic */
|
||||
/*********************/
|
||||
|
||||
+static void ath_txq_lock(struct ath_softc *sc, struct ath_txq *txq)
|
||||
+{
|
||||
+ spin_lock_bh(&txq->axq_lock);
|
||||
+}
|
||||
+
|
||||
+static void ath_txq_unlock(struct ath_softc *sc, struct ath_txq *txq)
|
||||
+{
|
||||
+ spin_unlock_bh(&txq->axq_lock);
|
||||
+}
|
||||
+
|
||||
+static void ath_txq_unlock_complete(struct ath_softc *sc, struct ath_txq *txq)
|
||||
+{
|
||||
+ struct sk_buff_head q;
|
||||
+ struct sk_buff *skb;
|
||||
+
|
||||
+ __skb_queue_head_init(&q);
|
||||
+ skb_queue_splice_init(&txq->complete_q, &q);
|
||||
+ spin_unlock_bh(&txq->axq_lock);
|
||||
+
|
||||
+ while ((skb = __skb_dequeue(&q)))
|
||||
+ ieee80211_tx_status(sc->hw, skb);
|
||||
+}
|
||||
+
|
||||
static void ath_tx_queue_tid(struct ath_txq *txq, struct ath_atx_tid *tid)
|
||||
{
|
||||
struct ath_atx_ac *ac = tid->ac;
|
||||
@@ -130,7 +153,7 @@ static void ath_tx_resume_tid(struct ath
|
||||
|
||||
WARN_ON(!tid->paused);
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
tid->paused = false;
|
||||
|
||||
if (skb_queue_empty(&tid->buf_q))
|
||||
@@ -139,7 +162,7 @@ static void ath_tx_resume_tid(struct ath
|
||||
ath_tx_queue_tid(txq, tid);
|
||||
ath_txq_schedule(sc, txq);
|
||||
unlock:
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
|
||||
static struct ath_frame_info *get_frame_info(struct sk_buff *skb)
|
||||
@@ -189,8 +212,11 @@ static void ath_tx_flush_tid(struct ath_
|
||||
tid->state &= ~AGGR_CLEANUP;
|
||||
}
|
||||
|
||||
- if (sendbar)
|
||||
+ if (sendbar) {
|
||||
+ ath_txq_unlock(sc, txq);
|
||||
ath_send_bar(tid, tid->seq_start);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
|
||||
@@ -564,13 +590,6 @@ static void ath_tx_complete_aggr(struct
|
||||
bf = bf_next;
|
||||
}
|
||||
|
||||
- if (bar_index >= 0) {
|
||||
- u16 bar_seq = ATH_BA_INDEX2SEQ(seq_first, bar_index);
|
||||
- ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1));
|
||||
- if (BAW_WITHIN(tid->seq_start, tid->baw_size, bar_seq))
|
||||
- tid->bar_index = ATH_BA_INDEX(tid->seq_start, bar_seq);
|
||||
- }
|
||||
-
|
||||
/* prepend un-acked frames to the beginning of the pending frame queue */
|
||||
if (!skb_queue_empty(&bf_pending)) {
|
||||
if (an->sleeping)
|
||||
@@ -585,6 +604,17 @@ static void ath_tx_complete_aggr(struct
|
||||
}
|
||||
}
|
||||
|
||||
+ if (bar_index >= 0) {
|
||||
+ u16 bar_seq = ATH_BA_INDEX2SEQ(seq_first, bar_index);
|
||||
+
|
||||
+ if (BAW_WITHIN(tid->seq_start, tid->baw_size, bar_seq))
|
||||
+ tid->bar_index = ATH_BA_INDEX(tid->seq_start, bar_seq);
|
||||
+
|
||||
+ ath_txq_unlock(sc, txq);
|
||||
+ ath_send_bar(tid, ATH_BA_INDEX2SEQ(seq_first, bar_index + 1));
|
||||
+ ath_txq_lock(sc, txq);
|
||||
+ }
|
||||
+
|
||||
if (tid->state & AGGR_CLEANUP)
|
||||
ath_tx_flush_tid(sc, tid);
|
||||
|
||||
@@ -1183,7 +1213,7 @@ void ath_tx_aggr_stop(struct ath_softc *
|
||||
return;
|
||||
}
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
txtid->paused = true;
|
||||
|
||||
/*
|
||||
@@ -1198,7 +1228,7 @@ void ath_tx_aggr_stop(struct ath_softc *
|
||||
txtid->state &= ~AGGR_ADDBA_COMPLETE;
|
||||
|
||||
ath_tx_flush_tid(sc, txtid);
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
|
||||
void ath_tx_aggr_sleep(struct ieee80211_sta *sta, struct ath_softc *sc,
|
||||
@@ -1219,7 +1249,7 @@ void ath_tx_aggr_sleep(struct ieee80211_
|
||||
ac = tid->ac;
|
||||
txq = ac->txq;
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
|
||||
buffered = !skb_queue_empty(&tid->buf_q);
|
||||
|
||||
@@ -1231,7 +1261,7 @@ void ath_tx_aggr_sleep(struct ieee80211_
|
||||
list_del(&ac->list);
|
||||
}
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock(sc, txq);
|
||||
|
||||
ieee80211_sta_set_buffered(sta, tidno, buffered);
|
||||
}
|
||||
@@ -1250,7 +1280,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
|
||||
ac = tid->ac;
|
||||
txq = ac->txq;
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
ac->clear_ps_filter = true;
|
||||
|
||||
if (!skb_queue_empty(&tid->buf_q) && !tid->paused) {
|
||||
@@ -1258,7 +1288,7 @@ void ath_tx_aggr_wakeup(struct ath_softc
|
||||
ath_txq_schedule(sc, txq);
|
||||
}
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1358,6 +1388,7 @@ struct ath_txq *ath_txq_setup(struct ath
|
||||
txq->axq_qnum = axq_qnum;
|
||||
txq->mac80211_qnum = -1;
|
||||
txq->axq_link = NULL;
|
||||
+ __skb_queue_head_init(&txq->complete_q);
|
||||
INIT_LIST_HEAD(&txq->axq_q);
|
||||
INIT_LIST_HEAD(&txq->axq_acq);
|
||||
spin_lock_init(&txq->axq_lock);
|
||||
@@ -1482,7 +1513,8 @@ static void ath_drain_txq_list(struct at
|
||||
*/
|
||||
void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
|
||||
{
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
+
|
||||
if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
|
||||
int idx = txq->txq_tailidx;
|
||||
|
||||
@@ -1503,7 +1535,7 @@ void ath_draintxq(struct ath_softc *sc,
|
||||
if ((sc->sc_flags & SC_OP_TXAGGR) && !retry_tx)
|
||||
ath_txq_drain_pending_buffers(sc, txq);
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
|
||||
bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx)
|
||||
@@ -1947,7 +1979,7 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
|
||||
q = skb_get_queue_mapping(skb);
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
|
||||
if (txq == sc->tx.txq_map[q] &&
|
||||
++txq->pending_frames > ATH_MAX_QDEPTH && !txq->stopped) {
|
||||
@@ -1957,7 +1989,7 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
|
||||
ath_tx_start_dma(sc, skb, txctl, tid);
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock(sc, txq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -1969,7 +2001,6 @@ int ath_tx_start(struct ieee80211_hw *hw
|
||||
static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
|
||||
int tx_flags, struct ath_txq *txq)
|
||||
{
|
||||
- struct ieee80211_hw *hw = sc->hw;
|
||||
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
|
||||
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
struct ieee80211_hdr * hdr = (struct ieee80211_hdr *)skb->data;
|
||||
@@ -2013,7 +2044,7 @@ static void ath_tx_complete(struct ath_s
|
||||
}
|
||||
}
|
||||
|
||||
- ieee80211_tx_status(hw, skb);
|
||||
+ __skb_queue_tail(&txq->complete_q, skb);
|
||||
}
|
||||
|
||||
static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
|
||||
@@ -2149,7 +2180,7 @@ static void ath_tx_processq(struct ath_s
|
||||
txq->axq_qnum, ath9k_hw_gettxbuf(sc->sc_ah, txq->axq_qnum),
|
||||
txq->axq_link);
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
for (;;) {
|
||||
if (work_pending(&sc->hw_reset_work))
|
||||
break;
|
||||
@@ -2208,7 +2239,7 @@ static void ath_tx_processq(struct ath_s
|
||||
|
||||
ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head);
|
||||
}
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
|
||||
static void ath_tx_complete_poll_work(struct work_struct *work)
|
||||
@@ -2225,17 +2256,17 @@ static void ath_tx_complete_poll_work(st
|
||||
for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
|
||||
if (ATH_TXQ_SETUP(sc, i)) {
|
||||
txq = &sc->tx.txq[i];
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
if (txq->axq_depth) {
|
||||
if (txq->axq_tx_inprogress) {
|
||||
needreset = true;
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock(sc, txq);
|
||||
break;
|
||||
} else {
|
||||
txq->axq_tx_inprogress = true;
|
||||
}
|
||||
}
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
|
||||
if (needreset) {
|
||||
@@ -2293,10 +2324,10 @@ void ath_tx_edma_tasklet(struct ath_soft
|
||||
|
||||
txq = &sc->tx.txq[ts.qid];
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
|
||||
if (list_empty(&txq->txq_fifo[txq->txq_tailidx])) {
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock(sc, txq);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2322,7 +2353,7 @@ void ath_tx_edma_tasklet(struct ath_soft
|
||||
}
|
||||
|
||||
ath_tx_process_buffer(sc, txq, &ts, bf, &bf_head);
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock_complete(sc, txq);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2460,7 +2491,7 @@ void ath_tx_node_cleanup(struct ath_soft
|
||||
ac = tid->ac;
|
||||
txq = ac->txq;
|
||||
|
||||
- spin_lock_bh(&txq->axq_lock);
|
||||
+ ath_txq_lock(sc, txq);
|
||||
|
||||
if (tid->sched) {
|
||||
list_del(&tid->list);
|
||||
@@ -2476,6 +2507,6 @@ void ath_tx_node_cleanup(struct ath_soft
|
||||
tid->state &= ~AGGR_ADDBA_COMPLETE;
|
||||
tid->state &= ~AGGR_CLEANUP;
|
||||
|
||||
- spin_unlock_bh(&txq->axq_lock);
|
||||
+ ath_txq_unlock(sc, txq);
|
||||
}
|
||||
}
|
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -196,6 +196,7 @@ struct ath_txq {
|
||||
u8 txq_headidx;
|
||||
u8 txq_tailidx;
|
||||
int pending_frames;
|
||||
+ struct sk_buff_head complete_q;
|
||||
};
|
||||
|
||||
struct ath_atx_ac {
|
@ -1,32 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
|
||||
@@ -558,10 +558,11 @@ int ath9k_hw_process_rxdesc_edma(struct
|
||||
rxs->rs_status |= ATH9K_RXERR_DECRYPT;
|
||||
else if (rxsp->status11 & AR_MichaelErr)
|
||||
rxs->rs_status |= ATH9K_RXERR_MIC;
|
||||
- if (rxsp->status11 & AR_KeyMiss)
|
||||
- rxs->rs_status |= ATH9K_RXERR_KEYMISS;
|
||||
}
|
||||
|
||||
+ if (rxsp->status11 & AR_KeyMiss)
|
||||
+ rxs->rs_status |= ATH9K_RXERR_KEYMISS;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma);
|
||||
--- a/drivers/net/wireless/ath/ath9k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/mac.c
|
||||
@@ -621,10 +621,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *a
|
||||
rs->rs_status |= ATH9K_RXERR_DECRYPT;
|
||||
else if (ads.ds_rxstatus8 & AR_MichaelErr)
|
||||
rs->rs_status |= ATH9K_RXERR_MIC;
|
||||
- if (ads.ds_rxstatus8 & AR_KeyMiss)
|
||||
- rs->rs_status |= ATH9K_RXERR_KEYMISS;
|
||||
}
|
||||
|
||||
+ if (ads.ds_rxstatus8 & AR_KeyMiss)
|
||||
+ rs->rs_status |= ATH9K_RXERR_KEYMISS;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ath9k_hw_rxprocdesc);
|
@ -1,17 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/recv.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/recv.c
|
||||
@@ -823,6 +823,14 @@ static bool ath9k_rx_accept(struct ath_c
|
||||
(ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC |
|
||||
ATH9K_RXERR_KEYMISS));
|
||||
|
||||
+ /*
|
||||
+ * Key miss events are only relevant for pairwise keys where the
|
||||
+ * descriptor does contain a valid key index. This has been observed
|
||||
+ * mostly with CCMP encryption.
|
||||
+ */
|
||||
+ if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID)
|
||||
+ rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
|
||||
+
|
||||
if (!rx_stats->rs_datalen)
|
||||
return false;
|
||||
/*
|
@ -1,21 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1061,13 +1061,16 @@ void ath9k_hw_init_global_settings(struc
|
||||
|
||||
/*
|
||||
* Workaround for early ACK timeouts, add an offset to match the
|
||||
- * initval's 64us ack timeout value.
|
||||
+ * initval's 64us ack timeout value. Use 48us for the CTS timeout.
|
||||
* This was initially only meant to work around an issue with delayed
|
||||
* BA frames in some implementations, but it has been found to fix ACK
|
||||
* timeout issues in other cases as well.
|
||||
*/
|
||||
- if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ)
|
||||
+ if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) {
|
||||
acktimeout += 64 - sifstime - ah->slottime;
|
||||
+ ctstimeout += 48 - sifstime - ah->slottime;
|
||||
+ }
|
||||
+
|
||||
|
||||
ath9k_hw_set_sifs_time(ah, sifstime);
|
||||
ath9k_hw_setslottime(ah, slottime);
|
@ -1,37 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/mci.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/mci.c
|
||||
@@ -234,8 +234,8 @@ static void ath_mci_cal_msg(struct ath_s
|
||||
}
|
||||
}
|
||||
|
||||
-void ath_mci_process_profile(struct ath_softc *sc,
|
||||
- struct ath_mci_profile_info *info)
|
||||
+static void ath_mci_process_profile(struct ath_softc *sc,
|
||||
+ struct ath_mci_profile_info *info)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
struct ath_btcoex *btcoex = &sc->btcoex;
|
||||
@@ -261,8 +261,8 @@ void ath_mci_process_profile(struct ath_
|
||||
ath_mci_update_scheme(sc);
|
||||
}
|
||||
|
||||
-void ath_mci_process_status(struct ath_softc *sc,
|
||||
- struct ath_mci_profile_status *status)
|
||||
+static void ath_mci_process_status(struct ath_softc *sc,
|
||||
+ struct ath_mci_profile_status *status)
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(sc->sc_ah);
|
||||
struct ath_btcoex *btcoex = &sc->btcoex;
|
||||
--- a/drivers/net/wireless/ath/ath9k/mci.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/mci.h
|
||||
@@ -128,10 +128,6 @@ struct ath_mci_coex {
|
||||
};
|
||||
|
||||
void ath_mci_flush_profile(struct ath_mci_profile *mci);
|
||||
-void ath_mci_process_profile(struct ath_softc *sc,
|
||||
- struct ath_mci_profile_info *info);
|
||||
-void ath_mci_process_status(struct ath_softc *sc,
|
||||
- struct ath_mci_profile_status *status);
|
||||
int ath_mci_setup(struct ath_softc *sc);
|
||||
void ath_mci_cleanup(struct ath_softc *sc);
|
||||
void ath_mci_intr(struct ath_softc *sc);
|
@ -1,544 +0,0 @@ |
||||
--- a/drivers/net/wireless/ath/ath9k/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/ath9k/Kconfig
|
||||
@@ -59,6 +59,14 @@ config ATH9K_RATE_CONTROL
|
||||
Say Y, if you want to use the ath9k specific rate control
|
||||
module instead of minstrel_ht.
|
||||
|
||||
+config ATH9K_BTCOEX_SUPPORT
|
||||
+ bool "Atheros ath9k bluetooth coexistence support"
|
||||
+ depends on ATH9K
|
||||
+ default y
|
||||
+ ---help---
|
||||
+ Say Y, if you want to use the ath9k radios together with
|
||||
+ Bluetooth modules in the same system.
|
||||
+
|
||||
config ATH9K_HTC
|
||||
tristate "Atheros HTC based wireless cards support"
|
||||
depends on USB && MAC80211
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.h
|
||||
@@ -210,7 +210,11 @@ enum ath9k_hw_caps {
|
||||
ATH9K_HW_CAP_5GHZ = BIT(14),
|
||||
ATH9K_HW_CAP_APM = BIT(15),
|
||||
ATH9K_HW_CAP_RTT = BIT(16),
|
||||
+#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
|
||||
ATH9K_HW_CAP_MCI = BIT(17),
|
||||
+#else
|
||||
+ ATH9K_HW_CAP_MCI = 0,
|
||||
+#endif
|
||||
};
|
||||
|
||||
struct ath9k_hw_capabilities {
|
||||
@@ -1229,6 +1233,16 @@ void ar9003_mci_sync_bt_state(struct ath
|
||||
void ar9003_mci_get_interrupt(struct ath_hw *ah, u32 *raw_intr,
|
||||
u32 *rx_msg_intr);
|
||||
|
||||
+#ifdef CONFIG_ATH9K_BTCOEX_SUPPORT
|
||||
+static inline enum ath_btcoex_scheme
|
||||
+ath9k_hw_get_btcoex_scheme(struct ath_hw *ah)
|
||||
+{
|
||||
+ return ah->btcoex_hw.scheme;
|
||||
+}
|
||||
+#else
|
||||
+#define ath9k_hw_get_btcoex_scheme(...) ATH_BTCOEX_CFG_NONE
|
||||
+#endif
|
||||
+
|
||||
#define ATH9K_CLOCK_RATE_CCK 22
|
||||
#define ATH9K_CLOCK_RATE_5GHZ_OFDM 40
|
||||
#define ATH9K_CLOCK_RATE_2GHZ_OFDM 44
|
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -411,7 +411,7 @@ static int ath9k_init_btcoex(struct ath_
|
||||
struct ath_hw *ah = sc->sc_ah;
|
||||
int r;
|
||||
|
||||
- switch (sc->sc_ah->btcoex_hw.scheme) {
|
||||
+ switch (ath9k_hw_get_btcoex_scheme(sc->sc_ah)) {
|
||||
case ATH_BTCOEX_CFG_NONE:
|
||||
break;
|
||||
case ATH_BTCOEX_CFG_2WIRE:
|
||||
@@ -866,10 +866,10 @@ static void ath9k_deinit_softc(struct at
|
||||
kfree(sc->sbands[IEEE80211_BAND_5GHZ].channels);
|
||||
|
||||
if ((sc->btcoex.no_stomp_timer) &&
|
||||
- sc->sc_ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
|
||||
+ ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_3WIRE)
|
||||
ath_gen_timer_free(sc->sc_ah, sc->btcoex.no_stomp_timer);
|
||||
|
||||
- if (sc->sc_ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_MCI)
|
||||
+ if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_MCI)
|
||||
ath_mci_cleanup(sc);
|
||||
|
||||
for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++)
|
||||
--- a/drivers/net/wireless/ath/ath9k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/pci.c
|
||||
@@ -121,7 +121,7 @@ static void ath_pci_aspm_init(struct ath
|
||||
if (!parent)
|
||||
return;
|
||||
|
||||
- if (ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) {
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) {
|
||||
/* Bluetooth coexistance requires disabling ASPM. */
|
||||
pci_read_config_byte(pdev, pos + PCI_EXP_LNKCTL, &aspm);
|
||||
aspm &= ~(PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1);
|
||||
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
|
||||
@@ -610,7 +610,7 @@ static void ath9k_init_btcoex(struct ath
|
||||
{
|
||||
int qnum;
|
||||
|
||||
- switch (priv->ah->btcoex_hw.scheme) {
|
||||
+ switch (ath9k_hw_get_btcoex_scheme(priv->ah)) {
|
||||
case ATH_BTCOEX_CFG_NONE:
|
||||
break;
|
||||
case ATH_BTCOEX_CFG_3WIRE:
|
||||
@@ -704,7 +704,8 @@ static int ath9k_init_priv(struct ath9k_
|
||||
|
||||
if (product && strncmp(product, ATH_HTC_BTCOEX_PRODUCT_ID, 5) == 0) {
|
||||
ah->btcoex_hw.scheme = ATH_BTCOEX_CFG_3WIRE;
|
||||
- ath9k_init_btcoex(priv);
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE)
|
||||
+ ath9k_init_btcoex(priv);
|
||||
}
|
||||
|
||||
return 0;
|
||||
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
|
||||
@@ -958,7 +958,7 @@ static int ath9k_htc_start(struct ieee80
|
||||
mod_timer(&priv->tx.cleanup_timer,
|
||||
jiffies + msecs_to_jiffies(ATH9K_HTC_TX_CLEANUP_INTERVAL));
|
||||
|
||||
- if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE) {
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE) {
|
||||
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
|
||||
AR_STOMP_LOW_WLAN_WGHT);
|
||||
ath9k_hw_btcoex_enable(ah);
|
||||
@@ -1010,7 +1010,8 @@ static void ath9k_htc_stop(struct ieee80
|
||||
|
||||
mutex_lock(&priv->mutex);
|
||||
|
||||
- if (ah->btcoex_hw.enabled) {
|
||||
+ if (ah->btcoex_hw.enabled &&
|
||||
+ ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) {
|
||||
ath9k_hw_btcoex_disable(ah);
|
||||
if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
|
||||
ath_htc_cancel_btcoex_work(priv);
|
||||
--- a/drivers/net/wireless/ath/ath9k/main.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
||||
@@ -742,11 +742,11 @@ void ath9k_tasklet(unsigned long data)
|
||||
ath_tx_tasklet(sc);
|
||||
}
|
||||
|
||||
- if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE)
|
||||
if (status & ATH9K_INT_GENTIMER)
|
||||
ath_gen_timer_isr(sc->sc_ah);
|
||||
|
||||
- if (status & ATH9K_INT_MCI)
|
||||
+ if ((status & ATH9K_INT_MCI) && ATH9K_HW_CAP_MCI)
|
||||
ath_mci_intr(sc);
|
||||
|
||||
out:
|
||||
@@ -1083,14 +1083,14 @@ static int ath9k_start(struct ieee80211_
|
||||
|
||||
spin_unlock_bh(&sc->sc_pcu_lock);
|
||||
|
||||
- if ((ah->btcoex_hw.scheme != ATH_BTCOEX_CFG_NONE) &&
|
||||
+ if ((ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) &&
|
||||
!ah->btcoex_hw.enabled) {
|
||||
if (!(sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_MCI))
|
||||
ath9k_hw_btcoex_set_weight(ah, AR_BT_COEX_WGHT,
|
||||
AR_STOMP_LOW_WLAN_WGHT);
|
||||
ath9k_hw_btcoex_enable(ah);
|
||||
|
||||
- if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE)
|
||||
ath9k_btcoex_timer_resume(sc);
|
||||
}
|
||||
|
||||
@@ -1194,9 +1194,10 @@ static void ath9k_stop(struct ieee80211_
|
||||
/* Ensure HW is awake when we try to shut it down. */
|
||||
ath9k_ps_wakeup(sc);
|
||||
|
||||
- if (ah->btcoex_hw.enabled) {
|
||||
+ if (ah->btcoex_hw.enabled &&
|
||||
+ ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE) {
|
||||
ath9k_hw_btcoex_disable(ah);
|
||||
- if (ah->btcoex_hw.scheme == ATH_BTCOEX_CFG_3WIRE)
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_3WIRE)
|
||||
ath9k_btcoex_timer_pause(sc);
|
||||
ath_mci_flush_profile(&sc->btcoex.mci);
|
||||
}
|
||||
--- a/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/gpio.c
|
||||
@@ -253,6 +253,9 @@ int ath_init_btcoex_timer(struct ath_sof
|
||||
{
|
||||
struct ath_btcoex *btcoex = &sc->btcoex;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(sc->sc_ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return 0;
|
||||
+
|
||||
btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD * 1000;
|
||||
btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) *
|
||||
btcoex->btcoex_period / 100;
|
||||
@@ -286,6 +289,9 @@ void ath9k_btcoex_timer_resume(struct at
|
||||
ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX,
|
||||
"Starting btcoex timers\n");
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
/* make sure duty cycle timer is also stopped when resuming */
|
||||
if (btcoex->hw_timer_enabled)
|
||||
ath9k_gen_timer_stop(sc->sc_ah, btcoex->no_stomp_timer);
|
||||
@@ -306,6 +312,9 @@ void ath9k_btcoex_timer_pause(struct ath
|
||||
struct ath_btcoex *btcoex = &sc->btcoex;
|
||||
struct ath_hw *ah = sc->sc_ah;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
del_timer_sync(&btcoex->period_timer);
|
||||
|
||||
if (btcoex->hw_timer_enabled)
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1932,7 +1932,8 @@ int ath9k_hw_reset(struct ath_hw *ah, st
|
||||
#endif
|
||||
}
|
||||
|
||||
- if (ah->btcoex_hw.enabled)
|
||||
+ if (ah->btcoex_hw.enabled &&
|
||||
+ ath9k_hw_get_btcoex_scheme(ah) != ATH_BTCOEX_CFG_NONE)
|
||||
ath9k_hw_btcoex_enable(ah);
|
||||
|
||||
if (mci && mci_hw->ready) {
|
||||
--- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c
|
||||
@@ -116,6 +116,9 @@ void ath_htc_init_btcoex_work(struct ath
|
||||
{
|
||||
struct ath_btcoex *btcoex = &priv->btcoex;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(priv->ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
btcoex->btcoex_period = ATH_BTCOEX_DEF_BT_PERIOD;
|
||||
btcoex->btcoex_no_stomp = (100 - ATH_BTCOEX_DEF_DUTY_CYCLE) *
|
||||
btcoex->btcoex_period / 100;
|
||||
@@ -134,6 +137,9 @@ void ath_htc_resume_btcoex_work(struct a
|
||||
struct ath_btcoex *btcoex = &priv->btcoex;
|
||||
struct ath_hw *ah = priv->ah;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
ath_dbg(ath9k_hw_common(ah), ATH_DBG_BTCOEX, "Starting btcoex work\n");
|
||||
|
||||
btcoex->bt_priority_cnt = 0;
|
||||
@@ -148,6 +154,9 @@ void ath_htc_resume_btcoex_work(struct a
|
||||
*/
|
||||
void ath_htc_cancel_btcoex_work(struct ath9k_htc_priv *priv)
|
||||
{
|
||||
+ if (ath9k_hw_get_btcoex_scheme(priv->ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
cancel_delayed_work_sync(&priv->coex_period_work);
|
||||
cancel_delayed_work_sync(&priv->duty_cycle_work);
|
||||
}
|
||||
--- a/drivers/net/wireless/ath/ath9k/btcoex.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/btcoex.c
|
||||
@@ -68,6 +68,9 @@ void ath9k_hw_init_btcoex_hw(struct ath_
|
||||
u32 i, idx;
|
||||
bool rxclear_polarity = ath_bt_config.bt_rxclear_polarity;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
if (AR_SREV_9300_20_OR_LATER(ah))
|
||||
rxclear_polarity = !ath_bt_config.bt_rxclear_polarity;
|
||||
|
||||
@@ -99,6 +102,9 @@ void ath9k_hw_btcoex_init_2wire(struct a
|
||||
{
|
||||
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
/* connect bt_active to baseband */
|
||||
REG_CLR_BIT(ah, AR_GPIO_INPUT_EN_VAL,
|
||||
(AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_DEF |
|
||||
@@ -121,6 +127,9 @@ void ath9k_hw_btcoex_init_3wire(struct a
|
||||
{
|
||||
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
/* btcoex 3-wire */
|
||||
REG_SET_BIT(ah, AR_GPIO_INPUT_EN_VAL,
|
||||
(AR_GPIO_INPUT_EN_VAL_BT_PRIORITY_BB |
|
||||
@@ -147,6 +156,9 @@ static void ath9k_hw_btcoex_enable_2wire
|
||||
{
|
||||
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
/* Configure the desired GPIO port for TX_FRAME output */
|
||||
ath9k_hw_cfg_output(ah, btcoex_hw->wlanactive_gpio,
|
||||
AR_GPIO_OUTPUT_MUX_AS_TX_FRAME);
|
||||
@@ -158,6 +170,9 @@ void ath9k_hw_btcoex_set_weight(struct a
|
||||
{
|
||||
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
btcoex_hw->bt_coex_weights = SM(bt_weight, AR_BTCOEX_BT_WGHT) |
|
||||
SM(wlan_weight, AR_BTCOEX_WL_WGHT);
|
||||
}
|
||||
@@ -219,9 +234,9 @@ void ath9k_hw_btcoex_enable(struct ath_h
|
||||
{
|
||||
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
|
||||
|
||||
- switch (btcoex_hw->scheme) {
|
||||
+ switch (ath9k_hw_get_btcoex_scheme(ah)) {
|
||||
case ATH_BTCOEX_CFG_NONE:
|
||||
- break;
|
||||
+ return;
|
||||
case ATH_BTCOEX_CFG_2WIRE:
|
||||
ath9k_hw_btcoex_enable_2wire(ah);
|
||||
break;
|
||||
@@ -246,6 +261,9 @@ void ath9k_hw_btcoex_disable(struct ath_
|
||||
struct ath_btcoex_hw *btcoex_hw = &ah->btcoex_hw;
|
||||
int i;
|
||||
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
btcoex_hw->enabled = false;
|
||||
if (btcoex_hw->scheme == ATH_BTCOEX_CFG_MCI) {
|
||||
ath9k_hw_btcoex_bt_stomp(ah, ATH_BTCOEX_STOMP_NONE);
|
||||
@@ -294,6 +312,9 @@ static void ar9003_btcoex_bt_stomp(struc
|
||||
void ath9k_hw_btcoex_bt_stomp(struct ath_hw *ah,
|
||||
enum ath_stomp_type stomp_type)
|
||||
{
|
||||
+ if (ath9k_hw_get_btcoex_scheme(ah) == ATH_BTCOEX_CFG_NONE)
|
||||
+ return;
|
||||
+
|
||||
if (AR_SREV_9300_20_OR_LATER(ah)) {
|
||||
ar9003_btcoex_bt_stomp(ah, stomp_type);
|
||||
return;
|
||||
--- a/drivers/net/wireless/ath/ath9k/ar9003_mci.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mci.c
|
||||
@@ -85,6 +85,9 @@ void ar9003_mci_remote_reset(struct ath_
|
||||
{
|
||||
u32 payload[4] = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffff00};
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
ar9003_mci_send_message(ah, MCI_REMOTE_RESET, 0, payload, 16,
|
||||
wait_done, false);
|
||||
udelay(5);
|
||||
@@ -94,6 +97,9 @@ void ar9003_mci_send_lna_transfer(struct
|
||||
{
|
||||
u32 payload = 0x00000000;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
ar9003_mci_send_message(ah, MCI_LNA_TRANS, 0, &payload, 1,
|
||||
wait_done, false);
|
||||
}
|
||||
@@ -107,6 +113,9 @@ static void ar9003_mci_send_req_wake(str
|
||||
|
||||
void ar9003_mci_send_sys_waking(struct ath_hw *ah, bool wait_done)
|
||||
{
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
ar9003_mci_send_message(ah, MCI_SYS_WAKING, MCI_FLAG_DISABLE_TIMESTAMP,
|
||||
NULL, 0, wait_done, false);
|
||||
}
|
||||
@@ -221,6 +230,9 @@ void ar9003_mci_send_coex_halt_bt_gpm(st
|
||||
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
|
||||
u32 payload[4] = {0, 0, 0, 0};
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
ath_dbg(common, ATH_DBG_MCI, "MCI Send Coex %s BT GPM.\n",
|
||||
(halt) ? "halt" : "unhalt");
|
||||
|
||||
@@ -381,12 +393,17 @@ static void ar9003_mci_prep_interface(st
|
||||
|
||||
void ar9003_mci_disable_interrupt(struct ath_hw *ah)
|
||||
{
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
REG_WRITE(ah, AR_MCI_INTERRUPT_EN, 0);
|
||||
REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN, 0);
|
||||
}
|
||||
|
||||
void ar9003_mci_enable_interrupt(struct ath_hw *ah)
|
||||
{
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
|
||||
REG_WRITE(ah, AR_MCI_INTERRUPT_EN, AR_MCI_INTERRUPT_DEFAULT);
|
||||
REG_WRITE(ah, AR_MCI_INTERRUPT_RX_MSG_EN,
|
||||
@@ -397,6 +414,9 @@ bool ar9003_mci_check_int(struct ath_hw
|
||||
{
|
||||
u32 intr;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return false;
|
||||
+
|
||||
intr = REG_READ(ah, AR_MCI_INTERRUPT_RX_MSG_RAW);
|
||||
return ((intr & ints) == ints);
|
||||
}
|
||||
@@ -405,6 +425,10 @@ void ar9003_mci_get_interrupt(struct ath
|
||||
u32 *rx_msg_intr)
|
||||
{
|
||||
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
|
||||
+
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
*raw_intr = mci->raw_intr;
|
||||
*rx_msg_intr = mci->rx_msg_intr;
|
||||
|
||||
@@ -418,6 +442,9 @@ void ar9003_mci_2g5g_changed(struct ath_
|
||||
{
|
||||
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
if (!mci->update_2g5g &&
|
||||
(mci->is_2g != is_2g))
|
||||
mci->update_2g5g = true;
|
||||
@@ -531,6 +558,9 @@ void ar9003_mci_reset(struct ath_hw *ah,
|
||||
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
|
||||
u32 regval, thresh;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
ath_dbg(common, ATH_DBG_MCI, "MCI full_sleep = %d, is_2g = %d\n",
|
||||
is_full_sleep, is_2g);
|
||||
|
||||
@@ -661,6 +691,9 @@ void ar9003_mci_mute_bt(struct ath_hw *a
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
/* disable all MCI messages */
|
||||
REG_WRITE(ah, AR_MCI_MSG_ATTRIBUTES_TABLE, 0xffff0000);
|
||||
REG_WRITE(ah, AR_BTCOEX_WL_WEIGHTS0, 0xffffffff);
|
||||
@@ -693,6 +726,9 @@ void ar9003_mci_sync_bt_state(struct ath
|
||||
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
|
||||
u32 cur_bt_state;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
cur_bt_state = ar9003_mci_state(ah, MCI_STATE_REMOTE_SLEEP, NULL);
|
||||
|
||||
if (mci->bt_state != cur_bt_state) {
|
||||
@@ -857,6 +893,9 @@ void ar9003_mci_2g5g_switch(struct ath_h
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
if (mci->update_2g5g) {
|
||||
if (mci->is_2g) {
|
||||
|
||||
@@ -908,6 +947,9 @@ bool ar9003_mci_send_message(struct ath_
|
||||
u32 saved_mci_int_en;
|
||||
int i;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return false;
|
||||
+
|
||||
saved_mci_int_en = REG_READ(ah, AR_MCI_INTERRUPT_EN);
|
||||
regval = REG_READ(ah, AR_BTCOEX_CTRL);
|
||||
|
||||
@@ -973,6 +1015,9 @@ void ar9003_mci_setup(struct ath_hw *ah,
|
||||
struct ath9k_hw_mci *mci = &ah->btcoex_hw.mci;
|
||||
void *sched_buf = (void *)((char *) gpm_buf + (sched_addr - gpm_addr));
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
mci->gpm_addr = gpm_addr;
|
||||
mci->gpm_buf = gpm_buf;
|
||||
mci->gpm_len = len;
|
||||
@@ -987,6 +1032,9 @@ void ar9003_mci_cleanup(struct ath_hw *a
|
||||
{
|
||||
struct ath_common *common = ath9k_hw_common(ah);
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
/* Turn off MCI and Jupiter mode. */
|
||||
REG_WRITE(ah, AR_BTCOEX_CTRL, 0x00);
|
||||
ath_dbg(common, ATH_DBG_MCI, "MCI ar9003_mci_cleanup\n");
|
||||
@@ -1056,6 +1104,9 @@ u32 ar9003_mci_wait_for_gpm(struct ath_h
|
||||
u8 recv_type = 0, recv_opcode = 0;
|
||||
bool b_is_bt_cal_done = (gpm_type == MCI_GPM_BT_CAL_DONE);
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return 0;
|
||||
+
|
||||
more_data = time_out ? MCI_GPM_NOMORE : MCI_GPM_MORE;
|
||||
|
||||
while (time_out > 0) {
|
||||
@@ -1188,6 +1239,9 @@ u32 ar9003_mci_state(struct ath_hw *ah,
|
||||
u32 value = 0, more_gpm = 0, gpm_ptr;
|
||||
u8 query_type;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return 0;
|
||||
+
|
||||
switch (state_type) {
|
||||
case MCI_STATE_ENABLE:
|
||||
if (mci->ready) {
|
||||
--- a/drivers/net/wireless/ath/ath9k/mci.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/mci.c
|
||||
@@ -425,6 +425,9 @@ int ath_mci_setup(struct ath_softc *sc)
|
||||
struct ath_mci_coex *mci = &sc->mci_coex;
|
||||
int error = 0;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return 0;
|
||||
+
|
||||
mci->sched_buf.bf_len = ATH_MCI_SCHED_BUF_SIZE + ATH_MCI_GPM_BUF_SIZE;
|
||||
|
||||
if (ath_mci_buf_alloc(sc, &mci->sched_buf)) {
|
||||
@@ -458,6 +461,9 @@ void ath_mci_cleanup(struct ath_softc *s
|
||||
struct ath_hw *ah = sc->sc_ah;
|
||||
struct ath_mci_coex *mci = &sc->mci_coex;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
/*
|
||||
* both schedule and gpm buffers will be released
|
||||
*/
|
||||
@@ -476,6 +482,9 @@ void ath_mci_intr(struct ath_softc *sc)
|
||||
u32 more_data = MCI_GPM_MORE;
|
||||
bool skip_gpm = false;
|
||||
|
||||
+ if (!ATH9K_HW_CAP_MCI)
|
||||
+ return;
|
||||
+
|
||||
ar9003_mci_get_interrupt(sc->sc_ah, &mci_int, &mci_int_rxmsg);
|
||||
|
||||
if (ar9003_mci_state(ah, MCI_STATE_ENABLE, NULL) == 0) {
|
Loading…
Reference in new issue