[PATCH] mac80211: kill rate control ioctls

These aren't used anywhere (hostapd, wpa_supplicant) and until we
have a proper interface to the rate control algorithms they don't
make much sense either since e.g. rc80211_lowest won't honour them.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Jiri Benc <jbenc@suse.cz>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Johannes Berg 2007-07-10 19:32:09 +02:00 committed by John W. Linville
parent 40f7cac9f8
commit 3ef8bed469
5 changed files with 6 additions and 90 deletions

View File

@ -40,10 +40,6 @@ enum {
PRISM2_PARAM_ANTENNA_MODE = 1013,
PRISM2_PARAM_STAT_TIME = 1016,
PRISM2_PARAM_STA_ANTENNA_SEL = 1017,
PRISM2_PARAM_FORCE_UNICAST_RATE = 1018,
PRISM2_PARAM_RATE_CTRL_NUM_UP = 1019,
PRISM2_PARAM_RATE_CTRL_NUM_DOWN = 1020,
PRISM2_PARAM_MAX_RATECTRL_RATE = 1021,
PRISM2_PARAM_TX_POWER_REDUCTION = 1022,
PRISM2_PARAM_KEY_TX_RX_THRESHOLD = 1024,
PRISM2_PARAM_DEFAULT_WEP_ONLY = 1026,

View File

@ -4924,8 +4924,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
local->short_retry_limit = 7;
local->long_retry_limit = 4;
local->hw.conf.radio_enabled = 1;
local->rate_ctrl_num_up = RATE_CONTROL_NUM_UP;
local->rate_ctrl_num_down = RATE_CONTROL_NUM_DOWN;
local->enabled_modes = (unsigned int) -1;

View File

@ -514,8 +514,6 @@ struct ieee80211_local {
STA_ANTENNA_SEL_SW_CTRL_DEBUG = 2
} sta_antenna_sel;
int rate_ctrl_num_up, rate_ctrl_num_down;
#ifdef CONFIG_MAC80211_DEBUG_COUNTERS
/* TX/RX handler statistics */
unsigned int tx_handlers_drop;

View File

@ -1074,62 +1074,6 @@ static int ieee80211_ioctl_clear_keys(struct net_device *dev)
}
static int
ieee80211_ioctl_force_unicast_rate(struct net_device *dev,
struct ieee80211_sub_if_data *sdata,
int rate)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_hw_mode *mode;
int i;
if (sdata->type != IEEE80211_IF_TYPE_AP)
return -ENOENT;
if (rate == 0) {
sdata->u.ap.force_unicast_rateidx = -1;
return 0;
}
mode = local->oper_hw_mode;
for (i = 0; i < mode->num_rates; i++) {
if (mode->rates[i].rate == rate) {
sdata->u.ap.force_unicast_rateidx = i;
return 0;
}
}
return -EINVAL;
}
static int
ieee80211_ioctl_max_ratectrl_rate(struct net_device *dev,
struct ieee80211_sub_if_data *sdata,
int rate)
{
struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
struct ieee80211_hw_mode *mode;
int i;
if (sdata->type != IEEE80211_IF_TYPE_AP)
return -ENOENT;
if (rate == 0) {
sdata->u.ap.max_ratectrl_rateidx = -1;
return 0;
}
mode = local->oper_hw_mode;
for (i = 0; i < mode->num_rates; i++) {
if (mode->rates[i].rate == rate) {
sdata->u.ap.max_ratectrl_rateidx = i;
return 0;
}
}
return -EINVAL;
}
static void ieee80211_key_enable_hwaccel(struct ieee80211_local *local,
struct ieee80211_key *key)
{
@ -1317,22 +1261,6 @@ static int ieee80211_ioctl_prism2_param(struct net_device *dev,
local->sta_antenna_sel = value;
break;
case PRISM2_PARAM_FORCE_UNICAST_RATE:
ret = ieee80211_ioctl_force_unicast_rate(dev, sdata, value);
break;
case PRISM2_PARAM_MAX_RATECTRL_RATE:
ret = ieee80211_ioctl_max_ratectrl_rate(dev, sdata, value);
break;
case PRISM2_PARAM_RATE_CTRL_NUM_UP:
local->rate_ctrl_num_up = value;
break;
case PRISM2_PARAM_RATE_CTRL_NUM_DOWN:
local->rate_ctrl_num_down = value;
break;
case PRISM2_PARAM_TX_POWER_REDUCTION:
if (value < 0)
ret = -EINVAL;
@ -1451,14 +1379,6 @@ static int ieee80211_ioctl_get_prism2_param(struct net_device *dev,
*param = local->sta_antenna_sel;
break;
case PRISM2_PARAM_RATE_CTRL_NUM_UP:
*param = local->rate_ctrl_num_up;
break;
case PRISM2_PARAM_RATE_CTRL_NUM_DOWN:
*param = local->rate_ctrl_num_down;
break;
case PRISM2_PARAM_TX_POWER_REDUCTION:
*param = local->hw.conf.tx_power_reduction;
break;

View File

@ -187,9 +187,13 @@ static void rate_control_simple_tx_status(void *priv, struct net_device *dev,
}
#endif
if (per_failed > local->rate_ctrl_num_down) {
/*
* XXX: Make these configurable once we have an
* interface to the rate control algorithms
*/
if (per_failed > RATE_CONTROL_NUM_DOWN) {
rate_control_rate_dec(local, sta);
} else if (per_failed < local->rate_ctrl_num_up) {
} else if (per_failed < RATE_CONTROL_NUM_UP) {
rate_control_rate_inc(local, sta);
}
srctrl->tx_avg_rate_sum += status->control.rate->rate;