aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/rx.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2013-02-15 08:40:31 -0500
committerJohannes Berg <johannes.berg@intel.com>2013-02-15 09:46:37 -0500
commitbf7cd94dcc71682cd6af4a9028f95307b7db41c5 (patch)
tree66b4573619eaebf52c0a298969a9756eb0059266 /net/mac80211/rx.c
parent93c78c5debeb9c7101ecc73347d4730c26a98c05 (diff)
mac80211: clean up mesh code
There's various code with strange indentation, questionable loop and locking constructs, etc. The bigger change is moving the "sdata" argument to the first argument of all functions, like all other mac80211 functions that have one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r--net/mac80211/rx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 3acb70b73e22..bb73ed2d20b9 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2027,7 +2027,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
2027 /* frame is in RMC, don't forward */ 2027 /* frame is in RMC, don't forward */
2028 if (ieee80211_is_data(hdr->frame_control) && 2028 if (ieee80211_is_data(hdr->frame_control) &&
2029 is_multicast_ether_addr(hdr->addr1) && 2029 is_multicast_ether_addr(hdr->addr1) &&
2030 mesh_rmc_check(hdr->addr3, mesh_hdr, rx->sdata)) 2030 mesh_rmc_check(rx->sdata, hdr->addr3, mesh_hdr))
2031 return RX_DROP_MONITOR; 2031 return RX_DROP_MONITOR;
2032 2032
2033 if (!ieee80211_is_data(hdr->frame_control) || 2033 if (!ieee80211_is_data(hdr->frame_control) ||
@@ -2054,9 +2054,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
2054 } 2054 }
2055 2055
2056 rcu_read_lock(); 2056 rcu_read_lock();
2057 mppath = mpp_path_lookup(proxied_addr, sdata); 2057 mppath = mpp_path_lookup(sdata, proxied_addr);
2058 if (!mppath) { 2058 if (!mppath) {
2059 mpp_path_add(proxied_addr, mpp_addr, sdata); 2059 mpp_path_add(sdata, proxied_addr, mpp_addr);
2060 } else { 2060 } else {
2061 spin_lock_bh(&mppath->state_lock); 2061 spin_lock_bh(&mppath->state_lock);
2062 if (!ether_addr_equal(mppath->mpp, mpp_addr)) 2062 if (!ether_addr_equal(mppath->mpp, mpp_addr))
@@ -2104,13 +2104,13 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
2104 memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN); 2104 memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
2105 /* update power mode indication when forwarding */ 2105 /* update power mode indication when forwarding */
2106 ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr); 2106 ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr);
2107 } else if (!mesh_nexthop_lookup(fwd_skb, sdata)) { 2107 } else if (!mesh_nexthop_lookup(sdata, fwd_skb)) {
2108 /* mesh power mode flags updated in mesh_nexthop_lookup */ 2108 /* mesh power mode flags updated in mesh_nexthop_lookup */
2109 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast); 2109 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
2110 } else { 2110 } else {
2111 /* unable to resolve next hop */ 2111 /* unable to resolve next hop */
2112 mesh_path_error_tx(ifmsh->mshcfg.element_ttl, fwd_hdr->addr3, 2112 mesh_path_error_tx(sdata, ifmsh->mshcfg.element_ttl,
2113 0, reason, fwd_hdr->addr2, sdata); 2113 fwd_hdr->addr3, 0, reason, fwd_hdr->addr2);
2114 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route); 2114 IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route);
2115 kfree_skb(fwd_skb); 2115 kfree_skb(fwd_skb);
2116 return RX_DROP_MONITOR; 2116 return RX_DROP_MONITOR;