aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/p2p_supplicant.c
Commit message (Collapse)AuthorAgeFilesLines
...
* D-Bus: Add InvitationReceived SignalManeesh Jain2015-09-271-0/+4
| | | | | | | | This is equivalent to the P2P_EVENT_INVITATION_RECEIVED signal on the control interface. It can be used to sent the Invitation Received signal to applications written using D-Bus. Signed-off-by: Maneesh Jain <maneesh.jain@samsung.com>
* P2P: Add D-Bus signal GroupFormationFailureNishant Chaprana2015-09-051-0/+4
| | | | | | | This is similar to the control interface event P2P-GROUP-FORMATION-FAILURE. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* P2P: Request fresh scan results after GO NegotiationJouni Malinen2015-08-211-4/+8
| | | | | | | | | | | | The P2P group is not yet operating when going through GO Negotiation exchange. Previously, an old cached scan result could be used to skip the scan immediately after the GO Negotiation. While this is quite unlikely to happen in practice, we can easily force a scan here now with the generic scan_min_time mechanism. Do that to avoid any corner cases that a previous instance of the group could have if found in cached scan results. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Require fresh scan results for persistent group re-invocationJouni Malinen2015-08-211-7/+11
| | | | | | | | | | | | | | | | | | 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>
* P2PS: Consider WPS P2PS method when joining a groupAndrei Otcheretianski2015-08-141-0/+3
| | | | | | | | | If P2PS PD concludes to use default P2PS method wpas_p2p_scan_res_join() ignores this value and tries to perform a redundant legacy PD. Fix this by considering WPS_P2PS method too. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Support driver preferred freq list for invitation caseAhmad Kholaif2015-08-111-0/+1
| | | | | | | | When using P2P invitation to re-invoke a persistent P2P group without specifying the operating channel, query the driver for the preferred frequency list, and use it to select the operating channel of the group. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Support driver preferred freq list for Autonomous GO caseAhmad Kholaif2015-08-101-0/+32
| | | | | | | | When starting an autonomous GO without specifying the operating channel, query the driver for the preferred frequency list, and use it to select the operating channel of the GO (if supported). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Authorize any peer for P2PS method if interface address not knownAndrei Otcheretianski2015-08-061-21/+36
| | | | | | | | | | | | | | | | | When P2PS PD with default P2PS method is done, the peer that becomes GO should authorize the client. However, P2PS specification doesn't require the client to include its intended interface address in PD Request/Response. As a result, the P2P Client's interface address may not be known and any address may need to be authorized. Previously, client's P2P Device Address was used for authorization, which is not correct when a dedicated interface is used for P2P Client. This is not resulting in a connection failure, however it causes a significant delay (until WPS_PIN_TIME_IGNORE_SEL_REG elapses). Fix this by authorizing the intended interface address, if known; or any address, if not known. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* P2PS: Clean up intended interface address passing to p2ps_prov_completeJouni Malinen2015-08-061-2/+2
| | | | | | | | Use NULL to indicate if the address is not available instead of fixed 00:00:00:00:00:00. wpas_p2ps_prov_complete() already had code for converting NULL to that all zeros address for event messages. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not perform P2P GO CS in some casesIlan Peer2015-08-041-8/+28
| | | | | | | | | | | | 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>
* P2P: Disallow GO CS immediately after GO Negotiation or invitationIlan Peer2015-08-041-0/+41
| | | | | | | | | | | | | | | A newly created GO might move to another channel before the client was able to connect to it. This creates a situation where the client searches the GO on the channel agreed upon during GO Negotiation or invitation signaling, while the GO is on another channel. This in turn might lead to delayed connection or connection failure and group removal. Fix this by disallowing a GO CS as long as there is some activity that should delay the switch. If a GO move is not allowed, set a timeout to re-attempt the move. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Consider channel optimizations for additional casesIlan Peer2015-08-041-52/+35
| | | | | | | | Re-factor the code, so channel optimizations would be also triggered upon the following changes: channel updates from the kernel, disallow_freq interface, etc. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Modify wpas_p2p_init_go_params()Ilan Peer2015-08-031-99/+164
| | | | | | | | | Not all paths in wpas_p2p_init_go_params() verified that the candidate frequency can be used for GO purposes. Fix this, and in addition re-factor the code to put better emphasis on the frequency selection priorities. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Move a GO to a frequency that is also supported by the clientIlan Peer2015-08-031-43/+52
| | | | | | | | | A P2P GO interface that was instantiated after a GO Negotiation or Invitation holds the intersection of frequencies between the GO and the client. In case the GO is going to move to another frequency, allow it to move only to a frequency that is also supported by the client. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Add a function to compute the group common freqsIlan Peer2015-08-031-0/+30
| | | | | | | | Add a function to compute the group common frequencies, and use it to update the group_common_frequencies as part of the channel switch flows. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Move a GO from its operating frequencyIlan Peer2015-08-031-1/+218
| | | | | | | | | | | | | | | | | | | | | | | | | | | Upon any change in the currently used channels evaluate if a GO should move to a different operating frequency, where the possible scenarios: 1. The frequency that the GO is currently using is no longer valid, due to regulatory reasons, and thus the GO must be moved to some other frequency. 2. Due to Multi Concurrent Channel (MCC) policy considerations, it would be preferable, based on configuration settings, to prefer Same Channel Mode (SCM) over concurrent operation in multiple channels. The supported policies: - prefer SCM: prefer moving the GO to a frequency used by some other interface. - prefer SCM if Peer supports: prefer moving the GO to a frequency used by some other station interface iff the other station interface is using a frequency that is common between the local and the peer device (based on the GO Negotiation/Invitation signaling). - Stay on the current frequency. Currently, the GO transition to another frequency is handled by a complete tear down and re-setup of the GO. Still need to add CSA flow to the considerations. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Cancel group formation when deleting a group during group formationMichael Olbrich2015-08-021-0/+1
| | | | | | | Otherwise P2P remains in provisioning state and continues to skip extended listening forever. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
* P2P: Do not clear wpa_s->go_dev_addr before group removalJouni Malinen2015-08-021-7/+8
| | | | | | | | | | | | | | | This variable is needed to figure out whether a wpa_supplicant interface is for a P2P group that is (or was) connected to a specific GO. The previous implementation was able to find such a case only when there was an association with the GO. However, this may be needed even if there is a temporary disconnection from the GO. Keep the GO device address information over such temporary disconnections and only remove it on group termination. This fixes an issue with D-Bus Peer PropertiesChanged signals for the Groups property in case a P2P group gets removed due to group idle timeout instead of explicit group termination command (local request) or GO notification. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Expose driver preferred frequency list fetch to P2PAhmad Kholaif2015-07-301-0/+12
| | | | | | | | This adds a callback function that can be used from the P2P module to request the current preferred list of operating channels from the driver. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Use preferred frequency list from the local driverAhmad Kholaif2015-07-301-5/+61
| | | | | | | | | If the driver supports the preferred frequency list extension, use this information from the driver when no explicitly configured preference list (p2p_pref_chan) is present for P2P operating channel selection. This commit adds this for GO Negotiation and Invitation use cases. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Inform driver of the operating channel following group formationAhmad Kholaif2015-07-291-0/+5
| | | | | | | | Upon GO Negotiation completion, if the remote peer becomes GO, send a hint event over QCA vendor specific interface to inform the driver of the likely operating channel of the P2P GO. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2PS: Add feature capability to PD eventsMax Stepanov2015-07-261-16/+49
| | | | | | | | | | | Report the feature capability on P2PS-PROV-START and P2PS-PROV-DONE ctrl-iface events. A feature capability value is specified as 'feature_cap=<hex>' event parameter, where <val> is a hexadecimal string of feature capability bytes in a PD Response frame. 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>
* P2PS: Set intended interface address correctly for new groupAndrei Otcheretianski2015-07-071-4/+11
| | | | | | | | | | | | | | | | | | If a device may be an explicit GO, it adds the GO details in the PD Request. First, we try to reuse an active GO. If it is not present, we try to reuse a non-active persistent group. In the latter case, if a dedicated P2P interface is needed, the intended address should be that of the pending interface. However, the wpas_get_go_info() provided the ssid->bssid address, which is the address of the P2P device. This might result in an incorrect intended interface attribute in the PD Request in case a separate group interface is used. Fix this by setting group_iface variable to true only if a dedicated interface should be used and set the attribute accordingly. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Max Stepanov <Max.Stepanov@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2PS: Add PD Response validationAndrei Otcheretianski2015-07-071-0/+8
| | | | | | | | | Validate the PD Response frame contents more thoroughly when it is used for P2PS. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Max Stepanov <Max.Stepanov@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2PS: Add intended iface address during PD for persistent groupAndrei Otcheretianski2015-07-071-1/+15
| | | | | | | | | | When persistent group is used and the peer is GO in this group, intended interface attribute should be added to PD request/response. Not doing so violates the spec. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Max Stepanov <Max.Stepanov@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2PS: Fix P2PS-PROV-DONE event on GOAndrei Otcheretianski2015-07-071-5/+16
| | | | | | | | | | | | | If after P2PS PD the device should become a GO it sends P2PS-PROV-DONE event which contains the GO interface name. If the GO isn't running yet the device may use pending interface name. However, when the GO is started, pending interface name will be removed. Fix the GO interface name in P2PS-PROV-DONE event by copying the interface name instead of saving the pointer. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2PS: Use wpas_p2p_create_iface() to check if dedicated iface is neededAndrei Otcheretianski2015-07-071-2/+2
| | | | | | | | | Call wpas_p2p_create_iface() instead of just checking p2p_no_group_iface config value. Not doing so, resulted in an incorrect behavior when the driver sets WPA_DRIVER_FLAGS_DEDICATED_P2P_DEVICE flag. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Handle P2P Device dedicated interface parent removalIlan Peer2015-06-191-1/+0
| | | | | | | | | | | | | | | | | In case of a network interface removal, check if the interface was also the parent interface of the P2P Device dedicated interface. If this is the case, then stop the P2P Device functionality, and remove the P2P Device dedicated interface. In case that the interface is added again and P2P Device functionality can be enabled again, add a new P2P Device dedicated interface and allow further P2P Device functionality. In case that the P2P Device dedicated interface is re-created, the original P2P Device configuration file is needed, so store it in the global params (instead in the wpa_interface configuration). Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix secondary channel selection for HT40Eliad Peller2015-06-191-1/+2
| | | | | | | | | wpas_p2p_get_ht40_mode() used blacklist approach (bw != BW20) to find the relevant op_class, but didn't take into account other non-BW40 cases, like BW80, that had been added to the bw enum after the initial implementation. Fix this by looking for the specific BW40 bw cases. Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
* P2P: Use the P2P Device interface in wpas_p2p_fallback_to_go_neg()Ilan Peer2015-06-191-1/+1
| | | | | | | Previously the wpa_s->parent interface was used, which is not necessarily the P2P Device management interface. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix group interface addition failure properly for concurrent caseJouni Malinen2015-06-151-10/+15
| | | | | | | | | | | 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: Specify frequency when sending Probe Response frameAndrei Otcheretianski2015-06-141-2/+4
| | | | | | | | | | If the RX frequency of the Probe Request frame is known, specify it when sending the Probe Response frame. This is needed when the Probe Request frame is received on another virtual interface, for example, when a GO or P2PS client are discoverable on the group operating channel. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2PS: Enable Probe Request frame processing by P2P ClientMax Stepanov2015-06-141-1/+9
| | | | | | | | | | | | | | | | 1. Add global p2p_cli_probe property to enable/disable Probe Request frame RX reporting for connected P2P Clients. The property can be set to 0 - disable or 1 - enable. The default value is 0. 2. Enable Probe Request frame RX reporting for P2P Client on WPA_COMPLETED state if p2p_cli_probe property is set to 1. Disable it when an interface state is changing to any other state. 3. Don't cancel Probe Request frame RX reporting on wpa_stop_listen for a connected P2P Client handling Probe Request frames. Signed-off-by: Max Stepanov <Max.Stepanov@intel.com> Reviewed-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Add rx_freq parameter to Probe Request frame handlerMax Stepanov2015-06-141-2/+3
| | | | | | | | | | | 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>
* P2P: Update target GO Device Address from BSS entry during joinJouni Malinen2015-06-141-0/+15
| | | | | | | | | | | | It is possible for P2P_CONNECT-join command to be issued on a GO's P2P Interface Address before the P2P peer entry is available to map this into the GO's P2P Device Address. This could result in the join operation failing to continue after receiving PD Response due to the address mismatch (source address = P2P Device Address while only the P2P Interface Address is known). Fix this by updating the pending join P2P Device Address based on the BSS entry, if needed. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Add Operating class 125 for P2P supported channelsAmr BEN ABDESSALEM2015-06-121-0/+2
| | | | | | | | | Add operating class 125 (channels 149..169) to the list of P2P supported channels. This allows the 5 GHz channels 161 and 169 to be used for P2P GO when those channels are allowed for AP mode in the current regulatory domain. Signed-off-by: Amr BEN ABDESSALEM <amrx.ben.abdessalem@intel.com>
* P2P: Add GO Intent of connecting device in GO Negotiation Request eventMAYANK HAARIT2015-06-061-3/+5
| | | | | | | | | Add GO Intent information of connecting device in GO Negotiation Request event which will help applications to decide its own GO intent value in advance and can avoid failure cases when both devices use GO Intent 15 depending on application requirement. Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
* P2P: Restart group formation timer upon receiving new Inv ReqKrishna Vamsi2015-05-291-0/+17
| | | | | | | | | | A new Invitation Request might be received on a just started persistent group if the previous Invitation Response sent isn't received at the peer (GO of the persistent group). When the peer sends an Invitation Request again, treat it as start of group formation and restart the group formation timer at this point of time. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Use p2p_init_wpa_s for P2P command redirection over D-BusIlan Peer2015-05-251-1/+0
| | | | | | | | | | | | | D-Bus used the p2p_dev member in struct wpa_supplicant to track the interface used for P2P Device operations. However, this is not needed as the interface used for P2P Device operations is stored in struct wpa_global->p2p_init_wpa_s. Replace all the redirections to wpa_s->p2p_dev with redirections to wpa_s->global->p2p_init_wpa_s and removed this member as it is no longer needed. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix wpas_remove_persistent_peer() to use P2P mgmt interfaceIlan Peer2015-05-251-2/+3
| | | | | | | | | | | The function used wpa_s->parent->conf to iterate the P2P networks and update the configuration file. However, wpa_s->parent is not necessarily the interface used to manage the P2P Device operations. Fix this by accessing the configuration file of the interface initialized to manage the P2P Device operations. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix wpas_p2p_add_persistent_group_client() to use P2P mgmt interfaceIlan Peer2015-05-251-3/+4
| | | | | | | | | | | The function used wpa_s->parent->conf to iterate the P2P networks and update the configuration file. However, wpa_s->parent is not necessarily the interface used to manage the P2P Device operations. Fix this by accessing the configuration file of the interface initialized to managed the P2P Device operations. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Fix wpas_p2p_set_own_freq_preference() to use P2P mgmt interfaceIlan Peer2015-05-251-1/+5
| | | | | | | | | | | wpas_p2p_set_own_freq_preference() accessed wpa_s->parent->conf to test if p2p_ignore_shared_freq is set, but wpa_s->parent is not necessarily the interface used to manage the P2P Device operations. Fix this by accessing the configuration file of the interface initialized to manage the P2P Device operations. Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Use the P2P Device management interface in wpas_p2p_remove_client()Ben Rosenfeld2015-05-251-3/+4
| | | | | | | | | As wpas_p2p_remove_client() is not necessarily called from the interface used to manage the P2P Device operations, when removing a client, use the P2P management interface to iterate over the saved networks and remove the relevant entries form the P2P GO network blocks. Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
* P2P: Add D-Bus FindStopped to notify P2P-FIND-STOPPED eventNishant Chaprana2015-05-251-0/+1
| | | | | | | Add D-Bus notification mechanism of P2P-FIND-STOPPED event on fi.w1.wpa_supplicant1.Interface.P2PDevice interface. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* P2P: Advertize cross connection to WLAN AP on a non-P2P interfaceSunil Dutt2015-05-251-1/+5
| | | | | | | | | | | Commit 1c2aa04c96626f5b000d167bb5274a8c39b7dac2 ('P2P: Do not add P2P IEs on P2P disabled interface') removed the P2P IEs from association on non-P2P interface. However, an AP functioning as a P2P manager needs the cross connection capability of the station (P2P Device). This needs to be done to meet the P2P specification requirements even if the station interface has p2p_disabled=1 in case P2P in general is enabled. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow wpa_supplicant to start if social channels are not supportedJouni Malinen2015-04-261-3/+3
| | | | | | | | | | It was possible for an nl80211-based driver to be determined to support P2P even when the radio supports only the 5 GHz band. This resulted in P2P initialization failing due to not being able to pick a social channel and wpa_supplicant not starting. Fix this by not enabling P2P, but still allowing wpa_supplicant initialization to complete. Signed-off-by: Jouni Malinen <j@w1.fi>
* Declare all read only data structures as constMikael Kanstrup2015-04-251-3/+3
| | | | | | | | By analysing objdump output some read only structures were found in .data section. To help compiler further optimize code declare these as const. Signed-off-by: Mikael Kanstrup <mikael.kanstrup@sonymobile.com>
* P2P: Optimize scan frequencies list when re-joining a persistent groupAvraham Stern2015-03-291-8/+16
| | | | | | | | | | | When starting a P2P client to re-join a persistent group (P2P_GROUP_ADD persistent=<id>), it is possible that the P2P GO was already found in previous scans. Try to get the P2P GO operating frequency from the scan results list so wpa_supplicant will initially scan only the P2P GO known operating frequency. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Ilan Peer <ilan.peer@intel.com>
* P2P: Move upper layer SD interaction into a separate fileJouni Malinen2015-03-151-1221/+0
| | | | | | | | 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>
* DFS offload: P2P changes for autonomous GOAhmad Kholaif2015-03-051-9/+43
| | | | | | | Add P2P changes to allow bringing up P2P autonomous GO on a DFS channel if DFS functionality is offloaded to the driver. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>