Commit graph

34 commits

Author SHA1 Message Date
Andre Heider
0172c97759
cli: print the frequency and band on the scan list
Provide band and frequency info on scan list dump.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:26:58 +01:00
Andre Heider
bbe424f394
cli: print the band on the frequency list
Provide band info on frequency list dump.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:26:58 +01:00
Andre Heider
dbc0ee7c57
cli: describe USB devices as such
This makes it clear if the hardware is embedded or usb/pci based.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 16:08:00 +01:00
Jo-Philipp Wich
fac0787ab0
devices: add support for declaring compatible matched devices
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>
2023-01-10 00:26:50 +01:00
Andre Heider
8d158096a9 cli: print current HT mode
This was present in the ubus call provided by rpcd, but not the cli.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
8f86dd69f7 cli: use IWINFO_HTMODE_COUNT
ARRAY_SIZE works too, but just the sake of consistency.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
f36b72b00d cli: use IWINFO_KMGMT_NAMES
There's no need to duplicate the strings or even miss new ones.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
91be7e0d28 cli: use IWINFO_CIPHER_NAMES
There's no need to duplicate the strings or even miss new ones.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
49b6ec91e9 cli: fix printing the scan channel width
The "chan_width" var contains an index, not a value.

While at it, make the 40 and 2040 description shorter and clearer.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
b1c8873e37 cli: fix marking the active channel
Match by frequency and not by channel as the radio might have the same
channel on multiple bands:

$ iwinfo radio0 freqlist
[snip]
* 2.432 GHz (Channel 5)
[snip]
* 5.975 GHz (Channel 5)
[snip]

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
87529770f6 utils: add and use iwinfo_format_hwmodes()
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>
2022-12-16 00:09:07 +01:00
Andre Heider
d6381634c2 fix -Wdangling-else warnings
It's less confusing with braces.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-15 20:07:49 +01:00
Andre Heider
ccaabb4ea4 fix -Wformat-truncation warnings
Increase buffer sizes to get rid of e.g.:
iwinfo_nl80211.c:797:41: note: 'snprintf' output between 24 and 279 bytes into a destination of size 64

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-15 20:07:49 +01:00
Joerg Werner
0dad3e6660 Add support for CCMP-256 and GCMP-256 ciphers
Signed-off-by: Joerg Werner <schreibubi@gmail.com>
2022-08-20 17:59:11 +02:00
Felix Fietkau
aa0e3c4bbe iwinfo: nl80211: add support for printing the device path for a phy
Will be used to replace the shell code from mac80211.sh

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-06-09 13:57:26 +02:00
David Bauer
c45f0b584b iwinfo: add 802.11ax HE rate information
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>
2021-05-02 00:20:54 +02:00
David Bauer
cd23727f72 iwinfo: cli: fix hwmode formatting
The placeholder for the 802.11ax hwmode was missing.

Signed-off-by: David Bauer <mail@david-bauer.net>
2021-04-20 18:04:31 +02:00
David Bauer
50b64a63e3 iwinfo: add basic IEEE 802.11ax support
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>
2021-04-12 23:45:42 +02:00
Daniel Golle
8bfd8d8800 iwinfo: add support for GCMP cipher
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>
2021-01-05 22:19:43 +00:00
Daniel Golle
74d13fb987 cli: account for additional digit for frequencies above 10GHz
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>
2021-01-05 22:19:43 +00:00
Ansuel Smith
4e22953eb1 iwinfo: export center_chan info for local wifi
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>
2021-01-05 22:19:43 +00:00
Ansuel Smith
ea28dfb5f9 iwinfo: export ht and vht operation in scan results
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>
2021-01-05 22:19:42 +00:00
David Bauer
06a03c9e3b Revert "iwinfo: add BSS load element to scan result"
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>
2020-03-22 01:06:36 +01:00
David Bauer
a6914dc0dc iwinfo: add BSS load element to scan result
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>
2020-02-04 14:44:14 +01:00
Jo-Philipp Wich
02112f9b10 cli: fix reporting of mixed WPA2/WPA3 versions
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2019-09-20 13:12:56 +02:00
Hauke Mehrtens
f599a8dc01 iwinfo: Fix rate buffer size
This string could be truncated for higher rates.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2019-09-01 19:43:40 +02:00
Robert Marko
f8ef450652 iwinfo: Add support for WPA3
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>
2019-09-01 12:38:57 +02:00
Robert Marko
a8e8275923 iwinfo: Add support for 802.11ad
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>
2019-03-21 16:28:39 +01:00
Daniel Golle
223e09bf3f 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>
2018-02-15 04:50:28 +01:00
Jo-Philipp Wich
78f0fafa59 cli: support reporting VHT rates
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-25 15:02:50 +01:00
Jo-Philipp Wich
e8a1e7d224 Fix -Wall -Wpedantic warnings
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-05-19 18:54:58 +02:00
Jo-Philipp Wich
7b39bee1c6 iwinfo: add support for querying available HT modes
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-05-08 13:29:10 +02:00
Jo-Philipp Wich
149ce00582 cli: add command to translate uci section to phy name
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-10-27 17:18:21 +01:00
Jo-Philipp Wich
8ae758db52 Initial commit
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-10-05 19:56:27 +02:00