#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/slab.h>
#include <net/mac80211.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include "common.h"
#include "4965.h"
#define IL4965_RS_NAME …
#define NUM_TRY_BEFORE_ANT_TOGGLE …
#define IL_NUMBER_TRY …
#define IL_HT_NUMBER_TRY …
#define RATE_MAX_WINDOW …
#define RATE_MIN_FAILURE_TH …
#define RATE_MIN_SUCCESS_TH …
#define IL_MISSED_RATE_MAX …
#define RATE_SCALE_FLUSH_INTVL …
static u8 rs_ht_to_legacy[] = …;
static const u8 ant_toggle_lookup[] = …;
#define IL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) …
const struct il_rate_info il_rates[RATE_COUNT] = …;
static int
il4965_hwrate_to_plcp_idx(u32 rate_n_flags)
{ … }
static void il4965_rs_rate_scale_perform(struct il_priv *il,
struct sk_buff *skb,
struct ieee80211_sta *sta,
struct il_lq_sta *lq_sta);
static void il4965_rs_fill_link_cmd(struct il_priv *il,
struct il_lq_sta *lq_sta, u32 rate_n_flags);
static void il4965_rs_stay_in_table(struct il_lq_sta *lq_sta,
bool force_search);
#ifdef CONFIG_MAC80211_DEBUGFS
static void il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta,
u32 *rate_n_flags, int idx);
#else
static void
il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx)
{
}
#endif
static s32 expected_tpt_legacy[RATE_COUNT] = …;
static s32 expected_tpt_siso20MHz[4][RATE_COUNT] = …;
static s32 expected_tpt_siso40MHz[4][RATE_COUNT] = …;
static s32 expected_tpt_mimo2_20MHz[4][RATE_COUNT] = …;
static s32 expected_tpt_mimo2_40MHz[4][RATE_COUNT] = …;
static const struct il_rate_mcs_info il_rate_mcs[RATE_COUNT] = …;
#define MCS_IDX_PER_STREAM …
static inline u8
il4965_rs_extract_rate(u32 rate_n_flags)
{ … }
static void
il4965_rs_rate_scale_clear_win(struct il_rate_scale_data *win)
{ … }
static inline u8
il4965_rs_is_valid_ant(u8 valid_antenna, u8 ant_type)
{ … }
static void
il4965_rs_tl_rm_old_stats(struct il_traffic_load *tl, u32 curr_time)
{ … }
static u8
il4965_rs_tl_add_packet(struct il_lq_sta *lq_data, struct ieee80211_hdr *hdr)
{ … }
static u32
il4965_rs_tl_get_load(struct il_lq_sta *lq_data, u8 tid)
{ … }
static int
il4965_rs_tl_turn_on_agg_for_tid(struct il_priv *il, struct il_lq_sta *lq_data,
u8 tid, struct ieee80211_sta *sta)
{ … }
static void
il4965_rs_tl_turn_on_agg(struct il_priv *il, u8 tid, struct il_lq_sta *lq_data,
struct ieee80211_sta *sta)
{ … }
static inline int
il4965_get_il4965_num_of_ant_from_rate(u32 rate_n_flags)
{ … }
static s32
il4965_get_expected_tpt(struct il_scale_tbl_info *tbl, int rs_idx)
{ … }
static int
il4965_rs_collect_tx_data(struct il_scale_tbl_info *tbl, int scale_idx,
int attempts, int successes)
{ … }
static u32
il4965_rate_n_flags_from_tbl(struct il_priv *il, struct il_scale_tbl_info *tbl,
int idx, u8 use_green)
{ … }
static int
il4965_rs_get_tbl_info_from_mcs(const u32 rate_n_flags,
enum nl80211_band band,
struct il_scale_tbl_info *tbl, int *rate_idx)
{ … }
static int
il4965_rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags,
struct il_scale_tbl_info *tbl)
{ … }
static bool
il4965_rs_use_green(struct il_priv *il, struct ieee80211_sta *sta)
{ … }
static u16
il4965_rs_get_supported_rates(struct il_lq_sta *lq_sta,
struct ieee80211_hdr *hdr,
enum il_table_type rate_type)
{ … }
static u16
il4965_rs_get_adjacent_rate(struct il_priv *il, u8 idx, u16 rate_mask,
int rate_type)
{ … }
static u32
il4965_rs_get_lower_rate(struct il_lq_sta *lq_sta,
struct il_scale_tbl_info *tbl, u8 scale_idx,
u8 ht_possible)
{ … }
static bool
il4965_table_type_matches(struct il_scale_tbl_info *a,
struct il_scale_tbl_info *b)
{ … }
static void
il4965_rs_tx_status(void *il_r, struct ieee80211_supported_band *sband,
struct ieee80211_sta *sta, void *il_sta,
struct sk_buff *skb)
{ … }
static void
il4965_rs_set_stay_in_table(struct il_priv *il, u8 is_legacy,
struct il_lq_sta *lq_sta)
{ … }
static void
il4965_rs_set_expected_tpt_table(struct il_lq_sta *lq_sta,
struct il_scale_tbl_info *tbl)
{ … }
static s32
il4965_rs_get_best_rate(struct il_priv *il, struct il_lq_sta *lq_sta,
struct il_scale_tbl_info *tbl,
u16 rate_mask, s8 idx)
{ … }
static int
il4965_rs_switch_to_mimo2(struct il_priv *il, struct il_lq_sta *lq_sta,
struct ieee80211_conf *conf,
struct ieee80211_sta *sta,
struct il_scale_tbl_info *tbl, int idx)
{ … }
static int
il4965_rs_switch_to_siso(struct il_priv *il, struct il_lq_sta *lq_sta,
struct ieee80211_conf *conf, struct ieee80211_sta *sta,
struct il_scale_tbl_info *tbl, int idx)
{ … }
static int
il4965_rs_move_legacy_other(struct il_priv *il, struct il_lq_sta *lq_sta,
struct ieee80211_conf *conf,
struct ieee80211_sta *sta, int idx)
{ … }
static int
il4965_rs_move_siso_to_other(struct il_priv *il, struct il_lq_sta *lq_sta,
struct ieee80211_conf *conf,
struct ieee80211_sta *sta, int idx)
{ … }
static int
il4965_rs_move_mimo2_to_other(struct il_priv *il, struct il_lq_sta *lq_sta,
struct ieee80211_conf *conf,
struct ieee80211_sta *sta, int idx)
{ … }
static void
il4965_rs_stay_in_table(struct il_lq_sta *lq_sta, bool force_search)
{ … }
static void
il4965_rs_update_rate_tbl(struct il_priv *il, struct il_lq_sta *lq_sta,
struct il_scale_tbl_info *tbl, int idx, u8 is_green)
{ … }
static void
il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb,
struct ieee80211_sta *sta,
struct il_lq_sta *lq_sta)
{ … }
static void
il4965_rs_initialize_lq(struct il_priv *il, struct ieee80211_conf *conf,
struct ieee80211_sta *sta, struct il_lq_sta *lq_sta)
{ … }
static void
il4965_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
struct ieee80211_tx_rate_control *txrc)
{ … }
static void *
il4965_rs_alloc_sta(void *il_rate, struct ieee80211_sta *sta, gfp_t gfp)
{ … }
void
il4965_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
{ … }
static void
il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta,
u32 new_rate)
{ … }
static void *
il4965_rs_alloc(struct ieee80211_hw *hw)
{ … }
static void
il4965_rs_free(void *il_rate)
{ … }
static void
il4965_rs_free_sta(void *il_r, struct ieee80211_sta *sta, void *il_sta)
{ … }
#ifdef CONFIG_MAC80211_DEBUGFS
static void
il4965_rs_dbgfs_set_mcs(struct il_lq_sta *lq_sta, u32 * rate_n_flags, int idx)
{ … }
static ssize_t
il4965_rs_sta_dbgfs_scale_table_write(struct file *file,
const char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static ssize_t
il4965_rs_sta_dbgfs_scale_table_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations rs_sta_dbgfs_scale_table_ops = …;
static ssize_t
il4965_rs_sta_dbgfs_stats_table_read(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{ … }
static const struct file_operations rs_sta_dbgfs_stats_table_ops = …;
static ssize_t
il4965_rs_sta_dbgfs_rate_scale_data_read(struct file *file,
char __user *user_buf, size_t count,
loff_t *ppos)
{ … }
static const struct file_operations rs_sta_dbgfs_rate_scale_data_ops = …;
static void
il4965_rs_add_debugfs(void *il, void *il_sta, struct dentry *dir)
{ … }
#endif
static void
il4965_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband,
struct cfg80211_chan_def *chandef,
struct ieee80211_sta *sta, void *il_sta)
{ … }
static const struct rate_control_ops rs_4965_ops = …;
int
il4965_rate_control_register(void)
{ … }
void
il4965_rate_control_unregister(void)
{ … }