project/iwinfo.git
2 years agodevices: add MediaTek MT7986 WiSoC
Daniel Golle [Mon, 25 Jul 2022 02:17:44 +0000 (04:17 +0200)]
devices: add MediaTek MT7986 WiSoC

Add detection of the MediaTek MT7986 WiSoC using the compatible string
from device tree.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2 years agoAdd support for CCMP-256 and GCMP-256 ciphers
Joerg Werner [Fri, 19 Aug 2022 09:06:22 +0000 (11:06 +0200)]
Add support for CCMP-256 and GCMP-256 ciphers

Signed-off-by: Joerg Werner <schreibubi@gmail.com>
2 years agoiwinfo: Add missing auth_suites mappings for WPA3
Tjeu Kayim [Thu, 28 Jul 2022 08:47:09 +0000 (10:47 +0200)]
iwinfo: Add missing auth_suites mappings for WPA3

`iwinfo.h` says:
    #define IWINFO_KMGMT_COUNT   5
    ...
    extern const char *IWINFO_KMGMT_NAMES[IWINFO_KMGMT_COUNT];

Though only only 3 items are defined. The other two were forgotten
when adding WPA3 support. The `auth_suites` table exposed via Lua
never included the items "SAE" and "OWE" until this commit.

Fixes: f8ef45065207 ("iwinfo: Add support for WPA3")
Signed-off-by: Tjeu Kayim <15987676+TjeuKayim@users.noreply.github.com>
2 years agoiwinfo: nl80211: omit A-hwmode on non-5GHz hardware
David Bauer [Mon, 25 Apr 2022 23:53:51 +0000 (01:53 +0200)]
iwinfo: nl80211: omit A-hwmode on non-5GHz hardware

Don't add the hwmode A for radios which do not support 5GHz operation.
Before, this hwmode was added to all non-VHT radios regardless of their
supported bands.

Fixes commit 562d01532616 ("iwinfo: nl80211: fix hwmode parsing for multi-band NICs")

Signed-off-by: David Bauer <mail@david-bauer.net>
2 years agodevices: remove whitespace
David Bauer [Sun, 24 Apr 2022 21:04:57 +0000 (23:04 +0200)]
devices: remove whitespace

Signed-off-by: David Bauer <mail@david-bauer.net>
2 years agoiwinfo: nl80211: fix hwmode parsing for multi-band NICs
David Bauer [Fri, 22 Apr 2022 21:56:35 +0000 (23:56 +0200)]
iwinfo: nl80211: fix hwmode parsing for multi-band NICs

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>
2 years agodevices: Add Cypress CYW43455
Hauke Mehrtens [Sun, 16 Jan 2022 19:47:30 +0000 (20:47 +0100)]
devices: Add Cypress CYW43455

This adds the Cypress CYW43455. This device was found on the Raspberry Pi 4.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2 years agodevices: fix AMD RZ608 format
David Bauer [Thu, 6 Jan 2022 01:13:37 +0000 (02:13 +0100)]
devices: fix AMD RZ608 format

Signed-off-by: David Bauer <mail@david-bauer.net>
2 years agodevices: add AMD RZ608 device-id
David Bauer [Sun, 2 Jan 2022 01:32:58 +0000 (02:32 +0100)]
devices: add AMD RZ608 device-id

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoiwinfo: rename hardware.txt to devices.txt
Jo-Philipp Wich [Sun, 11 Jul 2021 13:56:35 +0000 (15:56 +0200)]
iwinfo: rename hardware.txt to devices.txt

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agonl80211: fix path compatibility issue
Felix Fietkau [Mon, 28 Jun 2021 13:30:28 +0000 (15:30 +0200)]
nl80211: fix path compatibility issue

