Commit graph

1131 commits

Author SHA1 Message Date
Andrei Otcheretianski 1c4ffa8746 nl80211: Add channel switch implementation
Implement nl80211 switch_channel() operation.
Publish flags indicating kernel support for channel switch.

Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2013-11-17 17:12:49 +02:00
Andrei Otcheretianski dcca2219ae wpa_supplicant: Update channel switch driver interface
Add csa_settings struct which holds parameters for CSA. Change driver
interface for switch_channel(), so that it will receive this struct and
not only the new frequency as it was before. This allows wpa_supplicant
to provide all the required parameters (beacons, proberesp, assocresp,
CSA IE) which are required by cfg80211 implementation.

Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
2013-11-17 16:48:33 +02:00
Jouni Malinen 3505743395 Sync with wireless-testing.git include/uapi/linux/nl80211.h
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-11-17 16:48:03 +02:00
Abhishek Singh 795baf773f hostapd: Filter channel list updated events after country code change
We were not filtering the EVENT_CHANNEL_LIST_CHANGED events based on the
regulatory hint initiator. So wait for EVENT_CHANNEL_LIST_CHANGED event
after our own change was triggered even when regulatory hint initiator
was the driver. This could result in the wait for the channel list to be
updated to be terminated before the real change has occurred and as
such, old channel list remaining in use when configuring
hostapd/wpa_supplicant country parameter. Fix this by filtering the
hints according to the initiator and only regulatory hints initiated by
user will be used to stop the wait.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-11-15 02:59:55 +02:00
Jouni Malinen 146fa9b38f nl80211: Do not force interface down on deinit
If wpa_supplicant or hostapd was started with the interface
already up, do not force interface down on deinit.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-11-09 18:05:54 +02:00
Jouni Malinen 49b4b2058b nl80211: Do not for station mode on hostapd deinit
If hostapd was started with the interface already in AP mode, leave the
interface in AP mode on deinit instead of unconditionally forcing it to
station mode.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-11-09 17:29:32 +02:00
Jouni Malinen 04eff7d5ba nl80211: Remove build time condition on HOSTAPD define
It is common to build wpa_supplicant with AP mode support and it is
justifiable to clean up driver_nl80211.c by removing the conditional
build blocks based on hostapd vs. wpa_supplicant builds.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-11-09 17:22:49 +02:00
Jouni Malinen 0d547d5ff8 nl80211: Share more code between hostapd and wpa_supplicant
This gets rid of some ifdef HOSTAPD constructs and shares more
of the initialization code between hostapd and wpa_supplicant.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-11-09 17:09:02 +02:00
Jouni Malinen 7b7de4cf94 nl80211: Remove read-only last_freq/last_freq_ht
These variables were originally used in hostapd to clear HT channel
information when exiting. However, that functionality was lost with
commit f019981aee when moving to a common
code for setting the channel. Taken into account that no one seems to
have missed this functionality over the last four years, it seems safe
to drop this rather than try to fix the old hostapd behavior.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-11-09 17:02:05 +02:00
Jouni Malinen 1c6edec60c nl80211: Work around nl_socket_set_nonblocking on Android
system/core/libnl_2 does not include nl_socket_set_nonblocking(), so
need to implement that to fix the build.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-11-07 17:10:34 +02:00
Jouni Malinen 149338020b drivers: Do not call hostapd_logger()
This call requires a struct hostapd_data pointer and that is not really
something that the driver wrappers should be using.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-11-06 00:19:46 +02:00
Jouni Malinen f0793bf191 hostapd: Wait for channel list update after country code change
If hostapd is requested to set the country code and the previous country
code differs from the new one, the channel list information from the
driver may change. This change may not be instant, so wait for an
EVENT_CHANNEL_LIST_CHANGED event before continuing interface setup with
fetching of the channel list information. This fixes issues where the
selected channel is not available based on the previous regulatory data
and update through CRDA takes some time.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-11-03 19:51:06 +02:00
Jouni Malinen 884f1a3c65 nl80211: Verify radar event attributes exist before using them
While these attributes may be expected to be present always, this needs
to be verified within driver_nl80211.c since we cannot depend on the
kernel/driver working correctly.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-11-03 11:31:48 +02:00
Jouni Malinen 2aec4f3c0c Allow add-BSS operation to re-use existing netdev
When removing and re-adding the first wlan# netdev to hostapd
dynamically, the netdev is already present and should not be removed and
re-added to maintain its state as not-added-by-hostapd so that it does
not get removed automatically.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-31 22:34:25 +02:00
Kyeyoon Park 390e489c0d hostapd: Allow the first BSS in a multi-BSS setup to be removed
This moves the vif added check from core hostapd to the driver wrapper
(only driver_nl80211.c uses this) and reorders operations a bit to allow
the first BSS (vif) to be removed from a multi-BSS setup.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-31 22:00:31 +02:00
Kyeyoon Park 834ee56f78 nl80211: Make wpa_driver_nl80211_data::first_bss pointer
This is needed to allow the first BSS to be removed and replaced by the
next one in the list.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-31 22:00:31 +02:00
Jouni Malinen 748c0ac0e7 nl80211: Fix monitor interface reference counting
The first user of monitor interface was not counted and that could
result in the monitor interface getting removed if the initial interface
was removed from a multi-BSS setup.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-31 22:00:31 +02:00
Jouni Malinen 08e55ebbb0 nl80211: Add a debug print for DEL_BEACON
This is quite helpful in debugging beaconing issues.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-31 22:00:12 +02:00
Jouni Malinen bbc706a3c3 nl80211: Add debug prints for NL80211_CMD_SET_STATION
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-10-30 00:38:57 +02:00
Eliad Peller 53cfad46e2 nl80211: Mark VHT 80 MHz channels
Later on, we'll consider the availability of these
channels when starting P2P GO with VHT support.

Signed-hostap: Eliad Peller <eliadx.peller@intel.com>
2013-10-27 19:37:10 +02:00
Helmut Schaa 6651f1f9f1 nl80211: Use max tx power from regulatory domain
Previously the Country element contained the max TX power the local
hardware was capable of. Change this to just use the regulatory limit.

Signed-hostap: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
2013-10-27 18:42:16 +02:00
Jouni Malinen 7ac3616d0f nl80211: Replace perror() and printf() calls with wpa_printf()
This avoids use of stderr and makes debug messages more consistent.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-10-27 17:58:12 +02:00
Jouni Malinen e7ecab4a3b Use ARRAY_SIZE() macro
Replace the common sizeof(a)/sizeof(a[0]) constructions with a more
readable version.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-10-26 17:49:05 +03:00
Jouni Malinen 34068ac3b1 nl80211: Add debug prints on nl_recvmsgs() failure
These libnl calls could potentially fail and it is useful to know if
that has happened.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-10-26 17:48:28 +03:00
Johannes Berg 10b8592183 nl80211: Make eloop sockets non-blocking
To avoid a problem where the beacon socket occasionally
blocks, mark any sockets on the eloop as non-blocking.
The previous patch reordered the code to never send a
command after a socket was put on the eloop, but now also
invalidate the nl handle pointer while it's on there.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-10-26 17:48:22 +03:00
Johannes Berg 5f65e9f717 nl80211: Abstract handling of sockets on eloop
Abstract the handling of sockets on the eloop to avoid
destroying sockets still on the eloop and also to allow
the next patch to mark the socket non-blocking.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-10-26 17:48:17 +03:00
Johannes Berg e8d1168b73 nl80211: Register for IBSS auth frames before eloop
The IBSS code registers the bss nl_mgmt socket for auth
frames when the join event happens, but that is too late
as then the socket is already on the eloop, which could
cause problems when other events are received at the
same time as the registration is done.

