diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 18:01:55 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:22 -0400 |
commit | c2b13452b283f9c4a5b02a6b53ed6416ebf4c03c (patch) | |
tree | 756b8c9668c643293a46389b8b8f34b8efd3d2ea /net/mac80211/mlme.c | |
parent | 213cd118cbb88b76ae48f92cfb7dbef9a83cca62 (diff) |
mac80211: clean up scan namespace
Most of the scan functions are called ieee80211_sta_scan_*
or similar, make clean it up so they are all just called
ieee80211_scan_*.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mlme.c')
-rw-r--r-- | net/mac80211/mlme.c | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index e14830106526..5b748447eb7d 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -52,7 +52,7 @@ static int ecw2cw(int ecw) | |||
52 | return (1 << ecw) - 1; | 52 | return (1 << ecw) - 1; |
53 | } | 53 | } |
54 | 54 | ||
55 | static u8 *ieee80211_bss_get_ie(struct ieee80211_sta_bss *bss, u8 ie) | 55 | static u8 *ieee80211_bss_get_ie(struct ieee80211_bss *bss, u8 ie) |
56 | { | 56 | { |
57 | u8 *end, *pos; | 57 | u8 *end, *pos; |
58 | 58 | ||
@@ -72,7 +72,7 @@ static u8 *ieee80211_bss_get_ie(struct ieee80211_sta_bss *bss, u8 ie) | |||
72 | return NULL; | 72 | return NULL; |
73 | } | 73 | } |
74 | 74 | ||
75 | static int ieee80211_compatible_rates(struct ieee80211_sta_bss *bss, | 75 | static int ieee80211_compatible_rates(struct ieee80211_bss *bss, |
76 | struct ieee80211_supported_band *sband, | 76 | struct ieee80211_supported_band *sband, |
77 | u64 *rates) | 77 | u64 *rates) |
78 | { | 78 | { |
@@ -239,7 +239,7 @@ static void ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata, | |||
239 | u8 *pos, *ies, *ht_add_ie; | 239 | u8 *pos, *ies, *ht_add_ie; |
240 | int i, len, count, rates_len, supp_rates_len; | 240 | int i, len, count, rates_len, supp_rates_len; |
241 | u16 capab; | 241 | u16 capab; |
242 | struct ieee80211_sta_bss *bss; | 242 | struct ieee80211_bss *bss; |
243 | int wmm = 0; | 243 | int wmm = 0; |
244 | struct ieee80211_supported_band *sband; | 244 | struct ieee80211_supported_band *sband; |
245 | u64 rates = 0; | 245 | u64 rates = 0; |
@@ -470,7 +470,7 @@ static void ieee80211_send_deauth_disassoc(struct ieee80211_sub_if_data *sdata, | |||
470 | 470 | ||
471 | /* MLME */ | 471 | /* MLME */ |
472 | static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, | 472 | static void ieee80211_sta_def_wmm_params(struct ieee80211_sub_if_data *sdata, |
473 | struct ieee80211_sta_bss *bss) | 473 | struct ieee80211_bss *bss) |
474 | { | 474 | { |
475 | struct ieee80211_local *local = sdata->local; | 475 | struct ieee80211_local *local = sdata->local; |
476 | int i, have_higher_than_11mbit = 0; | 476 | int i, have_higher_than_11mbit = 0; |
@@ -621,7 +621,7 @@ static u32 ieee80211_handle_erp_ie(struct ieee80211_sub_if_data *sdata, | |||
621 | } | 621 | } |
622 | 622 | ||
623 | static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, | 623 | static u32 ieee80211_handle_bss_capability(struct ieee80211_sub_if_data *sdata, |
624 | struct ieee80211_sta_bss *bss) | 624 | struct ieee80211_bss *bss) |
625 | { | 625 | { |
626 | u32 changed = 0; | 626 | u32 changed = 0; |
627 | 627 | ||
@@ -674,7 +674,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata, | |||
674 | struct ieee80211_conf *conf = &local_to_hw(local)->conf; | 674 | struct ieee80211_conf *conf = &local_to_hw(local)->conf; |
675 | u32 changed = BSS_CHANGED_ASSOC; | 675 | u32 changed = BSS_CHANGED_ASSOC; |
676 | 676 | ||
677 | struct ieee80211_sta_bss *bss; | 677 | struct ieee80211_bss *bss; |
678 | 678 | ||
679 | ifsta->flags |= IEEE80211_STA_ASSOCIATED; | 679 | ifsta->flags |= IEEE80211_STA_ASSOCIATED; |
680 | 680 | ||
@@ -846,7 +846,7 @@ static int ieee80211_privacy_mismatch(struct ieee80211_sub_if_data *sdata, | |||
846 | struct ieee80211_if_sta *ifsta) | 846 | struct ieee80211_if_sta *ifsta) |
847 | { | 847 | { |
848 | struct ieee80211_local *local = sdata->local; | 848 | struct ieee80211_local *local = sdata->local; |
849 | struct ieee80211_sta_bss *bss; | 849 | struct ieee80211_bss *bss; |
850 | int bss_privacy; | 850 | int bss_privacy; |
851 | int wep_privacy; | 851 | int wep_privacy; |
852 | int privacy_invoked; | 852 | int privacy_invoked; |
@@ -1219,7 +1219,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
1219 | /* Add STA entry for the AP */ | 1219 | /* Add STA entry for the AP */ |
1220 | sta = sta_info_get(local, ifsta->bssid); | 1220 | sta = sta_info_get(local, ifsta->bssid); |
1221 | if (!sta) { | 1221 | if (!sta) { |
1222 | struct ieee80211_sta_bss *bss; | 1222 | struct ieee80211_bss *bss; |
1223 | int err; | 1223 | int err; |
1224 | 1224 | ||
1225 | sta = sta_info_alloc(sdata, ifsta->bssid, GFP_ATOMIC); | 1225 | sta = sta_info_alloc(sdata, ifsta->bssid, GFP_ATOMIC); |
@@ -1339,7 +1339,7 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
1339 | 1339 | ||
1340 | static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | 1340 | static int ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, |
1341 | struct ieee80211_if_sta *ifsta, | 1341 | struct ieee80211_if_sta *ifsta, |
1342 | struct ieee80211_sta_bss *bss) | 1342 | struct ieee80211_bss *bss) |
1343 | { | 1343 | { |
1344 | struct ieee80211_local *local = sdata->local; | 1344 | struct ieee80211_local *local = sdata->local; |
1345 | int res, rates, i, j; | 1345 | int res, rates, i, j; |
@@ -1490,7 +1490,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, | |||
1490 | { | 1490 | { |
1491 | struct ieee80211_local *local = sdata->local; | 1491 | struct ieee80211_local *local = sdata->local; |
1492 | int freq; | 1492 | int freq; |
1493 | struct ieee80211_sta_bss *bss; | 1493 | struct ieee80211_bss *bss; |
1494 | struct sta_info *sta; | 1494 | struct sta_info *sta; |
1495 | struct ieee80211_channel *channel; | 1495 | struct ieee80211_channel *channel; |
1496 | u64 beacon_timestamp, rx_timestamp; | 1496 | u64 beacon_timestamp, rx_timestamp; |
@@ -1893,7 +1893,7 @@ static void ieee80211_sta_merge_ibss(struct ieee80211_sub_if_data *sdata, | |||
1893 | 1893 | ||
1894 | printk(KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other " | 1894 | printk(KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other " |
1895 | "IBSS networks with same SSID (merge)\n", sdata->dev->name); | 1895 | "IBSS networks with same SSID (merge)\n", sdata->dev->name); |
1896 | ieee80211_sta_req_scan(sdata, ifsta->ssid, ifsta->ssid_len); | 1896 | ieee80211_request_scan(sdata, ifsta->ssid, ifsta->ssid_len); |
1897 | } | 1897 | } |
1898 | 1898 | ||
1899 | 1899 | ||
@@ -1974,7 +1974,7 @@ static int ieee80211_sta_create_ibss(struct ieee80211_sub_if_data *sdata, | |||
1974 | struct ieee80211_if_sta *ifsta) | 1974 | struct ieee80211_if_sta *ifsta) |
1975 | { | 1975 | { |
1976 | struct ieee80211_local *local = sdata->local; | 1976 | struct ieee80211_local *local = sdata->local; |
1977 | struct ieee80211_sta_bss *bss; | 1977 | struct ieee80211_bss *bss; |
1978 | struct ieee80211_supported_band *sband; | 1978 | struct ieee80211_supported_band *sband; |
1979 | u8 bssid[ETH_ALEN], *pos; | 1979 | u8 bssid[ETH_ALEN], *pos; |
1980 | int i; | 1980 | int i; |
@@ -2035,7 +2035,7 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata, | |||
2035 | struct ieee80211_if_sta *ifsta) | 2035 | struct ieee80211_if_sta *ifsta) |
2036 | { | 2036 | { |
2037 | struct ieee80211_local *local = sdata->local; | 2037 | struct ieee80211_local *local = sdata->local; |
2038 | struct ieee80211_sta_bss *bss; | 2038 | struct ieee80211_bss *bss; |
2039 | int found = 0; | 2039 | int found = 0; |
2040 | u8 bssid[ETH_ALEN]; | 2040 | u8 bssid[ETH_ALEN]; |
2041 | int active_ibss; | 2041 | int active_ibss; |
@@ -2050,8 +2050,8 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata, | |||
2050 | printk(KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n", | 2050 | printk(KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n", |
2051 | sdata->dev->name, active_ibss); | 2051 | sdata->dev->name, active_ibss); |
2052 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ | 2052 | #endif /* CONFIG_MAC80211_IBSS_DEBUG */ |
2053 | spin_lock_bh(&local->sta_bss_lock); | 2053 | spin_lock_bh(&local->bss_lock); |
2054 | list_for_each_entry(bss, &local->sta_bss_list, list) { | 2054 | list_for_each_entry(bss, &local->bss_list, list) { |
2055 | if (ifsta->ssid_len != bss->ssid_len || | 2055 | if (ifsta->ssid_len != bss->ssid_len || |
2056 | memcmp(ifsta->ssid, bss->ssid, bss->ssid_len) != 0 | 2056 | memcmp(ifsta->ssid, bss->ssid, bss->ssid_len) != 0 |
2057 | || !(bss->capability & WLAN_CAPABILITY_IBSS)) | 2057 | || !(bss->capability & WLAN_CAPABILITY_IBSS)) |
@@ -2065,7 +2065,7 @@ static int ieee80211_sta_find_ibss(struct ieee80211_sub_if_data *sdata, | |||
2065 | if (active_ibss || memcmp(bssid, ifsta->bssid, ETH_ALEN) != 0) | 2065 | if (active_ibss || memcmp(bssid, ifsta->bssid, ETH_ALEN) != 0) |
2066 | break; | 2066 | break; |
2067 | } | 2067 | } |
2068 | spin_unlock_bh(&local->sta_bss_lock); | 2068 | spin_unlock_bh(&local->bss_lock); |
2069 | 2069 | ||
2070 | #ifdef CONFIG_MAC80211_IBSS_DEBUG | 2070 | #ifdef CONFIG_MAC80211_IBSS_DEBUG |
2071 | if (found) | 2071 | if (found) |
@@ -2110,7 +2110,7 @@ dont_join: | |||
2110 | IEEE80211_SCAN_INTERVAL)) { | 2110 | IEEE80211_SCAN_INTERVAL)) { |
2111 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " | 2111 | printk(KERN_DEBUG "%s: Trigger new scan to find an IBSS to " |
2112 | "join\n", sdata->dev->name); | 2112 | "join\n", sdata->dev->name); |
2113 | return ieee80211_sta_req_scan(sdata, ifsta->ssid, | 2113 | return ieee80211_request_scan(sdata, ifsta->ssid, |
2114 | ifsta->ssid_len); | 2114 | ifsta->ssid_len); |
2115 | } else if (ifsta->state != IEEE80211_STA_MLME_IBSS_JOINED) { | 2115 | } else if (ifsta->state != IEEE80211_STA_MLME_IBSS_JOINED) { |
2116 | int interval = IEEE80211_SCAN_INTERVAL; | 2116 | int interval = IEEE80211_SCAN_INTERVAL; |
@@ -2145,12 +2145,12 @@ static int ieee80211_sta_config_auth(struct ieee80211_sub_if_data *sdata, | |||
2145 | struct ieee80211_if_sta *ifsta) | 2145 | struct ieee80211_if_sta *ifsta) |
2146 | { | 2146 | { |
2147 | struct ieee80211_local *local = sdata->local; | 2147 | struct ieee80211_local *local = sdata->local; |
2148 | struct ieee80211_sta_bss *bss, *selected = NULL; | 2148 | struct ieee80211_bss *bss, *selected = NULL; |
2149 | int top_rssi = 0, freq; | 2149 | int top_rssi = 0, freq; |
2150 | 2150 | ||
2151 | spin_lock_bh(&local->sta_bss_lock); | 2151 | spin_lock_bh(&local->bss_lock); |
2152 | freq = local->oper_channel->center_freq; | 2152 | freq = local->oper_channel->center_freq; |
2153 | list_for_each_entry(bss, &local->sta_bss_list, list) { | 2153 | list_for_each_entry(bss, &local->bss_list, list) { |
2154 | if (!(bss->capability & WLAN_CAPABILITY_ESS)) | 2154 | if (!(bss->capability & WLAN_CAPABILITY_ESS)) |
2155 | continue; | 2155 | continue; |
2156 | 2156 | ||
@@ -2180,7 +2180,7 @@ static int ieee80211_sta_config_auth(struct ieee80211_sub_if_data *sdata, | |||
2180 | } | 2180 | } |
2181 | if (selected) | 2181 | if (selected) |
2182 | atomic_inc(&selected->users); | 2182 | atomic_inc(&selected->users); |
2183 | spin_unlock_bh(&local->sta_bss_lock); | 2183 | spin_unlock_bh(&local->bss_lock); |
2184 | 2184 | ||
2185 | if (selected) { | 2185 | if (selected) { |
2186 | ieee80211_set_freq(sdata, selected->freq); | 2186 | ieee80211_set_freq(sdata, selected->freq); |
@@ -2207,9 +2207,9 @@ static int ieee80211_sta_config_auth(struct ieee80211_sub_if_data *sdata, | |||
2207 | if (ifsta->assoc_scan_tries < IEEE80211_ASSOC_SCANS_MAX_TRIES) { | 2207 | if (ifsta->assoc_scan_tries < IEEE80211_ASSOC_SCANS_MAX_TRIES) { |
2208 | ifsta->assoc_scan_tries++; | 2208 | ifsta->assoc_scan_tries++; |
2209 | if (ifsta->flags & IEEE80211_STA_AUTO_SSID_SEL) | 2209 | if (ifsta->flags & IEEE80211_STA_AUTO_SSID_SEL) |
2210 | ieee80211_sta_start_scan(sdata, NULL, 0); | 2210 | ieee80211_start_scan(sdata, NULL, 0); |
2211 | else | 2211 | else |
2212 | ieee80211_sta_start_scan(sdata, ifsta->ssid, | 2212 | ieee80211_start_scan(sdata, ifsta->ssid, |
2213 | ifsta->ssid_len); | 2213 | ifsta->ssid_len); |
2214 | ifsta->state = IEEE80211_STA_MLME_AUTHENTICATE; | 2214 | ifsta->state = IEEE80211_STA_MLME_AUTHENTICATE; |
2215 | set_bit(IEEE80211_STA_REQ_AUTH, &ifsta->request); | 2215 | set_bit(IEEE80211_STA_REQ_AUTH, &ifsta->request); |
@@ -2231,7 +2231,7 @@ static void ieee80211_sta_work(struct work_struct *work) | |||
2231 | if (!netif_running(sdata->dev)) | 2231 | if (!netif_running(sdata->dev)) |
2232 | return; | 2232 | return; |
2233 | 2233 | ||
2234 | if (local->sta_sw_scanning || local->sta_hw_scanning) | 2234 | if (local->sw_scanning || local->hw_scanning) |
2235 | return; | 2235 | return; |
2236 | 2236 | ||
2237 | if (WARN_ON(sdata->vif.type != IEEE80211_IF_TYPE_STA && | 2237 | if (WARN_ON(sdata->vif.type != IEEE80211_IF_TYPE_STA && |
@@ -2246,7 +2246,8 @@ static void ieee80211_sta_work(struct work_struct *work) | |||
2246 | ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE && | 2246 | ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE && |
2247 | ifsta->state != IEEE80211_STA_MLME_ASSOCIATE && | 2247 | ifsta->state != IEEE80211_STA_MLME_ASSOCIATE && |
2248 | test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request)) { | 2248 | test_and_clear_bit(IEEE80211_STA_REQ_SCAN, &ifsta->request)) { |
2249 | ieee80211_sta_start_scan(sdata, ifsta->scan_ssid, ifsta->scan_ssid_len); | 2249 | ieee80211_start_scan(sdata, ifsta->scan_ssid, |
2250 | ifsta->scan_ssid_len); | ||
2250 | return; | 2251 | return; |
2251 | } | 2252 | } |
2252 | 2253 | ||