path: root/src/drivers
Commit message (Collapse)AuthorAgeFilesLines
* Remove CONFIG_IEEE80211W build parameterJouni Malinen2019-09-083-31/+3
| | | | | | | | | Hardcode this to be defined and remove the separate build options for PMF since this functionality is needed with large number of newer protocol extensions and is also something that should be enabled in all WPA2/WPA3 networks. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Request update connection params only for drivers with SMESunil Dutt2019-08-161-0/+8
| | | | | | | | | Update Connection Params is intended for drivers that implement internal SME and expect these updated connection params from wpa_supplicant. Do not send this request for the drivers using SME from wpa_supplicant. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: Don't force VHT channel definition with HESven Eckelmann2019-08-111-1/+9
| | | | | | | | | | | | | | | HE (802.11ax) is also supported on 2.4 GHz. And the 2.4 GHz band isn't supposed to use VHT operations. Some codepaths in wpa_supplicant will therefore not initialize the freq->bandwidth or the freq->center_freq1/2 members. As a result, the nl80211_put_freq_params() will directly return an error (-1) or the kernel will return an error due to the invalid channel definition. Instead, the channel definitions should be created based on the actual HT/VHT/none information on 2.4 GHz. Fixes: ad9a1bfe788e ("nl80211: Share VHT channel configuration for HE") Signed-off-by: Sven Eckelmann <seckelmann@datto.com>
* Rename qca_wlan_vendor_attr_roam_subcmd to represent subcmdsSunil Dutt2019-08-081-1/+1
| | | | | | | | | | qca_wlan_vendor_attr_roam_subcmd is an enum associated with the attribute QCA_WLAN_VENDOR_ATTR_ROAMING_SUBCMD. It represents different sub command values and these are not the attributes. Hence, rename the enum to qca_wlan_vendor_roaming_subcmd. Accordingly, the members of this enum are also renamed to suite the usage. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: Use separate flag for 4-way handshake offloadArend van Spriel2019-08-012-1/+9
| | | | | | | | | | | | | | | | Commit d896874f8689 ("nl80211: Indicate 802.1X 4-way handshake offload in connect") used the req_key_mgmt_offload flag to indicate to the driver that it should offload the 802.1X handshake. However, this field was existing and used for a different offload API. This causes wpa_supplicant to send a connect request without the WANT_1X_HS flag and the subsequent set-pmk is rejected causing the connection to fail. Fix that by introducing a new flag req_handshake_offload so the offloads are no longer entangled. Fixes: d896874f8689 ("nl80211: Indicate 802.1X 4-way handshake offload in connect") Reported-by: Stefan Wahren <wahrenst@gmx.net> Tested-by: Stefan Wahren <wahrenst@gmx.net> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
* nl80211: Missing sysctl flags aren't fatalBrian Norris2019-07-301-4/+19
| | | | | | | | | | | | | The relevant flags were only added in Linux 4.6, so we shouldn't complain because they're missing. Also, they're always missing if a device is being removed (e.g., 'iw dev wlan0 del', or if the device is in the process of resetting itself). So kill those 2 birds with 1 stone: if we can't find the file, just silently skip it. Also, we probably should *actually* propagate the error if we had a write failure. Signed-off-by: Brian Norris <briannorris@chromium.org>
* nl80211: Add WMM parameters while updating TDLS peer entrySunil Dutt2019-07-261-2/+3
| | | | | | | | | | | The AP mode fix for removing NL80211_ATTR_STA_WME from NL80211_CMD_SET_STATION did not consider the TDLS case and that resulted in incorrectly removing WMM parameters from TDLS STA entry updates. Fix this by considering the WPA_STA_TDLS_PEER flag similarly to the other update parameters. Fixes: 6d14b98fc6fc ("nl80211: Do not add WMM parameters when updating an existing STA entry") Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* mesh: Add support for HE modeSven Eckelmann2019-06-231-1/+2
| | | | | | | | | Mesh points can partially support HE features (when requiring no controlling STA/AP) as long as hardware supports it. The kernel just requires support for HE mesh and wpa_supplicant can forward the peer capabilities to the kernel for further processing. Signed-off-by: Sven Eckelmann <seckelmann@datto.com>
* nl80211: Add driver multi iftype HE capability parsingSven Eckelmann2019-06-232-22/+56
| | | | | | | | | | | | | | The HE capabilities are no longer per PHY but per iftype on this specific PHY. It is therefore no longer enough to just parse the AP capabilities. The he_capabilities are now duplicated to store all information for IEEE80211_MODE_* which hostap cares about. The nl80211 driver fills in this information when the iftype supports HE. The rest of the code still only uses the IEEE80211_HE_AP portion but can be extended later to also use other HE capabilities. Signed-off-by: Sven Eckelmann <seckelmann@datto.com>
* nl80211: Introduce the interface to update new DH IELiangwei Dong2019-06-144-0/+87
| | | | | | | | | | | | 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>
* macsec_linux: Hook QCA driver wrapper for hostapd MACsecJouni Malinen2019-06-031-0/+214
| | | | Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* macsec_qca: Hook QCA driver wrapper for hostapd MACsecleiwei2019-06-031-0/+225
| | | | Signed-off-by: leiwei <leiwei@codeaurora.org>
* SAE: Fix external_auth status in driver-SME STA case with AP SME supportAshok Kumar2019-05-311-1/+1
| | | | | | | | | | | A driver that uses internal AP SME may need to be able to use the external_auth status operation in station mode, so do not skip this solely based on drv->device_ap_sme; instead, use that condition only when operating in AP mode. Fix external_auth status in non SME case. Signed-off-by: Ashok Kumar <aponnaia@codeaurora.org>
* nl80211: Add regulatory wmm_limit to hostapd_channel_dataHaim Dreyfuss2019-05-282-0/+75
| | | | | | | | | | | | | | | | | | | | | ETSI EN 301 893 v2.1.1 (2017-05) standard defines a new channel access mechanism that all devices (WLAN and LAA) need to comply with. In previous versions the device was allowed by ETSI to implement 802.11 channel access mechanism based on a set of priority classes which are taken from 802.11. According of the new standard there might be some exceptions which require ETSI countries to follow more restrictive rules. In such a case the AP's wmm IE need to comply with ETSI limitation. To be able to do so the regulatory domain passes the new limitation values if needed. Implement this, by storing it and use it to calculate the new WMM parameters. This commit adds determination of regulator limitations to NL80211_CMD_GET_WIPHY processing so that the information is available for upper layer implementation to use later when constructing WMM element. Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
* nl80211: Add support to probe specific mesh link by injecting framesPradeep Kumar Chitrapu2019-05-282-0/+43
| | | | | | | | | Add support for injecting frames to a given mesh peer, bypassing the mpath table lookup using PROBE_MESH_LINK command. This helps to send data frames over unexercised direct mesh path, which is not selected as next_hop node. This can be helpful in measuring link metrics. Signed-off-by: Pradeep Kumar Chitrapu <pradeepc@codeaurora.org>
* Sync with mac80211-next.git include/uapi/linux/nl80211.hJouni Malinen2019-05-281-2/+84
| | | | | | This brings in nl80211 definitions as of 2019-04-26. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Update freq only when CSA completesJohannes Berg2019-05-281-1/+2
| | | | | | | | | | | | | | | | | In the case of the ap_csa_disable test, I frequently see failures due to the kernel *not* having switched, but the CSA-STARTED event having been processed, and thus the frequency having been updated already. This is wrong at least for AP mode, the frequency we store for this case internally in nl80211 should only be updated when the channel switch completes, otherwise we end up in a situation where the switch is aborted and the kernel is thus on the old channel, but the internal information has been updated and every subsequent mgmt-frame TX fails due to being tagged with the wrong channel. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* nl80211: Share VHT channel configuration for HEJohn Crispin2019-05-272-5/+11
| | | | | | | | Set operating channel bandwidth and center frequencies using the same attributes for VHT and HE. Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com> Signed-off-by: John Crispin <john@phrozen.org>
* HE: Fix HE Capabilities indication from driverJohn Crispin2019-05-271-11/+1
| | | | | | | | | | The PPE Thresholds information in the end of the HE Capabilities element is optional and of variable length. struct he_ppe_threshold was not really used correctly for encoding this, so remove it and just reserve enough space for the information. Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com> Signed-off-by: John Crispin <john@phrozen.org>
* nl80211: Allow HE Capability to be set for a STAJohn Crispin2019-05-272-0/+10
| | | | | Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com> Signed-off-by: John Crispin <john@phrozen.org>
* nl80211: Write event name in debug log for ignored eventsJouni Malinen2019-05-251-2/+3
| | | | | | | This makes it easier to understand debug logs from systems that have multiple interfaces. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Station airtime weight configurationToke Høiland-Jørgensen2019-05-022-0/+32
| | | | | | | This provides a mechanism for configuring per-STA airtime weight for airtime policy configuration. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
* nl80211: Fetch STA TX/RX duration statisticsToke Høiland-Jørgensen2019-04-302-0/+9
| | | | | | | This makes per-STA TX/RX duration statistics available for airtime policy configuration. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
* nl80211: Fetch STA TXQ backlog statisticsToke Høiland-Jørgensen2019-04-302-0/+36
| | | | | | | This makes per-STA TXQ backlog statistics available for airtime policy configuration. Signed-off-by: Toke Høiland-Jørgensen <toke@toke.dk>
* nl80211: Simplify if_indices trackingJouni Malinen2019-04-282-48/+26
| | | | | | | | | | | | Maintain a single array (of struct with two int variables) instead of two independent arrays (of int) for tracking know ifindexes and reasons for having added them. The previous implementation tried to maintain two independent arrays even though they were always required to be of exactly same length and order. That had resulted in a bug earlier and the code was not exactly easy to understand either, so replace this with a single array. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Fix handling of if_indices reallocation failureJouni Malinen2019-04-281-1/+4
| | | | | | | | | | Addition of a separate if_indices_reason array broke reallocation failure checking. drv->if_indices or drv->if_indices_reason could not be NULL in the place where this check was moved to. Fix that by maintaining knowledge of reallocation failure in a separate local variable. Fixes: 732b1d20ec06 ("nl80211: Clean up ifidx properly if interface in a bridge is removed") Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Add driver HE capabilities parsing supportJohn Crispin2019-04-252-4/+86
| | | | | | | | | Add code to parse NL80211_BAND_ATTR_IFTYPE_DATA when reading the band info. This is needed to find out about the local HE capabilities in AP mode. Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com> Signed-off-by: John Crispin <john@phrozen.org>
* nl80211: Remove QCA vendor specific HE capability handlingJouni Malinen2019-04-252-101/+0
| | | | | | | | | | | | | | The QCA_NL80211_VENDOR_SUBCMD_GET_HE_CAPABILITIES attributes are not up-to-date with the latest P802.11ax/D4.0 capabilities and would need to be updated or replaced. Since the variables from this functionality were not used for anything in practice, it is easier to simply remove this functionality completely to avoid issues with upcoming updates to use upstream nl80211 information to determine HE capabilities. This is practically reverting the commit ca1ab9db2a9e ("hostapd: Get vendor HE capabilities"). Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* Make channel switch started event available over control interfaceOmer Dagan2019-04-223-4/+33
| | | | | | | | 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>
* Replace int status/reason_code with u16 variableJouni Malinen2019-04-228-22/+22
| | | | | | | | | These cases are for the IEEE 802.11 Status Code and Reason Code and those fields are unsigned 16 bit values, so use the more appropriate type consistently. This is mainly to document the uses and to make the source code easier to understand. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Check nla_put_flag() failure for ext authJouni Malinen2019-04-181-2/+4
| | | | | | | | All nla_put*() operations should be verified to succeed, so check this recently added one for NL80211_ATTR_EXTERNAL_AUTH_SUPPORT. Fixes: 236e793e7b8b ("nl80211: External authentication in driver-based AP SME mode") Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: Handle NL80211_CMD_PROBE_CLIENT command responseIlan Peer2019-04-151-1/+7
| | | | | | | | | | | | | | | When processing the NL80211_CMD_PROBE_CLIENT command response, the nl80211 layer in the kernel sends a response containing the cookie associated with the client probe request. This response was not handled by driver_nl80211.c when sending the command, and it was mistakenly handled as an asynchronous event. This incorrect event did not include the MAC/ACK attributes, so it was ignored in practice, but nevertheless, the command response should not be processed as an event. Fix this by reading the response as part of the sending the command flow. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* nl80211: More detailed PROBE_CLIENT debug printJouni Malinen2019-04-151-6/+13
| | | | | | | Include the MAC address of the peer, knowledge of whether the poll was ACKed, and cookie into the debug message to make this more useful. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Update assoc_freq and bss->freq based on real association infoJouni Malinen2019-04-141-2/+4
| | | | | | | | | | | | | Move event.assoc_info.freq selection to be after the nl80211_get_assoc_ssid() call so that the current cfg80211 information on the operating channel can be used should anything unexpected have happened between the association request and completion of association. Furthermore, update bss->freq based on assoc_freq to make that information a bit more useful for station mode. It was already updated after channel switches during association, but not at the beginning of association. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Clear bss->freq on station mode disconnectionJouni Malinen2019-04-141-0/+1
| | | | | | | | | | | This fixes some issues where bss->freq could have been used to replace the current operating channel when sending out a management frame. bss->freq has not been consistently used to track the current operating channel in station mode, so it should not be trusted for this type of uses. Clearing it makes this a bit more robust by at least avoiding the cases of information from past association being used. Signed-off-by: Jouni Malinen <j@w1.fi>
* bsd: Fix a typo in error messageRyo ONODERA2019-04-131-1/+1
| | | | | | | When SIOCG80211 failed, show error message with SIOCG80211 instead of SIOCS80211. Signed-off-by: Ryo ONODERA <ryo@tetera.org>
* Remove unnecessary copying of SSID and BSSID for external_authJouni Malinen2019-04-123-8/+7
| | | | | | | | | The external authentication command and event does not need to copy the BSSID/SSID values into struct external_auth since those values are used before returning from the call. Simplify this by using const u8 * to external data instead of the array with a copy of the external data. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: External authentication in driver-based AP SME modeSrinivas Dasari2019-04-122-2/+28
| | | | | | | | | | | | | | | | This extends driver interface to nl80211 by introducing the following changes, 1. Register for Authenication frames in driver-based AP SME mode. 2. Advertise NL80211_ATTR_EXTERNAL_AUTH_SUPPORT in set_ap when offloaded SAE authentication is supported. 3. Extend the NL80211_CMD_EXTERNAL_AUTH interface to also send PMKID so that the drivers can respond to the PMKSA cached connection attempts from the stations avoiding the need to contact user space for all PMKID-based connections. 4. Send external auth status to driver only if it is a driver based SME solution. Signed-off-by: Srinivas Dasari <dasaris@codeaurora.org>
* nl80211: Add SAE, FT-SAE, FT-EAP-SHA384 AKMs in connect requestAnkita Bajaj2019-04-051-0/+12
| | | | | | | This is needed for full MAC drivers that use NL80211_CMD_CONNECT for issuing connect request. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: Do not add WMM parameters when updating an existing STA entryJouni Malinen2019-03-271-1/+2
| | | | | | | | | | | In the case of the driver not supporting full AP mode STA state (i.e., not adding a STA entry before association), the QoS parameters are not allowed to be modified when going through (re)association exchange for a STA entry that has not been removed from the kernel. cfg80211 would reject such command to update STA flags, so do not add the WMM parameter in this case. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: Clear keys from heap memory before freeing it for get_seqnumvamsi krishna2019-03-131-0/+1
| | | | | | | | | | | | | NL80211_CMD_GET_KEY response may return the actual key in addition to the last used sequence number that we need. That might result in a key being left in unused heap memory after the buffer is freed. Explicitly clear the message payload with the possibly included key material from heap memory before returning from the handler function (and having libnl free the nlmsg) when key information is obtained from the driver using the NL80211_CMD_GET_KEY command. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: Exclude PMK when sending NL80211_CMD_DEL_PMKSA explicitlyvamsi krishna2019-03-131-1/+2
| | | | | | | | | | Add a check in nl80211 driver layer to not include PMK while sending NL80211_CMD_DEL_PMKSA explicitly. Though it is taken care already in supplicant layer by setting the pmk_len to zero, it would be good to have a check in nl80211 layer in order to avoid future accidental inclusions of keying material in commands that do not need them. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* Allow fragmentation/RTS threshold to be disabled explicitlyJouni Malinen2019-03-121-2/+2
| | | | | | | | | | | | | | | | | hostapd configuration parameters fragm_threshold and rts_threshold were documented to disable the threshold with value -1 and not change driver configuration if the parameter is not included. However, -1 was mapped into not changing the driver value, so the explicit disabling part did not work. Replace the default values for these to be -2 so that explicitly set configuration value -1 can be distinguished from the case of not including the parameter. Map the -1 value to a driver request to disable the threshold. Ignore any error from this operation just in case to avoid breaking functionality should some drivers not accept the (u32) -1 value as a threshold value request to disable the mechanism. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* Sync with mac80211-next.git include/uapi/linux/nl80211.hJouni Malinen2019-03-111-5/+39
| | | | | | This brings in nl80211 definitions as of 2019-01-25. Signed-off-by: Jouni Malinen <j@w1.fi>
* roboswitch: Check some read operation resultsJouni Malinen2019-03-091-14/+22
| | | | | | | This gets rid of some static analyzer warnings about uninitialized variables being used in comparisons or write operations. Signed-off-by: Jouni Malinen <j@w1.fi>
* atheros: Avoid clang compiler warning on address of array checkJouni Malinen2019-02-251-2/+1
| | | | | | | | | | ie.wps_ie is an array, so there is no point in checking whether it is NULL. driver_atheros.c:1221:9: error: address of array 'ie.wps_ie' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion] Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: (Re)Association Request frame IEs from association eventJouni Malinen2019-02-151-5/+13
| | | | | | | | | Process NL80211_ATTR_REQ_IE from the NL80211_CMD_ASSOCIATE event to allow request IEs to be made available for the SME-in-wpa_supplicant case similarly to how this is done with SME-in-driver with NL80211_CMD_CONNECT. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: Use wpa_ssid_txt() for debug messages more consistentlyJouni Malinen2019-02-092-20/+20
| | | | | | | | Print the SSID with printf escaping instead of wpa_hexdump_ascii() format to clean up the debug log a bit. This was already done for number of SSID debug prints. Signed-off-by: Jouni Malinen <j@w1.fi>
* nl80211: Clear PMKID add command message bufferJouni Malinen2019-02-051-1/+2
| | | | | | | | | This command has now been extended to include PMK for offload needs, so the message buffer needs to be cleared explicitly after use to avoid leaving such material in heap memory unnecessarily. Fixes: 061a3d3d5300 ("nl80211: Add support for FILS Cache Identifier in add/remove_pmkid()") Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* nl80211: Clear connect command message bufferJouni Malinen2019-02-051-2/+4
| | | | | | | | This command can include keys (WEP or PSK for offload), so the message buffer needs to be cleared explicitly after use to avoid leaving such material in heap memory unnecessarily. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>