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.

Signed-off-by: Ben Greear <[email protected]>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to