Historical ath9k-devel archives
 help / color / mirror / Atom feed
* [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise
@ 2010-04-27 22:08 Benoit Papillault
  2010-04-27 22:17 ` Luis R. Rodriguez
  2010-04-28  7:00 ` Jouni Malinen
  0 siblings, 2 replies; 7+ messages in thread
From: Benoit Papillault @ 2010-04-27 22:08 UTC (permalink / raw)
  To: ath9k-devel


Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>
---
 drivers/net/wireless/ath/ath9k/main.c |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index c03821e..f0b2aa2 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2047,6 +2047,25 @@ static int ath9k_ampdu_action(struct ieee80211_hw *hw,
 	return ret;
 }
 
+static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
+			     struct survey_info *survey)
+{
+	struct ath_wiphy *aphy = hw->priv;
+	struct ath_softc *sc = aphy->sc;
+	struct ath_hw *ah = sc->sc_ah;
+	struct ath_common *common = ath9k_hw_common(ah);
+	struct ieee80211_conf *conf = &hw->conf;
+
+	 if (idx != 0)
+		return -ENOENT;
+
+	survey->channel = conf->channel;
+	survey->filled = SURVEY_INFO_NOISE_DBM;
+	survey->noise = common->ani.noise_floor;
+
+	return 0;
+}
+
 static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
 {
 	struct ath_wiphy *aphy = hw->priv;
@@ -2122,6 +2141,7 @@ struct ieee80211_ops ath9k_ops = {
 	.set_tsf 	    = ath9k_set_tsf,
 	.reset_tsf 	    = ath9k_reset_tsf,
 	.ampdu_action       = ath9k_ampdu_action,
+	.get_survey	    = ath9k_get_survey,
 	.sw_scan_start      = ath9k_sw_scan_start,
 	.sw_scan_complete   = ath9k_sw_scan_complete,
 	.rfkill_poll        = ath9k_rfkill_poll_state,
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise
  2010-04-27 22:08 [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise Benoit Papillault
@ 2010-04-27 22:17 ` Luis R. Rodriguez
  2010-04-28  7:00 ` Jouni Malinen
  1 sibling, 0 replies; 7+ messages in thread
From: Luis R. Rodriguez @ 2010-04-27 22:17 UTC (permalink / raw)
  To: ath9k-devel

On Tue, Apr 27, 2010 at 03:08:24PM -0700, Benoit Papillault wrote:
> 
> Signed-off-by: Benoit Papillault <benoit.papillault@free.fr>

Looks good, thanks for this work.

  Luis

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise
  2010-04-27 22:08 [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise Benoit Papillault
  2010-04-27 22:17 ` Luis R. Rodriguez
@ 2010-04-28  7:00 ` Jouni Malinen
  2010-04-28  8:01   ` [ath9k-devel] kernel warning on 2.6.33 ath9k Xu, Martin
  2010-04-28 20:13   ` [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise Benoit PAPILLAULT
  1 sibling, 2 replies; 7+ messages in thread
From: Jouni Malinen @ 2010-04-28  7:00 UTC (permalink / raw)
  To: ath9k-devel

On Tue, 2010-04-27 at 15:08 -0700, Benoit Papillault wrote:
> +static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
> +			     struct survey_info *survey)

> +	struct ieee80211_conf *conf = &hw->conf;
> +
> +	 if (idx != 0)
> +		return -ENOENT;
> +
> +	survey->channel = conf->channel;

Are there any plans on providing this information from all channels? I
have assumed that the survey command was supposed to be used for
surveying all channels (e.g., to get information for auto-channel
selection) and returning something for the current channel is quite
limited subset of that. In other words, I would like to be able to run a
scan of all channels and then use NL80211_CMD_GET_SURVEY to fetch
additional per-channel information like noise (and also channel usage
statistics in case of ath9k) from the scanned channels.

- Jouni

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ath9k-devel] kernel warning on 2.6.33 ath9k
  2010-04-28  7:00 ` Jouni Malinen
@ 2010-04-28  8:01   ` Xu, Martin
  2010-04-28 14:04     ` John W. Linville
  2010-04-28 20:13   ` [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise Benoit PAPILLAULT
  1 sibling, 1 reply; 7+ messages in thread
From: Xu, Martin @ 2010-04-28  8:01 UTC (permalink / raw)
  To: ath9k-devel

Hi
I found that kernel reports below warning when using ath9k in kernel 2.6.33.
Someone can kindly tell me whether it is the new found issue or the issue is known and has been fixed in later commit in git tree?
Thanks!

------------[ cut here ]------------
WARNING: at kernel/softirq.c:143 local_bh_enable_ip+0x32/0x76()
Hardware name: AO532h          
Modules linked in: cbc ecryptfs ath9k ath9k_common battery atl1c joydev ath9k_hw uvcvideo
Pid: 850, comm: wpa_supplicant Not tainted 2.6.33.2-8.1-netbook #1
Call Trace:
 [<c1030978>] warn_slowpath_common+0x66/0x7d
 [<c1035a74>] ? local_bh_enable_ip+0x32/0x76
 [<c103099c>] warn_slowpath_null+0xd/0x10
 [<c1035a74>] local_bh_enable_ip+0x32/0x76
 [<c14789c0>] _raw_spin_unlock_bh+0x17/0x19
 [<f871dbd3>] ath_tx_node_cleanup+0xe0/0xf9 [ath9k]
 [<c103ae46>] ? lock_timer_base+0x22/0x41
 [<f871a005>] ath9k_sta_notify+0x74/0x78 [ath9k]
 [<c1443987>] __sta_info_unlink+0x139/0x189
 [<f8719f91>] ? ath9k_sta_notify+0x0/0x78 [ath9k]
 [<c14439fa>] sta_info_unlink+0x23/0x31
 [<c1448834>] ieee80211_set_disassoc+0x1bd/0x1e3
 [<c1448cf8>] ieee80211_mgd_deauth+0x3c/0xfe
 [<c144df21>] ieee80211_deauth+0x14/0x16
 [<c143c3fc>] __cfg80211_mlme_deauth+0xe9/0xf2
 [<c143eea1>] __cfg80211_disconnect+0xcb/0x12e
 [<c1440b74>] cfg80211_wext_siwmlme+0x64/0x80
 [<c1441cf6>] ioctl_standard_call+0x1d7/0x26f
 [<c139281b>] ? dev_get_by_name_rcu+0x73/0x80
 [<c13928d9>] ? __dev_get_by_name+0x71/0x7e
 [<c1441e81>] wext_handle_ioctl+0xf3/0x17e
 [<c1440b10>] ? cfg80211_wext_siwmlme+0x0/0x80
 [<c1396410>] dev_ioctl+0x578/0x598
 [<c10091b9>] ? restore_i387_fxsave+0x54/0x66
 [<c1387b44>] sock_ioctl+0x1cf/0x1db
 [<c10b0979>] vfs_ioctl+0x28/0x92
 [<c1387975>] ? sock_ioctl+0x0/0x1db
 [<c10b0ed6>] do_vfs_ioctl+0x453/0x491
 [<c1388233>] ? sys_recvmsg+0x2c/0x47
 [<c1389542>] ? sys_socketcall+0x147/0x18c
 [<c10b0f43>] sys_ioctl+0x2f/0x49
 [<c10027d0>] sysenter_do_call+0x12/0x26

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ath9k-devel] kernel warning on 2.6.33 ath9k
  2010-04-28  8:01   ` [ath9k-devel] kernel warning on 2.6.33 ath9k Xu, Martin
@ 2010-04-28 14:04     ` John W. Linville
  2010-04-29  0:39       ` Xu, Martin
  0 siblings, 1 reply; 7+ messages in thread
From: John W. Linville @ 2010-04-28 14:04 UTC (permalink / raw)
  To: ath9k-devel

On Wed, Apr 28, 2010 at 04:01:45PM +0800, Xu, Martin wrote:
> Hi
> I found that kernel reports below warning when using ath9k in kernel 2.6.33.
> Someone can kindly tell me whether it is the new found issue or the issue is known and has been fixed in later commit in git tree?
> Thanks!

Looks like this:

	https://bugzilla.kernel.org/show_bug.cgi?id=15839

> ------------[ cut here ]------------
> WARNING: at kernel/softirq.c:143 local_bh_enable_ip+0x32/0x76()
> Hardware name: AO532h          
> Modules linked in: cbc ecryptfs ath9k ath9k_common battery atl1c joydev ath9k_hw uvcvideo
> Pid: 850, comm: wpa_supplicant Not tainted 2.6.33.2-8.1-netbook #1
> Call Trace:
>  [<c1030978>] warn_slowpath_common+0x66/0x7d
>  [<c1035a74>] ? local_bh_enable_ip+0x32/0x76
>  [<c103099c>] warn_slowpath_null+0xd/0x10
>  [<c1035a74>] local_bh_enable_ip+0x32/0x76
>  [<c14789c0>] _raw_spin_unlock_bh+0x17/0x19
>  [<f871dbd3>] ath_tx_node_cleanup+0xe0/0xf9 [ath9k]
>  [<c103ae46>] ? lock_timer_base+0x22/0x41
>  [<f871a005>] ath9k_sta_notify+0x74/0x78 [ath9k]
>  [<c1443987>] __sta_info_unlink+0x139/0x189
>  [<f8719f91>] ? ath9k_sta_notify+0x0/0x78 [ath9k]
>  [<c14439fa>] sta_info_unlink+0x23/0x31
>  [<c1448834>] ieee80211_set_disassoc+0x1bd/0x1e3
>  [<c1448cf8>] ieee80211_mgd_deauth+0x3c/0xfe
>  [<c144df21>] ieee80211_deauth+0x14/0x16
>  [<c143c3fc>] __cfg80211_mlme_deauth+0xe9/0xf2
>  [<c143eea1>] __cfg80211_disconnect+0xcb/0x12e
>  [<c1440b74>] cfg80211_wext_siwmlme+0x64/0x80
>  [<c1441cf6>] ioctl_standard_call+0x1d7/0x26f
>  [<c139281b>] ? dev_get_by_name_rcu+0x73/0x80
>  [<c13928d9>] ? __dev_get_by_name+0x71/0x7e
>  [<c1441e81>] wext_handle_ioctl+0xf3/0x17e
>  [<c1440b10>] ? cfg80211_wext_siwmlme+0x0/0x80
>  [<c1396410>] dev_ioctl+0x578/0x598
>  [<c10091b9>] ? restore_i387_fxsave+0x54/0x66
>  [<c1387b44>] sock_ioctl+0x1cf/0x1db
>  [<c10b0979>] vfs_ioctl+0x28/0x92
>  [<c1387975>] ? sock_ioctl+0x0/0x1db
>  [<c10b0ed6>] do_vfs_ioctl+0x453/0x491
>  [<c1388233>] ? sys_recvmsg+0x2c/0x47
>  [<c1389542>] ? sys_socketcall+0x147/0x18c
>  [<c10b0f43>] sys_ioctl+0x2f/0x49
>  [<c10027d0>] sysenter_do_call+0x12/0x26

-- 
John W. Linville		Someday the world will need a hero, and you
linville at tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise
  2010-04-28  7:00 ` Jouni Malinen
  2010-04-28  8:01   ` [ath9k-devel] kernel warning on 2.6.33 ath9k Xu, Martin
@ 2010-04-28 20:13   ` Benoit PAPILLAULT
  1 sibling, 0 replies; 7+ messages in thread
From: Benoit PAPILLAULT @ 2010-04-28 20:13 UTC (permalink / raw)
  To: ath9k-devel

Jouni Malinen a ?crit :
> On Tue, 2010-04-27 at 15:08 -0700, Benoit Papillault wrote:
>   
>> +static int ath9k_get_survey(struct ieee80211_hw *hw, int idx,
>> +			     struct survey_info *survey)
>>     
>
>   
>> +	struct ieee80211_conf *conf = &hw->conf;
>> +
>> +	 if (idx != 0)
>> +		return -ENOENT;
>> +
>> +	survey->channel = conf->channel;
>>     
>
> Are there any plans on providing this information from all channels? I
> have assumed that the survey command was supposed to be used for
> surveying all channels (e.g., to get information for auto-channel
> selection) and returning something for the current channel is quite
> limited subset of that. In other words, I would like to be able to run a
> scan of all channels and then use NL80211_CMD_GET_SURVEY to fetch
> additional per-channel information like noise (and also channel usage
> statistics in case of ath9k) from the scanned channels.
>
> - Jouni
>   
Hi Jouni,

I dig into the source code to understand the use of "idx" and having the 
value for all scanned channels sounds a good plan. However :

- when doing a normal scan (iw dev wlan0 scan), the noise floor 
calibration is started in a special mode, so I don't know if the results 
is accurate enought.

- the first calibration takes some times .... more than the scan itself. 
So, you cannot get a valid value before switching to the next channel.

Anyway, how idx is supposed to be used? From 0 ... up to the callback 
returning -ENOENT ?
Do we need to keep a table with noise for each channel and return those 
where we have a value, in which case idx cannot be used as an index into 
this table ?

Regards,
Benoit

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [ath9k-devel] kernel warning on 2.6.33 ath9k
  2010-04-28 14:04     ` John W. Linville
@ 2010-04-29  0:39       ` Xu, Martin
  0 siblings, 0 replies; 7+ messages in thread
From: Xu, Martin @ 2010-04-29  0:39 UTC (permalink / raw)
  To: ath9k-devel

> -----Original Message-----
> From: John W. Linville [mailto:linville at tuxdriver.com]
> Sent: Wednesday, April 28, 2010 10:05 PM
> To: Xu, Martin
> Cc: ath9k-devel at lists.ath5k.org; linux-wireless at vger.kernel.org
> Subject: Re: kernel warning on 2.6.33 ath9k
> 
> On Wed, Apr 28, 2010 at 04:01:45PM +0800, Xu, Martin wrote:
> > Hi
> > I found that kernel reports below warning when using ath9k in kernel 2.6.33.
> > Someone can kindly tell me whether it is the new found issue or the issue is
> known and has been fixed in later commit in git tree?
> > Thanks!
> 
> Looks like this:
Yes, just this, thanks. 

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-29  0:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-27 22:08 [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise Benoit Papillault
2010-04-27 22:17 ` Luis R. Rodriguez
2010-04-28  7:00 ` Jouni Malinen
2010-04-28  8:01   ` [ath9k-devel] kernel warning on 2.6.33 ath9k Xu, Martin
2010-04-28 14:04     ` John W. Linville
2010-04-29  0:39       ` Xu, Martin
2010-04-28 20:13   ` [ath9k-devel] [PATCH] ath9k: Added get_survey callback in order to get channel noise Benoit PAPILLAULT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox