The mac80211.sh implementation of the uci "path" option compares the
readlink() results of each /sys/class/ieee80211/*/device link to find
the proper phy directory while iwinfo so far tried to construct a full
path out of the uci value.
The iwinfo approach appears to fail under certain circumstances, e.g.
with Hyper-V systems utilizing PCI passthrough for the radio devices.
This commit mimicks the behaviour of mac80211.sh more closely to
achieve the same results.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
When wpa_supplicant responds with FAIL-BUSY in response to the SCAN
command, a scan process is already in process. Instead of failing in
this case, simply keep awaiting the result list.
This also significantly speeds up the scan operation in many cases.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Refactor the parsing of wpa_supplicant scan list results, the wpa_supplicant
status output and the hostapd configuration file format to properly detect
WPA3 key management protocols like SAE, OWE or EAP Suite B.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
With WPA3 the wpa_key_mgmt string can be longer than 16 bytes. The
sea-mixed setting for example is 27 bytes long:
wpa_key_mgmt=WPA-PSK WPA-PSK-SHA256 SAE
Increase the buffer to better detect more complicated authentication methods.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This patch adds support for WPA3, meaning SAE and OWE are now properly identified.
This fixes iwinfo and LuCi showing WPA2 NONE for WPA3 SAE and OWE.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Do not require a temporary interface just to read the hardware ID numbers
from a given phy name, instead read the data from the ieee80211 sysfs
directory.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This device currently showed up as Generic Mac80211.
While at it, spell the vendor name correctly (large 'T')
Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
This commit includes all power offsets and subsystem device IDs
for Ubiquiti XM and XW devices. The device ID is wildcarded.
Consistency has been tested among all Ubiquiti platforms.
These values seem to be PA gains and likely do not include
antenna gains. I expect the antenna gains to be defined in ART-
partitions.
Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
This patch enables proper identification of ad hwmode in channel2frequency function.
Now iwinfo will properly calculate frequency for a channels 1-6 in 802.11ad.
Fixes a8e8275923
Signed-off-by: Robert Marko <robimarko@gmail.com>
This patch adds support for identifying, calculating channels from
frequency and vice versa as well as Lua hwmode for 802.11ad.
Support has been added for channels 1-6.
Signed-off-by: Robert Marko <robimarko@gmail.com>
[Increase buffer size for hwmodes]
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This reverts commit a51413988c.
It causes assertion failures in ld and requires changes to linked libraries,
so drop this for now.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Some wireless runtime parameters are not available via nl80211, e.g.
the effective Mesh ID so we need to fetch those from ubus state info.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
The wpa_supplicant control socket might reply with "FAIL-BUSY" when
attempting to start a scan while another scanning process is already
running, back out early in this case.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
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>
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>
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>
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>