]> git.ipfire.org Git - thirdparty/iw.git/log
thirdparty/iw.git
5 years agoiw: separate wait/print when waiting for an event
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>
5 years agoiw: make parse_random_mac_addr() more generally available
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>
5 years agoupdate nl80211.h and command list
Johannes Berg [Fri, 1 Feb 2019 21:55:13 +0000 (22:55 +0100)] 
update nl80211.h and command list

Update nl80211.h to what should be in kernel 5.0.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: make all code files non-executable
Johannes Berg [Tue, 8 Jan 2019 11:42:42 +0000 (12:42 +0100)] 
iw: make all code files non-executable

Change-Id: I19eafb95c718cc1632530aef2670581e9e958808
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: add FEATURE support for scan randomization
Brian Norris [Wed, 14 Nov 2018 23:11:29 +0000 (15:11 -0800)] 
iw: add FEATURE support for scan randomization

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: dump 'rx bitrate' in link stats
Brian Norris [Thu, 29 Nov 2018 02:38:48 +0000 (18:38 -0800)] 
iw: dump 'rx bitrate' in link stats

We include it in 'station dump' but not 'link'.

Signed-off-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: use -Wstringop-overflow=4
Johannes Berg [Wed, 21 Nov 2018 08:13:54 +0000 (09:13 +0100)] 
iw: use -Wstringop-overflow=4

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: honor CPPFLAGS when compiling
Paride Legovini [Thu, 8 Nov 2018 20:36:59 +0000 (21:36 +0100)] 
iw: honor CPPFLAGS when compiling

Pass CPPFLAGS to the compiler as done with CFLAGS.

Change-Id: Ic91d26125e8314b32596e9fefa0dd9393cf0cda1
Signed-off-by: Paride Legovini <pl@ninthfloor.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: Fix NAN match event formatting
Andrei Otcheretianski [Sun, 7 May 2017 15:20:30 +0000 (18:20 +0300)] 
iw: Fix NAN match event formatting

Handle new lines and commas correctly.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: nan: fix warning of uninitialized variable
Zamir, Roee [Thu, 23 Mar 2017 10:13:11 +0000 (12:13 +0200)] 
iw: nan: fix warning of uninitialized variable

Signed-off-by: Zamir, Roee <roee.zamir@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoremove stray evp.h include
Johannes Berg [Tue, 7 Mar 2017 08:29:56 +0000 (09:29 +0100)] 
remove stray evp.h include

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: nan: Add NAN Commands
Roee Zamir [Mon, 31 Oct 2016 13:42:32 +0000 (15:42 +0200)] 
iw: nan: Add NAN Commands

Implement nan commands for NAN interface.
The commands allow to start/stop the interface, subscribe/publish
and change current configuration.

Signed-off-by: Roee Zamir <roee.zamir@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: nan: Handle NAN Events
Roee Zamir [Mon, 31 Oct 2016 14:31:02 +0000 (16:31 +0200)] 
iw: nan: Handle NAN Events

Handle NAN function termination and NAN match events.

Signed-off-by: Roee Zamir <roee.zamir@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: Add inactivity timeout configuration support
Netanel Bachner [Thu, 18 Jan 2018 18:38:11 +0000 (20:38 +0200)] 
iw: Add inactivity timeout configuration support

Add inactivity time as an optional parameter, so that the time it takes
for the AP to free up a connected inactive station could be configured.

Signed-off-by: Netanel Bachner <netanel.bachner@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agowowlan: Use MAX_NL80211_ATTR instead of NUM in nla_parse
David Spinadel [Mon, 2 Jul 2018 15:27:39 +0000 (18:27 +0300)] 
wowlan: Use MAX_NL80211_ATTR instead of NUM in nla_parse

nla_parse expects max type and not the num of the attributes.
The previous code could cause stack smashing.

While at that use nla_parse_nested instead of nla_parse.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoconnect: fix parsing of WEP keys
Emmanuel Grumbach [Tue, 12 Jun 2018 06:01:56 +0000 (09:01 +0300)] 
connect: fix parsing of WEP keys

