aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h3
-rw-r--r--drivers/net/wireless/ath/ath9k/xmit.c38
2 files changed, 17 insertions, 24 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 6204f7b46f43..01306a3c4475 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -32,6 +32,7 @@
32 */ 32 */
33 33
34struct ath_node; 34struct ath_node;
35struct ath_wiphy;
35 36
36/* Macro to expand scalars to 64-bit objects */ 37/* Macro to expand scalars to 64-bit objects */
37 38
@@ -233,7 +234,6 @@ struct ath_buf {
233 bool bf_stale; 234 bool bf_stale;
234 u16 bf_flags; 235 u16 bf_flags;
235 struct ath_buf_state bf_state; 236 struct ath_buf_state bf_state;
236 struct ath_wiphy *aphy;
237}; 237};
238 238
239struct ath_atx_tid { 239struct ath_atx_tid {
@@ -563,7 +563,6 @@ struct ath_ant_comb {
563#define PS_WAIT_FOR_TX_ACK BIT(3) 563#define PS_WAIT_FOR_TX_ACK BIT(3)
564#define PS_BEACON_SYNC BIT(4) 564#define PS_BEACON_SYNC BIT(4)
565 565
566struct ath_wiphy;
567struct ath_rate_table; 566struct ath_rate_table;
568 567
569struct ath9k_vif_iter_data { 568struct ath9k_vif_iter_data {
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 07fdfa314759..d7e3f8c0602e 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -55,8 +55,9 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
55static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, 55static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
56 struct list_head *head); 56 struct list_head *head);
57static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len); 57static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len);
58static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts, 58static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
59 int nframes, int nbad, int txok, bool update_rc); 59 struct ath_tx_status *ts, int nframes, int nbad,
60 int txok, bool update_rc);
60static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid, 61static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
61 int seqno); 62 int seqno);
62 63
@@ -295,7 +296,6 @@ static struct ath_buf* ath_clone_txbuf(struct ath_softc *sc, struct ath_buf *bf)
295 296
296 ATH_TXBUF_RESET(tbf); 297 ATH_TXBUF_RESET(tbf);
297 298
298 tbf->aphy = bf->aphy;
299 tbf->bf_mpdu = bf->bf_mpdu; 299 tbf->bf_mpdu = bf->bf_mpdu;
300 tbf->bf_buf_addr = bf->bf_buf_addr; 300 tbf->bf_buf_addr = bf->bf_buf_addr;
301 memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len); 301 memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len);
@@ -343,7 +343,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
343 struct ath_node *an = NULL; 343 struct ath_node *an = NULL;
344 struct sk_buff *skb; 344 struct sk_buff *skb;
345 struct ieee80211_sta *sta; 345 struct ieee80211_sta *sta;
346 struct ieee80211_hw *hw; 346 struct ieee80211_hw *hw = sc->hw;
347 struct ieee80211_hdr *hdr; 347 struct ieee80211_hdr *hdr;
348 struct ieee80211_tx_info *tx_info; 348 struct ieee80211_tx_info *tx_info;
349 struct ath_atx_tid *tid = NULL; 349 struct ath_atx_tid *tid = NULL;
@@ -362,7 +362,6 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
362 hdr = (struct ieee80211_hdr *)skb->data; 362 hdr = (struct ieee80211_hdr *)skb->data;
363 363
364 tx_info = IEEE80211_SKB_CB(skb); 364 tx_info = IEEE80211_SKB_CB(skb);
365 hw = bf->aphy->hw;
366 365
367 memcpy(rates, tx_info->control.rates, sizeof(rates)); 366 memcpy(rates, tx_info->control.rates, sizeof(rates));
368 367
@@ -381,7 +380,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
381 !bf->bf_stale || bf_next != NULL) 380 !bf->bf_stale || bf_next != NULL)
382 list_move_tail(&bf->list, &bf_head); 381 list_move_tail(&bf->list, &bf_head);
383 382
384 ath_tx_rc_status(bf, ts, 1, 1, 0, false); 383 ath_tx_rc_status(sc, bf, ts, 1, 1, 0, false);
385 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, 384 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
386 0, 0); 385 0, 0);
387 386
@@ -487,10 +486,10 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
487 486
488 if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) { 487 if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
489 memcpy(tx_info->control.rates, rates, sizeof(rates)); 488 memcpy(tx_info->control.rates, rates, sizeof(rates));
490 ath_tx_rc_status(bf, ts, nframes, nbad, txok, true); 489 ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok, true);
491 rc_update = false; 490 rc_update = false;
492 } else { 491 } else {
493 ath_tx_rc_status(bf, ts, nframes, nbad, txok, false); 492 ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok, false);
494 } 493 }
495 494
496 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts, 495 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
@@ -514,7 +513,7 @@ static void ath_tx_complete_aggr(struct ath_softc *sc, struct ath_txq *txq,
514 513
515 bf->bf_state.bf_type |= 514 bf->bf_state.bf_type |=
516 BUF_XRETRY; 515 BUF_XRETRY;
517 ath_tx_rc_status(bf, ts, nframes, 516 ath_tx_rc_status(sc, bf, ts, nframes,
518 nbad, 0, false); 517 nbad, 0, false);
519 ath_tx_complete_buf(sc, bf, txq, 518 ath_tx_complete_buf(sc, bf, txq,
520 &bf_head, 519 &bf_head,
@@ -1680,7 +1679,6 @@ static struct ath_buf *ath_tx_setup_buffer(struct ieee80211_hw *hw,
1680 1679
1681 ATH_TXBUF_RESET(bf); 1680 ATH_TXBUF_RESET(bf);
1682 1681
1683 bf->aphy = aphy;
1684 bf->bf_flags = setup_tx_flags(skb); 1682 bf->bf_flags = setup_tx_flags(skb);
1685 bf->bf_mpdu = skb; 1683 bf->bf_mpdu = skb;
1686 1684
@@ -1834,8 +1832,7 @@ int ath_tx_start(struct ieee80211_hw *hw, struct sk_buff *skb,
1834/*****************/ 1832/*****************/
1835 1833
1836static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb, 1834static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
1837 struct ath_wiphy *aphy, int tx_flags, int ftype, 1835 int tx_flags, int ftype, struct ath_txq *txq)
1838 struct ath_txq *txq)
1839{ 1836{
1840 struct ieee80211_hw *hw = sc->hw; 1837 struct ieee80211_hw *hw = sc->hw;
1841 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 1838 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
@@ -1845,9 +1842,6 @@ static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
1845 1842
1846 ath_dbg(common, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb); 1843 ath_dbg(common, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb);
1847 1844
1848 if (aphy)
1849 hw = aphy->hw;
1850
1851 if (tx_flags & ATH_TX_BAR) 1845 if (tx_flags & ATH_TX_BAR)
1852 tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK; 1846 tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
1853 1847
@@ -1921,7 +1915,7 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
1921 complete(&sc->paprd_complete); 1915 complete(&sc->paprd_complete);
1922 } else { 1916 } else {
1923 ath_debug_stat_tx(sc, bf, ts); 1917 ath_debug_stat_tx(sc, bf, ts);
1924 ath_tx_complete(sc, skb, bf->aphy, tx_flags, 1918 ath_tx_complete(sc, skb, tx_flags,
1925 bf->bf_state.bfs_ftype, txq); 1919 bf->bf_state.bfs_ftype, txq);
1926 } 1920 }
1927 /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't 1921 /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't
@@ -1937,14 +1931,14 @@ static void ath_tx_complete_buf(struct ath_softc *sc, struct ath_buf *bf,
1937 spin_unlock_irqrestore(&sc->tx.txbuflock, flags); 1931 spin_unlock_irqrestore(&sc->tx.txbuflock, flags);
1938} 1932}
1939 1933
1940static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts, 1934static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
1941 int nframes, int nbad, int txok, bool update_rc) 1935 struct ath_tx_status *ts, int nframes, int nbad,
1936 int txok, bool update_rc)
1942{ 1937{
1943 struct sk_buff *skb = bf->bf_mpdu; 1938 struct sk_buff *skb = bf->bf_mpdu;
1944 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; 1939 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
1945 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); 1940 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
1946 struct ieee80211_hw *hw = bf->aphy->hw; 1941 struct ieee80211_hw *hw = sc->hw;
1947 struct ath_softc *sc = bf->aphy->sc;
1948 struct ath_hw *ah = sc->sc_ah; 1942 struct ath_hw *ah = sc->sc_ah;
1949 u8 i, tx_rateindex; 1943 u8 i, tx_rateindex;
1950 1944
@@ -2083,7 +2077,7 @@ static void ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq)
2083 */ 2077 */
2084 if (ts.ts_status & ATH9K_TXERR_XRETRY) 2078 if (ts.ts_status & ATH9K_TXERR_XRETRY)
2085 bf->bf_state.bf_type |= BUF_XRETRY; 2079 bf->bf_state.bf_type |= BUF_XRETRY;
2086 ath_tx_rc_status(bf, &ts, 1, txok ? 0 : 1, txok, true); 2080 ath_tx_rc_status(sc, bf, &ts, 1, txok ? 0 : 1, txok, true);
2087 } 2081 }
2088 2082
2089 if (bf_isampdu(bf)) 2083 if (bf_isampdu(bf))
@@ -2233,7 +2227,7 @@ void ath_tx_edma_tasklet(struct ath_softc *sc)
2233 if (!bf_isampdu(bf)) { 2227 if (!bf_isampdu(bf)) {
2234 if (txs.ts_status & ATH9K_TXERR_XRETRY) 2228 if (txs.ts_status & ATH9K_TXERR_XRETRY)
2235 bf->bf_state.bf_type |= BUF_XRETRY; 2229 bf->bf_state.bf_type |= BUF_XRETRY;
2236 ath_tx_rc_status(bf, &txs, 1, txok ? 0 : 1, txok, true); 2230 ath_tx_rc_status(sc, bf, &txs, 1, txok ? 0 : 1, txok, true);
2237 } 2231 }
2238 2232
2239 if (bf_isampdu(bf)) 2233 if (bf_isampdu(bf))