Remove the assumption that phy names follow the format phy%d and instead look
up the phy index from sysfs properly
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Don't assume a fixed naming pattern. Check all options in this order:
- netdev
- phy name
- wifi device in uci
Use the first one that matches
Signed-off-by: Felix Fietkau <nbd@nbd.name>
`iwinfo.h` says:
#define IWINFO_KMGMT_COUNT 5
...
extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT];
Though only only 3 items are defined. The other two were forgotten
when adding WPA3 support. The `auth_suites` table exposed via Lua
never included the items "SAE" and "OWE" until this commit.
Fixes: f8ef450652 ("iwinfo: Add support for WPA3")
Signed-off-by: Tjeu Kayim <15987676+TjeuKayim@users.noreply.github.com>
Don't add the hwmode A for radios which do not support 5GHz operation.
Before, this hwmode was added to all non-VHT radios regardless of their
supported bands.
Fixes commit 562d015326 ("iwinfo: nl80211: fix hwmode parsing for multi-band NICs")
Signed-off-by: David Bauer <mail@david-bauer.net>
In case a NIC supports multiple frequency bands, the supported
hw-modelist might not contain all valid hwmodes, as B/G/AD hwmodes are
only included based on the last parsed supported frequency.
In case a radio supports multiple bands, this might result in these
hwmodes not being flagged as supported.
Circumvent this by tracking all seen frequency bands using a bitmask
which later determined which HW modes are listed as supported.
Signed-off-by: David Bauer <mail@david-bauer.net>
The previous shell script implementation accepted shorter path values
that omitted initial parts before the pcie bus node by only checking if
the configured path is included in the determined path
Add support for doing the same thing here
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This adds 802.11ax HE specific rate information to iwinfo.
Add fields for HE status of a STA as well as DCM and guard interval
fields specific to HE operation.
Signed-off-by: David Bauer <mail@david-bauer.net>
Perform a split wiphy dump when acquiring the hw modelist of a mac80211
device. Otherwise HE capabilities are missing from the message.
This is necessary since upstream commit f8d504caa ("nl80211: reduce
non-split wiphy dump size") (Kernel 5.9).
Signed-off-by: David Bauer <mail@david-bauer.net>
This adds basic support for IEEE 802.11ax when requesting HW or HT
Modelist for a PHY from iwinfo. This way, applications using iwinfo can
detect HE phys.
Signed-off-by: David Bauer <mail@david-bauer.net>
Add description strings and detection logic for all 6
types of WiFi NICs integrated in QCA MIPS WiSoCs.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Extend support for WPA ciphers by GCMP which is required for 802.11ad.
Breaks ABI as ciphers now needs to be a field of 16 bits instead of 8.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
When using 802.11ad, the frequency string will no longer fit in the
preallocated buffer of 10 bytes. In the best case this leads to the
'z' character being truncated in the CLI output:
Mode: Client Channel: 1 (58.320 GH)
Fix that by allocating a large enough buffer.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Iwinfo already export the htmode but there is no way to know where the
channel expan in case a 40Mhz+ channel width is used. Export the center
channels used by the driver to better know the channel utilizzation of
the wifi.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Export ht and vht operation data in scan results. These additional data
can be usefull to check wifi channel utilizzation by neraby stations.
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
As it's the most reliable and straight forward way on modern platforms,
detect the hardware ID by checking the 'compatible'-string of non-PCI
(ie. built-in) devices.
As this is only relevant for WiSoCs, there won't be that many records,
so it's not worth making any larger structural changes. Hence just
match the compatible string and translate it into fake PCI IDs.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This adds the PCI-ID for the MT7915 series.
This PCI-ID was found on the Ubiquiti UniFi6 Lite Access Point.
Signed-off-by: David Bauer <mail@david-bauer.net>
Commit bf2c1069a7 ("nl80211: add htmode to iwinfo_ops") increased
IWINFO_HTMODE_COUNT but left the size of the IWINFO_HTMODE_NAMES array
untouched, leading to a segmentation fault when trying to get the HT
modelist from Lua.
Add a dummy NOHT modestring to make the array size fit the size
declaration.
Fixes: bf2c1069a7 ("nl80211: add htmode to iwinfo_ops")
Signed-off-by: David Bauer <mail@david-bauer.net>
This reverts commit a6914dc0dc.
iwinfo currently misses ABI version tracking in OpenWrt, potentially
breaking other packages unintentionally.
Revert this commit for now until this is implemented.
Otherwise, we are not able to safely bump iwinfo at the moment.
Signed-off-by: David Bauer <mail@david-bauer.net>
This adds support for the BSS load information element. With this patch,
the BSS load information is visible when using the CLI as well as when
accessing scan results using the LUA binding.
Signed-off-by: David Bauer <mail@david-bauer.net>
This fixes VAPs not being queried correctly when the netdev name starts
with "radio".
Fixes: FS#2629
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: David Bauer <mail@david-bauer.net>