OSDN Git Service

Accumulative patch from commit dc013f1e37df3462085cf01a13f0c432f146ad7a
[android-x86/external-wpa_supplicant_8.git] / src / drivers / driver_atheros.c
index 5f2e675..c2f5934 100644 (file)
@@ -874,7 +874,7 @@ static void atheros_raw_recv_hs20(void *ctx, const u8 *src_addr, const u8 *buf,
 }
 #endif /* CONFIG_HS20 */
 
-#if defined(CONFIG_IEEE80211V) && !defined(CONFIG_IEEE80211R)
+#if defined(CONFIG_WNM) && !defined(CONFIG_IEEE80211R)
 static void atheros_raw_recv_11v(void *ctx, const u8 *src_addr, const u8 *buf,
                                 size_t len)
 {
@@ -921,9 +921,9 @@ static void atheros_raw_recv_11v(void *ctx, const u8 *src_addr, const u8 *buf,
                break;
        }
 }
-#endif /* CONFIG_IEEE80211V */
+#endif /* CONFIG_WNM */
 
-#if defined(CONFIG_WPS) || defined(CONFIG_IEEE80211R) || defined(CONFIG_IEEE80211V)
+#if defined(CONFIG_WPS) || defined(CONFIG_IEEE80211R) || defined(CONFIG_WNM)
 static void atheros_raw_receive(void *ctx, const u8 *src_addr, const u8 *buf,
                                size_t len)
 {
@@ -933,9 +933,9 @@ static void atheros_raw_receive(void *ctx, const u8 *src_addr, const u8 *buf,
 #ifdef CONFIG_IEEE80211R
        atheros_raw_recv_11r(ctx, src_addr, buf, len);
 #endif /* CONFIG_IEEE80211R */
-#if defined(CONFIG_IEEE80211V) && !defined(CONFIG_IEEE80211R)
+#if defined(CONFIG_WNM) && !defined(CONFIG_IEEE80211R)
        atheros_raw_recv_11v(ctx, src_addr, buf, len);
-#endif /* CONFIG_IEEE80211V */
+#endif /* CONFIG_WNM */
 #ifdef CONFIG_HS20
        atheros_raw_recv_hs20(ctx, src_addr, buf, len);
 #endif /* CONFIG_HS20 */
@@ -957,9 +957,9 @@ static int atheros_receive_pkt(struct atheros_driver_data *drv)
                               IEEE80211_FILTER_TYPE_AUTH |
                               IEEE80211_FILTER_TYPE_ACTION);
 #endif
-#ifdef CONFIG_IEEE80211V
+#ifdef CONFIG_WNM
        filt.app_filterype |= IEEE80211_FILTER_TYPE_ACTION;
-#endif /* CONFIG_IEEE80211V */
+#endif /* CONFIG_WNM */
 #ifdef CONFIG_HS20
        filt.app_filterype |= IEEE80211_FILTER_TYPE_ACTION;
 #endif /* CONFIG_HS20 */
@@ -976,8 +976,6 @@ static int atheros_receive_pkt(struct atheros_driver_data *drv)
        if (drv->sock_raw == NULL)
                return -1;
 #endif /* CONFIG_WPS || CONFIG_IEEE80211R */
-       if (l2_packet_get_own_addr(drv->sock_xmit, drv->own_addr))
-               return -1;
        return ret;
 }
 
@@ -1656,6 +1654,7 @@ atheros_init(struct hostapd_data *hapd, struct wpa_init_params *params)
                goto bad;
        if (l2_packet_get_own_addr(drv->sock_xmit, params->own_addr))
                goto bad;
+       os_memcpy(drv->own_addr, params->own_addr, ETH_ALEN);
        if (params->bridge[0]) {
                wpa_printf(MSG_DEBUG, "Configure bridge %s for EAPOL traffic.",
                           params->bridge[0]);
@@ -1689,13 +1688,17 @@ atheros_init(struct hostapd_data *hapd, struct wpa_init_params *params)
        linux_set_iface_flags(drv->ioctl_sock, drv->iface, 0);
        atheros_set_privacy(drv, 0); /* default to no privacy */
 
-       atheros_receive_pkt(drv);
+       if (atheros_receive_pkt(drv))
+               goto bad;
 
        if (atheros_wireless_event_init(drv))
                goto bad;
 
        return drv;
 bad:
+       atheros_reset_appfilter(drv);
+       if (drv->sock_raw)
+               l2_packet_deinit(drv->sock_raw);
        if (drv->sock_recv != NULL && drv->sock_recv != drv->sock_xmit)
                l2_packet_deinit(drv->sock_recv);
        if (drv->sock_xmit != NULL)
@@ -1960,7 +1963,7 @@ static int atheros_send_action(void *priv, unsigned int freq,
 }
 
 
-#ifdef CONFIG_IEEE80211V
+#ifdef CONFIG_WNM
 static int athr_wnm_tfs(struct atheros_driver_data *drv, const u8* peer,
                        u8 *ie, u16 *len, enum wnm_oper oper)
 {
@@ -2113,7 +2116,7 @@ static int atheros_wnm_oper(void *priv, enum wnm_oper oper, const u8 *peer,
                return -1;
        }
 }
-#endif /* CONFIG_IEEE80211V */
+#endif /* CONFIG_WNM */
 
 
 const struct wpa_driver_ops wpa_driver_atheros_ops = {
@@ -2147,7 +2150,7 @@ const struct wpa_driver_ops wpa_driver_atheros_ops = {
        .add_sta_node           = atheros_add_sta_node,
 #endif /* CONFIG_IEEE80211R */
        .send_action            = atheros_send_action,
-#ifdef CONFIG_IEEE80211V
+#ifdef CONFIG_WNM
        .wnm_oper               = atheros_wnm_oper,
-#endif /* CONFIG_IEEE80211V */
+#endif /* CONFIG_WNM */
 };