diff mbox

Android: Use extended P2P functionality (ANDROID_P2P) for all vendors

Message ID 20140411233430.79B3D13FCF8@ushik.mtv.corp.google.com
State Superseded
Headers show

Commit Message

Dmitry Shmidt April 11, 2014, 11:05 p.m. UTC
Change-Id: I781ce5410bda14bc55719198e14c9ce36fa3b648
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
---
 hostapd/Android.mk           | 12 +++---------
 src/drivers/driver_nl80211.c | 17 +++++++++++++++++
 wpa_supplicant/Android.mk    | 15 ++++++---------
 3 files changed, 26 insertions(+), 18 deletions(-)

Comments

Arik Nemtsov April 13, 2014, 10:53 a.m. UTC | #1
On Sat, Apr 12, 2014 at 2:05 AM, Dmitry Shmidt <dimitrysh@google.com> wrote:
> Change-Id: I781ce5410bda14bc55719198e14c9ce36fa3b648
> Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
> ---
>  hostapd/Android.mk           | 12 +++---------
>  src/drivers/driver_nl80211.c | 17 +++++++++++++++++
>  wpa_supplicant/Android.mk    | 15 ++++++---------
>  3 files changed, 26 insertions(+), 18 deletions(-)
>
> diff --git a/hostapd/Android.mk b/hostapd/Android.mk
[...]
> +int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon,
> +                                const struct wpabuf *proberesp,
> +                                const struct wpabuf *assocresp) {
> +       return -1;
> +}

I think you need to return 0 here for the non-implemented case.
Otherwise AP init fails.

Arik
diff mbox

Patch

diff --git a/hostapd/Android.mk b/hostapd/Android.mk
index 6db82f8..5125b21 100644
--- a/hostapd/Android.mk
+++ b/hostapd/Android.mk
@@ -24,16 +24,10 @@  L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
 # Set Android log name
 L_CFLAGS += -DANDROID_LOG_NAME=\"hostapd\"
 
-ifeq ($(BOARD_WLAN_DEVICE), bcmdhd)
-L_CFLAGS += -DANDROID_P2P
-endif
-
-ifeq ($(BOARD_WLAN_DEVICE), qcwcn)
-L_CFLAGS += -DANDROID_P2P
-endif
-
-ifeq ($(BOARD_WLAN_DEVICE), mrvl)
+# Set Android extended P2P functionality
 L_CFLAGS += -DANDROID_P2P
+ifeq ($(BOARD_HOSTAPD_PRIVATE_LIB),)
+L_CFLAGS += -DANDROID_P2P_STUB
 endif
 
 # Use Android specific directory for control interface sockets
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index e531e22..71a25fd 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -369,12 +369,29 @@  extern int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf,
 					 size_t buf_len);
 #endif /* ANDROID */
 #ifdef ANDROID_P2P
+#ifdef ANDROID_P2P_STUB
+int wpa_driver_set_p2p_noa(void *priv, u8 count, int start, int duration) {
+	return -1;
+}
+int wpa_driver_get_p2p_noa(void *priv, u8 *buf, size_t len) {
+	return -1;
+}
+int wpa_driver_set_p2p_ps(void *priv, int legacy_ps, int opp_ps, int ctwindow) {
+	return -1;
+}
+int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon,
+				 const struct wpabuf *proberesp,
+				 const struct wpabuf *assocresp) {
+	return -1;
+}
+#else
 int wpa_driver_set_p2p_noa(void *priv, u8 count, int start, int duration);
 int wpa_driver_get_p2p_noa(void *priv, u8 *buf, size_t len);
 int wpa_driver_set_p2p_ps(void *priv, int legacy_ps, int opp_ps, int ctwindow);
 int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon,
 				 const struct wpabuf *proberesp,
 				 const struct wpabuf *assocresp);
+#endif /* ANDROID_P2P_STUB */
 #endif /* ANDROID_P2P */
 
 static void add_ifidx(struct wpa_driver_nl80211_data *drv, int ifidx);
diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk
index c8fe1c2..0020ae5 100644
--- a/wpa_supplicant/Android.mk
+++ b/wpa_supplicant/Android.mk
@@ -24,24 +24,21 @@  L_CFLAGS += -DVERSION_STR_POSTFIX=\"-$(PLATFORM_VERSION)\"
 # Set Android log name
 L_CFLAGS += -DANDROID_LOG_NAME=\"wpa_supplicant\"
 
+# Set Android extended P2P functionality
+L_CFLAGS += -DANDROID_P2P
+ifeq ($(BOARD_WPA_SUPPLICANT_PRIVATE_LIB),)
+L_CFLAGS += -DANDROID_P2P_STUB
+endif
+
 # Disable roaming in wpa_supplicant
 ifdef CONFIG_NO_ROAMING
 L_CFLAGS += -DCONFIG_NO_ROAMING
 endif
 
 ifeq ($(BOARD_WLAN_DEVICE), bcmdhd)
-L_CFLAGS += -DANDROID_P2P
 L_CFLAGS += -DP2P_CONCURRENT_SEARCH_DELAY=0
 endif
 
-ifeq ($(BOARD_WLAN_DEVICE), qcwcn)
-L_CFLAGS += -DANDROID_P2P
-endif
-
-ifeq ($(BOARD_WLAN_DEVICE), mrvl)
-L_CFLAGS += -DANDROID_P2P
-endif
-
 # Use Android specific directory for control interface sockets
 L_CFLAGS += -DCONFIG_CTRL_IFACE_CLIENT_DIR=\"/data/misc/wifi/sockets\"
 L_CFLAGS += -DCONFIG_CTRL_IFACE_DIR=\"/data/system/wpa_supplicant\"