aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/mac80211/cfg.c14
-rw-r--r--net/mac80211/main.c3
-rw-r--r--net/mac80211/mesh.c115
-rw-r--r--net/mac80211/mesh.h105
-rw-r--r--net/mac80211/mesh_hwmp.c68
-rw-r--r--net/mac80211/mesh_pathtbl.c89
-rw-r--r--net/mac80211/mesh_plink.c36
-rw-r--r--net/mac80211/mesh_sync.c47
-rw-r--r--net/mac80211/rx.c12
-rw-r--r--net/mac80211/tx.c26
10 files changed, 252 insertions, 263 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 179dcbd8be1c..09d96a8f6c2c 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1500,13 +1500,13 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
1500 return -ENOENT; 1500 return -ENOENT;
1501 } 1501 }
1502 1502
1503 err = mesh_path_add(dst, sdata); 1503 err = mesh_path_add(sdata, dst);
1504 if (err) { 1504 if (err) {
1505 rcu_read_unlock(); 1505 rcu_read_unlock();
1506 return err; 1506 return err;
1507 } 1507 }
1508 1508
1509 mpath = mesh_path_lookup(dst, sdata); 1509 mpath = mesh_path_lookup(sdata, dst);
1510 if (!mpath) { 1510 if (!mpath) {
1511 rcu_read_unlock(); 1511 rcu_read_unlock();
1512 return -ENXIO; 1512 return -ENXIO;
@@ -1518,12 +1518,12 @@ static int ieee80211_add_mpath(struct wiphy *wiphy, struct net_device *dev,
1518} 1518}
1519 1519
1520static int ieee80211_del_mpath(struct wiphy *wiphy, struct net_device *dev, 1520static int ieee80211_del_mpath(struct wiphy *wiphy, struct net_device *dev,
1521 u8 *dst) 1521 u8 *dst)
1522{ 1522{
1523 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1523 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1524 1524
1525 if (dst) 1525 if (dst)
1526 return mesh_path_del(dst, sdata); 1526 return mesh_path_del(sdata, dst);
1527 1527
1528 mesh_path_flush_by_iface(sdata); 1528 mesh_path_flush_by_iface(sdata);
1529 return 0; 1529 return 0;
@@ -1547,7 +1547,7 @@ static int ieee80211_change_mpath(struct wiphy *wiphy,
1547 return -ENOENT; 1547 return -ENOENT;
1548 } 1548 }
1549 1549
1550 mpath = mesh_path_lookup(dst, sdata); 1550 mpath = mesh_path_lookup(sdata, dst);
1551 if (!mpath) { 1551 if (!mpath) {
1552 rcu_read_unlock(); 1552 rcu_read_unlock();
1553 return -ENOENT; 1553 return -ENOENT;
@@ -1611,7 +1611,7 @@ static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev,
1611 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1611 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1612 1612
1613 rcu_read_lock(); 1613 rcu_read_lock();
1614 mpath = mesh_path_lookup(dst, sdata); 1614 mpath = mesh_path_lookup(sdata, dst);
1615 if (!mpath) { 1615 if (!mpath) {
1616 rcu_read_unlock(); 1616 rcu_read_unlock();
1617 return -ENOENT; 1617 return -ENOENT;
@@ -1632,7 +1632,7 @@ static int ieee80211_dump_mpath(struct wiphy *wiphy, struct net_device *dev,
1632 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1632 sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1633 1633
1634 rcu_read_lock(); 1634 rcu_read_lock();
1635 mpath = mesh_path_lookup_by_idx(idx, sdata); 1635 mpath = mesh_path_lookup_by_idx(sdata, idx);
1636 if (!mpath) { 1636 if (!mpath) {
1637 rcu_read_unlock(); 1637 rcu_read_unlock();
1638 return -ENOENT; 1638 return -ENOENT;
diff --git a/net/mac80211/main.c b/net/mac80211/main.c
index f9747689d604..d0dd11153a6c 100644
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
@@ -1173,8 +1173,7 @@ static void __exit ieee80211_exit(void)
1173 rc80211_minstrel_ht_exit(); 1173 rc80211_minstrel_ht_exit();
1174 rc80211_minstrel_exit(); 1174 rc80211_minstrel_exit();
1175 1175
1176 if (mesh_allocated) 1176 ieee80211s_stop();
1177 ieee80211s_stop();
1178 1177
1179 ieee80211_iface_exit(); 1178 ieee80211_iface_exit();
1180 1179
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index a77d40ed4e61..b0223326d9cd 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -17,7 +17,7 @@
17#define TMR_RUNNING_MP 1 17#define TMR_RUNNING_MP 1
18#define TMR_RUNNING_MPR 2 18#define TMR_RUNNING_MPR 2
19 19
20int mesh_allocated; 20static int mesh_allocated;
21static struct kmem_cache *rm_cache; 21static struct kmem_cache *rm_cache;
22 22
23bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt) 23bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt)
@@ -36,6 +36,8 @@ void ieee80211s_init(void)
36 36
37void ieee80211s_stop(void) 37void ieee80211s_stop(void)
38{ 38{
39 if (!mesh_allocated)
40 return;
39 mesh_pathtbl_unregister(); 41 mesh_pathtbl_unregister();
40 kmem_cache_destroy(rm_cache); 42 kmem_cache_destroy(rm_cache);
41} 43}
@@ -90,24 +92,22 @@ bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
90 (ifmsh->mesh_cc_id == ie->mesh_config->meshconf_congest) && 92 (ifmsh->mesh_cc_id == ie->mesh_config->meshconf_congest) &&
91 (ifmsh->mesh_sp_id == ie->mesh_config->meshconf_synch) && 93 (ifmsh->mesh_sp_id == ie->mesh_config->meshconf_synch) &&
92 (ifmsh->mesh_auth_id == ie->mesh_config->meshconf_auth))) 94 (ifmsh->mesh_auth_id == ie->mesh_config->meshconf_auth)))
93 goto mismatch; 95 return false;
94 96
95 ieee80211_sta_get_rates(local, ie, ieee80211_get_sdata_band(sdata), 97 ieee80211_sta_get_rates(local, ie, ieee80211_get_sdata_band(sdata),
96 &basic_rates); 98 &basic_rates);
97 99
98 if (sdata->vif.bss_conf.basic_rates != basic_rates) 100 if (sdata->vif.bss_conf.basic_rates != basic_rates)
99 goto mismatch; 101 return false;
100 102
101 ieee80211_ht_oper_to_chandef(sdata->vif.bss_conf.chandef.chan, 103 ieee80211_ht_oper_to_chandef(sdata->vif.bss_conf.chandef.chan,
102 ie->ht_operation, &sta_chan_def); 104 ie->ht_operation, &sta_chan_def);
103 105
104 if (!cfg80211_chandef_compatible(&sdata->vif.bss_conf.chandef, 106 if (!cfg80211_chandef_compatible(&sdata->vif.bss_conf.chandef,
105 &sta_chan_def)) 107 &sta_chan_def))
106 goto mismatch; 108 return false;
107 109
108 return true; 110 return true;
109mismatch:
110 return false;
111} 111}
112 112
113/** 113/**
@@ -118,7 +118,7 @@ mismatch:
118bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie) 118bool mesh_peer_accepts_plinks(struct ieee802_11_elems *ie)
119{ 119{
120 return (ie->mesh_config->meshconf_cap & 120 return (ie->mesh_config->meshconf_cap &
121 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS) != 0; 121 IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS) != 0;
122} 122}
123 123
124/** 124/**
@@ -196,11 +196,12 @@ void mesh_rmc_free(struct ieee80211_sub_if_data *sdata)
196 if (!sdata->u.mesh.rmc) 196 if (!sdata->u.mesh.rmc)
197 return; 197 return;
198 198
199 for (i = 0; i < RMC_BUCKETS; i++) 199 for (i = 0; i < RMC_BUCKETS; i++) {
200 list_for_each_entry_safe(p, n, &rmc->bucket[i], list) { 200 list_for_each_entry_safe(p, n, &rmc->bucket[i], list) {
201 list_del(&p->list); 201 list_del(&p->list);
202 kmem_cache_free(rm_cache, p); 202 kmem_cache_free(rm_cache, p);
203 } 203 }
204 }
204 205
205 kfree(rmc); 206 kfree(rmc);
206 sdata->u.mesh.rmc = NULL; 207 sdata->u.mesh.rmc = NULL;
@@ -209,6 +210,7 @@ void mesh_rmc_free(struct ieee80211_sub_if_data *sdata)
209/** 210/**
210 * mesh_rmc_check - Check frame in recent multicast cache and add if absent. 211 * mesh_rmc_check - Check frame in recent multicast cache and add if absent.
211 * 212 *
213 * @sdata: interface
212 * @sa: source address 214 * @sa: source address
213 * @mesh_hdr: mesh_header 215 * @mesh_hdr: mesh_header
214 *