The introduction of MFP options added a bug that causes a
segmentation fault when parsing WEP keys.
Fix that.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoconnect: Fix parsing of PSK
Ilan Peer [Wed, 20 Jun 2018 06:22:23 +0000 (09:22 +0300)] 
connect: Fix parsing of PSK

Commit cdef5f1f7d40 ("[BUGFIX] connect: fix parsing of WEP keys")
missed updating 'argc' and 'argv' at the end of PSK processing.
Fix it.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: fix various static checker warnings
Johannes Berg [Thu, 11 Oct 2018 10:26:02 +0000 (12:26 +0200)] 
iw: fix various static checker warnings

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: scan: parse OWE Transition Mode element
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>
5 years agoiw: Make input to mac_addr_n2a() const
Hauke Mehrtens [Wed, 10 Oct 2018 20:47:46 +0000 (22:47 +0200)] 
iw: Make input to mac_addr_n2a() const

The parameter is not modified, so we can make it constant. This makes it
possible to provide other const parameters to this function.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoscan: Decode additional Authentication types
Hauke Mehrtens [Fri, 5 Oct 2018 21:14:31 +0000 (23:14 +0200)] 
scan: Decode additional Authentication types

This adds some more authentication types, the constants are taken from
hostapd. I only tested SAE, FT/SAE and OWE.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: fix enum warnings
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>
5 years agoiw: fix the beacon average signal parsing
Emmanuel Grumbach [Thu, 4 Oct 2018 09:34:20 +0000 (12:34 +0300)] 
iw: fix the beacon average signal parsing

NL80211_STA_INFO_BEACON_SIGNAL_AVG is parsed as a u8, but
it should be casted to a int8_t before being printed.

Change-Id: Ieb6fab3b803d8ea82819a450f07cc4b537d8de8b
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: ack signal support for tx ack packets
Balaji Pothunoori [Thu, 19 Jul 2018 14:29:50 +0000 (19:59 +0530)] 
iw: ack signal support for tx ack packets

This patch is to display the average ack signal,
last ack signal of tx ack packets.

Signed-off-by: Balaji Pothunoori <bpothuno@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoscan: fix fall through warning
Johannes Berg [Wed, 29 Aug 2018 08:56:10 +0000 (10:56 +0200)] 
scan: fix fall through warning

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoupdate nl80211.h
Johannes Berg [Wed, 29 Aug 2018 08:54:45 +0000 (10:54 +0200)] 
update nl80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoscan: fix indentation in previous change
Johannes Berg [Tue, 14 Aug 2018 11:34:50 +0000 (13:34 +0200)] 
scan: fix indentation in previous change

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoscan: fix crash when driver doesn't report frame type
Sergey Matyukevich [Sat, 4 Aug 2018 20:31:11 +0000 (23:31 +0300)] 
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>
5 years agoiw: 'idby' might be used uninitialized in main function
Omer Dagan [Sun, 22 Jul 2018 14:44:36 +0000 (17:44 +0300)] 
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>
5 years agoiw: enable -Wextra and fix warnings caused by it
Johannes Berg [Tue, 22 May 2018 20:23:32 +0000 (22:23 +0200)] 
iw: enable -Wextra and fix warnings caused by it

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoscan: print out "Information elements from Probe Response frame" only if certain
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>
5 years agoiw: fix some scan code indentation
Johannes Berg [Tue, 22 May 2018 20:10:03 +0000 (22:10 +0200)] 
iw: fix some scan code indentation

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: Add getting and setting of TXQ params for phy
Toke Høiland-Jørgensen [Tue, 8 May 2018 11:22:11 +0000 (13:22 +0200)] 
iw: Add getting and setting of TXQ params for phy

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.

Sample output:

$ iw phy phy0 get txq
Packet limit: 8192 pkts
Memory limit: 4194304 bytes
Quantum: 300 bytes
Number of queues: 4096
Backlog: 12 pkts
Memory usage: 52224 bytes
Packet limit overflows: 0
Memory limit overflows: 0
Hash collisions: 1

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: Print TXQ statistics for stations and interfaces
Toke Høiland-Jørgensen [Tue, 8 May 2018 11:22:11 +0000 (13:22 +0200)] 
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.

