aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/p2p_supplicant.c
Commit message (Collapse)AuthorAgeFilesLines
* P2P: Pass HE flag to GO negotiation resultYu Wang2019-07-291-0/+2
| | | | | | | In order to set up P2P connection with HE capability, the 'he' flag should be passed to GO negotiation result. Signed-off-by: Yu Wang <yyuwang@codeaurora.org>
* P2P: Force p2p-send-action as the next radio work to executeSunil Dutt2019-05-311-1/+1
| | | | | | | | | | | | | | This increases the priority of the p2p-send-action radio work, i.e., the radio work used for transmitting potentially offchannel P2P Action frames by marking it as the next radio work to execute. This is to avoid the delay in transmissions due to already queued offchannel radio work items in the queue. In particular, this means not having to wait for a pending p2p-scan radio work to be executed before the new P2P Action frame can be transmitted. This helps in avoiding timeouts on the peer device when a P2P Action frames is received during other activity on the device. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* P2P: Reject p2p-send-action work while other one is pendingSunil Dutt2019-05-311-1/+1
| | | | | | | | | | | | | | | | | The previous implementation rejects the p2p-send-action work while there is already one in progress (wpas_send_action_cb() has already been called for it to start operation). Enhance the same to also consider any p2p-send-action works pending in the radio work (i.e., waiting for that wpas_send_action_cb() call). This is considering the current behaviour of P2P to handle the state corresponding to respective Action frame transmission: pending_action_state. If a new P2P Action frame transmission is queued while there is another one already in the queue, the transmit status of the first frame is wrongly intepreted by the P2P state machine which has already scheduled/queued another frame for transmission. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* HE: Remove VHT_ prefix from CHANWITDH_* defineJohn Crispin2019-05-271-4/+4
| | | | | | | | The bandwidth values are shared between VHT and HE mode so remove the VHT specific prefix. Signed-off-by: Shashidhar Lakkavalli <slakkavalli@datto.com> Signed-off-by: John Crispin <john@phrozen.org>
* P2PS: Cleanup pending_p2ps_group flagAndrei Otcheretianski2019-04-151-2/+7
| | | | | | | | | | | | | pending_p2ps_group flag is not always cleaned, which may later result in an unexpected GO bring up, after PD response is transmitted in wpas_prov_disc_resp_cb(). This can be seen when running the following hwsim tests together: - p2ps_channel_sta_connected_disallow_freq_mcc - p2ps_channel_active_go_and_station_different_mcc Fix this by clearing pending_p2ps_group flag also when processing new PD requests. In addition, set this flag only when really needed. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* D-Bus: Fix P2P GroupStarted signal not to use uninitialized IP bufferJouni Malinen2019-04-151-2/+3
| | | | | | | | | | | | wpas_p2p_completed() used wpa_sm_get_p2p_ip_addr() return value properly for filling in the ip_addr[] string only if the IP addresses got assigned, but the raw ip[] array was passed to wpas_dbus_signal_p2p_group_started() regardless of whether the IP addresses were assigned. This could result in using uninitialized stack memory for constructing the GroupStarted signal values. Fix this by filling those in only if the IP addressed are actually available. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* P2P: Fix ACS offloading behavior with p2p_no_group_iface=1Jayachandran Sreekumaran2019-03-131-0/+1
| | | | | | | | | | | | | wpa_s->p2p_go_do_acs was not cleared during P2P group deletion and that resulted in the case of no separate group interface continuing to assume ACS was to be used for consecutive GO starts even if they tried to specify a frequency. Fix this by explicitly clearing wpa_s->p2p_go_do_acs during P2P group deletion and also clear this when processing the P2P_GROUP_ADD if the parameters do not request ACS to be used. Fixes: 37ed3254de22 ("P2P: ACS offload for the autonomous GO") Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* wpa_supplicant: Support Multi-AP backhaul STA onboarding with WPSDavina Lu2019-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Wi-Fi Alliance Multi-AP Specification v1.0 allows onboarding of a backhaul STA through WPS. To enable this, the backhaul STA needs to add a Multi-AP IE to the WFA vendor extension element in the WSC M1 message that indicates it supports the Multi-AP backhaul STA role. The Registrar (if it support Multi-AP onboarding) will respond to that with a WSC M8 message that also contains the Multi-AP IE, and that contains the credentials for the backhaul SSID (which may be different from the SSID on which WPS is performed). Introduce a new parameter to wpas_wps_start_pbc() and allow it to be set via control interface's new multi_ap=1 parameter of WPS_PBC call. multi_ap_backhaul_sta is set to 1 in the automatically created SSID. Thus, if the AP does not support Multi-AP, association will fail and WPS will be terminated. Only wps_pbc is supported. This commit adds the multi_ap argument only to the control socket interface, not to the D-Bus interface. Since WPS associates with the fronthaul BSS instead of the backhaul BSS, we should not drop association if the AP announces fronthaul-only BSS. Still, we should only do that in the specific case of WPS. Therefore, add a check to multi_ap_process_assoc_resp() to allow association with a fronthaul-only BSS if and only if key_mgmt contains WPS. Signed-off-by: Davina Lu <ylu@quantenna.com> Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Cc: Marianna Carrera <marianna.carrera.so@quantenna.com>
* P2P: Stop listen state if Action frame TX is needed on another channelJouni Malinen2019-02-171-5/+12
| | | | | | | | | | | | | | | | This speeds up P2P responses to frames received on an operating channel in case there is an ongoing P2P listen operation on another channel. This is applicable to drivers that support multiple channels in concurrently. This addresses an issue showing up in the p2ps_channel_active_go_and_station_different_mcc test case where the Provision Discovery Request frame can be received on the operating channel of a group instead of the Listen channel. The response was delayed until the listen operation timed out and this took too long time for the peer to receive the response. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Allow the avoid channels for P2P discovery/negotiationPurushottam Kushwaha2019-01-301-4/+11
| | | | | | | | | | | | | | | The avoid channels are notified through QCA_NL80211_VENDOR_SUBCMD_AVOID_FREQUENCY allow minimal traffic, so enhance the P2P behavior accordingly by considering these avoid frequencies for P2P discovery/negotiation as long as they are not in disallowed frequencies list. Additionally, do not return failure when none of social channels are available as operation channel, rather, mark the op_channel/op_reg_class to 0 as this would anyway get selected during the group formation in p2p_prepare_channel. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* P2P: support random interface addressJimmy Chen2019-01-121-0/+30
| | | | | | | | | | To enhance privacy, generate a random interface for each group. There are two configurations are introduced: * p2p_interface_random_mac_addr enable interface random MAC address feature, default disable. Signed-off-by: Jimmy Chen <jimmycmchen@google.com>
* P2P: Support random device addressJimmy Chen2019-01-121-0/+54
| | | | | | | | | | | | | | | 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-17/+26
| | | | | | | | 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>
* P2PS: Notify D-Bus about removal of a stale/empty persistent groupJouni Malinen2019-01-041-0/+18
| | | | | | | | During P2PS PD Request processing wpa_supplicant removes stale and empty persistent groups, but it did not notify D-Bus to unregister object. Fix this by adding the missing notifications. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2PS: Notify D-Bus about removal of a stale persistent groupAmit Khatri2019-01-041-0/+4
| | | | | | | | | | | | | During P2PS PD Request processing wpa_supplicant removes stale persistent groups, but it did not notify D-Bus to unregister object. This can result in leaving behind objects pointing to freed memory and memory leaks. Sometime it can cause a crash in wpa_config_get_all() function and DBUS_ERROR_OBJECT_PATH_IN_USE errors. Fix this by adding the missed notification to D-Bus code to unregister the object. Signed-off-by: Amit Khatri <amit7861234@gmail.com>
* P2P: Set global->p2p_group_formation in wpas_p2p_join_start() for p2pdevAloni, Adiel2019-01-011-9/+10
| | | | | | | | | | | | | When a dedicated P2P device interface is used, the global->p2p_group_formation was not set in wpas_p2p_join_start() if no separate group interface is used. This would cause that in case of a failure in group formation, the cleaning of p2p_in_provisioning is done on the wrong interface. Furthermore, P2P_CANCEL command could not be used to stop such a group-join operation. Fix this by setting the global->p2p_group_formation correctly in case that the group interface is reusing wpa_s->parent. Signed-off-by: Adiel Aloni <adiel.aloni@intel.com>
* P2P: Use more compact debug print of common group frequenciesJouni Malinen2018-06-151-5/+14
| | | | | | | Print the list of frequencies on a single line instead of one line per frequency. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* P2P: Improve common group channel selection if GO needs to be movedJouni Malinen2018-06-151-0/+87
| | | | | | | | | | | | Prefer channels that support VHT80 (and secondarily, HT40 on the same band) over other common group channels. If no such channel is found, prefer any channel that uses the same band so that CSA can be used. This improves the case where a P2P GO needs to move to another channel and there is no other reason (e.g., preferred channel from the driver or an already used channel from a virtual interface sharing the same radio) to pick a specific channel. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* Silence a gcc warning on switch statement fallthroughJouni Malinen2018-05-151-0/+1
| | | | | | | Add an explicit comment noting a previously undocumented fallthrough to not trigger an implicit-fallthrough warning. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* DFS: Mark channels required DFS based on reg-domain info from the drivermazumdar2018-04-231-4/+7
| | | | | | | | | | | | Mark a channel as required DFS based on regulatory information received from the driver/kernel rather than deciding based on hardcoded boundaries on the frequency. Previously few channels were being marked as requiring DFS even though they were non-DFS in a particular country. If the driver does not provide channel list information, fall back to the previously used frequency-based determination. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
* P2P: ACS offload for the autonomous GOSunil Dutt2017-11-031-3/+11
| | | | | | | | | | | | This commit introduces the ACS functionality for the autonomous GO. The optional parameter <freq> in p2p_group_add is enhanced to carry a value "acs" with the intention to select the channels among any supported band. freq = 2 / 5 carry the need to select the channels only in the respective bands 2.4 / 5 GHz. This functionality is on top of the host driver's capability to offload ACS, which is advertized through WPA_DRIVER_FLAGS_ACS_OFFLOAD. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not mark DFS channel as invalid if DFS is offloaded to driverSunil Dutt2017-10-111-2/+6
| | | | | | | | While considering the movement of P2P GO from its current operating channel, do not mark a DFS channel as invalid if DFS is offloaded to the driver. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Prefer 5/60 GHz band over 2.4 GHz during GO configurationSunil Dutt2017-10-111-24/+24
| | | | | | | | | | | | | | | | | | Previously, wpas_p2p_select_go_freq_no_pref() ended up selecting a 2.4 GHz band channel first before even considering 5 or 60 GHz channels. This was likely done more or less by accident rather than by design when the 5 GHz and 60 GHz band extensions were added. It seems reasonable to enhance this by reordering the code to start with 5 and 60 GHz operating classes and move to 2.4 GHz band only if no channel was available in 5 or 60 GHz bands for P2P GO use. This does have some potential interop issues with 2.4 GHz only peer devices when starting up an autonomous GO (i.e., without there being prior knowledge of channels that the peers support). Upper layers are expected to enforce 2.4 GHz selection if that is needed for some use cases. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow GO to advertise Interworking elementSunil Dutt2017-10-051-0/+5
| | | | | | | | | This adds new wpa_supplicant configuration parameters (go_interworking, go_access_network_type, go_internet, go_venue_group, go_venue_type) to add a possibility of configuring the P2P GO to advertise Interworking element. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow auto GO on DFS channels if driver supports thisSunil Dutt2017-07-071-20/+21
| | | | | | | | | | | | | | | If a DFS forced frequency is provided in 'p2p_group_add' and the driver supports DFS offload, the frequency was rejected in wpas_p2p_init_go_params(). However, it was accepted in wpas_p2p_select_go_freq() and wpas_p2p_group_add(). To make the behavior consistent, the DFS frequency is now accepted in wpas_p2p_init_go_params() similar to the way done in wpas_p2p_select_go_freq(). Redundant check in wpas_p2p_group_add() for DFS forced frequency is removed. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Debug print P2P_FIND rejection reasonJouni Malinen2017-06-131-1/+7
| | | | | | | This can be helpful in figuring out what happened if P2P_FIND operation is unexpectedly rejected. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Fix p2p_in_provisioning clearing in failure caseWu Gao2017-06-131-0/+4
| | | | | | | | | | | | | | | | | | | | wpa_s->p2p_in_provisioning needs to be cleared when group formation fully completes. The change to postpone GO side handling to the first data connection in commit 41f853235fe1d1fad1acecc0ee5dfe81c872c6b2 ('P2P: Extend group formation timeout on GO to first data connection') resulted in making this not happen in one P2P Client side case: EAP-WSC timeout in PBC case. While that is quite special case since it requires 30 second timeout without receiving new EAPOL frames and not getting disassociation, it can apparently happen in some cases in practice. This would result in new P2P operations (e.g., P2P_FIND) getting rejected until wpa_supplicant is restarted. Fix this by clearing wpa_s->p2p_in_provisioning whenever processing a group formation failure case. For group formation success, wpa_s->p2p_in_provisioning is left set to non-zero value to avoid breaking the earlier limits on the GO side. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: wpas_p2p_select_go_freq() to check for supported pref_freqSunil Dutt2017-05-271-2/+4
| | | | | | | | | | | | | | | | | | This commit is similar to the commit 783c2920cc9117b663506dc82223867bfa792a5d ('P2P: Check if the pref_freq reported by the driver supports P2P') but extends the check for supported pref_freq to wpas_p2p_select_go_freq(). This avoids issues with P2P_GROUP_ADD ending up selecting an unexpected channel when get_pref_freq_list() (i.e., QCA_NL80211_VENDOR_SUBCMD_GET_PREFERRED_FREQ_LIST) is used. Filter the list by removing channels that do not allow P2P operation at all. Previously, only the explicitly disallowed channels were removed and that could have resulted in selecting an operating channel that is not allowed for P2P and failing to complete the operation to start the group. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Clear driver scan cache after BSS_FLUSHJouni Malinen2017-02-071-0/+13
| | | | | | | | | | | | | The only_new_results=1 scan parameter was previously set on other scan cases, but not on the two P2P specific scan triggers. Set this also for those P2P cases to get consistent behavior after BSS_FLUSH. This was showing up with number of hwsim P2P test cases maintaining unexpected scan results from previous test cases due to the flush operation not really working correctly since the cfg80211 BSS table was not explicitly cleared. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_supplicant: Extend verify_channel() and make it globalAvraham Stern2017-01-031-4/+0
| | | | | | | | | Extend verify_channel() to return whether IR is allowed on the channel or not, and make it a global function so it can be used in other files, too. This makes this function useful for checking not only if a channel is supported but also if it is allowed for active and passive scan. Signed-off-by: Avraham Stern <avraham.stern@intel.com>
* P2P: Fix a theoretical out of bounds read in wpas_p2p_select_go_freq()Amit Purwar2016-12-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | Commit 8e84921efe652233703588852bc43c36ccb241df ('P2P: Support driver preferred freq list for Autonomous GO case') introduced this loop to go through preferred channel list from the driver. The loop does bounds checking of the index only after having read a value from the array. That could in theory read one entry beyond the end of the stack buffer. Fix this by moving the index variable check to be done before using it to fetch a value from the array. This code is used only if wpa_supplicant is build with CONFIG_DRIVER_NL80211_QCA=y and if the driver supports the vendor extension (get_pref_freq_list() driver op). In addition, the driver would need to return more than P2P_MAX_PREF_CHANNELS (= 100) preferred channels for this to actually be able to read beyond the buffer. No driver is known to return that many preferred channels, so this does not seem to be reachable in practice. Signed-off-by: Amit Purwar <amit.purwar@samsung.com> Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
* P2P: Fix a theoretical out of bounds read in wpas_p2p_setup_freqs()Amit Purwar2016-12-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | Commit 370017d968e071522357ea88c0c6aaed02853222 ('P2P: Use preferred frequency list from the local driver') introduced this loop to go through preferred channel list from the driver. The loop does bounds checking of the index only after having read a value from the array. That could in theory read one entry beyond the end of the stack buffer. Fix this by moving the index variable check to be done before using it to fetch a value from the array. This code is used only if wpa_supplicant is build with CONFIG_DRIVER_NL80211_QCA=y and if the driver supports the vendor extension (get_pref_freq_list() driver op). In addition, the driver would need to return more than P2P_MAX_PREF_CHANNELS (= 100) preferred channels for this to actually be able to read beyond the buffer. No driver is known to return that many preferred channels, so this does not seem to be reachable in practice. Signed-off-by: Amit Purwar <amit.purwar@samsung.com> Signed-off-by: Mayank Haarit <mayank.h@samsung.com>
* Add support to abort vendor scanSunil Dutt2016-11-301-0/+2
| | | | | | | | | | | | | | | | | | | This commit enhances the existing implementation of abort scan to also abort concurrent active vendor scans. This is achieved by passing the the scan_cookie to the driver interface with the intention to abort the specific scan request. This scan_cookie is returned from the driver interface when the scan request is scheduled. This scan_cookie is 0 if the scan is triggered through the upstream cfg80211 interface. Thus, the scan_cookie is used to determine whether to abort the cfg80211 or vendor scan request. Also, the previous implementation of relying on scan_work/p2p_scan_work for the active work to trigger the abort scan is enhanced to check for the started state of either of these work operations. This should also help to abort the concurrent active scan/p2p-scan operations. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* D-Bus: Send P2P IP address assignment info with GroupStarted eventNishant Chaprana2016-11-211-3/+4
| | | | | | | This commit adds IP address information into GroupStarted event on the P2P client side like it is sent over the control interface. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* wpa_supplicant: Use correct interface type when creating P2P interfaceAvrahams Stern2016-10-281-1/+1
| | | | | | | | | | | | | | | When starting ASP provisioning with connection capability set to NEW, don't create the pending P2P interface as a GO interface because Go negotiation will determine which side will be the GO and it is possible that eventually this interface will become the client. In this case, when the P2P client is started it will start scanning and do other station specific operations while the interface type is AP. Instead, use type WPA_IF_P2P_GROUP when creating the interface which means the interface type will be determined later. Signed-off-by: Avrahams Stern <avraham.stern@intel.com>
* P2P: Check if the pref_freq reported by the driver supports P2PSunil Dutt2016-10-241-2/+4
| | | | | | | | | | | | Filter out get_pref_freq_list() (i.e., QCA_NL80211_VENDOR_SUBCMD_GET_PREFERRED_FREQ_LIST) output in case of channel negotiation by removing channels that do not allow P2P operation at all. Previously, only the explicitly disallowed channels were removed and that could have resulted in selecting an operating channel that is not allowed for P2P and failing to complete the operation to start the group. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Fix compilation warning in p2p_supplicant.cMax Stepanov2016-09-221-1/+1
| | | | | | | On some architectures unsigned int differs from size_t, and some compilers warn about it. Signed-off-by: Max Stepanov <Max.Stepanov@intel.com>
* P2P: Fix D-Bus persistent parameter in group started event on GOJouni Malinen2016-09-211-1/+1
| | | | | | | | | | | | | | | | | When starting a P2P GO, the struct p2p_go_neg_results may use persistent_group == 2 to indicate use of persistent reconnect. Setting ssid->p2p_persistent_group based on this did not take into account this special case and that ended up in D-Bus code trying to encode 2 as a DBUS_TYPE_BOOLEAN value which results in an assert from the library. Fix this by setting ssid->p2p_persistent_group to 0 or 1 instead of raw params->persistent_group value without any filtering. This is similar to an earlier fix in commit 112fdee738d28c4e8bfb66ad7202d4348c4e7771 ('P2P: Fix D-Bus persistent parameter in group started event') that addressed another code path in sending out this D-Bus signal. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Fix D-Bus persistent parameter in group started eventJouni Malinen2016-08-021-1/+1
| | | | | | | | | | | | wpas_p2p_persistent_group() returns non-zero for persistent groups. This value happens to be 2 instead of 1 due to the P2P_GROUP_CAPAB_PERSISTENT_GROUP value. This ended up with D-Bus code trying to encode 2 as a DBUS_TYPE_BOOLEAN value which results in an assert from the library. Fix this by modifying wpas_p2p_persistent_group() to return 0 or 1 instead of 0 or an arbitrary non-zero. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow P2P listen being offloaded to the driver/firmwarePeng Xu2016-07-031-1/+90
| | | | | | | | | | | | | 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>
* D-Bus: Indicate whether created group is persistent or notNishant Chaprana2016-05-301-17/+12
| | | | | | | | | This adds an extra parameter in GroupStarted signal to indicate whether the created group is Persistent or not. It is similar to the [PERSISTENT] tag which comes in P2P-GROUP-STARTED over the control interface. Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
* P2PS: Allow P2P_CONNECT command for P2PS connection with/without PINPurushottam Kushwaha2016-05-191-0/+3
| | | | | | | | | | | | | This allows using P2PS config method with or without PIN for connection. wpa_supplicant should internally handle the default PIN "12345670" and shall also allow connection irrespective of PIN used in P2P_CONNECT. For example, 1. P2P_CONNECT 02:2a:fb:22:22:33 p2ps 2. P2P_CONNECT 02:2a:fb:22:22:33 xxxxxxxx p2ps Where the second one is maintained for backwards compatibility. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not enable P2P group processing for non-P2P AP modeJouni Malinen2016-05-141-1/+2
| | | | | | | | wpa_supplicant was starting P2P group processing for all AP mode interfaces in CONFIG_P2P=y builds. This is unnecessary and such operations should be enabled only for actual GO interfaces. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Copy config from p2pdev when not using dedicated group interfaceAndrei Otcheretianski2016-04-241-21/+12
| | | | | | | | | | | | | | | | | | | | When the P2P Device interface is used and an existing interface is used for P2P GO/Client, the P2P Device configuration was not cloned to the configuration of the existing interface. Thus, configuration parameters such as idle_group_time, etc., were not propagated to the P2P GO/Client interface. Handle this by copying all configuration parameters of the P2P device interface to the reused interface, with the following exceptions: 1. Copy the NFC key data only if it was not set in the configuration file. 2. The WPS string fields are set only if they were not previously set in the configuration of the destination interface (based on the assumption that these fields should be identical among all interfaces). Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* P2P: Fix wpas_p2p_nfc_auth_join()Andrei Otcheretianski2016-04-241-9/+9
| | | | | | | | | Use the p2pdev pointer instead of the parent pointer to comply with the flows when a dedicated P2P Device interface is used and p2p_no_group_iface == 1 (in which case the parent of the reused interface isn't necessary the same as p2pdev). Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* P2P: Trigger event when invitation is acceptedLior David2016-04-181-0/+19
| | | | | | | | | | Trigger an event when wpa_supplicant accepts an invitation to re-invoke a persistent group. Previously wpa_supplicant entered group formation without triggering any specific events and it could confuse clients, especially when operating with a driver that does not support concurrency between P2P and infrastructure connection. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* P2P: Fix persistent group for 60 GHz networksLior David2016-03-251-3/+6
| | | | | | | | | | | Fix two problems with storage of 60 GHz P2P persistent groups: 1. pbss flag was not stored in the network block. 2. When recreating the persistent group from storage, in addition to the missing pbss flag, the pairwise_cipher and group_cipher were initialized to CCMP which does not work in 60 GHz since the default in 60 GHz should be GCMP. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com>
* P2P: Advertise IP Address Allocation only if it is enabled on GOJouni Malinen2016-03-201-0/+2
| | | | | | | | | | | | This group capability bit was previously added unconditionally which could result in the P2P Client assuming the functionality is available even though the GO would always reject the request (not reply to it with an assigned IP address) during the 4-way handshake. Fix this by advertising the capability only if the GO configuration allow IP address assignment to be completed. Signed-off-by: Jouni Malinen <j@w1.fi>
* P2P: Respect p2p_ignore_shared_freq on p2p_group_addEliad Peller2016-03-041-5/+5
| | | | | | | | Make sure wpas_p2p_init_go_params() respects the p2p_ignore_shared_freq configuration option. Choose currently used frequencies only if this option is not set, or if there are no unused channels left. Signed-off-by: Eliad Peller <eliad@wizery.com>
* P2P: Fix shared freq print in wpas_p2p_init_go_params()Eliad Peller2016-03-041-2/+2
| | | | | | | "freq" contains the forced frequency, not the selected one. Print the correct freq instead. Signed-off-by: Eliad Peller <eliad@wizery.com>