summaryrefslogtreecommitdiff
path: root/iwinfo_cli.c
Commit message (Collapse)AuthorAgeFilesLines
* cli: print the flags on the frequency listAndre Heider2023-01-201-2/+21
| | | | | | | Provide info for each flags applied to the frequency on frequency list dump. Signed-off-by: Andre Heider <a.heider@gmail.com>
* cli: print the frequency and band on the scan listAndre Heider2023-01-201-1/+3
| | | | | | Provide band and frequency info on scan list dump. Signed-off-by: Andre Heider <a.heider@gmail.com>
* cli: print the band on the frequency listAndre Heider2023-01-201-1/+13
| | | | | | Provide band info on frequency list dump. Signed-off-by: Andre Heider <a.heider@gmail.com>
* cli: describe USB devices as suchAndre Heider2023-01-201-0/+4
| | | | | | This makes it clear if the hardware is embedded or usb/pci based. Signed-off-by: Andre Heider <a.heider@gmail.com>
* devices: add support for declaring compatible matched devicesJo-Philipp Wich2023-01-101-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* cli: print current HT modeAndre Heider2022-12-161-2/+17
| | | | | | This was present in the ubus call provided by rpcd, but not the cli. Signed-off-by: Andre Heider <a.heider@gmail.com>
* cli: use IWINFO_HTMODE_COUNTAndre Heider2022-12-161-1/+1
| | | | | | ARRAY_SIZE works too, but just the sake of consistency. Signed-off-by: Andre Heider <a.heider@gmail.com>
* cli: use IWINFO_KMGMT_NAMESAndre Heider2022-12-161-14/+4
| | | | | | There's no need to duplicate the strings or even miss new ones. Signed-off-by: Andre Heider <a.heider@gmail.com>
* cli: use IWINFO_CIPHER_NAMESAndre Heider2022-12-161-32/+4
| | | | | | There's no need to duplicate the strings or even miss new ones. Signed-off-by: Andre Heider <a.heider@gmail.com>
* cli: fix printing the scan channel widthAndre Heider2022-12-161-13/+18
| | | | | | | | 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>
* cli: fix marking the active channelAndre Heider2022-12-161-4/+4
| | | | | | | | | | | | | | 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>
* utils: add and use iwinfo_format_hwmodes()Andre Heider2022-12-161-11/+2
| | | | | | | | | | 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>
* fix -Wdangling-else warningsAndre Heider2022-12-151-0/+2
| | | | | | It's less confusing with braces. Signed-off-by: Andre Heider <a.heider@gmail.com>
* fix -Wformat-truncation warningsAndre Heider2022-12-151-4/+4
| | | | | | | 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>
* Add support for CCMP-256 and GCMP-256 ciphersJoerg Werner2022-08-201-0/+6
| | | | Signed-off-by: Joerg Werner <schreibubi@gmail.com>
* iwinfo: nl80211: add support for printing the device path for a phyFelix Fietkau2021-06-091-0/+14
| | | | | | Will be used to replace the shell code from mac80211.sh Signed-off-by: Felix Fietkau <nbd@nbd.name>
* iwinfo: add 802.11ax HE rate informationDavid Bauer2021-05-021-0/+14
| | | | | | | | | 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>
* iwinfo: cli: fix hwmode formattingDavid Bauer2021-04-201-2/+2
| | | | | | The placeholder for the 802.11ax hwmode was missing. Signed-off-by: David Bauer <mail@david-bauer.net>
* iwinfo: add basic IEEE 802.11ax supportDavid Bauer2021-04-121-1/+2
| | | | | | | | 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>
* iwinfo: add support for GCMP cipherDaniel Golle2021-01-051-0/+3
| | | | | | | 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>
* cli: account for additional digit for frequencies above 10GHzDaniel Golle2021-01-051-1/+1
| | | | | | | | | | | 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: export center_chan info for local wifiAnsuel Smith2021-01-051-0/+23
| | | | | | | | | 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>
* iwinfo: export ht and vht operation in scan resultsAnsuel Smith2021-01-051-1/+34
| | | | | | | 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>
* Revert "iwinfo: add BSS load element to scan result"David Bauer2020-03-221-10/+1
| | | | | | | | | | | | This reverts commit a6914dc0dc3cba65e245fbe40076626ea2bcd5a3. 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>
* iwinfo: add BSS load element to scan resultDavid Bauer2020-02-041-1/+10
| | | | | | | | 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>
* cli: fix reporting of mixed WPA2/WPA3 versionsJo-Philipp Wich2019-09-201-22/+18
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* iwinfo: Fix rate buffer sizeHauke Mehrtens2019-09-011-1/+1
| | | | | | This string could be truncated for higher rates. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
* iwinfo: Add support for WPA3Robert Marko2019-09-011-0/+12
| | | | | | | 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>
* iwinfo: Add support for 802.11adRobert Marko2019-03-211-3/+4
| | | | | | | | | | | 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>
* add support for expected throughputDaniel Golle2018-02-151-1/+4
| | | | | | | | | | 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>
* cli: support reporting VHT ratesJo-Philipp Wich2016-01-251-5/+13
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* Fix -Wall -Wpedantic warningsJo-Philipp Wich2015-05-191-1/+0
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* iwinfo: add support for querying available HT modesJo-Philipp Wich2015-05-081-0/+22
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* cli: add command to translate uci section to phy nameJo-Philipp Wich2014-10-271-31/+80
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* Initial commitJo-Philipp Wich2014-10-051-0/+839
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>