path: root/src/drivers/driver_wext.c
Commit message (Collapse)AuthorAgeFilesLines
* Android: wext: Add sched_scan functions for PNODmitry Shmidt2011-11-291-0/+133
| | | | | | | (jm: This is based on the Android change that used driver_cmd. The same implementation is used for the actual driver interface, but the commands are now accessed through sched_scan/stop_sched_scan driver_ops instead of driver_cmd)
* Android: wext: Add driver state eventsDmitry Shmidt2011-11-291-0/+11
* WEXT: Use linux/wireless.h instead of wireless_copy.hJouni Malinen2011-11-151-1/+1
| | | | | | | | WEXT is not really changing anymore and more or less all Linux distros come with linux/wireless.h that is recent enough to allow the driver wrappers to be build. Signed-hostap: Jouni Malinen <j@w1.fi>
* wext: Do not set SSID on disconnect on AndroidDmitry Shmidt2011-10-211-0/+4
| | | | | Some drivers seem to try to associate using the random SSID, so do not use this hack on Android.
* wext: Clean up the disconnect BSSID/SSID clearingJouni Malinen2011-10-211-11/+16
* wext: Remove trailing whitespaceJouni Malinen2011-10-211-1/+1
* wext: Increase scan timeout from 5 to 10 secondsJouni Malinen2011-10-181-1/+1
| | | | | | Some dualband cards can use more than five seconds to run through a full scan, so increase the timeout to avoid hitting the missing scan completed event workaround.
* wext: Remove write-only variable ap_numPavel Roskin2011-09-211-2/+1
| | | | Signed-off-by: Pavel Roskin <proski@gnu.org>
* Use set_key addr to distinguish default and multicast keysJouni Malinen2011-01-091-2/+1
| | | | | | | | Previously, both NULL and ff:ff:ff:ff:ff:ff addr were used in various places to indicate default/broadcast keys. Make this more consistent and useful by defining NULL to mean default key (i.e., used both for unicast and broadcast) and ff:ff:ff:ff:ff:ff to indicate broadcast key (i.e., used only with broadcast).
* Enable sharing of scan result events among virtual interfacesBen Greear2010-11-261-0/+44
| | | | | | | | | | | When controlling multiple virtual interfaces on the same physical radio, share the scan results events with sibling interfaces. This decreases the time it takes to connect many virtual interfaces. This is currently only supported on Linux with cfg80211-based drivers when using nl80211 or wext driver interface. Signed-off-by: Ben Greear <greearb@candelatech.com>
* wext: Fix scan result signal levels when driver reports in dBmDavid A Benjamin2010-10-041-2/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | wpa_supplicant showed signal levels incorrectly with some drivers: Jun 6 16:29:36 rupert wpa_supplicant[18945]: Current BSS: 00:0d:97:11:40:d6 level=190 Jun 6 16:29:36 rupert wpa_supplicant[18945]: Selected BSS: 00:0d:97:11:50:09 level=192 Judging from output from other tools (iwlist) and the min_diff block at the end of wpa_supplicant_need_to_roam, it seems these values should actually be negative. Specifically, if one treats that number as a signed char instead of unsigned, everything matches up. To be honest, I've little to no understanding of wireless, but looking at the source code for wireless-tools (iw_print_stats in iwlib.c), it seems that the fields of the iw_quality struct need to be decoded differently depending on various flags. I guess src/drivers/driver_wext.c should have similar logic in wext_get_scan_qual. I wrote a patch that attempts to replicate some of that logic, although it may be more complicated than is necessary; I think some of the complexity is for backwards-compatibility, which might not be necessary depending on wpa_supplicant's dependencies? In any case, it is attached. Again, I don't know how any of this works, so it's likely the patch is a bit off. But I think at least the logic to determine min_diff in wpa_supplicant_need_to_roam would be more accurate if level were determined correctly.
* rfkill: Use rtnetlink ifup/ifdown eventsJouni Malinen2010-05-311-3/+19
| | | | | | | | | | | Replace use of rfkill block event with rtnetlink ifdown. This makes the design more robust since the rfkill event could have been for another interface while the rtnetlink events are already filtered based of ifindex. In addition, the new design handles other than rfkill-triggered ifdown/ifup events, too. rfkill unblocked event is still needed to try to set the interface back up. If the unblock was for another interface, ifup will fail and the driver state is not changed.
* Fix memory leak on rfkill init error pathJouni Malinen2010-05-251-1/+3
* Add Linux rfkill supportJouni Malinen2010-05-231-2/+61
| | | | | | | | | | | Add a new wpa_supplicant state: interface disabled. This can be used to allow wpa_supplicant to be running with the network interface even when the driver does not actually allow any radio operations (e.g., due to rfkill). Allow driver_nl80211.c and driver_wext.c to start while rfkill is in blocked state (i.e., when ifconfig up fails) and process rfkill events to block/unblock WLAN.
* wext: Add cfg80211-specific optimization to avoid silly behaviorJouni Malinen2010-01-121-3/+37
| | | | | | | | | | | If the driver is detected to use cfg80211, we can rely on it being able to disconnect with SIOCSIWMLME commands and to use empty SSID as a way to stop it from associating when we are in progress of configuring the driver for association. Consequently, we can remove the hack that uses random 32-octet SSID to force disconnection and re-order association commands to match the expectations that cfg80211 has for WEXT ioctls. This gets rid of extra scan rounds and attempts to associate with the silly 32-octet SSID.
* wext: Check hexstr2bin() return value in custom scan text processingJouni Malinen2010-01-101-3/+8
* WEXT: Show BSSID/SSID set failures on disconnect in debug logJouni Malinen2010-01-101-3/+5
* wext: Check hexstr2bin() return valueJouni Malinen2010-01-101-5/+5
* Share a single Linux ioctl helper fo setting interface up/downJouni Malinen2010-01-031-93/+6
| | | | | | Number of Linux driver wrappers included this more or less identical function, so lets add a new helper file to be able to share some more code between the driver wrappers.
* Standardize on a single definition of auth_alg bitfield valuesJouni Malinen2010-01-031-5/+5
* Use generic driver event notification for AP mode assoc/disassocJouni Malinen2010-01-031-14/+15
* nl80211/wext: Hardcode all auth_algs as supportedJouni Malinen2010-01-011-0/+3
| | | | | | There does not seem to be a driver interface for fetching auth_algs capability, but this may be used by some external application, so hardcode all auth_algs as supported for now.
* Get rid of unnecessary typedefs for enums.Jouni Malinen2009-12-261-2/+2
* netlink: Move more of the newlink/dellink parsing into shared codeJouni Malinen2009-12-181-47/+17
* nl80211/wext: Share netlink new/del link event receive codeJouni Malinen2009-12-181-113/+37
* driver_nl80211/wext: Share netlink operstate send functionJouni Malinen2009-12-181-68/+12
| | | | | | As an initial step in sharing netlink helper functions among driver wrappers, create a new file for netlink code and move operstate send function there.
* Fix netlink payload length calculationJouni Malinen2009-12-181-3/+3
| | | | nlmsghdr length needs to be removed from payload length. [Bug 341]
* Remove src/common from default header file pathJouni Malinen2009-11-291-2/+2
| | | | | | | | | | This makes it clearer which files are including header from src/common. Some of these cases should probably be cleaned up in the future not to do that. In addition, src/common/nl80211_copy.h and wireless_copy.h were moved into src/drivers since they are only used by driver wrappers and do not need to live in src/common.
* Remove deprecated scan and set_probe_req_ie driver_opsJouni Malinen2009-11-231-6/+5
| | | | | These have been replaced with scan2 driver_ops that provides all parameters in a single call.
* Remove deprecated driver_ops handlersJouni Malinen2009-11-231-14/+13
| | | | | | This gets rid of previously deprecated driver_ops handlers set_wpa, set_drop_unencrypted, set_auth_alg, set_mode. The same functionality can be achieved by using the init/deinit/associate handlers.
* Merge set_key and hapd_set_key driver_ops into a single functionJouni Malinen2009-11-231-1/+1
* Work around some gcc 4.4 strict-aliasing warningsJouni Malinen2009-11-041-2/+3
| | | | | | | | | | gcc 4.4 ends up generating strict-aliasing warnings about some very common networking socket uses that do not really result in a real problem and cannot be easily avoided with union-based type-punning due to struct definitions including another struct in system header files. To avoid having to fully disable strict-aliasing warnings, provide a mechanism to hide the typecast from aliasing for now. A cleaner solution will hopefully be found in the future to handle these cases.
* wext: disconnect at init and deinitDan Williams2009-05-271-2/+9
| | | | | | | | To ensure the supplicant starts and ends with a clean slate (keys are already cleaned up at init and deinit time), force a null BSSID and bogus SSID to ensure the driver isn't connected to anything. Signed-off-by: Dan Williams <dcbw@redhat.com>
* wext: Fix deauthentication to do IW_MLME_DEAUTH prior to disconnectDan Williams2009-05-271-1/+1
| | | | | | | | 4853d5ac847efbfe54b80eeefabc2932696414c9 had a small bug in the order of these function calls in _wext_deauthenticate() (_disassociate() did have the correct order). The deauthentication frame is supposed to go out (if driver supports that) before we disconnect more forcefully.
* wext: don't force-disconnect in ad-hoc modeDan Williams2009-05-271-8/+23
| | | | | | | Otherwise the driver might interpret the request as a request to create/join a new adhoc network with the bogus SSID. Signed-off-by: Dan Williams <dcbw@redhat.com>
* Add BSS flags to scan results to indicate signal quality validityJouni Malinen2009-02-181-0/+8
| | | | | | These flags are used to mark which values (level, noise, qual) are invalid (not available from the driver) and whether level is using dBm. D-Bus interface will now only report the values that were available.
* Rename "broadcast SSID" to "wildcard SSID"Jouni Malinen2009-02-141-2/+2
| | | | | "Wildcard SSID" is the term used in IEEE Std 802.11-2007, so it is a better name for the zero-length SSID used in Probe Request.
* Allow multiple driver wrappers to be specified on command lineJouni Malinen2009-02-141-19/+33
| | | | | | For example, -Dnl80211,wext could be used to automatically select between nl80211 and wext. The first driver wrapper that is able to initialize the interface will be used.
* New driver capability info: max number of scan SSIDsJouni Malinen2009-02-121-0/+1
| | | | | | | | | | The driver wrappers can now inform wpa_supplicant how many SSIDs can be used in a single scan request (i.e., send multiple Probe Requests per channel). This value is not yet used, but it can eventually be used to allow a new scan command to specify multiple SSIDs to speed up scan_ssid=1 operations. In addition, a warning could be printed if scan_ssid=1 is used with a driver that does not support it (max_scan_ssids=0).
* wext: Force disconnect on deauthenticate()Jouni Malinen2009-02-101-13/+26
| | | | | Use the same zero-BSSID, random-SSID trick for both disassociate() and deauthenticate().
* wext: really disassociate (set random SSID)Dan Williams2009-02-101-2/+14
| | | | | | | | | | | Really disassociate when tearing stuff down; drivers may sometimes (legally) keep trying to reassociate unless the BSSID is unlocked. If the SSID is unlocked too, under WEXT drivers are able to pick an SSID to associate, so kill that behavior by setting a bogus SSID. Unfortunately WEXT doesn't provide an easy method to say "stop whatever doing and just idle". Signed-off-by: Dan Williams <dcbw@redhat.com>
* Fixed scan buffer increasing with WEXTJouni Malinen2009-02-051-1/+3
| | | | | | | | | | We can now handle up to 65535 byte result buffer which is the maximum due to WEXT using 16-bit length field. Previously, this was limited to 32768 bytes in practice even through we tried with 65536 and 131072 buffers which we just truncated into 0 in the 16-bit variable. This more or less doubles the number of BSSes we can received from scan results.
* driver_wext: Add IW_ENCODE_TEMP into SIOCSIWENCODE{,EXT} callsDan Williams2009-01-131-0/+3
| | | | | | This is needed for airo driver to work correctly and no other driver seems to care, so the change is safe to make. This has been in number of distro releases for a long time and no issues have been reported.
* Include pending MFP defines in nl80211_copy.hJouni Malinen2008-12-311-4/+0
| | | | | This can be used to get rid of the extra cpp define since we have our local copy of wireless.h and nl80211.h.
* Updated userspace MLME instructions for current mac80211Jouni Malinen2008-11-181-480/+0
| | | | | | | Remove the old code from driver_wext.c since the private ioctl interface is never going to be used with mac80211. driver_nl80211.c has an implementation than can be used with mac80211 (with two external patches to enable userspace MLME configuration are still required, though).
* Add an optional set_mode() driver_ops handler for setting mode before keysDan Williams2008-09-291-2/+1
| | | | | | | | | | | | | A bug just got reported as a result of this for mac80211 drivers. https://bugzilla.redhat.com/show_bug.cgi?id=459399 The basic problem is that since taking the device down clears the keys from the driver on many mac80211-based cards, and since the mode gets set _after_ the keys have been set in the driver, the keys get cleared on a mode switch and the resulting association is wrong. The report is about ad-hoc mode specifically, but this could happen when switching from adhoc back to managed mode.
* Validate WEXT event iwe->u.data.length before using the event dataJouni Malinen2008-09-271-1/+24
| | | | | This is needed to avoid crashing wpa_supplicant with invalid event messages that may be received when using 64-bit kernel with 32-bit userspace.
* Fixed WEXT scan result parser to not crash on invalid IEs (zero len buffer)Jouni Malinen2008-08-271-2/+5
| | | | | | | | | | | | | | | | | If IWEVGENIE or custom event wpa_ie/rsn_ie is received in scan with empty buffer, the previous version ended up calling realloc(NULL, 0) which seems to return a non-NULL value in some cases. When this return value is passed again into realloc with realloc(ptr, 0), the returned value could be NULL. If the ptr is then freed (os_free(data.ie) in SIOCGIWAP handling), glibc may crash due to invalid pointer being freed (or double-freed?). The non-NULL realloc(NULL, 0) return value from glibc looks a bit odd behavior, but anyway, better avoid this case completely and just skip the IE events that have an empty buffer. This issue should not show up with drivers that produce proper scan results since the IEs will always include the two-octet header. However, it seems to be possible to see this when using 64-bit kernel and 32-bit userspace with incorrect compat-ioctl processing.
* WEXT: Fixed re-initialization of removed and re-inserted interfaceJouni Malinen2008-07-241-10/+78
| | | | | | | | | | Network device ifindex will change when the interface is re-inserted. driver_wext.c will need to accept netlink events from "unknown" (based on ifindex) interfaces when a previously used card was removed earlier. If the previously removed interface is added back, the driver_wext data need to be updated to match with the new ifindex value. In addition, the initial setup tasks for the card (set interface up, update ifindex, set mode, etc.) from wpa_driver_wext_init() need to be run again.
* wext: fix maxrate calculationDan Williams2008-07-151-1/+5
| | | | | | | | | | | | | | When scan results got moved from wpa_scan_result -> wpa_scan_res, the 'maxrate' member was dropped from wpa_scan_res. The D-Bus interface used 'maxrate', which was replaced with wpa_scan_get_max_rate(). Unfortunately, wpa_scan_get_max_rate() returns 802.11 rate values directly from the IE, where 'maxrate' was the rate in bits/second. The supplicant internally fakes an IE for wpa_scan_res from the value of wpa_scan_result->maxrate, but interprets ->maxrate as an 802.11 rate index. As a side-effect, this fixes a soft-break of the D-Bus control API since the wpa_scan_res change was introduced.