diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2012-03-20 12:51:25 -0700 |
---|---|---|
committer | Arik Nemtsov <arik@wizery.com> | 2012-08-02 13:04:01 +0300 |
commit | 7d265efb895e1ca8eefe3fb4c60d702c0bea26df (patch) | |
tree | dc8706457f564cbfcf38934ed6446a9902b8254c /src | |
parent | 887ea6c62f72a4309dddbc04a25f0a5521e96100 (diff) | |
download | external_wpa_supplicant_8_ti-7d265efb895e1ca8eefe3fb4c60d702c0bea26df.zip external_wpa_supplicant_8_ti-7d265efb895e1ca8eefe3fb4c60d702c0bea26df.tar.gz external_wpa_supplicant_8_ti-7d265efb895e1ca8eefe3fb4c60d702c0bea26df.tar.bz2 |
nl80211: Use native cfg80211 sta events (BRCM)
[Eyal - Keep specific BRCM specific stuff under
ANDROID_BRCM_P2P_PATCH and not ANDROID_P2P which
TI solution compiles with]
Change-Id: I0f6222839ac87241f1bfbbb1fdc6469bf6359652
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Signed-off-by: Eyal Shapira <eyal@wizery.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/driver_nl80211.c | 105 |
1 files changed, 15 insertions, 90 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index a36abfe..41a81fe 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1096,20 +1096,6 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv, u16 status; mgmt = (const struct ieee80211_mgmt *) frame; -#if (defined (CONFIG_AP) || defined (HOSTAPD) ) && defined (ANDROID_BRCM_P2P_PATCH) - if (drv->nlmode == NL80211_IFTYPE_AP || drv->nlmode == NL80211_IFTYPE_P2P_GO) { - if (len < 24 + sizeof(mgmt->u.assoc_req)) { - wpa_printf(MSG_DEBUG, "nl80211: Too short association event " - "frame"); - return; - } - os_memset(&event, 0, sizeof(event)); - event.assoc_info.freq = drv->assoc_freq; - event.assoc_info.req_ies = (u8 *) mgmt->u.assoc_req.variable; - event.assoc_info.req_ies_len = len - 24 - sizeof(mgmt->u.assoc_req); - event.assoc_info.addr = mgmt->sa; - } else { -#endif if (len < 24 + sizeof(mgmt->u.assoc_resp)) { wpa_printf(MSG_DEBUG, "nl80211: Too short association event " "frame"); @@ -1143,10 +1129,6 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv, } event.assoc_info.freq = drv->assoc_freq; -#if (defined (CONFIG_AP) || defined(HOSTAPD)) && defined (ANDROID_BRCM_P2P_PATCH) - } -#endif - wpa_supplicant_event(drv->ctx, EVENT_ASSOC, &event); } @@ -1319,14 +1301,6 @@ static void mlme_event_mgmt(struct wpa_driver_nl80211_data *drv, event.rx_action.data = &mgmt->u.action.category + 1; event.rx_action.len = frame + len - event.rx_action.data; wpa_supplicant_event(drv->ctx, EVENT_RX_ACTION, &event); -#ifdef ANDROID_BRCM_P2P_PATCH - } else if (stype == WLAN_FC_STYPE_ASSOC_REQ) { - mlme_event_assoc(drv, frame, len); - } else if (stype == WLAN_FC_STYPE_DISASSOC) { - mlme_event_deauth_disassoc(drv, EVENT_DISASSOC, frame, len); - } else if (stype == WLAN_FC_STYPE_DEAUTH) { - mlme_event_deauth_disassoc(drv, EVENT_DEAUTH, frame, len); -#endif /* ANDROID_BRCM_P2P_PATCH */ } else { event.rx_mgmt.frame = frame; event.rx_mgmt.frame_len = len; @@ -1412,11 +1386,6 @@ static void mlme_event_deauth_disassoc(struct wpa_driver_nl80211_data *drv, if (type == EVENT_DISASSOC) { event.disassoc_info.locally_generated = !os_memcmp(mgmt->sa, drv->first_bss.addr, ETH_ALEN); -#ifdef ANDROID_BRCM_P2P_PATCH - if (is_ap_interface(drv->nlmode)) { - event.disassoc_info.addr = mgmt->sa; - } else -#endif /* ANDROID_BRCM_P2P_PATCH */ event.disassoc_info.addr = bssid; event.disassoc_info.reason_code = reason_code; if (frame + len > mgmt->u.disassoc.variable) { @@ -1427,11 +1396,6 @@ static void mlme_event_deauth_disassoc(struct wpa_driver_nl80211_data *drv, } else { event.deauth_info.locally_generated = !os_memcmp(mgmt->sa, drv->first_bss.addr, ETH_ALEN); -#ifdef ANDROID_BRCM_P2P_PATCH - if (is_ap_interface(drv->nlmode)) { - event.deauth_info.addr = mgmt->sa; - } else -#endif /* ANDROID_BRCM_P2P_PATCH */ event.deauth_info.addr = bssid; event.deauth_info.reason_code = reason_code; if (frame + len > mgmt->u.deauth.variable) { @@ -2632,8 +2596,9 @@ broken_combination: WPA_DRIVER_FLAGS_TDLS_EXTERNAL_SETUP; } } - +#ifndef ANDROID_BRCM_P2P_PATCH if (tb[NL80211_ATTR_DEVICE_AP_SME]) +#endif info->device_ap_sme = 1; if (tb[NL80211_ATTR_FEATURE_FLAGS]) { @@ -5371,17 +5336,6 @@ static int wpa_driver_nl80211_send_mlme_freq(struct i802_bss *bss, 1); } -#ifdef ANDROID_BRCM_P2P_PATCH - if (is_ap_interface(drv->nlmode)) { - wpa_printf(MSG_DEBUG, "%s: Sending frame on bss freq %d " - "using nl80211_send_frame_cmd", __func__, - bss->freq); - return nl80211_send_frame_cmd(bss, bss->freq, 0, - data, data_len, - &drv->send_action_cookie, 0, - noack, 0); - } -#else /* ANDROID_BRCM_P2P_PATCH */ if (drv->device_ap_sme && is_ap_interface(drv->nlmode)) { if (freq == 0) freq = bss->freq; @@ -5392,7 +5346,6 @@ static int wpa_driver_nl80211_send_mlme_freq(struct i802_bss *bss, &drv->send_action_cookie, no_cck, noack, offchanok); } -#endif /* ANDROID_BRCM_P2P_PATCH */ if (WLAN_FC_GET_TYPE(fc) == WLAN_FC_TYPE_MGMT && WLAN_FC_GET_STYPE(fc) == WLAN_FC_STYPE_AUTH) { @@ -5618,9 +5571,6 @@ static int wpa_driver_nl80211_set_ap(void *priv, } else { bss->beacon_set = 1; } -#if defined(ANDROID_BRCM_P2P_PATCH) && defined(HOSTAPD) - wpa_driver_nl80211_probe_req_report(priv, 1); -#endif return ret; nla_put_failure: nlmsg_free(msg); @@ -5658,15 +5608,8 @@ static int wpa_driver_nl80211_set_freq(struct i802_bss *bss, NL80211_CHAN_HT40PLUS); break; default: -#ifdef ANDROID_BRCM_P2P_PATCH - /* Should be changed to HT20 as a default value because - * P2P firmware does not support 11n for BCM4329 */ - NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, - NL80211_CHAN_NO_HT); -#else /* ANDROID_BRCM_P2P_PATCH */ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_CHANNEL_TYPE, NL80211_CHAN_HT20); -#endif /* ANDROID_BRCM_P2P_PATCH */ break; } } @@ -6363,6 +6306,7 @@ static int nl80211_setup_ap(struct i802_bss *bss) if (nl80211_mgmt_subscribe_ap(bss)) return -1; +#ifndef ANDROID_BRCM_P2P_PATCH if (drv->device_ap_sme && !drv->use_monitor) if (nl80211_mgmt_subscribe_ap_dev_sme(bss)) return -1; @@ -6370,6 +6314,14 @@ static int nl80211_setup_ap(struct i802_bss *bss) if (!drv->device_ap_sme && drv->use_monitor && nl80211_create_monitor_interface(drv) && !drv->device_ap_sme) +#else + if (drv->device_ap_sme) + if (nl80211_mgmt_subscribe_ap_dev_sme(bss)) + return -1; + + if (drv->use_monitor && + nl80211_create_monitor_interface(drv)) +#endif return -1; if (drv->device_ap_sme && @@ -6441,8 +6393,11 @@ static int wpa_driver_nl80211_hapd_send_eapol( u8 *pos; int res; int qos = flags & WPA_STA_WMM; - +#ifndef ANDROID_BRCM_P2P_PATCH if (drv->device_ap_sme || !drv->use_monitor) +#else + if (drv->device_ap_sme && !drv->use_monitor) +#endif return nl80211_send_eapol_data(bss, addr, data, data_len); len = sizeof(*hdr) + (qos ? 2 : 0) + sizeof(rfc1042_header) + 2 + @@ -8489,36 +8444,6 @@ static int wpa_driver_nl80211_probe_req_report(void *priv, int report) NULL, 0) < 0) goto out_err; -#ifdef ANDROID_BRCM_P2P_PATCH - if (nl80211_register_frame(bss, bss->nl_preq, - (WLAN_FC_TYPE_MGMT << 2) | - (WLAN_FC_STYPE_ASSOC_REQ << 4), - NULL, 0) < 0) { - goto out_err; - } - - if (nl80211_register_frame(bss, bss->nl_preq, - (WLAN_FC_TYPE_MGMT << 2) | - (WLAN_FC_STYPE_REASSOC_REQ << 4), - NULL, 0) < 0) { - goto out_err; - } - - if (nl80211_register_frame(bss, bss->nl_preq, - (WLAN_FC_TYPE_MGMT << 2) | - (WLAN_FC_STYPE_DISASSOC << 4), - NULL, 0) < 0) { - goto out_err; - } - - if (nl80211_register_frame(bss, bss->nl_preq, - (WLAN_FC_TYPE_MGMT << 2) | - (WLAN_FC_STYPE_DEAUTH << 4), - NULL, 0) < 0) { - goto out_err; - } -#endif /* ANDROID_BRCM_P2P_PATCH */ - eloop_register_read_sock(nl_socket_get_fd(bss->nl_preq), wpa_driver_nl80211_event_receive, bss->nl_cb, bss->nl_preq); |