Enable hostapd with secured mode
authorKim Gibyoung <lastkgb.kim@samsung.com>
Tue, 23 Apr 2013 16:35:44 +0000 (01:35 +0900)
committerKim Gibyoung <lastkgb.kim@samsung.com>
Tue, 23 Apr 2013 17:36:37 +0000 (02:36 +0900)
Change-Id: I4caa8d46d7542799ddb4df23e11b265f827e58a8

12 files changed:
configurations/tizen.config
configurations/tizen_hostapd.config
debian/changelog
hostapd/Makefile
hostapd/hostapd.conf
packaging/wpasupplicant.spec
src/ap/wpa_auth_ie.c
src/drivers/driver_nl80211.c
src/wps/wps_registrar.c
wpa_supplicant/Makefile
wpa_supplicant/events.c
wpa_supplicant/p2p_supplicant.c

index 27142c3..01ea341 100644 (file)
@@ -41,7 +41,7 @@
 
 
 # Driver interface for Host AP driver
-CONFIG_DRIVER_HOSTAP=y
+#CONFIG_DRIVER_HOSTAP=y
 
 # Driver interface for Agere driver
 #CONFIG_DRIVER_HERMES=y
index 63a8453..2d09284 100644 (file)
@@ -41,7 +41,7 @@
 
 
 # Driver interface for Host AP driver
-CONFIG_DRIVER_HOSTAP=y
+#CONFIG_DRIVER_HOSTAP=y
 
 # Driver interface for Agere driver
 #CONFIG_DRIVER_HERMES=y
@@ -83,7 +83,7 @@ CONFIG_DRIVER_HOSTAP=y
 # replacement for WEXT and its use allows wpa_supplicant to properly control
 # the driver to improve existing functionality like roaming and to support new
 # functionality.
-CONFIG_DRIVER_WEXT=y
+#CONFIG_DRIVER_WEXT=y
 
 # Driver interface for Linux drivers using the nl80211 kernel interface
 CONFIG_DRIVER_NL80211=y
@@ -130,22 +130,22 @@ CONFIG_LIBNL20=y
 
 # Enable IEEE 802.1X Supplicant (automatically included if any EAP method is
 # included)
-CONFIG_IEEE8021X_EAPOL=y
+#CONFIG_IEEE8021X_EAPOL=y
 
 # EAP-MD5
-CONFIG_EAP_MD5=y
+#CONFIG_EAP_MD5=y
 
 # EAP-MSCHAPv2
-CONFIG_EAP_MSCHAPV2=y
+#CONFIG_EAP_MSCHAPV2=y
 
 # EAP-TLS
-CONFIG_EAP_TLS=y
+#CONFIG_EAP_TLS=y
 
 # EAL-PEAP
-CONFIG_EAP_PEAP=y
+#CONFIG_EAP_PEAP=y
 
 # EAP-TTLS
-CONFIG_EAP_TTLS=y
+#CONFIG_EAP_TTLS=y
 
 # EAP-FAST
 # Note: Default OpenSSL package does not include support for all the
@@ -155,10 +155,10 @@ CONFIG_EAP_TTLS=y
 #CONFIG_EAP_FAST=y
 
 # EAP-GTC
-CONFIG_EAP_GTC=y
+#CONFIG_EAP_GTC=y
 
 # EAP-OTP
-CONFIG_EAP_OTP=y
+#CONFIG_EAP_OTP=y
 
 # EAP-SIM (enable CONFIG_PCSC, if EAP-SIM is used)
 #CONFIG_EAP_SIM=y
@@ -170,7 +170,7 @@ CONFIG_EAP_OTP=y
 #CONFIG_EAP_PAX=y
 
 # LEAP
-CONFIG_EAP_LEAP=y
+#CONFIG_EAP_LEAP=y
 
 # EAP-AKA (enable CONFIG_PCSC, if EAP-AKA is used)
 #CONFIG_EAP_AKA=y
@@ -212,7 +212,7 @@ CONFIG_PKCS12=y
 
 # Smartcard support (i.e., private key on a smartcard), e.g., with openssl
 # engine.
-CONFIG_SMARTCARD=y
+#CONFIG_SMARTCARD=y
 
 # PC/SC interface for smartcards (USIM, GSM SIM)
 # Enable this if EAP-SIM or EAP-AKA is included