Move the auth frame registration to the initial setup
before the socket is put onto the eloop.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-10-26 17:48:09 +03:00
Jouni Malinen 0f0120148a Verify that readlink() did not truncate result
linux_br_get() was forcing null termination on the buffer, but did not
check whether the string could have been truncated. Make this more
strict by rejecting any truncation case.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-10-26 15:55:39 +03:00
Jouni Malinen f5eb9da304 nl80211: Clean up if_add() for hostapd use
The allocation of new_bss and its use was separated by a lot of code in
this function. This can be cleaned up by moving the allocation next to
the use, so that this all can be within a single #ifdef HOSTAPD block.
The i802_check_bridge() call was outside type == WPA_IF_AP_BSS case, but
in practice, it is only used for WPA_IF_AP_BSS (and if used for
something else, this would have resulted in NULL pointer dereference
anyway).

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-10-26 15:55:30 +03:00
Jouni Malinen 6cb4f11dba nl80211: Fix strerror() value in P2P Dev debug messages
send_and_recv_msgs() returns negative errno, so need to use -ret in the
strerror() call.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-10-26 15:55:18 +03:00
Jouni Malinen 24f051eb14 Replace remainining strncpy() uses with strlcpy()
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-10-26 15:54:47 +03:00
Michal Kazior cd3b0700df nl80211: Fix DFS radar event parsing
Incorrect nla_get variants were used to get event type and frequency.
Kernel passes both as u32. This caused issues on tinynl/big-endian hosts
- CAC finished was treated as radar detection and frequency was 0.

Signed-hostap: Michal Kazior <michal.kazior@tieto.com>
2013-10-22 15:50:07 +03:00
Jouni Malinen 2b72df6374 nl80211: Free BSS structure even if netdev does not exists
It is possible for a vif netdev to be removed by something else than
hostapd and if that happens for a virtual AP interface, if_remove()
handler should still free the local data structure to avoid memory leaks
if something external removes a netdev.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-22 13:35:32 +03:00
Jouni Malinen 41cc50d19e nl80211: Update send_action_cookie on AP-offchannel-TX path
Previously, the send_mlme->send_frame->send_frame_cmd path that could be
used when a GO sends an offchannel Action frame ended up not updating
drv->send_action_cookie. This can result in an issue with not being able
to cancel wait for the response, e.g., in invitation-to-running-group
case.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-21 18:24:20 +03:00
Jouni Malinen 56f5af489c Interworking: Add support for QoS Mapping functionality for the STA
Indicate support for QoS Mapping and configure driver to update the QoS
Map if QoS Map Set elements is received from the AP either in
(Re)Association Response or QoS Map Configure frame.

This commit adds support for receiving the frames with nl80211 drivers,
but the actual QoS Map configuration command is still missing.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-18 14:13:45 +03:00
Kyeyoon Park 850e1c2579 atheros: Add support for QoS Mapping configuration
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-18 14:13:45 +03:00
Kyeyoon Park c551700f1f Interworking: Add support for QoS Mapping functionality for the AP
This allows QoS Map Set element to be added to (Re)Association Response
frames and in QoS Map Configure frame. The QoS Mapping parameters are
also made available for the driver interface.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-10-18 14:13:45 +03:00
Janusz Dziedzic 846de15d7b DFS: Add more parameters to radar events
Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2013-10-17 21:05:39 +03:00
Janusz Dziedzic 04e8003c6c nl80211: Use struct hostapd_freq_params with start_dfs_cac
Signed-hostap: Janusz Dziedzic <janusz.dziedzic@tieto.com>
2013-10-17 21:05:31 +03:00
Jouni Malinen a771c07dfc Add driver status information to control interface
STATUS-DRIVER command can now be used to fetch driver interface status
information. This is mainly for exporting low-level driver interface
information for debug purposes.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-09-28 17:19:30 +03:00
Jouni Malinen 739faee2a9 nl80211: Add some more debug prints for mgmt frame TX
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-09-28 12:10:57 +03:00
Jouni Malinen f78f278520 nl80211: Fix off-channel Action frame TX from GO with use_monitor
TX frequency gets lost when going through the monitor send MLME option
and this resulted in P2P operations like invitation from a GO failing
when the driver needs monitor socket, but would support offchannel TX.
Fix this by using frame_cmd path instead in case the monitor socket
would have been hit for action frame TX.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-09-28 12:08:19 +03:00
Jouni Malinen af96448488 nl80211: Add more debug prints for send_mlme operations
This makes it easier to debug issues in incorrect channel use in
management frame transmission.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-09-25 23:18:33 +03:00
Jouni Malinen 5d4c78fb1f nl80211: Reset nlmode to station on leaving IBSS
Previously, IBSS mode (NL80211_IFTYPE_ADHOC) was left in drv->nlmode
when leaving IBSS. This causes issues for send_mlme() handler for P2P
Probe Response transmission in Listen state. Fix this by clearing nlmode
back to NL80211_IFTYPE_STATION on leaving IBSS so that following P2P
operations can be executed correctly. Previously, this was fixed only
when the next authentication/association attempt in station mode
occured.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-09-25 23:14:41 +03:00
Jouni Malinen f18b7817ec nl80211: Print more debug info on management frame RX information
This can be useful in figuring out how drv->last_mgmt_freq gets set
to debug issues with P2P frames being sent on incorrect channel.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-09-25 17:42:00 +03:00
Kyeyoon Park 3ca96df596 atheros: Compile fix for driver code not defining IEEE80211_APPIE_FRAME_WNM
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-09-25 14:44:16 +03:00
Michal Kazior 50f4f2a066 hostapd: Add Automatic Channel Selection (ACS) support
This adds ACS support to hostapd. Currently only survey-based
algorithm is available.

To use ACS you need to enable CONFIG_ACS=y in .config and use
channel=0 (or channel=acs_survey) in hostapd.conf.

For more details see wiki page [1] or comments in src/ap/acs.c.

[1]: http://wireless.kernel.org/en/users/Documentation/acs

Signed-hostap: Michal Kazior <michal.kazior@tieto.com>
2013-08-31 11:51:06 +03:00
Michal Kazior 0185007c2e hostapd: Add survey dump support
This adds survey dump support for all frequencies
and for specific desired frequencies. This will later
be used by ACS code for spectrum heuristics.

Signed-hostap: Michal Kazior <michal.kazior@tieto.com>
2013-08-25 18:35:25 +03:00
Rui Paulo ba873bdf86 wired: Wait for the link to become active before sending packets
Interfaces that take one or two seconds to reconfigure the link after we
set IFF_ALLMULTI or after we bring the interface up were dropping the
initial TX EAPOL packet which caused excessive delays in authentication.
This change applies to FreeBSD/DragonFly only.

Signed-hostap: Rui Paulo <rpaulo@FreeBSD.org>
2013-08-25 11:40:19 +03:00
Ilan Peer bf83eab553 nl80211: Start P2P Device when rfkill is unblocked
Signed-hostap: Ilan Peer <ilan.peer@intel.com>
2013-08-25 10:43:52 +03:00
Ilan Peer 60b13c2017 nl80211: Do not change type to station on P2P interfaces
It is possible that when trying to remove a dynamically added interface,
changing its type to station mode is not possible (since the kernel does
not support so in its interface combinations).

