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>
This commit is contained in:

committed by
John W. Linville

parent
deeaee197b
commit
c2c98fdeb5
@@ -92,7 +92,9 @@ static struct sta_info *mesh_plink_alloc(struct ieee80211_sub_if_data *sdata,
|
||||
if (!sta)
|
||||
return NULL;
|
||||
|
||||
sta->flags = WLAN_STA_AUTHORIZED | WLAN_STA_AUTH | WLAN_STA_WME;
|
||||
set_sta_flag(sta, WLAN_STA_AUTH);
|
||||
set_sta_flag(sta, WLAN_STA_AUTHORIZED);
|
||||
set_sta_flag(sta, WLAN_STA_WME);
|
||||
sta->sta.supp_rates[local->hw.conf.channel->band] = rates;
|
||||
rate_control_rate_init(sta);
|
||||
|
||||
@@ -383,7 +385,7 @@ int mesh_plink_open(struct sta_info *sta)
|
||||
__le16 llid;
|
||||
struct ieee80211_sub_if_data *sdata = sta->sdata;
|
||||
|
||||
if (!test_sta_flags(sta, WLAN_STA_AUTH))
|
||||
if (!test_sta_flag(sta, WLAN_STA_AUTH))
|
||||
return -EPERM;
|
||||
|
||||
spin_lock_bh(&sta->lock);
|
||||
@@ -503,7 +505,7 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
|
||||
return;
|
||||
}
|
||||
|
||||
if (sta && !test_sta_flags(sta, WLAN_STA_AUTH)) {
|
||||
if (sta && !test_sta_flag(sta, WLAN_STA_AUTH)) {
|
||||
mpl_dbg("Mesh plink: Action frame from non-authed peer\n");
|
||||
rcu_read_unlock();
|
||||
return;
|
||||
|
Reference in New Issue
Block a user