The 32bit counter can only count to 4GiB before wrapping.
Switching to the 64bit variant avoids this issue.
In practice some users are interpreting the counter values as signed
integer bringing down the usable range for 32bit values down to only
2GiB.
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
In converting the iwinfo header to enum-define pattern the IWINFO_AUTH
define conversion was wrongly dropped. Readd the missing define to fix
iwinfo always reporting None as encryption.
Fixes: 7e3d7ded29 ("iwinfo: reorganize iwinfo header to enum and defines")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Providing the channel alone isn't clear as there're overlapping channels
on e.g. band 2 and 6.
Note: This changes the ABI.
Signed-off-by: Andre Heider <a.heider@gmail.com>
So that consumers don't have to fiddle around with mapping frequencies
to bands, which everyone seems to do a little differently.
Note: This changes the ABI.
Signed-off-by: Andre Heider <a.heider@gmail.com>
iwinfo.h have a mixed way to declare defines, some use enum, some define
bits in enum and other have their own special way. In all of this case
the count of all this defines is hardcoded to an arbitrary number.
To make code less error prone, convert everything to a common pattern
and use enum way to calculate the count of each flags.
Also drop defining number for each flag and just declare that the enum
starts from 0.
Move the related char array just below the define declaration to improve
code readability.
No functionl change intended.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Some device have embedded wifi card that are not connected with usb or
internall with pci. Such device have fake device_id and only the
vendor_id actually reflect something real but internally they don't have
any id and are just matched by the node compatible binding in DT.
We currently match this with a big if-else to match the single devices
but this can be improved and be matched directly in devices.txt
Rework this so that we can drop the big if-else and move the matching
to devices.txt
When a device is matched using compatible in iwinfo the hardware will be
flagged as embedded and won't print empty ids.
Update devices.txt by migrating all the compatible matching device from
fake id to compatible matching.
Tested-by: Christian Marangi <ansuelsmth@gmail.com> # ipq4019
Co-developed-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Tested-by: Robert Marko <robimarko@gmail.com> # ipq8074
Reviewed-by: Andre Heider <a.heider@gmail.com>
Some defines/enums use bits, while some functions only set a single one.
Make it less painful to get to a name for those.
This avoids hardcoding bit lists for consumers.
Signed-off-by: Andre Heider <a.heider@gmail.com>
Unify how hwmodes are displayed, e.g.:
"802.11ac/ax/b/g/n" instead of "802.11bgnacax".
Luci currently uses a natural sort order, but that probably doesn't work
as intended once "be" is added, so let's do this here.
Signed-off-by: Andre Heider <a.heider@gmail.com>
Repurpose the IWINFO_FREQ_NO_2160MHZ define for that, which was
introduced but never used. nl80211 doesn't have such a flag either.
Signed-off-by: Andre Heider <a.heider@gmail.com>
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>
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>
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>
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>
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>
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 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>
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>
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>
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>
This adds flags field which may be used to mark frequency not available
under some conditions.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-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>
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