On Wed, 2018-06-13 at 16:15 +0530, Tamizh chelvam wrote: > > + if (sta->rssi_thold && bss_conf->enable_beacon) { > + int last_event = sta->last_sta_mon_event_signal; > + int thold = sta->rssi_thold; > + int hyst = sta->rssi_hyst; > + int sig = -ewma_signal_read(&sta->rx_stats_avg.signal); > + > + if (sig < thold && > + (last_event == 0 || sig < last_event - hyst)) { > + sta->last_sta_mon_event_signal = sig; > + cfg80211_sta_mon_rssi_notify( > + rx->sdata->dev, sta->addr, > + NL80211_STA_MON_RSSI_THRESHOLD_EVENT_LOW, > + sig, GFP_ATOMIC); > + } else if (sig > thold && > + (last_event == 0 || sig > last_event + hyst)) { > + sta->last_sta_mon_event_signal = sig; > + cfg80211_sta_mon_rssi_notify( > + rx->sdata->dev, sta->addr, > + NL80211_STA_MON_RSSI_THRESHOLD_EVENT_HIGH, > + sig, GFP_ATOMIC); > + } > + } This seems really familiar - perhaps if you unify the cfg80211 API for sta_mon and "normal" CQM (distinguish based on the peer address?) you can unify this block of code too? johannes