@@ -1108,6 +1108,7 @@ struct wpa_signal_info {
u32 frequency;
int above_threshold;
int current_signal;
+ int avg_signal;
int current_noise;
int current_txrate;
enum chan_width chanwidth;
@@ -1765,6 +1765,7 @@ static int get_link_signal(struct nl_msg *msg, void *arg)
struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1];
static struct nla_policy policy[NL80211_STA_INFO_MAX + 1] = {
[NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
+ [NL80211_STA_INFO_SIGNAL_AVG] = { .type = NLA_U8 },
};
struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1];
static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
@@ -1787,6 +1788,13 @@ static int get_link_signal(struct nl_msg *msg, void *arg)
sig_change->current_signal =
(s8) nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]);
+
+ if (sinfo[NL80211_STA_INFO_SIGNAL_AVG])
+ sig_change->avg_signal =
+ (s8) nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]);
+ else
+ sig_change->avg_signal = 0;
+
if (sinfo[NL80211_STA_INFO_TX_BITRATE]) {
if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX,
sinfo[NL80211_STA_INFO_TX_BITRATE],
@@ -5029,10 +5029,12 @@ static int wpa_supplicant_signal_poll(struct wpa_supplicant *wpa_s, char *buf,
if (ret)
return -1;
- ret = os_snprintf(buf, buflen, "RSSI=%d\nLINKSPEED=%d\n"
+ ret = os_snprintf(buf, buflen, "RSSI=%d\n"
+ "AVG_RSSI=%d\nLINKSPEED=%d\n"
"NOISE=%d\nFREQUENCY=%u\nWIDTH=%s\n"
"CENTER_FRQ1=%d\nCENTER_FRQ2=%d\n",
- si.current_signal, si.current_txrate / 1000,
+ si.current_signal, si.avg_signal,
+ si.current_txrate / 1000,
si.current_noise, si.frequency,
channel_width_name(si.chanwidth),
si.center_frq1, si.center_frq2);