aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/p2p_supplicant.h
Commit message (Collapse)AuthorAgeFilesLines
* P2P: Support random device addressJimmy Chen2019-01-121-0/+1
| | | | | | | | | | | | | | | To enhance privacy, generate a random device address for P2P interface. If there is no saved persistent group, it generate a new random MAC address on bringing up p2p0. If there is saved persistent group, it will use last MAC address to avoid breaking group reinvoke behavior. There are two configurations are introduced: * p2p_device_random_mac_addr enable device random MAC address feature, default disable. * p2p_device_persistent_mac_addr store last used random MAC address. Signed-off-by: Jimmy Chen <jimmycmchen@google.com>
* P2P: Add 802.11ax support for P2P GOPeng Xu2019-01-121-4/+4
| | | | | | | | An optional parameter "he" is added to p2p_connect, p2p_group_add, and p2p_invite to enable 11ax HE support. The new p2p_go_he=1 configuration parameter can be used to request this to be enabled by default. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* P2P: Allow P2P listen being offloaded to the driver/firmwarePeng Xu2016-07-031-0/+4
| | | | | | | | | | | | | 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>
* P2P: Provide group SSID, if specified, to P2P Client join stepJouni Malinen2015-12-301-4/+5
| | | | | | | | | At least one of the wpas_p2p_connect() callers (NFC join case) already had access to the Group SSID. Pass that information through wpas_p2p_connect() to wpas_p2p_join() so that the join operation can filter out incorrect groups more easily. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add support for VHT 80+80 MHz and 160 MHzAhmad Kholaif2015-11-251-6/+11
| | | | | | | | | The new max_oper_chwidth and freq2 arguments to P2P_CONNECT, P2P_INVITE, and P2P_GROUP_ADD control interface commands can be used to request larger VHT operating channel bandwidth to be used than the previously used maximum 80 MHz. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* nl80211: Add VHT 160 MHz channel flagsAhmad Kholaif2015-11-251-0/+2
| | | | | | | | | This extends the previous design that covered only the VHT 80 MHz cases for VHT channel flags. New functions are introduced to allow 160 MHz bandwidth cases to determine the center channel and check availability of a 160 MHz channel. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Require fresh scan results for persistent group re-invocationJouni Malinen2015-08-211-1/+1
| | | | | | | | | | | | | | | | | | The P2P group is not yet operating when going through invitation exchange for re-invocation. Previously, an old cached scan result could be used to skip the scan immediately after the invitation exchange. While this may result in the fastest possible connection, it does have some issues with cases where the GO takes some time to start up. It would also be at least theoretically possible for some of the BSS parameters to be different, so having a fresh scan result from the new GO instance may be desired in any case. Add a mechanism to skip scan results that have been last updated before a specific point in time and as the first user for this mechanism, require chan results to be more recent than the invitation message exchange for the P2P Client role in persistent group re-invocation case. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not perform P2P GO CS in some casesIlan Peer2015-08-041-2/+16
| | | | | | | | | | | | A P2P GO channel switch should not be triggered in all cases that require channel list update. Specifically, a P2P GO CS should not be triggered in case that the P2P GO state changed or in case that that the P2P GO has just completed a CS. To fix this, add reason code to wpas_p2p_channel_list_update() and trigger CS flow only for the relevant cases. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2PS: Add CPT parameter to P2P_SERVICE_ADD asp commandMax Stepanov2015-07-261-1/+2
| | | | | | | | | | | | | | | | | | | | Add Coordination Transport Protocol parameter to P2P_SERVICE_ADD asp command. Extend p2ps_advertisement structure to contain CPT priorities and a supported CPT bitmask. The format of the new parameter: cpt=<cpt>[:<cpt>] where <cpt> is a name of the Coordination Protocol Transport. This implementation supports two CPT names: UDP and MAC. The order of specified CPTs defines their priorities where the first one has the highest priority. Signed-off-by: Max Stepanov <Max.Stepanov@intel.com> Reviewed-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix group interface addition failure properly for concurrent caseJouni Malinen2015-06-151-1/+0
| | | | | | | | | | | It was possible for a P2P group formation failure to result in a concurrent station mode operation getting disconnected in the specific error case where group interface addition fails after a successful GO Negotiation. Fix this by skipping the wpas_p2p_group_delete() call in this specific case since the group interface does not exists anymore at the point wpas_group_formation_completed() gets called. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add rx_freq parameter to Probe Request frame handlerMax Stepanov2015-06-141-2/+2
| | | | | | | | | | | In some cases, Probe Request frames can be received by a peer not only on a listen channel. In this case an additional rx_freq parameter explitly contains a Probe Request frame RX frequency. In case rx_freq is set to 0, a Probe Request frame RX channel is assumed to be our own listen channel (p2p->cfg->channel). Signed-off-by: Max Stepanov <Max.Stepanov@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2PS: Delete ASP advertisements on wpas_p2p_service_flushMax Stepanov2015-03-201-0/+1
| | | | | | | Delete all ASP serice advertisement on wpas_p2p_service_flush similarly to Bonjour and UPnP services. Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
* P2P: Move upper layer SD interaction into a separate fileJouni Malinen2015-03-151-0/+4
| | | | | | | | wpa_supplicant/p2p_supplicant.c has reached almost 10000 lines in length and was getting a bit inconvenient to edit, so start splitting it into separate files. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Allow a specific channel to be specified in P2P_FINDDaisuke Niwa2015-02-281-1/+1
| | | | | | | | | The optional freq=<MHz> can now be used with the P2P_FIND command to specify a single channel to scan during the first round of P2P search. For example, this can be used to replace the full initial scan with a single channel scan of a known operation channel. Signed-off-by: Daichi Ueura <daichi.ueura@sonymobile.com>
* P2PS: Process P2PS provisioning commandsKrishna Vamsi2015-02-021-2/+5
| | | | | | | | This extends wpas_p2p_prov_disc() implementation to accept P2PS parameters. None of the callers are yet using this functionality; the following commit introduces a user. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Add support to send ASP service requestsKrishna Vamsi2015-02-021-0/+2
| | | | | | | | This extends the P2P_SERV_DISC_REQ control interface command with a new "asp" service type. This takes service id, service string, and optional service info as arguments. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Extend add/del services logic to support ASPKrishna Vamsi2015-02-021-0/+5
| | | | | | | In addition, add a new P2P_SERVICE_REP command that can be used to replace existing ASP advertisements. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Add option to specify seek strings into P2P_FINDBrian Gix2015-02-021-1/+2
| | | | | | | P2PS seek strings can now be specified in the P2P_FIND control interface command with one or more optional "seek=<str>" parameters. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Avoid truncation of long listen operation due to offchan txJithu Jance2014-12-181-0/+1
| | | | | | | | | On receiving the cancel remain on channel event, the pending_tx is scheduled immediately and returned. This was preventing the wpas_p2p_listen_start function from execution thereby resulting in termination of the long listen operation. Signed-off-by: Jithu Jance <jithu@broadcom.com>
* P2P: Remove all child interfaces when removing the parentJouni Malinen2014-10-211-1/+7
| | | | | | | | This is needed to allow dynamic removal of an interface that adds the P2P Device interface without leaving behind the management interface with invalid wpa_s->parent pointer. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Use only the -m config for P2P management deviceJouni Malinen2014-10-031-1/+2
| | | | | | | | | | | | | | | | | | Previously, the case of non-netdev P2P management device ended up pulling in both the main interface (e.g., wlan0) and P2P Device interface (from command line -m argument) as configuration. Similarly, the main interface ended up included both configuration files. This is not really helpful for various use cases, e.g., when permanent P2P group information is stored in the P2P Devince interface, but it gets duplicated in the main station interface configuration. Clean this up by changing the -m<file> argument to replace, not concatenate, configuration information. In other words, the main station interface will not read this configuration and the P2P Device interface (non-netdev) does not read parameters from the station interface configuration file. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add utility functions to get GO/client interfaceTomasz Bursztyka2014-06-291-0/+4
| | | | | | | This will be useful for a peer to know if it is part of a group either as a client of our local GO or as the peer GO. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
* P2P: Clean up by moving ifdef CONFIG_P2P to p2p_suppplicant.hJouni Malinen2014-06-151-34/+148
| | | | | | | | This removes number of unnecessary #ifdef CONFIG_P2P blocks from generic code by hiding the conditional build into p2p_supplicant.h with empty inline functions. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Use another interface operating channel as listen channelIlan Peer2014-06-141-0/+2
| | | | | | | | | | | | | | | | | | | Performing a P2P Device flow such as p2p_listen or p2p_find, can degrade the performance of an active interface connection, if the listen frequency is different than the frequency used by that interface. To reduce the effect of P2P Device flows on other interfaces, try changing the listen channel of the P2P Device to match the operating channel of one of the other active interfaces. This change will be possible only in case that the listen channel is not forced externally, and will be delayed to a point where the P2P Device state machine is idle. The optimization can be configured in the configuration file and is disabled by default. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix segfault when PBC overlap is detectedAvraham Stern2014-03-281-0/+1
| | | | | | | | | | If a separate P2P group interface is used, PBC overlap during group formation causes the group interface to be removed, which ends up with the interface context becoming invalid. Fix this by scheduling a timeout to process the PBC overlap and interface removal instead of removing the interface directly before the connection operation has returned. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* Fix persistent P2P connection failure in case channel list changesMahesh A Saptasagar2014-02-071-2/+2
| | | | | | | | | | | P2P persistent connection may fail due to 802.11d channel change event invalidating support of the operating frequency sent in the invitation request, before receiving the invitation response. If the operating frequency is invalid at the time the invitation response is processed and there is no forced frequency provided by user, allow frequency re-selection. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P NFC: Add support for freq option in NFC ctrl_iface commandsJouni Malinen2014-01-271-2/+2
| | | | | | | This can be used to force an operating channel for P2P group formation triggered by NFC operations. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P NFC: Add NFC tag enabling for static handoverJouni Malinen2014-01-271-0/+1
| | | | | | | | The device with the NFC Tag can be configured to enable NFC to be used with "P2P_SET nfc_tag 1" and "P2P_LISTEN" commands to allow static handover to be used. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P NFC: Report handover select from tag for static handoverJouni Malinen2014-01-271-0/+2
| | | | | | | WPS_NFC_TAG_READ can be used to report static connection handover where the connection handover select message was read from an NFC tag. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P NFC: Report connection handover as trigger for P2PJouni Malinen2014-01-271-0/+3
| | | | | | | | "NFC_REPORT_HANDOVER {INIT,RESP} P2P <req> <sel>" can now be used to report completed NFC negotiated connection handover in which the P2P alternative carrier was selected. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P NFC: Build connection handover messagesJouni Malinen2014-01-271-0/+4
| | | | | | | | | | | | | | "NFC_GET_HANDOVER_{REQ,SEL} NDEF P2P-CR" can now be used to build P2P alternative carrier record for NFC connection handover request/select messages. Static connection handover case can be enabled by configuring the DH parameters (either with wps_nfc_* configuration parameters or with WPS_NFC_TOKEN command at run time. The NFC Tag contents can be generated with "NFC_GET_HANDOVER_SEL NDEF P2P-CR-TAG" after having configured Listen channel (p2p_listen_reg_class/p2p_listen_channel). Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Reject group formation on WPS provisioning failureJouni Malinen2014-01-071-0/+1
| | | | | | | | | There is no need to wait for the 15 second group formation timeout to clear the state if WPS failure is detected during P2P group formation. Allow the WPS exchange steps (WSC_NACK and EAP-Failure) to be completed and remove the group to get rid of the extra wait. Signed-hostap: Jouni Malinen <j@w1.fi>
* Use radio work for P2P scan requestsJouni Malinen2014-01-051-5/+0
| | | | | | | | | Avoid concurrent P2P scan requests with any other exclusive use of the radio by using the radio work queuing mechanism. This removes some of the earlier workarounds that postponed scans depending on other operations. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Remove WPA_DRIVER_FLAGS_P2P_MGMT optionJouni Malinen2013-12-291-15/+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>
* P2P: Handle frequency conflict in single channel concurrency caseJithu Jance2013-12-081-0/+2
| | | | | | | Based on priority, remove the connection with least priority whenever a frequency conflict is detected. Signed-hostap: Jithu Jance <jithu@broadcom.com>
* P2P: Add VHT supportEliad Peller2013-10-271-0/+2
| | | | | | | Start GO with VHT support if VHT option was requested and the appropriate channels are available. Signed-hostap: Eliad Peller <eliadx.peller@intel.com>
* P2P: Add VHT parameter to P2P operationsEliad Peller2013-10-271-4/+4
| | | | | | | | | | | | Add the option to ask for VHT operation similarly to the way ht40 is configured - either by adding 'vht' param to the relevant p2p_* commands or by configuring p2p_go_vht=1 in the configuration file. This patch only adds the configuration option (e.g., via control interface). The actual handling of the VHT parameter (asking the driver to use VHT, etc.) will be done by the following patch. Signed-hostap: Eliad Peller <eliadx.peller@intel.com>
* P2P: Use group formation timeout on persistent group GOJouni Malinen2013-09-261-1/+2
| | | | | | | | | | | | | | | | Previously, GO considered the group to be fully re-invoked after starting beaconing on successful invitation exchange. This would leave the group running until idle timeout (which may not be enabled) or explicit removal if the client fails to connect for any reason. Since the client is expected to connect immediately after the invitation exchange that ends with status=0 (i.e., either client initiated the exchange or it responded with success), extend group formation timeout to cover that period until the first successfully completed data connection. This allows the GO to remove the group automatically if the client devices does not connect within P2P_MAX_INITIAL_CONN_WAIT_GO_REINVOKE (15) seconds. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Fix crash when failed to create GO interfaceaosp-kk-from-upstreamVinay Krishna Eranna2013-09-031-0/+5
| | | | | | | | | | | | | | | | | wpa_supplicant crashes if driver configuration for AP mode interface configuration fails after group negotiation. This is because of a regression from commit 1075b2957169d8f9d6dddd7679339c751dc9515b that ends up freeing the wpa_s instance from within wpa_supplicant_create_ap() without the caller knowing. Fix this by using an eloop timeout to free remove the P2P group so that wpa_supplicant_create_ap() and especially wpa_supplicant_associate() callers do not need to know about interface getting possibly removed. In addition, move the P2P specific code into p2p_supplicant.c where it really belongs. This allows the already existing group formation timeout to be used by reducing the timeout to zero. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add event messages for possible PSK failures on P2P groupsJouni Malinen2013-09-011-0/+6
| | | | | | | | | | | | | | | | | | | | | | | It is possible for the GO of a persistent group to change the PSK or remove a client when per-client PSKs are used and this can happen without the SSID changing (i.e., the group is still valid, but just not for a specific client). If the client side of such persistent group ends up trying to use an invalidated persistent group information, the connection will fail in 4-way handshake. A new WPS provisioning step is needed to recover from this. Detect this type of case based on two 4-way handshake failures when acting as a P2P client in a persistent group. A new "P2P-PERSISTENT-PSK-FAIL id=<persistent group id>" event is used to indicate when this happens. This makes it easier for upper layers to remove the persistent group information with "REMOVE_NETWORK <persistent group id>" if desired (e.g., based on user confirmation). In addition to indicating the error cases for persistent groups, all this type of PSK failures end up in the client removing the group with the new reason=PSK_FAILURE information in the P2P-GROUP-REMOVED event. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Add a command for removing a client from all groupsJouni Malinen2013-09-011-0/+2
| | | | | | | | | | The new control interface command P2P_REMOVE_CLIENT <P2P Device Address|iface=Address> can now be used to remove the specified client from all groups (ongoing and persistent) in which the local device is a GO. This will remove any per-client PSK entries and deauthenticate the device. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Maintain list of per-client PSKs for persistent groupsJouni Malinen2013-09-011-0/+3
| | | | | | | | | Record all generated per-client PSKs in the persistent group network block and configure these for the GO Authenticator whenever re-starting the persistent group. This completes per-client PSK support for persistent groups. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Report group formation failure on error to start GO modeJouni Malinen2013-07-111-0/+1
| | | | | | | | There is no need to wait for the 15 second group formation timeout before indicating P2P group formation failure if GO mode cannot be started successfully for some reason. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Create P2P Device interface if supportedArend van Spriel2013-06-301-0/+2
| | | | | | | | | | | | | | If the capability flag of the driver indicates a dedicated P2P Device is supported, a P2P Device interface is created. Create the P2P Device in main interface creation loop when the added interface flags support and P2P supplicant is not yet initialized avoiding recursion of add_interface. Do not register l2_packet for P2P Device interface (both for EAPOL and for TDLS). Signed-hostap: Arend van Spriel <arend@broadcom.com>
* P2P: Use common function for re-starting P2P scan after station scanJouni Malinen2013-03-181-0/+8
| | | | | | | | Make the implementation more consistent and cleaner by using a single function for addressing all the cases where completion of a station mode scan operation allows a P2P operation (search) to be re-started. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Use peer's channel list to limit GO freq on invitationJouni Malinen2013-03-011-1/+3
| | | | | | | | | Peer device includes its list of allowed operating channels in the Invitation Response frame. When we are becoming the GO, use that list from the peer to filter out acceptable channels to avoid selecting a channel that the peer is unable to use. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow P2P client to specify preferred group channelJouni Malinen2013-03-011-1/+1
| | | | | | | | | | When re-invoking a persistent group in P2P client role, the new pref=<MHz> parameter can now be used with the p2p_invite command to indicate a preferred operating frequency. Unlike the older freq=<MHz> parameter, this leaves GO an option to select another channel (from our supported channels) if the GO cannot accept the channel. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Fix disconnection event processingJouni Malinen2012-08-311-3/+3
| | | | | | | | | | | | | | | | | | | Commit 0d30cc240fa36905b034dc9676f9d8da0ac18e56 forced wpa_s->current_ssid and wpa_s->key_mgmt to be cleared in wpa_supplicant_mark_disassoc() which gets called from wpa_supplicant_event_disassoc(). This broke IEEE 802.1X authentication failure processing and P2P deauthentication notification (group termination). Fix this by splitting wpa_supplicant_event_disassoc() into two parts and make wpas_p2p_deauth_notif() indicate whether the interface was removed. If so, the last part of disassocition event processing is skipped. Since the wpa_supplicant_mark_disassoc() call is in the second part, the above mentioned issues are resolved. In addition, this cleans up the P2P group interface removal case by not trying to use fast reconnection mechanism just before the interface gets removed. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow p2p_invite-persistent to specify channel for GOJouni Malinen2012-08-311-1/+2
| | | | | | | The freq and ht40 parameters can now be used with the p2p_invite command when reinvoking a persistent group as the GO. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WFD: Add support for sending Wi-Fi Display service discovery requestsJouni Malinen2012-08-291-0/+2
| | | | | | | | | | | | | | | wpa_cli p2p_serv_disc_req command can now be used to request WSD request to be sent to specified or all peers who support WSD. format: wifi-display <list of roles> <list of subelements> examples: p2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source] 2,3,4,5 p2p_serv_disc_req 02:01:02:03:04:05 wifi-display [pri-sink] 3 p2p_serv_disc_req 00:00:00:00:00:00 wifi-display [sec-source] 2 p2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source+sink] 2,3,4,5 p2p_serv_disc_req 00:00:00:00:00:00 wifi-display [source][pri-sink] 2,3,4,5 Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>