0238fab253690e3cbfcc3fd38495acd692c502d1
[openwrt/svn-archive/archive.git] / package / mac80211 / patches / 542-ath9k_remove_bf_aphy.patch
1 --- a/drivers/net/wireless/ath/ath9k/xmit.c
2 +++ b/drivers/net/wireless/ath/ath9k/xmit.c
3 @@ -57,8 +57,9 @@ static void ath_tx_complete_buf(struct a
4 static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq,
5 struct list_head *head);
6 static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf, int len);
7 -static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
8 - int nframes, int nbad, int txok, bool update_rc);
9 +static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
10 + struct ath_tx_status *ts, int nframes, int nbad,
11 + int txok, bool update_rc);
12 static void ath_tx_update_baw(struct ath_softc *sc, struct ath_atx_tid *tid,
13 int seqno);
14
15 @@ -297,7 +298,6 @@ static struct ath_buf* ath_clone_txbuf(s
16
17 ATH_TXBUF_RESET(tbf);
18
19 - tbf->aphy = bf->aphy;
20 tbf->bf_mpdu = bf->bf_mpdu;
21 tbf->bf_buf_addr = bf->bf_buf_addr;
22 memcpy(tbf->bf_desc, bf->bf_desc, sc->sc_ah->caps.tx_desc_len);
23 @@ -345,7 +345,7 @@ static void ath_tx_complete_aggr(struct
24 struct ath_node *an = NULL;
25 struct sk_buff *skb;
26 struct ieee80211_sta *sta;
27 - struct ieee80211_hw *hw;
28 + struct ieee80211_hw *hw = sc->hw;
29 struct ieee80211_hdr *hdr;
30 struct ieee80211_tx_info *tx_info;
31 struct ath_atx_tid *tid = NULL;
32 @@ -364,7 +364,6 @@ static void ath_tx_complete_aggr(struct
33 hdr = (struct ieee80211_hdr *)skb->data;
34
35 tx_info = IEEE80211_SKB_CB(skb);
36 - hw = bf->aphy->hw;
37
38 memcpy(rates, tx_info->control.rates, sizeof(rates));
39
40 @@ -383,7 +382,7 @@ static void ath_tx_complete_aggr(struct
41 !bf->bf_stale || bf_next != NULL)
42 list_move_tail(&bf->list, &bf_head);
43
44 - ath_tx_rc_status(bf, ts, 1, 1, 0, false);
45 + ath_tx_rc_status(sc, bf, ts, 1, 1, 0, false);
46 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
47 0, 0);
48
49 @@ -489,10 +488,10 @@ static void ath_tx_complete_aggr(struct
50
51 if (rc_update && (acked_cnt == 1 || txfail_cnt == 1)) {
52 memcpy(tx_info->control.rates, rates, sizeof(rates));
53 - ath_tx_rc_status(bf, ts, nframes, nbad, txok, true);
54 + ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok, true);
55 rc_update = false;
56 } else {
57 - ath_tx_rc_status(bf, ts, nframes, nbad, txok, false);
58 + ath_tx_rc_status(sc, bf, ts, nframes, nbad, txok, false);
59 }
60
61 ath_tx_complete_buf(sc, bf, txq, &bf_head, ts,
62 @@ -516,7 +515,7 @@ static void ath_tx_complete_aggr(struct
63
64 bf->bf_state.bf_type |=
65 BUF_XRETRY;
66 - ath_tx_rc_status(bf, ts, nframes,
67 + ath_tx_rc_status(sc, bf, ts, nframes,
68 nbad, 0, false);
69 ath_tx_complete_buf(sc, bf, txq,
70 &bf_head,
71 @@ -1677,7 +1676,6 @@ static struct ath_buf *ath_tx_setup_buff
72
73 ATH_TXBUF_RESET(bf);
74
75 - bf->aphy = aphy;
76 bf->bf_flags = setup_tx_flags(skb);
77 bf->bf_mpdu = skb;
78
79 @@ -1831,8 +1829,7 @@ int ath_tx_start(struct ieee80211_hw *hw
80 /*****************/
81
82 static void ath_tx_complete(struct ath_softc *sc, struct sk_buff *skb,
83 - struct ath_wiphy *aphy, int tx_flags, int ftype,
84 - struct ath_txq *txq)
85 + int tx_flags, int ftype, struct ath_txq *txq)
86 {
87 struct ieee80211_hw *hw = sc->hw;
88 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
89 @@ -1842,9 +1839,6 @@ static void ath_tx_complete(struct ath_s
90
91 ath_dbg(common, ATH_DBG_XMIT, "TX complete: skb: %p\n", skb);
92
93 - if (aphy)
94 - hw = aphy->hw;
95 -
96 if (tx_flags & ATH_TX_BAR)
97 tx_info->flags |= IEEE80211_TX_STAT_AMPDU_NO_BACK;
98
99 @@ -1918,7 +1912,7 @@ static void ath_tx_complete_buf(struct a
100 complete(&sc->paprd_complete);
101 } else {
102 ath_debug_stat_tx(sc, bf, ts);
103 - ath_tx_complete(sc, skb, bf->aphy, tx_flags,
104 + ath_tx_complete(sc, skb, tx_flags,
105 bf->bf_state.bfs_ftype, txq);
106 }
107 /* At this point, skb (bf->bf_mpdu) is consumed...make sure we don't
108 @@ -1934,14 +1928,14 @@ static void ath_tx_complete_buf(struct a
109 spin_unlock_irqrestore(&sc->tx.txbuflock, flags);
110 }
111
112 -static void ath_tx_rc_status(struct ath_buf *bf, struct ath_tx_status *ts,
113 - int nframes, int nbad, int txok, bool update_rc)
114 +static void ath_tx_rc_status(struct ath_softc *sc, struct ath_buf *bf,
115 + struct ath_tx_status *ts, int nframes, int nbad,
116 + int txok, bool update_rc)
117 {
118 struct sk_buff *skb = bf->bf_mpdu;
119 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
120 struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
121 - struct ieee80211_hw *hw = bf->aphy->hw;
122 - struct ath_softc *sc = bf->aphy->sc;
123 + struct ieee80211_hw *hw = sc->hw;
124 struct ath_hw *ah = sc->sc_ah;
125 u8 i, tx_rateindex;
126
127 @@ -2077,7 +2071,7 @@ static void ath_tx_processq(struct ath_s
128 */
129 if (ts.ts_status & ATH9K_TXERR_XRETRY)
130 bf->bf_state.bf_type |= BUF_XRETRY;
131 - ath_tx_rc_status(bf, &ts, 1, txok ? 0 : 1, txok, true);
132 + ath_tx_rc_status(sc, bf, &ts, 1, txok ? 0 : 1, txok, true);
133 }
134
135 if (bf_isampdu(bf))
136 @@ -2196,7 +2190,7 @@ void ath_tx_edma_tasklet(struct ath_soft
137 if (!bf_isampdu(bf)) {
138 if (txs.ts_status & ATH9K_TXERR_XRETRY)
139 bf->bf_state.bf_type |= BUF_XRETRY;
140 - ath_tx_rc_status(bf, &txs, 1, txok ? 0 : 1, txok, true);
141 + ath_tx_rc_status(sc, bf, &txs, 1, txok ? 0 : 1, txok, true);
142 }
143
144 if (bf_isampdu(bf))
145 --- a/drivers/net/wireless/ath/ath9k/ath9k.h
146 +++ b/drivers/net/wireless/ath/ath9k/ath9k.h
147 @@ -32,6 +32,7 @@
148 */
149
150 struct ath_node;
151 +struct ath_wiphy;
152
153 /* Macro to expand scalars to 64-bit objects */
154
155 @@ -233,7 +234,6 @@ struct ath_buf {
156 bool bf_stale;
157 u16 bf_flags;
158 struct ath_buf_state bf_state;
159 - struct ath_wiphy *aphy;
160 };
161
162 struct ath_atx_tid {
163 @@ -550,7 +550,6 @@ struct ath_ant_comb {
164 #define PS_WAIT_FOR_TX_ACK BIT(3)
165 #define PS_BEACON_SYNC BIT(4)
166
167 -struct ath_wiphy;
168 struct ath_rate_table;
169
170 struct ath9k_vif_iter_data {