mac80211: make rate control ops const
authorJohannes Berg <johannes.berg@intel.com>
Mon, 20 Jan 2014 22:29:34 +0000 (23:29 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 4 Feb 2014 20:48:21 +0000 (21:48 +0100)
Change the code to allow making all the rate control ops
const, nothing ever needs to change them. Also change all
drivers to make use of this and mark the ops const.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13 files changed:
drivers/net/wireless/ath/ath9k/rc.c
drivers/net/wireless/iwlegacy/3945-rs.c
drivers/net/wireless/iwlegacy/4965-rs.c
drivers/net/wireless/iwlwifi/dvm/rs.c
drivers/net/wireless/iwlwifi/mvm/rs.c
drivers/net/wireless/rtlwifi/rc.c
include/net/mac80211.h
net/mac80211/rate.c
net/mac80211/rate.h
net/mac80211/rc80211_minstrel.c
net/mac80211/rc80211_minstrel.h
net/mac80211/rc80211_minstrel_ht.c
net/mac80211/rc80211_pid_algo.c

index d829bb62a3fc6d9e94ae867b2a675530ea4d1d7a..1219532e908afabd278360b98c0f69bfae0d97e7 100644 (file)
@@ -1466,7 +1466,7 @@ static void ath_rate_free_sta(void *priv, struct ieee80211_sta *sta,
        kfree(rate_priv);
 }
 
-static struct rate_control_ops ath_rate_ops = {
+static const struct rate_control_ops ath_rate_ops = {
        .module = NULL,
        .name = "ath9k_rate_control",
        .tx_status = ath_tx_status,
index 9a45f6f626f69633c938bd386242cdacff6496e7..7088c6a89455192e416bdb3066b474670e956635 100644 (file)
@@ -891,7 +891,7 @@ il3945_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband,
 {
 }
 
-static struct rate_control_ops rs_ops = {
+static const struct rate_control_ops rs_ops = {
        .module = NULL,
        .name = RS_NAME,
        .tx_status = il3945_rs_tx_status,
index 4d5e33259ca894d66fe2edc997b8d3ed6580467b..cdbfc1d30b982a70f3cba4c44c82608c32e40978 100644 (file)
@@ -2807,7 +2807,7 @@ il4965_rs_rate_init_stub(void *il_r, struct ieee80211_supported_band *sband,
 {
 }
 
-static struct rate_control_ops rs_4965_ops = {
+static const struct rate_control_ops rs_4965_ops = {
        .module = NULL,
        .name = IL4965_RS_NAME,
        .tx_status = il4965_rs_tx_status,
index 0977d93b529d3ce11fde93ac1e1c4ff626415a13..c4dded8d8091d9bebea154802d15b9dc8c097a86 100644 (file)
@@ -3319,7 +3319,8 @@ static void rs_rate_init_stub(void *priv_r, struct ieee80211_supported_band *sba
                              struct ieee80211_sta *sta, void *priv_sta)
 {
 }
-static struct rate_control_ops rs_ops = {
+
+static const struct rate_control_ops rs_ops = {
        .module = NULL,
        .name = RS_NAME,
        .tx_status = rs_tx_status,
index 6abf74e1351f0d97ab8a5161e4d2d81199f67c1b..22f1953880b629222e1fde314baafe0b62dff37c 100644 (file)
@@ -2815,7 +2815,8 @@ static void rs_rate_init_stub(void *mvm_r,
                              struct ieee80211_sta *sta, void *mvm_sta)
 {
 }
-static struct rate_control_ops rs_mvm_ops = {
+
+static const struct rate_control_ops rs_mvm_ops = {
        .module = NULL,
        .name = RS_NAME,
        .tx_status = rs_tx_status,
index a98acefb8c06a3802290c9130de368b8effcab83..1503d9e5bc9f04713153568ba9d4ad7bb76d1297 100644 (file)
@@ -260,7 +260,7 @@ static void rtl_rate_free_sta(void *rtlpriv,
        kfree(rate_priv);
 }
 
-static struct rate_control_ops rtl_rate_ops = {
+static const struct rate_control_ops rtl_rate_ops = {
        .module = NULL,
        .name = "rtl_rc",
        .alloc = rtl_rate_alloc,
index df1004be7ba5b1f0961af972ca49f1aaba8c5b3f..0c2676e2a1f8c123467c1a1c6d4383064bfa326b 100644 (file)
@@ -4555,8 +4555,8 @@ int rate_control_set_rates(struct ieee80211_hw *hw,
                           struct ieee80211_sta *pubsta,
                           struct ieee80211_sta_rates *rates);
 
-int ieee80211_rate_control_register(struct rate_control_ops *ops);
-void ieee80211_rate_control_unregister(struct rate_control_ops *ops);
+int ieee80211_rate_control_register(const struct rate_control_ops *ops);
+void ieee80211_rate_control_unregister(const struct rate_control_ops *ops);
 
 static inline bool
 conf_is_ht20(struct ieee80211_conf *conf)
index 22b223f13c9fa22994eba6f68769a27b2cfe4eb3..255b59e616d00937a7fdd2ee12e35f79b67cd711 100644 (file)
@@ -18,7 +18,7 @@
 
 struct rate_control_alg {
        struct list_head list;
-       struct rate_control_ops *ops;
+       const struct rate_control_ops *ops;
 };
 
 static LIST_HEAD(rate_ctrl_algs);
@@ -29,7 +29,7 @@ module_param(ieee80211_default_rc_algo, charp, 0644);
 MODULE_PARM_DESC(ieee80211_default_rc_algo,
                 "Default rate control algorithm for mac80211 to use");
 
-int ieee80211_rate_control_register(struct rate_control_ops *ops)
+int ieee80211_rate_control_register(const struct rate_control_ops *ops)
 {
        struct rate_control_alg *alg;
 
@@ -60,7 +60,7 @@ int ieee80211_rate_control_register(struct rate_control_ops *ops)
 }
 EXPORT_SYMBOL(ieee80211_rate_control_register);
 
-void ieee80211_rate_control_unregister(struct rate_control_ops *ops)
+void ieee80211_rate_control_unregister(const struct rate_control_ops *ops)
 {
        struct rate_control_alg *alg;
 
@@ -76,11 +76,11 @@ void ieee80211_rate_control_unregister(struct rate_control_ops *ops)
 }
 EXPORT_SYMBOL(ieee80211_rate_control_unregister);
 
-static struct rate_control_ops *
+static const struct rate_control_ops *
 ieee80211_try_rate_control_ops_get(const char *name)
 {
        struct rate_control_alg *alg;
-       struct rate_control_ops *ops = NULL;
+       const struct rate_control_ops *ops = NULL;
 
        if (!name)
                return NULL;
@@ -98,10 +98,10 @@ ieee80211_try_rate_control_ops_get(const char *name)
 }
 
 /* Get the rate control algorithm. */
-static struct rate_control_ops *
+static const struct rate_control_ops *
 ieee80211_rate_control_ops_get(const char *name)
 {
-       struct rate_control_ops *ops;
+       const struct rate_control_ops *ops;
        const char *alg_name;
 
        kparam_block_sysfs_write(ieee80211_default_rc_algo);
@@ -127,7 +127,7 @@ ieee80211_rate_control_ops_get(const char *name)
        return ops;
 }
 
-static void ieee80211_rate_control_ops_put(struct rate_control_ops *ops)
+static void ieee80211_rate_control_ops_put(const struct rate_control_ops *ops)
 {
        module_put(ops->module);
 }
index b95e16c070813da22169679e8c5c1aa7e3ee0f1d..9aa2a1190a86353a25deca879018b2750bdefad9 100644 (file)
@@ -21,7 +21,7 @@
 
 struct rate_control_ref {
        struct ieee80211_local *local;
-       struct rate_control_ops *ops;
+       const struct rate_control_ops *ops;
        void *priv;
 };
 
index f3d88b0c054c219fde20b907195c3bdb5a481c97..26fd94fa0aedb86e43382781f791b1f36de44954 100644 (file)
@@ -657,7 +657,7 @@ minstrel_free(void *priv)
        kfree(priv);
 }
 
-struct rate_control_ops mac80211_minstrel = {
+const struct rate_control_ops mac80211_minstrel = {
        .name = "minstrel",
        .tx_status = minstrel_tx_status,
        .get_rate = minstrel_get_rate,
index f4301f4b2e418f1e325ccd78c4c2a6986303ca36..046d1bd598a86d114c5c4dd6a7c7edb75808af13 100644 (file)
@@ -123,7 +123,7 @@ struct minstrel_debugfs_info {
        char buf[];
 };
 
-extern struct rate_control_ops mac80211_minstrel;
+extern const struct rate_control_ops mac80211_minstrel;
 void minstrel_add_sta_debugfs(void *priv, void *priv_sta, struct dentry *dir);
 void minstrel_remove_sta_debugfs(void *priv, void *priv_sta);
 
index c1b5b73c5b91353597eb1dfcf7a0f70946c72562..a6d6cc5c3db4d4ab89d5e63388399c9343f94cb2 100644 (file)
@@ -1031,7 +1031,7 @@ minstrel_ht_free(void *priv)
        mac80211_minstrel.free(priv);
 }
 
-static struct rate_control_ops mac80211_minstrel_ht = {
+static const struct rate_control_ops mac80211_minstrel_ht = {
        .name = "minstrel_ht",
        .tx_status = minstrel_ht_tx_status,
        .get_rate = minstrel_ht_get_rate,
index 958fad07b54cf64856e3600bd6299f4ca9abd72a..d0da2a70fe6899e7cf4f9733225d3846186f1780 100644 (file)
@@ -452,7 +452,7 @@ static void rate_control_pid_free_sta(void *priv, struct ieee80211_sta *sta,
        kfree(priv_sta);
 }
 
-static struct rate_control_ops mac80211_rcpid = {
+static const struct rate_control_ops mac80211_rcpid = {
        .name = "pid",
        .tx_status = rate_control_pid_tx_status,
        .get_rate = rate_control_pid_get_rate,
This page took 0.038029 seconds and 5 git commands to generate.