* [PATCH 1/1] mac80211: check for non-managed interface
@ 2012-04-22 16:00 Wey-Yi Guy
2012-04-22 17:01 ` Emmanuel Grumbach
0 siblings, 1 reply; 3+ messages in thread
From: Wey-Yi Guy @ 2012-04-22 16:00 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, Wey-Yi Guy
Average beacon signal only keep tracked by managed interface,
give warning and return 0 for the others.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
---
net/mac80211/util.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index 89c1e5b..2cbcb6a 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -1799,5 +1799,10 @@ int ieee80211_ave_rssi(struct ieee80211_vif *vif)
struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
+ if (sdata->vif.type != NL80211_IFTYPE_STATION) {
+ /* non-managed type inferfaces */
+ WARN_ON(1);
+ return 0;
+ }
return ifmgd->ave_beacon_signal;
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mac80211: check for non-managed interface
2012-04-22 16:00 [PATCH 1/1] mac80211: check for non-managed interface Wey-Yi Guy
@ 2012-04-22 17:01 ` Emmanuel Grumbach
2012-04-22 17:45 ` Johannes Berg
0 siblings, 1 reply; 3+ messages in thread
From: Emmanuel Grumbach @ 2012-04-22 17:01 UTC (permalink / raw)
To: Wey-Yi Guy; +Cc: linville, linux-wireless
On Sun, Apr 22, 2012 at 19:00, Wey-Yi Guy <wey-yi.w.guy@intel.com> wrote:
> Average beacon signal only keep tracked by managed interface,
> give warning and return 0 for the others.
>
> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> ---
> net/mac80211/util.c | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/net/mac80211/util.c b/net/mac80211/util.c
> index 89c1e5b..2cbcb6a 100644
> --- a/net/mac80211/util.c
> +++ b/net/mac80211/util.c
> @@ -1799,5 +1799,10 @@ int ieee80211_ave_rssi(struct ieee80211_vif *vif)
> struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
> struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
>
> + if (sdata->vif.type != NL80211_IFTYPE_STATION) {
> + /* non-managed type inferfaces */
> + WARN_ON(1);
WARN_ON_ONCE ?
We don't need to flood the kernel log here
> + return 0;
> + }
> return ifmgd->ave_beacon_signal;
> }
> --
> 1.7.0.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] mac80211: check for non-managed interface
2012-04-22 17:01 ` Emmanuel Grumbach
@ 2012-04-22 17:45 ` Johannes Berg
0 siblings, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2012-04-22 17:45 UTC (permalink / raw)
To: Emmanuel Grumbach; +Cc: Wey-Yi Guy, linville, linux-wireless
On Sun, 2012-04-22 at 20:01 +0300, Emmanuel Grumbach wrote:
> On Sun, Apr 22, 2012 at 19:00, Wey-Yi Guy <wey-yi.w.guy@intel.com> wrote:
> > Average beacon signal only keep tracked by managed interface,
> > give warning and return 0 for the others.
> >
> > Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
> > ---
> > net/mac80211/util.c | 5 +++++
> > 1 files changed, 5 insertions(+), 0 deletions(-)
> >
> > diff --git a/net/mac80211/util.c b/net/mac80211/util.c
> > index 89c1e5b..2cbcb6a 100644
> > --- a/net/mac80211/util.c
> > +++ b/net/mac80211/util.c
> > @@ -1799,5 +1799,10 @@ int ieee80211_ave_rssi(struct ieee80211_vif *vif)
> > struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
> > struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
> >
> > + if (sdata->vif.type != NL80211_IFTYPE_STATION) {
> > + /* non-managed type inferfaces */
> > + WARN_ON(1);
>
> WARN_ON_ONCE ?
> We don't need to flood the kernel log here
if (WARN_ON_ONCE(...))
would also be nicer :-)
johannes
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-04-22 17:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-22 16:00 [PATCH 1/1] mac80211: check for non-managed interface Wey-Yi Guy
2012-04-22 17:01 ` Emmanuel Grumbach
2012-04-22 17:45 ` Johannes Berg
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.