Commit graph

77 commits

Author SHA1 Message Date
Vincent Wiemann
073a838891 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>
2019-05-20 22:20:54 +02:00
Koen Vandeputte
04f5a7d3a4 iwinfo: Add Mikrotik R11e-5HnD
This device currently showed up as Generic Mac80211.

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
2019-05-20 14:08:49 +02:00
Robert Marko
c2cfe9d96c 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 a8e8275923

Signed-off-by: Robert Marko <robimarko@gmail.com>
2019-03-28 15:02:58 +01: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
Robert Marko
ce1814baec 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>
2019-03-11 23:02:32 +01:00
Daniel Golle
cb108c5468 iwinfo: fix capitalization of vendor name
They were called 'Ralink' rather than 'RaLink'.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-01 23:16:28 +01:00
Daniel Golle
e9e14008fa iwinfo: more Ralink and MediaTek WiSoC and PCIe chips
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-01 12:10:58 +01:00
Daniel Golle
b514490688 iwinfo: add device id for MediaTek MT7603E
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2019-03-01 10:23:10 +01:00
Mathias Kresin
dd508af481 iwinfo: fix QCA9984 vendor id
Fix the typo in the QCA9984 vendor id.

Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-12-25 09:23:48 +01:00
Mathias Kresin
0eaabf1e65 iwinfo: add device id for Atheros AR9287
Signed-off-by: Mathias Kresin <dev@kresin.me>
2018-12-25 09:23:41 +01:00
David Bauer
6e998ec591 iwinfo: add device id for MediaTek MT7612E
Signed-off-by: David Bauer <mail@david-bauer.net>
2018-12-25 08:31:26 +01:00
Daniel Danzberger
5aa8c5496c libiwinfo: nl80211: add mesh stats on assoclist.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2018-11-26 11:03:17 +01:00
Rosen Penev
77a9e98009 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>
2018-09-10 09:10:48 +02:00
Jo-Philipp Wich
65b8333f5b Revert "build: compile with -ffunction-sections, -fdata-sections and LTO"
This reverts commit a51413988c.

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>
2018-07-31 20:36:35 +02:00
Jo-Philipp Wich
3c30b17170 wl: only invoke nvram executable if it exists
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-31 20:09:02 +02:00
Jo-Philipp Wich
a51413988c build: compile with -ffunction-sections, -fdata-sections and LTO
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-26 09:13:21 +02:00
Jo-Philipp Wich
94b1366de3 nl80211: attempt to query Mesh ID from ubus
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-24 17:36:22 +02:00
Jo-Philipp Wich
d991fe5481 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>
2018-07-24 17:36:17 +02:00
Jo-Philipp Wich
44956b780d 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>
2018-07-23 18:00:31 +02:00
Jo-Philipp Wich
49c0a4b1a2 nl80211: handle Mesh ID IE
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-07-23 17:08:44 +02:00
Daniel Danzberger
305f6955d6 iwinfo: nl80211: add survey.
Signed-off-by: Daniel Danzberger <daniel@dd-wrt.com>
2018-07-16 09:03:12 +02:00
Daniel Danzberger
2c5c641aab 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>
2018-07-16 09:01:23 +02:00
Jo-Philipp Wich
e59f9253aa hardware: add device ids for QCA9984, 88W8887 and 88W8964 radios
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-26 21:50:08 +02:00
Jo-Philipp Wich
2a82f87ac9 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>
2018-04-26 17:12:16 +02:00
Rafał Miłecki
77c32f0eb6 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>
2018-04-09 07:30:37 +02: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
Olof Sivertsson
fb749bf51a 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>
2018-01-17 13:34:08 +01:00
Jo-Philipp Wich
75c572074f 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>
2018-01-17 13:27:03 +01:00
Jo-Philipp Wich
5a5e21b158 nl80211: skip event notifications in wpa_supplicant scan result reply
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-01-16 14:03:37 +01:00
Rafał Miłecki
c1a03e8231 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>
2017-08-23 11:00:00 +02:00
Rafał Miłecki
5638567dc7 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>
2017-08-16 17:15:19 +02:00
Rafał Miłecki
ce51cb8123 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>
2017-08-16 17:15:03 +02:00
Rafał Miłecki
5c10efa2cb 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>
2017-08-16 17:14:26 +02:00
Jo-Philipp Wich
335967c6c2 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>
2017-06-26 09:48:02 +02:00
Jo-Philipp Wich
ab089dda34 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>
2017-06-26 07:30:56 +02:00
Jo-Philipp Wich
7bba117a3a nl80211: handle netlink errors in nl80211_wait()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-06-26 07:06:40 +02:00
Sven Roederer
d22c64c2eb iwinfo: add device id for Ubiquiti NanoStation Loco M2
id read from unit and txoffset from datasheet

Signed-off-by: Sven Roederer <devel-sven@geroedel.de>
2016-10-15 19:56:24 +02:00
Jo-Philipp Wich
fd9e17be0c lua: fix WPA cipher reporting
Use the same logic as the command line interface for reporting the used WPA
ciphers. Instead of printing the intersection of pairwise and group ciphers,
report both group and pairwise ciphers.

This fixes a case where a connection which uses CCMP for pairwise and TKIP
as groupwise cipher is getting reported as using the NONE cipher.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-09-21 21:02:15 +02:00
Felix Fietkau
717ff71750 Makefile: drop link against libblobmsg_json and libjson-c
They are not necessary

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2016-07-29 16:28:32 +02:00
Florian Fainelli
8e68ab0bb4 Makefile: explictly link with all shared libraries
linking with libuci means we need to link with libblobmsg_json, libjson-c and
libubox. Sinc e we do not use pkg-config or something equivalent, we need to
specify all dependencies.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
2016-07-23 12:31:12 +02:00
Jo-Philipp Wich
96d322d594 nl80211: retry phy lookup with platform/ prefix
If the first attempt to lookup the phy index by the path value fails, retry to
find the index within the platform/ subdirectory to follow the logic used by
the mac80211 package.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-07-04 16:07:12 +02:00
Jo-Philipp Wich
e4aca3910d lua: support reporting VHT rates
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-25 16:01:32 +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
bc8682aa5e nl80211: add VHT rateinfo support
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-25 15:01:49 +01:00
Jo-Philipp Wich
e3bd6c3653 iwinfo: assign explicit length to IWINFO_*_NAMES[] to fix compile issues
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-25 15:00:22 +01:00
Jo-Philipp Wich
1b471aa33d Sync with upstream nl80211.h
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-25 14:41:31 +01:00
Jo-Philipp Wich
7781ba3f33 nl80211: remove dead code
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-29 13:46:12 +01:00
Jo-Philipp Wich
41ae5bd556 nl80211: fix possibly unterminated ifname string
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-29 10:53:56 +01:00
Jo-Philipp Wich
89296a5f17 utils: fix possibly unterminated ifname string
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-29 10:53:48 +01:00
Jo-Philipp Wich
1e628bb535 wext_scan: fix possibly unterminated ifname string
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-29 10:53:32 +01:00