Commit cc01f9b5 authored by Johannes Berg's avatar Johannes Berg

mac80211: remove module handling from rate control ops

There's not a single rate control algorithm actually in
a separate module where the module refcount would be
required. Similarly, there's no specific rate control
module.

Therefore, all the module handling code in rate control
is really just dead code, so remove it.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent f6e1a73b
...@@ -1467,7 +1467,6 @@ static void ath_rate_free_sta(void *priv, struct ieee80211_sta *sta, ...@@ -1467,7 +1467,6 @@ static void ath_rate_free_sta(void *priv, struct ieee80211_sta *sta,
} }
static const struct rate_control_ops ath_rate_ops = { static const struct rate_control_ops ath_rate_ops = {
.module = NULL,
.name = "ath9k_rate_control", .name = "ath9k_rate_control",
.tx_status = ath_tx_status, .tx_status = ath_tx_status,
.get_rate = ath_get_rate, .get_rate = ath_get_rate,
......
...@@ -892,7 +892,6 @@ il3945_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband, ...@@ -892,7 +892,6 @@ il3945_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband,
} }
static const struct rate_control_ops rs_ops = { static const struct rate_control_ops rs_ops = {
.module = NULL,
.name = RS_NAME, .name = RS_NAME,
.tx_status = il3945_rs_tx_status, .tx_status = il3945_rs_tx_status,
.get_rate = il3945_rs_get_rate, .get_rate = il3945_rs_get_rate,
......
...@@ -2808,7 +2808,6 @@ il4965_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband, ...@@ -2808,7 +2808,6 @@ il4965_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband,
} }
static const struct rate_control_ops rs_4965_ops = { static const struct rate_control_ops rs_4965_ops = {
.module = NULL,
.name = IL4965_RS_NAME, .name = IL4965_RS_NAME,
.tx_status = il4965_rs_tx_status, .tx_status = il4965_rs_tx_status,
.get_rate = il4965_rs_get_rate, .get_rate = il4965_rs_get_rate,
......
...@@ -3321,7 +3321,6 @@ static void rs_rate_init_stub(void *priv_r, struct ieee80211_supported_band *sba ...@@ -3321,7 +3321,6 @@ static void rs_rate_init_stub(void *priv_r, struct ieee80211_supported_band *sba
} }
static const struct rate_control_ops rs_ops = { static const struct rate_control_ops rs_ops = {
.module = NULL,
.name = RS_NAME, .name = RS_NAME,
.tx_status = rs_tx_status, .tx_status = rs_tx_status,
.get_rate = rs_get_rate, .get_rate = rs_get_rate,
......
...@@ -2817,7 +2817,6 @@ static void rs_rate_init_stub(void *mvm_r, ...@@ -2817,7 +2817,6 @@ static void rs_rate_init_stub(void *mvm_r,
} }
static const struct rate_control_ops rs_mvm_ops = { static const struct rate_control_ops rs_mvm_ops = {
.module = NULL,
.name = RS_NAME, .name = RS_NAME,
.tx_status = rs_tx_status, .tx_status = rs_tx_status,
.get_rate = rs_get_rate, .get_rate = rs_get_rate,
......
...@@ -261,7 +261,6 @@ static void rtl_rate_free_sta(void *rtlpriv, ...@@ -261,7 +261,6 @@ static void rtl_rate_free_sta(void *rtlpriv,
} }
static const struct rate_control_ops rtl_rate_ops = { static const struct rate_control_ops rtl_rate_ops = {
.module = NULL,
.name = "rtl_rc", .name = "rtl_rc",
.alloc = rtl_rate_alloc, .alloc = rtl_rate_alloc,
.free = rtl_rate_free, .free = rtl_rate_free,
......
...@@ -4453,7 +4453,6 @@ struct ieee80211_tx_rate_control { ...@@ -4453,7 +4453,6 @@ struct ieee80211_tx_rate_control {
}; };
struct rate_control_ops { struct rate_control_ops {
struct module *module;
const char *name; const char *name;
void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir);
void (*free)(void *priv); void (*free)(void *priv);
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/rtnetlink.h> #include <linux/rtnetlink.h>
#include <linux/slab.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h>
#include "rate.h" #include "rate.h"
#include "ieee80211_i.h" #include "ieee80211_i.h"
#include "debugfs.h" #include "debugfs.h"
...@@ -87,8 +87,7 @@ ieee80211_try_rate_control_ops_get(const char *name) ...@@ -87,8 +87,7 @@ ieee80211_try_rate_control_ops_get(const char *name)
mutex_lock(&rate_ctrl_mutex); mutex_lock(&rate_ctrl_mutex);
list_for_each_entry(alg, &rate_ctrl_algs, list) { list_for_each_entry(alg, &rate_ctrl_algs, list) {
if (!strcmp(alg->ops->name, name)) if (!strcmp(alg->ops->name, name)) {
if (try_module_get(alg->ops->module)) {
ops = alg->ops; ops = alg->ops;
break; break;
} }
...@@ -111,10 +110,6 @@ ieee80211_rate_control_ops_get(const char *name) ...@@ -111,10 +110,6 @@ ieee80211_rate_control_ops_get(const char *name)
alg_name = name; alg_name = name;
ops = ieee80211_try_rate_control_ops_get(alg_name); ops = ieee80211_try_rate_control_ops_get(alg_name);
if (!ops) {
request_module("rc80211_%s", alg_name);
ops = ieee80211_try_rate_control_ops_get(alg_name);
}
if (!ops && name) if (!ops && name)
/* try default if specific alg requested but not found */ /* try default if specific alg requested but not found */
ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo); ops = ieee80211_try_rate_control_ops_get(ieee80211_default_rc_algo);
...@@ -127,11 +122,6 @@ ieee80211_rate_control_ops_get(const char *name) ...@@ -127,11 +122,6 @@ ieee80211_rate_control_ops_get(const char *name)
return ops; return ops;
} }
static void ieee80211_rate_control_ops_put(const struct rate_control_ops *ops)
{
module_put(ops->module);
}
#ifdef CONFIG_MAC80211_DEBUGFS #ifdef CONFIG_MAC80211_DEBUGFS
static ssize_t rcname_read(struct file *file, char __user *userbuf, static ssize_t rcname_read(struct file *file, char __user *userbuf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
...@@ -158,11 +148,11 @@ static struct rate_control_ref *rate_control_alloc(const char *name, ...@@ -158,11 +148,11 @@ static struct rate_control_ref *rate_control_alloc(const char *name,
ref = kmalloc(sizeof(struct rate_control_ref), GFP_KERNEL); ref = kmalloc(sizeof(struct rate_control_ref), GFP_KERNEL);
if (!ref) if (!ref)
goto fail_ref; return NULL;
ref->local = local; ref->local = local;
ref->ops = ieee80211_rate_control_ops_get(name); ref->ops = ieee80211_rate_control_ops_get(name);
if (!ref->ops) if (!ref->ops)
goto fail_ops; goto free;
#ifdef CONFIG_MAC80211_DEBUGFS #ifdef CONFIG_MAC80211_DEBUGFS
debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir); debugfsdir = debugfs_create_dir("rc", local->hw.wiphy->debugfsdir);
...@@ -172,14 +162,11 @@ static struct rate_control_ref *rate_control_alloc(const char *name, ...@@ -172,14 +162,11 @@ static struct rate_control_ref *rate_control_alloc(const char *name,
ref->priv = ref->ops->alloc(&local->hw, debugfsdir); ref->priv = ref->ops->alloc(&local->hw, debugfsdir);
if (!ref->priv) if (!ref->priv)
goto fail_priv; goto free;
return ref; return ref;
fail_priv: free:
ieee80211_rate_control_ops_put(ref->ops);
fail_ops:
kfree(ref); kfree(ref);
fail_ref:
return NULL; return NULL;
} }
...@@ -192,7 +179,6 @@ static void rate_control_free(struct rate_control_ref *ctrl_ref) ...@@ -192,7 +179,6 @@ static void rate_control_free(struct rate_control_ref *ctrl_ref)
ctrl_ref->local->debugfs.rcdir = NULL; ctrl_ref->local->debugfs.rcdir = NULL;
#endif #endif
ieee80211_rate_control_ops_put(ctrl_ref->ops);
kfree(ctrl_ref); kfree(ctrl_ref);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment