nl80211: fix code calculating average signal and rate Using average of previous average and the next value is highly imprecise. E.g. for values 20, 20, 20, 180 it would result in /average/ of 100 (instead of 60). Fix it by storing & using an info of how many samples were used for the previous calculation. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
add support for expected throughput cfg80211 allows drivers to announce the to-be-expected layer-2 datarate using the NL80211_STA_INFO_EXPECTED_THROUGHPUT field. This information is useful as a metric for user-space routing daemons, so grab it via nl80211 and make it available in both C and Lua APIs, and show expected throughput on CLI interface assoclist. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
nl80211: do not block when driver aborts scan Drivers may abort a scan by calling cfg80211_scan_done() with a struct cfg80211_scan_info that sets aborted to true. To avoid blocking forever consider both NL80211_CMD_NEW_SCAN_RESULTS and NL80211_CMD_SCAN_ABORTED when waiting for scan results. Tested with Broadcom's bcmdhd driver. Signed-off-by: Olof Sivertsson <olof.sivertsson@zenterio.com> [rebased on top of variadic nl80211_wait()] Signed-off-by: Jo-Philipp Wich <jo@mein.io>
nl80211: turn nl80211_wait() into variadic function Extend the nl82011_wait() function to accept multiple command numbers. This is useful to wait for different possible results, e.g. either NL80211_CMD_NEW_SCAN_RESULTS or NL80211_CMD_SCAN_ABORTED. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
nl80211: support receiving split frequencies In order to get more details about each frequency we will need to set NL80211_ATTR_SPLIT_WIPHY_DUMP in the future. This will result in our callback being called multiple times. Modify it to support such a scenario: 1) Start putting new frequencies after the last set one 2) Make sure that attribute is set before iterating it Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Jo-Philipp Wich <jo@mein.io>
nl80211: improve error handling - introduce a new nl80211_request() which combines nl80211_msg() with nl80211_send() to simplify calling code - always invoke nl80211_free() in nl80211_send() and remove explicit nl80211_free() invocations in callers - back out early on netlink errors in functions performing multiple calls, e.g. when fetching scan results Signed-off-by: Jo-Philipp Wich <jo@mein.io>
lua: fix WPA cipher reporting Use the same logic as the command line interface for reporting the used WPA ciphers. Instead of printing the intersection of pairwise and group ciphers, report both group and pairwise ciphers. This fixes a case where a connection which uses CCMP for pairwise and TKIP as groupwise cipher is getting reported as using the NONE cipher. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Makefile: explictly link with all shared libraries linking with libuci means we need to link with libblobmsg_json, libjson-c and libubox. Sinc e we do not use pkg-config or something equivalent, we need to specify all dependencies. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>