diff options
author | Johannes Berg <johannes.berg@intel.com> | 2011-09-29 10:04:36 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-09-30 15:57:19 -0400 |
commit | c2c98fdeb5c897499644eb247285c8e3dacc6450 (patch) | |
tree | aaa9c0f8dd16ab896308470e21a0813041094670 /net/mac80211/mesh_plink.c | |
parent | deeaee197b0fa694ba6c8f02cdb57b3be7115b4f (diff) |
mac80211: optimise station flags
The flaglock in struct sta_info has long been
something that I wanted to get rid of, this
finally does the conversion to atomic bitops.
The conversion itself is straight-forward in
most places, a few things needed to change a
bit since we can no longer use multiple bits
at the same time.
On x86-64, this is a fairly significant code
size reduction:
text data bss dec hex
427861 23648 1008 452517 6e7a5 before
425383 23648 976 450007 6ddd7 after
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh_plink.c')
-rw-r--r-- | net/mac80211/mesh_plink.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c index 9cc5029b3c46..7e57f5d07f66 100644 --- a/net/mac80211/mesh_plink.c +++ b/net/mac80211/mesh_plink.c | |||
@@ -92,7 +92,9 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata, | |||
92 | if (!sta) | 92 | if (!sta) |
93 | return NULL; | 93 | return NULL; |
94 | 94 | ||
95 | sta->flags = WLAN_STA_AUTHORIZED | WLAN_STA_AUTH | WLAN_STA_WME; | 95 | set_sta_flag(sta, WLAN_STA_AUTH); |
96 | set_sta_flag(sta, WLAN_STA_AUTHORIZED); | ||
97 | set_sta_flag(sta, WLAN_STA_WME); | ||
96 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; | 98 | sta->sta.supp_rates[local->hw.conf.channel->band] = rates; |
97 | rate_control_rate_init(sta); | 99 | rate_control_rate_init(sta); |
98 | 100 | ||
@@ -383,7 +385,7 @@ int mesh_plink_open(struct sta_info *sta) | |||
383 | __le16 llid; | 385 | __le16 llid; |
384 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 386 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
385 | 387 | ||
386 | if (!test_sta_flags(sta, WLAN_STA_AUTH)) | 388 | if (!test_sta_flag(sta, WLAN_STA_AUTH)) |
387 | return -EPERM; | 389 | return -EPERM; |
388 | 390 | ||
389 | spin_lock_bh(&sta->lock); | 391 | spin_lock_bh(&sta->lock); |
@@ -503,7 +505,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m | |||
503 | return; | 505 | return; |
504 | } | 506 | } |
505 | 507 | ||
506 | if (sta && !test_sta_flags(sta, WLAN_STA_AUTH)) { | 508 | if (sta && !test_sta_flag(sta, WLAN_STA_AUTH)) { |
507 | mpl_dbg("Mesh plink: Action frame from non-authed peer\n"); | 509 | mpl_dbg("Mesh plink: Action frame from non-authed peer\n"); |
508 | rcu_read_unlock(); | 510 | rcu_read_unlock(); |
509 | return; | 511 | return; |