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>
Johannes Berg [Mon, 19 Nov 2018 10:22:55 +0000 (11:22 +0100)]
iw: make parse_random_mac_addr() more generally available
The parse_random_mac_addr() function is useful in contexts
other than scanning, so make it more generally available and
make it set the attributes to randomise all when no arguments
are given.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Hauke Mehrtens [Wed, 10 Oct 2018 20:47:47 +0000 (22:47 +0200)]
iw: scan: parse OWE Transition Mode element
This adds code to parse the Opportunistic Wireless Encryption Transition
Mode element.
Without this patch the output looks like this:
WFA 0x1c, data: 00 37 b7 36 dc 0c 08 4f 70 65 6e 57 72 74 34
With this patch it looks like this:
OWE Transition Mode:
BSSID: 00:37:b7:36:dc:0c
SSID: OpenWrt4
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Brian Norris [Mon, 8 Oct 2018 17:51:26 +0000 (10:51 -0700)]
iw: fix enum warnings
clang warns about the misuse of enums:
reg.c:246:26: warning: implicit conversion from enumeration type 'enum command_identify_by' to different enumeration type 'enum id_input' [-Wenum-conversion]
err = handle_cmd(state, CIB_NONE, 2, dump_args);
~~~~~~~~~~ ^~~~~~~~
info.c:645:26: warning: implicit conversion from enumeration type 'enum command_identify_by' to different enumeration type 'enum id_input' [-Wenum-conversion]
err = handle_cmd(state, CIB_NONE, 2, feat_args);
~~~~~~~~~~ ^~~~~~~~
Signed-off-by: Brian Norris <briannorris@chromium.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
scan: fix crash when driver doesn't report frame type
If driver does not know what kind of frame has been received from BSS,
then it is possible to specify CFG80211_BSS_FTYPE_UNKNOWN
in cfg80211_inform_bss[_width].
In this case neither NL80211_BSS_BEACON_IES nor NL80211_BSS_PRESP_DATA
will be reported to userspace.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iw: 'idby' might be used uninitialized in main function
During static-analysis of the code, a message appeared stating that
'idby' enum might be used un-initialized.
It described a case in which the 'goto detect' statment occurred and
that means that the enum initialization will be skipped.
Johannes: just move the initialization after the label, instead
of moving the variable as Omer's patch had it since we always
just want it to be II_NONE to start with and don't need it in
any other scope.
Signed-off-by: Omer Dagan <omer.dagan@tandemg.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Tue, 22 May 2018 20:15:32 +0000 (22:15 +0200)]
scan: print out "Information elements from Probe Response frame" only if certain
If we can't be sure that the IEs were really from a probe
response, avoid printing out that they were, since that's
just confusing to the user.
After kernel commit 0e227084aee3 ("cfg80211: clarify BSS
probe response vs. beacon data") in 3.18 it will set the
NL80211_BSS_PRESP_DATA attribute, so we know for sure; we
can also know if the content is different from the beacon
content.
Reported-by: Denis Kenzior <denkenz@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This adds commands to get and set the per-phy TXQ parameters for drivers
that use the intermediate TXQs. These are the settings and statistics that
are also available through /sys/kernel/debug/ieee80211/phyX/aqm.
iw: Print TXQ statistics for stations and interfaces
This adds printing of TXQ statistics for stations and interfaces when
supplied by the kernel. For stations, another section is added when verbose
mode is enabled; for interfaces, the multicast queue information is always
printed when available.
This is the information also available through debugfs in
/sys/kernel/debug/ieee80211/phyX/netdev:Y/aqm and
/sys/kernel/debug/ieee80211/phyX/netdev:Y/stations/*/aqm.
Johannes Berg [Thu, 4 Jan 2018 15:20:05 +0000 (16:20 +0100)]
bump version to 4.14
This is a bit of a superset of 4.14, but maybe I want to
release 4.15 with the new things still WIP, and I need to
get a release out the door due to signature issues.
The extended capabilities IE needs to know if the ap is a VHT STA
and because of that a 'struct print_ies_data' was added to contain
the original ie buffer.
Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Add debug command to receive and print selected management frames.
Frames are selected by their type and pattern containing the first
several bytes of the frame that should match.
Note that Linux wireless core does not support multiple listeners
for management frames. So this debug command can be used together
with hostapd or other wireless software only in the case if it
subscribes for different set of management frames.
Frame type is supplied as hex w/o leading 0x. Frame pattern is supplied
as hex pattern of the form aa:bb:cc w/o leading 0x as well.
Count is a number of frames to receive.
Signed-off-by: Sergey Matyukevich <sergey.matyukevich.os@quantenna.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Thu, 26 Jan 2017 09:20:08 +0000 (10:20 +0100)]
iw: parse_freqs: check how many center frequencies to expect
Instead of just plain assuming the next two integer arguments
are, if present, center frequencies, teach the code how many
are expected and check that they're actually present.
This makes it slightly better to use the parser before an int
argument, although it's still ambiguous due to the width.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Mon, 7 Nov 2016 14:59:43 +0000 (15:59 +0100)]
Print frequency of radar events.
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Mon, 7 Nov 2016 14:59:41 +0000 (15:59 +0100)]
Add commands to send CSA
Add a new set of commands to send a CSA. Both the number of beacons and the
flag to block TX can be given optionally.
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Mon, 7 Nov 2016 14:59:40 +0000 (15:59 +0100)]
Add cac command to allow clearing channels
Allow the user to start a CAC for clearing DFS channels.
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de> Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Benjamin Berg [Mon, 7 Nov 2016 14:59:36 +0000 (15:59 +0100)]
util: Add generic frequency/channel command line handler
The ability to parse channel definitions is required in a lot of places
inside iw. However, right now each of these duplicates a lot of code to
handle it.
So add a new helper which can be used everywhere.
Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Rafał Miłecki [Wed, 1 Jun 2016 05:51:14 +0000 (07:51 +0200)]
add "channels" PHY command listing frequencies with more details
Channels (frequencies) are getting more details that users may want to
know about. E.g. it's important to know which frequencies allow using
40/80/160 MHz channels to setup AP properly.
We list channels in "info" command output but it's already quite big and
it was agreed to introduce new command rather than expand the old one.
This patch adds "channels" command printing what was already available
in the "info" plus details about supported channel widths. It also
removes DFS info from the "info" output.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Yongqin Liu [Tue, 3 May 2016 05:48:48 +0000 (13:48 +0800)]
iw: version.sh: update to get version with git correctly
update to get the version information from the
git repository where this file is located instead of the
the current directory where it is executed, otherwise if
there is .git directory in the current directory, it will
get the wrong version information.
And improved the version check since the tag information
may not be mirrored like what AOSP does now.
Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Erik Stromdahl [Mon, 2 May 2016 19:55:30 +0000 (21:55 +0200)]
iw: add vendor command response support
Introduced two new commands for reading vendor command responses:
recv and recvbin
Both will send a vendor command (typically some kind of GET request)
in the same way as the current send command and print the received
response in ASCII or binary.
Signed-off-by: Erik Stromdahl <erik.stromdahl@gmail.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
iw: Add support for NL80211_STA_INFO_RX_DURATION netlink attribute
Add support for new netlink attribute 'NL80211_STA_INFO_RX_DURATION'.
'NL80211_STA_INFO_RX_DURATION' accounts for aggregate PPDU duration
in microseconds for all the frames from a peer. Drivers can fill
'rx_duration' field and set the flag 'NL80211_STA_INFO_RX_DURATION'.
'rx_duration' will give an idea about the total time spent by our peer
with each of its connected peers.
This will get dumped as part of 'iw dev wlan#N station dump'
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qti.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Tribush, Gil [Wed, 18 May 2016 11:22:10 +0000 (11:22 +0000)]
iw: Change socket configuration to avoid buffer allocation error
Move nl_socket_set_buffer_size() to be called after genl_connect(),
otherwise nl_socket_set_buffer_size() always returns an NLE_BAD_SOCK
error because sk->s_fd is equal to -1 at that stage.
Signed-off-by: Gil Treibush <gil.tribush@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Avraham Stern [Sun, 8 Nov 2015 08:09:14 +0000 (10:09 +0200)]
iw: add scheduled scan plans configuration
Scheduled scan now supports configuring multiple 'scan plans'.
Each scan plan specifies the interval between scans and the number
of iterations to scan. So add an option to configure scan plans
for scheduled scan
At least one scan plan must be configured. Note that all scan plans
but the last one must specify the scan interval and the number of
iterations. The last scan plan must specify only the interval and
will be run infinitely.
The option to set only an interval is kept for backwards
compatibility. However, the new scan plans option and the old interval
optoin are mutually exclusive.
Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Aviya Erenfeld [Mon, 29 Jun 2015 16:02:55 +0000 (19:02 +0300)]
iw: add missing station statistics
add prints of statistics, flags and data to iw dump command.
the prints added are:
TID statistics
bss parameters
beacon rx
beacon loss
rx drop misc
beacon signal avg
associated flag
the TID statistics is a big table and therefore only printed
when adding -v parameter to the dump command.
in addition change rx bytes and tx bytes to u64 instead of u32
Signed-off-by: Aviya Erenfeld <aviya.erenfeld@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>