Since P2P interfaces are always dynamically added, avoid changing their
type to station in the deinit_ap() and deinit_p2p_client() nl80211
callbacks, assuming that the interface is about to be removed.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>
2013-08-25 10:20:54 +03:00
Jouni Malinen b378c41fbc nl80211: Fix deinit path to unregister nl_mgmt socket
Commit 8e12685c43 replaced call to
nl80211_mgmt_unsubscribe() on the deinit path with a
wpa_driver_nl80211_set_mode() call. This is not enough to unregister the
bss->nl_mgmt read socket in all cases. Fix this by unconditionally
unsubscribing from the nl80211 events after having change mode to
station.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-08-24 23:45:11 +03:00
Sunil Dutt 30158a0d80 nl80211: Update the assoc_freq during connect
drv->assoc_freq was not updated during the connect command (neither
during the command's invocation nor after getting the event) unlike with
auth/assoc case where assoc_freq is updated. This resulted in
nl80211_get_link_noise() (and any other function for that matter) using
the improper drv->assoc_freq value with drivers that use the connect
API. Fix this by updating drv->assoc_freq on connect command and when
fetching the frequency from the driver.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-08-23 15:41:05 +03:00
Jouni Malinen 83e7bb0e5d nl80211: Add more debug prints for DEL_STATION commands
This makes the debug log clearer on AP mode STA operations.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-08-23 12:03:28 +03:00
Rui Paulo 646f12ad4c bsd: Add a commit routine
Signed-hostap: Rui Paulo <rpaulo@FreeBSD.org>
2013-08-07 11:03:44 +03:00
Rui Paulo 32dc6a319e bsd: Mark define sta_set_flags() only for hostapd
Signed-hostap: Rui Paulo <rpaulo@FreeBSD.org>
2013-08-07 11:02:55 +03:00
Rui Paulo 70a867c268 bsd: Mark the interface down before opening the routing socket
Signed-hostap: Rui Paulo <rpaulo@FreeBSD.org>
2013-08-07 11:01:12 +03:00
Rui Paulo 89f4690005 bsd: Compute the RSSI level
Signed-hostap: Rui Paulo <rpaulo@FreeBSD.org>
2013-08-07 10:57:51 +03:00
Rui Paulo 5dd82c634c bsd: Set IEEE80211_KEY_NOREPLAY in IBSS/AHDEMO mode
Signed-hostap: Rui Paulo <rpaulo@FreeBSD.org>
2013-08-07 10:57:10 +03:00
Rui Paulo cb76af8a35 bsd: Skip SIOCSIFFFLAGS ioctl when there is no change.
Don't issue SIOCSIFFLAGS if the interface is already up or already down.

Signed-hostap: Rui Paulo <rpaulo@FreeBSD.org>
2013-08-07 10:54:16 +03:00
Sameer Thalappil 7239ea7f01 nl80211: Add stop AP mode event API
Stop AP command can be used by the driver as an event to indicate that
AP mode has stopped operation. WLAN driver may have encountered errors
that has forced the driver to report this event or concurrent operations
on virtual interfaces may have forced AP operation to be stopped. When
in P2P GO mode, wpa_supplicant uses this event to remove P2P group to
keep in sync with the driver state.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-08-06 23:28:40 +03:00
Jouni Malinen dc01de8a0e nl80211: Fix TDLS key configuration to not set TX key index
The nl80211 command for setting the TX index does not distinguish TDLS
vs. AP key and as such, the driver would not know what this set TX key
index operation is doing in the TDLS case. This could result in the TX
key index for AP being changed instead if static WEP is used in the AP
connection. Fix the issue by not setting TX key index when configuring a
TDLS key.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-07-31 18:34:16 +03:00
Ilan Peer 932659696e nl80211: Remove unused WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT
This is not used anymore after the previous commits that changed the
driver interface to use number of supported concurrent channels instead
of this flag.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>
Signed-hostap: David Spinadel <david.spinadel@intel.com>
2013-07-21 20:52:09 +03:00
Ilan Peer 4752147d88 nl80211: Report the number of concurrent support channels
Previously, drivers only reported if they support multiple concurrent
channels, but did not report the maximum number of supported channels.
Add this reporting to the driver capabilities and add the implementation
to driver_nl80211.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>
Signed-hostap: David Spinadel <david.spinadel@intel.com>
2013-07-21 19:49:47 +03:00
Antonio Quartulli b21990b4bb nl80211: Register for AUTH frames when joining an IBSS network
In order to correctly handle IBSS/RSN, wpa_supplicant has to register
for any incoming Authentication frmae to properly react when those are
received.

Signed-hostap: Nicolas Cavallari <cavallar@lri.fr>
Signed-hostap: Antonio Quartulli <antonio@open-mesh.com>
2013-07-21 15:27:19 +03:00
Nicolas Cavallari c91f796fb4 nl80211: Support not specifying the frame frequency
If the frequency is not specified the frame is now sent over
the channel used by the current BSS.

This will also log the payload of each sent CMD_FRAME.

Signed-hostap: Nicolas Cavallari <cavallar@lri.fr>
[antonio@open-mesh.com: commit message reworded]
Signed-hostap: Antonio Quartulli <antonio@open-mesh.com>
2013-07-21 15:24:50 +03:00
Mohammed Shafi Shajakhan ed07764699 nl80211: Remove redundant assignment of ifindex
wpa_driver_nl80211_finish_drv_init() takes care of assigning
the interface index.

Signed-hostap: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
2013-07-21 13:20:27 +03:00
Sujith Manoharan 69dd2967db WDS: Fix WEP usage with nl80211 wds_sta=1
The static WEP keys have to be configured for the new VLAN
interface that is created for a 4addr WDS peer, not doing so
breaks WEP functionality in nl80211/4addr based WDS links.

Signed-hostap: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2013-07-20 17:41:22 +03:00
Michal Kazior c8ebeda406 wpa_supplicant: Add support for VHT BSS membership selector
This allows wpa_supplicant to associate to an AP that has VHT BSS
membership selector set to indicate VHT support is required for the BSS.

Without the patch it was impossible to connect to, e.g., hostapd-based
AP that has require_vht=1. wpa_supplicant was complaining with:
  hardware does not support required rate 63.0 Mbps

Signed-hostap: Michal Kazior <michal.kazior@tieto.com>
2013-07-20 17:28:42 +03:00
Jithu Jance 3f53c006c7 nl80211: Ignore disconnect event in case of locally generated request
Previously, there could be two disconnection events in core
wpa_supplicant when going through a case of wpa_supplicant-requested
disconnection with a driver that implements SME internally. This could
result in undesired behavior when a disconnection is followed by a new
connection attempt before the extra event has been received (e.g.,
during fast reassoc or WPS provisioning). Avoid such issues by ignoring
locally generated disconnect events after requesting cfg80211 to
disconnect.

This makes the previously used ignore_next_local_disconnect more
consistent by setting the variable within
wpa_driver_nl80211_disconnect() so that both callers get the same
behavior.

Signed-hostap: Jithu Jance <jithu@broadcom.com>
2013-07-20 16:06:13 +03:00
Jouni Malinen 54d4ba427c nl80211: Silence a compiler warning with older gcc versions
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-06-30 12:54:47 +03:00
Jouni Malinen 851b0c5581 nl80211: Do not indicate P2P_DEVICE support by default
Since the P2P_DEVICE support indication was added to kernel before
everything was working properly, there may be kernel versions in use
with the new mechanism breaking P2P functionality (especially with
mac80211_hwsim). For now, disable P2P_DEVICE support by default and
allow it to be enabled with driver_param=p2p_device=1 in the
configuration file. This default behavior may be changed in the future
once the kernel issues has been resolved in stable releases.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-06-30 10:50:13 +03:00
Arend van Spriel 7940c7902e nl80211: Use wdev id when cancelling wait for frame using P2P_DEVICE
Another function that needs the wdev id when P2P management is done
using the P2P_DEVICE interface.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-30 10:50:13 +03:00
Arend van Spriel f608081c1d nl80211: Verify P2P GO/client address with all interface addresses
With P2P Device support there will be two interfaces with their
own MAC address. The P2P Interface Address must be unique so verify
it is.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-30 10:50:13 +03:00
Arend van Spriel 5fbcb45daf nl80211: Fix determining phy name for P2P Device
The phy name was determined using /sys/class/net/<ifname> but the P2P
Device is not listed there since it does not have an associated net
device. This patch changes name determination to obtain the name from
the wiphy information provide by nl80211.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-30 10:50:13 +03:00
Arend van Spriel 27ce1d64c4 nl80211: Fix nl80211_get_wiphy_index() for P2P Device
For P2P Device the netlink message should have wdev identifier
instead of the interface index. This fixes a failure which occurred
executing the P2P_GROUP_ADD command.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-30 10:50:13 +03:00
Arend van Spriel ab7a1addf2 nl80211: Fix P2P group interface creating using P2P Device
When P2P Device is used as P2P management interface the creation of the
P2P group interface fails because MAC address retrieval fails for the
P2P Device interface.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:52:58 +03:00
Arend van Spriel fa93de4059 nl80211: Use wdev_id in nl80211_create_iface_once()
For P2P an interface may be created for the P2P client/group. The
create request is done on the P2P management interface, which may
be a P2P Device interface. In that case it needs to use the wdev_id.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:51:59 +03:00
Arend van Spriel fdc554b8ae nl80211: Use wdev id to obtain P2P Device scan results
In order to get a P2P-DEVICE-FOUND event the supplicant needs to
see a peer device during SEARCH and LISTEN phase. The SEARCH
phase does a scan so obtaining the scan results for the P2P Device
interface needs to be supported, i.e., use the wdev_id.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:51:14 +03:00
Arend van Spriel 597b94f5f4 nl80211: Add .get_mac_addr() callback for P2P Device
For P2P Device the MAC address is determined upon .init2(). The
wpa_s for this interface retrieves this address in
wpa_supplicant_update_mac_addr() using the .get_mac_addr() callback.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:50:21 +03:00
Arend van Spriel 8e12685c43 nl80211: Rework setting interface mode
The function setting the interface mode also handles management
frame subscription. Rework it so subscription is done for the
P2P Device interface.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:49:16 +03:00
Arend van Spriel 91724d6faa nl80211: Introduce i802_set_iface_flags()
The driver uses linux_set_iface_flags() in several places. Introduce and
use i802_set_iface_flags() which also works for P2P Device interface.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:48:03 +03:00
Arend van Spriel eb4582f273 nl80211: Remove P2P Device interface upon .deinit()
The .deinit() closes netlink for P2P Device. Before doing that remove
the P2P Device interface that was created by wpa_supplicant.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:46:34 +03:00
Arend van Spriel f632e483b1 nl80211: Fix P2P Device interface initialization
Couple of issues upon initializing a P2P Device interface needed
to be solved.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:44:54 +03:00
Arend van Spriel e472e1b458 nl80211: Handle creation of P2P Device interface
Add specific handler for creating the P2P Device to store the wdev_id as
this type of interface does not have an interface index.

Signed-hostap: Arend van Spriel <arend@broadcom.com>
2013-06-25 13:41:55 +03:00
Johannes Berg 01517c8b30 nl80211: Allow Android P2P functionality
To support Android the kernel may have a "p2p0" netdev for a P2P Device
even though this isn't very useful, but Android requires a netdev. To
support this in the supplicant, if the interface mode is P2P_DEVICE,
re-set it to the same instead of STATION mode.

Note that this is only possible with a kernel that creates a
netdev for the P2P Device wdev.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-06-25 13:38:03 +03:00
David Spinadel 6bae92e0f2 nl80211: Add support for P2P Device in add interface
Don't try to assign ifindex for P2P Device interface.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2013-06-25 13:36:04 +03:00
David Spinadel d6dcfcdaac nl80211: Add a handler to create_interface
Add an option to pass a handler to nl80211_create_iface() and
nl80211_create_interface_once() that will be called after receiving the
message from the kernel. This handler will add the option to process the
message in different ways for different interfaces.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2013-06-25 13:35:05 +03:00
David Spinadel d3aaef8034 nl80211: Hold wdev identification for P2P Device
Add wdev_id to i802_bss. wdev_id_set indicates whether this id is
available. Use wdev_id if assigned, instead of ifindex. Use wdev_id for
events that come from the kernel to identify the relevant interface.
This commit does not assign wdev_id value for the BSS yet, i.e., this is
only preparation for the value to be used in a future commit.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2013-06-25 13:33:45 +03:00
Nirav Shah 7aad838c92 nl80211: Identify if nl80211 is capable of P2P Device abstraction
Check the supported interfaces attribute to identify support for
a dedicated P2P Device interface type. If set, update the driver
capabilities flag to notify the supplicant.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2013-06-25 13:29:48 +03:00
David Spinadel 6a71413ef2 nl80211: Rename is_p2p_interface
Rename is_p2p_interface() to is_p2p_net_interface() since it used to
identify network P2P interfaces to disable 802.11b rates on them.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
2013-06-25 13:26:17 +03:00
Michael Braun 8393e1a024 nl80211: Print interface name on set_key()
Sometimes an interface name that cannot be resolved is given to the
set_key function, so print the ifname in addition to the ifidx.

Signed-hostap: Michael Braun <michael-dev@fami-braun.de>
2013-06-25 12:25:15 +03:00
Andrei Otcheretianski 9578329874 Add AVG_RSSI report in signal_poll
Add AVG_RSSI report to the signal_poll command if it is reported by
the kernel.

Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-hostap: Ilan Peer <ilan.peer@intel.com>
2013-06-22 12:01:05 +03:00
Andrei Otcheretianski 2cc8d8f4e8 Add bandwidth and center freq info to signal_poll
Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-hostap: Ilan Peer <ilan.peer@intel.com>
2013-06-22 12:00:46 +03:00
David Spinadel 2090a0b42e nl80211: Add prints for kernel events
Add prints for kernel event, including the event ID and event string.

Signed-hostap: David Spinadel <david.spinadel@intel.com>
Signed-hostap: Ilan Peer <ilan.peer@intel.com>
2013-06-22 11:12:48 +03:00
Jouni Malinen e112764e6d nl80211: Use NL80211_ATTR_PEER_AID to set TDLS peer AID
This is needed for TDLS with VHT to allow partial AID to be set
correctly for the direct link frames. cfg80211 validation rules
prevented NL80211_ATTR_STA_AID from being used for this in set_station
case, so the new attribute is used instead.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-05-30 10:25:23 +03:00
Jouni Malinen f8a5fd4243 Synchronize with wireless-testing.git include/uapi/linux/nl80211.h
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-05-30 10:22:47 +03:00
Jouni Malinen 1ba51ec02b nl80211: Add debug print for set_supp_port operation
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-05-27 20:32:54 +03:00
Jouni Malinen add9b7a46a nl80211: Ignore deauth/disassoc event from old AP
It looks like cfg80211 can deliver a deauth/disassoc event during some
roaming cases while we are already in progress with a new
authentication/association. This happens at least with FT protocol.
Avoid issues with such disconnection event resulting in core
wpa_supplicant stopping the new connection attempt by tracking
auth/assoc BSSID more carefully within driver_nl80211.c and filtering
out events that do not apply for the current AP.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-05-27 20:10:57 +03:00
Vivek Natarajan 3c4ca36330 hostapd: Support MAC address based access control list
Enable MAC address based ACL for the drivers which advertise
this capabilty with NL80211_ATTR_MAC_ACL_MAX. Either of blacklist
or whitelist is supported, though, not simultaneously.

Signed-hostap: Vivek Natarajan <nataraja@qca.qualcomm.com>
2013-05-24 13:26:35 +03:00
Jouni Malinen 1045ec36a3 nl80211: Add couple of additional iftypes to debug prints
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-05-21 16:51:06 +03:00
Jouni Malinen ed496f131f P2P: Clean up debug prints
Replace direct wpa_msg() calls with p2p_dbg(), p2p_info(), and p2p_err()
calls that use a new debug_print() callback to handle actual debug
printing outside the P2P module.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-05-18 18:47:36 +03:00
Jouni Malinen 455299fb40 nl80211: Fix foreign address filtering for MLME frame events
Commit 97279d8d1a started filtering MLME
frame events based on Address 1 (destination) field. This works fine for
frames sent to us, but it did filter out some corner cases where we
actually want to process an event based on a frame sent by us. The main
such case is deauthentication or disassociation triggered by something
external to wpa_supplicant in the system. Fix this by accepting events
for frames where either Address 1 or 2 (transmitter) matches the
interface address.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-05-13 11:53:21 +03:00
Simon Wunderlich 695c70381f nl80211: Add driver_ops for stopping AP beaconing
This can be used to stop AP mode beaconing temporarily, e.g., in
response to a radar detected event.

This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
2013-05-09 20:06:33 +03:00
Simon Wunderlich f90e9c1c8b nl80211: Add driver_ops for starting radar detection
This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
2013-05-09 20:05:01 +03:00
Simon Wunderlich fc96522eb9 nl80211: Add channel flags for DFS state information
This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
2013-05-09 20:02:57 +03:00
Simon Wunderlich f295d0c86a nl80211: Add driver capability flag for radar detection
This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
2013-05-09 19:59:47 +03:00
Simon Wunderlich 04be54fa09 nl80211: Add driver events for radar detection
This patch is based on the original work by Boris Presman and
Victor Goldenshtein. Channel Switch Announcement support has been
removed and event handling as well as channel set handling was
changed, among various other changes.

Cc: Boris Presman <boris.presman@ti.com>
Cc: Victor Goldenshtein <victorg@ti.com>
Signed-hostap: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
2013-05-09 19:59:40 +03:00
Jouni Malinen 03565bc2d6 Synchronize with wireless-testing.git include/uapi/linux/nl80211.h
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-05-06 15:59:49 +03:00
Jouni Malinen f11b72c3e9 TDLS: Move AID=1 workaround into driver_nl80211.c
The use of AID=1 for the nl80211 dummy STA case is specific to the
driver (cfg80211), so better move this into the driver wrapper instead
of generic TDLS implementation.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-05-06 15:57:03 +03:00
Jouni Malinen 048edb1070 Revert "nl80211: Add nla_put_u32() wrapper for Android"
This reverts commit df2f9ec6b2.

The current AOSP snapshot for JB includes nla_put_u32(), so this is not
needed anymore and is also causing linking issues due to duplicated
definition.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-05-04 20:19:43 +03:00
Ilan Peer b691dcb129 nl80211: Fix max_remain_on_chan capability reading
In case that NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP is supported,
wiphy_info_handler() is called several times, where
NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION is present only in one
of these calls. Thus capa->max_remain_on_chan is overridden in
all other calls.

Fix it so the default value is set only after all the wiphy info was
received.

Signed-hostap: Ilan Peer <ilan.peer@intel.com>
2013-05-04 11:28:54 +03:00
Jouni Malinen b57b560034 wpa_supplicant: Default to nl80211 instead of wext
nl80211 has obsoleted WEXT as the preferred kernel interface for
controlling wireless drivers. Update wpa_supplicant driver interface
list order so that nl80211 gets used first if both nl80211 and wext
interfaces are included in the build. In addition, update README to
reflect the fact that WEXT is obsolete.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-04-29 16:55:44 +03:00
Jouni Malinen 5e24dc8a4b Add dup_binstr() to help common binary string tasks
There are quite a few places in the current implementation where a nul
terminated string is generated from binary data. Add a helper function
to simplify the code a bit.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-04-27 23:44:59 +03:00
Jouni Malinen e864c0aefe Use a common frequency to channel conversion function
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-04-27 22:11:51 +03:00
Jouni Malinen 97279d8d1a nl80211: Drop frame events that are for foreign address
This avoids duplicate processing of events when multiple BSSes are
configured.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-04-24 01:02:01 +03:00
Jouni Malinen cc2ada868e nl80211: Reduce debug on Probe Request frames
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-04-24 01:01:21 +03:00
Johannes Berg adc96dc2ad nl80211: Fix nla_nest_start conversion
Dmitry reported that the kernel could no longer parse the
scheduled scan attributes correctly after my patch to use
nla_nest_start/nla_nest_end. The reason is that the wrong
attribute is closed I accidentally made it close the full
scan config instead of just the SSID match set.

Reported-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-04-23 17:19:20 +03:00
Johannes Berg 8cd6b7bce8 hostapd/wpa_s: Use driver's extended capabilities
Some extended capabilities (I'm currently interested in "Operating Mode
Notification" for VHT) are implemented by the kernel driver and exported
in nl80211. Use these in hostapd/wpa_supplicant.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-03-31 21:51:44 +03:00
Johannes Berg 8970bae806 nl80211: Use nla_nest_start/end instead of nla_put_nested
Instead of allocating a new message and then moving that into
the message being built, use nla_nest_start() and put the data
into the message directly.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-03-30 20:37:44 +02:00
Jouni Malinen b92e08fc72 nl80211: Add debug prints for set_ap parameters
This makes it easier to see how exactly the driver is configured for AP
mode operations.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-03-21 15:40:25 +02:00
Johannes Berg c30a4ab045 nl80211: Fix mode settings with split wiphy dump
When the wiphy information is split, there's no guarantee that the
channels are processed before the bitrates; in fact, with the current
kernel it happens the other way around. Therefore, the mode information
isn't set up correctly and there's no 11g mode.

Fix this by doing the 11b/11g determination as part of the
postprocessing.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-03-19 02:01:46 +02:00
Jouni Malinen 565110cd55 nl80211: Include interface name in more debug prints
This makes it easier to understand how scan operations and events occur
when multiple interfaces is being controlled by a single wpa_supplicant
process.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-03-18 16:05:24 +02:00
Bruno Randolf 65d52fc103 Add capability flag for IBSS and add get_capability modes
Add a driver capability flag for drivers which support IBSS mode and set
it for nl80211 drivers which have set the NL80211_IFTYPE_ADHOC.

Add a new option "modes" to "get_capability" which will return "AP" and
"IBSS" if the corresponding capability flags are set.

The idea is that this can be used for UIs to find out if the driver
supports IBSS mode.

Signed-hostap: Bruno Randolf <br1@einfach.org>
2013-03-16 12:42:15 +02:00
Deepthi Gowri 6a1ce39599 FT: Add support for IEEE 802.11r with driver-based SME
Add NL80211_CMD_UPDATE_FT_IES to support update of FT IEs to the
WLAN driver. Add NL80211_CMD_FT_EVENT to send FT event from the
WLAN driver. This will carry the target AP's MAC address along
with the relevant Information Elements. This event is used to
report received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).

Signed-off-by: Deepthi Gowri <deepthi@codeaurora.org>
2013-03-12 20:08:53 +02:00
Johannes Berg e9ee8dc394 wpa_supplicant: Support VHT capability overrides
Add support for VHT capability overrides to allow testing connections
with a subset of the VHT capabilities that are actually supported by
the device. The only thing that isn't currently supported (by mac80211
and this code) is the RX/TX highest rate field.

Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-03-10 18:04:39 +02:00
Jouni Malinen 214a77b016 nl80211: Use helper function for phy_info_freqs()
This allows one level of indentation to be removed by using a helper
function to process each frequency.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-03-10 16:44:23 +02:00
Jouni Malinen e62a1d43f9 nl80211: Split phy_info_band() into smaller helper functions
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-03-10 16:35:23 +02:00
Jouni Malinen 3cfcad1bb1 nl80211: Use helper function for phy_info_handler()
This allows one level of indentation to be removed by using a helper
function to process each wiphy band.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-03-10 16:17:18 +02:00
Jouni Malinen 5f43910727 nl80211: Split wiphy_info_handler() into smaller helper functions
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-03-10 16:05:55 +02:00
Dennis H Jensen 4324555222 nl80211: Support splitting wiphy information in dumps
This implements support for the new NL80211_ATTR_SPLIT_WIPHY_DUMP in
nl80211 to handle wiphy information that cannot fit in one message.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-hostap: Dennis H Jensen <dennis.h.jensen@siemens.com>
2013-03-10 13:22:43 +02:00
Jouni Malinen 3b365d4e9a Synchronize with wireless-testing.git include/uapi/linux/nl80211.h
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-03-10 13:06:31 +02:00
Jouni Malinen 316a9e4d30 nl80211: Add debug print for cancel-frame-wait command
This makes it easier to interpret the logs for offloaded TX frame
operations.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-02-28 22:09:32 +02:00
Felix Fietkau c3e3a5b90c nl80211: Fix WDS STA handling with multiple BSS interfaces
The MAC address of the AP VLAN needs to be the same as the BSS that the
STA belongs to.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>
2013-02-28 16:55:13 +02:00
Srinivasan B bdaf17489a hostapd: Fix Max SP Length derivation from QoS Info
Hostapd provides QoS info of the STA (Service Period & AC mask) to the
kernel during wpa_driver_nl80211_sta_add call. Bit 5 and Bit 6 of QoS
info represents the Max SP length. Fix an issue in the code to fetch the
Max SP by shifting right the QoS info by value WMM_QOSINFO_STA_SP_SHIFT.
(operator ">" is replaced with ">>" operator).