@@ -368,10 +368,10 @@ CONFIG_TLS=openssl
 
 # Add support for new DBus control interface
 # (fi.w1.hostap.wpa_supplicant1)
-CONFIG_CTRL_IFACE_DBUS_NEW=y
+#CONFIG_CTRL_IFACE_DBUS_NEW=y
 
 # Add introspection support for new DBus control interface
-CONFIG_CTRL_IFACE_DBUS_INTRO=y
+#CONFIG_CTRL_IFACE_DBUS_INTRO=y
 
 # Add support for loading EAP methods dynamically as shared libraries.
 # When this option is enabled, each EAP method can be either included
@@ -469,3 +469,7 @@ CONFIG_IEEE80211N=y
 # external networks (GAS/ANQP to learn more about the networks and network
 # selection based on available credentials).
 #CONFIG_INTERWORKING=y
+
+CONFIG_NO_RADIUS=y
+CONFIG_AP=y
+TIZEN_EXT=y
index 6ab8f97..0d44798 100644 (file)
@@ -1,4 +1,12 @@
-wpasupplicant (1.0.0-1) precise; urgency=low
+wpasupplicant (1.0.1-2) unstable; urgency=low
+
+  * Enable hostapd with secured mode
+  * Git: framework/connectivity/wpasupplicant
+  * Tag: wpasupplicant_1.0.1-2
+
+ -- Gibyoung Kim <lastkgb.kim@samsung.com>  Wed, 24 Apr 2013 00:59:05 +0900
+
+wpasupplicant (1.0.1-1) precise; urgency=low
 
   * State clear when assoc_reject
   * Git: framework/connectivity/wpasupplicant
index e46561e..ade093a 100644 (file)
@@ -56,6 +56,18 @@ OBJS += ../src/ap/beacon.o
 
 OBJS_c = hostapd_cli.o ../src/common/wpa_ctrl.o ../src/utils/os_$(CONFIG_OS).o
 
+ifdef TIZEN_EXT
+CFLAGS += -DTIZEN_EXT
+CFLAGS += -DTIZEN_EXT_SOFTAP
+CFLAGS += -DBCM_DRIVER_V115
+CFLAGS += -I../src/drivers
+
+# To force sizeof(enum) = 4
+ifeq ($(TARGET_ARCH),arm)
+CFLAGS += -mabi=aapcs-linux
+endif
+endif
+
 NEED_RC4=y
 NEED_AES=y
 NEED_MD5=y
@@ -790,8 +802,13 @@ verify_config:
        fi
 
 install: all
+ifdef TIZEN_EXT
+       mkdir -p $(DESTDIR)/usr/sbin
+       for i in $(ALL); do cp -f $$i $(DESTDIR)/usr/sbin/$$i; done
+else
        mkdir -p $(DESTDIR)/usr/local/bin
        for i in $(ALL); do cp -f $$i $(DESTDIR)/usr/local/bin/$$i; done
+endif
 
 ../src/drivers/build.hostapd:
        @if [ -f ../src/drivers/build.wpa_supplicant ]; then \
@@ -807,6 +824,7 @@ hostapd: $(BCHECK) $(OBJS)
 
 ifdef CONFIG_WPA_TRACE
 OBJS_c += ../src/utils/trace.o
+OBJS_c += ../src/utils/wpa_debug.o
 endif
 hostapd_cli: $(OBJS_c)
        $(Q)$(CC) $(LDFLAGS) -o hostapd_cli $(OBJS_c) $(LIBS_c)
index a2e50bf..52661cc 100644 (file)
@@ -3,7 +3,7 @@
 
 # AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for
 # management frames); ath0 for madwifi
-interface=wlan0
+#interface=wlan0
 
 # In case of madwifi, atheros, and nl80211 driver interfaces, an additional
 # configuration parameter, bridge, may be used to notify hostapd if the
@@ -62,7 +62,7 @@ dump_file=/tmp/hostapd.dump
 # than one interface is used.
 # /var/run/hostapd is the recommended directory for sockets and by default,
 # hostapd_cli will use it when trying to connect with hostapd.
-ctrl_interface=/var/run/hostapd
+#ctrl_interface=/var/run/hostapd
 
 # Access control for the control interface can be configured by setting the
 # directory to allow only members of a group to use sockets. This way, it is
