]> git.ipfire.org Git - thirdparty/iw.git/log
thirdparty/iw.git
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>
8 years agoiw: Fix segfault when no args are given to offchannel
Ola Olsson [Wed, 21 Oct 2015 12:02:24 +0000 (14:02 +0200)] 
iw: Fix segfault when no args are given to offchannel

The offchannel command assumes that frequency and duration
are given as arguments, otherwise iw segfaults - fix that
by printing help text instead.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
[remove braces]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: add and fix -Wsign-compare
Johannes Berg [Wed, 14 Oct 2015 06:49:14 +0000 (08:49 +0200)] 
iw: add and fix -Wsign-compare

Ola Olsson pointed out that -Wsign-compare was getting a lot
of warnings, those seem reasonable to fix.

Reported-by: Ola Olsson <ola1olsson@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: fix help text for event command
Ola Olsson [Mon, 12 Oct 2015 20:37:08 +0000 (22:37 +0200)] 
iw: fix help text for event command

According to the source, the -t and -r options are
mutually exclusive. Fix the help text accordingly.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: add helpful hints for vendor cmd
Ola Olsson [Mon, 12 Oct 2015 20:32:10 +0000 (22:32 +0200)] 
iw: add helpful hints for vendor cmd

Without having access to the source, it was
hard to know the format of vendor oui and sub
cmd. This commit fixes that by returning the
right error code to print the help text.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoocb: use correct "MHz" instead of "MHZ"
Ola Olsson [Mon, 12 Oct 2015 07:35:56 +0000 (09:35 +0200)] 
ocb: use correct "MHz" instead of "MHZ"

Fixes the last typos of MHZ to MHz

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: Fix return values when parameters are wrong
Ola Olsson [Mon, 12 Oct 2015 07:34:54 +0000 (09:34 +0200)] 
iw: Fix return values when parameters are wrong

According to header file, wrong parameters
yield 1 as return value.
Also tried to fix the comments since one part
of it was unreadable.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: Fix memory leak in error path
Ola Olsson [Fri, 9 Oct 2015 14:52:42 +0000 (16:52 +0200)] 
iw: Fix memory leak in error path

The leak is present if malloc fails after requesting
a scan with ies or meshid as input.

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 [Sun, 4 Oct 2015 21:08:39 +0000 (23:08 +0200)] 
iw: remove superfluous includes

if.h only contains if_nametoindex and the reverse.
Lets remove the inclusion in the source files where
these functions are not called.

Signed-off-by: Ola Olsson <ola.olsson@sonymobile.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoibss: use correct "MHz" instead of "MHZ"
Johannes Berg [Fri, 18 Sep 2015 09:11:38 +0000 (11:11 +0200)] 
ibss: use correct "MHz" instead of "MHZ"

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoibss: add VHT80 support for IBSS
Janusz.Dziedzic@tieto.com [Thu, 10 Sep 2015 10:04:13 +0000 (12:04 +0200)] 
ibss: add VHT80 support for IBSS

Add VHT80 support for IBSS.

eg. iw wlan0 ibss join 5180 80MHZ
    iw wlan0 ibbs join 5220 80MHZ

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
[fix formatting]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoscan: Add FTM info to scan results
Assaf Krauss [Thu, 10 Sep 2015 12:53:03 +0000 (15:53 +0300)] 
scan: Add FTM info to scan results

In each scan result, check station capabilities and report whether it
is capable of acting as an FTM initiator, and whether it is capable
if acting as an FTM responder.

Signed-off-by: Assaf Krauss <assaf.krauss@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: display interface TX power if available
Rafał Miłecki [Tue, 1 Sep 2015 07:55:52 +0000 (09:55 +0200)] 
iw: display interface TX power if available

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
[print dBm]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agobump version to 4.3 v4.3
Johannes Berg [Fri, 18 Sep 2015 08:54:53 +0000 (10:54 +0200)] 
bump version to 4.3

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: fix off-by-one
Johannes Berg [Fri, 18 Sep 2015 08:54:17 +0000 (10:54 +0200)] 
iw: fix off-by-one

An off-by-one prevented printing the very last command, fix it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoadd a few new commands/events
Johannes Berg [Fri, 18 Sep 2015 08:52:26 +0000 (10:52 +0200)] 
add a few new commands/events

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoprint IR-concurrent instead of GO-concurrent
Johannes Berg [Fri, 18 Sep 2015 08:50:50 +0000 (10:50 +0200)] 
print IR-concurrent instead of GO-concurrent

Since this flag is now also used for other IR indications,
e.g. TDLS.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoupdate nl80211.h to kernel 4.3
Johannes Berg [Fri, 18 Sep 2015 08:50:29 +0000 (10:50 +0200)] 
update nl80211.h to kernel 4.3

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: don't mix declaration into code
Johannes Berg [Fri, 18 Sep 2015 08:47:42 +0000 (10:47 +0200)] 
iw: don't mix declaration into code

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: make netns_get_fd static
Johannes Berg [Fri, 18 Sep 2015 08:46:57 +0000 (10:46 +0200)] 
iw: make netns_get_fd static

This can be static since it's only used right there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: fix s_cb leak
Johannes Berg [Fri, 18 Sep 2015 08:44:44 +0000 (10:44 +0200)] 
iw: fix s_cb leak

Reported-by: Amit Khatri <amit.khatri@samsung.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: avoid passing NULL to nla_data()
Amit Khatri [Thu, 13 Aug 2015 10:26:59 +0000 (10:26 +0000)] 
iw: avoid passing NULL to nla_data()

