Message ID | 1462835537-11268-1-git-send-email-greearb@candelatech.com (mailing list archive) |
---|---|
State | Changes Requested |
Delegated to: | Johannes Berg |
Headers | show |
Hi Ben, I'm confused about the subject - "more often"? > Some NICs (ath9k_htc) don't use chanctx_conf, it > seems, so look at local->hw.conf.channel->center_freq > in 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 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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