@@ -83,7 +83,7 @@ ctrl_interface_group=0
 ##### IEEE 802.11 related configuration #######################################
 
 # SSID to be used in IEEE 802.11 management frames
-ssid=test
+#ssid=test
 
 # Country code (ISO/IEC 3166-1). Used to set regulatory domain.
 # Set as needed to indicate country in which device is operating.
@@ -463,7 +463,7 @@ eapol_key_index_workaround=0
 # Use integrated EAP server instead of external RADIUS authentication
 # server. This is also needed if hostapd is configured to act as a RADIUS
 # authentication server.
-eap_server=0
+#eap_server=0
 
 # Path for EAP server user database
 #eap_user_file=/etc/hostapd.eap_user
@@ -574,7 +574,7 @@ eap_server=0
 # authentication with external ACL for MAC addresses, and accounting
 
 # The own IP address of the access point (used as NAS-IP-Address)
-own_ip_addr=127.0.0.1
+#own_ip_addr=127.0.0.1
 
 # Optional NAS-Identifier string for RADIUS messages. When used, this should be
 # a unique to the NAS within the scope of the RADIUS server. For example, a
@@ -1125,3 +1125,20 @@ own_ip_addr=127.0.0.1
 #bss=wlan0_1
 #bssid=00:13:10:95:fe:0b
 # ...
+
+## Tizen Setting Example #######
+
+interface=wlan0
+ctrl_interface=/var/run/hostapd
+ssid=Tizen_AP
+
+wpa=2
+wpa_key_mgmt=WPA-PSK
+wpa_pairwise=CCMP
+wpa_passphrase=12345678
+wps_pin_requests=/var/run/hostapd_wps_pin_requests
+wps_state=2
+eap_server=1
+ap_setup_locked=1
+config_methods=label display push_button keypad
+########################
index f0aef0c..0b8bc6d 100644 (file)
@@ -1,7 +1,7 @@
 Name:      wpasupplicant
 Summary:    Support for WPA and WPA2 (IEEE 802.11i / RSN)
 Version:    1.0.1
-Release:    1
+Release:    2
 Group:      System/Network
 License:    BSD license
 Source0:    %{name}-%{version}.tar.gz
index 5e8d134..3023582 100644 (file)
@@ -253,10 +253,14 @@ int wpa_write_rsn_ie(struct wpa_auth_config *conf, u8 *buf, size_t len,
                capab |= WPA_CAPABILITY_PREAUTH;
        if (conf->peerkey)
                capab |= WPA_CAPABILITY_PEERKEY_ENABLED;
+#ifdef TIZEN_EXT_SOFTAP
+       capab |= (RSN_NUM_REPLAY_COUNTERS_16 << 2);
+#else
        if (conf->wmm_enabled) {
                /* 4 PTKSA replay counters when using WMM */
                capab |= (RSN_NUM_REPLAY_COUNTERS_16 << 2);
        }
+#endif
 #ifdef CONFIG_IEEE80211W
        if (conf->ieee80211w != NO_MGMT_FRAME_PROTECTION) {
                capab |= WPA_CAPABILITY_MFPC;
index 9d4acb1..2e25398 100755 (executable)
@@ -818,6 +818,20 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv,
        u16 status;
 
        mgmt = (const struct ieee80211_mgmt *) frame;
+#ifdef TIZEN_EXT
+       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");
@@ -851,7 +865,9 @@ static void mlme_event_assoc(struct wpa_driver_nl80211_data *drv,
        }
 
        event.assoc_info.freq = drv->assoc_freq;
-
+#ifdef TIZEN_EXT
+       }
+#endif
        wpa_supplicant_event(drv->ctx, EVENT_ASSOC, &event);
 }
 
@@ -953,6 +969,13 @@ static void mlme_timeout_event(struct wpa_driver_nl80211_data *drv,
        wpa_supplicant_event(drv->ctx, ev, &event);
 }
 
+#ifdef TIZEN_EXT
+#ifdef BCM_DRIVER_V115
+static void mlme_event_deauth_disassoc(struct wpa_driver_nl80211_data *drv,
+                                      enum wpa_event_type type,
+                                      const u8 *frame, size_t len);
+#endif
+#endif
 
 static void mlme_event_mgmt(struct wpa_driver_nl80211_data *drv,
                            struct nlattr *freq, const u8 *frame, size_t len)
