mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 23:04:43 +00:00
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>
This commit is contained in:
parent
93c78c5deb
commit
bf7cd94dcc
10 changed files with 252 additions and 263 deletions
|
@ -2027,7 +2027,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
|
|||
/* frame is in RMC, don't forward */
|
||||
if (ieee80211_is_data(hdr->frame_control) &&
|
||||
is_multicast_ether_addr(hdr->addr1) &&
|
||||
mesh_rmc_check(hdr->addr3, mesh_hdr, rx->sdata))
|
||||
mesh_rmc_check(rx->sdata, hdr->addr3, mesh_hdr))
|
||||
return RX_DROP_MONITOR;
|
||||
|
||||
if (!ieee80211_is_data(hdr->frame_control) ||
|
||||
|
@ -2054,9 +2054,9 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
|
|||
}
|
||||
|
||||
rcu_read_lock();
|
||||
mppath = mpp_path_lookup(proxied_addr, sdata);
|
||||
mppath = mpp_path_lookup(sdata, proxied_addr);
|
||||
if (!mppath) {
|
||||
mpp_path_add(proxied_addr, mpp_addr, sdata);
|
||||
mpp_path_add(sdata, proxied_addr, mpp_addr);
|
||||
} else {
|
||||
spin_lock_bh(&mppath->state_lock);
|
||||
if (!ether_addr_equal(mppath->mpp, mpp_addr))
|
||||
|
@ -2104,13 +2104,13 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
|
|||
memcpy(fwd_hdr->addr2, sdata->vif.addr, ETH_ALEN);
|
||||
/* update power mode indication when forwarding */
|
||||
ieee80211_mps_set_frame_flags(sdata, NULL, fwd_hdr);
|
||||
} else if (!mesh_nexthop_lookup(fwd_skb, sdata)) {
|
||||
} else if (!mesh_nexthop_lookup(sdata, fwd_skb)) {
|
||||
/* mesh power mode flags updated in mesh_nexthop_lookup */
|
||||
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, fwded_unicast);
|
||||
} else {
|
||||
/* unable to resolve next hop */
|
||||
mesh_path_error_tx(ifmsh->mshcfg.element_ttl, fwd_hdr->addr3,
|
||||
0, reason, fwd_hdr->addr2, sdata);
|
||||
mesh_path_error_tx(sdata, ifmsh->mshcfg.element_ttl,
|
||||
fwd_hdr->addr3, 0, reason, fwd_hdr->addr2);
|
||||
IEEE80211_IFSTA_MESH_CTR_INC(ifmsh, dropped_frames_no_route);
|
||||
kfree_skb(fwd_skb);
|
||||
return RX_DROP_MONITOR;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue