diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-11-25 11:46:19 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-12-21 18:38:52 -0500 |
commit | 47846c9b0c10808d9337d2e7d09361f3e0a0a71a (patch) | |
tree | 8e5d0dbf3309b7868fa73a888f9561ffea1580e3 /net/mac80211/mesh_hwmp.c | |
parent | abe60632f311d515b082b450504ee24006023951 (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/mesh_hwmp.c')
-rw-r--r-- | net/mac80211/mesh_hwmp.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c index b836892f0ba9..664f5cc2b273 100644 --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c | |||
@@ -128,9 +128,9 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags, | |||
128 | IEEE80211_STYPE_ACTION); | 128 | IEEE80211_STYPE_ACTION); |
129 | 129 | ||
130 | memcpy(mgmt->da, da, ETH_ALEN); | 130 | memcpy(mgmt->da, da, ETH_ALEN); |
131 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); | 131 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); |
132 | /* BSSID == SA */ | 132 | /* BSSID == SA */ |
133 | memcpy(mgmt->bssid, sdata->dev->dev_addr, ETH_ALEN); | 133 | memcpy(mgmt->bssid, sdata->vif.addr, ETH_ALEN); |
134 | mgmt->u.action.category = MESH_PATH_SEL_CATEGORY; | 134 | mgmt->u.action.category = MESH_PATH_SEL_CATEGORY; |
135 | mgmt->u.action.u.mesh_action.action_code = MESH_PATH_SEL_ACTION; | 135 | mgmt->u.action.u.mesh_action.action_code = MESH_PATH_SEL_ACTION; |
136 | 136 | ||
@@ -222,7 +222,7 @@ int mesh_path_error_tx(u8 ttl, u8 *target, __le32 target_sn, | |||
222 | IEEE80211_STYPE_ACTION); | 222 | IEEE80211_STYPE_ACTION); |
223 | 223 | ||
224 | memcpy(mgmt->da, ra, ETH_ALEN); | 224 | memcpy(mgmt->da, ra, ETH_ALEN); |
225 | memcpy(mgmt->sa, sdata->dev->dev_addr, ETH_ALEN); | 225 | memcpy(mgmt->sa, sdata->vif.addr, ETH_ALEN); |
226 | /* BSSID is left zeroed, wildcard value */ | 226 | /* BSSID is left zeroed, wildcard value */ |
227 | mgmt->u.action.category = MESH_PATH_SEL_CATEGORY; | 227 | mgmt->u.action.category = MESH_PATH_SEL_CATEGORY; |
228 | mgmt->u.action.u.mesh_action.action_code = MESH_PATH_SEL_ACTION; | 228 | mgmt->u.action.u.mesh_action.action_code = MESH_PATH_SEL_ACTION; |
@@ -374,7 +374,7 @@ static u32 hwmp_route_info_get(struct ieee80211_sub_if_data *sdata, | |||
374 | new_metric = MAX_METRIC; | 374 | new_metric = MAX_METRIC; |
375 | exp_time = TU_TO_EXP_TIME(orig_lifetime); | 375 | exp_time = TU_TO_EXP_TIME(orig_lifetime); |
376 | 376 | ||
377 | if (memcmp(orig_addr, sdata->dev->dev_addr, ETH_ALEN) == 0) { | 377 | if (memcmp(orig_addr, sdata->vif.addr, ETH_ALEN) == 0) { |
378 | /* This MP is the originator, we are not interested in this | 378 | /* This MP is the originator, we are not interested in this |
379 | * frame, except for updating transmitter's path info. | 379 | * frame, except for updating transmitter's path info. |
380 | */ | 380 | */ |
@@ -486,7 +486,7 @@ static void hwmp_preq_frame_process(struct ieee80211_sub_if_data *sdata, | |||
486 | 486 | ||
487 | mhwmp_dbg("received PREQ from %pM\n", orig_addr); | 487 | mhwmp_dbg("received PREQ from %pM\n", orig_addr); |
488 | 488 | ||
489 | if (memcmp(target_addr, sdata->dev->dev_addr, ETH_ALEN) == 0) { | 489 | if (memcmp(target_addr, sdata->vif.addr, ETH_ALEN) == 0) { |
490 | mhwmp_dbg("PREQ is for us\n"); | 490 | mhwmp_dbg("PREQ is for us\n"); |
491 | forward = false; | 491 | forward = false; |
492 | reply = true; | 492 | reply = true; |
@@ -579,7 +579,7 @@ static void hwmp_prep_frame_process(struct ieee80211_sub_if_data *sdata, | |||
579 | * replies | 579 | * replies |
580 | */ | 580 | */ |
581 | target_addr = PREP_IE_TARGET_ADDR(prep_elem); | 581 | target_addr = PREP_IE_TARGET_ADDR(prep_elem); |
582 | if (memcmp(target_addr, sdata->dev->dev_addr, ETH_ALEN) == 0) | 582 | if (memcmp(target_addr, sdata->vif.addr, ETH_ALEN) == 0) |
583 | /* destination, no forwarding required */ | 583 | /* destination, no forwarding required */ |
584 | return; | 584 | return; |
585 | 585 | ||
@@ -890,7 +890,7 @@ void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata) | |||
890 | target_flags = MP_F_RF; | 890 | target_flags = MP_F_RF; |
891 | 891 | ||
892 | spin_unlock_bh(&mpath->state_lock); | 892 | spin_unlock_bh(&mpath->state_lock); |
893 | mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->dev->dev_addr, | 893 | mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, |
894 | cpu_to_le32(ifmsh->sn), target_flags, mpath->dst, | 894 | cpu_to_le32(ifmsh->sn), target_flags, mpath->dst, |
895 | cpu_to_le32(mpath->sn), broadcast_addr, 0, | 895 | cpu_to_le32(mpath->sn), broadcast_addr, 0, |
896 | ttl, cpu_to_le32(lifetime), 0, | 896 | ttl, cpu_to_le32(lifetime), 0, |
@@ -939,7 +939,7 @@ int mesh_nexthop_lookup(struct sk_buff *skb, | |||
939 | if (time_after(jiffies, | 939 | if (time_after(jiffies, |
940 | mpath->exp_time + | 940 | mpath->exp_time + |
941 | msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) && | 941 | msecs_to_jiffies(sdata->u.mesh.mshcfg.path_refresh_time)) && |
942 | !memcmp(sdata->dev->dev_addr, hdr->addr4, ETH_ALEN) && | 942 | !memcmp(sdata->vif.addr, hdr->addr4, ETH_ALEN) && |
943 | !(mpath->flags & MESH_PATH_RESOLVING) && | 943 | !(mpath->flags & MESH_PATH_RESOLVING) && |
944 | !(mpath->flags & MESH_PATH_FIXED)) { | 944 | !(mpath->flags & MESH_PATH_FIXED)) { |
945 | mesh_queue_preq(mpath, | 945 | mesh_queue_preq(mpath, |
@@ -1010,7 +1010,7 @@ mesh_path_tx_root_frame(struct ieee80211_sub_if_data *sdata) | |||
1010 | { | 1010 | { |
1011 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; | 1011 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; |
1012 | 1012 | ||
1013 | mesh_path_sel_frame_tx(MPATH_RANN, 0, sdata->dev->dev_addr, | 1013 | mesh_path_sel_frame_tx(MPATH_RANN, 0, sdata->vif.addr, |
1014 | cpu_to_le32(++ifmsh->sn), | 1014 | cpu_to_le32(++ifmsh->sn), |
1015 | 0, NULL, 0, broadcast_addr, | 1015 | 0, NULL, 0, broadcast_addr, |
1016 | 0, MESH_TTL, 0, 0, 0, sdata); | 1016 | 0, MESH_TTL, 0, 0, 0, sdata); |