From: Dmitry Shmidt Date: Thu, 21 Jul 2011 22:19:46 +0000 (-0700) Subject: nl80211: Add P2P support for BRCM cfg80211 driver X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=615831e8ae5ae2fc77bf94b83392795a3a61f1ed;p=thirdparty%2Fhostap.git nl80211: Add P2P support for BRCM cfg80211 driver This is a merge of following commits that first added vendor specific extensions in ICS and moved closer to upstream implementation in JB: Add P2P support for BRCM CFG80211 driver (nl80211) Change-Id: Iafec4bedbd33836d0a64e7ea054d8a46ef8ec204 Signed-off-by: Dmitry Shmidt nl80211: Add MLME events (BRCM) Fix WFD and WPS certification problem for GO (BRCM) Change-Id: I5bbac818aad7c0a14fddb3beb88a6a2d87c07ea0 Signed-off-by: Dmitry Shmidt nl80211: Use native cfg80211 sta events Change-Id: Id59cc4af50dbccd283db2ec3e7b0b6f8c2146e68 Signed-off-by: Dmitry Shmidt --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index a8ff3a392..5fe1628ad 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -3343,6 +3343,14 @@ static int wiphy_info_handler(struct nl_msg *msg, void *arg) if (tb[NL80211_ATTR_DEVICE_AP_SME]) info->device_ap_sme = 1; +#ifdef ANDROID_P2P + /* + * TODO: Make Android drivers advertise NL80211_ATTR_DEVICE_AP_SME + * properly to avoid need for this.. + */ + info->device_ap_sme = 1; +#endif /* ANDROID_P2P */ + wiphy_info_feature_flags(info, tb[NL80211_ATTR_FEATURE_FLAGS]); wiphy_info_probe_resp_offload(capa, tb[NL80211_ATTR_PROBE_RESP_OFFLOAD]); @@ -7624,6 +7632,7 @@ static int nl80211_setup_ap(struct i802_bss *bss) if (nl80211_mgmt_subscribe_ap(bss)) return -1; +#ifndef ANDROID_P2P if (drv->device_ap_sme && !drv->use_monitor) if (nl80211_mgmt_subscribe_ap_dev_sme(bss)) return -1; @@ -7632,6 +7641,15 @@ static int nl80211_setup_ap(struct i802_bss *bss) nl80211_create_monitor_interface(drv) && !drv->device_ap_sme) return -1; +#else /* ANDROID_P2P */ + if (drv->device_ap_sme) + if (nl80211_mgmt_subscribe_ap_dev_sme(bss)) + return -1; + + if (drv->use_monitor && + nl80211_create_monitor_interface(drv)) + return -1; +#endif /* ANDROID_P2P */ if (drv->device_ap_sme && wpa_driver_nl80211_probe_req_report(bss, 1) < 0) { @@ -7705,7 +7723,11 @@ static int wpa_driver_nl80211_hapd_send_eapol( int res; int qos = flags & WPA_STA_WMM; +#ifndef ANDROID_P2P if (drv->device_ap_sme || !drv->use_monitor) +#else /* ANDROID_P2P */ + if (drv->device_ap_sme && !drv->use_monitor) +#endif /* ANDROID_P2P */ return nl80211_send_eapol_data(bss, addr, data, data_len); len = sizeof(*hdr) + (qos ? 2 : 0) + sizeof(rfc1042_header) + 2 +