summaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-07-22 12:45:03 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-07-22 12:45:03 +0000
commit9384cc59512c6974908289b67c3321d40ee4f19b (patch)
tree2efda9ebe3be4fa220e11d6c8c2b26299a3f00c8 /package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch
parent3b17e2ab6853f78989b7cea4a2cf412938881ac2 (diff)
downloadmaster-31e0f0ae-9384cc59512c6974908289b67c3321d40ee4f19b.tar.gz
master-31e0f0ae-9384cc59512c6974908289b67c3321d40ee4f19b.tar.bz2
master-31e0f0ae-9384cc59512c6974908289b67c3321d40ee4f19b.zip
mac80211: update to wireless-testing 2015-07-21
Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 46436
Diffstat (limited to 'package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch')
-rw-r--r--package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch161
1 files changed, 161 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch b/package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch
new file mode 100644
index 0000000000..928c93b207
--- /dev/null
+++ b/package/kernel/mac80211/patches/306-mac80211-Deinline-rate_control_rate_init-rate_contro.patch
@@ -0,0 +1,161 @@
+From: Denys Vlasenko <dvlasenk@redhat.com>
+Date: Wed, 15 Jul 2015 14:56:06 +0200
+Subject: [PATCH] mac80211: Deinline rate_control_rate_init,
+ rate_control_rate_update
+
+With this .config: http://busybox.net/~vda/kernel_config,
+after deinlining these functions have sizes and callsite counts
+as follows:
+
+rate_control_rate_init: 554 bytes, 8 calls
+rate_control_rate_update: 1596 bytes, 5 calls
+
+Total size reduction: about 11 kbytes.
+
+Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
+CC: John Linville <linville@tuxdriver.com>
+CC: Michal Kazior <michal.kazior@tieto.com>
+CC: Johannes Berg <johannes.berg@intel.com>
+Cc: linux-wireless@vger.kernel.org
+Cc: netdev@vger.kernel.org
+CC: linux-kernel@vger.kernel.org
+---
+
+--- a/net/mac80211/rate.c
++++ b/net/mac80211/rate.c
+@@ -29,6 +29,65 @@ module_param(ieee80211_default_rc_algo,
+ MODULE_PARM_DESC(ieee80211_default_rc_algo,
+ "Default rate control algorithm for mac80211 to use");
+
++void rate_control_rate_init(struct sta_info *sta)
++{
++ struct ieee80211_local *local = sta->sdata->local;
++ struct rate_control_ref *ref = sta->rate_ctrl;
++ struct ieee80211_sta *ista = &sta->sta;
++ void *priv_sta = sta->rate_ctrl_priv;
++ struct ieee80211_supported_band *sband;
++ struct ieee80211_chanctx_conf *chanctx_conf;
++
++ ieee80211_sta_set_rx_nss(sta);
++
++ if (!ref)
++ return;
++
++ rcu_read_lock();
++
++ chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf);
++ if (WARN_ON(!chanctx_conf)) {
++ rcu_read_unlock();
++ return;
++ }
++
++ sband = local->hw.wiphy->bands[chanctx_conf->def.chan->band];
++
++ spin_lock_bh(&sta->rate_ctrl_lock);
++ ref->ops->rate_init(ref->priv, sband, &chanctx_conf->def, ista,
++ priv_sta);
++ spin_unlock_bh(&sta->rate_ctrl_lock);
++ rcu_read_unlock();
++ set_sta_flag(sta, WLAN_STA_RATE_CONTROL);
++}
++
++void rate_control_rate_update(struct ieee80211_local *local,
++ struct ieee80211_supported_band *sband,
++ struct sta_info *sta, u32 changed)
++{
++ struct rate_control_ref *ref = local->rate_ctrl;
++ struct ieee80211_sta *ista = &sta->sta;
++ void *priv_sta = sta->rate_ctrl_priv;
++ struct ieee80211_chanctx_conf *chanctx_conf;
++
++ if (ref && ref->ops->rate_update) {
++ rcu_read_lock();
++
++ chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf);
++ if (WARN_ON(!chanctx_conf)) {
++ rcu_read_unlock();
++ return;
++ }
++
++ spin_lock_bh(&sta->rate_ctrl_lock);
++ ref->ops->rate_update(ref->priv, sband, &chanctx_conf->def,
++ ista, priv_sta, changed);
++ spin_unlock_bh(&sta->rate_ctrl_lock);
++ rcu_read_unlock();
++ }
++ drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
++}
++
+ int ieee80211_rate_control_register(const struct rate_control_ops *ops)
+ {
+ struct rate_control_alg *alg;
+--- a/net/mac80211/rate.h
++++ b/net/mac80211/rate.h
+@@ -71,64 +71,10 @@ rate_control_tx_status_noskb(struct ieee
+ spin_unlock_bh(&sta->rate_ctrl_lock);
+ }
+
+-static inline void rate_control_rate_init(struct sta_info *sta)
+-{
+- struct ieee80211_local *local = sta->sdata->local;
+- struct rate_control_ref *ref = sta->rate_ctrl;
+- struct ieee80211_sta *ista = &sta->sta;
+- void *priv_sta = sta->rate_ctrl_priv;
+- struct ieee80211_supported_band *sband;
+- struct ieee80211_chanctx_conf *chanctx_conf;
+-
+- ieee80211_sta_set_rx_nss(sta);
+-
+- if (!ref)
+- return;
+-
+- rcu_read_lock();
+-
+- chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf);
+- if (WARN_ON(!chanctx_conf)) {
+- rcu_read_unlock();
+- return;
+- }
+-
+- sband = local->hw.wiphy->bands[chanctx_conf->def.chan->band];
+-
+- spin_lock_bh(&sta->rate_ctrl_lock);
+- ref->ops->rate_init(ref->priv, sband, &chanctx_conf->def, ista,
+- priv_sta);
+- spin_unlock_bh(&sta->rate_ctrl_lock);
+- rcu_read_unlock();
+- set_sta_flag(sta, WLAN_STA_RATE_CONTROL);
+-}
+-
+-static inline void rate_control_rate_update(struct ieee80211_local *local,
++void rate_control_rate_init(struct sta_info *sta);
++void rate_control_rate_update(struct ieee80211_local *local,
+ struct ieee80211_supported_band *sband,
+- struct sta_info *sta, u32 changed)
+-{
+- struct rate_control_ref *ref = local->rate_ctrl;
+- struct ieee80211_sta *ista = &sta->sta;
+- void *priv_sta = sta->rate_ctrl_priv;
+- struct ieee80211_chanctx_conf *chanctx_conf;
+-
+- if (ref && ref->ops->rate_update) {
+- rcu_read_lock();
+-
+- chanctx_conf = rcu_dereference(sta->sdata->vif.chanctx_conf);
+- if (WARN_ON(!chanctx_conf)) {
+- rcu_read_unlock();
+- return;
+- }
+-
+- spin_lock_bh(&sta->rate_ctrl_lock);
+- ref->ops->rate_update(ref->priv, sband, &chanctx_conf->def,
+- ista, priv_sta, changed);
+- spin_unlock_bh(&sta->rate_ctrl_lock);
+- rcu_read_unlock();
+- }
+- drv_sta_rc_update(local, sta->sdata, &sta->sta, changed);
+-}
++ struct sta_info *sta, u32 changed);
+
+ static inline void *rate_control_alloc_sta(struct rate_control_ref *ref,
+ struct sta_info *sta, gfp_t gfp)