Commit graph

75 commits

Author SHA1 Message Date
Rafał Miłecki
c1a03e8231 nl80211: request split information about frequencies
This allows kernel send more details including all the
NL80211_FREQUENCY_ATTR_NO_* flags.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
2017-08-23 11:00:00 +02:00
Rafał Miłecki
5638567dc7 nl80211: store info about freq being not available for some bandwidths
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Jo-Philipp Wich <jo@mein.io>
2017-08-16 17:15:19 +02:00
Rafał Miłecki
5c10efa2cb nl80211: support receiving split frequencies
In order to get more details about each frequency we will need to set
NL80211_ATTR_SPLIT_WIPHY_DUMP in the future. This will result in our
callback being called multiple times. Modify it to support such a
scenario:
1) Start putting new frequencies after the last set one
2) Make sure that attribute is set before iterating it

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Acked-by: Jo-Philipp Wich <jo@mein.io>
2017-08-16 17:14:26 +02:00
Jo-Philipp Wich
335967c6c2 nl80211: improve error handling
- introduce a new nl80211_request() which combines nl80211_msg() with
   nl80211_send() to simplify calling code

 - always invoke nl80211_free() in nl80211_send() and remove explicit
   nl80211_free() invocations in callers

 - back out early on netlink errors in functions performing multiple
   calls, e.g. when fetching scan results

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-06-26 09:48:02 +02:00
Jo-Philipp Wich
ab089dda34 nl80211: propagate netlink errors to callers
Adjust nl80211_send() to propagate errors back to the caller and do not
free message and callbacks in send error case anymore since all callsites
immediately invoke nl80211_free() anyway.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-06-26 07:30:56 +02:00
Jo-Philipp Wich
7bba117a3a nl80211: handle netlink errors in nl80211_wait()
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2017-06-26 07:06:40 +02:00
Jo-Philipp Wich
96d322d594 nl80211: retry phy lookup with platform/ prefix
If the first attempt to lookup the phy index by the path value fails, retry to
find the index within the platform/ subdirectory to follow the logic used by
the mac80211 package.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2016-07-04 16:07:12 +02:00
Jo-Philipp Wich
bc8682aa5e nl80211: add VHT rateinfo support
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2016-01-25 15:01:49 +01:00
Jo-Philipp Wich
7781ba3f33 nl80211: remove dead code
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-29 13:46:12 +01:00
Jo-Philipp Wich
41ae5bd556 nl80211: fix possibly unterminated ifname string
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-29 10:53:56 +01:00
Jo-Philipp Wich
b19476dec2 nl80211: fix possible fd leak in nl80211_hostapd_hup()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-29 10:43:49 +01:00
Jo-Philipp Wich
eeaae3d011 nl80211: fix possible unitialized memory access in nl80211_get_hardware_id()
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-10-29 10:40:40 +01:00
Rafał Miłecki
813f61e48b nl80211: read TX power using NL80211_CMD_GET_INTERFACE
With the mac80211 commit d55d0d598e66 ("nl80211: put current TX power in
interface info") it is possible now to get TX power using nl80211. As we
don't really support any wext-only drivers it doesn't make sense to
leave wext as a fallback.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
2015-10-05 11:00:22 +02:00
Felix Fietkau
3d38d1d17e iwinfo: null-terminate country code
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
2015-09-11 15:46:59 +02:00
Jernej Kos
16597a70bc iwinfo: report additional data for stations
Signed-off-by: Jernej Kos <jernej@kos.mx>
2015-08-11 17:24:24 +02:00
Jo-Philipp Wich
e8a1e7d224 Fix -Wall -Wpedantic warnings
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-05-19 18:54:58 +02:00
Jo-Philipp Wich
5aef442328 nl80211: rework hostapd and wpa_supplicant query code
The old nl80211_hostapd_info() used a global static buffer which was not
properly zeroed on subsequent invocations, leading to misreported encryption
values when querying multiple radios or radious with multiple vifs.

Also rework and simplify the control socket code for wpa_supplicant by
splitting status query and scan handling.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-05-19 18:28:32 +02:00
Jo-Philipp Wich
7b39bee1c6 iwinfo: add support for querying available HT modes
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-05-08 13:29:10 +02:00
Jo-Philipp Wich
6e67940be5 nl80211: relax definition of restricted channels
Only mark channels restricted that do not have a radar flag set.

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2015-03-31 13:56:03 +02:00
Imre Kaloz
40f2844fad iwinfo: don't report AC capabilities on 2GHz-only interfaces
If a 802.11ac capable chip is in 2GHz-only mode, the hwmode
reported should be 802.11bgn.

Signed-off-by: Imre Kaloz <kaloz@openwrt.org>
2015-03-20 16:50:21 +01:00
Andrew McDonnell
50370d9e69 iwinfo: Fix incorrect buffer allocation in nl80211_get_ifcomb_cb()
This fixes a buffer overwrite, I found it when building with SSP enabled
2014-12-12 15:36:41 +01:00
Jo-Philipp Wich
665809c7f3 nl80211: implement lookup_phy() op
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-10-27 17:04:17 +01:00
Jo-Philipp Wich
32dad1a63a nl80211: support phy lookup by macaddr and phy name
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-10-27 15:22:20 +01:00
nbd
fe7133f7e5 iwinfo: fix handling of accessing nl80211 interfaces via radio*
look up device path via uci instead of assuming a direct phy index

Signed-off-by: Felix Fietkau <nbd@openwrt.org>

git-svn-id: svn+ssh://svn.openwrt.org/openwrt/trunk@42759 3c298f89-4303-0410-b956-a3cf2f4a3e73
2014-10-27 13:48:19 +01:00
Jo-Philipp Wich
8ae758db52 Initial commit
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
2014-10-05 19:56:27 +02:00