Sample output:

$ iw dev wlp2s0 station dump -v
Station xx:xx:xx:xx:xx:xx (on wlp2s0)
[...]
TXQs:
TID qsz-byt qsz-pkt flows drops marks overlmt hashcol tx-bytes tx-packets
0 0 0 0 0 0 0 0 0 0
1 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0
6 0 0 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0
8 0 0 0 0 0 0 0 0 0
9 0 0 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0
11 0 0 0 0 0 0 0 0 0
12 0 0 0 0 0 0 0 0 0
13 0 0 0 0 0 0 0 0 0
14 0 0 0 0 0 0 0 0 0
15 0 0 0 0 0 0 0 0 0
[...]

$ iw dev wlp2s0 info
Interface wlp2s0
ifindex 9
wdev 0x1
addr xx:xx:xx:xx:xx:xx
type AP
wiphy 0
channel 165 (5825 MHz), width: 20 MHz, center1: 5825 MHz
txpower 24.00 dBm
multicast TXQ:
qsz-byt qsz-pkt flows drops marks overlmt hashcol tx-bytes tx-packets
0 0 72 0 0 0 0 7380 72

Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoupdate nl80211.h
Johannes Berg [Fri, 18 May 2018 08:05:05 +0000 (10:05 +0200)] 
update nl80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: support reloading the regulatory database
Seth Forshee [Wed, 9 May 2018 15:36:20 +0000 (10:36 -0500)] 
iw: support reloading the regulatory database

Add a "iw reg reload" command, useful for testing new regulatory
databases.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
5 years agoiw: Add duration parameter to scan command
Pradeep Kumar Chitrapu [Tue, 8 May 2018 17:20:30 +0000 (10:20 -0700)] 
iw: Add duration parameter to scan command

This patch lets user to specify duration(TUs) and set duration-mandatory
flag in scan command.

Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: add printout of all supported ext_features to phy info
Dmitry Lebed [Fri, 30 Mar 2018 20:45:09 +0000 (23:45 +0300)] 
iw: add printout of all supported ext_features to phy info

Signed-off-by: Dmitry Lebed <lebed.dmitry@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: update nl80211.h
Johannes Berg [Thu, 19 Apr 2018 15:11:16 +0000 (17:11 +0200)] 
iw: update nl80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agobump version to 4.14 v4.14
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.

6 years agoupdate nl80211.h
Johannes Berg [Thu, 4 Jan 2018 15:19:57 +0000 (16:19 +0100)] 
update nl80211.h

6 years agoutil: update command list
Johannes Berg [Thu, 4 Jan 2018 15:19:46 +0000 (16:19 +0100)] 
util: update command list

6 years agoocb: Use common freqchan helper for setting the operating channel
Peter Große [Wed, 13 Dec 2017 12:58:40 +0000 (13:58 +0100)] 
ocb: Use common freqchan helper for setting the operating channel

Simplify code by using the helper which has been introduced earlier.

Signed-off-by: Peter Große <pegro@friiks.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: add support for mfp
Emmanuel Grumbach [Thu, 10 Aug 2017 07:50:30 +0000 (10:50 +0300)] 
iw: add support for mfp

Allow to add a paramater to require MFP in the connect command.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: ap: don't return -EPERM
Johannes Berg [Thu, 26 Jan 2017 09:19:20 +0000 (10:19 +0100)] 
iw: ap: don't return -EPERM

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: ap: support hidden/zeroed SSID
Johannes Berg [Wed, 25 Jan 2017 16:15:47 +0000 (17:15 +0100)] 
iw: ap: support hidden/zeroed SSID

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: ap: add support for passing a proper chandef
Shaul Triebitz [Thu, 19 Jan 2017 11:51:31 +0000 (13:51 +0200)] 
iw: ap: add support for passing a proper chandef

