mac80211: Get ethtool-stats frequency more often.
PATCH 1/1 mac80211: Get ethtool-stats frequency more often.
From: Ben Greear <[email protected]>
Some NICs (ath9k_htc) don't use chanctx_conf, it seems, so look at local->hw.conf.channel->center_freq in that case.
--- net/mac80211/ethtool.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
net/mac80211/ethtool.c +8 -4
@@ -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
Signature · 1 line
2.4.3
Johannes Berg
maintainerHi Ben,
I'm confused about the subject - "more often"?
Quoted 3 lines
Some NICs (
ath9k_htc) don't usechanctx_conf, it seems, so look atlocal->hw.conf.channel->center_freqin that case.
It shouldn't matter whether or not the *driver* (not NIC anyway) uses that structure - mac80211 uses it throughout internally. As such, this doesn't really make sense.
I also think that your patch is wrong because it causes a driver that doesn't report information for the current channel to still have a non- zero frequency, so userspace won't be able to tell if there's any data or not.
johannes