summaryrefslogtreecommitdiff
path: root/include
Commit message (Collapse)AuthorAgeFilesLines
* iwinfo: readd missing define for IWINFO_AUTH in headerChristian Marangi2023-01-231-0/+3
| | | | | | | | | 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: 7e3d7ded29d7 ("iwinfo: reorganize iwinfo header to enum and defines") Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* lib: add IWINFO_FREQ_FLAG_NAMESAndre Heider2023-01-201-0/+2
| | | | | | | The same as with the other defines/enums which allow consumers to iterate over all known ones. Signed-off-by: Andre Heider <a.heider@gmail.com>
* nl80211: add "mhz" and "band" to iwinfo_scanlist_entryAndre Heider2023-01-201-0/+2
| | | | | | | | | 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>
* nl80211: add "band" to iwinfo_freqlist_entryAndre Heider2023-01-201-0/+1
| | | | | | | | | 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>
* nl80211: add support for radiation and indoor chan restrictionChristian Marangi2023-01-201-0/+4
| | | | | | Add new 'flags' bits to declare these two channel restrictions. Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
* iwinfo: reorganize iwinfo header to enum and definesChristian Marangi2023-01-201-73/+162
| | | | | | | | | | | | | | | | | | | 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>
* devices: add support for declaring compatible matched devicesJo-Philipp Wich2023-01-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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/+3
| | | | | | 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/+3
| | | | | | | | | 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/+3
| | | | | | 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/+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>
* lib: add IWINFO_80211_COUNT and IWINFO_80211_NAMESAndre Heider2022-12-161-0/+2
| | | | | | | The same as with the other defines/enums which allow consumers to iterate over all known ones. Signed-off-by: Andre Heider <a.heider@gmail.com>
* lib: add IWINFO_BAND_COUNT and IWINFO_BAND_NAMESAndre Heider2022-12-161-0/+2
| | | | Signed-off-by: Andre Heider <a.heider@gmail.com>
* lib: add IWINFO_OPMODE_COUNT and use it for IWINFO_OPMODE_NAMESAndre Heider2022-12-151-1/+3
| | | | | | Match the other string arrays, which allows us to consistently loop over them. Signed-off-by: Andre Heider <a.heider@gmail.com>
* lib: constify and fixup the string array definitionsAndre Heider2022-12-151-6/+6
| | | | | | Match their declarations as per the header. Signed-off-by: Andre Heider <a.heider@gmail.com>
* nl80211: mark frequencies where HE operation in not allowedAndre Heider2022-12-151-1/+1
| | | | | | | 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>
* fix -Wduplicate-decl-specifier warningsAndre Heider2022-12-151-19/+9
| | | | | | | | | | include/iwinfo.h:209:19: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier] 209 | static const char const *ht_secondary_offset[4] = { | ^~~~~ Constify and move the offenders out of the header. Signed-off-by: Andre Heider <a.heider@gmail.com>
* Add support for CCMP-256 and GCMP-256 ciphersJoerg Werner2022-08-201-10/+12
| | | | Signed-off-by: Joerg Werner <schreibubi@gmail.com>
* iwinfo: nl80211: fix hwmode parsing for multi-band NICsDavid Bauer2022-04-231-0/+5
| | | | | | | | | | | | | | 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>
* iwinfo: rename hardware.txt to devices.txtJo-Philipp Wich2021-07-111-1/+1
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* iwinfo: nl80211: add support for printing the device path for a phyFelix Fietkau2021-06-091-0/+1
| | | | | | 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/+3
| | | | | | | | | 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: add basic IEEE 802.11ax supportDavid Bauer2021-04-121-1/+7
| | | | | | | | 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: improve center channel handlingAnsuel Smith2021-01-061-2/+2
| | | | | | | - Improve iwinfo center channel struct position - Prevent read beyond buffer on malformed data Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
* iwinfo: add support for GCMP cipherDaniel Golle2021-01-052-4/+5
| | | | | | | 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: export center_chan info for local wifiAnsuel Smith2021-01-051-0/+2
| | | | | | | | | 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-0/+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-222-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-042-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>
* nl80211: add htmode to iwinfo_opsDaniel Danzberger2020-01-051-1/+3
| | | | | | This callback shows the currently active HTMODE of the device. Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
* iwinfo: Add support for WPA3Robert Marko2019-09-011-1/+3
| | | | | | | 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-0/+2
| | | | | | | | | | | 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>
* libiwinfo: nl80211: add mesh stats on assoclist.Daniel Danzberger2018-11-261-0/+6
| | | | Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
* utils: add simple ubus query supportJo-Philipp Wich2018-07-241-0/+4
| | | | | | | 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>
* iwinfo: nl80211: add survey.Daniel Danzberger2018-07-161-0/+11
| | | | Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
* iwinfo: nl80211: add more stats to assoclist.Daniel Danzberger2018-07-161-0/+3
| | | | | | | | + NL80211_STA_INFO_SIGNAL_AVG + NL80211_STA_INFO_RX_DROP_MISC + NL80211_STA_INFO_CONNECTED_TIME Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
* add support for expected throughputDaniel Golle2018-02-151-0/+1
| | | | | | | | | | 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>
* Allow storing more info about each frequencyRafał Miłecki2017-08-161-0/+8
| | | | | | | | 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>
* nl80211: add VHT rateinfo supportJo-Philipp Wich2016-01-251-0/+4
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* iwinfo: assign explicit length to IWINFO_*_NAMES[] to fix compile issuesJo-Philipp Wich2016-01-251-3/+6
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* nl80211: read TX power using NL80211_CMD_GET_INTERFACERafał Miłecki2015-10-051-0/+4
| | | | | | | | | 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>
* iwinfo: report additional data for stationsJernej Kos2015-08-111-0/+11
| | | | Signed-off-by: Jernej Kos <jernej@kos.mx>
* Fix -Wall -Wpedantic warningsJo-Philipp Wich2015-05-191-3/+3
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* iwinfo: add support for querying available HT modesJo-Philipp Wich2015-05-081-0/+16
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* iwinfo: move ARRAY_SIZE macro to iwinfo/utils.hJo-Philipp Wich2015-05-081-0/+4
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* include: add lookup_phy() opJo-Philipp Wich2014-10-271-0/+1
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* lib: add iwinfo_backend_by_name()Jo-Philipp Wich2014-10-271-0/+1
| | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
* iwinfo: fix handling of accessing nl80211 interfaces via radio*nbd2014-10-271-0/+6
| | | | | | | | 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-053-0/+320
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>