While at it, also fix some minor things in the help.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: Add support for start/stop AP
Ilan Peer [Sun, 4 Sep 2016 14:02:35 +0000 (17:02 +0300)] 
iw: Add support for start/stop AP

The beacon head (mandatory) and tail should be provided as part of the
AP start command.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: print missing extended capabilities
Shahar S Matityahu [Sun, 4 Sep 2016 13:09:44 +0000 (16:09 +0300)] 
iw: print missing extended capabilities

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>
6 years agoiw: allow CCMP-128/GCMP-128 as CCMP/GCMP aliases
Johannes Berg [Wed, 17 Aug 2016 08:28:02 +0000 (10:28 +0200)] 
iw: allow CCMP-128/GCMP-128 as CCMP/GCMP aliases

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: add support for WPA2 PSK CCMP / GCMP association
Emmanuel Grumbach [Wed, 27 Jul 2016 18:25:10 +0000 (21:25 +0300)] 
iw: add support for WPA2 PSK CCMP / GCMP association

If the driver advertises
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_OFFLOAD_STA, we can
pass the PMK and let it do the 4way.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
[fix PSK -> PMK in attribute name]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoupdate nl80211.h
Johannes Berg [Mon, 11 Dec 2017 12:23:25 +0000 (13:23 +0100)] 
update nl80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: add command to register and dump mgmt frames
Sergey Matyukevich [Sat, 18 Nov 2017 18:20:52 +0000 (21:20 +0300)] 
iw: add command to register and dump mgmt frames

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.

Format:
$ iw dev <devname> frame <type> <pattern> [frame <type> <pattern>]* [count <frames>]

Example:
$ iw dev wlan0 mgmt dump frame 40 00 frame 40 01:02 count 10

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>
6 years agoiw: define SOL_NETLINK if it isn't
Johannes Berg [Thu, 7 Sep 2017 10:55:02 +0000 (12:55 +0200)] 
iw: define SOL_NETLINK if it isn't

We need SOL_NETLINK but userspace headers don't always define it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
6 years agoiw: add extack support
Johannes Berg [Thu, 13 Apr 2017 13:53:25 +0000 (15:53 +0200)] 
iw: add extack support

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoupdate nl80211.h
Johannes Berg [Thu, 16 Mar 2017 09:58:57 +0000 (10:58 +0100)] 
update nl80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: Fix bitrate output when no rate info found
Masashi Honma [Tue, 14 Feb 2017 09:38:58 +0000 (18:38 +0900)] 
iw: Fix bitrate output when no rate info found

Previously, bitrate showed uninitialized buffer when no rate info found.
This patch fixes the issue.

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: parse_freqs: check how many center frequencies to expect
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>
7 years agoiw: split str_to_bw() from parse_freqs()
Johannes Berg [Wed, 25 Jan 2017 15:57:43 +0000 (16:57 +0100)] 
iw: split str_to_bw() from parse_freqs()

This may be needed separately later, split it out now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoPrint frequency of radar events.
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>
7 years agoAdd commands to send CSA
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>
7 years agoAdd cac command to allow clearing channels
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>
7 years agomesh: Use common freqchan helper for joining a mesh
Benjamin Berg [Mon, 7 Nov 2016 14:59:39 +0000 (15:59 +0100)] 
mesh: Use common freqchan helper for joining a mesh

Simplify code by using the helper which has been introduced earlier.

Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoibss: Use common freqchan helper for joining an ibss
Benjamin Berg [Mon, 7 Nov 2016 14:59:38 +0000 (15:59 +0100)] 
ibss: Use common freqchan helper for joining an ibss

Simplify code by using the helper which has been introduced earlier.

Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agophy: Use common freqchan helper for setting the operating channel
Benjamin Berg [Mon, 7 Nov 2016 14:59:37 +0000 (15:59 +0100)] 
phy: Use common freqchan helper for setting the operating channel

Simplify code by using the helper which has been introduced earlier.

