[PATCH 1/2] P2P: Restore P2P_SCAN_SPECIFIC

Daichi Ueura daichi.ueura at gmail.com
Wed Nov 5 06:35:08 EST 2014


This patch is a reverse patch of commit below
 3df2f4f P2P: Remove unused P2P_SCAN_SPECIFIC
(with a modification to fit current code base)

Signed-off-by: Daichi Ueura <daichi.ueura at sonymobile.com>
---
 src/p2p/p2p.h                   | 4 +++-
 wpa_supplicant/p2p_supplicant.c | 7 +++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h
index fa886f7..dcd3027 100644
--- a/src/p2p/p2p.h
+++ b/src/p2p/p2p.h
@@ -147,6 +147,7 @@ struct p2p_data;
 enum p2p_scan_type {
 	P2P_SCAN_SOCIAL,
 	P2P_SCAN_FULL,
+	P2P_SCAN_SPECIFIC,
 	P2P_SCAN_SOCIAL_PLUS_ONE
 };
 
@@ -441,7 +442,8 @@ struct p2p_config {
 	 * operation to be completed. Type type argument specifies which type
 	 * of scan is to be done. @P2P_SCAN_SOCIAL indicates that only the
 	 * social channels (1, 6, 11) should be scanned. @P2P_SCAN_FULL
-	 * indicates that all channels are to be scanned.
+	 * indicates that all channels are to be scanned. @P2P_SCAN_SPECIFIC
+	 * request a scan of a single channel specified by freq.
 	 * @P2P_SCAN_SOCIAL_PLUS_ONE request scan of all the social channels
 	 * plus one extra channel specified by freq.
 	 *
diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c
index aac3a10..931200d 100644
--- a/wpa_supplicant/p2p_supplicant.c
+++ b/wpa_supplicant/p2p_supplicant.c
@@ -375,6 +375,13 @@ static int wpas_p2p_scan(void *ctx, enum p2p_scan_type type, int freq,
 		break;
 	case P2P_SCAN_FULL:
 		break;
+	case P2P_SCAN_SPECIFIC:
+		params->freqs = os_malloc(2 * sizeof(int));
+		if (params->freqs == NULL)
+			goto fail;
+		params->freqs[0] = freq;
+		params->freqs[1] = 0;
+		break;
 	case P2P_SCAN_SOCIAL_PLUS_ONE:
 		params->freqs = os_calloc(ARRAY_SIZE(social_channels_freq) + 2,
 					  sizeof(int));
-- 
1.8.2.2



More information about the HostAP mailing list