[Feature][task-view-306]merge P56U08(patch6) version

Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No

Change-Id: I8e809511ac30c97228dd110c304b4a08f4af36d7
diff --git a/ap/app/zte_comm/wlan/src/wlan-station.c b/ap/app/zte_comm/wlan/src/wlan-station.c
index 54070e3..a12db51 100755
--- a/ap/app/zte_comm/wlan/src/wlan-station.c
+++ b/ap/app/zte_comm/wlan/src/wlan-station.c
@@ -2720,6 +2720,32 @@
 

 }

 

+/* Started by AICoder, pid:17c05ab2631ba551484608a0f093f11de3c5165e */

+void cap_close_station(void)

+{

+	g_cap_sta_enable = 0;

+	send_sta_status_to_cap(IN_WIFI_STA_STATUS_NONE, IN_WIFI_REASON_CODE_NONE);

+	//sc_cfg_set("wifi_sta_connection", "0");

+

+	if (0 == g_wpa_supplicant) {

+		wf_log("station has closed");

+		return;

+	}

+	//MSG_CMD_WIFI_STATION_CLOSE;

+	sta_disconnected();

+	wlan_station_deinit();

+	if (g_work_mode == IN_WIFI_WORK_MODE_AP0 || g_work_mode == IN_WIFI_WORK_MODE_AP1) {

+		//no mssid, not need

+		//basic_deal_all (WIFI_CFG_RESTART_AP);

+	}

+	else {

+		sc_cfg_set ("wifi_cur_state", WIFI_CLOSED);

+	}

+

+}

+/* Ended by AICoder, pid:17c05ab2631ba551484608a0f093f11de3c5165e */

+

+/* Started by AICoder, pid:ife7a60485s530a149930907308c8b1b9099759f */

 static void cap_station_enable(wlan_sta_enable_t *sta_ena)

 {

 	if (sta_ena->enable == 1) {

@@ -2735,28 +2761,17 @@
 		}

 		else {

 			wf_log("-MSG_CMD_WIFI_STATION_OPEN-");

+			sc_cfg_set ("wifi_cur_state", WIFI_OPENED);

 			wlan_station_init();

 		}

 	}

 	else {

-		g_cap_sta_enable = 0;

-		send_sta_status_to_cap(IN_WIFI_STA_STATUS_NONE, IN_WIFI_REASON_CODE_NONE);

-		//sc_cfg_set("wifi_sta_connection", "0");

-

-		if (0 == g_wpa_supplicant) {

-			wf_log("station has closed");

-			return;

-		}

-		//MSG_CMD_WIFI_STATION_CLOSE;

-		sta_disconnected();

-		wlan_station_deinit();

-		if (g_work_mode == IN_WIFI_WORK_MODE_AP0 || g_work_mode == IN_WIFI_WORK_MODE_AP1) {

-			//no mssid, not need

-			//basic_deal_all (WIFI_CFG_RESTART_AP);

-		}

+		cap_close_station();

 	}

 

 }

+/* Ended by AICoder, pid:ife7a60485s530a149930907308c8b1b9099759f */

+

 

 static int get_cur_ap_rssi(void)

 {

@@ -3167,7 +3182,7 @@
 		if (strcmp (sta_ip_status, "connect") == 0 || strcmp (sta_ip_status, "dhcping") == 0) {

 			sta_disconnected();

 		#ifdef USE_CAP_SUPPORT

-			send_sta_status_to_cap(IN_WIFI_STA_STATUS_IDLE, IN_WIFI_REASON_CODE_NONE);

+			send_sta_status_to_cap(IN_WIFI_STA_STATUS_DISCONNECTED, IN_WIFI_REASON_CODE_NONE);

 		#endif

 		}

 		else{