mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-09 00:02:48 +01:00
netdev: update RSSI polling to use station info parser
This commit is contained in:
parent
cf17d42972
commit
08de8186c6
25
src/netdev.c
25
src/netdev.c
@ -408,6 +408,7 @@ static void netdev_rssi_poll_cb(struct l_genl_msg *msg, void *user_data)
|
|||||||
uint16_t type, len;
|
uint16_t type, len;
|
||||||
const void *data;
|
const void *data;
|
||||||
bool found;
|
bool found;
|
||||||
|
struct netdev_station_info info;
|
||||||
uint8_t prev_rssi_level_idx = netdev->cur_rssi_level_idx;
|
uint8_t prev_rssi_level_idx = netdev->cur_rssi_level_idx;
|
||||||
|
|
||||||
netdev->rssi_poll_cmd_id = 0;
|
netdev->rssi_poll_cmd_id = 0;
|
||||||
@ -420,28 +421,20 @@ static void netdev_rssi_poll_cb(struct l_genl_msg *msg, void *user_data)
|
|||||||
if (type != NL80211_ATTR_STA_INFO)
|
if (type != NL80211_ATTR_STA_INFO)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (!l_genl_attr_recurse(&attr, &nested))
|
||||||
|
goto done;
|
||||||
|
|
||||||
|
if (!netdev_parse_sta_info(&nested, &info))
|
||||||
|
goto done;
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!found || !l_genl_attr_recurse(&attr, &nested))
|
if (!found || !info.have_cur_rssi)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
found = false;
|
netdev->cur_rssi = info.cur_rssi;
|
||||||
while (l_genl_attr_next(&nested, &type, &len, &data)) {
|
|
||||||
if (type != NL80211_STA_INFO_SIGNAL_AVG)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (len != 1)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
found = true;
|
|
||||||
netdev->cur_rssi = *(const int8_t *) data;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!found)
|
|
||||||
goto done;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Note we don't have to handle LOW_SIGNAL_THRESHOLD here. The
|
* Note we don't have to handle LOW_SIGNAL_THRESHOLD here. The
|
||||||
|
Loading…
Reference in New Issue
Block a user