Signed-off-by: Benjamin Berg <benjamin.berg@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoutil: Add generic frequency/channel command line handler
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>
7 years agoupdate version to 4.9 v4.9
Johannes Berg [Tue, 18 Oct 2016 05:46:20 +0000 (07:46 +0200)] 
update version to 4.9

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: nan: Add NAN interface type
Andrei Otcheretianski [Thu, 3 Sep 2015 11:13:17 +0000 (14:13 +0300)] 
iw: nan: Add NAN interface type

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: add support for VHT MU-MIMO air sniffer
Aviya Erenfeld [Thu, 3 Dec 2015 10:11:31 +0000 (12:11 +0200)] 
iw: add support for VHT MU-MIMO air sniffer

Add support for MU-MIMO air sniffer by extending the
"set monitor" command, adding two options:

mumimo-groupid: for MU-MIMO-monitoring according a given MU-MIMO
                groupID

mumimo-follow-mac: for MU-MIMO-monitoring a station according
                   to its MAC address

Signed-off-by: Aviya Erenfeld <aviya.erenfeld@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoadd new commands
Johannes Berg [Tue, 18 Oct 2016 05:41:22 +0000 (07:41 +0200)] 
add new commands

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoibss: remove _POSIX_SOURCE
Johannes Berg [Tue, 18 Oct 2016 05:39:55 +0000 (07:39 +0200)] 
ibss: remove _POSIX_SOURCE

It doesn't appear to be necessary and is causing warnings about
struct addrinfo.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoupdate nl80211.h (kernel 4.9)
Johannes Berg [Tue, 18 Oct 2016 05:35:51 +0000 (07:35 +0200)] 
update nl80211.h (kernel 4.9)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoevent: handle NL80211_ATTR_TIMED_OUT in connect event
Johannes Berg [Wed, 17 Aug 2016 13:22:09 +0000 (15:22 +0200)] 
event: handle NL80211_ATTR_TIMED_OUT in connect event

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: add scan-abort command
Eliad Peller [Thu, 4 Aug 2016 12:36:23 +0000 (15:36 +0300)] 
iw: add scan-abort command

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoutils: make hex2byte and hex2bin parameter const
Emmanuel Grumbach [Wed, 27 Jul 2016 17:55:52 +0000 (20:55 +0300)] 
utils: make hex2byte and hex2bin parameter const

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: display 5/10 MHz channel widths
Bob Copeland [Thu, 21 Jul 2016 15:39:48 +0000 (11:39 -0400)] 
iw: display 5/10 MHz channel widths

iw was showing 'width: unknown' for channels on OCB interfaces; teach
it the values for 5/10 MHz so it will show the configured width.

Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: recognize 256-bit cipher suites
Mantas Mikulėnas [Wed, 6 Jul 2016 12:41:41 +0000 (15:41 +0300)] 
iw: recognize 256-bit cipher suites

Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoadd "channels" PHY command listing frequencies with more details
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>
7 years agoiw: bump version to 4.7 v4.7
Johannes Berg [Tue, 31 May 2016 09:52:46 +0000 (11:52 +0200)] 
iw: bump version to 4.7

Clearly I missed a number of kernel versions, but this
is pretty much up-to-date with 4.7.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: version.sh: update to get version with git correctly
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>
7 years agoiw: Fix -Wabsolute-value compiler warning in iw.c
Aurimas Liutikas [Thu, 12 May 2016 16:16:30 +0000 (09:16 -0700)] 
iw: Fix -Wabsolute-value compiler warning in iw.c

Signed-off-by: Aurimas Liutikas <aurimas@google.com>
Reviewed-by: Julian Calaby <julian.calaby@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: support setting frame subtype and reason code when deleting station
Rafał Miłecki [Wed, 4 May 2016 15:38:57 +0000 (17:38 +0200)] 
iw: support setting frame subtype and reason code when deleting station

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
7 years agoiw: add vendor command response support
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>
7 years agoiw: Add support for NL80211_STA_INFO_RX_DURATION netlink attribute
Mohammed Shafi Shajakhan [Thu, 7 Apr 2016 14:30:20 +0000 (20:00 +0530)] 
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>
7 years agoiw: Change socket configuration to avoid buffer allocation error
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>
8 years agoupdate nl80211.h
Johannes Berg [Thu, 14 Apr 2016 09:12:38 +0000 (11:12 +0200)] 
update nl80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: add scheduled scan plans configuration
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>
8 years agoiw: add missing station statistics
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>
8 years agoiw: document handler return value 1 as HANDLER_RET_USAGE
Johannes Berg [Wed, 13 Apr 2016 11:47:19 +0000 (13:47 +0200)] 
iw: document handler return value 1 as HANDLER_RET_USAGE