@@ -983,6 +1006,16 @@ 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 TIZEN_EXT
+#ifdef BCM_DRIVER_V115
+       } 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
+#endif
        } else {
                event.rx_mgmt.frame = frame;
                event.rx_mgmt.frame_len = len;
@@ -4530,6 +4563,11 @@ static int wpa_driver_nl80211_set_ap(void *priv,
                nl80211_set_bss(bss, params->cts_protect, params->preamble,
                                params->short_slot_time, params->ht_opmode);
        }
+
+#ifdef TIZEN_EXT
+       wpa_driver_nl80211_probe_req_report(priv, 1);
+#endif
+
        return ret;
  nla_put_failure:
        nlmsg_free(msg);
@@ -5368,19 +5406,23 @@ static int wpa_driver_nl80211_ap(struct wpa_driver_nl80211_data *drv,
 {
        enum nl80211_iftype nlmode;
 
+#ifdef TIZEN_EXT
+       nlmode = NL80211_IFTYPE_AP;
+#else
        if (params->p2p) {
                wpa_printf(MSG_DEBUG, "nl80211: Setup AP operations for P2P "
                           "group (GO)");
                nlmode = NL80211_IFTYPE_P2P_GO;
        } else
                nlmode = NL80211_IFTYPE_AP;
-
+#endif
        if (wpa_driver_nl80211_set_mode(&drv->first_bss, nlmode) ||
            wpa_driver_nl80211_set_freq(drv, params->freq, 0, 0)) {
                nl80211_remove_monitor_interface(drv);
                return -1;
        }
 
+#ifndef TIZEN_EXT
        if (drv->no_monitor_iface_capab) {
                if (wpa_driver_nl80211_probe_req_report(&drv->first_bss, 1) < 0)
                {
@@ -5389,7 +5431,7 @@ static int wpa_driver_nl80211_ap(struct wpa_driver_nl80211_data *drv,
                        /* Try to survive without this */
                }
        }
-
+#endif
        drv->ap_oper_freq = params->freq;
 
        return 0;
@@ -5616,6 +5658,15 @@ static int wpa_driver_nl80211_connect(
        NLA_PUT_U32(msg, NL80211_ATTR_AUTH_TYPE, type);
 
 skip_auth_type:
+#ifdef TIZEN_EXT
+       if (params->wpa_ie && params->wpa_ie_len) {
+               enum nl80211_wpa_versions ver;
+
+               if (params->wpa_ie[0] == WLAN_EID_RSN)
+                       ver = NL80211_WPA_VERSION_2;
+               else
+                       ver = NL80211_WPA_VERSION_1;
+#else
        if (params->wpa_proto) {
                enum nl80211_wpa_versions ver = 0;
 
@@ -5623,7 +5674,7 @@ skip_auth_type:
                        ver |= NL80211_WPA_VERSION_1;
                if (params->wpa_proto & WPA_PROTO_RSN)
                        ver |= NL80211_WPA_VERSION_2;
-
+#endif
                wpa_printf(MSG_DEBUG, "  * WPA Versions 0x%x", ver);
                NLA_PUT_U32(msg, NL80211_ATTR_WPA_VERSIONS, ver);
        }
@@ -6964,8 +7015,10 @@ static int nl80211_send_frame_cmd(struct wpa_driver_nl80211_data *drv,
 
        NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, drv->ifindex);
        NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq);
+#ifndef BCM_DRIVER_V115
        if (wait)
                NLA_PUT_U32(msg, NL80211_ATTR_DURATION, wait);
+#endif
        NLA_PUT_FLAG(msg, NL80211_ATTR_OFFCHANNEL_TX_OK);
        if (no_cck)
                NLA_PUT_FLAG(msg, NL80211_ATTR_TX_NO_CCK_RATE);
@@ -7177,6 +7230,45 @@ static int wpa_driver_nl80211_probe_req_report(void *priv, int report)
                                   NULL, 0) < 0)
                goto out_err;
 
+#ifdef TIZEN_EXT
+       if (drv->nlmode != NL80211_IFTYPE_AP &&
+               drv->nlmode != NL80211_IFTYPE_P2P_GO) {
+               wpa_printf(MSG_DEBUG, "nl80211: probe_req_report control only "
+                          "allowed in AP or P2P GO mode (iftype=%d)",
+                          drv->nlmode);
+               goto done;
+       }
+
+       if (nl80211_register_frame(drv, drv->nl_preq.handle,
+                          (WLAN_FC_TYPE_MGMT << 2) |
+                          (WLAN_FC_STYPE_ASSOC_REQ << 4),
+                          NULL, 0) < 0) {
+               goto out_err;
+       }
+
+       if (nl80211_register_frame(drv, drv->nl_preq.handle,
+                          (WLAN_FC_TYPE_MGMT << 2) |
+                          (WLAN_FC_STYPE_REASSOC_REQ << 4),
+                          NULL, 0) < 0) {
+               goto out_err;
+       }
+
+       if (nl80211_register_frame(drv, drv->nl_preq.handle,
+                          (WLAN_FC_TYPE_MGMT << 2) |
+                          (WLAN_FC_STYPE_DISASSOC << 4),
+                          NULL, 0) < 0) {
+               goto out_err;
+       }
+
+       if (nl80211_register_frame(drv, drv->nl_preq.handle,
+                                          (WLAN_FC_TYPE_MGMT << 2) |
+                                          (WLAN_FC_STYPE_DEAUTH << 4),
+                                          NULL, 0) < 0) {
+               goto out_err;
+       }
+
+done:
+#endif
        eloop_register_read_sock(nl_socket_get_fd(drv->nl_preq.handle),
                                 wpa_driver_nl80211_event_receive, drv,
                                 drv->nl_preq.handle);
index e5e8d28..fca2cd7 100644 (file)
@@ -2742,7 +2742,7 @@ static enum wps_process_res wps_process_wsc_msg(struct wps_data *wps,
        if (*attr.msg_type != WPS_M1 &&
            (attr.registrar_nonce == NULL ||
             os_memcmp(wps->nonce_r, attr.registrar_nonce,
-                      WPS_NONCE_LEN != 0))) {
+                      WPS_NONCE_LEN) != 0)) {
                wpa_printf(MSG_DEBUG, "WPS: Mismatch in registrar nonce");
                return WPS_FAILURE;
        }
@@ -2838,14 +2838,14 @@ static enum wps_process_res wps_process_wsc_ack(struct wps_data *wps,
 #endif /* CONFIG_WPS_UPNP */
 
        if (attr.registrar_nonce == NULL ||
-           os_memcmp(wps->nonce_r, attr.registrar_nonce, WPS_NONCE_LEN != 0))
+           os_memcmp(wps->nonce_r, attr.registrar_nonce, WPS_NONCE_LEN) != 0)
        {
                wpa_printf(MSG_DEBUG, "WPS: Mismatch in registrar nonce");
                return WPS_FAILURE;
        }
 
        if (attr.enrollee_nonce == NULL ||
-           os_memcmp(wps->nonce_e, attr.enrollee_nonce, WPS_NONCE_LEN != 0)) {
+           os_memcmp(wps->nonce_e, attr.enrollee_nonce, WPS_NONCE_LEN) != 0) {
                wpa_printf(MSG_DEBUG, "WPS: Mismatch in enrollee nonce");
                return WPS_FAILURE;
        }
@@ -2907,14 +2907,14 @@ static enum wps_process_res wps_process_wsc_nack(struct wps_data *wps,
 #endif /* CONFIG_WPS_UPNP */
 
        if (attr.registrar_nonce == NULL ||
-           os_memcmp(wps->nonce_r, attr.registrar_nonce, WPS_NONCE_LEN != 0))
+           os_memcmp(wps->nonce_r, attr.registrar_nonce, WPS_NONCE_LEN) != 0)
        {
                wpa_printf(MSG_DEBUG, "WPS: Mismatch in registrar nonce");
                return WPS_FAILURE;
        }
 
        if (attr.enrollee_nonce == NULL ||
-           os_memcmp(wps->nonce_e, attr.enrollee_nonce, WPS_NONCE_LEN != 0)) {
+           os_memcmp(wps->nonce_e, attr.enrollee_nonce, WPS_NONCE_LEN) != 0) {
                wpa_printf(MSG_DEBUG, "WPS: Mismatch in enrollee nonce");
                return WPS_FAILURE;
        }
@@ -2993,14 +2993,14 @@ static enum wps_process_res wps_process_wsc_done(struct wps_data *wps,
 #endif /* CONFIG_WPS_UPNP */
 
        if (attr.registrar_nonce == NULL ||
-           os_memcmp(wps->nonce_r, attr.registrar_nonce, WPS_NONCE_LEN != 0))
+           os_memcmp(wps->nonce_r, attr.registrar_nonce, WPS_NONCE_LEN) != 0)
        {
                wpa_printf(MSG_DEBUG, "WPS: Mismatch in registrar nonce");
                return WPS_FAILURE;
        }
 
        if (attr.enrollee_nonce == NULL ||
-           os_memcmp(wps->nonce_e, attr.enrollee_nonce, WPS_NONCE_LEN != 0)) {
+           os_memcmp(wps->nonce_e, attr.enrollee_nonce, WPS_NONCE_LEN) != 0) {
                wpa_printf(MSG_DEBUG, "WPS: Mismatch in enrollee nonce");
                return WPS_FAILURE;
        }
index a75a293..62841a5 100644 (file)
@@ -1473,7 +1473,7 @@ windows-bin: $(WINALL)
        $(STRIP) $(WINALL)
 
 wpa_gui/Makefile:
-       qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro 
+       qmake -o wpa_gui/Makefile wpa_gui/wpa_gui.pro
 
 wpa_gui: wpa_gui/Makefile
        $(MAKE) -C wpa_gui
index b1095b5..5956532 100644 (file)
@@ -2178,16 +2178,14 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
                                data->assoc_reject.status_code);
                if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)
                        sme_event_assoc_reject(wpa_s, data);
