Skip to contentSkip to conversation

mac80211: Get ethtool-stats frequency more often.

PATCH In review [email protected] 2 participants 2 messages May 9, 2016 – May 12, 2016 mac80211

lore
Share & tools
lore
#0 lore raw

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
index 9cc986d..4e937c1 100644
@@ -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
maintainer
#1 lore raw

Hi Ben,

I'm confused about the subject - "more often"?

Quoted 3 lines

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