Commit graph

217 commits

Author SHA1 Message Date
Raito Bezarius
14685a2680 lua: fix meta table for the module
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-07 20:01:28 +02:00
bbb4f9ff69 Merge pull request 'lua: Lua 5.3 support' (#1) from lua_5_3 into master
Reviewed-on: #1
2024-09-07 19:38:40 +02:00
Raito Bezarius
2d0826435d lua: Lua 5.3 support
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-07 19:38:20 +02:00
Raito Bezarius
aaa40cc77a chore: cleanup UCI dependency
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
2024-09-07 18:39:59 +02:00
Tan Zien
215820132b devices: add device id for Atheros AR9590
Add device ids for Atheros AR9590
(adapter found on Extreme Networks AP3825i)

Signed-off-by: Tan Zien <nabsdh9@gmail.com>
2024-07-06 14:18:18 +02:00
Shiji Yang
79a9615064 devices: add device id for Realtek RTL8188CU and RTL8188FTV
Add device ids for Realtek RTL8188CU and RTL8188FTV 802.11n 1x1 USB
Wi-Fi adapter.

Signed-off-by: Shiji Yang <yanshiji66@qq.com>
2024-03-23 19:28:59 +01:00
Shiji Yang
3aa2b6b2c6 devices: add device id for MediaTek MT7601U
Add device id for MediaTek MT7601U 802.11n 1x1 USB Wi-Fi adapter.

Signed-off-by: Shiji Yang <yanshiji66@qq.com>
2024-03-23 19:28:44 +01:00
Vladdrako
8ffb8bfd11
devices: add add Qualcomm Atheros IPQ6018 WiSoC compatible
This adds detection for the Qualcomm Atheros IPQ6018 WiSoC.

Signed-off-by: Vladyslav Andreichykov <vladdrako007@gmail.com>
2024-03-08 14:22:38 +01:00
Martin Schiller
163a640fef devices: add device id for Qualcomm Atheros QCA6174
This adds the device id for the Qualcomm Atheros QCA6174 found on a
jjPlus JWW6051 M.2 adapter.

Signed-off-by: Martin Schiller <ms@dev.tdt.de>
2024-02-07 09:38:57 +01:00
Marty Jones
a34977c076
devices: add device id for Cypress CYW43455
Add Cypress CYW43455 id variant found on the Raspberry Pi 5.

Signed-off-by: Marty Jones <mj8263788@gmail.com>
2023-11-19 14:39:36 -05:00
Dennis Schmalacker
3eb34df3ee
devices: add device id for MediaTek MT7916AN
MediaTek MT7916AN (Filogic 630) is a DBDC 2*2 G-Band and 3*3 B-Band
chip found on the AsiaRF AW7916-NPD mini PCIe Module.

Add the additional ID.

Signed-off-by: Dennis Schmalacker <dennis-on-github@dclabs.de>
[ improve commit description, wrap to 75 char ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-11-16 12:48:38 +01:00
Thomas Weißschuh
ca79f64154 lib: report byte counters as 64 bit values
The 32bit counter can only count to 4GiB before wrapping.
Switching to the 64bit variant avoids this issue.

In practice some users are interpreting the counter values as signed
integer bringing down the usable range for 32bit values down to only
2GiB.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-06-25 21:58:09 +02:00
Thomas Weißschuh
65ea345a5b nl80211: constify a few arrays
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
2023-06-25 21:57:51 +02:00
Shiji Yang
d1f07cfdf3
devices: add device id for Atheros AR9287 and AR9380
Atheros AR9287 is a 2*2 PCI wireless chip used in TP-Link TL-WR841N v7.
Atheros AR9380 is a 3*3 PCI wireless chip used in TP-Link TL-WR2543N v1.

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
2023-05-24 00:50:42 +02:00
David Bauer
c9f5c3f7b5 devices: add MediaTek MT7981 WMAC compatible
This adds detection for the MediaTek MT7981 WMAC.

Signed-off-by: David Bauer <mail@david-bauer.net>
2023-05-17 22:41:40 +02:00
Daniel Golle
b3888b2953
devices: add compatible strings for Ralink WiSoCs
Now that iwinfo_hardware_id_from_mtd() is no longer called in case
a compatible string is found we need to add those to devices.txt.
Unfortunately some WiSoCs share the same dtsi and hence also the
compatible string, so detection is now slightly wrong for those,
as they were previously identified parsing the MTD EEPROM data.
As a reminder that this will need fixing, the following entries
have been left in devices.txt:
0x1814 0x3051 0x1814 0x0007    0      0  "Ralink"   "Rt3051"
0x1814 0x3052 0x1814 0x0008    0      0  "Ralink"   "Rt3052"
0x1814 0x3350 0x1814 0x000b    0      0  "Ralink"   "Rt3350"
0x1814 0x3662 0x1814 0x000d    0      0  "Ralink"   "Rt3662"

Fixes: fac0787 ("devices: add support for declaring compatible matched devices")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2023-02-08 14:33:48 +00:00
Andre Heider
c7eb8ebe33
nl80211: restore iterating over all devices in nl80211_phy2ifname()
This reverts to the earlier behaviour, because:
* phys can be renamed, which breaks hardcoding "phy%d"
* /sys/class/ieee80211/*/device can return networks of other phys,
  since "device" is a symlink which can have multiple phys

The earlier behaviour fixes both points.

Fixes: 6194aaf0 "nl80211: simplify iterating over phy's devices"
Signed-off-by: Andre Heider <a.heider@gmail.com>
Tested-by: Olcay Korkmaz <nuke_mania@hotmail.com>
[ drop extra Fixes tag related to openwrt issue ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-02-06 21:31:45 +01:00
Christian Marangi
1e4e709d6f
iwinfo: readd missing define for IWINFO_AUTH in header
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: 7e3d7ded29 ("iwinfo: reorganize iwinfo header to enum and defines")
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-23 13:47:49 +01:00
Andre Heider
f766138662
cli: print the flags on the frequency list
Provide info for each flags applied to the frequency on frequency list
dump.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:27:00 +01:00
Andre Heider
8ee7971c76
lib: add IWINFO_FREQ_FLAG_NAMES
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>
2023-01-20 17:26:59 +01:00
Andre Heider
81184d2763
nl80211: fix some comments
Spelling and indenting fixes.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:26:59 +01:00
Andre Heider
2c4ee842e5
nl80211: prefer non-supplicant-based devices
If a phy has multiple devices, prefer non-supplicant-based ones as per
link_mode, see [0] and [1].

The nl80211 API provides more information than wpa_supplicant/hostapd does,
like HT/VHT operation, which are used by e.g. luci's channel analysis.

[0] https://www.kernel.org/doc/Documentation/ABI/testing/sysfs-class-net
[1] https://github.com/openwrt/luci/issues/6167#issuecomment-1364500296

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:26:59 +01:00
Andre Heider
6194aaf052
nl80211: simplify iterating over phy's devices
There's no need to iterate over all devices in /sys/class/net and check
if the phy index matches, sysfs already provides per phy devices.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:26:58 +01:00
Andre Heider
acbf4fe47d
nl80211: remove redundant check in nl80211_phy2ifname()
phyidx is already checked for <0 a few lines above.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:26:58 +01:00
Andre Heider
0172c97759
cli: print the frequency and band on the scan list
Provide band and frequency info on scan list dump.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:26:58 +01:00
Andre Heider
bbe424f394
cli: print the band on the frequency list
Provide band info on frequency list dump.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 17:26:58 +01:00
Andre Heider
afa147c45a
nl80211: add "mhz" and "band" to iwinfo_scanlist_entry
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>
2023-01-20 17:26:57 +01:00
Andre Heider
0d5ea34245
nl80211: add "band" to iwinfo_freqlist_entry
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>
2023-01-20 17:26:57 +01:00
Christian Marangi
dba0f0690b
nl80211: add support for radiation and indoor chan restriction
Add new 'flags' bits to declare these two channel restrictions.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
2023-01-20 17:26:57 +01:00
Christian Marangi
7e3d7ded29
iwinfo: reorganize iwinfo header to enum and defines
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>
2023-01-20 17:26:54 +01:00
Andre Heider
9b47b031c0
devices: add USB devices supported by the mt76 driver
A nice and stable working mainline driver deserves first class support,
and this adds all USB devices supported by it.

The PIDs/VIDs are taken directly from the driver, in the very same order
to make future syncs easy.

The single left out entry is the unknown 148f:760a.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 16:08:00 +01:00
Andre Heider
c0fda7cf24
utils: skip comment lines when parsing devices.txt
Just a small optimization, skip the line early if it starts with a #.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 16:08:00 +01:00
Andre Heider
dbc0ee7c57
cli: describe USB devices as such
This makes it clear if the hardware is embedded or usb/pci based.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 16:08:00 +01:00
Andre Heider
891acee618
devices: add MediaTek MT7628 card
This adds the single missing compatible supported by the mt76 driver,
which is used by a bunch of ramips mt7628an devices.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2023-01-20 16:07:59 +01:00
Jo-Philipp Wich
fac0787ab0
devices: add support for declaring compatible matched devices
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>
2023-01-10 00:26:50 +01:00
Robert Marko
c7b420a2f3
devices: add Qualcomm Atheros QCN6024/9024/9074 cards
Add Qualcomm Atheros QCN6024/9024/9074 PCI ID, they all are compatible and
use the same ID.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-06 17:44:23 +01:00
Robert Marko
5914d7113e
iwinfo: devices: add Qualcomm Atheros IPQ8074 WiSoC
Add detection of the Qualcomm Atheros IPQ8074 WiSoC using the compatible
string from device tree.

Signed-off-by: Robert Marko <robimarko@gmail.com>
2023-01-06 15:13:10 +01:00
Andre Heider
8d158096a9 cli: print current HT mode
This was present in the ubus call provided by rpcd, but not the cli.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
8f86dd69f7 cli: use IWINFO_HTMODE_COUNT
ARRAY_SIZE works too, but just the sake of consistency.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
f36b72b00d cli: use IWINFO_KMGMT_NAMES
There's no need to duplicate the strings or even miss new ones.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
91be7e0d28 cli: use IWINFO_CIPHER_NAMES
There's no need to duplicate the strings or even miss new ones.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
49b6ec91e9 cli: fix printing the scan channel width
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>
2022-12-16 00:09:07 +01:00
Andre Heider
b1c8873e37 cli: fix marking the active channel
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>
2022-12-16 00:09:07 +01:00
Andre Heider
9e14e643c5 utils: add iwinfo_band2ghz() and iwinfo_ghz2band() helpers
To classify bands, to be used as ubus values.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
e084781afc utils: add helper functions to get names by values
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>
2022-12-16 00:09:07 +01:00
Andre Heider
d09a77a369 utils: add iwinfo_htmode_is_{ht|vht|he} helpers
Small and useful functions which allow to clear up some consumers.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
87529770f6 utils: add and use iwinfo_format_hwmodes()
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>
2022-12-16 00:09:07 +01:00
Andre Heider
02f433e305 lib: add IWINFO_80211_COUNT and IWINFO_80211_NAMES
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>
2022-12-16 00:09:07 +01:00
Andre Heider
1d30df1929 lib: add IWINFO_BAND_COUNT and IWINFO_BAND_NAMES
Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-16 00:09:07 +01:00
Andre Heider
aefd0ef68f lib: use common IWINFO_CIPHER_NAMES strings
Use a hyphen for the WEP cipher names, just as the others. Not that
anyone cares anymore, but this let's us use this array instead of
everyone fixing it up on their own.

Signed-off-by: Andre Heider <a.heider@gmail.com>
2022-12-15 23:52:51 +01:00