diff options
Diffstat (limited to 'drivers/net/wireless/ath9k/xmit.c')
-rw-r--r-- | drivers/net/wireless/ath9k/xmit.c | 162 |
1 files changed, 43 insertions, 119 deletions
diff --git a/drivers/net/wireless/ath9k/xmit.c b/drivers/net/wireless/ath9k/xmit.c index 44735b6d9f04..baf5cb9d967e 100644 --- a/drivers/net/wireless/ath9k/xmit.c +++ b/drivers/net/wireless/ath9k/xmit.c | |||
@@ -102,23 +102,6 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, | |||
102 | ath9k_hw_txstart(ah, txq->axq_qnum); | 102 | ath9k_hw_txstart(ah, txq->axq_qnum); |
103 | } | 103 | } |
104 | 104 | ||
105 | /* Get transmit rate index using rate in Kbps */ | ||
106 | |||
107 | static int ath_tx_findindex(const struct ath9k_rate_table *rt, int rate) | ||
108 | { | ||
109 | int i; | ||
110 | int ndx = 0; | ||
111 | |||
112 | for (i = 0; i < rt->rateCount; i++) { | ||
113 | if (rt->info[i].rateKbps == rate) { | ||
114 | ndx = i; | ||
115 | break; | ||
116 | } | ||
117 | } | ||
118 | |||
119 | return ndx; | ||
120 | } | ||
121 | |||
122 | /* Check if it's okay to send out aggregates */ | 105 | /* Check if it's okay to send out aggregates */ |
123 | 106 | ||
124 | static int ath_aggr_query(struct ath_softc *sc, struct ath_node *an, u8 tidno) | 107 | static int ath_aggr_query(struct ath_softc *sc, struct ath_node *an, u8 tidno) |
@@ -158,26 +141,23 @@ static enum ath9k_pkt_type get_hw_packet_type(struct sk_buff *skb) | |||
158 | return htype; | 141 | return htype; |
159 | } | 142 | } |
160 | 143 | ||
161 | static bool check_min_rate(struct sk_buff *skb) | 144 | static bool is_pae(struct sk_buff *skb) |
162 | { | 145 | { |
163 | struct ieee80211_hdr *hdr; | 146 | struct ieee80211_hdr *hdr; |
164 | bool use_minrate = false; | ||
165 | __le16 fc; | 147 | __le16 fc; |
166 | 148 | ||
167 | hdr = (struct ieee80211_hdr *)skb->data; | 149 | hdr = (struct ieee80211_hdr *)skb->data; |
168 | fc = hdr->frame_control; | 150 | fc = hdr->frame_control; |
169 | 151 | ||
170 | if (ieee80211_is_mgmt(fc) || ieee80211_is_ctl(fc)) { | 152 | if (ieee80211_is_data(fc)) { |
171 | use_minrate = true; | ||
172 | } else if (ieee80211_is_data(fc)) { | ||
173 | if (ieee80211_is_nullfunc(fc) || | 153 | if (ieee80211_is_nullfunc(fc) || |
174 | /* Port Access Entity (IEEE 802.1X) */ | 154 | /* Port Access Entity (IEEE 802.1X) */ |
175 | (skb->protocol == cpu_to_be16(ETH_P_PAE))) { | 155 | (skb->protocol == cpu_to_be16(ETH_P_PAE))) { |
176 | use_minrate = true; | 156 | return true; |
177 | } | 157 | } |
178 | } | 158 | } |
179 | 159 | ||
180 | return use_minrate; | 160 | return false; |
181 | } | 161 | } |
182 | 162 | ||
183 | static int get_hw_crypto_keytype(struct sk_buff *skb) | 163 | static int get_hw_crypto_keytype(struct sk_buff *skb) |
@@ -199,50 +179,19 @@ static int get_hw_crypto_keytype(struct sk_buff *skb) | |||
199 | static void setup_rate_retries(struct ath_softc *sc, struct sk_buff *skb) | 179 | static void setup_rate_retries(struct ath_softc *sc, struct sk_buff *skb) |
200 | { | 180 | { |
201 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 181 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
202 | struct ath_tx_info_priv *tx_info_priv; | 182 | struct ieee80211_tx_rate *rates = tx_info->control.rates; |
203 | struct ath_rc_series *rcs; | ||
204 | struct ieee80211_hdr *hdr; | 183 | struct ieee80211_hdr *hdr; |
205 | const struct ath9k_rate_table *rt; | ||
206 | bool use_minrate; | ||
207 | __le16 fc; | 184 | __le16 fc; |
208 | u8 rix; | ||
209 | |||
210 | rt = sc->sc_currates; | ||
211 | BUG_ON(!rt); | ||
212 | 185 | ||
213 | hdr = (struct ieee80211_hdr *)skb->data; | 186 | hdr = (struct ieee80211_hdr *)skb->data; |
214 | fc = hdr->frame_control; | 187 | fc = hdr->frame_control; |
215 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; /* HACK */ | ||
216 | rcs = tx_info_priv->rcs; | ||
217 | |||
218 | /* Check if min rates have to be used */ | ||
219 | use_minrate = check_min_rate(skb); | ||
220 | |||
221 | if (ieee80211_is_data(fc) && !use_minrate) { | ||
222 | if (is_multicast_ether_addr(hdr->addr1)) { | ||
223 | rcs[0].rix = | ||
224 | ath_tx_findindex(rt, tx_info_priv->min_rate); | ||
225 | /* mcast packets are not re-tried */ | ||
226 | rcs[0].tries = 1; | ||
227 | } | ||
228 | } else { | ||
229 | /* for management and control frames, | ||
230 | or for NULL and EAPOL frames */ | ||
231 | if (use_minrate) | ||
232 | rcs[0].rix = ath_rate_findrateix(sc, tx_info_priv->min_rate); | ||
233 | else | ||
234 | rcs[0].rix = 0; | ||
235 | rcs[0].tries = ATH_MGT_TXMAXTRY; | ||
236 | } | ||
237 | |||
238 | rix = rcs[0].rix; | ||
239 | 188 | ||
240 | if (ieee80211_has_morefrags(fc) || | 189 | if (ieee80211_has_morefrags(fc) || |
241 | (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG)) { | 190 | (le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG)) { |
242 | rcs[1].tries = rcs[2].tries = rcs[3].tries = 0; | 191 | rates[1].count = rates[2].count = rates[3].count = 0; |
243 | rcs[1].rix = rcs[2].rix = rcs[3].rix = 0; | 192 | rates[1].idx = rates[2].idx = rates[3].idx = 0; |
244 | /* reset tries but keep rate index */ | 193 | /* reset tries but keep rate index */ |
245 | rcs[0].tries = ATH_TXMAXTRY; | 194 | rates[0].count = ATH_TXMAXTRY; |
246 | } | 195 | } |
247 | } | 196 | } |
248 | 197 | ||
@@ -274,7 +223,7 @@ static void assign_aggr_tid_seqno(struct sk_buff *skb, | |||
274 | 223 | ||
275 | /* Get seqno */ | 224 | /* Get seqno */ |
276 | 225 | ||
277 | if (ieee80211_is_data(fc) && !check_min_rate(skb)) { | 226 | if (ieee80211_is_data(fc) && !is_pae(skb)) { |
278 | /* For HT capable stations, we save tidno for later use. | 227 | /* For HT capable stations, we save tidno for later use. |
279 | * We also override seqno set by upper layer with the one | 228 | * We also override seqno set by upper layer with the one |
280 | * in tx aggregation state. | 229 | * in tx aggregation state. |
@@ -573,9 +522,11 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
573 | struct ath_node *an = NULL; | 522 | struct ath_node *an = NULL; |
574 | struct sk_buff *skb; | 523 | struct sk_buff *skb; |
575 | struct ieee80211_tx_info *tx_info; | 524 | struct ieee80211_tx_info *tx_info; |
525 | struct ieee80211_tx_rate *rates; | ||
576 | 526 | ||
577 | skb = (struct sk_buff *)bf->bf_mpdu; | 527 | skb = (struct sk_buff *)bf->bf_mpdu; |
578 | tx_info = IEEE80211_SKB_CB(skb); | 528 | tx_info = IEEE80211_SKB_CB(skb); |
529 | rates = tx_info->rate_driver_data[0]; | ||
579 | 530 | ||
580 | if (tx_info->control.sta) | 531 | if (tx_info->control.sta) |
581 | an = (struct ath_node *)tx_info->control.sta->drv_priv; | 532 | an = (struct ath_node *)tx_info->control.sta->drv_priv; |
@@ -584,9 +535,9 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
584 | * get the cix for the lowest valid rix. | 535 | * get the cix for the lowest valid rix. |
585 | */ | 536 | */ |
586 | rt = sc->sc_currates; | 537 | rt = sc->sc_currates; |
587 | for (i = 4; i--;) { | 538 | for (i = 3; i >= 0; i--) { |
588 | if (bf->bf_rcs[i].tries) { | 539 | if (rates[i].count) { |
589 | rix = bf->bf_rcs[i].rix; | 540 | rix = rates[i].idx; |
590 | break; | 541 | break; |
591 | } | 542 | } |
592 | } | 543 | } |
@@ -662,27 +613,27 @@ static void ath_buf_set_rate(struct ath_softc *sc, struct ath_buf *bf) | |||
662 | memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); | 613 | memset(series, 0, sizeof(struct ath9k_11n_rate_series) * 4); |
663 | 614 | ||
664 | for (i = 0; i < 4; i++) { | 615 | for (i = 0; i < 4; i++) { |
665 | if (!bf->bf_rcs[i].tries) | 616 | if (!rates[i].count) |
666 | continue; | 617 | continue; |
667 | 618 | ||
668 | rix = bf->bf_rcs[i].rix; | 619 | rix = rates[i].idx; |
669 | 620 | ||
670 | series[i].Rate = rt->info[rix].rateCode | | 621 | series[i].Rate = rt->info[rix].rateCode | |
671 | (bf_isshpreamble(bf) ? rt->info[rix].shortPreamble : 0); | 622 | (bf_isshpreamble(bf) ? rt->info[rix].shortPreamble : 0); |
672 | 623 | ||
673 | series[i].Tries = bf->bf_rcs[i].tries; | 624 | series[i].Tries = rates[i].count; |
674 | 625 | ||
675 | series[i].RateFlags = ( | 626 | series[i].RateFlags = ( |
676 | (bf->bf_rcs[i].flags & ATH_RC_RTSCTS_FLAG) ? | 627 | (rates[i].flags & IEEE80211_TX_RC_USE_RTS_CTS) ? |
677 | ATH9K_RATESERIES_RTS_CTS : 0) | | 628 | ATH9K_RATESERIES_RTS_CTS : 0) | |
678 | ((bf->bf_rcs[i].flags & ATH_RC_CW40_FLAG) ? | 629 | ((rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) ? |
679 | ATH9K_RATESERIES_2040 : 0) | | 630 | ATH9K_RATESERIES_2040 : 0) | |
680 | ((bf->bf_rcs[i].flags & ATH_RC_SGI_FLAG) ? | 631 | ((rates[i].flags & IEEE80211_TX_RC_SHORT_GI) ? |
681 | ATH9K_RATESERIES_HALFGI : 0); | 632 | ATH9K_RATESERIES_HALFGI : 0); |
682 | 633 | ||
683 | series[i].PktDuration = ath_pkt_duration(sc, rix, bf, | 634 | series[i].PktDuration = ath_pkt_duration(sc, rix, bf, |
684 | (bf->bf_rcs[i].flags & ATH_RC_CW40_FLAG) != 0, | 635 | (rates[i].flags & IEEE80211_TX_RC_40_MHZ_WIDTH) != 0, |
685 | (bf->bf_rcs[i].flags & ATH_RC_SGI_FLAG), | 636 | (rates[i].flags & IEEE80211_TX_RC_SHORT_GI), |
686 | bf_isshpreamble(bf)); | 637 | bf_isshpreamble(bf)); |
687 | 638 | ||
688 | if (bf_isht(bf) && an) | 639 | if (bf_isht(bf) && an) |
@@ -718,22 +669,12 @@ static int ath_tx_send_normal(struct ath_softc *sc, | |||
718 | struct list_head *bf_head) | 669 | struct list_head *bf_head) |
719 | { | 670 | { |
720 | struct ath_buf *bf; | 671 | struct ath_buf *bf; |
721 | struct sk_buff *skb; | ||
722 | struct ieee80211_tx_info *tx_info; | ||
723 | struct ath_tx_info_priv *tx_info_priv; | ||
724 | 672 | ||
725 | BUG_ON(list_empty(bf_head)); | 673 | BUG_ON(list_empty(bf_head)); |
726 | 674 | ||
727 | bf = list_first_entry(bf_head, struct ath_buf, list); | 675 | bf = list_first_entry(bf_head, struct ath_buf, list); |
728 | bf->bf_state.bf_type &= ~BUF_AMPDU; /* regular HT frame */ | 676 | bf->bf_state.bf_type &= ~BUF_AMPDU; /* regular HT frame */ |
729 | 677 | ||
730 | skb = (struct sk_buff *)bf->bf_mpdu; | ||
731 | tx_info = IEEE80211_SKB_CB(skb); | ||
732 | |||
733 | /* XXX: HACK! */ | ||
734 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | ||
735 | memcpy(bf->bf_rcs, tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); | ||
736 | |||
737 | /* update starting sequence number for subsequent ADDBA request */ | 678 | /* update starting sequence number for subsequent ADDBA request */ |
738 | INCR(tid->seq_start, IEEE80211_SEQ_MAX); | 679 | INCR(tid->seq_start, IEEE80211_SEQ_MAX); |
739 | 680 | ||
@@ -1124,8 +1065,8 @@ static int ath_tx_processq(struct ath_softc *sc, struct ath_txq *txq) | |||
1124 | skb = bf->bf_mpdu; | 1065 | skb = bf->bf_mpdu; |
1125 | tx_info = IEEE80211_SKB_CB(skb); | 1066 | tx_info = IEEE80211_SKB_CB(skb); |
1126 | 1067 | ||
1127 | /* XXX: HACK! */ | 1068 | tx_info_priv = |
1128 | tx_info_priv = (struct ath_tx_info_priv *) tx_info->control.vif; | 1069 | (struct ath_tx_info_priv *)tx_info->rate_driver_data[0]; |
1129 | if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) | 1070 | if (ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) |
1130 | tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; | 1071 | tx_info->flags |= IEEE80211_TX_STAT_TX_FILTERED; |
1131 | if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 && | 1072 | if ((ds->ds_txstat.ts_status & ATH9K_TXERR_FILT) == 0 && |
@@ -1268,9 +1209,6 @@ static int ath_tx_send_ampdu(struct ath_softc *sc, | |||
1268 | struct ath_tx_control *txctl) | 1209 | struct ath_tx_control *txctl) |
1269 | { | 1210 | { |
1270 | struct ath_buf *bf; | 1211 | struct ath_buf *bf; |
1271 | struct sk_buff *skb; | ||
1272 | struct ieee80211_tx_info *tx_info; | ||
1273 | struct ath_tx_info_priv *tx_info_priv; | ||
1274 | 1212 | ||
1275 | BUG_ON(list_empty(bf_head)); | 1213 | BUG_ON(list_empty(bf_head)); |
1276 | 1214 | ||
@@ -1296,12 +1234,6 @@ static int ath_tx_send_ampdu(struct ath_softc *sc, | |||
1296 | return 0; | 1234 | return 0; |
1297 | } | 1235 | } |
1298 | 1236 | ||
1299 | skb = (struct sk_buff *)bf->bf_mpdu; | ||
1300 | tx_info = IEEE80211_SKB_CB(skb); | ||
1301 | /* XXX: HACK! */ | ||
1302 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | ||
1303 | memcpy(bf->bf_rcs, tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); | ||
1304 | |||
1305 | /* Add sub-frame to BAW */ | 1237 | /* Add sub-frame to BAW */ |
1306 | ath_tx_addto_baw(sc, tid, bf); | 1238 | ath_tx_addto_baw(sc, tid, bf); |
1307 | 1239 | ||
@@ -1323,9 +1255,11 @@ static u32 ath_lookup_rate(struct ath_softc *sc, | |||
1323 | struct ath_buf *bf, | 1255 | struct ath_buf *bf, |
1324 | struct ath_atx_tid *tid) | 1256 | struct ath_atx_tid *tid) |
1325 | { | 1257 | { |
1258 | struct ath_rate_table *rate_table = sc->hw_rate_table[sc->sc_curmode]; | ||
1326 | const struct ath9k_rate_table *rt = sc->sc_currates; | 1259 | const struct ath9k_rate_table *rt = sc->sc_currates; |
1327 | struct sk_buff *skb; | 1260 | struct sk_buff *skb; |
1328 | struct ieee80211_tx_info *tx_info; | 1261 | struct ieee80211_tx_info *tx_info; |
1262 | struct ieee80211_tx_rate *rates; | ||
1329 | struct ath_tx_info_priv *tx_info_priv; | 1263 | struct ath_tx_info_priv *tx_info_priv; |
1330 | u32 max_4ms_framelen, frame_length; | 1264 | u32 max_4ms_framelen, frame_length; |
1331 | u16 aggr_limit, legacy = 0, maxampdu; | 1265 | u16 aggr_limit, legacy = 0, maxampdu; |
@@ -1333,10 +1267,9 @@ static u32 ath_lookup_rate(struct ath_softc *sc, | |||
1333 | 1267 | ||
1334 | skb = (struct sk_buff *)bf->bf_mpdu; | 1268 | skb = (struct sk_buff *)bf->bf_mpdu; |
1335 | tx_info = IEEE80211_SKB_CB(skb); | 1269 | tx_info = IEEE80211_SKB_CB(skb); |
1336 | tx_info_priv = (struct ath_tx_info_priv *) | 1270 | rates = tx_info->control.rates; |
1337 | tx_info->control.vif; /* XXX: HACK! */ | 1271 | tx_info_priv = |
1338 | memcpy(bf->bf_rcs, | 1272 | (struct ath_tx_info_priv *)tx_info->rate_driver_data[0]; |
1339 | tx_info_priv->rcs, 4 * sizeof(tx_info_priv->rcs[0])); | ||
1340 | 1273 | ||
1341 | /* | 1274 | /* |
1342 | * Find the lowest frame length among the rate series that will have a | 1275 | * Find the lowest frame length among the rate series that will have a |
@@ -1346,14 +1279,14 @@ static u32 ath_lookup_rate(struct ath_softc *sc, | |||
1346 | max_4ms_framelen = ATH_AMPDU_LIMIT_MAX; | 1279 | max_4ms_framelen = ATH_AMPDU_LIMIT_MAX; |
1347 | 1280 | ||
1348 | for (i = 0; i < 4; i++) { | 1281 | for (i = 0; i < 4; i++) { |
1349 | if (bf->bf_rcs[i].tries) { | 1282 | if (rates[i].count) { |
1350 | frame_length = bf->bf_rcs[i].max_4ms_framelen; | 1283 | if (rt->info[rates[i].idx].phy != PHY_HT) { |
1351 | |||
1352 | if (rt->info[bf->bf_rcs[i].rix].phy != PHY_HT) { | ||
1353 | legacy = 1; | 1284 | legacy = 1; |
1354 | break; | 1285 | break; |
1355 | } | 1286 | } |
1356 | 1287 | ||
1288 | frame_length = | ||
1289 | rate_table->info[rates[i].idx].max_4ms_framelen; | ||
1357 | max_4ms_framelen = min(max_4ms_framelen, frame_length); | 1290 | max_4ms_framelen = min(max_4ms_framelen, frame_length); |
1358 | } | 1291 | } |
1359 | } | 1292 | } |
@@ -1393,6 +1326,8 @@ static int ath_compute_num_delims(struct ath_softc *sc, | |||
1393 | u16 frmlen) | 1326 | u16 frmlen) |
1394 | { | 1327 | { |
1395 | const struct ath9k_rate_table *rt = sc->sc_currates; | 1328 | const struct ath9k_rate_table *rt = sc->sc_currates; |
1329 | struct sk_buff *skb = bf->bf_mpdu; | ||
1330 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | ||
1396 | u32 nsymbits, nsymbols, mpdudensity; | 1331 | u32 nsymbits, nsymbols, mpdudensity; |
1397 | u16 minlen; | 1332 | u16 minlen; |
1398 | u8 rc, flags, rix; | 1333 | u8 rc, flags, rix; |
@@ -1425,11 +1360,11 @@ static int ath_compute_num_delims(struct ath_softc *sc, | |||
1425 | if (mpdudensity == 0) | 1360 | if (mpdudensity == 0) |
1426 | return ndelim; | 1361 | return ndelim; |
1427 | 1362 | ||
1428 | rix = bf->bf_rcs[0].rix; | 1363 | rix = tx_info->control.rates[0].idx; |
1429 | flags = bf->bf_rcs[0].flags; | 1364 | flags = tx_info->control.rates[0].flags; |
1430 | rc = rt->info[rix].rateCode; | 1365 | rc = rt->info[rix].rateCode; |
1431 | width = (flags & ATH_RC_CW40_FLAG) ? 1 : 0; | 1366 | width = (flags & IEEE80211_TX_RC_40_MHZ_WIDTH) ? 1 : 0; |
1432 | half_gi = (flags & ATH_RC_SGI_FLAG) ? 1 : 0; | 1367 | half_gi = (flags & IEEE80211_TX_RC_SHORT_GI) ? 1 : 0; |
1433 | 1368 | ||
1434 | if (half_gi) | 1369 | if (half_gi) |
1435 | nsymbols = NUM_SYMBOLS_PER_USEC_HALFGI(mpdudensity); | 1370 | nsymbols = NUM_SYMBOLS_PER_USEC_HALFGI(mpdudensity); |
@@ -1471,7 +1406,7 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc, | |||
1471 | u16 aggr_limit = 0, al = 0, bpad = 0, | 1406 | u16 aggr_limit = 0, al = 0, bpad = 0, |
1472 | al_delta, h_baw = tid->baw_size / 2; | 1407 | al_delta, h_baw = tid->baw_size / 2; |
1473 | enum ATH_AGGR_STATUS status = ATH_AGGR_DONE; | 1408 | enum ATH_AGGR_STATUS status = ATH_AGGR_DONE; |
1474 | int prev_al = 0, is_ds_rate = 0; | 1409 | int prev_al = 0; |
1475 | INIT_LIST_HEAD(&bf_head); | 1410 | INIT_LIST_HEAD(&bf_head); |
1476 | 1411 | ||
1477 | BUG_ON(list_empty(&tid->buf_q)); | 1412 | BUG_ON(list_empty(&tid->buf_q)); |
@@ -1492,11 +1427,6 @@ static enum ATH_AGGR_STATUS ath_tx_form_aggr(struct ath_softc *sc, | |||
1492 | if (!rl) { | 1427 | if (!rl) { |
1493 | aggr_limit = ath_lookup_rate(sc, bf, tid); | 1428 | aggr_limit = ath_lookup_rate(sc, bf, tid); |
1494 | rl = 1; | 1429 | rl = 1; |
1495 | /* | ||
1496 | * Is rate dual stream | ||
1497 | */ | ||
1498 | is_ds_rate = | ||
1499 | (bf->bf_rcs[0].flags & ATH_RC_DS_FLAG) ? 1 : 0; | ||
1500 | } | 1430 | } |
1501 | 1431 | ||
1502 | /* | 1432 | /* |
@@ -1739,14 +1669,13 @@ static void ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf, | |||
1739 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 1669 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
1740 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; | 1670 | struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; |
1741 | struct ath_tx_info_priv *tx_info_priv; | 1671 | struct ath_tx_info_priv *tx_info_priv; |
1742 | struct ath_rc_series *rcs; | ||
1743 | int hdrlen; | 1672 | int hdrlen; |
1744 | __le16 fc; | 1673 | __le16 fc; |
1745 | 1674 | ||
1746 | tx_info_priv = (struct ath_tx_info_priv *)tx_info->control.vif; | 1675 | tx_info_priv = kzalloc(sizeof(*tx_info_priv), GFP_KERNEL); |
1676 | tx_info->rate_driver_data[0] = tx_info_priv; | ||
1747 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); | 1677 | hdrlen = ieee80211_get_hdrlen_from_skb(skb); |
1748 | fc = hdr->frame_control; | 1678 | fc = hdr->frame_control; |
1749 | rcs = tx_info_priv->rcs; | ||
1750 | 1679 | ||
1751 | ATH_TXBUF_RESET(bf); | 1680 | ATH_TXBUF_RESET(bf); |
1752 | 1681 | ||
@@ -1766,7 +1695,7 @@ static void ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf, | |||
1766 | (sc->sc_flags & SC_OP_PREAMBLE_SHORT) ? | 1695 | (sc->sc_flags & SC_OP_PREAMBLE_SHORT) ? |
1767 | (bf->bf_state.bf_type |= BUF_SHORT_PREAMBLE) : | 1696 | (bf->bf_state.bf_type |= BUF_SHORT_PREAMBLE) : |
1768 | (bf->bf_state.bf_type &= ~BUF_SHORT_PREAMBLE); | 1697 | (bf->bf_state.bf_type &= ~BUF_SHORT_PREAMBLE); |
1769 | (sc->hw->conf.ht.enabled && | 1698 | (sc->hw->conf.ht.enabled && !is_pae(skb) && |
1770 | (tx_info->flags & IEEE80211_TX_CTL_AMPDU)) ? | 1699 | (tx_info->flags & IEEE80211_TX_CTL_AMPDU)) ? |
1771 | (bf->bf_state.bf_type |= BUF_HT) : | 1700 | (bf->bf_state.bf_type |= BUF_HT) : |
1772 | (bf->bf_state.bf_type &= ~BUF_HT); | 1701 | (bf->bf_state.bf_type &= ~BUF_HT); |
@@ -1788,11 +1717,6 @@ static void ath_tx_setup_buffer(struct ath_softc *sc, struct ath_buf *bf, | |||
1788 | 1717 | ||
1789 | setup_rate_retries(sc, skb); | 1718 | setup_rate_retries(sc, skb); |
1790 | 1719 | ||
1791 | bf->bf_rcs[0] = rcs[0]; | ||
1792 | bf->bf_rcs[1] = rcs[1]; | ||
1793 | bf->bf_rcs[2] = rcs[2]; | ||
1794 | bf->bf_rcs[3] = rcs[3]; | ||
1795 | |||
1796 | /* Assign seqno, tidno */ | 1720 | /* Assign seqno, tidno */ |
1797 | 1721 | ||
1798 | if (bf_isht(bf) && (sc->sc_flags & SC_OP_TXAGGR)) | 1722 | if (bf_isht(bf) && (sc->sc_flags & SC_OP_TXAGGR)) |