Signed-off-by: Srinivasan <srinivasanb@posedge.com>
2013-02-16 11:15:13 +02:00
Sunil Dutt 122d16f25d nl80211: Configure STA Capabilities and Extended Capabilities
These are needed to allow drivers to implement all TDLS functionality
properly.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-02-15 23:45:48 +02:00
Jouni Malinen 542e7c406d Synchronize with wireless-testing.git include/uapi/linux/nl80211.h
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-02-15 23:45:02 +02:00
Sunil Dutt d16531c40c TDLS: Pass peer's Capability and Ext Capability info during sta_add
The contents of the peer's capability and extended capability
information is required for the driver to perform TDLS P-UAPSD and Off
Channel operations. Pass this information to the driver when the peer
station is getting added.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-02-14 21:02:34 +02:00
Jouni Malinen e4dea253b7 nl80211: Add debug prints for STA add/set operations
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-02-14 21:01:19 +02:00
Jouni Malinen cd8db7c3ba Synchronize with wireless-testing.git include/uapi/linux/nl80211.h
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-02-14 21:00:56 +02:00
Jouni Malinen c5f10e804a Use more accurate timestamps for scan results
For various P2P use cases, it is useful to have more accurate timestamp
for the peer information update. This commit improves scan result
handling by using a single timestamp that is taken immediately after
fetching the results from the driver and then using that value to
calculate the time when the driver last updated the BSS entry. In
addition, more debug information is added for P2P peer updates to be
able to clearly see how old information is being used here.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-02-12 19:14:32 +02:00
Vladimir Kondratiev ff3ad3c531 Capability matching for 60 GHz band
On the DMG (60 GHz) band, capability bits defined differently from
non-DMG ones. Adjust capability matching to cover both cases.

