diff options
-rw-r--r-- | hostapd/Android.mk | 5 | ||||
-rw-r--r-- | src/p2p/p2p.c | 16 | ||||
-rw-r--r-- | src/p2p/p2p.h | 8 | ||||
-rw-r--r-- | wpa_supplicant/Android.mk | 5 | ||||
-rw-r--r-- | wpa_supplicant/p2p_supplicant.c | 8 |
5 files changed, 42 insertions, 0 deletions
diff --git a/hostapd/Android.mk b/hostapd/Android.mk index c1e5d8b..107f381 100644 --- a/hostapd/Android.mk +++ b/hostapd/Android.mk @@ -28,6 +28,11 @@ ifeq ($(BOARD_WLAN_DEVICE), bcmdhd) L_CFLAGS += -DANDROID_P2P endif +ifeq ($(BOARD_WLAN_DEVICE), qcwcn) +L_CFLAGS += -DANDROID_QCOM_WCN +L_CFLAGS += -DANDROID_P2P +endif + # To force sizeof(enum) = 4 ifeq ($(TARGET_ARCH),arm) L_CFLAGS += -mabi=aapcs-linux diff --git a/src/p2p/p2p.c b/src/p2p/p2p.c index 58ada3b..eb2821e 100644 --- a/src/p2p/p2p.c +++ b/src/p2p/p2p.c @@ -1151,10 +1151,26 @@ static int p2p_prepare_channel(struct p2p_data *p2p, unsigned int force_freq) } p2p->op_reg_class = op_reg_class; p2p->op_channel = op_channel; +#ifndef ANDROID_P2P p2p->channels.reg_classes = 1; p2p->channels.reg_class[0].channels = 1; p2p->channels.reg_class[0].reg_class = p2p->op_reg_class; p2p->channels.reg_class[0].channel[0] = p2p->op_channel; +#else + if(p2p->cfg->p2p_concurrency == P2P_MULTI_CHANNEL_CONCURRENT) { + /* We we are requesting for a preferred channel. But since + * are multichannel concurrent, we have to poplulate the + * p2p_channels with list of channels that we support. + */ + os_memcpy(&p2p->channels, &p2p->cfg->channels, + sizeof(struct p2p_channels)); + } else { + p2p->channels.reg_classes = 1; + p2p->channels.reg_class[0].channels = 1; + p2p->channels.reg_class[0].reg_class = p2p->op_reg_class; + p2p->channels.reg_class[0].channel[0] = p2p->op_channel; + } +#endif } else { u8 op_reg_class, op_channel; diff --git a/src/p2p/p2p.h b/src/p2p/p2p.h index 8274d73..59da452 100644 --- a/src/p2p/p2p.h +++ b/src/p2p/p2p.h @@ -352,6 +352,14 @@ struct p2p_config { */ size_t ssid_postfix_len; +#ifdef ANDROID_P2P + enum p2p_concurrency_type { + P2P_NON_CONCURRENT, + P2P_SINGLE_CHANNEL_CONCURRENT, + P2P_MULTI_CHANNEL_CONCURRENT, + } p2p_concurrency; +#endif + /** * msg_ctx - Context to use with wpa_msg() calls */ diff --git a/wpa_supplicant/Android.mk b/wpa_supplicant/Android.mk index a0e7834..295a897 100644 --- a/wpa_supplicant/Android.mk +++ b/wpa_supplicant/Android.mk @@ -33,6 +33,11 @@ ifeq ($(BOARD_WLAN_DEVICE), bcmdhd) L_CFLAGS += -DANDROID_P2P endif +ifeq ($(BOARD_WLAN_DEVICE), qcwcn) +L_CFLAGS += -DANDROID_QCOM_WCN +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\" diff --git a/wpa_supplicant/p2p_supplicant.c b/wpa_supplicant/p2p_supplicant.c index fad8bd2..f4df4b0 100644 --- a/wpa_supplicant/p2p_supplicant.c +++ b/wpa_supplicant/p2p_supplicant.c @@ -2534,6 +2534,14 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s) p2p.p2p_intra_bss = wpa_s->conf->p2p_intra_bss; + +#ifdef ANDROID_P2P + if(wpa_s->drv_flags & WPA_DRIVER_FLAGS_MULTI_CHANNEL_CONCURRENT) + p2p.p2p_concurrency = P2P_MULTI_CHANNEL_CONCURRENT; + else if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_P2P_CONCURRENT) + p2p.p2p_concurrency = P2P_SINGLE_CHANNEL_CONCURRENT; +#endif + global->p2p = p2p_init(&p2p); if (global->p2p == NULL) return -1; |