-
 #if defined TIZEN_EXT
-       wpa_supplicant_cancel_auth_timeout(wpa_s);
-       /* Clear the states */
-       wpa_sm_notify_disassoc(wpa_s->wpa);
-       wpa_supplicant_disassociate(wpa_s, WLAN_REASON_DEAUTH_LEAVING);
-       wpa_s->reassociate = 1;
-       wpa_supplicant_req_scan(wpa_s, 1, 0);
+               wpa_supplicant_cancel_auth_timeout(wpa_s);
+               /* Clear the states */
+               wpa_sm_notify_disassoc(wpa_s->wpa);
+               wpa_supplicant_disassociate(wpa_s, WLAN_REASON_DEAUTH_LEAVING);
+               wpa_s->reassociate = 1;
+               wpa_supplicant_req_scan(wpa_s, 1, 0);
 #endif
-
                break;
        case EVENT_AUTH_TIMED_OUT:
                if (wpa_s->drv_flags & WPA_DRIVER_FLAGS_SME)
index ae6e151..e114832 100755 (executable)
@@ -2294,15 +2294,12 @@ int wpas_p2p_init(struct wpa_global *global, struct wpa_supplicant *wpa_s)
        p2p.get_noa = wpas_get_noa;
        p2p.go_connected = wpas_go_connected;
 
-#ifdef TIZEN_EXT
-#ifdef BCM_DRIVER_V115
+#if defined(TIZEN_EXT_P2P) && defined(BCM_DRIVER_V115)
        char buf[64];
-//     wpa_drv_driver_cmd(wpa_s,  "P2P_DEV_ADDR", buf, sizeof(buf));
-       wpa_s->driver->driver_cmd(wpa_s->drv_priv,  "P2P_DEV_ADDR", buf, sizeof(buf));
-//     os_memcpy(p2p.p2p_dev_addr, buf, ETH_ALEN);
+       wpa_s->driver->priv_cmd(wpa_s->drv_priv,  "P2P_DEV_ADDR", buf, sizeof(buf));
        os_memcpy(wpa_s->global->p2p_dev_addr, buf, ETH_ALEN);
        wpa_printf(MSG_DEBUG, "P2P: Device address ("MACSTR")", MAC2STR(buf));
-#endif
+       os_memcpy(p2p.own_addr, wpa_s->own_addr, ETH_ALEN);
 #else
        os_memcpy(wpa_s->global->p2p_dev_addr, wpa_s->own_addr, ETH_ALEN);
 #endif