Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mac80211: call rate_control_send_low() internally

There's no rate control algorithm that *doesn't* want to call
it internally, and calling it internally will let us modify
its behaviour in the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>

+7 -57
-3
Documentation/driver-api/80211/mac80211-advanced.rst
··· 226 226 .. kernel-doc:: include/net/mac80211.h 227 227 :functions: ieee80211_tx_rate_control 228 228 229 - .. kernel-doc:: include/net/mac80211.h 230 - :functions: rate_control_send_low 231 - 232 229 TBD 233 230 234 231 This part of the book describes mac80211 internals.
-3
drivers/net/wireless/intel/iwlegacy/3945-rs.c
··· 646 646 il_sta = NULL; 647 647 } 648 648 649 - if (rate_control_send_low(sta, il_sta, txrc)) 650 - return; 651 - 652 649 rate_mask = sta->supp_rates[sband->band]; 653 650 654 651 /* get user max rate if set */
-4
drivers/net/wireless/intel/iwlegacy/4965-rs.c
··· 2224 2224 il_sta = NULL; 2225 2225 } 2226 2226 2227 - /* Send management frames and NO_ACK data using lowest rate. */ 2228 - if (rate_control_send_low(sta, il_sta, txrc)) 2229 - return; 2230 - 2231 2227 if (!lq_sta) 2232 2228 return; 2233 2229
-4
drivers/net/wireless/intel/iwlwifi/dvm/rs.c
··· 2731 2731 priv_sta = NULL; 2732 2732 } 2733 2733 2734 - /* Send management frames and NO_ACK data using lowest rate. */ 2735 - if (rate_control_send_low(sta, priv_sta, txrc)) 2736 - return; 2737 - 2738 2734 rate_idx = lq_sta->last_txrate_idx; 2739 2735 2740 2736 if (lq_sta->last_rate_n_flags & RATE_MCS_HT_MSK) {
-4
drivers/net/wireless/intel/iwlwifi/mvm/rs.c
··· 2960 2960 mvm_sta = NULL; 2961 2961 } 2962 2962 2963 - /* Send management frames and NO_ACK data using lowest rate. */ 2964 - if (rate_control_send_low(sta, mvm_sta, txrc)) 2965 - return; 2966 - 2967 2963 if (!mvm_sta) 2968 2964 return; 2969 2965
-3
drivers/net/wireless/realtek/rtlwifi/rc.c
··· 173 173 u8 try_per_rate, i, rix; 174 174 bool not_data = !ieee80211_is_data(fc); 175 175 176 - if (rate_control_send_low(sta, priv_sta, txrc)) 177 - return; 178 - 179 176 rix = _rtl_rc_get_highest_rix(rtlpriv, sta, skb, not_data); 180 177 try_per_rate = 1; 181 178 _rtl_rc_rate_set_series(rtlpriv, sta, &rates[0], txrc,
-23
include/net/mac80211.h
··· 5960 5960 return (sta == NULL || sta->supp_rates[band] & BIT(index)); 5961 5961 } 5962 5962 5963 - /** 5964 - * rate_control_send_low - helper for drivers for management/no-ack frames 5965 - * 5966 - * Rate control algorithms that agree to use the lowest rate to 5967 - * send management frames and NO_ACK data with the respective hw 5968 - * retries should use this in the beginning of their mac80211 get_rate 5969 - * callback. If true is returned the rate control can simply return. 5970 - * If false is returned we guarantee that sta and sta and priv_sta is 5971 - * not null. 5972 - * 5973 - * Rate control algorithms wishing to do more intelligent selection of 5974 - * rate for multicast/broadcast frames may choose to not use this. 5975 - * 5976 - * @sta: &struct ieee80211_sta pointer to the target destination. Note 5977 - * that this may be null. 5978 - * @priv_sta: private rate control structure. This may be null. 5979 - * @txrc: rate control information we sholud populate for mac80211. 5980 - */ 5981 - bool rate_control_send_low(struct ieee80211_sta *sta, 5982 - void *priv_sta, 5983 - struct ieee80211_tx_rate_control *txrc); 5984 - 5985 - 5986 5963 static inline s8 5987 5964 rate_lowest_index(struct ieee80211_supported_band *sband, 5988 5965 struct ieee80211_sta *sta)
+7 -6
net/mac80211/rate.c
··· 369 369 } 370 370 371 371 372 - bool rate_control_send_low(struct ieee80211_sta *pubsta, 373 - void *priv_sta, 374 - struct ieee80211_tx_rate_control *txrc) 372 + static bool rate_control_send_low(struct ieee80211_sta *pubsta, 373 + struct ieee80211_tx_rate_control *txrc) 375 374 { 376 375 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(txrc->skb); 377 376 struct ieee80211_supported_band *sband = txrc->sband; ··· 378 379 int mcast_rate; 379 380 bool use_basicrate = false; 380 381 381 - if (!pubsta || !priv_sta || rc_no_data_or_no_ack_use_min(txrc)) { 382 + if (!pubsta || rc_no_data_or_no_ack_use_min(txrc)) { 382 383 __rate_control_send_low(txrc->hw, sband, pubsta, info, 383 384 txrc->rate_idx_mask); 384 385 ··· 404 405 } 405 406 return false; 406 407 } 407 - EXPORT_SYMBOL(rate_control_send_low); 408 408 409 409 static bool rate_idx_match_legacy_mask(s8 *rate_idx, int n_bitrates, u32 mask) 410 410 { ··· 900 902 if (ieee80211_hw_check(&sdata->local->hw, HAS_RATE_CONTROL)) 901 903 return; 902 904 905 + if (rate_control_send_low(ista, txrc)) 906 + return; 907 + 903 908 if (ista) { 904 909 spin_lock_bh(&sta->rate_ctrl_lock); 905 910 ref->ops->get_rate(ref->priv, ista, priv_sta, txrc); 906 911 spin_unlock_bh(&sta->rate_ctrl_lock); 907 912 } else { 908 - ref->ops->get_rate(ref->priv, NULL, NULL, txrc); 913 + rate_control_send_low(NULL, txrc); 909 914 } 910 915 911 916 if (ieee80211_hw_check(&sdata->local->hw, SUPPORTS_RC_TABLE))
-4
net/mac80211/rc80211_minstrel.c
··· 340 340 int delta; 341 341 int sampling_ratio; 342 342 343 - /* management/no-ack frames do not use rate control */ 344 - if (rate_control_send_low(sta, priv_sta, txrc)) 345 - return; 346 - 347 343 /* check multi-rate-retry capabilities & adjust lookaround_rate */ 348 344 mrr_capable = mp->has_mrr && 349 345 !txrc->rts &&
-3
net/mac80211/rc80211_minstrel_ht.c
··· 1098 1098 struct minstrel_priv *mp = priv; 1099 1099 int sample_idx; 1100 1100 1101 - if (rate_control_send_low(sta, priv_sta, txrc)) 1102 - return; 1103 - 1104 1101 if (!msp->is_ht) 1105 1102 return mac80211_minstrel.get_rate(priv, sta, &msp->legacy, txrc); 1106 1103