OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2004 Video54 Technologies, Inc. | 2 * Copyright (c) 2004 Video54 Technologies, Inc. |
3 * Copyright (c) 2004-2009 Atheros Communications, Inc. | 3 * Copyright (c) 2004-2009 Atheros Communications, Inc. |
4 * | 4 * |
5 * Permission to use, copy, modify, and/or distribute this software for any | 5 * Permission to use, copy, modify, and/or distribute this software for any |
6 * purpose with or without fee is hereby granted, provided that the above | 6 * purpose with or without fee is hereby granted, provided that the above |
7 * copyright notice and this permission notice appear in all copies. | 7 * copyright notice and this permission notice appear in all copies. |
8 * | 8 * |
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | 9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | 10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
531 const struct ath_rate_table *rate_table, | 531 const struct ath_rate_table *rate_table, |
532 struct ath_rateset *rateset, | 532 struct ath_rateset *rateset, |
533 u32 capflag) | 533 u32 capflag) |
534 { | 534 { |
535 u8 i, j, hi = 0; | 535 u8 i, j, hi = 0; |
536 | 536 |
537 /* Use intersection of working rates and valid rates */ | 537 /* Use intersection of working rates and valid rates */ |
538 for (i = 0; i < rateset->rs_nrates; i++) { | 538 for (i = 0; i < rateset->rs_nrates; i++) { |
539 for (j = 0; j < rate_table->rate_cnt; j++) { | 539 for (j = 0; j < rate_table->rate_cnt; j++) { |
540 u32 phy = rate_table->info[j].phy; | 540 u32 phy = rate_table->info[j].phy; |
541 » » » u16 rate_flags = rate_table->info[j].rate_flags; | 541 » » » u16 rate_flags = rate_table->info[i].rate_flags; |
Sam Leffler
2010/12/01 00:23:44
looks like a local patch was dropped
| |
542 u8 rate = rateset->rs_rates[i]; | 542 u8 rate = rateset->rs_rates[i]; |
543 u8 dot11rate = rate_table->info[j].dot11rate; | 543 u8 dot11rate = rate_table->info[j].dot11rate; |
544 | 544 |
545 /* We allow a rate only if its valid and the | 545 /* We allow a rate only if its valid and the |
546 * capflag matches one of the validity | 546 * capflag matches one of the validity |
547 * (VALID/VALID_20/VALID_40) flags */ | 547 * (VALID/VALID_20/VALID_40) flags */ |
548 | 548 |
549 if ((rate == dot11rate) && | 549 if ((rate == dot11rate) && |
550 (rate_flags & WLAN_RC_CAP_MODE(capflag)) == | 550 (rate_flags & WLAN_RC_CAP_MODE(capflag)) == |
551 WLAN_RC_CAP_MODE(capflag) && | 551 WLAN_RC_CAP_MODE(capflag) && |
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1313 caps |= WLAN_RC_DS_FLAG; | 1313 caps |= WLAN_RC_DS_FLAG; |
1314 if (is_cw40) | 1314 if (is_cw40) |
1315 caps |= WLAN_RC_40_FLAG; | 1315 caps |= WLAN_RC_40_FLAG; |
1316 if (is_sgi) | 1316 if (is_sgi) |
1317 caps |= WLAN_RC_SGI_FLAG; | 1317 caps |= WLAN_RC_SGI_FLAG; |
1318 } | 1318 } |
1319 | 1319 |
1320 return caps; | 1320 return caps; |
1321 } | 1321 } |
1322 | 1322 |
1323 static bool ath_tx_aggr_check(struct ath_softc *sc, struct ath_node *an, | |
1324 u8 tidno) | |
1325 { | |
1326 struct ath_atx_tid *txtid; | |
1327 | |
1328 if (!(sc->sc_flags & SC_OP_TXAGGR)) | |
1329 return false; | |
1330 | |
1331 txtid = ATH_AN_2_TID(an, tidno); | |
1332 | |
1333 if (!(txtid->state & (AGGR_ADDBA_COMPLETE | AGGR_ADDBA_PROGRESS))) | |
1334 return true; | |
1335 return false; | |
1336 } | |
1337 | |
1338 | |
1339 /***********************************/ | 1323 /***********************************/ |
1340 /* mac80211 Rate Control callbacks */ | 1324 /* mac80211 Rate Control callbacks */ |
1341 /***********************************/ | 1325 /***********************************/ |
1342 | 1326 |
1343 static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband, | 1327 static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband, |
1344 struct ieee80211_sta *sta, void *priv_sta, | 1328 struct ieee80211_sta *sta, void *priv_sta, |
1345 struct sk_buff *skb) | 1329 struct sk_buff *skb) |
1346 { | 1330 { |
1347 struct ath_softc *sc = priv; | 1331 struct ath_softc *sc = priv; |
1348 struct ath_rate_priv *ath_rc_priv = priv_sta; | 1332 struct ath_rate_priv *ath_rc_priv = priv_sta; |
(...skipping 19 matching lines...) Expand all Loading... | |
1368 return; | 1352 return; |
1369 | 1353 |
1370 /* This packet was aggregated but doesn't carry status info */ | 1354 /* This packet was aggregated but doesn't carry status info */ |
1371 if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && | 1355 if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && |
1372 !(tx_info->flags & IEEE80211_TX_STAT_AMPDU)) | 1356 !(tx_info->flags & IEEE80211_TX_STAT_AMPDU)) |
1373 return; | 1357 return; |
1374 | 1358 |
1375 if (tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) | 1359 if (tx_info->flags & IEEE80211_TX_STAT_TX_FILTERED) |
1376 return; | 1360 return; |
1377 | 1361 |
1362 if (!(tx_info->flags & IEEE80211_TX_STAT_AMPDU)) { | |
1363 tx_info->status.ampdu_ack_len = | |
1364 (tx_info->flags & IEEE80211_TX_STAT_ACK ? 1 : 0); | |
1365 tx_info->status.ampdu_len = 1; | |
1366 } | |
1367 | |
1378 /* | 1368 /* |
1379 * If an underrun error is seen assume it as an excessive retry only | 1369 * If an underrun error is seen assume it as an excessive retry only |
1380 * if max frame trigger level has been reached (2 KB for singel stream, | 1370 * if max frame trigger level has been reached (2 KB for singel stream, |
1381 * and 4 KB for dual stream). Adjust the long retry as if the frame was | 1371 * and 4 KB for dual stream). Adjust the long retry as if the frame was |
1382 * tried hw->max_rate_tries times to affect how ratectrl updates PER for | 1372 * tried hw->max_rate_tries times to affect how ratectrl updates PER for |
1383 * the failed rate. In case of congestion on the bus penalizing these | 1373 * the failed rate. In case of congestion on the bus penalizing these |
1384 * type of underruns should help hardware actually transmit new frames | 1374 * type of underruns should help hardware actually transmit new frames |
1385 * successfully by eventually preferring slower rates. This itself | 1375 * successfully by eventually preferring slower rates. This itself |
1386 * should also alleviate congestion on the bus. | 1376 * should also alleviate congestion on the bus. |
1387 */ | 1377 */ |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1565 | 1555 |
1566 int ath_rate_control_register(void) | 1556 int ath_rate_control_register(void) |
1567 { | 1557 { |
1568 return ieee80211_rate_control_register(&ath_rate_ops); | 1558 return ieee80211_rate_control_register(&ath_rate_ops); |
1569 } | 1559 } |
1570 | 1560 |
1571 void ath_rate_control_unregister(void) | 1561 void ath_rate_control_unregister(void) |
1572 { | 1562 { |
1573 ieee80211_rate_control_unregister(&ath_rate_ops); | 1563 ieee80211_rate_control_unregister(&ath_rate_ops); |
1574 } | 1564 } |
OLD | NEW |