aboutsummaryrefslogtreecommitdiffstats
path: root/src/p2p/p2p_go_neg.c
Commit message (Collapse)AuthorAgeFilesLines
* WFD: Add Wi-Fi Display supportJouni Malinen2012-12-141-3/+39
| | | | | | | | | | | | | | | | | | | | 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> [vishalm@ti.com: Backported it to curent tree] Signed-off-by: Vishal Mahaveer <vishalm@ti.com> Change-Id: Ief0cd61903facd9209927d9dc84c8f093f3b6bac
* P2P: cancel action frame offchan wait after recv go neg resp (UPSTREAM)Eyal Shapira2012-11-021-1/+1
| | | | | | | | | | | A wait of 200ms is configured after sending the go neg request. The go neg process can end quickly within less than 200ms. If this wait isn't canceled it can cause the beaconing of the GO to start while mac80211 is still off channel on the listen channel and this may cause beaconing on the wrong channel if oper channel is different from the listen channel. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* P2P: cancel action frame offchan wait after recv go neg confEyal Shapira2012-10-241-0/+1
| | | | | | | | | | | The missing call to scan_action_done keeps us offchan on the listen channel for 250ms following sending go neg resp. In case the oper channel is different from the listen channel and we're GO a race could lead to start beaconing while offchan. This causes the beacons to go out on the listen channel instead of the oper channel. Signed-off-by: Eyal Shapira <eyal@wizery.com>
* P2P: fix oper channel selection (SQUASH)Arik Nemtsov2012-09-241-1/+2
| | | | | | | | | | | | Handles the forgotten p2p_process_go_neg_resp() case of patch: commit 66b8140a08b9f6297cd49a3428ada713bf668300 Author: Arik Nemtsov <arik@wizery.com> Date: Thu Aug 30 21:06:45 2012 +0300 P2P: always re-select oper channel if not hard coded Signed-off-by: Arik Nemtsov <arik@wizery.com>
* P2P: prefer operating channels where HT40 is possibleArik Nemtsov2012-09-041-0/+15
| | | | | | | | When no other user preference is specified, opt to use an operating channel that allows HT40 operation. This way, if driver capabilities and regulatory constraints allow, we might enjoy increased bandwidth. Signed-hostap: Arik Nemtsov <arik@wizery.com>
* P2P: always re-select oper channel if not hard codedArik Nemtsov2012-09-041-1/+16
| | | | | | | | | | | Since the operating channel is randomly set to 1/6/11 on init, which is always in the channel intersection, we were effectively ignoring the set of p2p preferred channels. Fix this by trying to get the best channel we can, unless the user hard coded the operating channel in the configuration file. Fall back to the initial randomly selected channel if a better one cannot be chosen. Signed-hostap: Arik Nemtsov <arik@wizery.com>
* P2P: Use larger GO config timeout if HT40 is usedJouni Malinen2012-09-041-2/+2
| | | | | | | 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: Increase GO Negotiation timeoutsJouni Malinen2012-08-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | p2p_set_timeout() calls in GO Neg Req/Resp TX callbacks used timeout of 100 ms which is the value given in the P2P specification for GO Negotiation, but this was actually shorter than the wait-for-offchannel-TX value (200 ms) used for the driver call. In addition, it looks like some devices (e.g., Galaxy Nexus with JB image) can take longer time to reply to GO Negotiation Response (somewhere between 200 and 250 ms has been observed). Increase the wait-for-GO-Neg-Resp timeout from 100 ms to 200 ms if GO Negotiation Request frame was acknowledged (this matches with the offchannel wait timeout that used previously). The no-ack case is left at 100 ms since we use GO Negotiation Request frame also to discover whether the peer is on its Listen channel. Increase the wait-for-GO-Neg-Conf timeout from 100 ms to 250 ms (and increase the offchannel wait timeout to matching 250 ms) as a workaround for devices that take over 200 ms to reply to GO Negotiation Response. Signed-hostap: Jouni Malinen <j@w1.fi>
* P2P: ignore neg_req with previously used dialog_tokenEliad Peller2012-07-301-0/+8
| | | | | | | | | | | | If for some reason we get a duplicate negotiation request, the supplicant will generate 2 different responses (different SSIDs) with the same dialog token. The remote peer will confirm one of them, but it will probably be the wrong one (the first it received). Workaround it by ignoring negotiation requests with the last used dialog_token. Signed-off-by: Eliad Peller <eliad@wizery.com>
* P2P: Fix setting of P2P Client Discoverability bitMasashi Honma2012-06-161-3/+9
| | | | | | | | | | | | | In the P2P specification v1.1, the P2P Client Discoverability bit is described in Table 12 "Device Capability Bitmap definition". The table says "Within a P2P Group Info attribute and a (Re)association request frame the P2P Client Discoverability field shall be set to 1 when the P2P Device supports P2P Client Discoverability, and is set to 0 otherwise. This field shall be reserved and set to 0 in all other frames or uses.". To match with this, filter out P2P Client Discoverability bit from frames where its use is reserved. Signed-hostap: Masashi Honma <masashi.honma@gmail.com>
* P2P: Ignore unexpected GO Neg Resp is we have sent RespJouni Malinen2012-06-091-0/+11
| | | | | | | | | | | | | | | | | | | | | | There is a race condition in GO Negotiation Request frame sending and processing that may end up with both devices sending GO Negotiation Response. This response frame was previously accepted even if a response had already been sent. This could result in two GO Negotiation Confirm frames being exchanged and consequently, with two separate GO Negotiations completing concurrently. These negotiations could result in getting mismatching parameters (e.g., both device could believe it was the GO). Fix this by ignoring GO Negotiation Response from the peer if twe have already sent a GO Negotiation Response frame and we have the higher P2P Device Address. This is similar to the rule used to determine whether to reply to GO Negotiation Request frame when Request was already sent, i.e., the same direction of GO Negotiation is maintained here to enforce that only the negotiation initiated by the device with smaller P2P Device Address is completed. Signed-hostap: Jouni Malinen <j@w1.fi> intended-for: hostap-1
* P2P: Address race condition with GO Negotiation Request TX statusNeeraj Kumar Garg2012-06-091-1/+2
| | | | | | | | | | | | | | | | If both peers initiate GO Negotiation at about the same time, it is possible for the GO Negotiation Request frame from the peer to be received between the local attempt to send the GO Negotiation Request and TX status event for that. This could result in both devices sending GO Negotiation Response frames even though one of them should have skipped this based which device uses a higher MAC address. Resolve this race by incrementing go_neg_req_sent when p2p_send_action() returns success instead of doing this from the TX status callback. If the frame is not acknowledged, go_neg_req_sent is cleared in TX status handler. Signed-off-by: Neeraj Garg <neerajkg@broadcom.com>
* P2P: Send GO Negotiation Confirm without waitJohannes Berg2012-06-061-1/+1
| | | | | | | The GO Negotiation Confirm frame doesn't need to be sent with a wait since we don't expect a response to it. Signed-hostap: Johannes Berg <johannes.berg@intel.com>
* P2P: Add option for Provision Discovery before GO NegotiationJouni Malinen2012-05-111-0/+17
| | | | | | | | | | 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: Add support for preferred channel listJouni Malinen2012-03-291-0/+16
| | | | | | | | | | | | | | | | | | | | | | p2p_pref_chan configuration parameter can now be used to set the list of preferred channel for P2P GO Negotiation. This will be used in the priority order if the peer does not support the channel we are trying to use as the GO (configured operating channel or the best 2.4 GHz/5 GHz channel) for the case where a forced channel is not used. p2p_pref_chan=<op class:channel>,... For example: p2p_pref_chan=81:1,81:2,81:3,81:4,81:5,81:6 This would configure 2.4 GHz channels 1-6 as the preferred ones with channel 1 the most preferred option. These configuration parameters can be set in wpa_supplicant.conf and dynamically updated with "wpa_cli set <param> <value>". Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
* P2P: Advertise immediate availability of WPS credentialJouni Malinen2012-02-271-1/+1
| | | | | | | | | | | | | | 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>
* 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: Advertise Persistent Reconnect group capabilityJouni Malinen2011-10-241-3/+14
| | | | | | | | 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-2/+8
| | | | | | | | 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: Remove Label config methodJouni Malinen2011-09-081-32/+2
| | | | | | | | | The P2P specification (3.1.4.3) disallows use of the Label configuration method between two P2P devices. This was previously enforced at upper level, but the obsolete code can be removed from wpa_supplicant. This adds a bit more strict enforcement of the policy, but should not result in practical differences since no known P2P implementation uses Label config method.
* P2P: Embed publically visible struct in peer infoKonguraj(Raj) Kulanthaivel2011-02-241-3/+3
| | | | | | | | | | | | 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>
* P2P: Limit the retransmission of GO Negotiation request to 120Fabien Marotte2010-12-281-0/+1
| | | | | | | | | | | | | | | | If the peer you want to connect to is no longer available (does not acknowledge frames) when wpa_supplicant sends GO Negotition Request frames, retransmission of this frame is done until the associated p2p_device structure is removed on timeout. In that case, no signal is emitted to inform the GO Negotiation has failed. When sending an Invitation Request frame, the same retransmission mechanism is in place but limit the transmission to 100 and hitting the limit generates an event. This patch adds the same mechanism as the one in place for Invitation Request, but with limit of 120 to match the existing wait_count for for GO Negotiation.
* P2P: Reselect operating channel preference based on best channelsJouni Malinen2010-11-101-28/+55
| | | | | | | When the peer does not include our initial preference in the Channel List attribute during GO Negotiation, try to use the best channel of the other band as the new preference instead of falling back to the first channel in the intersection.
* P2P: Delay send_action call if p2p_scan is in progressJouni Malinen2010-10-201-13/+8
| | | | | | In order to avoid confusing the driver with a new remain-on-channel request, delay sending of a new Action frame if the driver indicates Action frame RX diromg a scan.
* P2P: Do not stop Listen state if it is on correct channelJouni Malinen2010-10-201-1/+1
| | | | | | | | This is needed to optimize response to GO Negotiation Request frames. The extra remain-on-channel cancel followed by new remain-on-channel for the same channel takes too much time with some driver/firmware designs for the response to go out quickly enough to avoid peer timing out while waiting for our response.
* P2P: Add option for disabling intra BSS distributionSudhakar Swaminathan2010-09-101-0/+6
| | | | | | p2p_intra_bss configuration parameter can now be used to disable/enable intra BSS distribution (bridging of frames between the clients in a group).
* P2P: Add peer timeout into group formation 15 second timeoutJouni Malinen2010-09-101-0/+8
| | | | | This adds some more time for WPS provisioning step in case the peer takes long time to start group interface operations.
* P2P: Provide local event on GO Neg Req rejectionJouni Malinen2010-09-101-0/+2
| | | | | | | | | If an authorized (p2p_connect used locally) GO Negotiation is rejected when receiving GO Negotiation Request from the peer, indicate the failure with a ctrl_interface P2P-GO-NEG-FAILURE event. Previously, this event was only shown on the peer (i.e., the device receiving the GO Negotiation Response with non-zero Status code).
* P2P: Use SSID from GO Negotiation to limit WPS provisioning stepJouni Malinen2010-09-091-2/+8
| | | | | In order to avoid picking incorrect SSID from old scan results, use SSID from GO Negotiation to select the AP.
* P2P: Add Device Password ID to GO Neg Request RX eventJouni Malinen2010-09-091-1/+2
| | | | | | This event indicates the Device Password ID that the peer tried to use in GO Negotiation. For example: P2P-GO-NEG-REQUEST 02:40:61:c2:f3:b7 dev_passwd_id=4
* P2P: Add support for cross connectionJouni Malinen2010-09-091-4/+14
| | | | | | | | If enabled, cross connection allows GO to forward IPv4 packets using masquerading NAT from the P2P clients in the group to an uplink WLAN connection. This is disabled by default and can be enabled with "wpa_cli p2p_set cross_connect 1" on the P2P device interface.
* P2P: Fix channel forcing for p2p_connect authJouni Malinen2010-09-091-5/+12
|
* P2P: Fix country string mismatch validation off-by-one offsetJouni Malinen2010-09-091-2/+2
| | | | | 0x04 was being checked from incorrect location when skipping country code validation.
* P2P: Add initial version of P2P ModuleJouni Malinen2010-09-091-0/+1064