Also, for non-DMG bands, check ESS bit is set.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
2013-02-07 16:20:18 +02:00
Raja Mani 3140803b6d nl80211: Add ctrl_iface message for AP mode connection rejection
When AP mode operation reject the client, nl80211 layer advertises the
connect failed event with the reason for failures (for example, max
client reached, etc.) using NL80211_CMD_CONN_FAILED.

This patch adds some debug messages whenever such an event is received
from the nl80211 layer and also the same event is posted to the upper
layer via wpa_msg().

Signed-off-by: Raja Mani <rmani@qca.qualcomm.com>
2013-02-07 15:24:53 +02:00
Mark Kettenis 5f7ae5e61c Add driver for OpenBSD net80211 layer
Very basic support for OpenBSD.  No support for scanning yet, so this needs
ap_scan=0 and expects that the user has configured the interface manually
using ifconfig(8).

Signed-hostap: Mark Kettenis <kettenis@openbsd.org>
2013-02-03 21:16:29 +02:00
Jouni Malinen 9ebce9c546 nl80211: Do not use void pointer for driver_ops used internally
This allows some more pointer type validation at compile time.

Signed-hostap: Jouni Malinen <j@w1.fi>
2013-02-03 15:46:47 +02:00
Ben Greear 085b29f1fe hostapd: Fix crash when scan fails
When scan failed, the wpa_driver_nl80211_scan method tried
to recursively call itself, but it passed in the wrong argument
for the void*, and so then it crashed accessing bad memory.

