mt76: mt7615: measure channel noise and report it via survey
[linux-2.6-microblaze.git] / drivers / net / wireless / mediatek / mt76 / mac80211.c
index 8cc09aa..d752fb5 100644 (file)
@@ -618,6 +618,9 @@ int mt76_get_survey(struct ieee80211_hw *hw, int idx,
        survey->channel = chan;
        survey->filled = SURVEY_INFO_TIME | SURVEY_INFO_TIME_BUSY;
        survey->filled |= dev->drv->survey_flags;
+       if (state->noise)
+               survey->filled |= SURVEY_INFO_NOISE_DBM;
+
        if (chan == phy->main_chan) {
                survey->filled |= SURVEY_INFO_IN_USE;
 
@@ -628,6 +631,7 @@ int mt76_get_survey(struct ieee80211_hw *hw, int idx,
        survey->time_busy = div_u64(state->cc_busy, 1000);
        survey->time_rx = div_u64(state->cc_rx, 1000);
        survey->time = div_u64(state->cc_active, 1000);
+       survey->noise = state->noise;
 
        spin_lock_bh(&dev->cc_lock);
        survey->time_bss_rx = div_u64(state->cc_bss_rx, 1000);