869static u8 ath_rc_ratefind_ht(struct ath_softc *sc,
870 struct ath_rate_node *ath_rc_priv,
871 const struct ath_rate_table *rate_table,
872 int probe_allowed, int *is_probing,
873 int is_retry)
874{
875 u32 dt, best_thruput, this_thruput, now_msec;
876 u8 rate, next_rate, best_rate, maxindex, minindex;
877 int8_t rssi_last, rssi_reduce = 0, index = 0;
878 struct ath_tx_ratectrl *rate_ctrl = NULL;
879
880 rate_ctrl = (struct ath_tx_ratectrl *)(ath_rc_priv ?
881 (ath_rc_priv) : NULL);
882
883 *is_probing = FALSE;
884
885 rssi_last = median(rate_ctrl->rssi_last,
886 rate_ctrl->rssi_last_prev,
887 rate_ctrl->rssi_last_prev2);
888
889
890
891
892
893
894
895
896
897
898 now_msec = jiffies_to_msecs(jiffies);
899 dt = now_msec - rate_ctrl->rssi_time;
900
901 if (dt >= 185)
902 rssi_reduce = 10;
903 else if (dt >= 25)
904 rssi_reduce = (u8)((dt - 25) >> 4);
905
906
907 if (rssi_last < rssi_reduce)
908 rssi_last = 0;
909 else