With this fix, hostapd still will not retry the scan later, but
at least it will exit cleanly and won't polute the file system
with core files.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2013-02-03 13:51:54 +02:00
Jouni Malinen 8b706a99b8 nl80211: Add MFP information for NL80211_CMD_CONNECT
This was previously included only with NL80211_CMD_ASSOCIATE, but the
information is as useful (if not even more useful) for
NL80211_CMD_CONNECT. It should be noted that cfg80211 does not yet use
this attribute with NL80211_CMD_CONNECT, but that can be added easily.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-01-12 17:51:54 +02:00
Johannes Berg 05a8d4221d nl80211: Pass station VHT capabilities to kernel
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-01-12 17:51:52 +02:00
Johannes Berg a9a1d0f08a hostapd: Pass VHT capabilities to driver wrapper
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-01-12 17:51:52 +02:00
Johannes Berg 89b800d726 nl80211: Support VHT configuration
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-12 17:51:52 +02:00
Jouni Malinen ebeca8e3d1 Sync with linux/nl80211.h in wireless-testing.git
Signed-hostap: Jouni Malinen <j@w1.fi>
2013-01-12 17:51:52 +02:00
Johannes Berg fa4763369a hostapd: Allow configuring driver to VHT
Signed-hostap: Johannes Berg <johannes.berg@intel.com>
2013-01-12 17:51:52 +02:00
Jouni Malinen 708bc8e0e4 nl80211: Restore previous nlmode if set_freq for AP mode fails
wpa_driver_nl80211_ap() returned error if set_freq failed, but left the
previously set nlmode to GO/AP. While this should not be issue for most
purposes, it leaves the interface in somewhat unexpected state and could
potentially affect operations prior to next connection attempt. Address
this by restoring the previous nlmode if AP mode cannot be started for
some reason.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2013-01-08 00:34:08 +02:00
Baruch Siach 50d405ec87 atheros: Release sock_raw and reset appfilter on hapd_init failure
Signed-hostap: Baruch Siach <baruch@tkos.co.il>
2012-12-25 13:50:41 +02:00
Yoni Divinsky 3dfd0484fc P2P: Consider age for the P2P scan results
cfg80211 caches the scan results according the channel number. Due to
the 15 sec aging this might cause the user mode to see more than one
scan result with the same BSSID, e.g. - one scan result for the
P2P Device and one for the P2P GO (once it's enabled).

Fix this by updating the device entry only if the new peer entry is
newer than the one previously stored.

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Igal Chernobelsky <igalc@ti.com>
Signed-hostap: Arik Nemtsov <arik@wizery.com>
2012-12-25 11:22:42 +02:00
Sven Eckelmann a5e1eb2092 nl80211: Run TKIP countermeasures in correct hostapd_data context
hostapd can run with different VIF when using nl80211. Events about MIC
failures have to be processed in context of the VIF which received it
and not in context of the primary VIF. Otherwise the station belonging
to this VIF may not be found in the primary VIF station hash and
therefore no countermeasures are started or the countermeasures are
started for the wrong VIF.

Signed-hostap: Sven Eckelmann <sven@open-mesh.com>
Signed-hostap: Simon Wunderlich <simon@open-mesh.com>
2012-12-22 16:19:52 +02:00
Vladimir Kondratiev 7829894c21 Introduce 60 GHz band
Basic support for the 60 GHz band. Neither P2P nor WPS are yet taken
care off. Allows to start AP with very simple config:

network={
        ssid="test"
        mode=2
        frequency=60480
        key_mgmt=NONE
}

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-12-18 11:50:35 +02:00
Jouni Malinen ad3872a372 WNM: Use CONFIG_WNM more consistently
Replace CONFIG_IEEE80211V with CONFIG_WNM to get more consistent build
options for WNM-Sleep Mode operations. Previously it was possible to
define CONFIG_IEEE80211V without CONFIG_WNM which would break the build.
In addition, IEEE 802.11v has been merged into IEEE Std 802.11-2012 and
WNM is a better term to use for this new functionality anyway.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-12-16 18:22:54 +02:00
Jouni Malinen bd896433af nl80211: Register to process WNM-Sleep Mode Response frames
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-12-16 12:42:26 +02:00
Amitkumar Karwar 368b1957a6 Allow OBSS scan and 20/40 coex reports to non-SME drivers
We enable this feature for non-SME drivers as well if
they explicitly indicate need for it.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
2012-11-24 18:08:48 +02:00
Jouni Malinen 3d83a6b9b6 Sync with linux/nl80211.h in wireless-testing.git
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-11-24 18:04:55 +02:00
Pontus Fuchs fb660a9431 Do not double free cfg struct if netlink_init() fails
If netlink_init() fails on socket create or bind the cfg struct
provided as parameter is freed by netlink_init(). Callers of
netlink_init() also free this struct on their error paths leading
to double free.

Signed-hostap: Pontus Fuchs <pontus.fuchs@gmail.com>
2012-11-24 16:47:20 +02:00
Jouni Malinen 6201b052c8 nl80211: Add support for TDLS request event from the driver
The NL80211_CMD_TDLS_OPER command can be used as an event based on a
recent cfg80211 commit, so add code to map that to internal
wpa_supplicant event to request TDLS link setup/teardown.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-11-19 17:00:07 +02:00
Jouni Malinen 1ce0aa044c Remove unused disassociate() driver_ops
Commits 07783eaaa0 and
3da372fae8 removed the only users of the
disassociate() driver operation, so these driver wrapper functions can
also be removed now.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-11-15 00:06:12 +02:00
Jouni Malinen 9d7a63dc20 nl80211: Avoid strict-aliasing warning with gcc 4.7
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-11-11 20:28:27 +02:00
Christopher Wiley a8c5b43ad3 nl80211: Roam correctly through cfg80211 without SME
Change the nl80211 driver in wpa_supplicant to correctly handle
connecting to a new AP through cfg80211 without SME capability. As
before, the driver will disconnect from the previously associated AP,
but now we attempt to immediately connect to our intended AP. This
prevents us from blacklisting the AP we were trying to connect to
because of a semantic mismatch between cfg80211 and wpa_supplicant. The
disconnect/connect patch generates a local disconnect nl80211 event
which we discard because we're already correctly tracking the pending
association request.

In detail:

cfg80211 does not support connecting to a new BSS while already
connected to another BSS, if the underlying driver doesn't support
separate authenticate and associate commands. wpa_supplicant is written
to expect that this is a supported operation, except for a little error
handling that disconnects from the current BSS when roaming fails and
relies on autoconnect logic to reconnect later. However, this failure to
connect is incorrectly attributed to the new AP we attempted to
associate with, rather than a local condition in cfg80211.

The combined effect of these two conditions is that full-mac drivers
accessible through cfg80211 but without SME capability take a long time
to roam across BSS's because wpa_supplicant will:
1) Fail to associate for local reasons
2) Disconnect and return that the association request failed
3) Blacklist the association target (incorrectly)
4) Do a scan
5) Pick a less desirable AP to associate with

