wifi_error wifi_stop_gscan(wifi_request_id id, wifi_interface_handle iface)
{
    char prop_buf[PROPERTY_VALUE_MAX];
    property_get("wlan.mtk.gscan", prop_buf, "0");

    if(!strcmp(prop_buf, "1")) {
        ALOGD("[WIFI HAL]Stopping GScan");
        wifi_handle handle = getWifiHandle(iface);

        if(id == -1) {
            wifi_scan_result_handler handler;
            wifi_scan_cmd_params dummy_params;
            memset(&handler, 0, sizeof(handler));

            ScanCommand *cmd = new ScanCommand(iface, id, &dummy_params, handler);
            cmd->cancel();
            cmd->releaseRef();
            return WIFI_SUCCESS;
        }

        WifiCommand *cmd = wifi_unregister_cmd(handle, id);
        if (cmd) {
            cmd->cancel();
            cmd->releaseRef();
            return WIFI_SUCCESS;
        }
    }

    return WIFI_ERROR_INVALID_ARGS;
}
wifi_error wifi_disable_full_scan_results(wifi_request_id id, wifi_interface_handle iface)
{
    ALOGD("[WIFI HAL]Disabling full scan results");
    wifi_handle handle = getWifiHandle(iface);

    if(id == -1) {
        wifi_scan_result_handler handler;
        wifi_handle handle = getWifiHandle(iface);
        int params_dummy;

        memset(&handler, 0, sizeof(handler));
        FullScanResultsCommand *cmd = new FullScanResultsCommand(iface, 0, &params_dummy, handler);
        cmd->cancel();
        cmd->releaseRef();
        return WIFI_SUCCESS;
    }

    WifiCommand *cmd = wifi_unregister_cmd(handle, id);
    if (cmd) {
        cmd->cancel();
        cmd->releaseRef();
        return WIFI_SUCCESS;
    }

    return WIFI_ERROR_INVALID_ARGS;
}
wifi_error wifi_reset_significant_change_handler(wifi_request_id id, wifi_interface_handle iface)
{
    char prop_buf[PROPERTY_VALUE_MAX];
    property_get("wlan.mtk.gscan", prop_buf, "0");

    if(!strcmp(prop_buf, "1")) {
        wifi_handle handle = getWifiHandle(iface);

        WifiCommand *cmd = wifi_unregister_cmd(handle, id);
        if (cmd) {
            cmd->cancel();
            cmd->releaseRef();
            return WIFI_SUCCESS;
        }
    }

    return WIFI_ERROR_INVALID_ARGS;
}