• Jonas Jelonek's avatar
    mac80211: extend current rate control tx status API · 44fa75f2
    Jonas Jelonek authored
    This patch adds the new struct ieee80211_rate_status and replaces
    'struct rate_info *rate' in ieee80211_tx_status with pointer and length
    annotation.
    
    The struct ieee80211_rate_status allows to:
    (1)	receive tx power status feedback for transmit power control (TPC)
    	per packet or packet retry
    (2)	dynamic mapping of wifi chip specific multi-rate retry (mrr)
    	chains with different lengths
    (3)	increase the limit of annotatable rate indices to support
    	IEEE802.11ac rate sets and beyond
    
    ieee80211_tx_info, control and status buffer, and ieee80211_tx_rate
    cannot be used to achieve these goals due to fixed size limitations.
    
    Our new struct contains a struct rate_info to annotate the rate that was
    used, retry count of the rate and tx power. It is intended for all
    information related to RC and TPC that needs to be passed from driver to
    mac80211 and its RC/TPC algorithms like Minstrel_HT. It corresponds to
    one stage in an mrr. Multiple subsequent instances of this struct can be
    included in struct ieee80211_tx_status via a pointer and a length variable.
    Those instances can be allocated on-stack. The former reference to a single
    instance of struct rate_info is replaced with our new annotation.
    
    An extension is introduced to struct ieee80211_hw. There are two new
    members called 'tx_power_levels' and 'max_txpwr_levels_idx' acting as a
    tx power level table. When a wifi device is registered, the driver shall
    supply all supported power levels in this list. This allows to support
    several quirks like differing power steps in power level ranges or
    alike. TPC can use this for algorithm and thus be designed more abstract
    instead of handling all possible step widths individually.
    
    Further mandatory changes in status.c, mt76 and ath11k drivers due to the
    removal of 'struct rate_info *rate' are also included.
    status.c already uses the information in ieee80211_tx_status->rate in
    radiotap, this is now changed to use ieee80211_rate_status->rate_idx.
    mt76 driver already uses struct rate_info to pass the tx rate to status
    path. The new members of the ieee80211_tx_status are set to NULL and 0
    because the previously passed rate is not relevant to rate control and
    accurate information is passed via tx_info->status.rates.
    For ath11k, the txrate can be passed via this struct because ath11k uses
    firmware RC and thus the information does not interfere with software RC.
    
    Compile-Tested: current wireless-next tree with all flags on
    Tested-on: Xiaomi 4A Gigabit (MediaTek MT7603E, MT7612E) with OpenWrt
    		Linux 5.10.113
    Signed-off-by: default avatarJonas Jelonek <jelonek.jonas@gmail.com>
    Link: https://lore.kernel.org/r/20220509173958.1398201-2-jelonek.jonas@gmail.comSigned-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
    44fa75f2
mac80211.h 273 KB