The previous shell script implementation accepted shorter path values
that omitted initial parts before the pcie bus node by only checking if
the configured path is included in the determined path
Add support for doing the same thing here

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agoiwinfo: nl80211: fix typo
Felix Fietkau [Wed, 9 Jun 2021 20:12:08 +0000 (22:12 +0200)]
iwinfo: nl80211: fix typo

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agoiwinfo: nl80211: support looking up phy by path=.. and macaddr=...
Felix Fietkau [Wed, 9 Jun 2021 12:21:51 +0000 (14:21 +0200)]
iwinfo: nl80211: support looking up phy by path=.. and macaddr=...

Can be used from within mac80211.sh without the need to reference the uci
config directly

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agoiwinfo: nl80211: use new path lookup function for nl80211_phy_idx_from_uci_path
Felix Fietkau [Wed, 9 Jun 2021 12:03:29 +0000 (14:03 +0200)]
iwinfo: nl80211: use new path lookup function for nl80211_phy_idx_from_uci_path

Fixes issues with multiple phy instances of one device

Signed-off-by: Felix Fietkau <nbd@nbd.name>
3 years agoiwinfo: nl80211: add support for printing the device path for a phy
Felix Fietkau [Wed, 9 Jun 2021 11:57:23 +0000 (13:57 +0200)]
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>
3 years agoiwinfo: add 802.11ax HE rate information
David Bauer [Sat, 17 Apr 2021 21:05:16 +0000 (23:05 +0200)]
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>
3 years agoiwinfo: cli: fix hwmode formatting
David Bauer [Tue, 20 Apr 2021 00:22:38 +0000 (02:22 +0200)]
iwinfo: cli: fix hwmode formatting

The placeholder for the 802.11ax hwmode was missing.

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoiwinfo: nl80211: perform split wiphy dump
David Bauer [Sun, 18 Apr 2021 23:38:15 +0000 (01:38 +0200)]
iwinfo: nl80211: perform split wiphy dump

Perform a split wiphy dump when acquiring the hw modelist of a mac80211
device. Otherwise HE capabilities are missing from the message.

