ath9k: Added get_survey callback in order to get channel noise
PATCH 1/1 ath9k: Added get_survey callback in order to get channel noise
--- drivers/net/wireless/ath/ath9k/main.c | 20 ++++++++++++++++++++ 1 files changed, 20 insertions(+), 0 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +20 -0
@@ -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,
Signature · 1 line
1.5.6.5
PATCH 1/1 ath9k: Added get_survey callback in order to get channel noise
Quoted 2 lines · Benoit Papillault
Signed-off-by Benoit Papillault <[email protected]>
Looks good, thanks for this work.
Luis
PATCH 1/1 ath9k: Added get_survey callback in order to get channel noise
In reply to Benoit Papillaultdrivers/net/wireless/ath/ath9k/main.c static int ath9k_ampdu_action(struct ieee80211_hw *hw, · line 2062
Quoted 9 lines · Benoit Papillault
drivers/net/wireless/ath/ath9k/main.c +8
-0+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
Xu
[ath9k-devel] kernel warning on 2.6.33 ath9k
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
[ath9k-devel] kernel warning on 2.6.33 ath9k
Quoted 4 lines · Martin
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
Quoted 38 lines
------------[ 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
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you linville at tuxdriver.com might be all we have. Be ready.
Xu
[ath9k-devel] kernel warning on 2.6.33 ath9k
Quoted 7 lines
-----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
Quoted 8 lines
Quoted 3 lines · Martin
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 isknown and has been fixed in later commit in git tree?
Quoted 1 line
Thanks!
Looks like this:
Yes, just this, thanks.
PATCH 1/1 ath9k: Added get_survey callback in order to get channel noise
In reply to Jouni MalinenJouni Malinen a ?crit :
Quoted 24 lines · Benoit Papillault
drivers/net/wireless/ath/ath9k/main.c static int ath9k_ampdu_action(struct ieee80211_hw *hw, · line 2062
Quoted 13 lines
drivers/net/wireless/ath/ath9k/main.c +8
-0+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_SURVEYto fetch additional per-channel information like noise (and also channel usage statistics in case of ath9k) from the scanned channels.
Quoted 2 lines
- 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