This value is used to mean "print out usage info", so make
a define for it. Still not used, but new code can and should
use it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: fix "iw reg get" double output
Johannes Berg [Wed, 13 Apr 2016 11:45:24 +0000 (13:45 +0200)] 
iw: fix "iw reg get" double output

Axel reports that running "iw reg get" results in the (global)
output being printed twice. The reason for this is that we try
to use the dump facility, and if that succeeds we also do the
get command.

To prevent this, allow handlers to return HANDLER_RET_DONE, in
which case the command will be treated as successful but will
not actually execute another netlink command.

Reported-by: Axel Köllhofer <AxelKoellhofer@web.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoprint BSS boottime if received
Johannes Berg [Thu, 14 Jan 2016 10:46:56 +0000 (11:46 +0100)] 
print BSS boottime if received

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoupdate nl80211.h
Johannes Berg [Thu, 14 Jan 2016 10:14:59 +0000 (11:14 +0100)] 
update nl80211.h

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: print NOHT always as first in usage texts
Sven Eckelmann [Wed, 25 Nov 2015 13:59:18 +0000 (14:59 +0100)] 
iw: print NOHT always as first in usage texts

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: use get_cf1 and struct chanmode for ocb
Sven Eckelmann [Wed, 25 Nov 2015 13:59:17 +0000 (14:59 +0100)] 
iw: use get_cf1 and struct chanmode for ocb

The struct chanmode and the function get_cf1 is already used by ibss and
mesh. Also use it for ocb to make it consistent for for all join functions.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: add VHT80 support for 802.11s
Sven Eckelmann [Wed, 25 Nov 2015 13:59:16 +0000 (14:59 +0100)] 
iw: add VHT80 support for 802.11s

iw mesh supports non-HT and HT channel widths like HT20 or NOHT. But the
Linux 802.11s implementation also supports VHT80 which can be specified
during the mesh join.

    iw dev mesh0 mesh join "meshnet" freq 5180 80MHz

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: prepare get_cf1 for use in join_* functions
Sven Eckelmann [Wed, 25 Nov 2015 13:59:15 +0000 (14:59 +0100)] 
iw: prepare get_cf1 for use in join_* functions

The chanmode structure and the function get_cf1 to calculate the center
frequency one can be used by not only the ibss join code but also by the
mesh and ocb join code.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: don't use NULL pointer in nla_nest_end()
Amit Khatri [Thu, 26 Nov 2015 09:10:19 +0000 (14:40 +0530)] 
iw: don't use NULL pointer in nla_nest_end()

Fix a crash if nla_nest_start() fails here.

Signed-off-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Rahul Jain <rahul.jain@samsung.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: Fix memory leak if nla_put fails
Ola Olsson [Fri, 23 Oct 2015 22:33:12 +0000 (00:33 +0200)] 
iw: Fix memory leak if nla_put fails

The NLA_PUT macro will automatically goto nla_put_failure if
the underlying nla_put fails. This will in turn leak our malloced
memory in both the scan and wowlan commands.
Fix that by not using the macro in the cases where we have
allocated heap mem.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agomesh: show mesh parameters when no args are given
Ola Olsson [Wed, 21 Oct 2015 12:13:19 +0000 (14:13 +0200)] 
mesh: show mesh parameters when no args are given

The help text in "<get|set> mesh_param" says that
available parameters will be shown if no args are given
but that is not the case - fix that.

Also, add help text if a parameter is given but not found.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: remove superfluous includes
Ola Olsson [Wed, 21 Oct 2015 12:04:37 +0000 (14:04 +0200)] 
iw: remove superfluous includes

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>