This is necessary since upstream commit f8d504caa ("nl80211: reduce
non-split wiphy dump size")  (Kernel 5.9).

Signed-off-by: David Bauer <mail@david-bauer.net>
3 years agoiwinfo: add basic IEEE 802.11ax support
David Bauer [Thu, 17 Dec 2020 19:39:56 +0000 (20:39 +0100)]
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>
3 years agoiwinfo: add PCI ID for MediaTek MT7613BE
Stijn Segers [Sat, 30 Jan 2021 20:32:05 +0000 (21:32 +0100)]
iwinfo: add PCI ID for MediaTek MT7613BE

This adds the PCI ID for the MT7613BE series, found in e.g.
the TP-Link EAP235-Wall v1.

Signed-off-by: Stijn Segers <foss@volatilesystems.org>
3 years agoiwinfo: add hardware description for MediaTek MT7622
Daniel Golle [Thu, 28 Jan 2021 22:34:42 +0000 (22:34 +0000)]
iwinfo: add hardware description for MediaTek MT7622

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agobuild: add ability to specify shared object version
Jo-Philipp Wich [Wed, 6 Jan 2021 22:12:46 +0000 (23:12 +0100)]
build: add ability to specify shared object version

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
3 years agoiwinfo: set center chan unsupported for not-nl80211 driver
Ansuel Smith [Wed, 6 Jan 2021 04:54:57 +0000 (05:54 +0100)]
iwinfo: set center chan unsupported for not-nl80211 driver

Declare get_center_chan1 and get_center_chan2 not supported for not
nl80211 driver.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
3 years agoiwinfo: improve center channel handling
Ansuel Smith [Wed, 6 Jan 2021 03:05:37 +0000 (04:05 +0100)]
iwinfo: improve center channel handling

- Improve iwinfo center channel struct position
- Prevent read beyond buffer on malformed data

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
3 years agoiwinfo: add hardware description for QCA MIPS WiSoCs
Daniel Golle [Wed, 6 Jan 2021 16:37:58 +0000 (16:37 +0000)]
iwinfo: add hardware description for QCA MIPS WiSoCs

Add description strings and detection logic for all 6
types of WiFi NICs integrated in QCA MIPS WiSoCs.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agoiwinfo: add support for GCMP cipher
Daniel Golle [Tue, 5 Jan 2021 14:21:14 +0000 (14:21 +0000)]
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>
3 years agocli: account for additional digit for frequencies above 10GHz
Daniel Golle [Tue, 5 Jan 2021 15:09:40 +0000 (15:09 +0000)]
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>
3 years agoiwinfo: export center_chan info for local wifi
Ansuel Smith [Sun, 6 Dec 2020 01:11:16 +0000 (02:11 +0100)]
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>
3 years agoiwinfo: export ht and vht operation in scan results
Ansuel Smith [Sun, 6 Dec 2020 01:11:15 +0000 (02:11 +0100)]
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>
3 years agoiwinfo: detect QCA IPQ4019 WiSoC from FDT
Daniel Golle [Tue, 5 Jan 2021 22:08:46 +0000 (22:08 +0000)]
iwinfo: detect QCA IPQ4019 WiSoC from FDT

As it's the most reliable and straight forward way on modern platforms,
detect the hardware ID by checking the 'compatible'-string of non-PCI
(ie. built-in) devices.
As this is only relevant for WiSoCs, there won't be that many records,
so it's not worth making any larger structural changes. Hence just
match the compatible string and translate it into fake PCI IDs.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
3 years agohardware: add PCI ID for MediaTek MT7915
David Bauer [Sun, 13 Dec 2020 19:46:03 +0000 (20:46 +0100)]
hardware: add PCI ID for MediaTek MT7915

This adds the PCI-ID for the MT7915 series.

This PCI-ID was found on the Ubiquiti UniFi6 Lite Access Point.

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoiwinfo: add device id for Mikrotik R11e-5HacD miniPCIe card
Johann Neuhauser [Mon, 6 Apr 2020 21:58:43 +0000 (23:58 +0200)]
iwinfo: add device id for Mikrotik R11e-5HacD miniPCIe card

Lets add device id for Mikrotik R11e-5HacD miniPCIe card.

Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
[added missing commit description]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoiwinfo: add device id for Marvell 88W8997 SDIO wifi card
Pali Rohár [Wed, 20 May 2020 12:33:05 +0000 (14:33 +0200)]
iwinfo: add device id for Marvell 88W8997 SDIO wifi card

Lets add device id for Marvell 88W8997 SDIO wifi card.

Signed-off-by: Pali Rohár <pali@kernel.org>
[added missing commit description]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
4 years agoiwinfo: add device id for Atheros AR9287 PCIe wifi card
Pali Rohár [Wed, 20 May 2020 12:31:46 +0000 (14:31 +0200)]
iwinfo: add device id for Atheros AR9287 PCIe wifi card

This card is identified by lspci as:

  01:00.0 Network controller [0280]: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) [168c:002e] (rev 01)
          Subsystem: Qualcomm Atheros Device [168c:30a4]

Signed-off-by: Pali Rohár <pali@kernel.org>
4 years agoiwinfo: add missing HT modename for HT-None
David Bauer [Sun, 22 Mar 2020 00:01:26 +0000 (01:01 +0100)]
iwinfo: add missing HT modename for HT-None

Commit bf2c1069a7f1 ("nl80211: add htmode to iwinfo_ops") increased
IWINFO_HTMODE_COUNT but left the size of the IWINFO_HTMODE_NAMES array
untouched, leading to a segmentation fault when trying to get the HT
modelist from Lua.

Add a dummy NOHT modestring to make the array size fit the size
declaration.

Fixes: bf2c1069a7f1 ("nl80211: add htmode to iwinfo_ops")
Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoRevert "iwinfo: add BSS load element to scan result"
David Bauer [Sun, 22 Mar 2020 00:05:03 +0000 (01:05 +0100)]
Revert "iwinfo: add BSS load element to scan result"

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>
4 years agoiwinfo: add device id for Qualcomm Atheros QCA9990
Robert Marko [Thu, 30 Jan 2020 21:47:29 +0000 (22:47 +0100)]
iwinfo: add device id for Qualcomm Atheros QCA9990

