linux/drivers/net/wireless/intel/iwlegacy/3945-rs.c

// SPDX-License-Identifier: GPL-2.0-only
/******************************************************************************
 *
 * Copyright(c) 2005 - 2011 Intel Corporation. All rights reserved.
 *
 * Contact Information:
 *  Intel Linux Wireless <[email protected]>
 * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
 *
 *****************************************************************************/

#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 "commands.h"
#include "3945.h"

#define RS_NAME

static s32 il3945_expected_tpt_g[RATE_COUNT_3945] =;

static s32 il3945_expected_tpt_g_prot[RATE_COUNT_3945] =;

static s32 il3945_expected_tpt_a[RATE_COUNT_3945] =;

static s32 il3945_expected_tpt_b[RATE_COUNT_3945] =;

struct il3945_tpt_entry {};

static struct il3945_tpt_entry il3945_tpt_table_a[] =;

static struct il3945_tpt_entry il3945_tpt_table_g[] =;

#define RATE_MAX_WINDOW
#define RATE_FLUSH
#define RATE_WIN_FLUSH
#define IL39_RATE_HIGH_TH
#define IL_SUCCESS_UP_TH
#define IL_SUCCESS_DOWN_TH
#define RATE_MIN_FAILURE_TH
#define RATE_MIN_SUCCESS_TH
#define RATE_DECREASE_TH
#define RATE_RETRY_TH

static u8
il3945_get_rate_idx_by_rssi(s32 rssi, enum nl80211_band band)
{}

static void
il3945_clear_win(struct il3945_rate_scale_data *win)
{}

/*
 * il3945_rate_scale_flush_wins - flush out the rate scale wins
 *
 * Returns the number of wins that have gathered data but were
 * not flushed.  If there were any that were not flushed, then
 * reschedule the rate flushing routine.
 */
static int
il3945_rate_scale_flush_wins(struct il3945_rs_sta *rs_sta)
{}

#define RATE_FLUSH_MAX
#define RATE_FLUSH_MIN
#define IL_AVERAGE_PACKETS

static void
il3945_bg_rate_scale_flush(struct timer_list *t)
{}

/*
 * il3945_collect_tx_data - Update the success/failure sliding win
 *
 * We keep a sliding win of the last 64 packets transmitted
 * at this rate.  win->data contains the bitmask of successful
 * packets.
 */
static void
il3945_collect_tx_data(struct il3945_rs_sta *rs_sta,
		       struct il3945_rate_scale_data *win, int success,
		       int retries, int idx)
{}

/*
 * Called after adding a new station to initialize rate scaling
 */
void
il3945_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
{}

static void *
il3945_rs_alloc(struct ieee80211_hw *hw)
{}

/* rate scale requires free function to be implemented */
static void
il3945_rs_free(void *il)
{}

static void *
il3945_rs_alloc_sta(void *il_priv, struct ieee80211_sta *sta, gfp_t gfp)
{}

static void
il3945_rs_free_sta(void *il_priv, struct ieee80211_sta *sta, void *il_sta)
{}

/*
 * il3945_rs_tx_status - Update rate control values based on Tx results
 *
 * NOTE: Uses il_priv->retry_rate for the # of retries attempted by
 * the hardware for each rate.
 */
static void
il3945_rs_tx_status(void *il_rate, struct ieee80211_supported_band *sband,
		    struct ieee80211_sta *sta, void *il_sta,
		    struct sk_buff *skb)
{}

static u16
il3945_get_adjacent_rate(struct il3945_rs_sta *rs_sta, u8 idx, u16 rate_mask,
			 enum nl80211_band band)
{}

/*
 * il3945_rs_get_rate - find the rate for the requested packet
 *
 * Returns the ieee80211_rate structure allocated by the driver.
 *
 * The rate control algorithm has no internal mapping between hw_mode's
 * rate ordering and the rate ordering used by the rate control algorithm.
 *
 * The rate control algorithm uses a single table of rates that goes across
 * the entire A/B/G spectrum vs. being limited to just one particular
 * hw_mode.
 *
 * As such, we can't convert the idx obtained below into the hw_mode's
 * rate table and must reference the driver allocated rate table
 *
 */
static void
il3945_rs_get_rate(void *il_r, struct ieee80211_sta *sta, void *il_sta,
		   struct ieee80211_tx_rate_control *txrc)
{}

#ifdef CONFIG_MAC80211_DEBUGFS

static ssize_t
il3945_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 void
il3945_add_debugfs(void *il, void *il_sta, struct dentry *dir)
{}
#endif

/*
 * Initialization of rate scaling information is done by driver after
 * the station is added. Since mac80211 calls this function before a
 * station is added we ignore it.
 */
static void
il3945_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_ops =;

void
il3945_rate_scale_init(struct ieee80211_hw *hw, s32 sta_id)
{}

int
il3945_rate_control_register(void)
{}

void
il3945_rate_control_unregister(void)
{}