diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 18:01:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:23 -0400 |
commit | 05c914fe330fa8e1cc67870dc0d3809dfd96c107 (patch) | |
tree | df53bcab47335f3361c09478d6b1447b7d298536 /net/mac80211 | |
parent | 96dd22ac06b0dbfb069fdf530c72046a941e9694 (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')
-rw-r--r-- | net/mac80211/cfg.c | 57 | ||||
-rw-r--r-- | net/mac80211/debugfs_netdev.c | 28 | ||||
-rw-r--r-- | net/mac80211/ht.c | 6 | ||||
-rw-r--r-- | net/mac80211/ieee80211_i.h | 6 | ||||
-rw-r--r-- | net/mac80211/iface.c | 40 | ||||
-rw-r--r-- | net/mac80211/key.c | 6 | ||||
-rw-r--r-- | net/mac80211/main.c | 89 | ||||
-rw-r--r-- | net/mac80211/mlme.c | 40 | ||||
-rw-r--r-- | net/mac80211/rx.c | 65 | ||||
-rw-r--r-- | net/mac80211/scan.c | 8 | ||||
-rw-r--r-- | net/mac80211/sta_info.c | 4 | ||||
-rw-r--r-- | net/mac80211/tx.c | 28 | ||||
-rw-r--r-- | net/mac80211/util.c | 44 | ||||
-rw-r--r-- | net/mac80211/wext.c | 84 |
14 files changed, 249 insertions, 256 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 6ec2127f9a60..d004351050cc 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -24,26 +24,19 @@ struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy) | |||
24 | } | 24 | } |
25 | EXPORT_SYMBOL(wiphy_to_hw); | 25 | EXPORT_SYMBOL(wiphy_to_hw); |
26 | 26 | ||
27 | static enum ieee80211_if_types | 27 | static bool nl80211_type_check(enum nl80211_iftype type) |
28 | nl80211_type_to_mac80211_type(enum nl80211_iftype type) | ||
29 | { | 28 | { |
30 | switch (type) { | 29 | switch (type) { |
31 | case NL80211_IFTYPE_UNSPECIFIED: | ||
32 | return IEEE80211_IF_TYPE_STA; | ||
33 | case NL80211_IFTYPE_ADHOC: | 30 | case NL80211_IFTYPE_ADHOC: |
34 | return IEEE80211_IF_TYPE_IBSS; | ||
35 | case NL80211_IFTYPE_STATION: | 31 | case NL80211_IFTYPE_STATION: |
36 | return IEEE80211_IF_TYPE_STA; | ||
37 | case NL80211_IFTYPE_MONITOR: | 32 | case NL80211_IFTYPE_MONITOR: |
38 | return IEEE80211_IF_TYPE_MNTR; | ||
39 | #ifdef CONFIG_MAC80211_MESH | 33 | #ifdef CONFIG_MAC80211_MESH |
40 | case NL80211_IFTYPE_MESH_POINT: | 34 | case NL80211_IFTYPE_MESH_POINT: |
41 | return IEEE80211_IF_TYPE_MESH_POINT; | ||
42 | #endif | 35 | #endif |
43 | case NL80211_IFTYPE_WDS: | 36 | case NL80211_IFTYPE_WDS: |
44 | return IEEE80211_IF_TYPE_WDS; | 37 | return true; |
45 | default: | 38 | default: |
46 | return IEEE80211_IF_TYPE_INVALID; | 39 | return false; |
47 | } | 40 | } |
48 | } | 41 | } |
49 | 42 | ||
@@ -52,17 +45,15 @@ static int ieee80211_add_iface(struct wiphy *wiphy, char *name, | |||
52 | struct vif_params *params) | 45 | struct vif_params *params) |
53 | { | 46 | { |
54 | struct ieee80211_local *local = wiphy_priv(wiphy); | 47 | struct ieee80211_local *local = wiphy_priv(wiphy); |
55 | enum ieee80211_if_types itype; | ||
56 | struct net_device *dev; | 48 | struct net_device *dev; |
57 | struct ieee80211_sub_if_data *sdata; | 49 | struct ieee80211_sub_if_data *sdata; |
58 | int err; | 50 | int err; |
59 | 51 | ||
60 | itype = nl80211_type_to_mac80211_type(type); | 52 | if (!nl80211_type_check(type)) |
61 | if (itype == IEEE80211_IF_TYPE_INVALID) | ||
62 | return -EINVAL; | 53 | return -EINVAL; |
63 | 54 | ||
64 | err = ieee80211_if_add(local, name, &dev, itype, params); | 55 | err = ieee80211_if_add(local, name, &dev, type, params); |
65 | if (err || itype != IEEE80211_IF_TYPE_MNTR || !flags) | 56 | if (err || type != NL80211_IFTYPE_MONITOR || !flags) |
66 | return err; | 57 | return err; |
67 | 58 | ||
68 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 59 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
@@ -93,7 +84,6 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex, | |||
93 | { | 84 | { |
94 | struct ieee80211_local *local = wiphy_priv(wiphy); | 85 | struct ieee80211_local *local = wiphy_priv(wiphy); |
95 | struct net_device *dev; | 86 | struct net_device *dev; |
96 | enum ieee80211_if_types itype; | ||
97 | struct ieee80211_sub_if_data *sdata; | 87 | struct ieee80211_sub_if_data *sdata; |
98 | int ret; | 88 | int ret; |
99 | 89 | ||
@@ -102,8 +92,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex, | |||
102 | if (!dev) | 92 | if (!dev) |
103 | return -ENODEV; | 93 | return -ENODEV; |
104 | 94 | ||
105 | itype = nl80211_type_to_mac80211_type(type); | 95 | if (!nl80211_type_check(type)) |
106 | if (itype == IEEE80211_IF_TYPE_INVALID) | ||
107 | return -EINVAL; | 96 | return -EINVAL; |
108 | 97 | ||
109 | if (dev == local->mdev) | 98 | if (dev == local->mdev) |
@@ -111,7 +100,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex, | |||
111 | 100 | ||
112 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 101 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
113 | 102 | ||
114 | ret = ieee80211_if_change_type(sdata, itype); | 103 | ret = ieee80211_if_change_type(sdata, type); |
115 | if (ret) | 104 | if (ret) |
116 | return ret; | 105 | return ret; |
117 | 106 | ||
@@ -120,7 +109,7 @@ static int ieee80211_change_iface(struct wiphy *wiphy, int ifindex, | |||
120 | params->mesh_id_len, | 109 | params->mesh_id_len, |
121 | params->mesh_id); | 110 | params->mesh_id); |
122 | 111 | ||
123 | if (sdata->vif.type != IEEE80211_IF_TYPE_MNTR || !flags) | 112 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR || !flags) |
124 | return 0; | 113 | return 0; |
125 | 114 | ||
126 | sdata->u.mntr_flags = *flags; | 115 | sdata->u.mntr_flags = *flags; |
@@ -516,7 +505,7 @@ static int ieee80211_add_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
516 | 505 | ||
517 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 506 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
518 | 507 | ||
519 | if (sdata->vif.type != IEEE80211_IF_TYPE_AP) | 508 | if (sdata->vif.type != NL80211_IFTYPE_AP) |
520 | return -EINVAL; | 509 | return -EINVAL; |
521 | 510 | ||
522 | old = sdata->u.ap.beacon; | 511 | old = sdata->u.ap.beacon; |
@@ -539,7 +528,7 @@ static int ieee80211_set_beacon(struct wiphy *wiphy, struct net_device *dev, | |||
539 | 528 | ||
540 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 529 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
541 | 530 | ||
542 | if (sdata->vif.type != IEEE80211_IF_TYPE_AP) | 531 | if (sdata->vif.type != NL80211_IFTYPE_AP) |
543 | return -EINVAL; | 532 | return -EINVAL; |
544 | 533 | ||
545 | old = sdata->u.ap.beacon; | 534 | old = sdata->u.ap.beacon; |
@@ -561,7 +550,7 @@ static int ieee80211_del_beacon(struct wiphy *wiphy, struct net_device *dev) | |||
561 | 550 | ||
562 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 551 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
563 | 552 | ||
564 | if (sdata->vif.type != IEEE80211_IF_TYPE_AP) | 553 | if (sdata->vif.type != NL80211_IFTYPE_AP) |
565 | return -EINVAL; | 554 | return -EINVAL; |
566 | 555 | ||
567 | old = sdata->u.ap.beacon; | 556 | old = sdata->u.ap.beacon; |
@@ -716,8 +705,8 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
716 | if (params->vlan) { | 705 | if (params->vlan) { |
717 | sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); | 706 | sdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
718 | 707 | ||
719 | if (sdata->vif.type != IEEE80211_IF_TYPE_VLAN && | 708 | if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && |
720 | sdata->vif.type != IEEE80211_IF_TYPE_AP) | 709 | sdata->vif.type != NL80211_IFTYPE_AP) |
721 | return -EINVAL; | 710 | return -EINVAL; |
722 | } else | 711 | } else |
723 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 712 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
@@ -747,8 +736,8 @@ static int ieee80211_add_station(struct wiphy *wiphy, struct net_device *dev, | |||
747 | return err; | 736 | return err; |
748 | } | 737 | } |
749 | 738 | ||
750 | if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN || | 739 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN || |
751 | sdata->vif.type == IEEE80211_IF_TYPE_AP) | 740 | sdata->vif.type == NL80211_IFTYPE_AP) |
752 | ieee80211_send_layer2_update(sta); | 741 | ieee80211_send_layer2_update(sta); |
753 | 742 | ||
754 | rcu_read_unlock(); | 743 | rcu_read_unlock(); |
@@ -812,8 +801,8 @@ static int ieee80211_change_station(struct wiphy *wiphy, | |||
812 | if (params->vlan && params->vlan != sta->sdata->dev) { | 801 | if (params->vlan && params->vlan != sta->sdata->dev) { |
813 | vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); | 802 | vlansdata = IEEE80211_DEV_TO_SUB_IF(params->vlan); |
814 | 803 | ||
815 | if (vlansdata->vif.type != IEEE80211_IF_TYPE_VLAN && | 804 | if (vlansdata->vif.type != NL80211_IFTYPE_AP_VLAN && |
816 | vlansdata->vif.type != IEEE80211_IF_TYPE_AP) { | 805 | vlansdata->vif.type != NL80211_IFTYPE_AP) { |
817 | rcu_read_unlock(); | 806 | rcu_read_unlock(); |
818 | return -EINVAL; | 807 | return -EINVAL; |
819 | } | 808 | } |
@@ -847,7 +836,7 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
847 | 836 | ||
848 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 837 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
849 | 838 | ||
850 | if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) | 839 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) |
851 | return -ENOTSUPP; | 840 | return -ENOTSUPP; |
852 | 841 | ||
853 | rcu_read_lock(); | 842 | rcu_read_lock(); |
@@ -903,7 +892,7 @@ static int ieee80211_change_mpath(struct wiphy *wiphy, | |||
903 | 892 | ||
904 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 893 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
905 | 894 | ||
906 | if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) | 895 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) |
907 | return -ENOTSUPP; | 896 | return -ENOTSUPP; |
908 | 897 | ||
909 | rcu_read_lock(); | 898 | rcu_read_lock(); |
@@ -978,7 +967,7 @@ static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
978 | 967 | ||
979 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 968 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
980 | 969 | ||
981 | if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) | 970 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) |
982 | return -ENOTSUPP; | 971 | return -ENOTSUPP; |
983 | 972 | ||
984 | rcu_read_lock(); | 973 | rcu_read_lock(); |
@@ -1006,7 +995,7 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev, | |||
1006 | 995 | ||
1007 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 996 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1008 | 997 | ||
1009 | if (sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT) | 998 | if (sdata->vif.type != NL80211_IFTYPE_MESH_POINT) |
1010 | return -ENOTSUPP; | 999 | return -ENOTSUPP; |
1011 | 1000 | ||
1012 | rcu_read_lock(); | 1001 | rcu_read_lock(); |
@@ -1035,7 +1024,7 @@ static int ieee80211_change_bss(struct wiphy *wiphy, | |||
1035 | 1024 | ||
1036 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 1025 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
1037 | 1026 | ||
1038 | if (sdata->vif.type != IEEE80211_IF_TYPE_AP) | 1027 | if (sdata->vif.type != NL80211_IFTYPE_AP) |
1039 | return -EINVAL; | 1028 | return -EINVAL; |
1040 | 1029 | ||
1041 | if (params->use_cts_prot >= 0) { | 1030 | if (params->use_cts_prot >= 0) { |
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c index 0fa7681a3d20..1b33cad24abc 100644 --- a/net/mac80211/debugfs_netdev.c +++ b/net/mac80211/debugfs_netdev.c | |||
@@ -345,26 +345,26 @@ static void add_files(struct ieee80211_sub_if_data *sdata) | |||
345 | return; | 345 | return; |
346 | 346 | ||
347 | switch (sdata->vif.type) { | 347 | switch (sdata->vif.type) { |
348 | case IEEE80211_IF_TYPE_MESH_POINT: | 348 | case NL80211_IFTYPE_MESH_POINT: |
349 | #ifdef CONFIG_MAC80211_MESH | 349 | #ifdef CONFIG_MAC80211_MESH |
350 | add_mesh_stats(sdata); | 350 | add_mesh_stats(sdata); |
351 | add_mesh_config(sdata); | 351 | add_mesh_config(sdata); |
352 | #endif | 352 | #endif |
353 | break; | 353 | break; |
354 | case IEEE80211_IF_TYPE_STA: | 354 | case NL80211_IFTYPE_STATION: |
355 | case IEEE80211_IF_TYPE_IBSS: | 355 | case NL80211_IFTYPE_ADHOC: |
356 | add_sta_files(sdata); | 356 | add_sta_files(sdata); |
357 | break; | 357 | break; |
358 | case IEEE80211_IF_TYPE_AP: | 358 | case NL80211_IFTYPE_AP: |
359 | add_ap_files(sdata); | 359 | add_ap_files(sdata); |
360 | break; | 360 | break; |
361 | case IEEE80211_IF_TYPE_WDS: | 361 | case NL80211_IFTYPE_WDS: |
362 | add_wds_files(sdata); | 362 | add_wds_files(sdata); |
363 | break; | 363 | break; |
364 | case IEEE80211_IF_TYPE_MNTR: | 364 | case NL80211_IFTYPE_MONITOR: |
365 | add_monitor_files(sdata); | 365 | add_monitor_files(sdata); |
366 | break; | 366 | break; |
367 | case IEEE80211_IF_TYPE_VLAN: | 367 | case NL80211_IFTYPE_AP_VLAN: |
368 | add_vlan_files(sdata); | 368 | add_vlan_files(sdata); |
369 | break; | 369 | break; |
370 | default: | 370 | default: |
@@ -482,26 +482,26 @@ static void del_files(struct ieee80211_sub_if_data *sdata) | |||
482 | return; | 482 | return; |
483 | 483 | ||
484 | switch (sdata->vif.type) { | 484 | switch (sdata->vif.type) { |
485 | case IEEE80211_IF_TYPE_MESH_POINT: | 485 | case NL80211_IFTYPE_MESH_POINT: |
486 | #ifdef CONFIG_MAC80211_MESH | 486 | #ifdef CONFIG_MAC80211_MESH |
487 | del_mesh_stats(sdata); | 487 | del_mesh_stats(sdata); |
488 | del_mesh_config(sdata); | 488 | del_mesh_config(sdata); |
489 | #endif | 489 | #endif |
490 | break; | 490 | break; |
491 | case IEEE80211_IF_TYPE_STA: | 491 | case NL80211_IFTYPE_STATION: |
492 | case IEEE80211_IF_TYPE_IBSS: | 492 | case NL80211_IFTYPE_ADHOC: |
493 | del_sta_files(sdata); | 493 | del_sta_files(sdata); |
494 | break; | 494 | break; |
495 | case IEEE80211_IF_TYPE_AP: | 495 | case NL80211_IFTYPE_AP: |
496 | del_ap_files(sdata); | 496 | del_ap_files(sdata); |
497 | break; | 497 | break; |
498 | case IEEE80211_IF_TYPE_WDS: | 498 | case NL80211_IFTYPE_WDS: |
499 | del_wds_files(sdata); | 499 | del_wds_files(sdata); |
500 | break; | 500 | break; |
501 | case IEEE80211_IF_TYPE_MNTR: | 501 | case NL80211_IFTYPE_MONITOR: |
502 | del_monitor_files(sdata); | 502 | del_monitor_files(sdata); |
503 | break; | 503 | break; |
504 | case IEEE80211_IF_TYPE_VLAN: | 504 | case NL80211_IFTYPE_AP_VLAN: |
505 | del_vlan_files(sdata); | 505 | del_vlan_files(sdata); |
506 | break; | 506 | break; |
507 | default: | 507 | default: |
diff --git a/net/mac80211/ht.c b/net/mac80211/ht.c index 4dc35c9dabc7..bc3c71ad7ae3 100644 --- a/net/mac80211/ht.c +++ b/net/mac80211/ht.c | |||
@@ -89,7 +89,7 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata, | |||
89 | memset(mgmt, 0, 24); | 89 | memset(mgmt, 0, 24); |
90 | memcpy(mgmt->da, da, ETH_ALEN); | 90 | memcpy(mgmt->da, da, ETH_ALEN); |
91 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); | 91 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); |
92 | if (sdata->vif.type == IEEE80211_IF_TYPE_AP) | 92 | if (sdata->vif.type == NL80211_IFTYPE_AP) |
93 | memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); | 93 | memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); |
94 | else | 94 | else |
95 | memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); | 95 | memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); |
@@ -139,7 +139,7 @@ static void ieee80211_send_addba_resp(struct ieee80211_sub_if_data *sdata, u8 *d | |||
139 | memset(mgmt, 0, 24); | 139 | memset(mgmt, 0, 24); |
140 | memcpy(mgmt->da, da, ETH_ALEN); | 140 | memcpy(mgmt->da, da, ETH_ALEN); |
141 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); | 141 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); |
142 | if (sdata->vif.type == IEEE80211_IF_TYPE_AP) | 142 | if (sdata->vif.type == NL80211_IFTYPE_AP) |
143 | memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); | 143 | memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); |
144 | else | 144 | else |
145 | memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); | 145 | memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); |
@@ -185,7 +185,7 @@ static void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, | |||
185 | memset(mgmt, 0, 24); | 185 | memset(mgmt, 0, 24); |
186 | memcpy(mgmt->da, da, ETH_ALEN); | 186 | memcpy(mgmt->da, da, ETH_ALEN); |
187 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); | 187 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); |
188 | if (sdata->vif.type == IEEE80211_IF_TYPE_AP) | 188 | if (sdata->vif.type == NL80211_IFTYPE_AP) |
189 | memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); | 189 | memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); |
190 | else | 190 | else |
191 | memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); | 191 | memcpy(mgmt->bssid, ifsta->bssid, ETH_ALEN); |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 21cc6d07b020..80d88f5ff90c 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -954,10 +954,10 @@ void ieee80211_rx_bss_put(struct ieee80211_local *local, | |||
954 | /* interface handling */ | 954 | /* interface handling */ |
955 | void ieee80211_if_setup(struct net_device *dev); | 955 | void ieee80211_if_setup(struct net_device *dev); |
956 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, | 956 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, |
957 | struct net_device **new_dev, enum ieee80211_if_types type, | 957 | struct net_device **new_dev, enum nl80211_iftype type, |
958 | struct vif_params *params); | 958 | struct vif_params *params); |
959 | int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, | 959 | int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, |
960 | enum ieee80211_if_types type); | 960 | enum nl80211_iftype type); |
961 | void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata); | 961 | void ieee80211_if_remove(struct ieee80211_sub_if_data *sdata); |
962 | void ieee80211_remove_interfaces(struct ieee80211_local *local); | 962 | void ieee80211_remove_interfaces(struct ieee80211_local *local); |
963 | 963 | ||
@@ -1001,7 +1001,7 @@ extern void *mac80211_wiphy_privid; /* for wiphy privid */ | |||
1001 | extern const unsigned char rfc1042_header[6]; | 1001 | extern const unsigned char rfc1042_header[6]; |
1002 | extern const unsigned char bridge_tunnel_header[6]; | 1002 | extern const unsigned char bridge_tunnel_header[6]; |
1003 | u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, | 1003 | u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, |
1004 | enum ieee80211_if_types type); | 1004 | enum nl80211_iftype type); |
1005 | int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, | 1005 | int ieee80211_frame_duration(struct ieee80211_local *local, size_t len, |
1006 | int rate, int erp, int short_preamble); | 1006 | int rate, int erp, int short_preamble); |
1007 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, | 1007 | void mac80211_ev_michael_mic_failure(struct ieee80211_sub_if_data *sdata, int keyidx, |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index dab8eba2602f..004fb23241da 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -41,7 +41,7 @@ static void ieee80211_teardown_sdata(struct net_device *dev) | |||
41 | sdata->fragment_next = 0; | 41 | sdata->fragment_next = 0; |
42 | 42 | ||
43 | switch (sdata->vif.type) { | 43 | switch (sdata->vif.type) { |
44 | case IEEE80211_IF_TYPE_AP: | 44 | case NL80211_IFTYPE_AP: |
45 | beacon = sdata->u.ap.beacon; | 45 | beacon = sdata->u.ap.beacon; |
46 | rcu_assign_pointer(sdata->u.ap.beacon, NULL); | 46 | rcu_assign_pointer(sdata->u.ap.beacon, NULL); |
47 | synchronize_rcu(); | 47 | synchronize_rcu(); |
@@ -53,22 +53,23 @@ static void ieee80211_teardown_sdata(struct net_device *dev) | |||
53 | } | 53 | } |
54 | 54 | ||
55 | break; | 55 | break; |
56 | case IEEE80211_IF_TYPE_MESH_POINT: | 56 | case NL80211_IFTYPE_MESH_POINT: |
57 | if (ieee80211_vif_is_mesh(&sdata->vif)) | 57 | if (ieee80211_vif_is_mesh(&sdata->vif)) |
58 | mesh_rmc_free(sdata); | 58 | mesh_rmc_free(sdata); |
59 | break; | 59 | break; |
60 | case IEEE80211_IF_TYPE_STA: | 60 | case NL80211_IFTYPE_STATION: |
61 | case IEEE80211_IF_TYPE_IBSS: | 61 | case NL80211_IFTYPE_ADHOC: |
62 | kfree(sdata->u.sta.extra_ie); | 62 | kfree(sdata->u.sta.extra_ie); |
63 | kfree(sdata->u.sta.assocreq_ies); | 63 | kfree(sdata->u.sta.assocreq_ies); |
64 | kfree(sdata->u.sta.assocresp_ies); | 64 | kfree(sdata->u.sta.assocresp_ies); |
65 | kfree_skb(sdata->u.sta.probe_resp); | 65 | kfree_skb(sdata->u.sta.probe_resp); |
66 | break; | 66 | break; |
67 | case IEEE80211_IF_TYPE_WDS: | 67 | case NL80211_IFTYPE_WDS: |
68 | case IEEE80211_IF_TYPE_VLAN: | 68 | case NL80211_IFTYPE_AP_VLAN: |
69 | case IEEE80211_IF_TYPE_MNTR: | 69 | case NL80211_IFTYPE_MONITOR: |
70 | break; | 70 | break; |
71 | case IEEE80211_IF_TYPE_INVALID: | 71 | case NL80211_IFTYPE_UNSPECIFIED: |
72 | case __NL80211_IFTYPE_AFTER_LAST: | ||
72 | BUG(); | 73 | BUG(); |
73 | break; | 74 | break; |
74 | } | 75 | } |
@@ -81,7 +82,7 @@ static void ieee80211_teardown_sdata(struct net_device *dev) | |||
81 | * Helper function to initialise an interface to a specific type. | 82 | * Helper function to initialise an interface to a specific type. |
82 | */ | 83 | */ |
83 | static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | 84 | static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, |
84 | enum ieee80211_if_types type) | 85 | enum nl80211_iftype type) |
85 | { | 86 | { |
86 | /* clear type-dependent union */ | 87 | /* clear type-dependent union */ |
87 | memset(&sdata->u, 0, sizeof(sdata->u)); | 88 | memset(&sdata->u, 0, sizeof(sdata->u)); |
@@ -93,28 +94,29 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
93 | sdata->dev->type = ARPHRD_ETHER; | 94 | sdata->dev->type = ARPHRD_ETHER; |
94 | 95 | ||
95 | switch (type) { | 96 | switch (type) { |
96 | case IEEE80211_IF_TYPE_AP: | 97 | case NL80211_IFTYPE_AP: |
97 | skb_queue_head_init(&sdata->u.ap.ps_bc_buf); | 98 | skb_queue_head_init(&sdata->u.ap.ps_bc_buf); |
98 | INIT_LIST_HEAD(&sdata->u.ap.vlans); | 99 | INIT_LIST_HEAD(&sdata->u.ap.vlans); |
99 | break; | 100 | break; |
100 | case IEEE80211_IF_TYPE_STA: | 101 | case NL80211_IFTYPE_STATION: |
101 | case IEEE80211_IF_TYPE_IBSS: | 102 | case NL80211_IFTYPE_ADHOC: |
102 | ieee80211_sta_setup_sdata(sdata); | 103 | ieee80211_sta_setup_sdata(sdata); |
103 | break; | 104 | break; |
104 | case IEEE80211_IF_TYPE_MESH_POINT: | 105 | case NL80211_IFTYPE_MESH_POINT: |
105 | if (ieee80211_vif_is_mesh(&sdata->vif)) | 106 | if (ieee80211_vif_is_mesh(&sdata->vif)) |
106 | ieee80211_mesh_init_sdata(sdata); | 107 | ieee80211_mesh_init_sdata(sdata); |
107 | break; | 108 | break; |
108 | case IEEE80211_IF_TYPE_MNTR: | 109 | case NL80211_IFTYPE_MONITOR: |
109 | sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP; | 110 | sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP; |
110 | sdata->dev->hard_start_xmit = ieee80211_monitor_start_xmit; | 111 | sdata->dev->hard_start_xmit = ieee80211_monitor_start_xmit; |
111 | sdata->u.mntr_flags = MONITOR_FLAG_CONTROL | | 112 | sdata->u.mntr_flags = MONITOR_FLAG_CONTROL | |
112 | MONITOR_FLAG_OTHER_BSS; | 113 | MONITOR_FLAG_OTHER_BSS; |
113 | break; | 114 | break; |
114 | case IEEE80211_IF_TYPE_WDS: | 115 | case NL80211_IFTYPE_WDS: |
115 | case IEEE80211_IF_TYPE_VLAN: | 116 | case NL80211_IFTYPE_AP_VLAN: |
116 | break; | 117 | break; |
117 | case IEEE80211_IF_TYPE_INVALID: | 118 | case NL80211_IFTYPE_UNSPECIFIED: |
119 | case __NL80211_IFTYPE_AFTER_LAST: | ||
118 | BUG(); | 120 | BUG(); |
119 | break; | 121 | break; |
120 | } | 122 | } |
@@ -123,7 +125,7 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
123 | } | 125 | } |
124 | 126 | ||
125 | int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, | 127 | int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, |
126 | enum ieee80211_if_types type) | 128 | enum nl80211_iftype type) |
127 | { | 129 | { |
128 | ASSERT_RTNL(); | 130 | ASSERT_RTNL(); |
129 | 131 | ||
@@ -153,7 +155,7 @@ int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, | |||
153 | } | 155 | } |
154 | 156 | ||
155 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, | 157 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, |
156 | struct net_device **new_dev, enum ieee80211_if_types type, | 158 | struct net_device **new_dev, enum nl80211_iftype type, |
157 | struct vif_params *params) | 159 | struct vif_params *params) |
158 | { | 160 | { |
159 | struct net_device *ndev; | 161 | struct net_device *ndev; |
diff --git a/net/mac80211/key.c b/net/mac80211/key.c index 6597c779e35a..d5b95748db2a 100644 --- a/net/mac80211/key.c +++ b/net/mac80211/key.c | |||
@@ -118,8 +118,8 @@ static const u8 *get_mac_for_key(struct ieee80211_key *key) | |||
118 | * address to indicate a transmit-only key. | 118 | * address to indicate a transmit-only key. |
119 | */ | 119 | */ |
120 | if (key->conf.alg != ALG_WEP && | 120 | if (key->conf.alg != ALG_WEP && |
121 | (key->sdata->vif.type == IEEE80211_IF_TYPE_AP || | 121 | (key->sdata->vif.type == NL80211_IFTYPE_AP || |
122 | key->sdata->vif.type == IEEE80211_IF_TYPE_VLAN)) | 122 | key->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) |
123 | addr = zero_addr; | 123 | addr = zero_addr; |
124 | 124 | ||
125 | if (key->sta) | 125 | if (key->sta) |
@@ -331,7 +331,7 @@ void ieee80211_key_link(struct ieee80211_key *key, | |||
331 | */ | 331 | */ |
332 | key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE; | 332 | key->conf.flags |= IEEE80211_KEY_FLAG_PAIRWISE; |
333 | } else { | 333 | } else { |
334 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { | 334 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
335 | struct sta_info *ap; | 335 | struct sta_info *ap; |
336 | 336 | ||
337 | /* | 337 | /* |
diff --git a/net/mac80211/main.c b/net/mac80211/main.c index 4c424acc01a4..584a75bd6cfe 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c | |||
@@ -146,7 +146,7 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) | |||
146 | int meshhdrlen; | 146 | int meshhdrlen; |
147 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 147 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
148 | 148 | ||
149 | meshhdrlen = (sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) ? 5 : 0; | 149 | meshhdrlen = (sdata->vif.type == NL80211_IFTYPE_MESH_POINT) ? 5 : 0; |
150 | 150 | ||
151 | /* FIX: what would be proper limits for MTU? | 151 | /* FIX: what would be proper limits for MTU? |
152 | * This interface uses 802.3 frames. */ | 152 | * This interface uses 802.3 frames. */ |
@@ -164,18 +164,16 @@ static int ieee80211_change_mtu(struct net_device *dev, int new_mtu) | |||
164 | 164 | ||
165 | static inline int identical_mac_addr_allowed(int type1, int type2) | 165 | static inline int identical_mac_addr_allowed(int type1, int type2) |
166 | { | 166 | { |
167 | return (type1 == IEEE80211_IF_TYPE_MNTR || | 167 | return type1 == NL80211_IFTYPE_MONITOR || |
168 | type2 == IEEE80211_IF_TYPE_MNTR || | 168 | type2 == NL80211_IFTYPE_MONITOR || |
169 | (type1 == IEEE80211_IF_TYPE_AP && | 169 | (type1 == NL80211_IFTYPE_AP && type2 == NL80211_IFTYPE_WDS) || |
170 | type2 == IEEE80211_IF_TYPE_WDS) || | 170 | (type1 == NL80211_IFTYPE_WDS && |
171 | (type1 == IEEE80211_IF_TYPE_WDS && | 171 | (type2 == NL80211_IFTYPE_WDS || |
172 | (type2 == IEEE80211_IF_TYPE_WDS || | 172 | type2 == NL80211_IFTYPE_AP)) || |
173 | type2 == IEEE80211_IF_TYPE_AP)) || | 173 | (type1 == NL80211_IFTYPE_AP && type2 == NL80211_IFTYPE_AP_VLAN) || |
174 | (type1 == IEEE80211_IF_TYPE_AP && | 174 | (type1 == NL80211_IFTYPE_AP_VLAN && |
175 | type2 == IEEE80211_IF_TYPE_VLAN) || | 175 | (type2 == NL80211_IFTYPE_AP || |
176 | (type1 == IEEE80211_IF_TYPE_VLAN && | 176 | type2 == NL80211_IFTYPE_AP_VLAN)); |
177 | (type2 == IEEE80211_IF_TYPE_AP || | ||
178 | type2 == IEEE80211_IF_TYPE_VLAN))); | ||
179 | } | 177 | } |
180 | 178 | ||
181 | static int ieee80211_open(struct net_device *dev) | 179 | static int ieee80211_open(struct net_device *dev) |
@@ -211,8 +209,8 @@ static int ieee80211_open(struct net_device *dev) | |||
211 | * belonging to the same hardware. Then, however, we're | 209 | * belonging to the same hardware. Then, however, we're |
212 | * faced with having to adopt two different TSF timers... | 210 | * faced with having to adopt two different TSF timers... |
213 | */ | 211 | */ |
214 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && | 212 | if (sdata->vif.type == NL80211_IFTYPE_ADHOC && |
215 | nsdata->vif.type == IEEE80211_IF_TYPE_IBSS) | 213 | nsdata->vif.type == NL80211_IFTYPE_ADHOC) |
216 | return -EBUSY; | 214 | return -EBUSY; |
217 | 215 | ||
218 | /* | 216 | /* |
@@ -232,37 +230,38 @@ static int ieee80211_open(struct net_device *dev) | |||
232 | /* | 230 | /* |
233 | * can only add VLANs to enabled APs | 231 | * can only add VLANs to enabled APs |
234 | */ | 232 | */ |
235 | if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN && | 233 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN && |
236 | nsdata->vif.type == IEEE80211_IF_TYPE_AP) | 234 | nsdata->vif.type == NL80211_IFTYPE_AP) |
237 | sdata->bss = &nsdata->u.ap; | 235 | sdata->bss = &nsdata->u.ap; |
238 | } | 236 | } |
239 | } | 237 | } |
240 | 238 | ||
241 | switch (sdata->vif.type) { | 239 | switch (sdata->vif.type) { |
242 | case IEEE80211_IF_TYPE_WDS: | 240 | case NL80211_IFTYPE_WDS: |
243 | if (!is_valid_ether_addr(sdata->u.wds.remote_addr)) | 241 | if (!is_valid_ether_addr(sdata->u.wds.remote_addr)) |
244 | return -ENOLINK; | 242 | return -ENOLINK; |
245 | break; | 243 | break; |
246 | case IEEE80211_IF_TYPE_VLAN: | 244 | case NL80211_IFTYPE_AP_VLAN: |
247 | if (!sdata->bss) | 245 | if (!sdata->bss) |
248 | return -ENOLINK; | 246 | return -ENOLINK; |
249 | list_add(&sdata->u.vlan.list, &sdata->bss->vlans); | 247 | list_add(&sdata->u.vlan.list, &sdata->bss->vlans); |
250 | break; | 248 | break; |
251 | case IEEE80211_IF_TYPE_AP: | 249 | case NL80211_IFTYPE_AP: |
252 | sdata->bss = &sdata->u.ap; | 250 | sdata->bss = &sdata->u.ap; |
253 | break; | 251 | break; |
254 | case IEEE80211_IF_TYPE_MESH_POINT: | 252 | case NL80211_IFTYPE_MESH_POINT: |
255 | if (!ieee80211_vif_is_mesh(&sdata->vif)) | 253 | if (!ieee80211_vif_is_mesh(&sdata->vif)) |
256 | break; | 254 | break; |
257 | /* mesh ifaces must set allmulti to forward mcast traffic */ | 255 | /* mesh ifaces must set allmulti to forward mcast traffic */ |
258 | atomic_inc(&local->iff_allmultis); | 256 | atomic_inc(&local->iff_allmultis); |
259 | break; | 257 | break; |
260 | case IEEE80211_IF_TYPE_STA: | 258 | case NL80211_IFTYPE_STATION: |
261 | case IEEE80211_IF_TYPE_MNTR: | 259 | case NL80211_IFTYPE_MONITOR: |
262 | case IEEE80211_IF_TYPE_IBSS: | 260 | case NL80211_IFTYPE_ADHOC: |
263 | /* no special treatment */ | 261 | /* no special treatment */ |
264 | break; | 262 | break; |
265 | case IEEE80211_IF_TYPE_INVALID: | 263 | case NL80211_IFTYPE_UNSPECIFIED: |
264 | case __NL80211_IFTYPE_AFTER_LAST: | ||
266 | /* cannot happen */ | 265 | /* cannot happen */ |
267 | WARN_ON(1); | 266 | WARN_ON(1); |
268 | break; | 267 | break; |
@@ -309,10 +308,10 @@ static int ieee80211_open(struct net_device *dev) | |||
309 | } | 308 | } |
310 | 309 | ||
311 | switch (sdata->vif.type) { | 310 | switch (sdata->vif.type) { |
312 | case IEEE80211_IF_TYPE_VLAN: | 311 | case NL80211_IFTYPE_AP_VLAN: |
313 | /* no need to tell driver */ | 312 | /* no need to tell driver */ |
314 | break; | 313 | break; |
315 | case IEEE80211_IF_TYPE_MNTR: | 314 | case NL80211_IFTYPE_MONITOR: |
316 | if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { | 315 | if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { |
317 | local->cooked_mntrs++; | 316 | local->cooked_mntrs++; |
318 | break; | 317 | break; |
@@ -336,8 +335,8 @@ static int ieee80211_open(struct net_device *dev) | |||
336 | ieee80211_configure_filter(local); | 335 | ieee80211_configure_filter(local); |
337 | netif_addr_unlock_bh(local->mdev); | 336 | netif_addr_unlock_bh(local->mdev); |
338 | break; | 337 | break; |
339 | case IEEE80211_IF_TYPE_STA: | 338 | case NL80211_IFTYPE_STATION: |
340 | case IEEE80211_IF_TYPE_IBSS: | 339 | case NL80211_IFTYPE_ADHOC: |
341 | sdata->u.sta.flags &= ~IEEE80211_STA_PREV_BSSID_SET; | 340 | sdata->u.sta.flags &= ~IEEE80211_STA_PREV_BSSID_SET; |
342 | /* fall through */ | 341 | /* fall through */ |
343 | default: | 342 | default: |
@@ -354,14 +353,14 @@ static int ieee80211_open(struct net_device *dev) | |||
354 | ieee80211_bss_info_change_notify(sdata, changed); | 353 | ieee80211_bss_info_change_notify(sdata, changed); |
355 | ieee80211_enable_keys(sdata); | 354 | ieee80211_enable_keys(sdata); |
356 | 355 | ||
357 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA && | 356 | if (sdata->vif.type == NL80211_IFTYPE_STATION && |
358 | !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) | 357 | !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) |
359 | netif_carrier_off(dev); | 358 | netif_carrier_off(dev); |
360 | else | 359 | else |
361 | netif_carrier_on(dev); | 360 | netif_carrier_on(dev); |
362 | } | 361 | } |
363 | 362 | ||
364 | if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { | 363 | if (sdata->vif.type == NL80211_IFTYPE_WDS) { |
365 | /* Create STA entry for the WDS peer */ | 364 | /* Create STA entry for the WDS peer */ |
366 | sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr, | 365 | sta = sta_info_alloc(sdata, sdata->u.wds.remote_addr, |
367 | GFP_KERNEL); | 366 | GFP_KERNEL); |
@@ -417,8 +416,8 @@ static int ieee80211_open(struct net_device *dev) | |||
417 | * yet be effective. Trigger execution of ieee80211_sta_work | 416 | * yet be effective. Trigger execution of ieee80211_sta_work |
418 | * to fix this. | 417 | * to fix this. |
419 | */ | 418 | */ |
420 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 419 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
421 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 420 | sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
422 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 421 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
423 | queue_work(local->hw.workqueue, &ifsta->work); | 422 | queue_work(local->hw.workqueue, &ifsta->work); |
424 | } | 423 | } |
@@ -433,7 +432,7 @@ static int ieee80211_open(struct net_device *dev) | |||
433 | local->ops->stop(local_to_hw(local)); | 432 | local->ops->stop(local_to_hw(local)); |
434 | err_del_bss: | 433 | err_del_bss: |
435 | sdata->bss = NULL; | 434 | sdata->bss = NULL; |
436 | if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN) | 435 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
437 | list_del(&sdata->u.vlan.list); | 436 | list_del(&sdata->u.vlan.list); |
438 | return res; | 437 | return res; |
439 | } | 438 | } |
@@ -496,7 +495,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
496 | dev_mc_unsync(local->mdev, dev); | 495 | dev_mc_unsync(local->mdev, dev); |
497 | 496 | ||
498 | /* APs need special treatment */ | 497 | /* APs need special treatment */ |
499 | if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { | 498 | if (sdata->vif.type == NL80211_IFTYPE_AP) { |
500 | struct ieee80211_sub_if_data *vlan, *tmp; | 499 | struct ieee80211_sub_if_data *vlan, *tmp; |
501 | struct beacon_data *old_beacon = sdata->u.ap.beacon; | 500 | struct beacon_data *old_beacon = sdata->u.ap.beacon; |
502 | 501 | ||
@@ -515,11 +514,11 @@ static int ieee80211_stop(struct net_device *dev) | |||
515 | local->open_count--; | 514 | local->open_count--; |
516 | 515 | ||
517 | switch (sdata->vif.type) { | 516 | switch (sdata->vif.type) { |
518 | case IEEE80211_IF_TYPE_VLAN: | 517 | case NL80211_IFTYPE_AP_VLAN: |
519 | list_del(&sdata->u.vlan.list); | 518 | list_del(&sdata->u.vlan.list); |
520 | /* no need to tell driver */ | 519 | /* no need to tell driver */ |
521 | break; | 520 | break; |
522 | case IEEE80211_IF_TYPE_MNTR: | 521 | case NL80211_IFTYPE_MONITOR: |
523 | if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { | 522 | if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) { |
524 | local->cooked_mntrs--; | 523 | local->cooked_mntrs--; |
525 | break; | 524 | break; |
@@ -542,8 +541,8 @@ static int ieee80211_stop(struct net_device *dev) | |||
542 | ieee80211_configure_filter(local); | 541 | ieee80211_configure_filter(local); |
543 | netif_addr_unlock_bh(local->mdev); | 542 | netif_addr_unlock_bh(local->mdev); |
544 | break; | 543 | break; |
545 | case IEEE80211_IF_TYPE_STA: | 544 | case NL80211_IFTYPE_STATION: |
546 | case IEEE80211_IF_TYPE_IBSS: | 545 | case NL80211_IFTYPE_ADHOC: |
547 | sdata->u.sta.state = IEEE80211_STA_MLME_DISABLED; | 546 | sdata->u.sta.state = IEEE80211_STA_MLME_DISABLED; |
548 | memset(sdata->u.sta.bssid, 0, ETH_ALEN); | 547 | memset(sdata->u.sta.bssid, 0, ETH_ALEN); |
549 | del_timer_sync(&sdata->u.sta.timer); | 548 | del_timer_sync(&sdata->u.sta.timer); |
@@ -569,7 +568,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
569 | sdata->u.sta.extra_ie = NULL; | 568 | sdata->u.sta.extra_ie = NULL; |
570 | sdata->u.sta.extra_ie_len = 0; | 569 | sdata->u.sta.extra_ie_len = 0; |
571 | /* fall through */ | 570 | /* fall through */ |
572 | case IEEE80211_IF_TYPE_MESH_POINT: | 571 | case NL80211_IFTYPE_MESH_POINT: |
573 | if (ieee80211_vif_is_mesh(&sdata->vif)) { | 572 | if (ieee80211_vif_is_mesh(&sdata->vif)) { |
574 | /* allmulti is always set on mesh ifaces */ | 573 | /* allmulti is always set on mesh ifaces */ |
575 | atomic_dec(&local->iff_allmultis); | 574 | atomic_dec(&local->iff_allmultis); |
@@ -698,12 +697,12 @@ int ieee80211_if_config(struct ieee80211_sub_if_data *sdata, u32 changed) | |||
698 | memset(&conf, 0, sizeof(conf)); | 697 | memset(&conf, 0, sizeof(conf)); |
699 | conf.changed = changed; | 698 | conf.changed = changed; |
700 | 699 | ||
701 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 700 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
702 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 701 | sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
703 | conf.bssid = sdata->u.sta.bssid; | 702 | conf.bssid = sdata->u.sta.bssid; |
704 | conf.ssid = sdata->u.sta.ssid; | 703 | conf.ssid = sdata->u.sta.ssid; |
705 | conf.ssid_len = sdata->u.sta.ssid_len; | 704 | conf.ssid_len = sdata->u.sta.ssid_len; |
706 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { | 705 | } else if (sdata->vif.type == NL80211_IFTYPE_AP) { |
707 | conf.bssid = sdata->dev->dev_addr; | 706 | conf.bssid = sdata->dev->dev_addr; |
708 | conf.ssid = sdata->u.ap.ssid; | 707 | conf.ssid = sdata->u.ap.ssid; |
709 | conf.ssid_len = sdata->u.ap.ssid_len; | 708 | conf.ssid_len = sdata->u.ap.ssid_len; |
@@ -1204,7 +1203,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb) | |||
1204 | 1203 | ||
1205 | rcu_read_lock(); | 1204 | rcu_read_lock(); |
1206 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 1205 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
1207 | if (sdata->vif.type == IEEE80211_IF_TYPE_MNTR) { | 1206 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR) { |
1208 | if (!netif_running(sdata->dev)) | 1207 | if (!netif_running(sdata->dev)) |
1209 | continue; | 1208 | continue; |
1210 | 1209 | ||
@@ -1450,7 +1449,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw) | |||
1450 | 1449 | ||
1451 | /* add one default STA interface */ | 1450 | /* add one default STA interface */ |
1452 | result = ieee80211_if_add(local, "wlan%d", NULL, | 1451 | result = ieee80211_if_add(local, "wlan%d", NULL, |
1453 | IEEE80211_IF_TYPE_STA, NULL); | 1452 | NL80211_IFTYPE_STATION, NULL); |
1454 | if (result) | 1453 | if (result) |
1455 | printk(KERN_WARNING "%s: Failed to add default virtual iface\n", | 1454 | printk(KERN_WARNING "%s: Failed to add default virtual iface\n", |
1456 | wiphy_name(local->hw.wiphy)); | 1455 | wiphy_name(local->hw.wiphy)); |
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 | ||
2274 | static void ieee80211_restart_sta_timer(struct ieee80211_sub_if_data *sdata) | 2274 | static 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); |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 33530b29c422..8c3dda5f00b2 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -295,7 +295,7 @@ ieee80211_rx_monitor(struct ieee80211_local *local, struct sk_buff *origskb, | |||
295 | if (!netif_running(sdata->dev)) | 295 | if (!netif_running(sdata->dev)) |
296 | continue; | 296 | continue; |
297 | 297 | ||
298 | if (sdata->vif.type != IEEE80211_IF_TYPE_MNTR) | 298 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR) |
299 | continue; | 299 | continue; |
300 | 300 | ||
301 | if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) | 301 | if (sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES) |
@@ -512,7 +512,7 @@ ieee80211_rx_h_check(struct ieee80211_rx_data *rx) | |||
512 | 512 | ||
513 | if (unlikely((ieee80211_is_data(hdr->frame_control) || | 513 | if (unlikely((ieee80211_is_data(hdr->frame_control) || |
514 | ieee80211_is_pspoll(hdr->frame_control)) && | 514 | ieee80211_is_pspoll(hdr->frame_control)) && |
515 | rx->sdata->vif.type != IEEE80211_IF_TYPE_IBSS && | 515 | rx->sdata->vif.type != NL80211_IFTYPE_ADHOC && |
516 | (!rx->sta || !test_sta_flags(rx->sta, WLAN_STA_ASSOC)))) { | 516 | (!rx->sta || !test_sta_flags(rx->sta, WLAN_STA_ASSOC)))) { |
517 | if ((!ieee80211_has_fromds(hdr->frame_control) && | 517 | if ((!ieee80211_has_fromds(hdr->frame_control) && |
518 | !ieee80211_has_tods(hdr->frame_control) && | 518 | !ieee80211_has_tods(hdr->frame_control) && |
@@ -724,14 +724,14 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) | |||
724 | /* Update last_rx only for IBSS packets which are for the current | 724 | /* Update last_rx only for IBSS packets which are for the current |
725 | * BSSID to avoid keeping the current IBSS network alive in cases where | 725 | * BSSID to avoid keeping the current IBSS network alive in cases where |
726 | * other STAs are using different BSSID. */ | 726 | * other STAs are using different BSSID. */ |
727 | if (rx->sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 727 | if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
728 | u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, | 728 | u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, |
729 | IEEE80211_IF_TYPE_IBSS); | 729 | NL80211_IFTYPE_ADHOC); |
730 | if (compare_ether_addr(bssid, rx->sdata->u.sta.bssid) == 0) | 730 | if (compare_ether_addr(bssid, rx->sdata->u.sta.bssid) == 0) |
731 | sta->last_rx = jiffies; | 731 | sta->last_rx = jiffies; |
732 | } else | 732 | } else |
733 | if (!is_multicast_ether_addr(hdr->addr1) || | 733 | if (!is_multicast_ether_addr(hdr->addr1) || |
734 | rx->sdata->vif.type == IEEE80211_IF_TYPE_STA) { | 734 | rx->sdata->vif.type == NL80211_IFTYPE_STATION) { |
735 | /* Update last_rx only for unicast frames in order to prevent | 735 | /* Update last_rx only for unicast frames in order to prevent |
736 | * the Probe Request frames (the only broadcast frames from a | 736 | * the Probe Request frames (the only broadcast frames from a |
737 | * STA in infrastructure mode) from keeping a connection alive. | 737 | * STA in infrastructure mode) from keeping a connection alive. |
@@ -751,8 +751,8 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) | |||
751 | sta->last_noise = rx->status->noise; | 751 | sta->last_noise = rx->status->noise; |
752 | 752 | ||
753 | if (!ieee80211_has_morefrags(hdr->frame_control) && | 753 | if (!ieee80211_has_morefrags(hdr->frame_control) && |
754 | (rx->sdata->vif.type == IEEE80211_IF_TYPE_AP || | 754 | (rx->sdata->vif.type == NL80211_IFTYPE_AP || |
755 | rx->sdata->vif.type == IEEE80211_IF_TYPE_VLAN)) { | 755 | rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) { |
756 | /* Change STA power saving mode only in the end of a frame | 756 | /* Change STA power saving mode only in the end of a frame |
757 | * exchange sequence */ | 757 | * exchange sequence */ |
758 | if (test_sta_flags(sta, WLAN_STA_PS) && | 758 | if (test_sta_flags(sta, WLAN_STA_PS) && |
@@ -982,8 +982,8 @@ ieee80211_rx_h_ps_poll(struct ieee80211_rx_data *rx) | |||
982 | !(rx->flags & IEEE80211_RX_RA_MATCH))) | 982 | !(rx->flags & IEEE80211_RX_RA_MATCH))) |
983 | return RX_CONTINUE; | 983 | return RX_CONTINUE; |
984 | 984 | ||
985 | if ((sdata->vif.type != IEEE80211_IF_TYPE_AP) && | 985 | if ((sdata->vif.type != NL80211_IFTYPE_AP) && |
986 | (sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) | 986 | (sdata->vif.type != NL80211_IFTYPE_AP_VLAN)) |
987 | return RX_DROP_UNUSABLE; | 987 | return RX_DROP_UNUSABLE; |
988 | 988 | ||
989 | skb = skb_dequeue(&rx->sta->tx_filtered); | 989 | skb = skb_dequeue(&rx->sta->tx_filtered); |
@@ -1131,23 +1131,23 @@ ieee80211_data_to_8023(struct ieee80211_rx_data *rx) | |||
1131 | switch (hdr->frame_control & | 1131 | switch (hdr->frame_control & |
1132 | cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) { | 1132 | cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) { |
1133 | case __constant_cpu_to_le16(IEEE80211_FCTL_TODS): | 1133 | case __constant_cpu_to_le16(IEEE80211_FCTL_TODS): |
1134 | if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_AP && | 1134 | if (unlikely(sdata->vif.type != NL80211_IFTYPE_AP && |
1135 | sdata->vif.type != IEEE80211_IF_TYPE_VLAN)) | 1135 | sdata->vif.type != NL80211_IFTYPE_AP_VLAN)) |
1136 | return -1; | 1136 | return -1; |
1137 | break; | 1137 | break; |
1138 | case __constant_cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS): | 1138 | case __constant_cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS): |
1139 | if (unlikely(sdata->vif.type != IEEE80211_IF_TYPE_WDS && | 1139 | if (unlikely(sdata->vif.type != NL80211_IFTYPE_WDS && |
1140 | sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT)) | 1140 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT)) |
1141 | return -1; | 1141 | return -1; |
1142 | break; | 1142 | break; |
1143 | case __constant_cpu_to_le16(IEEE80211_FCTL_FROMDS): | 1143 | case __constant_cpu_to_le16(IEEE80211_FCTL_FROMDS): |
1144 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA || | 1144 | if (sdata->vif.type != NL80211_IFTYPE_STATION || |
1145 | (is_multicast_ether_addr(dst) && | 1145 | (is_multicast_ether_addr(dst) && |
1146 | !compare_ether_addr(src, dev->dev_addr))) | 1146 | !compare_ether_addr(src, dev->dev_addr))) |
1147 | return -1; | 1147 | return -1; |
1148 | break; | 1148 | break; |
1149 | case __constant_cpu_to_le16(0): | 1149 | case __constant_cpu_to_le16(0): |
1150 | if (sdata->vif.type != IEEE80211_IF_TYPE_IBSS) | 1150 | if (sdata->vif.type != NL80211_IFTYPE_ADHOC) |
1151 | return -1; | 1151 | return -1; |
1152 | break; | 1152 | break; |
1153 | } | 1153 | } |
@@ -1221,8 +1221,8 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) | |||
1221 | skb = rx->skb; | 1221 | skb = rx->skb; |
1222 | xmit_skb = NULL; | 1222 | xmit_skb = NULL; |
1223 | 1223 | ||
1224 | if ((sdata->vif.type == IEEE80211_IF_TYPE_AP || | 1224 | if ((sdata->vif.type == NL80211_IFTYPE_AP || |
1225 | sdata->vif.type == IEEE80211_IF_TYPE_VLAN) && | 1225 | sdata->vif.type == NL80211_IFTYPE_AP_VLAN) && |
1226 | !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) && | 1226 | !(sdata->flags & IEEE80211_SDATA_DONT_BRIDGE_PACKETS) && |
1227 | (rx->flags & IEEE80211_RX_RA_MATCH)) { | 1227 | (rx->flags & IEEE80211_RX_RA_MATCH)) { |
1228 | if (is_multicast_ether_addr(ehdr->h_dest)) { | 1228 | if (is_multicast_ether_addr(ehdr->h_dest)) { |
@@ -1536,8 +1536,8 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) | |||
1536 | * FIXME: revisit this, I'm sure we should handle most | 1536 | * FIXME: revisit this, I'm sure we should handle most |
1537 | * of these frames in other modes as well! | 1537 | * of these frames in other modes as well! |
1538 | */ | 1538 | */ |
1539 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA && | 1539 | if (sdata->vif.type != NL80211_IFTYPE_STATION && |
1540 | sdata->vif.type != IEEE80211_IF_TYPE_IBSS) | 1540 | sdata->vif.type != NL80211_IFTYPE_ADHOC) |
1541 | return RX_DROP_MONITOR; | 1541 | return RX_DROP_MONITOR; |
1542 | 1542 | ||
1543 | switch (mgmt->u.action.category) { | 1543 | switch (mgmt->u.action.category) { |
@@ -1595,8 +1595,8 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) | |||
1595 | if (ieee80211_vif_is_mesh(&sdata->vif)) | 1595 | if (ieee80211_vif_is_mesh(&sdata->vif)) |
1596 | return ieee80211_mesh_rx_mgmt(sdata, rx->skb, rx->status); | 1596 | return ieee80211_mesh_rx_mgmt(sdata, rx->skb, rx->status); |
1597 | 1597 | ||
1598 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA && | 1598 | if (sdata->vif.type != NL80211_IFTYPE_STATION && |
1599 | sdata->vif.type != IEEE80211_IF_TYPE_IBSS) | 1599 | sdata->vif.type != NL80211_IFTYPE_ADHOC) |
1600 | return RX_DROP_MONITOR; | 1600 | return RX_DROP_MONITOR; |
1601 | 1601 | ||
1602 | if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) | 1602 | if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) |
@@ -1632,7 +1632,7 @@ static void ieee80211_rx_michael_mic_report(struct net_device *dev, | |||
1632 | if (!ieee80211_has_protected(hdr->frame_control)) | 1632 | if (!ieee80211_has_protected(hdr->frame_control)) |
1633 | goto ignore; | 1633 | goto ignore; |
1634 | 1634 | ||
1635 | if (rx->sdata->vif.type == IEEE80211_IF_TYPE_AP && keyidx) { | 1635 | if (rx->sdata->vif.type == NL80211_IFTYPE_AP && keyidx) { |
1636 | /* | 1636 | /* |
1637 | * APs with pairwise keys should never receive Michael MIC | 1637 | * APs with pairwise keys should never receive Michael MIC |
1638 | * errors for non-zero keyidx because these are reserved for | 1638 | * errors for non-zero keyidx because these are reserved for |
@@ -1702,7 +1702,7 @@ static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx) | |||
1702 | if (!netif_running(sdata->dev)) | 1702 | if (!netif_running(sdata->dev)) |
1703 | continue; | 1703 | continue; |
1704 | 1704 | ||
1705 | if (sdata->vif.type != IEEE80211_IF_TYPE_MNTR || | 1705 | if (sdata->vif.type != NL80211_IFTYPE_MONITOR || |
1706 | !(sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES)) | 1706 | !(sdata->u.mntr_flags & MONITOR_FLAG_COOK_FRAMES)) |
1707 | continue; | 1707 | continue; |
1708 | 1708 | ||
@@ -1801,7 +1801,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1801 | int multicast = is_multicast_ether_addr(hdr->addr1); | 1801 | int multicast = is_multicast_ether_addr(hdr->addr1); |
1802 | 1802 | ||
1803 | switch (sdata->vif.type) { | 1803 | switch (sdata->vif.type) { |
1804 | case IEEE80211_IF_TYPE_STA: | 1804 | case NL80211_IFTYPE_STATION: |
1805 | if (!bssid) | 1805 | if (!bssid) |
1806 | return 0; | 1806 | return 0; |
1807 | if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { | 1807 | if (!ieee80211_bssid_match(bssid, sdata->u.sta.bssid)) { |
@@ -1816,7 +1816,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1816 | rx->flags &= ~IEEE80211_RX_RA_MATCH; | 1816 | rx->flags &= ~IEEE80211_RX_RA_MATCH; |
1817 | } | 1817 | } |
1818 | break; | 1818 | break; |
1819 | case IEEE80211_IF_TYPE_IBSS: | 1819 | case NL80211_IFTYPE_ADHOC: |
1820 | if (!bssid) | 1820 | if (!bssid) |
1821 | return 0; | 1821 | return 0; |
1822 | if (ieee80211_is_beacon(hdr->frame_control)) { | 1822 | if (ieee80211_is_beacon(hdr->frame_control)) { |
@@ -1837,7 +1837,7 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1837 | bssid, hdr->addr2, | 1837 | bssid, hdr->addr2, |
1838 | BIT(rx->status->rate_idx)); | 1838 | BIT(rx->status->rate_idx)); |
1839 | break; | 1839 | break; |
1840 | case IEEE80211_IF_TYPE_MESH_POINT: | 1840 | case NL80211_IFTYPE_MESH_POINT: |
1841 | if (!multicast && | 1841 | if (!multicast && |
1842 | compare_ether_addr(sdata->dev->dev_addr, | 1842 | compare_ether_addr(sdata->dev->dev_addr, |
1843 | hdr->addr1) != 0) { | 1843 | hdr->addr1) != 0) { |
@@ -1847,8 +1847,8 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1847 | rx->flags &= ~IEEE80211_RX_RA_MATCH; | 1847 | rx->flags &= ~IEEE80211_RX_RA_MATCH; |
1848 | } | 1848 | } |
1849 | break; | 1849 | break; |
1850 | case IEEE80211_IF_TYPE_VLAN: | 1850 | case NL80211_IFTYPE_AP_VLAN: |
1851 | case IEEE80211_IF_TYPE_AP: | 1851 | case NL80211_IFTYPE_AP: |
1852 | if (!bssid) { | 1852 | if (!bssid) { |
1853 | if (compare_ether_addr(sdata->dev->dev_addr, | 1853 | if (compare_ether_addr(sdata->dev->dev_addr, |
1854 | hdr->addr1)) | 1854 | hdr->addr1)) |
@@ -1860,16 +1860,17 @@ static int prepare_for_handlers(struct ieee80211_sub_if_data *sdata, | |||
1860 | rx->flags &= ~IEEE80211_RX_RA_MATCH; | 1860 | rx->flags &= ~IEEE80211_RX_RA_MATCH; |
1861 | } | 1861 | } |
1862 | break; | 1862 | break; |
1863 | case IEEE80211_IF_TYPE_WDS: | 1863 | case NL80211_IFTYPE_WDS: |
1864 | if (bssid || !ieee80211_is_data(hdr->frame_control)) | 1864 | if (bssid || !ieee80211_is_data(hdr->frame_control)) |
1865 | return 0; | 1865 | return 0; |
1866 | if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2)) | 1866 | if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2)) |
1867 | return 0; | 1867 | return 0; |
1868 | break; | 1868 | break; |
1869 | case IEEE80211_IF_TYPE_MNTR: | 1869 | case NL80211_IFTYPE_MONITOR: |
1870 | /* take everything */ | 1870 | /* take everything */ |
1871 | break; | 1871 | break; |
1872 | case IEEE80211_IF_TYPE_INVALID: | 1872 | case NL80211_IFTYPE_UNSPECIFIED: |
1873 | case __NL80211_IFTYPE_AFTER_LAST: | ||
1873 | /* should never get here */ | 1874 | /* should never get here */ |
1874 | WARN_ON(1); | 1875 | WARN_ON(1); |
1875 | break; | 1876 | break; |
@@ -1930,7 +1931,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
1930 | if (!netif_running(sdata->dev)) | 1931 | if (!netif_running(sdata->dev)) |
1931 | continue; | 1932 | continue; |
1932 | 1933 | ||
1933 | if (sdata->vif.type == IEEE80211_IF_TYPE_MNTR) | 1934 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR) |
1934 | continue; | 1935 | continue; |
1935 | 1936 | ||
1936 | bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.type); | 1937 | bssid = ieee80211_get_bssid(hdr, skb->len, sdata->vif.type); |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 5e719e7b720b..8e6685e7ae85 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -475,7 +475,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw) | |||
475 | rcu_read_lock(); | 475 | rcu_read_lock(); |
476 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 476 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
477 | /* Tell AP we're back */ | 477 | /* Tell AP we're back */ |
478 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { | 478 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
479 | if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { | 479 | if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { |
480 | ieee80211_send_nullfunc(local, sdata, 0); | 480 | ieee80211_send_nullfunc(local, sdata, 0); |
481 | netif_tx_wake_all_queues(sdata->dev); | 481 | netif_tx_wake_all_queues(sdata->dev); |
@@ -539,7 +539,7 @@ void ieee80211_scan_work(struct work_struct *work) | |||
539 | chan = &sband->channels[local->scan_channel_idx]; | 539 | chan = &sband->channels[local->scan_channel_idx]; |
540 | 540 | ||
541 | if (chan->flags & IEEE80211_CHAN_DISABLED || | 541 | if (chan->flags & IEEE80211_CHAN_DISABLED || |
542 | (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && | 542 | (sdata->vif.type == NL80211_IFTYPE_ADHOC && |
543 | chan->flags & IEEE80211_CHAN_NO_IBSS)) | 543 | chan->flags & IEEE80211_CHAN_NO_IBSS)) |
544 | skip = 1; | 544 | skip = 1; |
545 | 545 | ||
@@ -638,7 +638,7 @@ int ieee80211_start_scan(struct ieee80211_sub_if_data *scan_sdata, | |||
638 | 638 | ||
639 | rcu_read_lock(); | 639 | rcu_read_lock(); |
640 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 640 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
641 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { | 641 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
642 | if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { | 642 | if (sdata->u.sta.flags & IEEE80211_STA_ASSOCIATED) { |
643 | netif_tx_stop_all_queues(sdata->dev); | 643 | netif_tx_stop_all_queues(sdata->dev); |
644 | ieee80211_send_nullfunc(local, sdata, 1); | 644 | ieee80211_send_nullfunc(local, sdata, 1); |
@@ -681,7 +681,7 @@ int ieee80211_request_scan(struct ieee80211_sub_if_data *sdata, | |||
681 | struct ieee80211_local *local = sdata->local; | 681 | struct ieee80211_local *local = sdata->local; |
682 | struct ieee80211_if_sta *ifsta; | 682 | struct ieee80211_if_sta *ifsta; |
683 | 683 | ||
684 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA) | 684 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
685 | return ieee80211_start_scan(sdata, ssid, ssid_len); | 685 | return ieee80211_start_scan(sdata, ssid, ssid_len); |
686 | 686 | ||
687 | /* | 687 | /* |
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 3370b2625633..31246d8e5327 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c | |||
@@ -319,7 +319,7 @@ int sta_info_insert(struct sta_info *sta) | |||
319 | 319 | ||
320 | /* notify driver */ | 320 | /* notify driver */ |
321 | if (local->ops->sta_notify) { | 321 | if (local->ops->sta_notify) { |
322 | if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN) | 322 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
323 | sdata = container_of(sdata->bss, | 323 | sdata = container_of(sdata->bss, |
324 | struct ieee80211_sub_if_data, | 324 | struct ieee80211_sub_if_data, |
325 | u.ap); | 325 | u.ap); |
@@ -456,7 +456,7 @@ static void __sta_info_unlink(struct sta_info **sta) | |||
456 | local->num_sta--; | 456 | local->num_sta--; |
457 | 457 | ||
458 | if (local->ops->sta_notify) { | 458 | if (local->ops->sta_notify) { |
459 | if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN) | 459 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
460 | sdata = container_of(sdata->bss, | 460 | sdata = container_of(sdata->bss, |
461 | struct ieee80211_sub_if_data, | 461 | struct ieee80211_sub_if_data, |
462 | u.ap); | 462 | u.ap); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index a523189f10c4..f4bcc589d674 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -226,7 +226,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) | |||
226 | !ieee80211_is_probe_req(hdr->frame_control)) | 226 | !ieee80211_is_probe_req(hdr->frame_control)) |
227 | return TX_DROP; | 227 | return TX_DROP; |
228 | 228 | ||
229 | if (tx->sdata->vif.type == IEEE80211_IF_TYPE_MESH_POINT) | 229 | if (tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT) |
230 | return TX_CONTINUE; | 230 | return TX_CONTINUE; |
231 | 231 | ||
232 | if (tx->flags & IEEE80211_TX_PS_BUFFERED) | 232 | if (tx->flags & IEEE80211_TX_PS_BUFFERED) |
@@ -236,7 +236,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) | |||
236 | 236 | ||
237 | if (likely(tx->flags & IEEE80211_TX_UNICAST)) { | 237 | if (likely(tx->flags & IEEE80211_TX_UNICAST)) { |
238 | if (unlikely(!(sta_flags & WLAN_STA_ASSOC) && | 238 | if (unlikely(!(sta_flags & WLAN_STA_ASSOC) && |
239 | tx->sdata->vif.type != IEEE80211_IF_TYPE_IBSS && | 239 | tx->sdata->vif.type != NL80211_IFTYPE_ADHOC && |
240 | ieee80211_is_data(hdr->frame_control))) { | 240 | ieee80211_is_data(hdr->frame_control))) { |
241 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG | 241 | #ifdef CONFIG_MAC80211_VERBOSE_DEBUG |
242 | DECLARE_MAC_BUF(mac); | 242 | DECLARE_MAC_BUF(mac); |
@@ -250,7 +250,7 @@ ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) | |||
250 | } else { | 250 | } else { |
251 | if (unlikely(ieee80211_is_data(hdr->frame_control) && | 251 | if (unlikely(ieee80211_is_data(hdr->frame_control) && |
252 | tx->local->num_sta == 0 && | 252 | tx->local->num_sta == 0 && |
253 | tx->sdata->vif.type != IEEE80211_IF_TYPE_IBSS)) { | 253 | tx->sdata->vif.type != NL80211_IFTYPE_ADHOC)) { |
254 | /* | 254 | /* |
255 | * No associated STAs - no need to send multicast | 255 | * No associated STAs - no need to send multicast |
256 | * frames. | 256 | * frames. |
@@ -281,7 +281,7 @@ static void purge_old_ps_buffers(struct ieee80211_local *local) | |||
281 | 281 | ||
282 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 282 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
283 | struct ieee80211_if_ap *ap; | 283 | struct ieee80211_if_ap *ap; |
284 | if (sdata->vif.type != IEEE80211_IF_TYPE_AP) | 284 | if (sdata->vif.type != NL80211_IFTYPE_AP) |
285 | continue; | 285 | continue; |
286 | ap = &sdata->u.ap; | 286 | ap = &sdata->u.ap; |
287 | skb = skb_dequeue(&ap->ps_bc_buf); | 287 | skb = skb_dequeue(&ap->ps_bc_buf); |
@@ -979,7 +979,7 @@ __ieee80211_tx_prepare(struct ieee80211_tx_data *tx, | |||
979 | 979 | ||
980 | /* process and remove the injection radiotap header */ | 980 | /* process and remove the injection radiotap header */ |
981 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 981 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
982 | if (unlikely(sdata->vif.type == IEEE80211_IF_TYPE_MNTR)) { | 982 | if (unlikely(sdata->vif.type == NL80211_IFTYPE_MONITOR)) { |
983 | if (__ieee80211_parse_tx_radiotap(tx, skb) == TX_DROP) | 983 | if (__ieee80211_parse_tx_radiotap(tx, skb) == TX_DROP) |
984 | return TX_DROP; | 984 | return TX_DROP; |
985 | 985 | ||
@@ -1457,8 +1457,8 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1457 | fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA); | 1457 | fc = cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_DATA); |
1458 | 1458 | ||
1459 | switch (sdata->vif.type) { | 1459 | switch (sdata->vif.type) { |
1460 | case IEEE80211_IF_TYPE_AP: | 1460 | case NL80211_IFTYPE_AP: |
1461 | case IEEE80211_IF_TYPE_VLAN: | 1461 | case NL80211_IFTYPE_AP_VLAN: |
1462 | fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS); | 1462 | fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS); |
1463 | /* DA BSSID SA */ | 1463 | /* DA BSSID SA */ |
1464 | memcpy(hdr.addr1, skb->data, ETH_ALEN); | 1464 | memcpy(hdr.addr1, skb->data, ETH_ALEN); |
@@ -1466,7 +1466,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1466 | memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN); | 1466 | memcpy(hdr.addr3, skb->data + ETH_ALEN, ETH_ALEN); |
1467 | hdrlen = 24; | 1467 | hdrlen = 24; |
1468 | break; | 1468 | break; |
1469 | case IEEE80211_IF_TYPE_WDS: | 1469 | case NL80211_IFTYPE_WDS: |
1470 | fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); | 1470 | fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); |
1471 | /* RA TA DA SA */ | 1471 | /* RA TA DA SA */ |
1472 | memcpy(hdr.addr1, sdata->u.wds.remote_addr, ETH_ALEN); | 1472 | memcpy(hdr.addr1, sdata->u.wds.remote_addr, ETH_ALEN); |
@@ -1476,7 +1476,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1476 | hdrlen = 30; | 1476 | hdrlen = 30; |
1477 | break; | 1477 | break; |
1478 | #ifdef CONFIG_MAC80211_MESH | 1478 | #ifdef CONFIG_MAC80211_MESH |
1479 | case IEEE80211_IF_TYPE_MESH_POINT: | 1479 | case NL80211_IFTYPE_MESH_POINT: |
1480 | fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); | 1480 | fc |= cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FCTL_TODS); |
1481 | /* RA TA DA SA */ | 1481 | /* RA TA DA SA */ |
1482 | memset(hdr.addr1, 0, ETH_ALEN); | 1482 | memset(hdr.addr1, 0, ETH_ALEN); |
@@ -1493,7 +1493,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1493 | hdrlen = 30; | 1493 | hdrlen = 30; |
1494 | break; | 1494 | break; |
1495 | #endif | 1495 | #endif |
1496 | case IEEE80211_IF_TYPE_STA: | 1496 | case NL80211_IFTYPE_STATION: |
1497 | fc |= cpu_to_le16(IEEE80211_FCTL_TODS); | 1497 | fc |= cpu_to_le16(IEEE80211_FCTL_TODS); |
1498 | /* BSSID SA DA */ | 1498 | /* BSSID SA DA */ |
1499 | memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN); | 1499 | memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN); |
@@ -1501,7 +1501,7 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1501 | memcpy(hdr.addr3, skb->data, ETH_ALEN); | 1501 | memcpy(hdr.addr3, skb->data, ETH_ALEN); |
1502 | hdrlen = 24; | 1502 | hdrlen = 24; |
1503 | break; | 1503 | break; |
1504 | case IEEE80211_IF_TYPE_IBSS: | 1504 | case NL80211_IFTYPE_ADHOC: |
1505 | /* DA SA BSSID */ | 1505 | /* DA SA BSSID */ |
1506 | memcpy(hdr.addr1, skb->data, ETH_ALEN); | 1506 | memcpy(hdr.addr1, skb->data, ETH_ALEN); |
1507 | memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); | 1507 | memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN); |
@@ -1812,7 +1812,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1812 | sdata = vif_to_sdata(vif); | 1812 | sdata = vif_to_sdata(vif); |
1813 | bdev = sdata->dev; | 1813 | bdev = sdata->dev; |
1814 | 1814 | ||
1815 | if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { | 1815 | if (sdata->vif.type == NL80211_IFTYPE_AP) { |
1816 | ap = &sdata->u.ap; | 1816 | ap = &sdata->u.ap; |
1817 | beacon = rcu_dereference(ap->beacon); | 1817 | beacon = rcu_dereference(ap->beacon); |
1818 | if (ap && beacon) { | 1818 | if (ap && beacon) { |
@@ -1854,7 +1854,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | |||
1854 | num_beacons = &ap->num_beacons; | 1854 | num_beacons = &ap->num_beacons; |
1855 | } else | 1855 | } else |
1856 | goto out; | 1856 | goto out; |
1857 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 1857 | } else if (sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
1858 | struct ieee80211_hdr *hdr; | 1858 | struct ieee80211_hdr *hdr; |
1859 | ifsta = &sdata->u.sta; | 1859 | ifsta = &sdata->u.sta; |
1860 | 1860 | ||
@@ -1999,7 +1999,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, | |||
1999 | rcu_read_lock(); | 1999 | rcu_read_lock(); |
2000 | beacon = rcu_dereference(bss->beacon); | 2000 | beacon = rcu_dereference(bss->beacon); |
2001 | 2001 | ||
2002 | if (sdata->vif.type != IEEE80211_IF_TYPE_AP || !beacon || !beacon->head) | 2002 | if (sdata->vif.type != NL80211_IFTYPE_AP || !beacon || !beacon->head) |
2003 | goto out; | 2003 | goto out; |
2004 | 2004 | ||
2005 | if (bss->dtim_count != 0) | 2005 | if (bss->dtim_count != 0) |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index d6aca91e612d..6eb222369bcb 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -43,7 +43,7 @@ const unsigned char bridge_tunnel_header[] __aligned(2) = | |||
43 | 43 | ||
44 | 44 | ||
45 | u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, | 45 | u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, |
46 | enum ieee80211_if_types type) | 46 | enum nl80211_iftype type) |
47 | { | 47 | { |
48 | __le16 fc = hdr->frame_control; | 48 | __le16 fc = hdr->frame_control; |
49 | 49 | ||
@@ -77,10 +77,10 @@ u8 *ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len, | |||
77 | 77 | ||
78 | if (ieee80211_is_back_req(fc)) { | 78 | if (ieee80211_is_back_req(fc)) { |
79 | switch (type) { | 79 | switch (type) { |
80 | case IEEE80211_IF_TYPE_STA: | 80 | case NL80211_IFTYPE_STATION: |
81 | return hdr->addr2; | 81 | return hdr->addr2; |
82 | case IEEE80211_IF_TYPE_AP: | 82 | case NL80211_IFTYPE_AP: |
83 | case IEEE80211_IF_TYPE_VLAN: | 83 | case NL80211_IFTYPE_AP_VLAN: |
84 | return hdr->addr1; | 84 | return hdr->addr1; |
85 | default: | 85 | default: |
86 | break; /* fall through to the return */ | 86 | break; /* fall through to the return */ |
@@ -376,15 +376,16 @@ void ieee80211_iterate_active_interfaces( | |||
376 | 376 | ||
377 | list_for_each_entry(sdata, &local->interfaces, list) { | 377 | list_for_each_entry(sdata, &local->interfaces, list) { |
378 | switch (sdata->vif.type) { | 378 | switch (sdata->vif.type) { |
379 | case IEEE80211_IF_TYPE_INVALID: | 379 | case __NL80211_IFTYPE_AFTER_LAST: |
380 | case IEEE80211_IF_TYPE_MNTR: | 380 | case NL80211_IFTYPE_UNSPECIFIED: |
381 | case IEEE80211_IF_TYPE_VLAN: | 381 | case NL80211_IFTYPE_MONITOR: |
382 | case NL80211_IFTYPE_AP_VLAN: | ||
382 | continue; | 383 | continue; |
383 | case IEEE80211_IF_TYPE_AP: | 384 | case NL80211_IFTYPE_AP: |
384 | case IEEE80211_IF_TYPE_STA: | 385 | case NL80211_IFTYPE_STATION: |
385 | case IEEE80211_IF_TYPE_IBSS: | 386 | case NL80211_IFTYPE_ADHOC: |
386 | case IEEE80211_IF_TYPE_WDS: | 387 | case NL80211_IFTYPE_WDS: |
387 | case IEEE80211_IF_TYPE_MESH_POINT: | 388 | case NL80211_IFTYPE_MESH_POINT: |
388 | break; | 389 | break; |
389 | } | 390 | } |
390 | if (netif_running(sdata->dev)) | 391 | if (netif_running(sdata->dev)) |
@@ -409,15 +410,16 @@ void ieee80211_iterate_active_interfaces_atomic( | |||
409 | 410 | ||
410 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | 411 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
411 | switch (sdata->vif.type) { | 412 | switch (sdata->vif.type) { |
412 | case IEEE80211_IF_TYPE_INVALID: | 413 | case __NL80211_IFTYPE_AFTER_LAST: |
413 | case IEEE80211_IF_TYPE_MNTR: | 414 | case NL80211_IFTYPE_UNSPECIFIED: |
414 | case IEEE80211_IF_TYPE_VLAN: | 415 | case NL80211_IFTYPE_MONITOR: |
416 | case NL80211_IFTYPE_AP_VLAN: | ||
415 | continue; | 417 | continue; |
416 | case IEEE80211_IF_TYPE_AP: | 418 | case NL80211_IFTYPE_AP: |
417 | case IEEE80211_IF_TYPE_STA: | 419 | case NL80211_IFTYPE_STATION: |
418 | case IEEE80211_IF_TYPE_IBSS: | 420 | case NL80211_IFTYPE_ADHOC: |
419 | case IEEE80211_IF_TYPE_WDS: | 421 | case NL80211_IFTYPE_WDS: |
420 | case IEEE80211_IF_TYPE_MESH_POINT: | 422 | case NL80211_IFTYPE_MESH_POINT: |
421 | break; | 423 | break; |
422 | } | 424 | } |
423 | if (netif_running(sdata->dev)) | 425 | if (netif_running(sdata->dev)) |
@@ -622,7 +624,7 @@ int ieee80211_set_freq(struct ieee80211_sub_if_data *sdata, int freqMHz) | |||
622 | chan = ieee80211_get_channel(local->hw.wiphy, freqMHz); | 624 | chan = ieee80211_get_channel(local->hw.wiphy, freqMHz); |
623 | 625 | ||
624 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { | 626 | if (chan && !(chan->flags & IEEE80211_CHAN_DISABLED)) { |
625 | if (sdata->vif.type == IEEE80211_IF_TYPE_IBSS && | 627 | if (sdata->vif.type == NL80211_IFTYPE_ADHOC && |
626 | chan->flags & IEEE80211_CHAN_NO_IBSS) { | 628 | chan->flags & IEEE80211_CHAN_NO_IBSS) { |
627 | printk(KERN_DEBUG "%s: IBSS not allowed on frequency " | 629 | printk(KERN_DEBUG "%s: IBSS not allowed on frequency " |
628 | "%d MHz\n", sdata->dev->name, chan->center_freq); | 630 | "%d MHz\n", sdata->dev->name, chan->center_freq); |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 77b68ed8b832..aef9707700fd 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -122,8 +122,8 @@ static int ieee80211_ioctl_siwgenie(struct net_device *dev, | |||
122 | if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) | 122 | if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) |
123 | return -EOPNOTSUPP; | 123 | return -EOPNOTSUPP; |
124 | 124 | ||
125 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 125 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
126 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 126 | sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
127 | int ret = ieee80211_sta_set_extra_ie(sdata, extra, data->length); | 127 | int ret = ieee80211_sta_set_extra_ie(sdata, extra, data->length); |
128 | if (ret) | 128 | if (ret) |
129 | return ret; | 129 | return ret; |
@@ -273,21 +273,21 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev, | |||
273 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 273 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
274 | int type; | 274 | int type; |
275 | 275 | ||
276 | if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN) | 276 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
277 | return -EOPNOTSUPP; | 277 | return -EOPNOTSUPP; |
278 | 278 | ||
279 | switch (*mode) { | 279 | switch (*mode) { |
280 | case IW_MODE_INFRA: | 280 | case IW_MODE_INFRA: |
281 | type = IEEE80211_IF_TYPE_STA; | 281 | type = NL80211_IFTYPE_STATION; |
282 | break; | 282 | break; |
283 | case IW_MODE_ADHOC: | 283 | case IW_MODE_ADHOC: |
284 | type = IEEE80211_IF_TYPE_IBSS; | 284 | type = NL80211_IFTYPE_ADHOC; |
285 | break; | 285 | break; |
286 | case IW_MODE_REPEAT: | 286 | case IW_MODE_REPEAT: |
287 | type = IEEE80211_IF_TYPE_WDS; | 287 | type = NL80211_IFTYPE_WDS; |
288 | break; | 288 | break; |
289 | case IW_MODE_MONITOR: | 289 | case IW_MODE_MONITOR: |
290 | type = IEEE80211_IF_TYPE_MNTR; | 290 | type = NL80211_IFTYPE_MONITOR; |
291 | break; | 291 | break; |
292 | default: | 292 | default: |
293 | return -EINVAL; | 293 | return -EINVAL; |
@@ -305,22 +305,22 @@ static int ieee80211_ioctl_giwmode(struct net_device *dev, | |||
305 | 305 | ||
306 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 306 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
307 | switch (sdata->vif.type) { | 307 | switch (sdata->vif.type) { |
308 | case IEEE80211_IF_TYPE_AP: | 308 | case NL80211_IFTYPE_AP: |
309 | *mode = IW_MODE_MASTER; | 309 | *mode = IW_MODE_MASTER; |
310 | break; | 310 | break; |
311 | case IEEE80211_IF_TYPE_STA: | 311 | case NL80211_IFTYPE_STATION: |
312 | *mode = IW_MODE_INFRA; | 312 | *mode = IW_MODE_INFRA; |
313 | break; | 313 | break; |
314 | case IEEE80211_IF_TYPE_IBSS: | 314 | case NL80211_IFTYPE_ADHOC: |
315 | *mode = IW_MODE_ADHOC; | 315 | *mode = IW_MODE_ADHOC; |
316 | break; | 316 | break; |
317 | case IEEE80211_IF_TYPE_MNTR: | 317 | case NL80211_IFTYPE_MONITOR: |
318 | *mode = IW_MODE_MONITOR; | 318 | *mode = IW_MODE_MONITOR; |
319 | break; | 319 | break; |
320 | case IEEE80211_IF_TYPE_WDS: | 320 | case NL80211_IFTYPE_WDS: |
321 | *mode = IW_MODE_REPEAT; | 321 | *mode = IW_MODE_REPEAT; |
322 | break; | 322 | break; |
323 | case IEEE80211_IF_TYPE_VLAN: | 323 | case NL80211_IFTYPE_AP_VLAN: |
324 | *mode = IW_MODE_SECOND; /* FIXME */ | 324 | *mode = IW_MODE_SECOND; /* FIXME */ |
325 | break; | 325 | break; |
326 | default: | 326 | default: |
@@ -336,13 +336,13 @@ static int ieee80211_ioctl_siwfreq(struct net_device *dev, | |||
336 | { | 336 | { |
337 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 337 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
338 | 338 | ||
339 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) | 339 | if (sdata->vif.type == NL80211_IFTYPE_STATION) |
340 | sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_CHANNEL_SEL; | 340 | sdata->u.sta.flags &= ~IEEE80211_STA_AUTO_CHANNEL_SEL; |
341 | 341 | ||
342 | /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */ | 342 | /* freq->e == 0: freq->m = channel; otherwise freq = m * 10^e */ |
343 | if (freq->e == 0) { | 343 | if (freq->e == 0) { |
344 | if (freq->m < 0) { | 344 | if (freq->m < 0) { |
345 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) | 345 | if (sdata->vif.type == NL80211_IFTYPE_STATION) |
346 | sdata->u.sta.flags |= | 346 | sdata->u.sta.flags |= |
347 | IEEE80211_STA_AUTO_CHANNEL_SEL; | 347 | IEEE80211_STA_AUTO_CHANNEL_SEL; |
348 | return 0; | 348 | return 0; |
@@ -386,8 +386,8 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev, | |||
386 | len--; | 386 | len--; |
387 | 387 | ||
388 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 388 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
389 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 389 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
390 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 390 | sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
391 | int ret; | 391 | int ret; |
392 | if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) { | 392 | if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) { |
393 | if (len > IEEE80211_MAX_SSID_LEN) | 393 | if (len > IEEE80211_MAX_SSID_LEN) |
@@ -407,7 +407,7 @@ static int ieee80211_ioctl_siwessid(struct net_device *dev, | |||
407 | return 0; | 407 | return 0; |
408 | } | 408 | } |
409 | 409 | ||
410 | if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { | 410 | if (sdata->vif.type == NL80211_IFTYPE_AP) { |
411 | memcpy(sdata->u.ap.ssid, ssid, len); | 411 | memcpy(sdata->u.ap.ssid, ssid, len); |
412 | memset(sdata->u.ap.ssid + len, 0, | 412 | memset(sdata->u.ap.ssid + len, 0, |
413 | IEEE80211_MAX_SSID_LEN - len); | 413 | IEEE80211_MAX_SSID_LEN - len); |
@@ -426,8 +426,8 @@ static int ieee80211_ioctl_giwessid(struct net_device *dev, | |||
426 | 426 | ||
427 | struct ieee80211_sub_if_data *sdata; | 427 | struct ieee80211_sub_if_data *sdata; |
428 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 428 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
429 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 429 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
430 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 430 | sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
431 | int res = ieee80211_sta_get_ssid(sdata, ssid, &len); | 431 | int res = ieee80211_sta_get_ssid(sdata, ssid, &len); |
432 | if (res == 0) { | 432 | if (res == 0) { |
433 | data->length = len; | 433 | data->length = len; |
@@ -437,7 +437,7 @@ static int ieee80211_ioctl_giwessid(struct net_device *dev, | |||
437 | return res; | 437 | return res; |
438 | } | 438 | } |
439 | 439 | ||
440 | if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { | 440 | if (sdata->vif.type == NL80211_IFTYPE_AP) { |
441 | len = sdata->u.ap.ssid_len; | 441 | len = sdata->u.ap.ssid_len; |
442 | if (len > IW_ESSID_MAX_SIZE) | 442 | if (len > IW_ESSID_MAX_SIZE) |
443 | len = IW_ESSID_MAX_SIZE; | 443 | len = IW_ESSID_MAX_SIZE; |
@@ -457,8 +457,8 @@ static int ieee80211_ioctl_siwap(struct net_device *dev, | |||
457 | struct ieee80211_sub_if_data *sdata; | 457 | struct ieee80211_sub_if_data *sdata; |
458 | 458 | ||
459 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 459 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
460 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 460 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
461 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 461 | sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
462 | int ret; | 462 | int ret; |
463 | if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) { | 463 | if (sdata->flags & IEEE80211_SDATA_USERSPACE_MLME) { |
464 | memcpy(sdata->u.sta.bssid, (u8 *) &ap_addr->sa_data, | 464 | memcpy(sdata->u.sta.bssid, (u8 *) &ap_addr->sa_data, |
@@ -477,7 +477,7 @@ static int ieee80211_ioctl_siwap(struct net_device *dev, | |||
477 | return ret; | 477 | return ret; |
478 | ieee80211_sta_req_auth(sdata, &sdata->u.sta); | 478 | ieee80211_sta_req_auth(sdata, &sdata->u.sta); |
479 | return 0; | 479 | return 0; |
480 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { | 480 | } else if (sdata->vif.type == NL80211_IFTYPE_WDS) { |
481 | /* | 481 | /* |
482 | * If it is necessary to update the WDS peer address | 482 | * If it is necessary to update the WDS peer address |
483 | * while the interface is running, then we need to do | 483 | * while the interface is running, then we need to do |
@@ -505,8 +505,8 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, | |||
505 | struct ieee80211_sub_if_data *sdata; | 505 | struct ieee80211_sub_if_data *sdata; |
506 | 506 | ||
507 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 507 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
508 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 508 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
509 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { | 509 | sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
510 | if (sdata->u.sta.state == IEEE80211_STA_MLME_ASSOCIATED || | 510 | if (sdata->u.sta.state == IEEE80211_STA_MLME_ASSOCIATED || |
511 | sdata->u.sta.state == IEEE80211_STA_MLME_IBSS_JOINED) { | 511 | sdata->u.sta.state == IEEE80211_STA_MLME_IBSS_JOINED) { |
512 | ap_addr->sa_family = ARPHRD_ETHER; | 512 | ap_addr->sa_family = ARPHRD_ETHER; |
@@ -516,7 +516,7 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, | |||
516 | memset(&ap_addr->sa_data, 0, ETH_ALEN); | 516 | memset(&ap_addr->sa_data, 0, ETH_ALEN); |
517 | return 0; | 517 | return 0; |
518 | } | 518 | } |
519 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_WDS) { | 519 | } else if (sdata->vif.type == NL80211_IFTYPE_WDS) { |
520 | ap_addr->sa_family = ARPHRD_ETHER; | 520 | ap_addr->sa_family = ARPHRD_ETHER; |
521 | memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN); | 521 | memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN); |
522 | return 0; | 522 | return 0; |
@@ -538,10 +538,10 @@ static int ieee80211_ioctl_siwscan(struct net_device *dev, | |||
538 | if (!netif_running(dev)) | 538 | if (!netif_running(dev)) |
539 | return -ENETDOWN; | 539 | return -ENETDOWN; |
540 | 540 | ||
541 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA && | 541 | if (sdata->vif.type != NL80211_IFTYPE_STATION && |
542 | sdata->vif.type != IEEE80211_IF_TYPE_IBSS && | 542 | sdata->vif.type != NL80211_IFTYPE_ADHOC && |
543 | sdata->vif.type != IEEE80211_IF_TYPE_MESH_POINT && | 543 | sdata->vif.type != NL80211_IFTYPE_MESH_POINT && |
544 | sdata->vif.type != IEEE80211_IF_TYPE_AP) | 544 | sdata->vif.type != NL80211_IFTYPE_AP) |
545 | return -EOPNOTSUPP; | 545 | return -EOPNOTSUPP; |
546 | 546 | ||
547 | /* if SSID was specified explicitly then use that */ | 547 | /* if SSID was specified explicitly then use that */ |
@@ -627,7 +627,7 @@ static int ieee80211_ioctl_giwrate(struct net_device *dev, | |||
627 | 627 | ||
628 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 628 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
629 | 629 | ||
630 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA) | 630 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
631 | return -EOPNOTSUPP; | 631 | return -EOPNOTSUPP; |
632 | 632 | ||
633 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; | 633 | sband = local->hw.wiphy->bands[local->hw.conf.channel->band]; |
@@ -858,8 +858,8 @@ static int ieee80211_ioctl_siwmlme(struct net_device *dev, | |||
858 | struct iw_mlme *mlme = (struct iw_mlme *) extra; | 858 | struct iw_mlme *mlme = (struct iw_mlme *) extra; |
859 | 859 | ||
860 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 860 | sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
861 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA && | 861 | if (sdata->vif.type != NL80211_IFTYPE_STATION && |
862 | sdata->vif.type != IEEE80211_IF_TYPE_IBSS) | 862 | sdata->vif.type != NL80211_IFTYPE_ADHOC) |
863 | return -EINVAL; | 863 | return -EINVAL; |
864 | 864 | ||
865 | switch (mlme->cmd) { | 865 | switch (mlme->cmd) { |
@@ -954,7 +954,7 @@ static int ieee80211_ioctl_giwencode(struct net_device *dev, | |||
954 | erq->length = sdata->keys[idx]->conf.keylen; | 954 | erq->length = sdata->keys[idx]->conf.keylen; |
955 | erq->flags |= IW_ENCODE_ENABLED; | 955 | erq->flags |= IW_ENCODE_ENABLED; |
956 | 956 | ||
957 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA) { | 957 | if (sdata->vif.type == NL80211_IFTYPE_STATION) { |
958 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; | 958 | struct ieee80211_if_sta *ifsta = &sdata->u.sta; |
959 | switch (ifsta->auth_alg) { | 959 | switch (ifsta->auth_alg) { |
960 | case WLAN_AUTH_OPEN: | 960 | case WLAN_AUTH_OPEN: |
@@ -1028,7 +1028,7 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, | |||
1028 | sdata->drop_unencrypted = !!data->value; | 1028 | sdata->drop_unencrypted = !!data->value; |
1029 | break; | 1029 | break; |
1030 | case IW_AUTH_PRIVACY_INVOKED: | 1030 | case IW_AUTH_PRIVACY_INVOKED: |
1031 | if (sdata->vif.type != IEEE80211_IF_TYPE_STA) | 1031 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
1032 | ret = -EINVAL; | 1032 | ret = -EINVAL; |
1033 | else { | 1033 | else { |
1034 | sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED; | 1034 | sdata->u.sta.flags &= ~IEEE80211_STA_PRIVACY_INVOKED; |
@@ -1043,8 +1043,8 @@ static int ieee80211_ioctl_siwauth(struct net_device *dev, | |||
1043 | } | 1043 | } |
1044 | break; | 1044 | break; |
1045 | case IW_AUTH_80211_AUTH_ALG: | 1045 | case IW_AUTH_80211_AUTH_ALG: |
1046 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 1046 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
1047 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) | 1047 | sdata->vif.type == NL80211_IFTYPE_ADHOC) |
1048 | sdata->u.sta.auth_algs = data->value; | 1048 | sdata->u.sta.auth_algs = data->value; |
1049 | else | 1049 | else |
1050 | ret = -EOPNOTSUPP; | 1050 | ret = -EOPNOTSUPP; |
@@ -1066,8 +1066,8 @@ static struct iw_statistics *ieee80211_get_wireless_stats(struct net_device *dev | |||
1066 | 1066 | ||
1067 | rcu_read_lock(); | 1067 | rcu_read_lock(); |
1068 | 1068 | ||
1069 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 1069 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
1070 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) | 1070 | sdata->vif.type == NL80211_IFTYPE_ADHOC) |
1071 | sta = sta_info_get(local, sdata->u.sta.bssid); | 1071 | sta = sta_info_get(local, sdata->u.sta.bssid); |
1072 | if (!sta) { | 1072 | if (!sta) { |
1073 | wstats->discard.fragment = 0; | 1073 | wstats->discard.fragment = 0; |
@@ -1097,8 +1097,8 @@ static int ieee80211_ioctl_giwauth(struct net_device *dev, | |||
1097 | 1097 | ||
1098 | switch (data->flags & IW_AUTH_INDEX) { | 1098 | switch (data->flags & IW_AUTH_INDEX) { |
1099 | case IW_AUTH_80211_AUTH_ALG: | 1099 | case IW_AUTH_80211_AUTH_ALG: |
1100 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || | 1100 | if (sdata->vif.type == NL80211_IFTYPE_STATION || |
1101 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) | 1101 | sdata->vif.type == NL80211_IFTYPE_ADHOC) |
1102 | data->value = sdata->u.sta.auth_algs; | 1102 | data->value = sdata->u.sta.auth_algs; |
1103 | else | 1103 | else |
1104 | ret = -EOPNOTSUPP; | 1104 | ret = -EOPNOTSUPP; |