Lets add the PCI ID for QCA9990

Signed-off-by: Robert Marko <robert.marko@sartura.hr>
4 years agoiwinfo: add device id for BCM43602
David Bauer [Tue, 4 Feb 2020 13:49:04 +0000 (14:49 +0100)]
iwinfo: add device id for BCM43602

Signed-off-by: David Bauer <mail@david-bauer.net>
4 years agoiwinfo: add BSS load element to scan result
David Bauer [Fri, 31 Jan 2020 13:45:03 +0000 (14:45 +0100)]
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>
4 years agoiwinfo: add device id for Atheros AR9287
Pawel Dembicki [Tue, 28 Jan 2020 21:16:44 +0000 (22:16 +0100)]
iwinfo: add device id for Atheros AR9287

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years agoiwinfo: add device id for MediaTek MT7615E
Pawel Dembicki [Tue, 28 Jan 2020 21:16:43 +0000 (22:16 +0100)]
iwinfo: add device id for MediaTek MT7615E

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
4 years agonl80211: add htmode to iwinfo_ops
Daniel Danzberger [Thu, 19 Dec 2019 14:41:24 +0000 (15:41 +0100)]
nl80211: add htmode to iwinfo_ops

This callback shows the currently active HTMODE of the device.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
4 years agonl80211: properly handle netdev names starting with "radio"
Jo-Philipp Wich [Tue, 26 Nov 2019 07:39:23 +0000 (08:39 +0100)]
nl80211: properly handle netdev names starting with "radio"

This fixes VAPs not being queried correctly when the netdev name starts
with "radio".

Fixes: FS#2629
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoiwinfo: add several QC/A device ids
Tomislav Požega [Fri, 1 Nov 2019 14:18:35 +0000 (15:18 +0100)]
iwinfo: add several QC/A device ids

Add device ids for AR9462, QCA9862, QCA9880 v1 mPCIe cards and
Ubiquiti branded QCA9880 v2 PCI wifi found in LiteBeam 5ac.

Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com>
5 years agonl80211: handle hidden SSIDs in wpa_supplicant scan results
Jo-Philipp Wich [Wed, 16 Oct 2019 14:40:41 +0000 (16:40 +0200)]
nl80211: handle hidden SSIDs in wpa_supplicant scan results

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agolua: fix string description of mixed WPA3 modes
Jo-Philipp Wich [Wed, 16 Oct 2019 14:01:55 +0000 (16:01 +0200)]
lua: fix string description of mixed WPA3 modes

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agonl80211: align path to phy mapping logic with mac80211.sh
Jo-Philipp Wich [Tue, 15 Oct 2019 12:21:38 +0000 (14:21 +0200)]
nl80211: align path to phy mapping logic with mac80211.sh

