aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_common.c
Commit message (Collapse)AuthorAgeFilesLines
* nl80211: Introduce the interface to update new DH IELiangwei Dong2019-06-141-0/+1
| | | | | | | | | | | | This command/event interface can be used by SME based host drivers that rely on user space (hostapd/wpa_supplicant) for DH IE processing/generation. This interface facilitates the OWE connection with host drivers by offloading DH IE processing to the user space (hostapd/wpa_supplicant). Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org> Signed-off-by: Liangwei Dong <liangwei@codeaurora.org> Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* Make channel switch started event available over control interfaceOmer Dagan2019-04-221-0/+1
| | | | | | | | This makes it easier to upper layer components to manage operating channels in cases where the same radio is shared for both station and AP mode virtual interfaces. Signed-off-by: Omer Dagan <omer.dagan@tandemg.com>
* drivers: Add separate driver flags for 802.1X and PSK 4-way HS offloadsArend van Spriel2019-01-071-1/+2
| | | | | | | | | Allow drivers to indicate support for offloading 4-way handshake for either IEEE 802.1X (WPA2-Enterprise; EAP) and/or WPA/WPA2-PSK (WPA2-Personal) by splitting the WPA_DRIVER_FLAGS_4WAY_HANDSHAKE flag into two separate flags. Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
* Add functions to convert channel bandwidth to an integerMathy Vanhoef2018-12-161-0/+19
| | | | | | | | | This adds two utility functions to convert both operating classes and and the chan_width enum to an integer representing the channel bandwidth. This can then be used to compare bandwidth parameters in an uniform manner. Signed-off-by: Mathy Vanhoef <Mathy.Vanhoef@cs.kuleuven.be>
* Add some missing driver flags stringsMikael Kanstrup2018-05-311-0/+13
| | | | | | | | New WPA_DRIVER_FLAGS have been added but corresponding lookup strings for driver_flags command were never added. Add the missing strings. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sony.com>
* hostapd: Add ctrl iface indications for WDS STA interfaceBhagavathi Perumal S2018-04-231-0/+1
| | | | | | | | This allows user to get event indication when a new interface is added/removed for 4addr WDS STA and also WDS STA ifname is informed through the STA command. Signed-off-by: Bhagavathi Perumal S <bperumal@codeaurora.org>
* wpa_supplicant: Fix auth failure when the MAC is updated externallyBeniamino Galvani2018-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When connecting to a WPA-EAP network and the MAC address is changed just before the association (for example by NetworkManager, which sets a random MAC during scans), the authentication sometimes fails in the following way ('####' logs added by me): wpa_supplicant logs: wlan0: WPA: RX message 1 of 4-Way Handshake from 02:00:00:00:01:00 (ver=1) RSN: msg 1/4 key data - hexdump(len=22): dd 14 00 0f ac 04 d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23 WPA: PMKID in EAPOL-Key - hexdump(len=22): dd 14 00 0f ac 04 d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23 RSN: PMKID from Authenticator - hexdump(len=16): d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23 wlan0: RSN: no matching PMKID found EAPOL: Successfully fetched key (len=32) WPA: PMK from EAPOL state machines - hexdump(len=32): [REMOVED] #### WPA: rsn_pmkid(): #### WPA: aa - hexdump(len=6): 02 00 00 00 01 00 #### WPA: spa - hexdump(len=6): 66 20 cf ab 8c dc #### WPA: PMK - hexdump(len=32): b5 24 76 4f 6f 50 8c f6 a1 2e 24 b8 07 4e 9a 13 1b 94 c4 a8 1f 7e 22 d6 ed fc 7d 43 c7 77 b6 f7 #### WPA: computed PMKID - hexdump(len=16): ea 73 67 b1 8e 5f 18 43 58 24 e8 1c 47 23 87 71 RSN: Replace PMKSA entry for the current AP and any PMKSA cache entry that was based on the old PMK nl80211: Delete PMKID for 02:00:00:00:01:00 wlan0: RSN: PMKSA cache entry free_cb: 02:00:00:00:01:00 reason=1 RSN: Added PMKSA cache entry for 02:00:00:00:01:00 network_ctx=0x5630bf85a270 nl80211: Add PMKID for 02:00:00:00:01:00 wlan0: RSN: PMKID mismatch - authentication server may have derived different MSK?! hostapd logs: WPA: PMK from EAPOL state machine (MSK len=64 PMK len=32) WPA: 02:00:00:00:00:00 WPA_PTK entering state PTKSTART wlan1: STA 02:00:00:00:00:00 WPA: sending 1/4 msg of 4-Way Handshake #### WPA: rsn_pmkid(): #### WPA: aa - hexdump(len=6): 02 00 00 00 01 00 #### WPA: spa - hexdump(len=6): 02 00 00 00 00 00 #### WPA: PMK - hexdump(len=32): b5 24 76 4f 6f 50 8c f6 a1 2e 24 b8 07 4e 9a 13 1b 94 c4 a8 1f 7e 22 d6 ed fc 7d 43 c7 77 b6 f7 #### WPA: computed PMKID - hexdump(len=16): d8 21 9d a5 73 98 88 26 ef 03 d2 ce f7 04 7d 23 WPA: Send EAPOL(version=1 secure=0 mic=0 ack=1 install=0 pairwise=1 kde_len=22 keyidx=0 encr=0) That's because wpa_supplicant computed the PMKID using the wrong (old) MAC address used during the scan. wpa_supplicant updates own_addr when the interface goes up, as the MAC can only change while the interface is down. However, drivers don't report all interface state changes: for example the nl80211 driver may ignore a down-up cycle if the down message is processed later, when the interface is already up. In such cases, wpa_supplicant (and in particular, the EAP state machine) would continue to use the old MAC. Add a new driver event that notifies of MAC address changes while the interface is active. Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
* nl80211: Add support for STA opmode change eventsTamizh chelvam2018-03-191-0/+1
| | | | | | | | The nl80211 driver can report STA_OPMODE notification event as soon as it receives an HT/VHT Action frame about modification of station's SMPS mode/bandwidth/RX NSS. Add support to parse such events. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org>
* driver: Add port authorized eventAvraham Stern2018-02-171-0/+1
| | | | | | | | | | | | Add an event that indicates that the 4 way handshake was completed by the driver. This event is useful for networks that require 802.1X authentication. The driver can use this event that a new connection is already authorized (e.g. when the driver used PMKSA caching) and 802.1X authentication is not required. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* nl80211: Introduce the interface for external authenticationSunil Dutt2018-02-021-0/+1
| | | | | | | | This command/event interface can be used by host drivers that do not define separate commands for authentication and association but rely on wpa_supplicant for the authentication (SAE) processing. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* Remove all PeerKey functionalityJouni Malinen2017-10-151-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | This was originally added to allow the IEEE 802.11 protocol to be tested, but there are no known fully functional implementations based on this nor any known deployments of PeerKey functionality. Furthermore, PeerKey design in the IEEE Std 802.11-2016 standard has already been marked as obsolete for DLS and it is being considered for complete removal in REVmd. This implementation did not really work, so it could not have been used in practice. For example, key configuration was using incorrect algorithm values (WPA_CIPHER_* instead of WPA_ALG_*) which resulted in mapping to an invalid WPA_ALG_* value for the actual driver operation. As such, the derived key could not have been successfully set for the link. Since there are bugs in this implementation and there does not seem to be any future for the PeerKey design with DLS (TDLS being the future for DLS), the best approach is to simply delete all this code to simplify the EAPOL-Key handling design and to get rid of any potential issues if these code paths were accidentially reachable. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Handle pre-CAC expired event from the driverVasanthakumar Thiagarajan2017-03-091-0/+1
| | | | | | | Process the new nl80211 event NL80211_RADAR_PRE_CAC_EXPIRED to allow the driver to notify expiry of the CAC result on a channel. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
* nl80211: More complete processing of connection quality monitor eventsJouni Malinen2017-01-081-1/+2
| | | | | | | | | This adds processing of beacon loss events and generation of an internal EVENT_BEACON_LOSS event based on them for wpa_supplicant processing. In addition, number of consecutively lost (not acknowledged) packets is now reported and TXE events are noted in the debug log. Signed-off-by: Jouni Malinen <j@w1.fi>
* Make driver flags available through control interfaceErik Ljungberg2016-07-231-0/+52
| | | | | | This shows the current set of driver flags in wpa_cli and hostapd_cli. Signed-off-by: Erik Ljungberg <erik.ljungberg@sonymobile.com>
* P2P: Allow P2P listen being offloaded to the driver/firmwarePeng Xu2016-07-031-0/+1
| | | | | | | | | | | | | This allows P2P Listen to be offloaded to device to enhance power saving. To start P2P listen offload, from wpa_cli interface, issue the command: p2p_lo_start <freq> <period> <interval> <count> To stop P2P listen offload, issue the command: p2p_lo_stop Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* ctype functions require an unsigned charRoy Marples2016-02-181-2/+2
| | | | | | | | Ensure that characters are represented as unsigned char when using isblank() and isspace(). These function take in a "int c" argument, but it needs to be unsigned for the cases where EOF is not indicated. Signed-off-by: Roy Marples <roy@marples.name>
* nl80211: Allocate QCA vendor subcmds for DFS radar detected and CAC eventsAhmad Kholaif2015-02-111-0/+1
| | | | | | | | | | | | When DFS offloading capability is supported by the driver, the driver should use these events to indicate when a radar pattern has been detected, channel availability check (CAC) has been completed, aborted or finished after the non-occupancy period is over on a DFS channel. Also, add a new driver.h event to be used by NL80211 to indicate CAC Started event on a DFS channel. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Allow ACS to be offloaded to the driverPeng Xu2014-12-031-0/+1
| | | | | | | | Using QCA vendor command, allow ACS function to be offloaded to the driver. Once channels are selected, hostapd is notified to perform OBSS operation. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* hostapd: Add wowlan_triggers config paramDmitry Shmidt2014-11-161-0/+76
| | | | | | | | | | New kernels in wiphy_suspend() will call cfg80211_leave_all() that will eventually end up in cfg80211_stop_ap() unless wowlan_triggers were set. For now, use the parameters from the station mode as-is. It may be desirable to extend (or constraint) this in the future for specific AP mode needs. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
* Remove unused EVENT_MLME_RXJouni Malinen2014-11-011-1/+0
| | | | | | | This was used in driver_test.c, but that driver wrapper has been removed and there are no remaining or expected users for EVENT_MLME_RX. Signed-off-by: Jouni Malinen <j@w1.fi>
* Remove unused EVENT_FT_RRB_RXJouni Malinen2014-11-011-1/+0
| | | | | | | | This was used in hostapd driver_test.c, but that driver wrapper has been removed and there are no remaining or expected users for EVENT_FT_RRB_RX. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Add new peer candidate event for meshBob Copeland2014-10-191-0/+1
| | | | | | | Signed-off-by: Javier Lopez <jlopex@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: Jason Mobarak <x@jason.mobarak.name> Signed-off-by: Bob Copeland <me@bobcopeland.com>
* Fix CONFIG_NO_SCAN_PROCESSING=y buildJouni Malinen2014-10-121-0/+36
| | | | | | ht_supported() was used but not defined in such a case. Signed-off-by: Jouni Malinen <j@w1.fi>
* dbus: Add SignalPoll() method to report current signal propertiesDan Williams2014-09-131-0/+21
| | | | | | Analogous to the control interface's SIGNAL_POLL request. Signed-hostap: Dan Williams <dcbw@redhat.com>
* P2P: Apply unsafe frequency rules to available channelsArif Hussain2014-01-271-0/+1
| | | | | | | | | | | | | | | | This adds a QCA vendor specific nl80211 event to allow the driver to indicate a list of frequency ranges that should be avoided due to interference or possible known co-existance constraints. Such frequencies are marked as not allowed for P2P use to force groups to be formed on different channels. If a P2P GO is operating on a channel that the driver recommended not to use, a notification about this is sent on the control interface and upper layer code may decide to tear down the group and optionally restart it on another channel. As a TODO item, this could also be changed to use CSA to avoid removing the group. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Remove WPA_DRIVER_FLAGS_P2P_MGMT optionJouni Malinen2013-12-291-7/+0
| | | | | | | | | | | | | The option of handling upper layer P2P management operations within the driver/firmware was originally planned to be used with wpa_supplicant, but this has not really happened and there is no clear sign of this being needed in the near term either. This functionality has not been completed and it is certainly not being kept up-to-date or tested. As such, it is best to remove it for now and if this or something similar is needed in the future, it can be brought back once a clear need for it has been demonstrated first. Signed-hostap: Jouni Malinen <j@w1.fi>
* Remove unnecessary EVENT_RX_ACTIONJouni Malinen2013-12-291-1/+0
| | | | | | | | | | | | This driver event was used separately for some Action frames, but all the driver wrappers converted to this from information that would have been enough to indicate an EVENT_RX_MGMT event. In addition, the received event was then converted back to a full IEEE 802.11 management frame for processing in most cases. This is unnecessary complexity, so get rid of the extra path and use EVENT_RX_MGMT for Action frames as well as other management frame subtypes. Signed-hostap: Jouni Malinen <j@w1.fi>
* Track whether scan was started by us or an external programJouni Malinen2013-12-261-0/+1
| | | | | | | This can be used to improve scan behavior in cases external programs request scans directly from the driver. Signed-hostap: Jouni Malinen <j@w1.fi>
* hostapd: Add survey dump supportMichal Kazior2013-08-251-0/+1
| | | | | | | | 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>
* nl80211: Add driver events for radar detectionSimon Wunderlich2013-05-091-0/+4
| | | | | | | | | | | 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>
* nl80211: Add ctrl_iface message for AP mode connection rejectionRaja Mani2013-02-071-0/+1
| | | | | | | | | | | | 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>
* WNM: Add placeholders for WNM driver commands and eventsXi Chen2012-08-011-0/+1
| | | | Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* nl80211: Handle CH_SWITCH eventThomas Pedersen2012-06-251-0/+1
| | | | | | | Some drivers may independently decide to switch channels. Handle this by updating the hostapd and wpa_supplicant AP and GO configuration. Signed-hostap: Thomas Pedersen <c_tpeder@qca.qualcomm.com>
* Remove the GPL notification from files contributed by Jouni MalinenJouni Malinen2012-02-111-8/+2
| | | | | | | Remove the GPL notification text from the files that were initially contributed by myself. Signed-hostap: Jouni Malinen <j@w1.fi>
* AP: Add explicit EAPOL TX status eventJohannes Berg2011-11-191-0/+1
| | | | | | | | The new event can be used when EAPOL TX status can't be reported as a complete 802.11 frame but is instead reported as just the EAPOL data as originally passed to hapd_send_eapol(). Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* Use a pre-processor macro to simplify event_to_string()Jouni Malinen2011-11-131-48/+50
| | | | Signed-hostap: Jouni Malinen <j@w1.fi>
* Print human readable driver event namesBen Greear2011-11-131-0/+57
| | | | | | This makes it easier to understand the event related logs. Signed-hostap: Ben Greear <greearb@candelatech.com>
* Move wpa_scan_results_free() into shared C fileJouni Malinen2011-11-131-0/+30
Replace the inline helper function with a new C file that can be used for common driver API related function. Signed-hostap: Jouni Malinen <j@w1.fi>