Commit graph

3192 commits

Author SHA1 Message Date
Jay Katabathuni 1d21e9dd5a Interworking: Fix Advertisement Protocol element length limit
The Query Response Length Limit is not allowed to be zero when
this is sent by the AP. Use 0x7F to indicate that the limit is
based on maximum number of GAS fragments.
2011-10-25 11:31:21 +03:00
Jithu Jance c9aab27406 P2P: Append P2P Device Address to AP-STA-CONNECTED event
For P2P, the p2p_connect takes in device address argument to make a
connection. However the connected event AP-STA-CONNECTED comes with
interface address. The application listening on events would find it
difficult to map interface address to the p2p device address which is
provided for connection.

Append P2P Device Address to AP-STA-CONNECTED event for P2P Client
connection. This will help applications to easily map the P2P Interface
Address to P2P Device Address on CONNECTED event. For non-P2P case, it
will just print the usual STA MAC address alone.

Signed-off-by: Jithu Jance <jithu@broadcom.com>
2011-10-25 00:13:03 +03:00
Jithu Jance 5cbd88d921 P2P: Fix wpa_supplicant crash on P2P WPS PBC overlap case
Once PBC overlap detected when using dynamic group interfaces, the wpa_s
corresponding to P2P group interface is freed. This patch avoids
accessing the wpa_s data structure after it is freed. This fixes a
possible crash in P2P client role in such a case.
2011-10-24 23:37:39 +03:00
Jouni Malinen acc247b260 P2P: Advertise Persistent Reconnect group capability
The persistent_reconnect configuration parameter was used to decide
whether to accept invitation to re-establish a persistent group.
However, this was not being advertised in the Group Capability bitmap.
Add the Persistent Reconnect bit based on this configuration to GO
Negotiation frames and Beacon/Probe Response frames from the GO.
2011-10-24 17:29:37 +03:00
Arik Nemtsov ccc12d7841 TDLS: Make use of wpa_tdls_add_peer to avoid code duplication
Use the wpa_tdls_add_peer function to allocate TDLS peer structures.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:20:58 +03:00
Arik Nemtsov 2d565a61f2 TDLS: Support mgmt-frame Tx for ctrl-iface operations
Use capability information to decide whether to perform a given TDLS
operation internally or through mgmt-frame Tx.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:20:43 +03:00
Arik Nemtsov 45b722f150 TDLS: Add peer as a STA during link setup
Before commencing setup, add a new STA entry to the driver representing
the peer. Later during setup, update the STA entry using information
received from the peer.

Extend sta_add() callback for adding/modifying a TDLS peer entry and
connect it to the TDLS state machine. Implement this callback for the
nl80211 driver and send peer information to kernel.

Mark TDLS peer entries with a new flag and translate it to a
corresponding nl80211 flag in the nl80211 driver.

In addition, correct TDLS related documentation in the wpa_driver_ops
structure.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:19:35 +03:00
Arik Nemtsov 979bcccf64 TDLS: Collect peer capabilities and supp-rates during link setup
Record the capabilities and supported rates of the TDLS peer during
link setup. These are given in the IEs passed in Setup Request and
Setup Response frames.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:19:13 +03:00
Arik Nemtsov 8f15f711c5 TDLS: Implement low-ack event for lost TDLS peers
Disable the direct connection when a TDLS peer stops responding
to packets, as indicated by the "LOW ACK" event coming from a driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:19:08 +03:00
Arik Nemtsov 7a1486cd31 TDLS: Support sending TDLS discovery requests
Allow sending a TDLS discovery request as a frame through the driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:19:05 +03:00
Arik Nemtsov 7de27409a2 TDLS: Support sending a teardown frame from usermode
When a driver does not implement the TDLS_TEARDOWN operation internally,
send an explicit TDLS link teardown frame to the driver.

Change all teardown calls to use these calling semantics.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:18:49 +03:00
Arik Nemtsov 35287637cc TDLS/nl80211: Support receiving TDLS discovery response frames
Register for the TDLS discovery response public action frame in nl80211.
Print out a debug message when a Discovery Resp frame is received and
validated.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:18:35 +03:00
Arik Nemtsov 4d0d6b37f9 TDLS: Process discovery requests and send discovery responses
When a discovery request is received, add the peer to the TDLS peer
cache and send a response containing minimal data. Mandatory IEs in
the discovery response frame will be filled out by the driver.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:18:27 +03:00
Arik Nemtsov c58ab8f249 TDLS: Get TDLS related capabilities from driver
Put glue code in place to propagate TDLS related driver capabilities to
the TDLS state machine.

