aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/util.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-11-25 11:46:19 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-12-21 18:38:52 -0500
commit47846c9b0c10808d9337d2e7d09361f3e0a0a71a (patch)
tree8e5d0dbf3309b7868fa73a888f9561ffea1580e3 /net/mac80211/util.c
parentabe60632f311d515b082b450504ee24006023951 (diff)
mac80211: reduce reliance on netdev
For bluetooth 3, we will most likely not have a netdev for a virtual interface (sdata), so prepare for that by reducing the reliance on having a netdev. This patch moves the name and address fields into the sdata struct and uses them from there all over. Some work is needed to keep them sync'ed, but that's not a lot of work and in slow paths anyway. In doing so, this also reduces the number of pointer dereferences in many places, because of things like sdata->dev->dev_addr becoming sdata->vif.addr. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/util.c')
-rw-r--r--net/mac80211/util.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index d09f78bb2442..d45760eae6c7 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -469,7 +469,7 @@ void ieee80211_iterate_active_interfaces(
469 break; 469 break;
470 } 470 }
471 if (netif_running(sdata->dev)) 471 if (netif_running(sdata->dev))
472 iterator(data, sdata->dev->dev_addr, 472 iterator(data, sdata->vif.addr,
473 &sdata->vif); 473 &sdata->vif);
474 } 474 }
475 475
@@ -503,7 +503,7 @@ void ieee80211_iterate_active_interfaces_atomic(
503 break; 503 break;
504 } 504 }
505 if (netif_running(sdata->dev)) 505 if (netif_running(sdata->dev))
506 iterator(data, sdata->dev->dev_addr, 506 iterator(data, sdata->vif.addr,
507 &sdata->vif); 507 &sdata->vif);
508 } 508 }
509 509
@@ -848,7 +848,7 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
848 sizeof(*mgmt) + 6 + extra_len); 848 sizeof(*mgmt) + 6 + extra_len);
849 if (!skb) { 849 if (!skb) {
850 printk(KERN_DEBUG "%s: failed to allocate buffer for auth " 850 printk(KERN_DEBUG "%s: failed to allocate buffer for auth "
851 "frame\n", sdata->dev->name); 851 "frame\n", sdata->name);
852 return; 852 return;
853 } 853 }
854 skb_reserve(skb, local->hw.extra_tx_headroom); 854 skb_reserve(skb, local->hw.extra_tx_headroom);
@@ -858,7 +858,7 @@ void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata,
858 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | 858 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
859 IEEE80211_STYPE_AUTH); 859 IEEE80211_STYPE_AUTH);
860 memcpy(mgmt->da, bssid, ETH_ALEN); 860 memcpy(mgmt->da, bssid, ETH_ALEN);
861 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); 861 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
862 memcpy(mgmt->bssid, bssid, ETH_ALEN); 862 memcpy(mgmt->bssid, bssid, ETH_ALEN);
863 mgmt->u.auth.auth_alg = cpu_to_le16(auth_alg); 863 mgmt->u.auth.auth_alg = cpu_to_le16(auth_alg);
864 mgmt->u.auth.auth_transaction = cpu_to_le16(transaction); 864 mgmt->u.auth.auth_transaction = cpu_to_le16(transaction);
@@ -949,7 +949,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
949 ie_len); 949 ie_len);
950 if (!skb) { 950 if (!skb) {
951 printk(KERN_DEBUG "%s: failed to allocate buffer for probe " 951 printk(KERN_DEBUG "%s: failed to allocate buffer for probe "
952 "request\n", sdata->dev->name); 952 "request\n", sdata->name);
953 return; 953 return;
954 } 954 }
955 skb_reserve(skb, local->hw.extra_tx_headroom); 955 skb_reserve(skb, local->hw.extra_tx_headroom);
@@ -958,7 +958,7 @@ void ieee80211_send_probe_req(struct ieee80211_sub_if_data *sdata, u8 *dst,
958 memset(mgmt, 0, 24); 958 memset(mgmt, 0, 24);
959 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | 959 mgmt->frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT |
960 IEEE80211_STYPE_PROBE_REQ); 960 IEEE80211_STYPE_PROBE_REQ);
961 memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); 961 memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN);
962 if (dst) { 962 if (dst) {
963 memcpy(mgmt->da, dst, ETH_ALEN); 963 memcpy(mgmt->da, dst, ETH_ALEN);
964 memcpy(mgmt->bssid, dst, ETH_ALEN); 964 memcpy(mgmt->bssid, dst, ETH_ALEN);
@@ -1051,7 +1051,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
1051 netif_running(sdata->dev)) { 1051 netif_running(sdata->dev)) {
1052 conf.vif = &sdata->vif; 1052 conf.vif = &sdata->vif;
1053 conf.type = sdata->vif.type; 1053 conf.type = sdata->vif.type;
1054 conf.mac_addr = sdata->dev->dev_addr; 1054 conf.mac_addr = sdata->vif.addr;
1055 res = drv_add_interface(local, &conf); 1055 res = drv_add_interface(local, &conf);
1056 } 1056 }
1057 } 1057 }