aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k/rc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath9k/rc.c')
-rw-r--r--drivers/net/wireless/ath9k/rc.c92
1 files changed, 3 insertions, 89 deletions
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c
index aafd10df9279..8a45b2502d23 100644
--- a/drivers/net/wireless/ath9k/rc.c
+++ b/drivers/net/wireless/ath9k/rc.c
@@ -709,27 +709,6 @@ u8 ath_rate_findrateix(struct ath_softc *sc,
709 return 0; 709 return 0;
710} 710}
711 711
712/*
713 * Update rate-control state on a device state change. When
714 * operating as a station this includes associate/reassociate
715 * with an AP. Otherwise this gets called, for example, when
716 * the we transition to run state when operating as an AP.
717 */
718void ath_rate_newstate(struct ath_softc *sc, struct ath_vap *avp)
719{
720 struct ath_rate_softc *asc = sc->sc_rc;
721
722 if (avp->av_config.av_fixed_rateset != IEEE80211_FIXED_RATE_NONE) {
723 asc->fixedrix =
724 sc->sc_rixmap[avp->av_config.av_fixed_rateset & 0xff];
725 /* NB: check the fixed rate exists */
726 if (asc->fixedrix == 0xff)
727 asc->fixedrix = IEEE80211_FIXED_RATE_NONE;
728 } else {
729 asc->fixedrix = IEEE80211_FIXED_RATE_NONE;
730 }
731}
732
733static u8 ath_rc_ratefind_ht(struct ath_softc *sc, 712static u8 ath_rc_ratefind_ht(struct ath_softc *sc,
734 struct ath_rate_node *ath_rc_priv, 713 struct ath_rate_node *ath_rc_priv,
735 const struct ath_rate_table *rate_table, 714 const struct ath_rate_table *rate_table,
@@ -1009,73 +988,11 @@ static void ath_rate_findrate(struct ath_softc *sc,
1009 int *is_probe, 988 int *is_probe,
1010 int is_retry) 989 int is_retry)
1011{ 990{
1012 struct ath_vap *avp = ath_rc_priv->avp;
1013
1014 DPRINTF(sc, ATH_DBG_RATE, "%s\n", __func__);
1015
1016 if (!num_rates || !num_tries) 991 if (!num_rates || !num_tries)
1017 return; 992 return;
1018 993
1019 if (avp->av_config.av_fixed_rateset == IEEE80211_FIXED_RATE_NONE) { 994 ath_rc_ratefind(sc, ath_rc_priv, num_tries, num_rates,
1020 ath_rc_ratefind(sc, ath_rc_priv, num_tries, num_rates, 995 rcflag, series, is_probe, is_retry);
1021 rcflag, series, is_probe, is_retry);
1022 } else {
1023 /* Fixed rate */
1024 int idx;
1025 u8 flags;
1026 u32 rix;
1027 struct ath_rate_softc *asc = ath_rc_priv->asc;
1028 struct ath_rate_table *rate_table;
1029
1030 rate_table = (struct ath_rate_table *)
1031 asc->hw_rate_table[sc->sc_curmode];
1032
1033 for (idx = 0; idx < 4; idx++) {
1034 unsigned int mcs;
1035 u8 series_rix = 0;
1036
1037 series[idx].tries = IEEE80211_RATE_IDX_ENTRY(
1038 avp->av_config.av_fixed_retryset, idx);
1039
1040 mcs = IEEE80211_RATE_IDX_ENTRY(
1041 avp->av_config.av_fixed_rateset, idx);
1042
1043 if (idx == 3 && (mcs & 0xf0) == 0x70)
1044 mcs = (mcs & ~0xf0)|0x80;
1045
1046 if (!(mcs & 0x80))
1047 flags = 0;
1048 else
1049 flags = ((ath_rc_priv->ht_cap &
1050 WLAN_RC_DS_FLAG) ?
1051 ATH_RC_DS_FLAG : 0) |
1052 ((ath_rc_priv->ht_cap &
1053 WLAN_RC_40_FLAG) ?
1054 ATH_RC_CW40_FLAG : 0) |
1055 ((ath_rc_priv->ht_cap &
1056 WLAN_RC_SGI_FLAG) ?
1057 ((ath_rc_priv->ht_cap &
1058 WLAN_RC_40_FLAG) ?
1059 ATH_RC_SGI_FLAG : 0) : 0);
1060
1061 series[idx].rix = sc->sc_rixmap[mcs];
1062 series_rix = series[idx].rix;
1063
1064 /* XXX: Give me some cleanup love */
1065 if ((flags & ATH_RC_CW40_FLAG) &&
1066 (flags & ATH_RC_SGI_FLAG))
1067 rix = rate_table->info[series_rix].ht_index;
1068 else if (flags & ATH_RC_SGI_FLAG)
1069 rix = rate_table->info[series_rix].sgi_index;
1070 else if (flags & ATH_RC_CW40_FLAG)
1071 rix = rate_table->info[series_rix].cw40index;
1072 else
1073 rix = rate_table->info[series_rix].base_index;
1074 series[idx].max_4ms_framelen =
1075 rate_table->info[rix].max_4ms_framelen;
1076 series[idx].flags = flags;
1077 }
1078 }
1079} 996}
1080 997
1081static void ath_rc_update_ht(struct ath_softc *sc, 998static void ath_rc_update_ht(struct ath_softc *sc,
@@ -1498,11 +1415,8 @@ static void ath_rate_tx_complete(struct ath_softc *sc,
1498{ 1415{
1499 int final_ts_idx = info_priv->tx.ts_rateindex; 1416 int final_ts_idx = info_priv->tx.ts_rateindex;
1500 int tx_status = 0, is_underrun = 0; 1417 int tx_status = 0, is_underrun = 0;
1501 struct ath_vap *avp;
1502 1418
1503 avp = rc_priv->avp; 1419 if (info_priv->tx.ts_status & ATH9K_TXERR_FILT)
1504 if ((avp->av_config.av_fixed_rateset != IEEE80211_FIXED_RATE_NONE) ||
1505 (info_priv->tx.ts_status & ATH9K_TXERR_FILT))
1506 return; 1420 return;
1507 1421
1508 if (info_priv->tx.ts_rssi > 0) { 1422 if (info_priv->tx.ts_rssi > 0) {