diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-12-18 19:31:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:09:37 -0500 |
commit | 51fb61e76d952e6bc2fbdd9f0d38425fbab1cf31 (patch) | |
tree | 09618b395aae1b91fbc8dec7ea9397a9654a9f0f /net/mac80211/ieee80211.c | |
parent | 32bfd35d4b63bd63de4bb0d791ef049c3c868726 (diff) |
mac80211: move interface type to vif structure
Drivers that support mixed AP/STA operation may well need to
know the type of a virtual interface when iterating over them.
The easiest way to support that is to move the interface type
variable into the vif structure.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211.c')
-rw-r--r-- | net/mac80211/ieee80211.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c index 42c27089f006..c9981701ef68 100644 --- a/net/mac80211/ieee80211.c +++ b/net/mac80211/ieee80211.c | |||
@@ -177,21 +177,21 @@ static int ieee80211_open(struct net_device *dev) | |||
177 | /* | 177 | /* |
178 | * check whether it may have the same address | 178 | * check whether it may have the same address |
179 | */ | 179 | */ |
180 | if (!identical_mac_addr_allowed(sdata->type, | 180 | if (!identical_mac_addr_allowed(sdata->vif.type, |
181 | nsdata->type)) | 181 | nsdata->vif.type)) |
182 | return -ENOTUNIQ; | 182 | return -ENOTUNIQ; |
183 | 183 | ||
184 | /* | 184 | /* |
185 | * can only add VLANs to enabled APs | 185 | * can only add VLANs to enabled APs |
186 | */ | 186 | */ |
187 | if (sdata->type == IEEE80211_IF_TYPE_VLAN && | 187 | if (sdata->vif.type == IEEE80211_IF_TYPE_VLAN && |
188 | nsdata->type == IEEE80211_IF_TYPE_AP && | 188 | nsdata->vif.type == IEEE80211_IF_TYPE_AP && |
189 | netif_running(nsdata->dev)) | 189 | netif_running(nsdata->dev)) |
190 | sdata->u.vlan.ap = nsdata; | 190 | sdata->u.vlan.ap = nsdata; |
191 | } | 191 | } |
192 | } | 192 | } |
193 | 193 | ||
194 | switch (sdata->type) { | 194 | switch (sdata->vif.type) { |
195 | case IEEE80211_IF_TYPE_WDS: | 195 | case IEEE80211_IF_TYPE_WDS: |
196 | if (is_zero_ether_addr(sdata->u.wds.remote_addr)) | 196 | if (is_zero_ether_addr(sdata->u.wds.remote_addr)) |
197 | return -ENOLINK; | 197 | return -ENOLINK; |
@@ -222,7 +222,7 @@ static int ieee80211_open(struct net_device *dev) | |||
222 | ieee80211_led_radio(local, local->hw.conf.radio_enabled); | 222 | ieee80211_led_radio(local, local->hw.conf.radio_enabled); |
223 | } | 223 | } |
224 | 224 | ||
225 | switch (sdata->type) { | 225 | switch (sdata->vif.type) { |
226 | case IEEE80211_IF_TYPE_VLAN: | 226 | case IEEE80211_IF_TYPE_VLAN: |
227 | list_add(&sdata->u.vlan.list, &sdata->u.vlan.ap->u.ap.vlans); | 227 | list_add(&sdata->u.vlan.list, &sdata->u.vlan.ap->u.ap.vlans); |
228 | /* no need to tell driver */ | 228 | /* no need to tell driver */ |
@@ -244,7 +244,7 @@ static int ieee80211_open(struct net_device *dev) | |||
244 | /* fall through */ | 244 | /* fall through */ |
245 | default: | 245 | default: |
246 | conf.vif = &sdata->vif; | 246 | conf.vif = &sdata->vif; |
247 | conf.type = sdata->type; | 247 | conf.type = sdata->vif.type; |
248 | conf.mac_addr = dev->dev_addr; | 248 | conf.mac_addr = dev->dev_addr; |
249 | res = local->ops->add_interface(local_to_hw(local), &conf); | 249 | res = local->ops->add_interface(local_to_hw(local), &conf); |
250 | if (res && !local->open_count && local->ops->stop) | 250 | if (res && !local->open_count && local->ops->stop) |
@@ -256,7 +256,7 @@ static int ieee80211_open(struct net_device *dev) | |||
256 | ieee80211_reset_erp_info(dev); | 256 | ieee80211_reset_erp_info(dev); |
257 | ieee80211_enable_keys(sdata); | 257 | ieee80211_enable_keys(sdata); |
258 | 258 | ||
259 | if (sdata->type == IEEE80211_IF_TYPE_STA && | 259 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA && |
260 | !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) | 260 | !(sdata->flags & IEEE80211_SDATA_USERSPACE_MLME)) |
261 | netif_carrier_off(dev); | 261 | netif_carrier_off(dev); |
262 | else | 262 | else |
@@ -322,7 +322,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
322 | dev_mc_unsync(local->mdev, dev); | 322 | dev_mc_unsync(local->mdev, dev); |
323 | 323 | ||
324 | /* down all dependent devices, that is VLANs */ | 324 | /* down all dependent devices, that is VLANs */ |
325 | if (sdata->type == IEEE80211_IF_TYPE_AP) { | 325 | if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { |
326 | struct ieee80211_sub_if_data *vlan, *tmp; | 326 | struct ieee80211_sub_if_data *vlan, *tmp; |
327 | 327 | ||
328 | list_for_each_entry_safe(vlan, tmp, &sdata->u.ap.vlans, | 328 | list_for_each_entry_safe(vlan, tmp, &sdata->u.ap.vlans, |
@@ -333,7 +333,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
333 | 333 | ||
334 | local->open_count--; | 334 | local->open_count--; |
335 | 335 | ||
336 | switch (sdata->type) { | 336 | switch (sdata->vif.type) { |
337 | case IEEE80211_IF_TYPE_VLAN: | 337 | case IEEE80211_IF_TYPE_VLAN: |
338 | list_del(&sdata->u.vlan.list); | 338 | list_del(&sdata->u.vlan.list); |
339 | sdata->u.vlan.ap = NULL; | 339 | sdata->u.vlan.ap = NULL; |
@@ -379,7 +379,7 @@ static int ieee80211_stop(struct net_device *dev) | |||
379 | /* fall through */ | 379 | /* fall through */ |
380 | default: | 380 | default: |
381 | conf.vif = &sdata->vif; | 381 | conf.vif = &sdata->vif; |
382 | conf.type = sdata->type; | 382 | conf.type = sdata->vif.type; |
383 | conf.mac_addr = dev->dev_addr; | 383 | conf.mac_addr = dev->dev_addr; |
384 | /* disable all keys for as long as this netdev is down */ | 384 | /* disable all keys for as long as this netdev is down */ |
385 | ieee80211_disable_keys(sdata); | 385 | ieee80211_disable_keys(sdata); |
@@ -502,13 +502,13 @@ static int __ieee80211_if_config(struct net_device *dev, | |||
502 | return 0; | 502 | return 0; |
503 | 503 | ||
504 | memset(&conf, 0, sizeof(conf)); | 504 | memset(&conf, 0, sizeof(conf)); |
505 | conf.type = sdata->type; | 505 | conf.type = sdata->vif.type; |
506 | if (sdata->type == IEEE80211_IF_TYPE_STA || | 506 | if (sdata->vif.type == IEEE80211_IF_TYPE_STA || |
507 | sdata->type == IEEE80211_IF_TYPE_IBSS) { | 507 | sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { |
508 | conf.bssid = sdata->u.sta.bssid; | 508 | conf.bssid = sdata->u.sta.bssid; |
509 | conf.ssid = sdata->u.sta.ssid; | 509 | conf.ssid = sdata->u.sta.ssid; |
510 | conf.ssid_len = sdata->u.sta.ssid_len; | 510 | conf.ssid_len = sdata->u.sta.ssid_len; |
511 | } else if (sdata->type == IEEE80211_IF_TYPE_AP) { | 511 | } else if (sdata->vif.type == IEEE80211_IF_TYPE_AP) { |
512 | conf.ssid = sdata->u.ap.ssid; | 512 | conf.ssid = sdata->u.ap.ssid; |
513 | conf.ssid_len = sdata->u.ap.ssid_len; | 513 | conf.ssid_len = sdata->u.ap.ssid_len; |
514 | conf.beacon = beacon; | 514 | conf.beacon = beacon; |
@@ -703,7 +703,7 @@ static void ieee80211_tasklet_handler(unsigned long data) | |||
703 | case IEEE80211_RX_MSG: | 703 | case IEEE80211_RX_MSG: |
704 | /* status is in skb->cb */ | 704 | /* status is in skb->cb */ |
705 | memcpy(&rx_status, skb->cb, sizeof(rx_status)); | 705 | memcpy(&rx_status, skb->cb, sizeof(rx_status)); |
706 | /* Clear skb->type in order to not confuse kernel | 706 | /* Clear skb->pkt_type in order to not confuse kernel |
707 | * netstack. */ | 707 | * netstack. */ |
708 | skb->pkt_type = 0; | 708 | skb->pkt_type = 0; |
709 | __ieee80211_rx(local_to_hw(local), skb, &rx_status); | 709 | __ieee80211_rx(local_to_hw(local), skb, &rx_status); |
@@ -962,7 +962,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb, | |||
962 | if (!monitors || !skb) | 962 | if (!monitors || !skb) |
963 | goto out; | 963 | goto out; |
964 | 964 | ||
965 | if (sdata->type == IEEE80211_IF_TYPE_MNTR) { | 965 | if (sdata->vif.type == IEEE80211_IF_TYPE_MNTR) { |
966 | if (!netif_running(sdata->dev)) | 966 | if (!netif_running(sdata->dev)) |
967 | continue; | 967 | continue; |
968 | monitors--; | 968 | monitors--; |
@@ -1084,7 +1084,7 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len, | |||
1084 | mdev->header_ops = &ieee80211_header_ops; | 1084 | mdev->header_ops = &ieee80211_header_ops; |
1085 | mdev->set_multicast_list = ieee80211_master_set_multicast_list; | 1085 | mdev->set_multicast_list = ieee80211_master_set_multicast_list; |
1086 | 1086 | ||
1087 | sdata->type = IEEE80211_IF_TYPE_AP; | 1087 | sdata->vif.type = IEEE80211_IF_TYPE_AP; |
1088 | sdata->dev = mdev; | 1088 | sdata->dev = mdev; |
1089 | sdata->local = local; | 1089 | sdata->local = local; |
1090 | sdata->u.ap.force_unicast_rateidx = -1; | 1090 | sdata->u.ap.force_unicast_rateidx = -1; |