[bugfix][T108][bug-view-2176]When the ap of Gao Xinxing wifi is turned off, the status obtained by using the gsw_wifi_get_ap_status function is incorrect

Only Configure: No
Affected branch: GSW_V1453
Affected module: WIFI
Is it affected on IC: only ASR
Self-test: yes
Doc Update: no

Change-Id: I6cf3b44665db60095c130ef5844c0a2e253dbc56
diff --git a/mbtk/libgsw_lib/gsw_wifi_interface_sdk.c b/mbtk/libgsw_lib/gsw_wifi_interface_sdk.c
index be244d8..3163f34 100755
--- a/mbtk/libgsw_lib/gsw_wifi_interface_sdk.c
+++ b/mbtk/libgsw_lib/gsw_wifi_interface_sdk.c
@@ -236,7 +236,6 @@
     char cmd[MAX_COMMAND_LEN];
     snprintf(cmd, sizeof(cmd), "killall hostapd");
     int status = execute_command(cmd);
-
     // 关闭对应的 hostapd 后,删除对应的文件
     char path[MAX_COMMAND_LEN];
     snprintf(path, sizeof(path), "%s/%s", CTRL_INTERFACE, WLAN_AP_DEV);
@@ -247,7 +246,20 @@
             LOGE(GSW_WIFI,"Failed to remove hostapd control interface file");
         }
     }
-    LOGI(GSW_WIFI,"gsw_wifi_ap_stop ret = %d\n", status);
+    int hostapd_status = -1;
+    for(int i = 0; i < 10; i++)
+    {
+        if(is_hostapd_running() != GSW_HAL_SUCCESS)
+        {
+            hostapd_status = i;
+            LOGI(GSW_WIFI,"Hostapd stop success");
+            break;
+        }
+        sleep(1);
+    }
+    LOGI(GSW_WIFI,"gsw_wifi_ap_stop ret = %d ,wait %ds\n", status, hostapd_status);
+    if(hostapd_status == -1)
+        return GSW_HAL_NORMAL_FAIL;
     return status;
 }