Signed-hostap: Christoper Wiley <wiley@chromium.org>
2012-11-11 16:15:29 +02:00
Baruch Siach b49019dd3d atheros: Remove redundant l2_packet_get_own_addr call
Commit deca6eff74 added a redundant call
to l2_packet_get_own_addr. Use the information we already have in
atheros_init.

Signed-hostap: Baruch Siach <baruch@tkos.co.il>
2012-11-11 16:07:28 +02:00
Jouni Malinen 7d81932d27 nl80211: Make debug log more readable for driver events
Print the full name of the nl80211 event message in the debug log to
make it easier to parse the debug log.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-11-03 13:54:43 +02:00
Jouni Malinen 04a3e69dd1 P2P: Allow all channels with multi-channel concurrency
If the driver indicates support for multi-channel concurrency, change
the p2p_connect behavior to not force the current operating channel, but
instead, just mark it as preferred for GO Negotiation. This change
applies only for the case when the freq parameter is not used with the
p2p_connect command.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-10-26 18:10:46 +03:00
Jouni Malinen 569fed9045 nl80211: Add support for SAE operations
This uses the recent cfg80211 changes to allow SAE authentication to be
implemented with the nl80211 driver interface.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-10-24 09:10:42 +03:00
Jouni Malinen 516059c753 Sync with linux/nl80211.h in wireless-testing.git
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-10-24 09:08:38 +03:00
Vladimir Kondratiev c097652828 60 GHz: Fix error while processing scan results
Channel frequency for 60 GHz band do not fit into 'short int', as was
used. Expand it to 'int'

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-10-04 16:32:23 +03:00
Jouni Malinen 369c8d7bcd Reserve AKM and cipher suite values
These values are used with WAPI and CCX and reserving the definitions
here reduces the number of merge conflicts with repositories that
include these functions.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-09-30 20:26:55 +03:00
Jouni Malinen c10347f246 Add initial parts for SAE
This introduces new AKM for SAE and FT-SAE and adds the initial parts
for going through the SAE Authentication frame exchange. The actual SAE
algorithm and new fields in Authentication frames are not yet included
in this commit and will be added separately. This version is able to
complete a dummy authentication with the correct authentication
algorithm and transaction values to allow cfg80211/mac80211 drivers to
be tested (all the missing parts can be handled with
hostapd/wpa_supplicant changes).

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-09-30 19:51:07 +03:00
Jouni Malinen 905029097c Sync with linux/nl80211.h in wireless-testing.git
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-09-30 10:49:46 +03:00
Mykyta Iziumtsev 817762d9c4 nl80211: Don't send BSSID with disconnect command
NL80211_CMD_DISCONNECT doesn't need BSSID, because cfg80211
uses locally saved value.