The attr pointer is checked for NULL but the function
doesn't handle it appropriately - fix that.

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: cqm: check nlmsg_alloc() return
Amit Khatri [Thu, 13 Aug 2015 10:20:48 +0000 (10:20 +0000)] 
iw: cqm: check nlmsg_alloc() return

If nlmsg_alloc() fails, don't crash but return an error.

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: remove android-nl.c with unneeded workaround
Filipe Brandenburger [Thu, 30 Jul 2015 21:35:15 +0000 (14:35 -0700)] 
iw: remove android-nl.c with unneeded workaround

The workaround might have been necessary in the past, however now it
produces the following error:

  .../libnl.a(attr.o): multiple definition of 'nla_put_flag'
  .../android-nl.o: previous definition here
  collect2: error: ld returned 1 exit status

TEST=Built AOSP tree with this patchset, tested the generated iw binary.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: fix references to libnl in Android.mk
Filipe Brandenburger [Thu, 30 Jul 2015 21:47:08 +0000 (14:47 -0700)] 
iw: fix references to libnl in Android.mk

The latest AOSP refers to that library as libnl and not libnl_2.

TEST=Built AOSP tree with this patchset, tested the generated iw binary.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: free memory on scan parse errors
Amit Khatri [Fri, 26 Jun 2015 09:02:36 +0000 (09:02 +0000)] 
iw: free memory on scan parse errors

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: remove cb from arguments and simplify valid handler
Johannes Berg [Fri, 26 Jun 2015 09:42:28 +0000 (11:42 +0200)] 
iw: remove cb from arguments and simplify valid handler

Just provide our own valid handler and let the command
functions assign it without going through the cb.

(With the event handling fixed by Eliad Peller)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: add connected time to station info
Arik Nemtsov [Wed, 3 Jun 2015 08:32:23 +0000 (11:32 +0300)] 
iw: add connected time to station info

Useful for long testing scenarios

Signed-off-by: Arik Nemtsov <arik@wizery.com>
--
As a side note, I had to change version.sh to make this compile in the
intel git. The "4.1" tag is missing here, so this line fails in
version.sh:

[ "${descr%%-*}" = "v$VERSION" ] || exit 2

8 years agoiw: print beacon-loss and wiphy delete events
Ben Greear [Thu, 11 Jun 2015 19:54:11 +0000 (15:54 -0400)] 
iw: print beacon-loss and wiphy delete events

This is nicer than messages about unknown events.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: only use tags matching "v*"
Johannes Berg [Mon, 8 Jun 2015 08:51:10 +0000 (10:51 +0200)] 
iw: only use tags matching "v*"

Some people/build systems may add additional tags, so use only
tags matching "v*" for the version creation.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agobump version to 4.1 v4.1
Johannes Berg [Tue, 5 May 2015 12:15:14 +0000 (14:15 +0200)] 
bump version to 4.1

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: handle NL80211_ATTR_EXT_FEATURES attribute
Janusz.Dziedzic@tieto.com [Mon, 30 Mar 2015 10:56:31 +0000 (12:56 +0200)] 
iw: handle NL80211_ATTR_EXT_FEATURES attribute

Print if VHT-IBSS is supported.

Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoupdate nl80211.h
Johannes Berg [Tue, 5 May 2015 12:14:11 +0000 (14:14 +0200)] 
update nl80211.h

(To 4.1-rc2)

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
8 years agoiw: trivial spelling fix (initial)
Stefan Lippers-Hollmann [Tue, 28 Apr 2015 02:45:09 +0000 (04:45 +0200)] 
iw: trivial spelling fix (initial)

Introduced in 29af20194aedd2f1c26205bb70a395d394845708, "iw: add a
delay option to net-detect".

Signed-off-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoiw: Print OSEN element for HotSpot 2.0 IE.
Ben Greear [Tue, 17 Mar 2015 22:02:33 +0000 (15:02 -0700)] 
iw: Print OSEN element for HotSpot 2.0 IE.

Re-uses most of the print-rsn logic since only the header
differs.

Example output:
...
HotSpot 2.0 OSEN:
 * Group cipher: NO-GROUP
 * Pairwise ciphers: CCMP
 * Authentication suites: OSEN
 * Capabilities: 16-PTKSA-RC 1-GTKSA-RC (0x000c)

Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoiw: add randomise option for sched_scan
Luciano Coelho [Tue, 17 Mar 2015 14:11:50 +0000 (16:11 +0200)] 
iw: add randomise option for sched_scan

Like with normal scans, we can randomise the MAC address sent out in
active scheduled scans.  Add the randomise option to sched_scan (and
net-detect) parsing code.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoiw: add support for active scheduled scan
Luciano Coelho [Tue, 17 Mar 2015 14:11:49 +0000 (16:11 +0200)] 
iw: add support for active scheduled scan

Add options to explicitly use active or passive scans on schedule
scans (and net-detect).  If neither active nor passive parameters are
passed, the default is to do active scans with the wildcard SSID.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoiw: implement scheduled scan
Luciano Coelho [Tue, 17 Mar 2015 14:11:48 +0000 (16:11 +0200)] 
iw: implement scheduled scan

Add sched_start, sched_stop and events parsing for scheduled scan.
For now, only passive scans are supported.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoiw: move generic sched scan parsing code out of net detect
Luciano Coelho [Tue, 17 Mar 2015 14:11:47 +0000 (16:11 +0200)] 
iw: move generic sched scan parsing code out of net detect

The scheduled scan structure is pretty much the same as the net-detect
WoWLAN trigger's.  Move the bulk of the command line parsing code to
a generic function so we can reuse it for sched_scan.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
9 years agoversion 4.0 v4.0
Johannes Berg [Tue, 17 Mar 2015 13:18:24 +0000 (14:18 +0100)] 
version 4.0