aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h24
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c12
-rw-r--r--drivers/net/wireless/ath/ath9k/rc.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c21
5 files changed, 29 insertions, 46 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 419bf4e4dc73..5ecec83117d6 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -583,19 +583,17 @@ struct ath_ant_comb {
583 583
584#define SC_OP_INVALID BIT(0) 584#define SC_OP_INVALID BIT(0)
585#define SC_OP_BEACONS BIT(1) 585#define SC_OP_BEACONS BIT(1)
586#define SC_OP_RXAGGR BIT(2) 586#define SC_OP_OFFCHANNEL BIT(2)
587#define SC_OP_TXAGGR BIT(3) 587#define SC_OP_PREAMBLE_SHORT BIT(3)
588#define SC_OP_OFFCHANNEL BIT(4) 588#define SC_OP_PROTECT_ENABLE BIT(4)
589#define SC_OP_PREAMBLE_SHORT BIT(5) 589#define SC_OP_RXFLUSH BIT(5)
590#define SC_OP_PROTECT_ENABLE BIT(6) 590#define SC_OP_LED_ASSOCIATED BIT(6)
591#define SC_OP_RXFLUSH BIT(7) 591#define SC_OP_LED_ON BIT(7)
592#define SC_OP_LED_ASSOCIATED BIT(8) 592#define SC_OP_TSF_RESET BIT(8)
593#define SC_OP_LED_ON BIT(9) 593#define SC_OP_BT_PRIORITY_DETECTED BIT(9)
594#define SC_OP_TSF_RESET BIT(11) 594#define SC_OP_BT_SCAN BIT(10)
595#define SC_OP_BT_PRIORITY_DETECTED BIT(12) 595#define SC_OP_ANI_RUN BIT(11)
596#define SC_OP_BT_SCAN BIT(13) 596#define SC_OP_PRIM_STA_VIF BIT(12)
597#define SC_OP_ANI_RUN BIT(14)
598#define SC_OP_PRIM_STA_VIF BIT(15)
599 597
600/* Powersave flags */ 598/* Powersave flags */
601#define PS_WAIT_FOR_BEACON BIT(0) 599#define PS_WAIT_FOR_BEACON BIT(0)
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index 944e9b518f19..2708d1fc2c10 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -484,19 +484,12 @@ static void ath9k_init_misc(struct ath_softc *sc)
484{ 484{
485 struct ath_common *common = ath9k_hw_common(sc->sc_ah); 485 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
486 int i = 0; 486 int i = 0;
487
487 setup_timer(&common->ani.timer, ath_ani_calibrate, (unsigned long)sc); 488 setup_timer(&common->ani.timer, ath_ani_calibrate, (unsigned long)sc);
488 489
489 sc->config.txpowlimit = ATH_TXPOWER_MAX; 490 sc->config.txpowlimit = ATH_TXPOWER_MAX;
490
491 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) {
492 sc->sc_flags |= SC_OP_TXAGGR;
493 sc->sc_flags |= SC_OP_RXAGGR;
494 }
495
496 sc->rx.defant = ath9k_hw_getdefantenna(sc->sc_ah); 491 sc->rx.defant = ath9k_hw_getdefantenna(sc->sc_ah);
497
498 memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN); 492 memcpy(common->bssidmask, ath_bcast_mac, ETH_ALEN);
499
500 sc->beacon.slottime = ATH9K_SLOT_TIME_9; 493 sc->beacon.slottime = ATH9K_SLOT_TIME_9;
501 494
502 for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) 495 for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++)
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index a07565c730b7..3f00daa0ea06 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -639,7 +639,8 @@ static void ath_node_attach(struct ath_softc *sc, struct ieee80211_sta *sta,
639#endif 639#endif
640 an->sta = sta; 640 an->sta = sta;
641 an->vif = vif; 641 an->vif = vif;
642 if (sc->sc_flags & SC_OP_TXAGGR) { 642
643 if (sta->ht_cap.ht_supported) {
643 ath_tx_node_init(sc, an); 644 ath_tx_node_init(sc, an);
644 an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR + 645 an->maxampdu = 1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
645 sta->ht_cap.ampdu_factor); 646 sta->ht_cap.ampdu_factor);
@@ -658,7 +659,7 @@ static void ath_node_detach(struct ath_softc *sc, struct ieee80211_sta *sta)
658 an->sta = NULL; 659 an->sta = NULL;
659#endif 660#endif
660 661
661 if (sc->sc_flags & SC_OP_TXAGGR) 662 if (sta->ht_cap.ht_supported)
662 ath_tx_node_cleanup(sc, an); 663 ath_tx_node_cleanup(sc, an);
663} 664}
664 665
@@ -1751,7 +1752,7 @@ static void ath9k_sta_notify(struct ieee80211_hw *hw,
1751 struct ath_softc *sc = hw->priv; 1752 struct ath_softc *sc = hw->priv;
1752 struct ath_node *an = (struct ath_node *) sta->drv_priv; 1753 struct ath_node *an = (struct ath_node *) sta->drv_priv;
1753 1754
1754 if (!(sc->sc_flags & SC_OP_TXAGGR)) 1755 if (!sta->ht_cap.ht_supported)
1755 return; 1756 return;
1756 1757
1757 switch (cmd) { 1758 switch (cmd) {
@@ -2119,15 +2120,10 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
2119 2120
2120 switch (action) { 2121 switch (action) {
2121 case IEEE80211_AMPDU_RX_START: 2122 case IEEE80211_AMPDU_RX_START:
2122 if (!(sc->sc_flags & SC_OP_RXAGGR))
2123 ret = -ENOTSUPP;
2124 break; 2123 break;
2125 case IEEE80211_AMPDU_RX_STOP: 2124 case IEEE80211_AMPDU_RX_STOP:
2126 break; 2125 break;
2127 case IEEE80211_AMPDU_TX_START: 2126 case IEEE80211_AMPDU_TX_START:
2128 if (!(sc->sc_flags & SC_OP_TXAGGR))
2129 return -EOPNOTSUPP;
2130
2131 ath9k_ps_wakeup(sc); 2127 ath9k_ps_wakeup(sc);
2132 ret = ath_tx_aggr_start(sc, sta, tid, ssn); 2128 ret = ath_tx_aggr_start(sc, sta, tid, ssn);
2133 if (!ret) 2129 if (!ret)
diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
index 6407af22f7b9..f26e9847bb2e 100644
--- a/drivers/net/wireless/ath/ath9k/rc.c
+++ b/drivers/net/wireless/ath/ath9k/rc.c
@@ -1298,12 +1298,13 @@ static u8 ath_rc_build_ht_caps(struct ath_softc *sc, struct ieee80211_sta *sta,
1298 return caps; 1298 return caps;
1299} 1299}
1300 1300
1301static bool ath_tx_aggr_check(struct ath_softc *sc, struct ath_node *an, 1301static bool ath_tx_aggr_check(struct ath_softc *sc, struct ieee80211_sta *sta,
1302 u8 tidno) 1302 u8 tidno)
1303{ 1303{
1304 struct ath_node *an = (struct ath_node *)sta->drv_priv;
1304 struct ath_atx_tid *txtid; 1305 struct ath_atx_tid *txtid;
1305 1306
1306 if (!(sc->sc_flags & SC_OP_TXAGGR)) 1307 if (!sta->ht_cap.ht_supported)
1307 return false; 1308 return false;
1308 1309
1309 txtid = ATH_AN_2_TID(an, tidno); 1310 txtid = ATH_AN_2_TID(an, tidno);
@@ -1374,13 +1375,11 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
1374 if (ieee80211_is_data_qos(fc) && 1375 if (ieee80211_is_data_qos(fc) &&
1375 skb_get_queue_mapping(skb) != IEEE80211_AC_VO) { 1376 skb_get_queue_mapping(skb) != IEEE80211_AC_VO) {
1376 u8 *qc, tid; 1377 u8 *qc, tid;
1377 struct ath_node *an;
1378 1378
1379 qc = ieee80211_get_qos_ctl(hdr); 1379 qc = ieee80211_get_qos_ctl(hdr);
1380 tid = qc[0] & 0xf; 1380 tid = qc[0] & 0xf;
1381 an = (struct ath_node *)sta->drv_priv;
1382 1381
1383 if(ath_tx_aggr_check(sc, an, tid)) 1382 if(ath_tx_aggr_check(sc, sta, tid))
1384 ieee80211_start_tx_ba_session(sta, tid, 0); 1383 ieee80211_start_tx_ba_session(sta, tid, 0);
1385 } 1384 }
1386 } 1385 }
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 9f785015a7dc..d2c635d84fbc 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -1290,14 +1290,11 @@ void ath_tx_aggr_resume(struct ath_softc *sc, struct ieee80211_sta *sta, u16 tid
1290 1290
1291 an = (struct ath_node *)sta->drv_priv; 1291 an = (struct ath_node *)sta->drv_priv;
1292 1292
1293 if (sc->sc_flags & SC_OP_TXAGGR) { 1293 txtid = ATH_AN_2_TID(an, tid);
1294 txtid = ATH_AN_2_TID(an, tid); 1294 txtid->baw_size = IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor;
1295 txtid->baw_size = 1295 txtid->state |= AGGR_ADDBA_COMPLETE;
1296 IEEE80211_MIN_AMPDU_BUF << sta->ht_cap.ampdu_factor; 1296 txtid->state &= ~AGGR_ADDBA_PROGRESS;
1297 txtid->state |= AGGR_ADDBA_COMPLETE; 1297 ath_tx_resume_tid(sc, txtid);
1298 txtid->state &= ~AGGR_ADDBA_PROGRESS;
1299 ath_tx_resume_tid(sc, txtid);
1300 }
1301} 1298}
1302 1299
1303/********************/ 1300/********************/
@@ -1523,7 +1520,7 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx)
1523 ath_drain_txq_list(sc, txq, &txq->axq_q, retry_tx); 1520 ath_drain_txq_list(sc, txq, &txq->axq_q, retry_tx);
1524 1521
1525 /* flush any pending frames if aggregation is enabled */ 1522 /* flush any pending frames if aggregation is enabled */
1526 if ((sc->sc_flags & SC_OP_TXAGGR) && !retry_tx) 1523 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) && !retry_tx)
1527 ath_txq_drain_pending_buffers(sc, txq); 1524 ath_txq_drain_pending_buffers(sc, txq);
1528 1525
1529 ath_txq_unlock_complete(sc, txq); 1526 ath_txq_unlock_complete(sc, txq);
@@ -1871,7 +1868,7 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct sk_buff *skb,
1871 struct ath_buf *bf; 1868 struct ath_buf *bf;
1872 u8 tidno; 1869 u8 tidno;
1873 1870
1874 if ((sc->sc_flags & SC_OP_TXAGGR) && txctl->an && 1871 if ((sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT) && txctl->an &&
1875 ieee80211_is_data_qos(hdr->frame_control)) { 1872 ieee80211_is_data_qos(hdr->frame_control)) {
1876 tidno = ieee80211_get_qos_ctl(hdr)[0] & 1873 tidno = ieee80211_get_qos_ctl(hdr)[0] &
1877 IEEE80211_QOS_CTL_TID_MASK; 1874 IEEE80211_QOS_CTL_TID_MASK;
@@ -2141,7 +2138,7 @@ static void ath_tx_process_buffer(struct ath_softc *sc, struct ath_txq *txq,
2141 } else 2138 } else
2142 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok, true); 2139 ath_tx_complete_aggr(sc, txq, bf, bf_head, ts, txok, true);
2143 2140
2144 if (sc->sc_flags & SC_OP_TXAGGR) 2141 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
2145 ath_txq_schedule(sc, txq); 2142 ath_txq_schedule(sc, txq);
2146} 2143}
2147 2144
@@ -2166,7 +2163,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
2166 2163
2167 if (list_empty(&txq->axq_q)) { 2164 if (list_empty(&txq->axq_q)) {
2168 txq->axq_link = NULL; 2165 txq->axq_link = NULL;
2169 if (sc->sc_flags & SC_OP_TXAGGR) 2166 if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_HT)
2170 ath_txq_schedule(sc, txq); 2167 ath_txq_schedule(sc, txq);
2171 break; 2168 break;
2172 } 2169 }