Commit 1d2231e2 authored by Felix Fietkau's avatar Felix Fietkau Committed by John W. Linville

ath9k: remove duplicate WMM AC definitions

Signed-off-by: default avatarFelix Fietkau <nbd@openwrt.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent e8c35a77
...@@ -291,7 +291,7 @@ struct ath_tx_control { ...@@ -291,7 +291,7 @@ struct ath_tx_control {
struct ath_tx { struct ath_tx {
u16 seq_no; u16 seq_no;
u32 txqsetup; u32 txqsetup;
int hwq_map[ATH9K_WME_AC_VO+1]; int hwq_map[WME_NUM_AC];
spinlock_t txbuflock; spinlock_t txbuflock;
struct list_head txbuf; struct list_head txbuf;
struct ath_txq txq[ATH9K_NUM_TX_QUEUES]; struct ath_txq txq[ATH9K_NUM_TX_QUEUES];
...@@ -680,8 +680,6 @@ void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle); ...@@ -680,8 +680,6 @@ void ath9k_set_wiphy_idle(struct ath_wiphy *aphy, bool idle);
void ath_mac80211_stop_queue(struct ath_softc *sc, u16 skb_queue); void ath_mac80211_stop_queue(struct ath_softc *sc, u16 skb_queue);
void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue); void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue);
int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype);
void ath_start_rfkill_poll(struct ath_softc *sc); void ath_start_rfkill_poll(struct ath_softc *sc);
extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw); extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw);
......
...@@ -38,8 +38,7 @@ int ath_beaconq_config(struct ath_softc *sc) ...@@ -38,8 +38,7 @@ int ath_beaconq_config(struct ath_softc *sc)
qi.tqi_cwmax = 0; qi.tqi_cwmax = 0;
} else { } else {
/* Adhoc mode; important thing is to use 2x cwmin. */ /* Adhoc mode; important thing is to use 2x cwmin. */
qnum = ath_tx_get_qnum(sc, ATH9K_TX_QUEUE_DATA, qnum = sc->tx.hwq_map[WME_AC_BE];
ATH9K_WME_AC_BE);
ath9k_hw_get_txq_props(ah, qnum, &qi_be); ath9k_hw_get_txq_props(ah, qnum, &qi_be);
qi.tqi_aifs = qi_be.tqi_aifs; qi.tqi_aifs = qi_be.tqi_aifs;
qi.tqi_cwmin = 4*qi_be.tqi_cwmin; qi.tqi_cwmin = 4*qi_be.tqi_cwmin;
......
...@@ -630,10 +630,10 @@ static const struct file_operations fops_wiphy = { ...@@ -630,10 +630,10 @@ static const struct file_operations fops_wiphy = {
do { \ do { \
len += snprintf(buf + len, size - len, \ len += snprintf(buf + len, size - len, \
"%s%13u%11u%10u%10u\n", str, \ "%s%13u%11u%10u%10u\n", str, \
sc->debug.stats.txstats[sc->tx.hwq_map[ATH9K_WME_AC_BE]].elem, \ sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_BE]].elem, \
sc->debug.stats.txstats[sc->tx.hwq_map[ATH9K_WME_AC_BK]].elem, \ sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_BK]].elem, \
sc->debug.stats.txstats[sc->tx.hwq_map[ATH9K_WME_AC_VI]].elem, \ sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_VI]].elem, \
sc->debug.stats.txstats[sc->tx.hwq_map[ATH9K_WME_AC_VO]].elem); \ sc->debug.stats.txstats[sc->tx.hwq_map[WME_AC_VO]].elem); \
} while(0) } while(0)
static ssize_t read_file_xmit(struct file *file, char __user *user_buf, static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
......
...@@ -426,7 +426,7 @@ static int ath9k_init_btcoex(struct ath_softc *sc) ...@@ -426,7 +426,7 @@ static int ath9k_init_btcoex(struct ath_softc *sc)
r = ath_init_btcoex_timer(sc); r = ath_init_btcoex_timer(sc);
if (r) if (r)
return -1; return -1;
qnum = ath_tx_get_qnum(sc, ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BE); qnum = sc->tx.hwq_map[WME_AC_BE];
ath9k_hw_init_btcoex_hw(sc->sc_ah, qnum); ath9k_hw_init_btcoex_hw(sc->sc_ah, qnum);
sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW; sc->btcoex.bt_stomp_type = ATH_BTCOEX_STOMP_LOW;
break; break;
...@@ -463,23 +463,23 @@ static int ath9k_init_queues(struct ath_softc *sc) ...@@ -463,23 +463,23 @@ static int ath9k_init_queues(struct ath_softc *sc)
sc->config.cabqReadytime = ATH_CABQ_READY_TIME; sc->config.cabqReadytime = ATH_CABQ_READY_TIME;
ath_cabq_update(sc); ath_cabq_update(sc);
if (!ath_tx_setup(sc, ATH9K_WME_AC_BK)) { if (!ath_tx_setup(sc, WME_AC_BK)) {
ath_print(common, ATH_DBG_FATAL, ath_print(common, ATH_DBG_FATAL,
"Unable to setup xmit queue for BK traffic\n"); "Unable to setup xmit queue for BK traffic\n");
goto err; goto err;
} }
if (!ath_tx_setup(sc, ATH9K_WME_AC_BE)) { if (!ath_tx_setup(sc, WME_AC_BE)) {
ath_print(common, ATH_DBG_FATAL, ath_print(common, ATH_DBG_FATAL,
"Unable to setup xmit queue for BE traffic\n"); "Unable to setup xmit queue for BE traffic\n");
goto err; goto err;
} }
if (!ath_tx_setup(sc, ATH9K_WME_AC_VI)) { if (!ath_tx_setup(sc, WME_AC_VI)) {
ath_print(common, ATH_DBG_FATAL, ath_print(common, ATH_DBG_FATAL,
"Unable to setup xmit queue for VI traffic\n"); "Unable to setup xmit queue for VI traffic\n");
goto err; goto err;
} }
if (!ath_tx_setup(sc, ATH9K_WME_AC_VO)) { if (!ath_tx_setup(sc, WME_AC_VO)) {
ath_print(common, ATH_DBG_FATAL, ath_print(common, ATH_DBG_FATAL,
"Unable to setup xmit queue for VO traffic\n"); "Unable to setup xmit queue for VO traffic\n");
goto err; goto err;
......
...@@ -577,13 +577,8 @@ enum ath9k_tx_queue { ...@@ -577,13 +577,8 @@ enum ath9k_tx_queue {
#define ATH9K_NUM_TX_QUEUES 10 #define ATH9K_NUM_TX_QUEUES 10
enum ath9k_tx_queue_subtype { /* Used as a queue subtype instead of a WMM AC */
ATH9K_WME_AC_BK = 0, #define ATH9K_WME_UPSD 4
ATH9K_WME_AC_BE,
ATH9K_WME_AC_VI,
ATH9K_WME_AC_VO,
ATH9K_WME_UPSD
};
enum ath9k_tx_queue_flags { enum ath9k_tx_queue_flags {
TXQ_FLAG_TXOKINT_ENABLE = 0x0001, TXQ_FLAG_TXOKINT_ENABLE = 0x0001,
...@@ -617,7 +612,7 @@ enum ath9k_pkt_type { ...@@ -617,7 +612,7 @@ enum ath9k_pkt_type {
struct ath9k_tx_queue_info { struct ath9k_tx_queue_info {
u32 tqi_ver; u32 tqi_ver;
enum ath9k_tx_queue tqi_type; enum ath9k_tx_queue tqi_type;
enum ath9k_tx_queue_subtype tqi_subtype; int tqi_subtype;
enum ath9k_tx_queue_flags tqi_qflags; enum ath9k_tx_queue_flags tqi_qflags;
u32 tqi_priority; u32 tqi_priority;
u32 tqi_aifs; u32 tqi_aifs;
......
...@@ -814,19 +814,19 @@ int ath_get_hal_qnum(u16 queue, struct ath_softc *sc) ...@@ -814,19 +814,19 @@ int ath_get_hal_qnum(u16 queue, struct ath_softc *sc)
switch (queue) { switch (queue) {
case 0: case 0:
qnum = sc->tx.hwq_map[ATH9K_WME_AC_VO]; qnum = sc->tx.hwq_map[WME_AC_VO];
break; break;
case 1: case 1:
qnum = sc->tx.hwq_map[ATH9K_WME_AC_VI]; qnum = sc->tx.hwq_map[WME_AC_VI];
break; break;
case 2: case 2:
qnum = sc->tx.hwq_map[ATH9K_WME_AC_BE]; qnum = sc->tx.hwq_map[WME_AC_BE];
break; break;
case 3: case 3:
qnum = sc->tx.hwq_map[ATH9K_WME_AC_BK]; qnum = sc->tx.hwq_map[WME_AC_BK];
break; break;
default: default:
qnum = sc->tx.hwq_map[ATH9K_WME_AC_BE]; qnum = sc->tx.hwq_map[WME_AC_BE];
break; break;
} }
...@@ -838,16 +838,16 @@ int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc) ...@@ -838,16 +838,16 @@ int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc)
int qnum; int qnum;
switch (queue) { switch (queue) {
case ATH9K_WME_AC_VO: case WME_AC_VO:
qnum = 0; qnum = 0;
break; break;
case ATH9K_WME_AC_VI: case WME_AC_VI:
qnum = 1; qnum = 1;
break; break;
case ATH9K_WME_AC_BE: case WME_AC_BE:
qnum = 2; qnum = 2;
break; break;
case ATH9K_WME_AC_BK: case WME_AC_BK:
qnum = 3; qnum = 3;
break; break;
default: default:
...@@ -1559,7 +1559,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue, ...@@ -1559,7 +1559,7 @@ static int ath9k_conf_tx(struct ieee80211_hw *hw, u16 queue,
ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n"); ath_print(common, ATH_DBG_FATAL, "TXQ Update failed\n");
if (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) if (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC)
if ((qnum == sc->tx.hwq_map[ATH9K_WME_AC_BE]) && !ret) if ((qnum == sc->tx.hwq_map[WME_AC_BE]) && !ret)
ath_beaconq_config(sc); ath_beaconq_config(sc);
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
......
...@@ -219,7 +219,7 @@ static int ath9k_send_nullfunc(struct ath_wiphy *aphy, ...@@ -219,7 +219,7 @@ static int ath9k_send_nullfunc(struct ath_wiphy *aphy,
info->control.rates[1].idx = -1; info->control.rates[1].idx = -1;
memset(&txctl, 0, sizeof(struct ath_tx_control)); memset(&txctl, 0, sizeof(struct ath_tx_control));
txctl.txq = &sc->tx.txq[sc->tx.hwq_map[ATH9K_WME_AC_VO]]; txctl.txq = &sc->tx.txq[sc->tx.hwq_map[WME_AC_VO]];
txctl.frame_type = ps ? ATH9K_IFT_PAUSE : ATH9K_IFT_UNPAUSE; txctl.frame_type = ps ? ATH9K_IFT_PAUSE : ATH9K_IFT_UNPAUSE;
if (ath_tx_start(aphy->hw, skb, &txctl) != 0) if (ath_tx_start(aphy->hw, skb, &txctl) != 0)
......
...@@ -959,32 +959,6 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype) ...@@ -959,32 +959,6 @@ struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype)
return &sc->tx.txq[qnum]; return &sc->tx.txq[qnum];
} }
int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype)
{
int qnum;
switch (qtype) {
case ATH9K_TX_QUEUE_DATA:
if (haltype >= ARRAY_SIZE(sc->tx.hwq_map)) {
ath_print(ath9k_hw_common(sc->sc_ah), ATH_DBG_FATAL,
"HAL AC %u out of range, max %zu!\n",
haltype, ARRAY_SIZE(sc->tx.hwq_map));
return -1;
}
qnum = sc->tx.hwq_map[haltype];
break;
case ATH9K_TX_QUEUE_BEACON:
qnum = sc->beacon.beaconq;
break;
case ATH9K_TX_QUEUE_CAB:
qnum = sc->beacon.cabq->axq_qnum;
break;
default:
qnum = -1;
}
return qnum;
}
int ath_txq_update(struct ath_softc *sc, int qnum, int ath_txq_update(struct ath_softc *sc, int qnum,
struct ath9k_tx_queue_info *qinfo) struct ath9k_tx_queue_info *qinfo)
{ {
...@@ -2423,26 +2397,8 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an) ...@@ -2423,26 +2397,8 @@ void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an)
for (acno = 0, ac = &an->ac[acno]; for (acno = 0, ac = &an->ac[acno];
acno < WME_NUM_AC; acno++, ac++) { acno < WME_NUM_AC; acno++, ac++) {
ac->sched = false; ac->sched = false;
ac->qnum = sc->tx.hwq_map[acno];
INIT_LIST_HEAD(&ac->tid_q); INIT_LIST_HEAD(&ac->tid_q);
switch (acno) {
case WME_AC_BE:
ac->qnum = ath_tx_get_qnum(sc,
ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BE);
break;
case WME_AC_BK:
ac->qnum = ath_tx_get_qnum(sc,
ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BK);
break;
case WME_AC_VI:
ac->qnum = ath_tx_get_qnum(sc,
ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_VI);
break;
case WME_AC_VO:
ac->qnum = ath_tx_get_qnum(sc,
ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_VO);
break;
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment