* [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh
@ 2012-02-24 2:30 Ashok Nagarajan
2012-02-24 5:21 ` Javier Cardona
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Ashok Nagarajan @ 2012-02-24 2:30 UTC (permalink / raw)
To: linux-wireless; +Cc: javier, Ashok Nagarajan
Mesh peer links are established only if average rssi of the peer
candidate satisfies the threshold. This is not in 802.11s specification
but was requested by David Fulgham, an open80211s user. This is a way to avoid
marginal peer links with stations that are barely within range.
Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
---
drivers/net/wireless/mac80211_hwsim.c | 1 +
net/mac80211/cfg.c | 1 +
net/mac80211/mesh_plink.c | 22 +++++++++++++++++++++-
net/wireless/nl80211.c | 3 ++-
4 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 4b9e730..ca7d5a6 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -729,6 +729,7 @@ static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw,
__func__, ieee80211_vif_type_p2p(vif),
vif->addr);
hwsim_set_magic(vif);
+ vif->driver_flags |= IEEE80211_VIF_SUPPORTS_CQM_RSSI;
return 0;
}
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index f7eb25a..d50258d 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1853,6 +1853,7 @@ static int ieee80211_set_cqm_rssi_config(struct wiphy *wiphy,
/* tell the driver upon association, unless already associated */
if (sdata->u.mgd.associated &&
+ sdata->vif.type != NL80211_IFTYPE_STATION &&
sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI)
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM);
diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
index 8806e5e..6144f35 100644
--- a/net/mac80211/mesh_plink.c
+++ b/net/mac80211/mesh_plink.c
@@ -31,6 +31,17 @@
#define dot11MeshHoldingTimeout(s) (s->u.mesh.mshcfg.dot11MeshHoldingTimeout)
#define dot11MeshMaxPeerLinks(s) (s->u.mesh.mshcfg.dot11MeshMaxPeerLinks)
+/*
+ * NOTE: Mesh peer links are established only if average rssi of the peer
+ * candidate satisfies the threshold. sta_meets_rssi_treshold doesn't use
+ * hysteresis as fluctuations around threshold have no adverse effects.
+ */
+
+#define sta_meets_rssi_threshold(sta, sdata) \
+ (sdata->vif.bss_conf.cqm_rssi_thold == 0 || \
+ ((s8) -ewma_read(&sta->avg_signal)) > \
+ sdata->vif.bss_conf.cqm_rssi_thold)
+
enum plink_event {
PLINK_UNDEFINED,
OPN_ACPT,
@@ -301,7 +312,8 @@ void mesh_neighbour_update(u8 *hw_addr, u32 rates,
if (mesh_peer_accepts_plinks(elems) &&
sta->plink_state == NL80211_PLINK_LISTEN &&
sdata->u.mesh.accepting_plinks &&
- sdata->u.mesh.mshcfg.auto_open_plinks)
+ sdata->u.mesh.mshcfg.auto_open_plinks &&
+ sta_meets_rssi_threshold(sta, sdata))
mesh_plink_open(sta);
rcu_read_unlock();
@@ -531,6 +543,14 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
return;
}
+ if (ftype == WLAN_SP_MESH_PEERING_OPEN &&
+ !sta_meets_rssi_threshold(sta, sdata)) {
+ mpl_dbg("Mesh plink: %pM does not meet rssi threshold\n",
+ sta->sta.addr);
+ rcu_read_unlock();
+ return;
+ }
+
if (sta && !test_sta_flag(sta, WLAN_STA_AUTH)) {
mpl_dbg("Mesh plink: Action frame from non-authed peer\n");
rcu_read_unlock();
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index 1998c36..6feff8c 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -5796,7 +5796,8 @@ static int nl80211_set_cqm_rssi(struct genl_info *info,
return -EOPNOTSUPP;
if (wdev->iftype != NL80211_IFTYPE_STATION &&
- wdev->iftype != NL80211_IFTYPE_P2P_CLIENT)
+ wdev->iftype != NL80211_IFTYPE_P2P_CLIENT &&
+ wdev->iftype != NL80211_IFTYPE_MESH_POINT)
return -EOPNOTSUPP;
return rdev->ops->set_cqm_rssi_config(wdev->wiphy, dev,
--
1.7.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh
2012-02-24 2:30 [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh Ashok Nagarajan
@ 2012-02-24 5:21 ` Javier Cardona
2012-02-24 5:24 ` Javier Cardona
2012-02-24 7:18 ` Johannes Berg
2012-02-24 7:19 ` Johannes Berg
2 siblings, 1 reply; 7+ messages in thread
From: Javier Cardona @ 2012-02-24 5:21 UTC (permalink / raw)
To: Ashok Nagarajan; +Cc: linux-wireless
Ashok,
You'll have to resubmit, see inline.
On Thu, Feb 23, 2012 at 6:30 PM, Ashok Nagarajan <ashok@cozybit.com> wrote:
> Mesh peer links are established only if average rssi of the peer
> candidate satisfies the threshold. This is not in 802.11s specification
> but was requested by David Fulgham, an open80211s user. This is a way to avoid
> marginal peer links with stations that are barely within range.
>
> Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
> Signed-off-by: Javier Cardona <javier@cozybit.com>
> ---
> drivers/net/wireless/mac80211_hwsim.c | 1 +
> net/mac80211/cfg.c | 1 +
> net/mac80211/mesh_plink.c | 22 +++++++++++++++++++++-
> net/wireless/nl80211.c | 3 ++-
> 4 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
> index 4b9e730..ca7d5a6 100644
> --- a/drivers/net/wireless/mac80211_hwsim.c
> +++ b/drivers/net/wireless/mac80211_hwsim.c
> @@ -729,6 +729,7 @@ static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw,
> __func__, ieee80211_vif_type_p2p(vif),
> vif->addr);
> hwsim_set_magic(vif);
> + vif->driver_flags |= IEEE80211_VIF_SUPPORTS_CQM_RSSI;
> return 0;
> }
>
> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
> index f7eb25a..d50258d 100644
> --- a/net/mac80211/cfg.c
> +++ b/net/mac80211/cfg.c
> @@ -1853,6 +1853,7 @@ static int ieee80211_set_cqm_rssi_config(struct wiphy *wiphy,
>
> /* tell the driver upon association, unless already associated */
> if (sdata->u.mgd.associated &&
> + sdata->vif.type != NL80211_IFTYPE_STATION &&
The logic and the order are wrong. This needs to be:
+ if (sdata->u.mgd.associated &&
+ if (sdata->vif.type == NL80211_IFTYPE_STATION &&
sdata->u.mgd.associated &&
This prevents checking sdata->u.mgd.associated for vifs that are not
of managed type.
> sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI)
> ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM);
>
> diff --git a/net/mac80211/mesh_plink.c b/net/mac80211/mesh_plink.c
> index 8806e5e..6144f35 100644
> --- a/net/mac80211/mesh_plink.c
> +++ b/net/mac80211/mesh_plink.c
> @@ -31,6 +31,17 @@
> #define dot11MeshHoldingTimeout(s) (s->u.mesh.mshcfg.dot11MeshHoldingTimeout)
> #define dot11MeshMaxPeerLinks(s) (s->u.mesh.mshcfg.dot11MeshMaxPeerLinks)
>
> +/*
> + * NOTE: Mesh peer links are established only if average rssi of the peer
> + * candidate satisfies the threshold. sta_meets_rssi_treshold doesn't use
> + * hysteresis as fluctuations around threshold have no adverse effects.
> + */
> +
> +#define sta_meets_rssi_threshold(sta, sdata) \
> + (sdata->vif.bss_conf.cqm_rssi_thold == 0 || \
> + ((s8) -ewma_read(&sta->avg_signal)) > \
> + sdata->vif.bss_conf.cqm_rssi_thold)
> +
> enum plink_event {
> PLINK_UNDEFINED,
> OPN_ACPT,
> @@ -301,7 +312,8 @@ void mesh_neighbour_update(u8 *hw_addr, u32 rates,
> if (mesh_peer_accepts_plinks(elems) &&
> sta->plink_state == NL80211_PLINK_LISTEN &&
> sdata->u.mesh.accepting_plinks &&
> - sdata->u.mesh.mshcfg.auto_open_plinks)
> + sdata->u.mesh.mshcfg.auto_open_plinks &&
> + sta_meets_rssi_threshold(sta, sdata))
> mesh_plink_open(sta);
>
> rcu_read_unlock();
> @@ -531,6 +543,14 @@ void mesh_rx_plink_frame(struct ieee80211_sub_if_data *sdata, struct ieee80211_m
> return;
> }
>
> + if (ftype == WLAN_SP_MESH_PEERING_OPEN &&
> + !sta_meets_rssi_threshold(sta, sdata)) {
> + mpl_dbg("Mesh plink: %pM does not meet rssi threshold\n",
> + sta->sta.addr);
> + rcu_read_unlock();
> + return;
> + }
> +
> if (sta && !test_sta_flag(sta, WLAN_STA_AUTH)) {
> mpl_dbg("Mesh plink: Action frame from non-authed peer\n");
> rcu_read_unlock();
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 1998c36..6feff8c 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -5796,7 +5796,8 @@ static int nl80211_set_cqm_rssi(struct genl_info *info,
> return -EOPNOTSUPP;
>
> if (wdev->iftype != NL80211_IFTYPE_STATION &&
> - wdev->iftype != NL80211_IFTYPE_P2P_CLIENT)
> + wdev->iftype != NL80211_IFTYPE_P2P_CLIENT &&
> + wdev->iftype != NL80211_IFTYPE_MESH_POINT)
> return -EOPNOTSUPP;
>
> return rdev->ops->set_cqm_rssi_config(wdev->wiphy, dev,
> --
> 1.7.0.4
>
--
Javier Cardona
cozybit Inc.
http://www.cozybit.com
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh
2012-02-24 5:21 ` Javier Cardona
@ 2012-02-24 5:24 ` Javier Cardona
0 siblings, 0 replies; 7+ messages in thread
From: Javier Cardona @ 2012-02-24 5:24 UTC (permalink / raw)
To: Ashok Nagarajan; +Cc: linux-wireless
On Thu, Feb 23, 2012 at 9:21 PM, Javier Cardona <javier@cozybit.com> wrote:
> The logic and the order are wrong. This needs to be:
>
> + if (sdata->u.mgd.associated &&
> + if (sdata->vif.type == NL80211_IFTYPE_STATION &&
> sdata->u.mgd.associated &&
Sorry, I meant
- if (sdata->u.mgd.associated &&
+ if (sdata->vif.type == NL80211_IFTYPE_STATION &&
+ sdata->u.mgd.associated &&
--
Javier Cardona
cozybit Inc.
http://www.cozybit.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh
2012-02-24 2:30 [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh Ashok Nagarajan
2012-02-24 5:21 ` Javier Cardona
@ 2012-02-24 7:18 ` Johannes Berg
2012-02-24 7:19 ` Johannes Berg
2 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2012-02-24 7:18 UTC (permalink / raw)
To: Ashok Nagarajan; +Cc: linux-wireless, javier
On Thu, 2012-02-23 at 18:30 -0800, Ashok Nagarajan wrote:
> Mesh peer links are established only if average rssi of the peer
> candidate satisfies the threshold. This is not in 802.11s specification
> but was requested by David Fulgham, an open80211s user. This is a way to avoid
> marginal peer links with stations that are barely within range.
>
> Signed-off-by: Ashok Nagarajan <ashok@cozybit.com>
> Signed-off-by: Javier Cardona <javier@cozybit.com>
> ---
> drivers/net/wireless/mac80211_hwsim.c | 1 +
> net/mac80211/cfg.c | 1 +
> net/mac80211/mesh_plink.c | 22 +++++++++++++++++++++-
> net/wireless/nl80211.c | 3 ++-
> 4 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
> index 4b9e730..ca7d5a6 100644
> --- a/drivers/net/wireless/mac80211_hwsim.c
> +++ b/drivers/net/wireless/mac80211_hwsim.c
> @@ -729,6 +729,7 @@ static int mac80211_hwsim_add_interface(struct ieee80211_hw *hw,
> __func__, ieee80211_vif_type_p2p(vif),
> vif->addr);
> hwsim_set_magic(vif);
> + vif->driver_flags |= IEEE80211_VIF_SUPPORTS_CQM_RSSI;
That isn't right, hwsim does nothing to support CQM.
johannes
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh
2012-02-24 2:30 [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh Ashok Nagarajan
2012-02-24 5:21 ` Javier Cardona
2012-02-24 7:18 ` Johannes Berg
@ 2012-02-24 7:19 ` Johannes Berg
2012-02-24 16:40 ` Javier Cardona
2 siblings, 1 reply; 7+ messages in thread
From: Johannes Berg @ 2012-02-24 7:19 UTC (permalink / raw)
To: Ashok Nagarajan; +Cc: linux-wireless, javier
On Thu, 2012-02-23 at 18:30 -0800, Ashok Nagarajan wrote:
> +/*
> + * NOTE: Mesh peer links are established only if average rssi of the peer
> + * candidate satisfies the threshold. sta_meets_rssi_treshold doesn't use
> + * hysteresis as fluctuations around threshold have no adverse effects.
> + */
> +
> +#define sta_meets_rssi_threshold(sta, sdata) \
> + (sdata->vif.bss_conf.cqm_rssi_thold == 0 || \
> + ((s8) -ewma_read(&sta->avg_signal)) > \
> + sdata->vif.bss_conf.cqm_rssi_thold)
This also isn't right, you're using a value (bss_conf.cqm_rssi_thold)
intended for *signalling* for actual *decision making*.
johannes
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh
2012-02-24 7:19 ` Johannes Berg
@ 2012-02-24 16:40 ` Javier Cardona
2012-02-24 16:44 ` Johannes Berg
0 siblings, 1 reply; 7+ messages in thread
From: Javier Cardona @ 2012-02-24 16:40 UTC (permalink / raw)
To: Johannes Berg; +Cc: Ashok Nagarajan, linux-wireless
Hi Johannes,
On Thu, Feb 23, 2012 at 11:19 PM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Thu, 2012-02-23 at 18:30 -0800, Ashok Nagarajan wrote:
>
>> +/*
>> + * NOTE: Mesh peer links are established only if average rssi of the peer
>> + * candidate satisfies the threshold. sta_meets_rssi_treshold doesn't use
>> + * hysteresis as fluctuations around threshold have no adverse effects.
>> + */
>> +
>> +#define sta_meets_rssi_threshold(sta, sdata) \
>> + (sdata->vif.bss_conf.cqm_rssi_thold == 0 || \
>> + ((s8) -ewma_read(&sta->avg_signal)) > \
>> + sdata->vif.bss_conf.cqm_rssi_thold)
>
> This also isn't right, you're using a value (bss_conf.cqm_rssi_thold)
> intended for *signalling* for actual *decision making*.
Isn't that value used for making the decision (in userspace) on
whether a signal is good enough to associate? On an open mesh this
decision takes place in the kernel. It made more sense to us to reuse
that parameter for mesh than to introduce a new one. Would you rather
see a separate mesh parameter for this?
Cheers,
Javier
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh
2012-02-24 16:40 ` Javier Cardona
@ 2012-02-24 16:44 ` Johannes Berg
0 siblings, 0 replies; 7+ messages in thread
From: Johannes Berg @ 2012-02-24 16:44 UTC (permalink / raw)
To: Javier Cardona; +Cc: Ashok Nagarajan, linux-wireless
On Fri, 2012-02-24 at 08:40 -0800, Javier Cardona wrote:
> Hi Johannes,
>
> On Thu, Feb 23, 2012 at 11:19 PM, Johannes Berg
> <johannes@sipsolutions.net> wrote:
> > On Thu, 2012-02-23 at 18:30 -0800, Ashok Nagarajan wrote:
> >
> >> +/*
> >> + * NOTE: Mesh peer links are established only if average rssi of the peer
> >> + * candidate satisfies the threshold. sta_meets_rssi_treshold doesn't use
> >> + * hysteresis as fluctuations around threshold have no adverse effects.
> >> + */
> >> +
> >> +#define sta_meets_rssi_threshold(sta, sdata) \
> >> + (sdata->vif.bss_conf.cqm_rssi_thold == 0 || \
> >> + ((s8) -ewma_read(&sta->avg_signal)) > \
> >> + sdata->vif.bss_conf.cqm_rssi_thold)
> >
> > This also isn't right, you're using a value (bss_conf.cqm_rssi_thold)
> > intended for *signalling* for actual *decision making*.
>
> Isn't that value used for making the decision (in userspace) on
> whether a signal is good enough to associate?
I don't think so, and if it happens to be the same value, that's still
not encoded in the API -- this value is really meant to be only for the
signalling in the API.
> On an open mesh this
> decision takes place in the kernel. It made more sense to us to reuse
> that parameter for mesh than to introduce a new one. Would you rather
> see a separate mesh parameter for this?
Yes, I think that makes more sense.
johannes
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-02-24 16:44 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-24 2:30 [PATCH] {nl,cfg,mac}80211: Enable control quality monitoring for mesh Ashok Nagarajan
2012-02-24 5:21 ` Javier Cardona
2012-02-24 5:24 ` Javier Cardona
2012-02-24 7:18 ` Johannes Berg
2012-02-24 7:19 ` Johannes Berg
2012-02-24 16:40 ` Javier Cardona
2012-02-24 16:44 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).