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>
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>
- 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>
Adjust nl80211_send() to propagate errors back to the caller and do not
free message and callbacks in send error case anymore since all callsites
immediately invoke nl80211_free() anyway.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
If the first attempt to lookup the phy index by the path value fails, retry to
find the index within the platform/ subdirectory to follow the logic used by
the mac80211 package.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
With the mac80211 commit d55d0d598e66 ("nl80211: put current TX power in
interface info") it is possible now to get TX power using nl80211. As we
don't really support any wext-only drivers it doesn't make sense to
leave wext as a fallback.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
The old nl80211_hostapd_info() used a global static buffer which was not
properly zeroed on subsequent invocations, leading to misreported encryption
values when querying multiple radios or radious with multiple vifs.
Also rework and simplify the control socket code for wpa_supplicant by
splitting status query and scan handling.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
look up device path via uci instead of assuming a direct phy index
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn+ssh://svn.openwrt.org/openwrt/trunk@42759 3c298f89-4303-0410-b956-a3cf2f4a3e73