summaryrefslogtreecommitdiff
path: root/iwinfo_utils.c
Commit message (Collapse)AuthorAgeFilesLines
* utils: skip comment lines when parsing devices.txtAndre Heider2023-01-201-0/+3
| | | | | | Just a small optimization, skip the line early if it starts with a #. Signed-off-by: Andre Heider <a.heider@gmail.com>
* devices: add support for declaring compatible matched devicesJo-Philipp Wich2023-01-101-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* utils: add iwinfo_band2ghz() and iwinfo_ghz2band() helpersAndre Heider2022-12-161-0/+34
| | | | | | To classify bands, to be used as ubus values. Signed-off-by: Andre Heider <a.heider@gmail.com>
* utils: add helper functions to get names by valuesAndre Heider2022-12-161-0/+38
| | | | | | | | | 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>
* utils: add iwinfo_htmode_is_{ht|vht|he} helpersAndre Heider2022-12-161-0/+42
| | | | | | Small and useful functions which allow to clear up some consumers. Signed-off-by: Andre Heider <a.heider@gmail.com>
* utils: add and use iwinfo_format_hwmodes()Andre Heider2022-12-161-0/+25
| | | | | | | | | | 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>
* Correctly identify key management algorithms starting with "FT-"Joerg Werner2022-11-011-1/+1
| | | | | | Correctly categorize FT-EAP-SHA384 as WPA3 Signed-off-by: Joerg Werner <schreibubi@gmail.com>
* Add support for CCMP-256 and GCMP-256 ciphersJoerg Werner2022-08-201-2/+8
| | | | Signed-off-by: Joerg Werner <schreibubi@gmail.com>
* iwinfo: add support for GCMP cipherDaniel Golle2021-01-051-3/+6
| | | | | | | 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>
* Revert "iwinfo: add BSS load element to scan result"David Bauer2020-03-221-8/+0
| | | | | | | | | | | | 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-0/+8
| | | | | | | | 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>
* utils: support parsing SAE and OWE key management suites from IEsJo-Philipp Wich2019-09-221-34/+88
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* iwinfo: more Ralink and MediaTek WiSoC and PCIe chipsDaniel Golle2019-03-011-4/+24
| | | | Signed-off-by: Daniel Golle <daniel@makrotopia.org>
* utils: add simple ubus query supportJo-Philipp Wich2018-07-241-0/+93
| | | | | | | 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>
* utils: fix possibly unterminated ifname stringJo-Philipp Wich2015-10-291-3/+3
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* utils: fix segfault in iwinfo_hardware_id_from_mtd()Jo-Philipp Wich2015-06-011-3/+3
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* Fix -Wall -Wpedantic warningsJo-Philipp Wich2015-05-191-4/+5
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* utils: only enable extended lookup if section looks like itJo-Philipp Wich2014-10-271-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* utils: support extended format for uci section lookupJo-Philipp Wich2014-10-271-5/+2
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* iwinfo: fix handling of accessing nl80211 interfaces via radio*nbd2014-10-271-0/+41
| | | | | | | | 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
* Initial commitJo-Philipp Wich2014-10-051-0/+367
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>