aboutsummaryrefslogtreecommitdiffstats
path: root/src/p2p/p2p_i.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix p2p service discoveryandroid-jbIrfan Sheriff2013-11-241-0/+8
| | | | | | | | - Fix listen timing to improve SD reliability - Fix SD packet scheduling Bug: 6629112 Change-Id: I01365279439116256372d019bdbfd4b2113bf2ce
* P2P: Move random channel selection into a helper functionJouni Malinen2013-11-181-0/+2
| | | | | | | | The new p2p_channel_select() function can be re-used to implement random channel selection from a set of operating classes in all places that need such functonality. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* wpa_supplicant: Fix updating GO beacons on WFD subelements changeAndrei Otcheretianski2013-11-051-0/+1
| | | | | | | | When WFD Subelements are set, the IE in the Beacon frames of already existing groups are not updated. This patch fixes this issue by setting beacon_update to be 1 on WFD IE update. Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
* P2P: Add option to allow additional client channelsJouni Malinen2013-10-261-1/+5
| | | | | | | | | | | The new p2p_add_cli_chan=1 configuration parameter can be used to request passive-scan channels to be included in P2P channel lists for cases where the local end may become the P2P client in a group. This allows more options for the peer to use channels, e.g., if the local device is not aware of its current location and has marked most channels to require passive scanning. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add option to remove channels from GO useJouni Malinen2013-10-261-0/+4
| | | | | | | | | | | | | The new p2p_no_go_freq frequency range list (comma-separated list of min-max frequency ranges in MHz) can now be used to configure channels on which the local device is not allowed to operate as a GO, but on which that device can be a P2P Client. These channels are left in the P2P Channel List in GO Negotiation to allow the peer device to select one of the channels for the cases where the peer becomes the GO. The local end will remove these channels from consideration if it becomes the GO. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Add explicit buffer length checks for p2p_build_wps_ie()Jouni Malinen2013-10-261-2/+2
| | | | | | | | Even though the length of this buffer is based only on locally configured information, it is cleaner to include explicit buffer room validation steps when adding the attributes into the buffer. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Add more user friendly debug print of channel listsJouni Malinen2013-10-221-0/+2
| | | | | | | This makes it easier to go through the P2P channel list operations in the debug log without having to parse through the hexdump manually. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Fix PD retry channel on join-a-group caseJouni Malinen2013-10-201-0/+8
| | | | | | | | | | | Join-a-group needs to force the current operating channel of the target group as the frequency to use for the PD exchange. When the channel was selected based on a BSS entry for the GO, this worked only for the first PD Request frame while the retries reverted to a potentially different channel based on a P2P peer entry. Fix this by maintaining the forced channel through the PD retry sequence. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Clean up debug printsJouni Malinen2013-05-181-0/+6
| | | | | | | | Replace direct wpa_msg() calls with p2p_dbg(), p2p_info(), and p2p_err() calls that use a new debug_print() callback to handle actual debug printing outside the P2P module. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Clean up channel--frequency conversion functionsJouni Malinen2013-04-271-3/+2
| | | | | | | | | All P2P use cases are required to use the global operating table and there is no need to need to try to maintain some backwards compatibility with country code -specific values. Clean up the implementation by removing the unnecessary country parameter. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Fix after_scan_tx processing during ongoing operationsJouni Malinen2013-04-231-0/+1
| | | | | | | | | | | | When Action frame TX is postponed until a pending p2p_scan completes, there may be additional operations that need to be continued after the postponed Action frame TX operation completes. Fix this by starting pending operation (if any) from TX status event for after_scan_tx frames. This fixes common errors seen with the test_discovery hwsim test case. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Fix shared frequency preference for concurrent operationsJouni Malinen2013-03-141-0/+1
| | | | | | | | | | | | Commit 50285f5ca8086cca45afa42cd23c3a3c1cd58f40 changed number of rules in channel selection and among other things, it broke the design where the currently used operating channel on a virtual interface that is shared by the same radio is preferred to avoid costs related to multi-channel concurrency. Fix this regression by making the P2P module aware of the shared channel and using that preference as the highest priority when re-selecting the channel during negotiation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow P2P client to specify preferred group channelJouni Malinen2013-03-011-0/+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>
* P2P: Allow all channels in case of multi channel concurrencyDeepthi Gowri2013-03-011-0/+2
| | | | | | | | If multi channel concurrency is supported, we have to populate the p2p_channels with list of channels that we support. Use the same design that was previously added for GO Negotiation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Assign GO tie breaker bit at the same time with dialog tokenJouni Malinen2013-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | Commit 624b4d5a6469c92b039e0d39655b9e0eb26588aa changed GO Negotiation to use the same Dialog Token value for all retransmissions of the GO Negotiation Request within the same session. However, it did leave the tie breaker bit changing for each frame. While this should not have caused issues for most cases, it looks like there are possible sequences where the peer may end up replying to two GO Negotiation Request frames with different tie breaker values. If in such a case the different GO Negotiation Response frames are used at each device, GO role determination may result in conflicting results when same GO intent is used. Fix this by assigning the tie breaker value at the same time with the dialog token (i.e., when processing the p2p_connect command instead of for each transmitted GO Negotiation Request frame) to avoid issues with GO selection. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not use old scan result data for peer discoveryJouni Malinen2013-02-121-0/+2
| | | | | | | | | | | | | | | | | The driver may have cached (e.g., in cfg80211 BSS table) the scan results for relatively long time. To avoid reporting stale information, update P2P peers only based on results that have based on frames received after the last p2p_find operation was started. This helps especially in detecting when a previously operating GO stops the group since the BSS entry for that could live for 30 seconds in the cfg80211 cache. Running p2p_flush followed by p2p_find will now allow wpa_supplicant to not add a P2P peer entry for that GO if the group had been terminated just before that p2p_flush command. Previously, that GO could have been indicated as a newly found device for up to 30 seconds after it had stopped the group. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Use more accurate timestamps for scan resultsJouni Malinen2013-02-121-1/+1
| | | | | | | | | | | | For various P2P use cases, it is useful to have more accurate timestamp for the peer information update. This commit improves scan result handling by using a single timestamp that is taken immediately after fetching the results from the driver and then using that value to calculate the time when the driver last updated the BSS entry. In addition, more debug information is added for P2P peer updates to be able to clearly see how old information is being used here. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Consider age for the P2P scan resultsYoni Divinsky2012-12-251-2/+3
| | | | | | | | | | | | | | | cfg80211 caches the scan results according the channel number. Due to the 15 sec aging this might cause the user mode to see more than one scan result with the same BSSID, e.g. - one scan result for the P2P Device and one for the P2P GO (once it's enabled). Fix this by updating the device entry only if the new peer entry is newer than the one previously stored. Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-hostap: Arik Nemtsov <arik@wizery.com>
* P2P: Allow discoverable interval for p2p_find to be configuredJouni Malinen2012-10-301-0/+5
| | | | | | | | | | | | | | | | | The new P2P_SET parameter disc_int can now be used to configure discoverable interval for p2p_find operations. The format of the command for setting the values is "P2P_SET disc_int <minDiscoverableInterval> <maxDiscoverableInterval> <max TUs for discoverable interval>". The first two parameters are given in units of 100 TUs (102.4 ms). The third parameter can be used to further limit the interval into a specific TU amount. If it is set to -1, no such additional limitation is enforced. It should be noted that the P2P specification describes the random Listen state interval to be in units of 100 TUs, so setting the max TU value to anything else than -1 is not compliant with the specification and should not be used in normal cases. The default parameters can be set with "P2P_SET disc_int 1 3 -1". Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow peer to propose channel in invitation processJouni Malinen2012-09-241-0/+2
| | | | | | | | | | | | | | Make Invitation process for re-invoking a persistent group behave similarly to GO Negotiation as far as channel negotiation is concerned. The Operating Channel value (if present) is used as a starting point if the local device does not have a forced operating channel (e.g., due to concurrent use). Channel lists from devices are then compared to check that the selected channel is in the intersection. If not, channel is selected based on GO Negotiation channel rules (best channel preferences etc.). Invitation Request is rejected if no common channel can be selected. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* WFD: Add support for sending Wi-Fi Display service discovery requestsJouni Malinen2012-08-291-0/+1
| | | | | | | | | | | | | | | 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>
* WFD: Add Wi-Fi Display supportJouni Malinen2012-08-291-0/+17
| | | | | | | | | | | | | | | | This commit adds control interface commands and internal storage of Wi-Fi Display related configuration. In addition, WFD IE is now added to various P2P frames, Probe Request/Response, and (Re)Association Request/Response frames. WFD subelements from peers are stored in the P2P peer table. Following control interface commands are now available: SET wifi_display <0/1> GET wifi_display WFD_SUBELEM_SET <subelem> [hexdump of length+body] WFD_SUBELEM_GET <subelem> Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow scan operations during p2p_findJouni Malinen2012-08-231-0/+5
| | | | | | | | | | | | | Previously, all station mode scan operations were either skipped or delayed while any P2P operation was in progress. To make concurrent operations easier to use, reduce this limitation by allowing a scan operation to be completed in the middle of a p2p_find. In addition, allow station mode association to be completed. When the station mode operation is run to its completion (scan results not acted on, connection to an AP completed, connection failed), resume the p2p_find operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Add option for adding extra delay to p2p_findJouni Malinen2012-08-231-0/+4
| | | | | | | | | | A new optional delay=<search delay in milliseconds> parameter can now be used with p2p_find command to request an extra delay between search iterations. This can be used, e.g., to make p2p_find friendlier to concurrent operations by avoiding it from taking 100% of the radio resources. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Use larger GO config timeout if HT40 is usedJouni Malinen2012-08-151-0/+3
| | | | | | | Increase GO config timeout if HT40 is used since it takes some time to scan channels for coex purposes before the BSS can be started. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Add option for Provision Discovery before GO NegotiationJouni Malinen2012-05-111-0/+1
| | | | | | | | | | This is a workaround for interoperability issues with some deployed P2P implementations that require a Provision Discovery exchange to be used before GO Negotiation. The new provdisc parameter for the p2p_connect command can be used to request this behavior without having to run a separate p2p_prov_disc command. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Store SSID of the group in p2p_group dataJouni Malinen2012-05-081-0/+2
| | | | | | | | This can be used with P2P management operations that need to verify whether the local device is operating a specific group based on P2P Group ID attribute from a peer. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Do not update peer Listen channel based on PD/InvitationJouni Malinen2012-04-261-1/+1
| | | | | | | | | | | | | | | | | | Commits 17bef1e97a5061a8b5443dc24166e28439911f0b and ffe98dfb88a19b66418184955ef272789e3abb68 started using p2p_add_device() with other frames than just Probe Response frames from scan results. However, these changes did not take into account that the PD Request and Invitation Request frames are normally received on the our own Listen channel, not on the Listen channel of the peer. As such, these frames must not be used to update Listen channel information for the peer. Fix this by letting p2p_add_device() know whether the results are from scan results and if not, skip the peer table updates that are specific to Probe Response frames. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com> intended-for: hostap-1
* P2P: Advertise immediate availability of WPS credentialJouni Malinen2012-02-271-1/+2
| | | | | | | | | | | | | | Use Device Password ID in WSC IE of Probe Request and Probe Response frames to advertise immediate availability of WPS credentials per P2P specification sections 3.1.2.1.1 (Listen State), 3.1.2.1.2 (Scan Phase), and 3.1.2.1.3 (Find Phase). For now, the Device Password ID is set only for the case where we are active GO Negotiation with a specific peer. In practice, this means that the Probe Response frames during pending GO Negotiation (whenever in Listen state) indicate availability of the credential. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Fix remain-on-channel use with PD/Invitation Request while in ListenJouni Malinen2012-02-271-0/+1
| | | | | | | | | | | | | | | | | If Listen state was in progress on another channel when a request to send an Action frame (e.g., Provision Discovery Request or Invitation Request to a peer on the peer's Listen channel that is different from our Listenc hannel) is issued, wpa_supplicant tried to use concurrent remain-on-channel operations. While some drivers can handle this cleanly, there are drivers that don't and wpa_supplicant is not expected to request concurrent remain-on-channel operations. Fix this by cancelling the ongoing remain-on-channel with stop_listen prior to sending the Action frame on another channel. If a P2P search was in progress, it will be continued after the timeout on the new operation. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* Remove the GPL notification from files contributed by AtherosJouni Malinen2012-02-111-8/+2
| | | | | | | Remove the GPL notification text from files that were initially contributed by Atheros Communications or Qualcomm Atheros. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Move p2p_add_device() prototype to correct header fileJouni Malinen2012-02-071-0/+2
| | | | | | | This was supposed to be an internal API to be used only within src/p2p/*.c. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Allow Device ID to be specified for p2p_find commandJouni Malinen2012-01-081-0/+2
| | | | | | | dev_id=<P2P Device Addr> can now be specified as an argument to p2p_find to request P2P find for a specific P2P device. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Fix Provision Discovery channel for some join-GO casesJouni Malinen2011-12-181-1/+1
| | | | | | | | | The Provision Discovery Request needs to be sent on the operating channel of the GO and as such, the frequency from the BSS table (scan results) need to override the frequency in the P2P peer table that could be based on the Listen channel of the GO. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Fix Provision Discovery name in debug messagesJouni Malinen2011-12-111-1/+1
| | | | | | | Some debug messages used incorrect name for Provision Discovery. Replace "Provisioning Discovery" with "Provision Discovery". Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Remove forgotten TODO commentJouni Malinen2011-12-101-2/+0
| | | | | | The P2P peers are already expired. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: Skip duplicated provision discovery on joinJithu Jance2011-12-061-0/+8
| | | | | | | If p2p_prov_disc join command is used prior to p2p_connect join, skip the duplicated provision discovery exchange. Signed-hostap: Jithu Jance <jithu@broadcom.com>
* P2P: Wait until ongoing scan completes before starting P2P findJouni Malinen2011-11-151-0/+6
| | | | | | | | | The P2P_FIND command was failing if it was issued at the moment when a scan operation was in progress. Avoid returning failure in this case by scheduling the P2P find to start once the ongoing scan is completed. Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Advertise Persistent Reconnect group capabilityJouni Malinen2011-10-241-0/+1
| | | | | | | | The persistent_reconnect configuration parameter was used to decide whether to accept invitation to re-establish a persistent group. However, this was not being advertised in the Group Capability bitmap. Add the Persistent Reconnect bit based on this configuration to GO Negotiation frames and Beacon/Probe Response frames from the GO.
* P2P: Do not change SSID during GO negotiationJouni Malinen2011-10-111-0/+5
| | | | | | | | If GO Negotiation Request (or in theory, also GO Negotiation Response) frame is delivered multiple time for processing, the SSID of the group could end up getting changed. This could result in possible issues if the peer ended up using different SSID. To avoid this, make sure the SSID does not get changed unless the negotiation is for a new group.
* P2P: Show P2P peer signal level in D-Bus P2P device propertiesJayant Sane2011-06-231-1/+0
| | | | | | | | | Move level parameter from p2p_device to p2p_device_info in order to expose this information and modify D-Bus P2P handler to return this new parameter through the P2P device properties. Signed-off-by: Fabien Marotte <fabienx.marotte@intel.com> Signed-off-by: Jayant Sane <jayant.sane@intel.com>
* P2P: Retry provision discovery requests in IDLE stateJayant Sane2011-06-121-0/+18
| | | | | | | | | | | Since the peer may not be in Listen state when the provision discovery request is sent, try to send the request again number of times when in IDLE state. This was already done when p2p_find is in progress, but this commit adds retries to the case where no other P2P operations are in progress. Signed-off-by: Jayant Sane <jayant.sane@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* P2P: Store more WPS attributes for peersJouni Malinen2011-03-281-0/+8
| | | | | | Store Manufacturer, Model Name, Model Number, and Serial Number attributes for P2P peers and expose these through the existing peer information mechanisms.
* P2P: Add option for requested device type in P2P search/scanJean-Michel Bachot2011-03-191-0/+4
| | | | | | | With this, p2p_find can be extended to find certain requested device types. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* P2P: Use a single define for max number of vendor extensionsJouni Malinen2011-03-191-4/+3
|
* P2P: Keep track of peer WPS vendor extensionsJean-Michel Bachot2011-03-191-0/+2
| | | | | | | | Make the P2P code keep track of WPS vendor extensions received from peers so they can be exposed via DBus later. Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* P2P: Allow adding of WPS vendor extension attributesJean-Michel Bachot2011-03-191-0/+6
| | | | | | | | This adds the ability to add WPS vendor extension attributes in P2P frames, like GO Negotiation and Probe Response frames. Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* P2P: Keep track of secondary device types for peersJean-Michel Bachot2011-03-171-0/+2
| | | | | Signed-off-by: Jean-Michel Bachot <jean-michelx.bachot@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* P2P: Add new_device flag to dev_found callbackJohannes Berg2011-02-241-0/+1
| | | | | | | | | | | | | | The DBus code will want to have perfect matching of dev_found and the dev_lost it adds so it doesn't need to keep track internally. Enable that with a new flag in the core that tracks whether we have already notified about this -- the existing users can ignore it. The part where this is always set to 1 if the new device is discovered by a driver that has P2P in the driver is buggy -- the driver should feed the P2P peer database and then that should feed the notification here instead. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* P2P: Embed publically visible struct in peer infoKonguraj(Raj) Kulanthaivel2011-02-241-6/+1
| | | | | | | | | | | | This embeds some information about each P2P peer that will be publically visible in a struct that is shared. The dev_found notification function is also passed the new struct, which requires some work for the driver-based P2P management. Signed-off-by: Konguraj(Raj) Kulanthaivel <konguraj.kulanthaivel@intel.com> Signed-off-by: Fabien Marotte <fabienx.marotte@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>