Signed-hostap: Mykyta Iziumtsev <mykyta.iziumtsev@gmail.com>
2012-09-29 19:01:50 +03:00
Felix Fietkau 73a3c6ffca nl80211: Use the monitor interface if socket tx status is not supported
Fixes hostapd on recent compat-wireless builds with older kernels.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>
2012-09-23 13:28:31 +03:00
Felix Fietkau 92d521d89c hostapd: Send EAPOL frames from the VO queue if WMM is active
This avoids extra latency caused by establishing an aggregation session
and makes the initial connection attempt more reliable

Signed-hostap: Felix Fietkau <nbd@openwrt.org>
2012-09-15 22:40:00 -07:00
Felix Fietkau c34e618d47 hostapd: Fix WDS VLAN bridge handling
This patch fixes an issue where removing a WDS VLAN interface also
removed the main AP interface from the same bridge.

Signed-hostap: Felix Fietkau <nbd@openwrt.org>
2012-09-15 22:38:14 -07:00
Baruch Siach ac947e2a83 atheros: Fix RSN capabilities debug print
Signed-hostap: Baruch Siach <baruch@tkos.co.il>
2012-09-05 19:01:11 +03:00
Jouni Malinen d732463c47 nl80211: Register read_sta_data() handler for station only builds
This driver_op can now be used in station mode, too, to fetch
information about the connection with the AP, so allow this to be used
even if wpa_supplicant is built without AP mode support.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-09-05 17:07:03 +03:00
Yuhao Zheng dc7785f845 wpa_supplicant: Add PKTCNT_POLL command to get TX/RX packet counters
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2012-09-05 17:02:02 +03:00
Jouni Malinen eb7719ff22 Add support for using GCMP cipher from IEEE 802.11ad
This allows both hostapd and wpa_supplicant to be used to derive and
configure keys for GCMP. This is quite similar to CCMP key
configuration, but a different cipher suite and somewhat different rules
are used in cipher selection. It should be noted that GCMP is not
included in default parameters at least for now, so explicit
pairwise/group configuration is needed to enable it. This may change in
the future to allow GCMP to be selected automatically in cases where
CCMP could have been used.

This commit does not included changes to WPS or P2P to allow GCMP to be
used.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-08-29 11:52:15 +03:00
Wei-Jen Lin e3e234fa35 nl80211: Set P2P multichan concurrency based on interface combinations
Use the NL80211_IFACE_COMB_NUM_CHANNELS value > 1 as a trigger for
enabling support for P2P multichannel channel concurrency. This does not
handle all possible details of enforcing driver capabilities, but it is
a good first step for allowing nl80211 drivers to enable multichannel
concurrency.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-08-28 19:31:58 +03:00
Jouni Malinen 1e05192eec test: Fix driver data pointer for the P2P commands
The driver_test.c data structures had been changed to use a separate
BSS structure, but the P2P commands were not using the new design.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-08-24 20:44:24 +03:00
Jouni Malinen 37448ede31 P2P: Add option for adding extra delay to p2p_find
A new optional delay=<search delay in milliseconds> parameter can now be
used with p2p_find command to request an extra delay between search
iterations. This can be used, e.g., to make p2p_find friendlier to
concurrent operations by avoiding it from taking 100% of the radio
resources.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
2012-08-23 18:20:58 +03:00
Jouni Malinen 75227f3ada nl80211: Print an error if WDS STA interface cannot be set up
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-19 18:28:55 +03:00
Dan Williams e7ecddf33a build: Use updated libnl3 header paths
libnl3's headers live in /usr/include/libnl3 for some time now.

Signed-hostap: Dan Williams <dcbw@redhat.com>
2012-08-15 20:44:33 +03:00
Jouni Malinen 067ffa2696 Convert os_realloc() for an array to use os_realloc_array()
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-13 21:21:23 +03:00
Jouni Malinen f9884c096a Convert os_zalloc() for an array to use os_calloc()
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-13 20:44:21 +03:00
Michael Braun 03a6a2e972 Add option to use netlink to create and remove VLAN interfaces
CONFIG_VLAN_NETLINK=y build option can now be used to replace the
ioctl()-based interface for creating and removing VLAN interfaces
with netlink-based interface.

Signed-hostap: M. Braun <michael-dev@fami-braun.de>
2012-08-10 14:09:05 +03:00
Jouni Malinen 1d0c6fb1eb nl80211: Fix re-enabling of 802.11b rates after P2P use
Commit a11241fa11 removed the 802.11b rate
enabling/disabling code from wpa_driver_nl80211_set_mode() and while
doing that, removed the only place where drv->disabled_11b_rates was
set. Fix this by updating the flag in nl80211_disable_11b_rates(). In
addition, re-enable the 802.11b rates when changing to non-P2P mode.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-10 11:48:57 +03:00
Rajkumar Manoharan edb9bfba89 nl80211: Disable 11b rates on configuring P2P interface
Right now 11b rates are masked out while creating a P2P interface,
but this is always failing as the interface is down. Most drivers
allow to configure rates only when the interface is UP and running.
So let us disable 11b rates when interface type is changed into a
P2P type and it is UP and running.

Signed-hostap: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
2012-08-10 11:35:33 +03:00
Jouni Malinen d99619b243 Sync with linux/nl80211.h in wireless-testing.git
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-10 11:21:16 +03:00
Jouni Malinen df2f9ec6b2 nl80211: Add nla_put_u32() wrapper for Android
The system/core/libnl_2 re-implementation in AOSP does not include
nla_put_u32().

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-09 18:45:39 +03:00
Jouni Malinen 95ac3bf49f nl80211: Share common function for scan parameters
trigger_scan and start_sched_scan can share code for building the
common attributes.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-07 17:48:52 +03:00
Jouni Malinen f0494d0f95 nl80211: Check nla_put_nested() return value and handle errors
Couple of functions did not verify that nla_put_nested() succeeded. Fix
these by checking the return value and handling error cases cleanly.

Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-07 17:27:55 +03:00
Jouni Malinen 6afbc3d698 nl80211: Fix netlink error paths in sched_scan() handler
Signed-hostap: Jouni Malinen <j@w1.fi>
2012-08-07 17:11:08 +03:00
Ben Greear addde1399e Better logging for ioctl set flags failure
Let user know if the call failed setting interface up vs. down.

Signed-hostap: Ben Greear <greearb@candelatech.com>
2012-08-04 20:41:35 +03:00
Paul Stewart 21270bb4b3 Fix a couple memory leaks
Found using valgrind.

Signed-hostap: Paul Stewart <pstew@chromium.org>
2012-08-04 20:10:08 +03:00