Commit e05ecccd authored by Jacob Minshall's avatar Jacob Minshall Committed by Johannes Berg

mac80211: set mesh formation field properly

Cap max peerings at 63 in accordance with IEEE-2012 8.4.2.100.7.
Triggers a beacon regeneration every time the number of peerings changes.
Previously this would only happen if the "accepting peerings" bit changed.
Signed-off-by: default avatarJacob Minshall <jacob@cozybit.com>
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 866403a7
...@@ -146,6 +146,7 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2) ...@@ -146,6 +146,7 @@ static inline u16 ieee80211_sn_sub(u16 sn1, u16 sn2)
#define IEEE80211_MAX_RTS_THRESHOLD 2353 #define IEEE80211_MAX_RTS_THRESHOLD 2353
#define IEEE80211_MAX_AID 2007 #define IEEE80211_MAX_AID 2007
#define IEEE80211_MAX_TIM_LEN 251 #define IEEE80211_MAX_TIM_LEN 251
#define IEEE80211_MAX_MESH_PEERINGS 63
/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
6.2.1.1.2. 6.2.1.1.2.
......
...@@ -274,8 +274,7 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata, ...@@ -274,8 +274,7 @@ int mesh_add_meshconf_ie(struct ieee80211_sub_if_data *sdata,
*pos++ = ifmsh->mesh_auth_id; *pos++ = ifmsh->mesh_auth_id;
/* Mesh Formation Info - number of neighbors */ /* Mesh Formation Info - number of neighbors */
neighbors = atomic_read(&ifmsh->estab_plinks); neighbors = atomic_read(&ifmsh->estab_plinks);
/* Number of neighbor mesh STAs or 15 whichever is smaller */ neighbors = min_t(int, neighbors, IEEE80211_MAX_MESH_PEERINGS);
neighbors = (neighbors > 15) ? 15 : neighbors;
*pos++ = neighbors << 1; *pos++ = neighbors << 1;
/* Mesh capability */ /* Mesh capability */
*pos = IEEE80211_MESHCONF_CAPAB_FORWARDING; *pos = IEEE80211_MESHCONF_CAPAB_FORWARDING;
......
...@@ -324,14 +324,14 @@ static inline ...@@ -324,14 +324,14 @@ static inline
u32 mesh_plink_inc_estab_count(struct ieee80211_sub_if_data *sdata) u32 mesh_plink_inc_estab_count(struct ieee80211_sub_if_data *sdata)
{ {
atomic_inc(&sdata->u.mesh.estab_plinks); atomic_inc(&sdata->u.mesh.estab_plinks);
return mesh_accept_plinks_update(sdata); return mesh_accept_plinks_update(sdata) | BSS_CHANGED_BEACON;
} }
static inline static inline
u32 mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata) u32 mesh_plink_dec_estab_count(struct ieee80211_sub_if_data *sdata)
{ {
atomic_dec(&sdata->u.mesh.estab_plinks); atomic_dec(&sdata->u.mesh.estab_plinks);
return mesh_accept_plinks_update(sdata); return mesh_accept_plinks_update(sdata) | BSS_CHANGED_BEACON;
} }
static inline int mesh_plink_free_count(struct ieee80211_sub_if_data *sdata) static inline int mesh_plink_free_count(struct ieee80211_sub_if_data *sdata)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment