All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mac80211: Get ethtool-stats frequency more often.
@ 2016-05-09 23:12 greearb
  2016-05-12  8:23 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: greearb @ 2016-05-09 23:12 UTC (permalink / raw)
  To: linux-wireless; +Cc: Ben Greear

From: Ben Greear <greearb@candelatech.com>

Some NICs (ath9k_htc) don't use chanctx_conf, it
seems, so look at local->hw.conf.channel->center_freq
in that case.

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 net/mac80211/ethtool.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/net/mac80211/ethtool.c b/net/mac80211/ethtool.c
index 9cc986d..4e937c1 100644
--- a/net/mac80211/ethtool.c
+++ b/net/mac80211/ethtool.c
@@ -165,10 +165,14 @@ do_survey:
 		} while (channel != survey.channel);
 	}
 
-	if (survey.filled)
-		data[i++] = survey.channel->center_freq;
-	else
-		data[i++] = 0;
+	if (channel) {
+		data[i++] = channel->center_freq;
+	} else {
+		if (local->_oper_chandef.chan)
+			data[i++] = local->_oper_chandef.chan->center_freq;
+		else
+			data[i++] = 0;
+	}
 	if (survey.filled & SURVEY_INFO_NOISE_DBM)
 		data[i++] = (u8)survey.noise;
 	else
-- 
2.4.3


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

end of thread, other threads:[~2016-05-12  8:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-09 23:12 [PATCH] mac80211: Get ethtool-stats frequency more often greearb
2016-05-12  8:23 ` 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.