If the driver doesn't support capabilities, assume TDLS is supported
internally.

When TDLS is explicitly not supported, disable all user facing TDLS
operations.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:15:15 +03:00
Arik Nemtsov 03ea178603 nl80211: Implement TDLS callback functions and propagate capabilities
Allow passing high-level TDLS commands and TDLS frames to kernel
via new nl80211 commands.

Propagate TDLS related nl80211 capability flags from kernel and add them
as driver capability flags.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:15:05 +03:00
Arik Nemtsov 568526f1ea TDLS: Use a valid dialog-token in a setup request
A zero dialog-token is considered invalid by IEEE Std 802.11z-2010.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:14:42 +03:00
Arik Nemtsov ba3936d990 TDLS: Support setting CONFIG_TDLS_TESTING in .config
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Cc: Kalyan C Gaddam <chakkal@iit.edu>
2011-10-23 22:14:31 +03:00
Jouni Malinen 8c66e18511 nl80211: Handle special TDLS direct link key index use
An ugly hack is currently used to indicate keys for TDLS direct link:
key_idx == -1. That needs to be converted to 0 for cfg80211 to accept
the key.
2011-10-23 22:14:05 +03:00
Jouni Malinen 8bdedb579a hwsim_test: Fix silly bug in select() result processing 2011-10-23 22:14:04 +03:00
Jouni Malinen 33d8a77a39 Remove incorrect statement about get_hw_feature_data() driver_ops
This function is actually needed for quite a bit more than just
user space MLME implementation. The old comment here has not been
accurate for a long time, so get rid of it.
2011-10-23 20:09:40 +03:00
Jouni Malinen edc3a7c414 Remove unused driver_ops client MLME functions
These driver_ops functions set_channel, set_ssid, set_bssid,
mlme_add_sta, and mlme_remove_sta were used with the user space
MLME implementation in wpa_supplicant. That was only for testing
purposes and was removed, but these driver_ops were forgotten.
Remove them now to remove confusing driver_ops definitions.
2011-10-23 20:07:57 +03:00
Christian Lamparter e1e8cae3c7 wpa_supplicant: Check rate sets before joining BSS
IEEE Std 802.11-2007 7.3.2.2 demands that in order to join a BSS all
required basic rates have to be supported by the hardware.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
2011-10-23 17:21:50 +03:00
Christian Lamparter 6bf731e8ce wpa_supplicant: Unify hardware feature data
The hardware feature data is required in several different places
throughout the code. Previously, the data was acquired and freed on
demand, but with this patch wpa_supplicant will keep a single copy
around at runtime for everyone to use.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
2011-10-23 17:21:50 +03:00
Jouni Malinen e3b473eb4e Allow driver wrappers to indicate whether HT info is known
This is needed to be able to figure out whether the driver is known
not to support HT.
2011-10-23 17:21:39 +03:00
Jouni Malinen 7756114f6a Postpone global_init() call until first driver instance is initialized
This avoids allocating global driver state for driver wrappers that
are built in but not used. This can save some resources and avoids
failures with driver_nl80211.c that is now initializing netlink
connections for nl80211 in global_init().
2011-10-23 13:20:52 +03:00
Jouni Malinen 3803bd331d TLS: Validate RSA ClientKeyExchange length field
Instead of using implicit length based on the received buffer, validate
RSA ClientKeyExchange based on the explicit length field.
2011-10-23 13:04:32 +03:00
Jouni Malinen 46eeedac61 Remove unused variables 2011-10-23 12:42:55 +03:00
Grant Erickson 80267c9cec dbus: Removed unused local variable
Signed-off-by: Grant Erickson <marathon96@gmail.com>
2011-10-23 12:36:04 +03:00
Jouni Malinen 2683690d91 Fix hostapd_wpa_auth_send_ether() return value
This was not currently used for anything, but better return the correct
value instead of hardcoded -1.
2011-10-23 12:33:17 +03:00
Jouni Malinen b832d34c48 Comment out scard initialization code if PCSC_FUNCS is not set 2011-10-23 12:24:36 +03:00
Jouni Malinen fe4c43ce95 Remove unused variable from os_gmtime() 2011-10-23 12:22:40 +03:00
Jouni Malinen bd2df8921b nl80211: Remove some unnecessary ifdef HOSTAPD blocks 2011-10-22 22:51:49 +03:00
Jouni Malinen 17fbb751e1 Remove user space client MLME
This code was used only with driver_test.c to allow MLME operations
in hostapd to be tested without having to use a real radio. There
are no plans on extending this to any other use than testing and
mac80211_hwsim has now obsoled the need for this type of testing.
As such, we can drop this code from wpa_supplicant to clean up the
implementation of unnecessary complexity.
2011-10-22 22:45:38 +03:00
Andrii Bordunov 745e8aba69 Add CONFIG_WPS_REG_DISABLE_OPEN to defconfig 2011-10-22 22:24:34 +03:00
Andrii Bordunov 2c4f80d519 WPS: Use ifdef blocks consistently for CONFIG_WPS_REG_DISABLE_OPEN
The registrar variable is used only if this macro is defined, so no
need to set it otherwise.
2011-10-22 22:21:53 +03:00
Andrii Bordunov d5695081c2 wpa_priv: Link in trace.o to fix CONFIG_WPA_TRACE build 2011-10-22 22:18:54 +03:00
Jouni Malinen 8d2639127f wpa_priv: Link in ieee802_11_common.o if driver_nl80211 is used 2011-10-22 22:17:41 +03:00
Andrii Bordunov f7fcfc347c wpa_priv: Update function arguments to fix compilation 2011-10-22 22:11:40 +03:00
Jouni Malinen 9e0e6902a2 Share a single wpa_scan_results_free() implementation
There is not really a very good location for this anywhere, but the
function is small enough to live as an inline function for now.
2011-10-22 22:09:40 +03:00
Andrii Bordunov d01b205378 Remove unused variable and function 2011-10-22 21:59:17 +03:00
Ben Greear f935bd4dc5 Fix typo in comment related to EAPOL
Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-10-22 21:41:09 +03:00
Ben Greear c81eff1a61 nl80211: Use one global ioctl socket
Saves sockets when using multiple VIFS in a single
wpa_supplicant process.

