* [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless
@ 2010-09-29 23:57 greearb
2010-09-29 23:57 ` [RFC 2/2] wireless: Report noise to /proc/net/wireless greearb
2010-09-30 7:43 ` [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless Johannes Berg
0 siblings, 2 replies; 8+ messages in thread
From: greearb @ 2010-09-29 23:57 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
User-space can then decode the flags to determine associated,
scanning, and other states.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 e6827ee... 43d485f... M include/linux/wireless.h
:100644 100644 f355b8c... b807430... M include/net/cfg80211.h
:100644 100644 c981604... 4fded2e... M net/mac80211/cfg.c
:100644 100644 7e5c3a4... 504a5d6... M net/wireless/wext-compat.c
include/linux/wireless.h | 4 ++--
include/net/cfg80211.h | 2 ++
net/mac80211/cfg.c | 4 ++++
net/wireless/wext-compat.c | 2 ++
4 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index e6827ee..43d485f 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -898,8 +898,8 @@ struct iw_pmkid_cand
*/
struct iw_statistics
{
- __u16 status; /* Status
- * - device dependent for now */
+ __u16 status; /* Status: ieee80211_sta_info_flags
+ * plus: (1<<15): Scanning */
struct iw_quality qual; /* Quality of the link
* (instant/mean/max) */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index f355b8c..b807430 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -457,6 +457,7 @@ struct rate_info {
* @plid: mesh peer link id
* @plink_state: mesh peer link state
* @signal: signal strength of last received packet in dBm
+ * @status: ieee80211_sta_info_flags plus: (1<<15) Scanning.
* @txrate: current unicast bitrate to this station
* @rx_packets: packets received from this station
* @tx_packets: packets transmitted to this station
@@ -474,6 +475,7 @@ struct station_info {
u16 plid;
u8 plink_state;
s8 signal;
+ u16 status;
struct rate_info txrate;
u32 rx_packets;
u32 tx_packets;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index c981604..4fded2e 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -327,6 +327,10 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
sinfo->plink_state = sta->plink_state;
#endif
}
+
+ sinfo->status = sta->flags;
+ if (sdata->local->scanning)
+ sinfo->status |= (1<<15);
}
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 7e5c3a4..504a5d6 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -1355,6 +1355,8 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
wstats.qual.updated |= IW_QUAL_NOISE_INVALID;
+ wstats.status = sinfo.status;
+
return &wstats;
}
EXPORT_SYMBOL_GPL(cfg80211_wireless_stats);
--
1.7.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [RFC 2/2] wireless: Report noise to /proc/net/wireless
2010-09-29 23:57 [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless greearb
@ 2010-09-29 23:57 ` greearb
2010-09-30 7:45 ` Johannes Berg
2010-09-30 7:43 ` [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless Johannes Berg
1 sibling, 1 reply; 8+ messages in thread
From: greearb @ 2010-09-29 23:57 UTC (permalink / raw)
To: linux-wireless; +Cc: Ben Greear
From: Ben Greear <greearb@candelatech.com>
This adds noise reports to /proc/net/wireless again.
Signed-off-by: Ben Greear <greearb@candelatech.com>
---
:100644 100644 b807430... 324d352... M include/net/cfg80211.h
:100644 100644 4fded2e... 3e2f354... M net/mac80211/cfg.c
:100644 100644 504a5d6... 27717ea... M net/wireless/wext-compat.c
include/net/cfg80211.h | 3 +++
net/mac80211/cfg.c | 4 ++++
net/wireless/wext-compat.c | 1 +
3 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index b807430..324d352 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -458,6 +458,7 @@ struct rate_info {
* @plink_state: mesh peer link state
* @signal: signal strength of last received packet in dBm
* @status: ieee80211_sta_info_flags plus: (1<<15) Scanning.
+ * @noise: noise, as obtained from dump_survey of index 0.
* @txrate: current unicast bitrate to this station
* @rx_packets: packets received from this station
* @tx_packets: packets transmitted to this station
@@ -476,6 +477,8 @@ struct station_info {
u8 plink_state;
s8 signal;
u16 status;
+ u8 noise;
+ /* 3 byte hole */
struct rate_info txrate;
u32 rx_packets;
u32 tx_packets;
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 4fded2e..3e2f354 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -277,6 +277,7 @@ static int ieee80211_config_default_mgmt_key(struct wiphy *wiphy,
static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
{
struct ieee80211_sub_if_data *sdata = sta->sdata;
+ struct survey_info survey;
sinfo->generation = sdata->local->sta_generation;
@@ -331,6 +332,9 @@ static void sta_set_sinfo(struct sta_info *sta, struct station_info *sinfo)
sinfo->status = sta->flags;
if (sdata->local->scanning)
sinfo->status |= (1<<15);
+
+ if (drv_get_survey(sdata->local, 0, &survey) == 0)
+ sinfo->noise = survey.noise;
}
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c
index 504a5d6..27717ea 100644
--- a/net/wireless/wext-compat.c
+++ b/net/wireless/wext-compat.c
@@ -1356,6 +1356,7 @@ struct iw_statistics *cfg80211_wireless_stats(struct net_device *dev)
wstats.qual.updated |= IW_QUAL_NOISE_INVALID;
wstats.status = sinfo.status;
+ wstats.qual.noise = sinfo.noise;
return &wstats;
}
--
1.7.2.2
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless
2010-09-29 23:57 [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless greearb
2010-09-29 23:57 ` [RFC 2/2] wireless: Report noise to /proc/net/wireless greearb
@ 2010-09-30 7:43 ` Johannes Berg
2010-09-30 15:31 ` Ben Greear
1 sibling, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2010-09-30 7:43 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
On Wed, 2010-09-29 at 16:57 -0700, greearb@candelatech.com wrote:
> User-space can then decode the flags to determine associated,
> scanning, and other states.
I really don't think we should be extending the useful life of wireless
extensions.
> * @signal: signal strength of last received packet in dBm
> + * @status: ieee80211_sta_info_flags plus: (1<<15) Scanning.
And are you seriously proposing to make internal mac80211 flags part of
the externally visible cfg80211 API??
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC 2/2] wireless: Report noise to /proc/net/wireless
2010-09-29 23:57 ` [RFC 2/2] wireless: Report noise to /proc/net/wireless greearb
@ 2010-09-30 7:45 ` Johannes Berg
2010-09-30 15:35 ` Ben Greear
0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2010-09-30 7:45 UTC (permalink / raw)
To: greearb; +Cc: linux-wireless
On Wed, 2010-09-29 at 16:57 -0700, greearb@candelatech.com wrote:
> This adds noise reports to /proc/net/wireless again.
Same comment applies here really...
> + * @noise: noise, as obtained from dump_survey of index 0.
It's not actually obtained that way, because if it was, cfg80211 could
just handle it by itself.
Additionally, even within mac80211 there's no guarantee that the
dump_survey(0) callback will give you the correct channel's noise.
Since you can easily obtain this information from userspace (and with
the extension that Felix proposed you can figure out which noise belongs
to the operating channel without really knowing the operating channel),
I don't think we should be doing this.
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless
2010-09-30 7:43 ` [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless Johannes Berg
@ 2010-09-30 15:31 ` Ben Greear
2010-09-30 15:39 ` Johannes Berg
0 siblings, 1 reply; 8+ messages in thread
From: Ben Greear @ 2010-09-30 15:31 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On 09/30/2010 12:43 AM, Johannes Berg wrote:
> On Wed, 2010-09-29 at 16:57 -0700, greearb@candelatech.com wrote:
>
>> User-space can then decode the flags to determine associated,
>> scanning, and other states.
>
> I really don't think we should be extending the useful life of wireless
> extensions.
>
>
>> * @signal: signal strength of last received packet in dBm
>> + * @status: ieee80211_sta_info_flags plus: (1<<15) Scanning.
>
>
> And are you seriously proposing to make internal mac80211 flags part of
> the externally visible cfg80211 API??
It would of course be easy to map them to a stable set of flags, but if you
don't want to fix /proc/net/wireless anyway, then I might as well do minimal changes
to make it easier to keep the patch in my own tree.
Aside from listening to 'iw event', is there any way to know if a STA is scanning,
authenticated, associated, etc? Some of this can be obtained from debugfs, but
that's not a fun api to code against...
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC 2/2] wireless: Report noise to /proc/net/wireless
2010-09-30 7:45 ` Johannes Berg
@ 2010-09-30 15:35 ` Ben Greear
0 siblings, 0 replies; 8+ messages in thread
From: Ben Greear @ 2010-09-30 15:35 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On 09/30/2010 12:45 AM, Johannes Berg wrote:
> On Wed, 2010-09-29 at 16:57 -0700, greearb@candelatech.com wrote:
>
>> This adds noise reports to /proc/net/wireless again.
>
> Same comment applies here really...
>
>> + * @noise: noise, as obtained from dump_survey of index 0.
>
> It's not actually obtained that way, because if it was, cfg80211 could
> just handle it by itself.
>
> Additionally, even within mac80211 there's no guarantee that the
> dump_survey(0) callback will give you the correct channel's noise.
>
> Since you can easily obtain this information from userspace (and with
> the extension that Felix proposed you can figure out which noise belongs
> to the operating channel without really knowing the operating channel),
> I don't think we should be doing this.
Do you have a pointer to Felix's proposal? Maybe I can use whatever API
he came up with to populate /proc/net/wireless with the noise from the current
channel.
Thanks,
Ben
>
> johannes
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless
2010-09-30 15:31 ` Ben Greear
@ 2010-09-30 15:39 ` Johannes Berg
2010-09-30 16:49 ` Ben Greear
0 siblings, 1 reply; 8+ messages in thread
From: Johannes Berg @ 2010-09-30 15:39 UTC (permalink / raw)
To: Ben Greear; +Cc: linux-wireless
On Thu, 2010-09-30 at 08:31 -0700, Ben Greear wrote:
> It would of course be easy to map them to a stable set of flags, but if you
> don't want to fix /proc/net/wireless anyway, then I might as well do minimal changes
> to make it easier to keep the patch in my own tree.
>
> Aside from listening to 'iw event', is there any way to know if a STA is scanning,
> authenticated, associated, etc? Some of this can be obtained from debugfs, but
> that's not a fun api to code against...
You can't get scanning, but auth/assoc should be visible in "iw dev
<iface> scan dump"
johannes
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless
2010-09-30 15:39 ` Johannes Berg
@ 2010-09-30 16:49 ` Ben Greear
0 siblings, 0 replies; 8+ messages in thread
From: Ben Greear @ 2010-09-30 16:49 UTC (permalink / raw)
To: Johannes Berg; +Cc: linux-wireless
On 09/30/2010 08:39 AM, Johannes Berg wrote:
> On Thu, 2010-09-30 at 08:31 -0700, Ben Greear wrote:
>
>> It would of course be easy to map them to a stable set of flags, but if you
>> don't want to fix /proc/net/wireless anyway, then I might as well do minimal changes
>> to make it easier to keep the patch in my own tree.
>>
>> Aside from listening to 'iw event', is there any way to know if a STA is scanning,
>> authenticated, associated, etc? Some of this can be obtained from debugfs, but
>> that's not a fun api to code against...
>
> You can't get scanning, but auth/assoc should be visible in "iw dev
> <iface> scan dump"
I find it a bit frustrating that it takes so many different commands
to find the information I'm looking for.
It looks like I'll need to integrate at least:
The information for the in-use BSS from 'scan dump', the info
from 'info', 'survey dump' for the active channel,
'station dump' (with additional of at least the counters that
used to be found in /proc/net/wireless),
If I were only doing one or two STA interfaces, that's not so bad,
but if I want to do hundreds, and update info relatively often,
that's going to be a lot of overhead!
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-09-30 16:49 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-29 23:57 [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless greearb
2010-09-29 23:57 ` [RFC 2/2] wireless: Report noise to /proc/net/wireless greearb
2010-09-30 7:45 ` Johannes Berg
2010-09-30 15:35 ` Ben Greear
2010-09-30 7:43 ` [RFC 1/2] wireless: Show sta_flags for status in /proc/net/wireless Johannes Berg
2010-09-30 15:31 ` Ben Greear
2010-09-30 15:39 ` Johannes Berg
2010-09-30 16:49 ` Ben Greear
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).