aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mlme.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-10 18:01:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-15 16:48:23 -0400
commit05c914fe330fa8e1cc67870dc0d3809dfd96c107 (patch)
treedf53bcab47335f3361c09478d6b1447b7d298536 /net/mac80211/mlme.c
parent96dd22ac06b0dbfb069fdf530c72046a941e9694 (diff)
mac80211: use nl80211 interface types
There's really no reason for mac80211 to be using its own interface type defines. Use the nl80211 types and simplify the configuration code a bit: there's no need to translate them any more now. 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.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 55bc60713937..8a2cfd3609b5 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -678,7 +678,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
678 678
679 ifsta->flags |= IEEE80211_STA_ASSOCIATED; 679 ifsta->flags |= IEEE80211_STA_ASSOCIATED;
680 680
681 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 681 if (sdata->vif.type != NL80211_IFTYPE_STATION)
682 return; 682 return;
683 683
684 bss = ieee80211_rx_bss_get(local, ifsta->bssid, 684 bss = ieee80211_rx_bss_get(local, ifsta->bssid,
@@ -1002,17 +1002,17 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1002 DECLARE_MAC_BUF(mac); 1002 DECLARE_MAC_BUF(mac);
1003 1003
1004 if (ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE && 1004 if (ifsta->state != IEEE80211_STA_MLME_AUTHENTICATE &&
1005 sdata->vif.type != IEEE80211_IF_TYPE_IBSS) 1005 sdata->vif.type != NL80211_IFTYPE_ADHOC)
1006 return; 1006 return;
1007 1007
1008 if (len < 24 + 6) 1008 if (len < 24 + 6)
1009 return; 1009 return;
1010 1010
1011 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 1011 if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
1012 memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0) 1012 memcmp(ifsta->bssid, mgmt->sa, ETH_ALEN) != 0)
1013 return; 1013 return;
1014 1014
1015 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 1015 if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
1016 memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0) 1016 memcmp(ifsta->bssid, mgmt->bssid, ETH_ALEN) != 0)
1017 return; 1017 return;
1018 1018
@@ -1020,7 +1020,7 @@ static void ieee80211_rx_mgmt_auth(struct ieee80211_sub_if_data *sdata,
1020 auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction); 1020 auth_transaction = le16_to_cpu(mgmt->u.auth.auth_transaction);
1021 status_code = le16_to_cpu(mgmt->u.auth.status_code); 1021 status_code = le16_to_cpu(mgmt->u.auth.status_code);
1022 1022
1023 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 1023 if (sdata->vif.type == NL80211_IFTYPE_ADHOC) {
1024 /* 1024 /*
1025 * IEEE 802.11 standard does not require authentication in IBSS 1025 * IEEE 802.11 standard does not require authentication in IBSS
1026 * networks and most implementations do not seem to use it. 1026 * networks and most implementations do not seem to use it.
@@ -1487,7 +1487,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1487 if (!channel || channel->flags & IEEE80211_CHAN_DISABLED) 1487 if (!channel || channel->flags & IEEE80211_CHAN_DISABLED)
1488 return; 1488 return;
1489 1489
1490 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && elems->supp_rates && 1490 if (sdata->vif.type == NL80211_IFTYPE_ADHOC && elems->supp_rates &&
1491 memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0) { 1491 memcmp(mgmt->bssid, sdata->u.sta.bssid, ETH_ALEN) == 0) {
1492 supp_rates = ieee80211_sta_get_rates(local, elems, band); 1492 supp_rates = ieee80211_sta_get_rates(local, elems, band);
1493 1493
@@ -1532,14 +1532,14 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
1532 * In STA mode, the remaining parameters should not be overridden 1532 * In STA mode, the remaining parameters should not be overridden
1533 * by beacons because they're not necessarily accurate there. 1533 * by beacons because they're not necessarily accurate there.
1534 */ 1534 */
1535 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS && 1535 if (sdata->vif.type != NL80211_IFTYPE_ADHOC &&
1536 bss->last_probe_resp && beacon) { 1536 bss->last_probe_resp && beacon) {
1537 ieee80211_rx_bss_put(local, bss); 1537 ieee80211_rx_bss_put(local, bss);
1538 return; 1538 return;
1539 } 1539 }
1540 1540
1541 /* check if we need to merge IBSS */ 1541 /* check if we need to merge IBSS */
1542 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && beacon && 1542 if (sdata->vif.type == NL80211_IFTYPE_ADHOC && beacon &&
1543 bss->capability & WLAN_CAPABILITY_IBSS && 1543 bss->capability & WLAN_CAPABILITY_IBSS &&
1544 bss->freq == local->oper_channel->center_freq && 1544 bss->freq == local->oper_channel->center_freq &&
1545 elems->ssid_len == sdata->u.sta.ssid_len && 1545 elems->ssid_len == sdata->u.sta.ssid_len &&
@@ -1649,7 +1649,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1649 1649
1650 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, true); 1650 ieee80211_rx_bss_info(sdata, mgmt, len, rx_status, &elems, true);
1651 1651
1652 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 1652 if (sdata->vif.type != NL80211_IFTYPE_STATION)
1653 return; 1653 return;
1654 ifsta = &sdata->u.sta; 1654 ifsta = &sdata->u.sta;
1655 1655
@@ -1700,7 +1700,7 @@ static void ieee80211_rx_mgmt_probe_req(struct ieee80211_sub_if_data *sdata,
1700 DECLARE_MAC_BUF(mac3); 1700 DECLARE_MAC_BUF(mac3);
1701#endif 1701#endif
1702 1702
1703 if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS || 1703 if (sdata->vif.type != NL80211_IFTYPE_ADHOC ||
1704 ifsta->state != IEEE80211_STA_MLME_IBSS_JOINED || 1704 ifsta->state != IEEE80211_STA_MLME_IBSS_JOINED ||
1705 len < 24 + 2 || !ifsta->probe_resp) 1705 len < 24 + 2 || !ifsta->probe_resp)
1706 return; 1706 return;
@@ -2212,8 +2212,8 @@ static void ieee80211_sta_work(struct work_struct *work)
2212 if (local->sw_scanning || local->hw_scanning) 2212 if (local->sw_scanning || local->hw_scanning)
2213 return; 2213 return;
2214 2214
2215 if (WARN_ON(sdata->vif.type != IEEE80211_IF_TYPE_STA && 2215 if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_STATION &&
2216 sdata->vif.type != IEEE80211_IF_TYPE_IBSS)) 2216 sdata->vif.type != NL80211_IFTYPE_ADHOC))
2217 return; 2217 return;
2218 ifsta = &sdata->u.sta; 2218 ifsta = &sdata->u.sta;
2219 2219
@@ -2273,7 +2273,7 @@ static void ieee80211_sta_work(struct work_struct *work)
2273 2273
2274static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) 2274static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata)
2275{ 2275{
2276 if (sdata->vif.type == IEEE80211_IF_TYPE_STA) 2276 if (sdata->vif.type == NL80211_IFTYPE_STATION)
2277 queue_work(sdata->local->hw.workqueue, 2277 queue_work(sdata->local->hw.workqueue,
2278 &sdata->u.sta.work); 2278 &sdata->u.sta.work);
2279} 2279}
@@ -2355,7 +2355,7 @@ void ieee80211_sta_req_auth(struct ieee80211_sub_if_data *sdata,
2355{ 2355{
2356 struct ieee80211_local *local = sdata->local; 2356 struct ieee80211_local *local = sdata->local;
2357 2357
2358 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 2358 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2359 return; 2359 return;
2360 2360
2361 if ((ifsta->flags & (IEEE80211_STA_BSSID_SET | 2361 if ((ifsta->flags & (IEEE80211_STA_BSSID_SET |
@@ -2407,7 +2407,7 @@ int ieee80211_sta_set_ssid(struct ieee80211_sub_if_data *sdata, char *ssid, size
2407 else 2407 else
2408 ifsta->flags &= ~IEEE80211_STA_SSID_SET; 2408 ifsta->flags &= ~IEEE80211_STA_SSID_SET;
2409 2409
2410 if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && 2410 if (sdata->vif.type == NL80211_IFTYPE_ADHOC &&
2411 !(ifsta->flags & IEEE80211_STA_BSSID_SET)) { 2411 !(ifsta->flags & IEEE80211_STA_BSSID_SET)) {
2412 ifsta->ibss_join_req = jiffies; 2412 ifsta->ibss_join_req = jiffies;
2413 ifsta->state = IEEE80211_STA_MLME_IBSS_SEARCH; 2413 ifsta->state = IEEE80211_STA_MLME_IBSS_SEARCH;
@@ -2482,8 +2482,8 @@ int ieee80211_sta_deauthenticate(struct ieee80211_sub_if_data *sdata, u16 reason
2482 printk(KERN_DEBUG "%s: deauthenticating by local choice (reason=%d)\n", 2482 printk(KERN_DEBUG "%s: deauthenticating by local choice (reason=%d)\n",
2483 sdata->dev->name, reason); 2483 sdata->dev->name, reason);
2484 2484
2485 if (sdata->vif.type != IEEE80211_IF_TYPE_STA && 2485 if (sdata->vif.type != NL80211_IFTYPE_STATION &&
2486 sdata->vif.type != IEEE80211_IF_TYPE_IBSS) 2486 sdata->vif.type != NL80211_IFTYPE_ADHOC)
2487 return -EINVAL; 2487 return -EINVAL;
2488 2488
2489 ieee80211_set_disassoc(sdata, ifsta, true, true, reason); 2489 ieee80211_set_disassoc(sdata, ifsta, true, true, reason);
@@ -2497,7 +2497,7 @@ int ieee80211_sta_disassociate(struct ieee80211_sub_if_data *sdata, u16 reason)
2497 printk(KERN_DEBUG "%s: disassociating by local choice (reason=%d)\n", 2497 printk(KERN_DEBUG "%s: disassociating by local choice (reason=%d)\n",
2498 sdata->dev->name, reason); 2498 sdata->dev->name, reason);
2499 2499
2500 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 2500 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2501 return -EINVAL; 2501 return -EINVAL;
2502 2502
2503 if (!(ifsta->flags & IEEE80211_STA_ASSOCIATED)) 2503 if (!(ifsta->flags & IEEE80211_STA_ASSOCIATED))
@@ -2513,7 +2513,7 @@ void ieee80211_mlme_notify_scan_completed(struct ieee80211_local *local)
2513 struct ieee80211_sub_if_data *sdata = local->scan_sdata; 2513 struct ieee80211_sub_if_data *sdata = local->scan_sdata;
2514 struct ieee80211_if_sta *ifsta; 2514 struct ieee80211_if_sta *ifsta;
2515 2515
2516 if (sdata && sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 2516 if (sdata && sdata->vif.type == NL80211_IFTYPE_ADHOC) {
2517 ifsta = &sdata->u.sta; 2517 ifsta = &sdata->u.sta;
2518 if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) || 2518 if (!(ifsta->flags & IEEE80211_STA_BSSID_SET) ||
2519 (!(ifsta->state == IEEE80211_STA_MLME_IBSS_JOINED) && 2519 (!(ifsta->state == IEEE80211_STA_MLME_IBSS_JOINED) &&
@@ -2539,7 +2539,7 @@ void ieee80211_notify_mac(struct ieee80211_hw *hw,
2539 case IEEE80211_NOTIFY_RE_ASSOC: 2539 case IEEE80211_NOTIFY_RE_ASSOC:
2540 rcu_read_lock(); 2540 rcu_read_lock();
2541 list_for_each_entry_rcu(sdata, &local->interfaces, list) { 2541 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
2542 if (sdata->vif.type != IEEE80211_IF_TYPE_STA) 2542 if (sdata->vif.type != NL80211_IFTYPE_STATION)
2543 continue; 2543 continue;
2544 2544
2545 ieee80211_sta_req_auth(sdata, &sdata->u.sta); 2545 ieee80211_sta_req_auth(sdata, &sdata->u.sta);