#include <linux/netdevice.h>
#include <linux/types.h>
#include <linux/skbuff.h>
#include <linux/debugfs.h>
#include <linux/random.h>
#include <linux/moduleparam.h>
#include <linux/ieee80211.h>
#include <linux/minmax.h>
#include <net/mac80211.h>
#include "rate.h"
#include "sta_info.h"
#include "rc80211_minstrel_ht.h"
#define AVG_AMPDU_SIZE …
#define AVG_PKT_SIZE …
#define MCS_NBITS …
#define MCS_NSYMS(bps) …
#define MCS_SYMBOL_TIME(sgi, syms) …
#define MCS_DURATION(streams, sgi, bps) …
#define BW_20 …
#define BW_40 …
#define BW_80 …
#define GROUP_IDX(_streams, _sgi, _ht40) …
#define _MAX(a, b) …
#define GROUP_SHIFT(duration) …
#define __MCS_GROUP(_streams, _sgi, _ht40, _s) …
#define MCS_GROUP_SHIFT(_streams, _sgi, _ht40) …
#define MCS_GROUP(_streams, _sgi, _ht40) …
#define VHT_GROUP_IDX(_streams, _sgi, _bw) …
#define BW2VBPS(_bw, r3, r2, r1) …
#define __VHT_GROUP(_streams, _sgi, _bw, _s) …
#define VHT_GROUP_SHIFT(_streams, _sgi, _bw) …
#define VHT_GROUP(_streams, _sgi, _bw) …
#define CCK_DURATION(_bitrate, _short) …
#define CCK_DURATION_LIST(_short, _s) …
#define __CCK_GROUP(_s) …
#define CCK_GROUP_SHIFT …
#define CCK_GROUP …
#define OFDM_DURATION(_bitrate) …
#define OFDM_DURATION_LIST(_s) …
#define __OFDM_GROUP(_s) …
#define OFDM_GROUP_SHIFT …
#define OFDM_GROUP …
static bool minstrel_vht_only = …;
module_param(minstrel_vht_only, bool, 0644);
MODULE_PARM_DESC(…) …;
const struct mcs_group minstrel_mcs_groups[] = …;
const s16 minstrel_cck_bitrates[4] = …;
const s16 minstrel_ofdm_bitrates[8] = …;
static u8 sample_table[SAMPLE_COLUMNS][MCS_GROUP_RATES] __read_mostly;
static const u8 minstrel_sample_seq[] = …;
static void
minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi);
static u16
minstrel_get_valid_vht_rates(int bw, int nss, __le16 mcs_map)
{ … }
static bool
minstrel_ht_is_legacy_group(int group)
{ … }
static int
minstrel_ht_get_group_idx(struct ieee80211_tx_rate *rate)
{ … }
static int
minstrel_ht_ri_get_group_idx(struct rate_info *rate)
{ … }
static int
minstrel_vht_get_group_idx(struct ieee80211_tx_rate *rate)
{ … }
static int
minstrel_vht_ri_get_group_idx(struct rate_info *rate)
{ … }
static struct minstrel_rate_stats *
minstrel_ht_get_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
struct ieee80211_tx_rate *rate)
{ … }
static struct minstrel_rate_stats *
minstrel_ht_ri_get_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
struct ieee80211_rate_status *rate_status)
{ … }
static inline struct minstrel_rate_stats *
minstrel_get_ratestats(struct minstrel_ht_sta *mi, int index)
{ … }
static inline int minstrel_get_duration(int index)
{ … }
static unsigned int
minstrel_ht_avg_ampdu_len(struct minstrel_ht_sta *mi)
{ … }
int
minstrel_ht_get_tp_avg(struct minstrel_ht_sta *mi, int group, int rate,
int prob_avg)
{ … }
static void
minstrel_ht_sort_best_tp_rates(struct minstrel_ht_sta *mi, u16 index,
u16 *tp_list)
{ … }
static void
minstrel_ht_set_best_prob_rate(struct minstrel_ht_sta *mi, u16 *dest, u16 index)
{ … }
static void
minstrel_ht_assign_best_tp_rates(struct minstrel_ht_sta *mi,
u16 tmp_mcs_tp_rate[MAX_THR_RATES],
u16 tmp_legacy_tp_rate[MAX_THR_RATES])
{ … }
static inline void
minstrel_ht_prob_rate_reduce_streams(struct minstrel_ht_sta *mi)
{ … }
static u16
__minstrel_ht_get_sample_rate(struct minstrel_ht_sta *mi,
enum minstrel_sample_type type)
{ … }
static inline int
minstrel_ewma(int old, int new, int weight)
{ … }
static inline int minstrel_filter_avg_add(u16 *prev_1, u16 *prev_2, s32 in)
{ … }
static void
minstrel_ht_calc_rate_stats(struct minstrel_priv *mp,
struct minstrel_rate_stats *mrs)
{ … }
static bool
minstrel_ht_find_sample_rate(struct minstrel_ht_sta *mi, int type, int idx)
{ … }
static int
minstrel_ht_move_sample_rates(struct minstrel_ht_sta *mi, int type,
u32 fast_rate_dur, u32 slow_rate_dur)
{ … }
static int
minstrel_ht_group_min_rate_offset(struct minstrel_ht_sta *mi, int group,
u32 max_duration)
{ … }
static u16
minstrel_ht_next_inc_rate(struct minstrel_ht_sta *mi, u32 fast_rate_dur)
{ … }
static int
minstrel_ht_next_group_sample_rate(struct minstrel_ht_sta *mi, int group,
u16 supported, int offset)
{ … }
static u16
minstrel_ht_next_jump_rate(struct minstrel_ht_sta *mi, u32 fast_rate_dur,
u32 slow_rate_dur, int *slow_rate_ofs)
{ … }
static void
minstrel_ht_refill_sample_rates(struct minstrel_ht_sta *mi)
{ … }
static void
minstrel_ht_update_stats(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
{ … }
static bool
minstrel_ht_txstat_valid(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
struct ieee80211_tx_rate *rate)
{ … }
static bool
minstrel_ht_ri_txstat_valid(struct minstrel_priv *mp,
struct minstrel_ht_sta *mi,
struct ieee80211_rate_status *rate_status)
{ … }
static void
minstrel_downgrade_rate(struct minstrel_ht_sta *mi, u16 *idx, bool primary)
{ … }
static void
minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband,
void *priv_sta, struct ieee80211_tx_status *st)
{ … }
static void
minstrel_calc_retransmit(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
int index)
{ … }
static void
minstrel_ht_set_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
struct ieee80211_sta_rates *ratetbl, int offset, int index)
{ … }
static inline int
minstrel_ht_get_prob_avg(struct minstrel_ht_sta *mi, int rate)
{ … }
static int
minstrel_ht_get_max_amsdu_len(struct minstrel_ht_sta *mi)
{ … }
static void
minstrel_ht_update_rates(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
{ … }
static u16
minstrel_ht_get_sample_rate(struct minstrel_priv *mp, struct minstrel_ht_sta *mi)
{ … }
static void
minstrel_ht_get_rate(void *priv, struct ieee80211_sta *sta, void *priv_sta,
struct ieee80211_tx_rate_control *txrc)
{ … }
static void
minstrel_ht_update_cck(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta)
{ … }
static void
minstrel_ht_update_ofdm(struct minstrel_priv *mp, struct minstrel_ht_sta *mi,
struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta)
{ … }
static void
minstrel_ht_update_caps(void *priv, struct ieee80211_supported_band *sband,
struct cfg80211_chan_def *chandef,
struct ieee80211_sta *sta, void *priv_sta)
{ … }
static void
minstrel_ht_rate_init(void *priv, struct ieee80211_supported_band *sband,
struct cfg80211_chan_def *chandef,
struct ieee80211_sta *sta, void *priv_sta)
{ … }
static void
minstrel_ht_rate_update(void *priv, struct ieee80211_supported_band *sband,
struct cfg80211_chan_def *chandef,
struct ieee80211_sta *sta, void *priv_sta,
u32 changed)
{ … }
static void *
minstrel_ht_alloc_sta(void *priv, struct ieee80211_sta *sta, gfp_t gfp)
{ … }
static void
minstrel_ht_free_sta(void *priv, struct ieee80211_sta *sta, void *priv_sta)
{ … }
static void
minstrel_ht_fill_rate_array(u8 *dest, struct ieee80211_supported_band *sband,
const s16 *bitrates, int n_rates, u32 rate_flags)
{ … }
static void
minstrel_ht_init_cck_rates(struct minstrel_priv *mp)
{ … }
static void
minstrel_ht_init_ofdm_rates(struct minstrel_priv *mp, enum nl80211_band band)
{ … }
static void *
minstrel_ht_alloc(struct ieee80211_hw *hw)
{ … }
#ifdef CONFIG_MAC80211_DEBUGFS
static void minstrel_ht_add_debugfs(struct ieee80211_hw *hw, void *priv,
struct dentry *debugfsdir)
{ … }
#endif
static void
minstrel_ht_free(void *priv)
{ … }
static u32 minstrel_ht_get_expected_throughput(void *priv_sta)
{ … }
static const struct rate_control_ops mac80211_minstrel_ht = …;
static void __init init_sample_table(void)
{ … }
int __init
rc80211_minstrel_init(void)
{ … }
void
rc80211_minstrel_exit(void)
{ … }