aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/tx.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/tx.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/tx.c')
-rw-r--r--net/mac80211/tx.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index fe644f91ae05..5b9602b62405 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1495,7 +1495,7 @@ void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb,
1495 if (ieee80211_vif_is_mesh(&sdata->vif)) { 1495 if (ieee80211_vif_is_mesh(&sdata->vif)) {
1496 if (ieee80211_is_data(hdr->frame_control) && 1496 if (ieee80211_is_data(hdr->frame_control) &&
1497 is_unicast_ether_addr(hdr->addr1)) { 1497 is_unicast_ether_addr(hdr->addr1)) {
1498 if (mesh_nexthop_resolve(skb, sdata)) 1498 if (mesh_nexthop_resolve(sdata, skb))
1499 return; /* skb queued: don't free */ 1499 return; /* skb queued: don't free */
1500 } else { 1500 } else {
1501 ieee80211_mps_set_frame_flags(sdata, NULL, hdr); 1501 ieee80211_mps_set_frame_flags(sdata, NULL, hdr);
@@ -1844,9 +1844,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1844 } 1844 }
1845 1845
1846 if (!is_multicast_ether_addr(skb->data)) { 1846 if (!is_multicast_ether_addr(skb->data)) {
1847 mpath = mesh_path_lookup(skb->data, sdata); 1847 mpath = mesh_path_lookup(sdata, skb->data);
1848 if (!mpath) 1848 if (!mpath)
1849 mppath = mpp_path_lookup(skb->data, sdata); 1849 mppath = mpp_path_lookup(sdata, skb->data);
1850 } 1850 }
1851 1851
1852 /* 1852 /*
@@ -1859,8 +1859,8 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1859 !(mppath && !ether_addr_equal(mppath->mpp, skb->data))) { 1859 !(mppath && !ether_addr_equal(mppath->mpp, skb->data))) {
1860 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc, 1860 hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
1861 skb->data, skb->data + ETH_ALEN); 1861 skb->data, skb->data + ETH_ALEN);
1862 meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr, 1862 meshhdrlen = ieee80211_new_mesh_header(sdata, &mesh_hdr,
1863 sdata, NULL, NULL); 1863 NULL, NULL);
1864 } else { 1864 } else {
1865 /* DS -> MBSS (802.11-2012 13.11.3.3). 1865 /* DS -> MBSS (802.11-2012 13.11.3.3).
1866 * For unicast with unknown forwarding information, 1866 * For unicast with unknown forwarding information,
@@ -1879,18 +1879,14 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
1879 mesh_da, sdata->vif.addr); 1879 mesh_da, sdata->vif.addr);
1880 if (is_multicast_ether_addr(mesh_da)) 1880 if (is_multicast_ether_addr(mesh_da))
1881 /* DA TA mSA AE:SA */ 1881 /* DA TA mSA AE:SA */
1882 meshhdrlen = 1882 meshhdrlen = ieee80211_new_mesh_header(
1883 ieee80211_new_mesh_header(&mesh_hdr, 1883 sdata, &mesh_hdr,
1884 sdata, 1884 skb->data + ETH_ALEN, NULL);
1885 skb->data + ETH_ALEN,
1886 NULL);
1887 else 1885 else
1888 /* RA TA mDA mSA AE:DA SA */ 1886 /* RA TA mDA mSA AE:DA SA */
1889 meshhdrlen = 1887 meshhdrlen = ieee80211_new_mesh_header(
1890 ieee80211_new_mesh_header(&mesh_hdr, 1888 sdata, &mesh_hdr, skb->data,
1891 sdata, 1889 skb->data + ETH_ALEN);
1892 skb->data,
1893 skb->data + ETH_ALEN);
1894 1890
1895 } 1891 }
1896 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf); 1892 chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);