diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 18:01:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:20 -0400 |
commit | 472dbc45dc1966284de72d7de15690c17ed2cf33 (patch) | |
tree | e8bfb88067f7fd8845978d1613f868e6a4499999 /net/mac80211/iface.c | |
parent | 7c95069522d02ff144cd421be6618dce619caf7e (diff) |
mac80211: split off mesh handling entirely
This patch splits off mesh handling from the STA/IBSS.
Unfortunately it increases mesh code size a bit, but I
think it makes things clearer. The patch also reduces
per-interface run-time memory usage.
Also clean up a few places where ifdef is not required.
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.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 672cec60a2fb..ddbaa417e2ec 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -54,10 +54,9 @@ static void ieee80211_teardown_sdata(struct net_device *dev) | |||
54 | 54 | ||
55 | break; | 55 | break; |
56 | case IEEE80211_IF_TYPE_MESH_POINT: | 56 | case IEEE80211_IF_TYPE_MESH_POINT: |
57 | /* Allow compiler to elide mesh_rmc_free call. */ | ||
58 | if (ieee80211_vif_is_mesh(&sdata->vif)) | 57 | if (ieee80211_vif_is_mesh(&sdata->vif)) |
59 | mesh_rmc_free(sdata); | 58 | mesh_rmc_free(sdata); |
60 | /* fall through */ | 59 | break; |
61 | case IEEE80211_IF_TYPE_STA: | 60 | case IEEE80211_IF_TYPE_STA: |
62 | case IEEE80211_IF_TYPE_IBSS: | 61 | case IEEE80211_IF_TYPE_IBSS: |
63 | kfree(sdata->u.sta.extra_ie); | 62 | kfree(sdata->u.sta.extra_ie); |
@@ -100,7 +99,6 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
100 | skb_queue_head_init(&sdata->u.ap.ps_bc_buf); | 99 | skb_queue_head_init(&sdata->u.ap.ps_bc_buf); |
101 | INIT_LIST_HEAD(&sdata->u.ap.vlans); | 100 | INIT_LIST_HEAD(&sdata->u.ap.vlans); |
102 | break; | 101 | break; |
103 | case IEEE80211_IF_TYPE_MESH_POINT: | ||
104 | case IEEE80211_IF_TYPE_STA: | 102 | case IEEE80211_IF_TYPE_STA: |
105 | case IEEE80211_IF_TYPE_IBSS: | 103 | case IEEE80211_IF_TYPE_IBSS: |
106 | ifsta = &sdata->u.sta; | 104 | ifsta = &sdata->u.sta; |
@@ -117,7 +115,8 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata, | |||
117 | IEEE80211_STA_AUTO_CHANNEL_SEL; | 115 | IEEE80211_STA_AUTO_CHANNEL_SEL; |
118 | if (ieee80211_num_regular_queues(&sdata->local->hw) >= 4) | 116 | if (ieee80211_num_regular_queues(&sdata->local->hw) >= 4) |
119 | ifsta->flags |= IEEE80211_STA_WMM_ENABLED; | 117 | ifsta->flags |= IEEE80211_STA_WMM_ENABLED; |
120 | 118 | break; | |
119 | case IEEE80211_IF_TYPE_MESH_POINT: | ||
121 | if (ieee80211_vif_is_mesh(&sdata->vif)) | 120 | if (ieee80211_vif_is_mesh(&sdata->vif)) |
122 | ieee80211_mesh_init_sdata(sdata); | 121 | ieee80211_mesh_init_sdata(sdata); |
123 | break; | 122 | break; |
@@ -225,9 +224,9 @@ int ieee80211_if_add(struct ieee80211_local *local, const char *name, | |||
225 | 224 | ||
226 | if (ieee80211_vif_is_mesh(&sdata->vif) && | 225 | if (ieee80211_vif_is_mesh(&sdata->vif) && |
227 | params && params->mesh_id_len) | 226 | params && params->mesh_id_len) |
228 | ieee80211_if_sta_set_mesh_id(&sdata->u.sta, | 227 | ieee80211_sdata_set_mesh_id(sdata, |
229 | params->mesh_id_len, | 228 | params->mesh_id_len, |
230 | params->mesh_id); | 229 | params->mesh_id); |
231 | 230 | ||
232 | list_add_tail_rcu(&sdata->list, &local->interfaces); | 231 | list_add_tail_rcu(&sdata->list, &local->interfaces); |
233 | 232 | ||