Johannes Berg [Thu, 27 Aug 2020 11:07:31 +0000 (13:07 +0200)]
iw: add support for vendor events
We can already drop in arbitrary files for vendor commands
as the build system picks those up, also add support for
vendor specific events in a similar fashion.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ilan Peer [Sun, 19 Jul 2020 07:44:24 +0000 (10:44 +0300)]
reg: Fix getting PHY specific regulatory information
Commit 14ad75d3b4c3 ("iw: support multiple regdom print") added
support for dumping multiple regulatory domain, with the intent
that if a specific phy is given, only its regulatory information
would be fetched. However, the phy specific handling was ignored.
Fix it.
Change-Id: I647ef420741e528a4d6568a7d4518c9a561bd199 Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Linus Lüssing [Wed, 17 Jun 2020 07:30:34 +0000 (09:30 +0200)]
iw: mesh: add mesh_param "mesh_nolearn" to skip path discovery
Currently, before being able to forward a packet between two 802.11s
nodes, both a PLINK handshake is performed upon receiving a beacon and
then later a PREQ/PREP exchange for path discovery is performed on
demand upon receiving a data frame to forward.
When running a mesh protocol on top of an 802.11s interface, like
batman-adv, we do not need the multi-hop mesh routing capabilities of
802.11s and usually set mesh_fwding=0. However, even with mesh_fwding=0
the PREQ/PREP path discovery is still performed on demand. Even though
in this scenario the next hop PREQ/PREP will determine is always the
direct 11s neighbor node.
The new mesh_nolearn parameter allows to skip the PREQ/PREP exchange in
this scenario, leading to a reduced delay, reduced packet buffering and
simplifies HWMP in general.
mesh_nolearn is still rather conservative in that if the packet destination
is not a direct 11s neighbor, it will fall back to PREQ/PREP path
discovery.
For normal, multi-hop 802.11s mesh routing it is usually not advisable
to enable mesh_nolearn as a transmission to a direct but distant neighbor
might be worse than reaching that same node via a more robust /
higher throughput etc. multi-hop path.
iw: sync frequency to channel mapping with kernel for 6GHz band
This enables support for channel to frequency conversion and vice versa
for 6GHz channels and frequencies. Channel numbers of 6GHz band might
overlap with those of 5G and 2G bands.
Use command NL80211_CMD_SET_TID_CONFIG to perform per-node TID specific
configuration. If peer is not specified, then configuration is applied
to all the peers. Currently kernel supports configuration of the
following parameters:
- short/long retry
- mpdu/msdu aggregation on/off
- rts/cts on/off
- noack on/off
Examples:
Apply configuration for specific peer and TIDs:
$ iw dev wlan0 set tidconf peer 1:2:3:4:5:6 tids 0x3 ampdu off tids 0x2 sretry 10 lretry 100
$ iw dev wlan0 set tidconf peer 1:2:3:4:5:6 tids 0x1 override ampdu off amsdu off
Apply configuration for all peers and all TIDs:
$ iw dev wlan0 set tidconf tids 0xff ampdu off amsdu off sretry 10 lretry 100 noack off
Apply configuration for all peers and specific TIDs:
$ iw dev wlan0 set tidconf peer 0xff:0xff:0xff:0xff:0xff:0xff tids 0x1 ampdu off amsdu off
Brian Norris [Tue, 31 Mar 2020 23:28:33 +0000 (16:28 -0700)]
iw: 'phy <name> reg get' shouldn't dump all domains
Right now, 'iw phy ... reg get' gets translated to NLM_F_DUMP, which
dumps all domains. But this command really is looking for non-DUMP
semantics -- it only wants the domain for the specified wiphy, or (per
the kernel's choice) the global, if the wiphy doesn't have its own.
We can achieve this by skipping the handle_reg_get() -> "reg dump"
indirection.
[ with a wiphy-specific domain ]
Before:
# iw phy phy0 reg get
global
country XX: DFS-YYY
[...]
phy#0
country AA: DFS-BBB
[...]
After:
# iw phy phy0 reg get
phy#0
country AA: DFS-BBB
[...]
[ without a wiphy-specific domain ]
Before and after (unchanged):
# iw phy phy0 reg get
global
country XX: DFS-YYY
[...]
Ilan Peer [Wed, 26 Feb 2020 11:31:48 +0000 (13:31 +0200)]
scan: Fix printing of unknown WPS vendor extension
When an unknown WPS vendor extension is encountered a '\t' was
inserted without a matching message with '\n'. This would impact
the output of following data. Fix it
Change-Id: I86c40c088592ecc7713b0793e0ac56e41d3607a3 Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Markus Theil [Sun, 9 Feb 2020 16:58:56 +0000 (17:58 +0100)]
iw: scan: fix buffer over-read in print_ies()
This patch correctly checks, if enough data bytes for parsing IEs are
present (-2 in check for type and length). Furthermore, it adds a
nullptr and length check to ease future fuzzing.
John Crispin [Tue, 4 Feb 2020 15:45:34 +0000 (16:45 +0100)]
iw: print ru-alloc values when dumping stations
In commit 2f74c59cf11e ("iw: add HE support to station dump call") we added
most of the HE values when parsing tx bitrates/dumping stations. The
ru-alloc value was missing. This patch adds that value.
Johannes Berg [Fri, 26 Jul 2019 07:18:11 +0000 (09:18 +0200)]
iw: scan: add missing newline
There was a missing newline after the ATIM window print, add it.
Change-Id: I3fba9d1bcd0015a622379c4f9f6c43df225877a6 Reported-by: Bill Unruh <unruh@physics.ubc.ca> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 2 May 2019 08:34:37 +0000 (10:34 +0200)]
iw: include all C files into the binary
There's really no reason to have a separate configuration
for HWSIM, so we can also always compile that. Then, we
no longer need to spell out the list of files and can just
include all the files.
Change-Id: I2a9141b9924bbc217015fce1076ea01017b88cae Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 2 May 2019 08:05:47 +0000 (10:05 +0200)]
iw: change __cmd section scheme to fit gcc/clang
There are some behaviour differences in how gcc and clang
fill a special section like the one we use for __cmd here.
In both compilers, obviously all variables declared like
this end up in the special __cmd section.
However, alignment and padding is applied differently by
different compilers and linkers, and as such it is hard to
really rely on being able to treat this like an array.
To avoid all these issues, put just *pointers* to the
structures into the special section, which makes it easy
to skip NULL pointers (resulting from padding) and has no
issues with alignment as they're always smaller than the
alignment applied.
Change-Id: I35e2c66e541758e60363883d26b31d2040ce8aa9 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iw: add command to inject a frame via direct mesh link to mesh peer
Add mpath command to inject ethernet frame over direct mesh link to
given peer, bypassing the mpath table lookup. This helps to send data
frames over unexcersized direct mesh path, which is not selected as
next_hop node. This can be helpful in measuring link metrics.
Print the value of the 4ADDR attribute when dumping the interface
status.
Signed-off-by: Antonio Quartulli <a@unstable.cc>
[print only when enabled] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Ieaa5de972638e9c0a9b74fe1daf4aa86dba2c7fd
Johannes Berg [Thu, 28 Feb 2019 20:34:03 +0000 (21:34 +0100)]
iw: fix cmd_size determination with LTO
Use a separate section to determine the cmd_size as in LTO
the entries in __cmd get freely rearranged, leading to a
(usually) very large cmd_size, and thus to the whole thing
not working.
Change-Id: I3437ad34de1d927961a3e98f109794d7a884327f Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iw: Add printing of station tx duration and airtime weight
This adds printing of the station TX duration (along with the existing RX
duration), and the airtime weight, both of which were added as part of the
airtime fairness patches that were recently merged into mac80211.
Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Fri, 1 Feb 2019 22:00:40 +0000 (23:00 +0100)]
iw: add FTM responder commands
Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Beni Lev <beni.lev@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 22 Nov 2018 12:59:03 +0000 (13:59 +0100)]
iw: separate wait/print when waiting for an event
We usually only wanted to print the event that we waited
for, but with measurements that's changing, we want to
wait for the complete event and print the results.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>