Signed-off-by: Ben Greear <greearb@candelatech.com>
2011-10-22 21:39:42 +03:00
Ben Greear 276e2d671c nl80211: Use a global netlink command object
Netlink sockets can be shared among all driver instances, saving
sockets and memory when using multiple interfaces in a single process.
2011-10-22 20:06:32 +03:00
Ben Greear 2a7b66f574 nl80211: Use global nl_cb template
All interfaces can share a single nl_cb template.
2011-10-22 20:06:30 +03:00
Ben Greear dac12351d8 nl80211: Clean up error path in wpa_driver_nl80211_init
No need to duplicate the deinit code since wpa_driver_nl80211_deinit()
can be used here to clean up after a failure.
2011-10-22 18:28:06 +03:00
Johannes Berg a92dfde818 nl80211: Abstract handle/cache (de)allocation
This is a cleanup now and makes it easier to add more sockets in the
future.
2011-10-22 16:56:43 +03:00
Johannes Berg 7635bfb071 nl80211: Fix hostapd error path
i802_init() tries to clean up everything manually, call
wpa_driver_nl80211_deinit() instead and also handle the
EAPOL socket properly.
2011-10-22 13:04:47 +03:00
Ben Greear 36d84860bb nl80211: Use global netlink rtm event object
Netlink sockets can be shared among all driver instances, saving lots
of sockets, spurious log messages, memory, and CPU usage when using
multiple interfaces in a single process.
2011-10-22 12:39:05 +03:00
Jouni Malinen 4b24282a17 hostapd: Call global_init/global_deinit driver_ops
Now both wpa_supplicant and hostapd allow the driver wrappers to use the
global context similarly.
2011-10-22 12:22:59 +03:00
Jouni Malinen 9fb0407055 nl80211: Use a wrapper for genlmsg_put
This reduces the code size by a kilobyte or so and makes it easier
to replace the netlink instances to be shared among interfaces.
2011-10-22 11:29:03 +03:00