diff options
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/ath9k/core.c | 15 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/core.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/recv.c | 81 | ||||
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 125 |
4 files changed, 99 insertions, 124 deletions
diff --git a/drivers/net/wireless/ath9k/core.c b/drivers/net/wireless/ath9k/core.c index 49fc264cfe5a..689a28037096 100644 --- a/drivers/net/wireless/ath9k/core.c +++ b/drivers/net/wireless/ath9k/core.c | |||
@@ -1366,9 +1366,10 @@ void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta, int if_id) | |||
1366 | 1366 | ||
1367 | an = (struct ath_node *)sta->drv_priv; | 1367 | an = (struct ath_node *)sta->drv_priv; |
1368 | 1368 | ||
1369 | /* set up per-node tx/rx state */ | 1369 | if (sc->sc_flags & SC_OP_TXAGGR) |
1370 | ath_tx_node_init(sc, an); | 1370 | ath_tx_node_init(sc, an); |
1371 | ath_rx_node_init(sc, an); | 1371 | if (sc->sc_flags & SC_OP_RXAGGR) |
1372 | ath_rx_node_init(sc, an); | ||
1372 | 1373 | ||
1373 | an->maxampdu = 1 << (IEEE80211_HTCAP_MAXRXAMPDU_FACTOR + | 1374 | an->maxampdu = 1 << (IEEE80211_HTCAP_MAXRXAMPDU_FACTOR + |
1374 | sta->ht_cap.ampdu_factor); | 1375 | sta->ht_cap.ampdu_factor); |
@@ -1384,10 +1385,10 @@ void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta) | |||
1384 | 1385 | ||
1385 | ath_chainmask_sel_timerstop(&an->an_chainmask_sel); | 1386 | ath_chainmask_sel_timerstop(&an->an_chainmask_sel); |
1386 | 1387 | ||
1387 | ath_tx_node_cleanup(sc, an); | 1388 | if (sc->sc_flags & SC_OP_TXAGGR) |
1388 | 1389 | ath_tx_node_cleanup(sc, an); | |
1389 | ath_tx_node_free(sc, an); | 1390 | if (sc->sc_flags & SC_OP_RXAGGR) |
1390 | ath_rx_node_free(sc, an); | 1391 | ath_rx_node_cleanup(sc, an); |
1391 | } | 1392 | } |
1392 | 1393 | ||
1393 | /* | 1394 | /* |
diff --git a/drivers/net/wireless/ath9k/core.h b/drivers/net/wireless/ath9k/core.h index d7228ec66c2f..d8aafff221c8 100644 --- a/drivers/net/wireless/ath9k/core.h +++ b/drivers/net/wireless/ath9k/core.h | |||
@@ -372,7 +372,7 @@ bool ath_stoprecv(struct ath_softc *sc); | |||
372 | void ath_flushrecv(struct ath_softc *sc); | 372 | void ath_flushrecv(struct ath_softc *sc); |
373 | u32 ath_calcrxfilter(struct ath_softc *sc); | 373 | u32 ath_calcrxfilter(struct ath_softc *sc); |
374 | void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an); | 374 | void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an); |
375 | void ath_rx_node_free(struct ath_softc *sc, struct ath_node *an); | 375 | void ath_rx_node_cleanup(struct ath_softc *sc, struct ath_node *an); |
376 | void ath_handle_rx_intr(struct ath_softc *sc); | 376 | void ath_handle_rx_intr(struct ath_softc *sc); |
377 | int ath_rx_init(struct ath_softc *sc, int nbufs); | 377 | int ath_rx_init(struct ath_softc *sc, int nbufs); |
378 | void ath_rx_cleanup(struct ath_softc *sc); | 378 | void ath_rx_cleanup(struct ath_softc *sc); |
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c index 6b4006ed4e01..27d6a981a106 100644 --- a/drivers/net/wireless/ath9k/recv.c +++ b/drivers/net/wireless/ath9k/recv.c | |||
@@ -1200,61 +1200,56 @@ void ath_rx_aggr_teardown(struct ath_softc *sc, struct ath_node *an, u8 tid) | |||
1200 | 1200 | ||
1201 | void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an) | 1201 | void ath_rx_node_init(struct ath_softc *sc, struct ath_node *an) |
1202 | { | 1202 | { |
1203 | if (sc->sc_flags & SC_OP_RXAGGR) { | 1203 | struct ath_arx_tid *rxtid; |
1204 | struct ath_arx_tid *rxtid; | 1204 | int tidno; |
1205 | int tidno; | 1205 | |
1206 | 1206 | /* Init per tid rx state */ | |
1207 | /* Init per tid rx state */ | 1207 | for (tidno = 0, rxtid = &an->an_aggr.rx.tid[tidno]; |
1208 | for (tidno = 0, rxtid = &an->an_aggr.rx.tid[tidno]; | 1208 | tidno < WME_NUM_TID; |
1209 | tidno < WME_NUM_TID; | 1209 | tidno++, rxtid++) { |
1210 | tidno++, rxtid++) { | 1210 | rxtid->an = an; |
1211 | rxtid->an = an; | 1211 | rxtid->seq_reset = 1; |
1212 | rxtid->seq_reset = 1; | 1212 | rxtid->seq_next = 0; |
1213 | rxtid->seq_next = 0; | 1213 | rxtid->baw_size = WME_MAX_BA; |
1214 | rxtid->baw_size = WME_MAX_BA; | 1214 | rxtid->baw_head = rxtid->baw_tail = 0; |
1215 | rxtid->baw_head = rxtid->baw_tail = 0; | ||
1216 | 1215 | ||
1217 | /* | 1216 | /* |
1218 | * Ensure the buffer pointer is null at this point | 1217 | * Ensure the buffer pointer is null at this point |
1219 | * (needs to be allocated when addba is received) | 1218 | * (needs to be allocated when addba is received) |
1220 | */ | 1219 | */ |
1221 | 1220 | ||
1222 | rxtid->rxbuf = NULL; | 1221 | rxtid->rxbuf = NULL; |
1223 | setup_timer(&rxtid->timer, ath_rx_timer, | 1222 | setup_timer(&rxtid->timer, ath_rx_timer, |
1224 | (unsigned long)rxtid); | 1223 | (unsigned long)rxtid); |
1225 | spin_lock_init(&rxtid->tidlock); | 1224 | spin_lock_init(&rxtid->tidlock); |
1226 | 1225 | ||
1227 | /* ADDBA state */ | 1226 | /* ADDBA state */ |
1228 | rxtid->addba_exchangecomplete = 0; | 1227 | rxtid->addba_exchangecomplete = 0; |
1229 | } | ||
1230 | } | 1228 | } |
1231 | } | 1229 | } |
1232 | 1230 | ||
1233 | void ath_rx_node_free(struct ath_softc *sc, struct ath_node *an) | 1231 | void ath_rx_node_cleanup(struct ath_softc *sc, struct ath_node *an) |
1234 | { | 1232 | { |
1235 | if (sc->sc_flags & SC_OP_RXAGGR) { | 1233 | struct ath_arx_tid *rxtid; |
1236 | struct ath_arx_tid *rxtid; | 1234 | int tidno, i; |
1237 | int tidno, i; | ||
1238 | 1235 | ||
1239 | /* Init per tid rx state */ | 1236 | /* Init per tid rx state */ |
1240 | for (tidno = 0, rxtid = &an->an_aggr.rx.tid[tidno]; | 1237 | for (tidno = 0, rxtid = &an->an_aggr.rx.tid[tidno]; |
1241 | tidno < WME_NUM_TID; | 1238 | tidno < WME_NUM_TID; |
1242 | tidno++, rxtid++) { | 1239 | tidno++, rxtid++) { |
1243 | 1240 | ||
1244 | if (!rxtid->addba_exchangecomplete) | 1241 | if (!rxtid->addba_exchangecomplete) |
1245 | continue; | 1242 | continue; |
1246 | 1243 | ||
1247 | /* must cancel timer first */ | 1244 | /* must cancel timer first */ |
1248 | del_timer_sync(&rxtid->timer); | 1245 | del_timer_sync(&rxtid->timer); |
1249 | 1246 | ||
1250 | /* drop any pending sub-frames */ | 1247 | /* drop any pending sub-frames */ |
1251 | ath_rx_flush_tid(sc, rxtid, 1); | 1248 | ath_rx_flush_tid(sc, rxtid, 1); |
1252 | 1249 | ||
1253 | for (i = 0; i < ATH_TID_MAX_BUFS; i++) | 1250 | for (i = 0; i < ATH_TID_MAX_BUFS; i++) |
1254 | ASSERT(rxtid->rxbuf[i].rx_wbuf == NULL); | 1251 | ASSERT(rxtid->rxbuf[i].rx_wbuf == NULL); |
1255 | 1252 | ||
1256 | rxtid->addba_exchangecomplete = 0; | 1253 | rxtid->addba_exchangecomplete = 0; |
1257 | } | ||
1258 | } | 1254 | } |
1259 | |||
1260 | } | 1255 | } |
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 64557133b227..bd78244f1d18 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -2565,62 +2565,60 @@ void ath_txq_schedule(struct ath_softc *sc, struct ath_txq *txq) | |||
2565 | 2565 | ||
2566 | void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an) | 2566 | void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an) |
2567 | { | 2567 | { |
2568 | if (sc->sc_flags & SC_OP_TXAGGR) { | 2568 | struct ath_atx_tid *tid; |
2569 | struct ath_atx_tid *tid; | 2569 | struct ath_atx_ac *ac; |
2570 | struct ath_atx_ac *ac; | 2570 | int tidno, acno; |
2571 | int tidno, acno; | ||
2572 | |||
2573 | /* | ||
2574 | * Init per tid tx state | ||
2575 | */ | ||
2576 | for (tidno = 0, tid = &an->an_aggr.tx.tid[tidno]; | ||
2577 | tidno < WME_NUM_TID; | ||
2578 | tidno++, tid++) { | ||
2579 | tid->an = an; | ||
2580 | tid->tidno = tidno; | ||
2581 | tid->seq_start = tid->seq_next = 0; | ||
2582 | tid->baw_size = WME_MAX_BA; | ||
2583 | tid->baw_head = tid->baw_tail = 0; | ||
2584 | tid->sched = false; | ||
2585 | tid->paused = false; | ||
2586 | tid->cleanup_inprogress = false; | ||
2587 | INIT_LIST_HEAD(&tid->buf_q); | ||
2588 | |||
2589 | acno = TID_TO_WME_AC(tidno); | ||
2590 | tid->ac = &an->an_aggr.tx.ac[acno]; | ||
2591 | 2571 | ||
2592 | /* ADDBA state */ | 2572 | /* |
2593 | tid->addba_exchangecomplete = 0; | 2573 | * Init per tid tx state |
2594 | tid->addba_exchangeinprogress = 0; | 2574 | */ |
2595 | tid->addba_exchangeattempts = 0; | 2575 | for (tidno = 0, tid = &an->an_aggr.tx.tid[tidno]; |
2596 | } | 2576 | tidno < WME_NUM_TID; |
2577 | tidno++, tid++) { | ||
2578 | tid->an = an; | ||
2579 | tid->tidno = tidno; | ||
2580 | tid->seq_start = tid->seq_next = 0; | ||
2581 | tid->baw_size = WME_MAX_BA; | ||
2582 | tid->baw_head = tid->baw_tail = 0; | ||
2583 | tid->sched = false; | ||
2584 | tid->paused = false; | ||
2585 | tid->cleanup_inprogress = false; | ||
2586 | INIT_LIST_HEAD(&tid->buf_q); | ||
2587 | |||
2588 | acno = TID_TO_WME_AC(tidno); | ||
2589 | tid->ac = &an->an_aggr.tx.ac[acno]; | ||
2590 | |||
2591 | /* ADDBA state */ | ||
2592 | tid->addba_exchangecomplete = 0; | ||
2593 | tid->addba_exchangeinprogress = 0; | ||
2594 | tid->addba_exchangeattempts = 0; | ||
2595 | } | ||
2597 | 2596 | ||
2598 | /* | 2597 | /* |
2599 | * Init per ac tx state | 2598 | * Init per ac tx state |
2600 | */ | 2599 | */ |
2601 | for (acno = 0, ac = &an->an_aggr.tx.ac[acno]; | 2600 | for (acno = 0, ac = &an->an_aggr.tx.ac[acno]; |
2602 | acno < WME_NUM_AC; acno++, ac++) { | 2601 | acno < WME_NUM_AC; acno++, ac++) { |
2603 | ac->sched = false; | 2602 | ac->sched = false; |
2604 | INIT_LIST_HEAD(&ac->tid_q); | 2603 | INIT_LIST_HEAD(&ac->tid_q); |
2605 | 2604 | ||
2606 | switch (acno) { | 2605 | switch (acno) { |
2607 | case WME_AC_BE: | 2606 | case WME_AC_BE: |
2608 | ac->qnum = ath_tx_get_qnum(sc, | 2607 | ac->qnum = ath_tx_get_qnum(sc, |
2609 | ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BE); | 2608 | ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BE); |
2610 | break; | 2609 | break; |
2611 | case WME_AC_BK: | 2610 | case WME_AC_BK: |
2612 | ac->qnum = ath_tx_get_qnum(sc, | 2611 | ac->qnum = ath_tx_get_qnum(sc, |
2613 | ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BK); | 2612 | ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_BK); |
2614 | break; | 2613 | break; |
2615 | case WME_AC_VI: | 2614 | case WME_AC_VI: |
2616 | ac->qnum = ath_tx_get_qnum(sc, | 2615 | ac->qnum = ath_tx_get_qnum(sc, |
2617 | ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_VI); | 2616 | ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_VI); |
2618 | break; | 2617 | break; |
2619 | case WME_AC_VO: | 2618 | case WME_AC_VO: |
2620 | ac->qnum = ath_tx_get_qnum(sc, | 2619 | ac->qnum = ath_tx_get_qnum(sc, |
2621 | ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_VO); | 2620 | ATH9K_TX_QUEUE_DATA, ATH9K_WME_AC_VO); |
2622 | break; | 2621 | break; |
2623 | } | ||
2624 | } | 2622 | } |
2625 | } | 2623 | } |
2626 | } | 2624 | } |
@@ -2664,25 +2662,6 @@ void ath_tx_node_cleanup(struct ath_softc *sc, struct ath_node *an) | |||
2664 | } | 2662 | } |
2665 | } | 2663 | } |
2666 | 2664 | ||
2667 | /* Cleanup per node transmit state */ | ||
2668 | |||
2669 | void ath_tx_node_free(struct ath_softc *sc, struct ath_node *an) | ||
2670 | { | ||
2671 | if (sc->sc_flags & SC_OP_TXAGGR) { | ||
2672 | struct ath_atx_tid *tid; | ||
2673 | int tidno, i; | ||
2674 | |||
2675 | /* Init per tid rx state */ | ||
2676 | for (tidno = 0, tid = &an->an_aggr.tx.tid[tidno]; | ||
2677 | tidno < WME_NUM_TID; | ||
2678 | tidno++, tid++) { | ||
2679 | |||
2680 | for (i = 0; i < ATH_TID_MAX_BUFS; i++) | ||
2681 | ASSERT(tid->tx_buf[i] == NULL); | ||
2682 | } | ||
2683 | } | ||
2684 | } | ||
2685 | |||
2686 | void ath_tx_cabq(struct ath_softc *sc, struct sk_buff *skb) | 2665 | void ath_tx_cabq(struct ath_softc *sc, struct sk_buff *skb) |
2687 | { | 2666 | { |
2688 | int hdrlen, padsize; | 2667 | int hdrlen, padsize; |