aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/iface.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-09-10 18:01:58 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-09-15 16:48:23 -0400
commit05c914fe330fa8e1cc67870dc0d3809dfd96c107 (patch)
treedf53bcab47335f3361c09478d6b1447b7d298536 /net/mac80211/iface.c
parent96dd22ac06b0dbfb069fdf530c72046a941e9694 (diff)
mac80211: use nl80211 interface types
There's really no reason for mac80211 to be using its own interface type defines. Use the nl80211 types and simplify the configuration code a bit: there's no need to translate them any more now. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/iface.c')
-rw-r--r--net/mac80211/iface.c40
1 files changed, 21 insertions, 19 deletions
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 */
83static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, 84static 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
125int ieee80211_if_change_type(struct ieee80211_sub_if_data *sdata, 127int 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
155int ieee80211_if_add(struct ieee80211_local *local, const char *name, 157int 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;