The mac80211.sh implementation of the uci "path" option compares the
readlink() results of each /sys/class/ieee80211/*/device link to find
the proper phy directory while iwinfo so far tried to construct a full
path out of the uci value.

The iwinfo approach appears to fail under certain circumstances, e.g.
with Hyper-V systems utilizing PCI passthrough for the radio devices.

This commit mimicks the behaviour of mac80211.sh more closely to
achieve the same results.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agonl80211: recognize SAE encrypted mesh
Jo-Philipp Wich [Mon, 30 Sep 2019 10:09:26 +0000 (12:09 +0200)]
nl80211: recognize SAE encrypted mesh

Also report open Ad-Hoc and Mesh network encryption as "none" and
not as "unknown".

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agonl80211: keep awaiting wpa_supplicant scan results on busy response
Jo-Philipp Wich [Sun, 22 Sep 2019 16:28:40 +0000 (18:28 +0200)]
nl80211: keep awaiting wpa_supplicant scan results on busy response

When wpa_supplicant responds with FAIL-BUSY in response to the SCAN
command, a scan process is already in process. Instead of failing in
this case, simply keep awaiting the result list.

This also significantly speeds up the scan operation in many cases.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agonl80211: fix parsing of mixed wpa encryption in wpa_supp scan results
Jo-Philipp Wich [Sun, 22 Sep 2019 15:58:03 +0000 (17:58 +0200)]
nl80211: fix parsing of mixed wpa encryption in wpa_supp scan results

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoutils: support parsing SAE and OWE key management suites from IEs
Jo-Philipp Wich [Sun, 22 Sep 2019 15:35:33 +0000 (17:35 +0200)]
utils: support parsing SAE and OWE key management suites from IEs

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agocli: fix reporting of mixed WPA2/WPA3 versions
Jo-Philipp Wich [Fri, 20 Sep 2019 06:55:37 +0000 (08:55 +0200)]
cli: fix reporting of mixed WPA2/WPA3 versions

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agonl80211: properly detect WEP encryption in wpa_supp scan results
Jo-Philipp Wich [Fri, 20 Sep 2019 07:07:23 +0000 (09:07 +0200)]
nl80211: properly detect WEP encryption in wpa_supp scan results

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agonl80211: do not confuse open connections with WEP ones
Jo-Philipp Wich [Fri, 20 Sep 2019 10:57:16 +0000 (12:57 +0200)]
nl80211: do not confuse open connections with WEP ones

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agonl80211: rework hostapd and wpa_supplicant wpa suite parsing
Jo-Philipp Wich [Fri, 20 Sep 2019 04:57:58 +0000 (06:57 +0200)]
nl80211: rework hostapd and wpa_supplicant wpa suite parsing

Refactor the parsing of wpa_supplicant scan list results, the wpa_supplicant
status output and the hostapd configuration file format to properly detect
WPA3 key management protocols like SAE, OWE or EAP Suite B.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoiwinfo: add device id for Qualcomm Atheros QCA9886
David Bauer [Fri, 6 Sep 2019 00:05:51 +0000 (02:05 +0200)]
iwinfo: add device id for Qualcomm Atheros QCA9886

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoiwinfo: add device id for Qualcomm Atheros QCA9887
David Bauer [Thu, 5 Sep 2019 23:58:33 +0000 (01:58 +0200)]
iwinfo: add device id for Qualcomm Atheros QCA9887

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agoiwinfo: Fix rate buffer size
Hauke Mehrtens [Sun, 1 Sep 2019 17:43:40 +0000 (19:43 +0200)]
iwinfo: Fix rate buffer size

This string could be truncated for higher rates.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years agoiwinfo: Fix buffer size
Hauke Mehrtens [Sun, 1 Sep 2019 17:26:01 +0000 (19:26 +0200)]
iwinfo: Fix buffer size

With WPA3 the wpa_key_mgmt string can be longer than 16 bytes. The
sea-mixed setting for example is 27 bytes long:
wpa_key_mgmt=WPA-PSK WPA-PSK-SHA256 SAE

Increase the buffer to better detect more complicated authentication methods.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
5 years agoiwinfo: Add support for WPA3
Robert Marko [Tue, 20 Aug 2019 12:18:16 +0000 (14:18 +0200)]
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>
5 years agonl80211: support reading hardware id from phy directly
Jo-Philipp Wich [Wed, 28 Aug 2019 09:11:28 +0000 (11:11 +0200)]
nl80211: support reading hardware id from phy directly

Do not require a temporary interface just to read the hardware ID numbers
from a given phy name, instead read the data from the ieee80211 sysfs
directory.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
5 years agoiwinfo: add device id for MediaTek MT7612E
Pawel Dembicki [Thu, 13 Jun 2019 14:20:37 +0000 (16:20 +0200)]
iwinfo: add device id for MediaTek MT7612E

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
5 years agoiwinfo: add device id for Atheros AR9390
Pawel Dembicki [Thu, 13 Jun 2019 14:20:36 +0000 (16:20 +0200)]
iwinfo: add device id for Atheros AR9390

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
5 years agoiwinfo: Add Mikrotik R11e-5HnDr2
Koen Vandeputte [Wed, 12 Jun 2019 12:21:23 +0000 (14:21 +0200)]
iwinfo: Add Mikrotik R11e-5HnDr2

This device currently showed up as Generic Mac80211.

While at it, spell the vendor name correctly (large 'T')

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agoiwinfo: Complete device IDs for Ubiquiti airOS XM/XW devices
Vincent Wiemann [Sat, 16 Mar 2019 21:32:35 +0000 (22:32 +0100)]
iwinfo: Complete device IDs for Ubiquiti airOS XM/XW devices

This commit includes all power offsets and subsystem device IDs
for Ubiquiti XM and XW devices. The device ID is wildcarded.
Consistency has been tested among all Ubiquiti platforms.
These values seem to be PA gains and likely do not include
antenna gains. I expect the antenna gains to be defined in ART-
partitions.

Signed-off-by: Vincent Wiemann <vincent.wiemann@ironai.com>
5 years agoiwinfo: Add Mikrotik R11e-5HnD
Koen Vandeputte [Mon, 20 May 2019 12:06:19 +0000 (14:06 +0200)]
iwinfo: Add Mikrotik R11e-5HnD

This device currently showed up as Generic Mac80211.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
5 years agoiwinfo: Fix 802.11ad channel to frequency
Robert Marko [Thu, 28 Mar 2019 13:55:55 +0000 (14:55 +0100)]
iwinfo: Fix 802.11ad channel to frequency

This patch enables proper identification of ad hwmode in channel2frequency function.
Now iwinfo will properly calculate frequency for a channels 1-6 in 802.11ad.

Fixes a8e827592338d7f10d93b4b93d04f367221465c2

Signed-off-by: Robert Marko <robimarko@gmail.com>
5 years agoiwinfo: Add support for 802.11ad
Robert Marko [Wed, 13 Mar 2019 18:19:19 +0000 (19:19 +0100)]
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>
5 years agoiwinfo: Add device ID for Wilocity Wil6210
Robert Marko [Mon, 11 Mar 2019 09:26:28 +0000 (10:26 +0100)]
iwinfo: Add device ID for Wilocity Wil6210

This patch adds device ID for Wilocity Wil6210 802.11ad
60 GHz PCI wireless card.

Signed-off-by: Robert Marko <robimarko@gmail.com>
5 years agoiwinfo: fix capitalization of vendor name
Daniel Golle [Fri, 1 Mar 2019 22:16:28 +0000 (23:16 +0100)]
iwinfo: fix capitalization of vendor name

They were called 'Ralink' rather than 'RaLink'.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years agoiwinfo: more Ralink and MediaTek WiSoC and PCIe chips
Daniel Golle [Fri, 1 Mar 2019 11:10:58 +0000 (12:10 +0100)]
iwinfo: more Ralink and MediaTek WiSoC and PCIe chips

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years agoiwinfo: add device id for MediaTek MT7603E
Daniel Golle [Thu, 22 Nov 2018 15:10:52 +0000 (16:10 +0100)]
iwinfo: add device id for MediaTek MT7603E

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
5 years agoiwinfo: fix QCA9984 vendor id
Mathias Kresin [Tue, 25 Dec 2018 07:37:40 +0000 (08:37 +0100)]
iwinfo: fix QCA9984 vendor id

Fix the typo in the QCA9984 vendor id.

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years agoiwinfo: add device id for Atheros AR9287
Mathias Kresin [Tue, 25 Dec 2018 07:36:24 +0000 (08:36 +0100)]
iwinfo: add device id for Atheros AR9287

Signed-off-by: Mathias Kresin <dev@kresin.me>
5 years agoiwinfo: add device id for MediaTek MT7612E
David Bauer [Tue, 25 Dec 2018 03:32:23 +0000 (04:32 +0100)]
iwinfo: add device id for MediaTek MT7612E

Signed-off-by: David Bauer <mail@david-bauer.net>
5 years agolibiwinfo: nl80211: add mesh stats on assoclist.
Daniel Danzberger [Wed, 31 Oct 2018 08:49:42 +0000 (09:49 +0100)]
libiwinfo: nl80211: add mesh stats on assoclist.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
6 years agoiwinfo: Add Mikrotik R11e-2HPnD and R11e-5HacT to hardware list
Rosen Penev [Fri, 7 Sep 2018 23:52:44 +0000 (16:52 -0700)]
iwinfo: Add Mikrotik R11e-2HPnD and R11e-5HacT to hardware list

These are both miniPCIe cards that show up as Generic MAC80211. This fixes
that.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
6 years agoRevert "build: compile with -ffunction-sections, -fdata-sections and LTO"
Jo-Philipp Wich [Tue, 31 Jul 2018 18:36:27 +0000 (20:36 +0200)]
Revert "build: compile with -ffunction-sections, -fdata-sections and LTO"

This reverts commit a51413988caaff7001f47c8a62bff11a72ca48bc.

It causes assertion failures in ld and requires changes to linked libraries,
so drop this for now.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agowl: only invoke nvram executable if it exists
Jo-Philipp Wich [Tue, 31 Jul 2018 18:09:02 +0000 (20:09 +0200)]
wl: only invoke nvram executable if it exists

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agobuild: compile with -ffunction-sections, -fdata-sections and LTO
Jo-Philipp Wich [Thu, 26 Jul 2018 07:13:21 +0000 (09:13 +0200)]
build: compile with -ffunction-sections, -fdata-sections and LTO

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agonl80211: attempt to query Mesh ID from ubus
Jo-Philipp Wich [Tue, 24 Jul 2018 14:41:47 +0000 (16:41 +0200)]
nl80211: attempt to query Mesh ID from ubus

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoutils: add simple ubus query support
Jo-Philipp Wich [Tue, 24 Jul 2018 14:31:24 +0000 (16:31 +0200)]
utils: add simple ubus query support

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>
6 years agonl80211: add support for obtaining bssid from NL80211_CMD_GET_INTERFACE
Jo-Philipp Wich [Mon, 23 Jul 2018 15:33:09 +0000 (17:33 +0200)]
nl80211: add support for obtaining bssid from NL80211_CMD_GET_INTERFACE

Fixes missing "BSSID" on Mesh Point interfaces

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agonl80211: handle Mesh ID IE
Jo-Philipp Wich [Mon, 23 Jul 2018 14:37:28 +0000 (16:37 +0200)]
nl80211: handle Mesh ID IE

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agoiwinfo: nl80211: add survey.
Daniel Danzberger [Tue, 3 Jul 2018 13:32:11 +0000 (15:32 +0200)]
iwinfo: nl80211: add survey.

Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
6 years agoiwinfo: nl80211: add more stats to assoclist.
Daniel Danzberger [Tue, 3 Jul 2018 13:32:10 +0000 (15:32 +0200)]
iwinfo: nl80211: add more stats to assoclist.

+ 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>
6 years agohardware: add device ids for QCA9984, 88W8887 and 88W8964 radios
Jo-Philipp Wich [Thu, 26 Apr 2018 19:50:00 +0000 (21:50 +0200)]
hardware: add device ids for QCA9984, 88W8887 and 88W8964 radios

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agonl80211: back out early when receiving FAIL-BUSY reply
Jo-Philipp Wich [Thu, 26 Apr 2018 15:12:16 +0000 (17:12 +0200)]
nl80211: back out early when receiving FAIL-BUSY reply

The wpa_supplicant control socket might reply with "FAIL-BUSY" when
attempting to start a scan while another scanning process is already
running, back out early in this case.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agonl80211: fix code calculating average signal and rate
Rafał Miłecki [Wed, 28 Mar 2018 08:30:07 +0000 (10:30 +0200)]
nl80211: fix code calculating average signal and rate

Using average of previous average and the next value is highly
imprecise. E.g. for values 20, 20, 20, 180 it would result in /average/
of 100 (instead of 60). Fix it by storing & using an info of how many
samples were used for the previous calculation.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
6 years agoadd support for expected throughput
Daniel Golle [Wed, 14 Feb 2018 20:37:44 +0000 (21:37 +0100)]
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>
6 years agonl80211: do not block when driver aborts scan
Olof Sivertsson [Wed, 17 Jan 2018 12:32:09 +0000 (13:32 +0100)]
nl80211: do not block when driver aborts scan

Drivers may abort a scan by calling cfg80211_scan_done() with a struct
cfg80211_scan_info that sets aborted to true.

To avoid blocking forever consider both NL80211_CMD_NEW_SCAN_RESULTS
and NL80211_CMD_SCAN_ABORTED when waiting for scan results.

Tested with Broadcom's bcmdhd driver.

Signed-off-by: Olof Sivertsson <olof.sivertsson@zenterio.com>
[rebased on top of variadic nl80211_wait()]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agonl80211: turn nl80211_wait() into variadic function
Jo-Philipp Wich [Wed, 17 Jan 2018 12:27:03 +0000 (13:27 +0100)]
nl80211: turn nl80211_wait() into variadic function

Extend the nl82011_wait() function to accept multiple command numbers.

This is useful to wait for different possible results, e.g. either
NL80211_CMD_NEW_SCAN_RESULTS or NL80211_CMD_SCAN_ABORTED.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
6 years agonl80211: skip event notifications in wpa_supplicant scan result reply
Jo-Philipp Wich [Tue, 16 Jan 2018 12:44:21 +0000 (13:44 +0100)]
nl80211: skip event notifications in wpa_supplicant scan result reply

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agonl80211: request split information about frequencies
Rafał Miłecki [Wed, 23 Aug 2017 09:00:00 +0000 (11:00 +0200)]
nl80211: request split information about frequencies

This allows kernel send more details including all the
NL80211_FREQUENCY_ATTR_NO_* flags.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
7 years agonl80211: store info about freq being not available for some bandwidths
Rafał Miłecki [Tue, 15 Aug 2017 08:36:19 +0000 (10:36 +0200)]
nl80211: store info about freq being not available for some bandwidths

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Jo-Philipp Wich <jo@mein.io>
7 years agoAllow storing more info about each frequency
Rafał Miłecki [Tue, 15 Aug 2017 08:36:18 +0000 (10:36 +0200)]
Allow storing more info about each frequency

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>
7 years agonl80211: support receiving split frequencies
Rafał Miłecki [Tue, 15 Aug 2017 08:36:17 +0000 (10:36 +0200)]
nl80211: support receiving split frequencies

In order to get more details about each frequency we will need to set
NL80211_ATTR_SPLIT_WIPHY_DUMP in the future. This will result in our
callback being called multiple times. Modify it to support such a
scenario:
1) Start putting new frequencies after the last set one
2) Make sure that attribute is set before iterating it

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Jo-Philipp Wich <jo@mein.io>
7 years agonl80211: improve error handling
Jo-Philipp Wich [Mon, 26 Jun 2017 07:20:24 +0000 (09:20 +0200)]
nl80211: improve error handling

 - introduce a new nl80211_request() which combines nl80211_msg() with
   nl80211_send() to simplify calling code

 - always invoke nl80211_free() in nl80211_send() and remove explicit
   nl80211_free() invocations in callers

 - back out early on netlink errors in functions performing multiple
   calls, e.g. when fetching scan results

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agonl80211: propagate netlink errors to callers
Jo-Philipp Wich [Mon, 26 Jun 2017 05:22:10 +0000 (07:22 +0200)]
nl80211: propagate netlink errors to callers

Adjust nl80211_send() to propagate errors back to the caller and do not
free message and callbacks in send error case anymore since all callsites
immediately invoke nl80211_free() anyway.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
7 years agonl80211: handle netlink errors in nl80211_wait()
Jo-Philipp Wich [Mon, 26 Jun 2017 05:06:40 +0000 (07:06 +0200)]
nl80211: handle netlink errors in nl80211_wait()

Signed-off-by: Jo-Philipp Wich <jo@mein.io>