/* SPDX-License-Identifier: LGPL-2.1-only OR BSD-3-Clause */
/******************************************************************************
 *
 * This file is provided under a dual license.  When you use or
 * distribute this software, you may choose to be licensed under
 * version 2.1 of the GNU Lesser General Public License
 * ("LGPLv2.1 License") or BSD License.
 *
 * LGPLv2.1 License
 *
 * Copyright(C) 2019 MediaTek Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of version 2.1 of the GNU Lesser General Public
 * License as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html for more
 * details.
 *
 * BSD LICENSE
 *
 * Copyright(C) 2019 MediaTek Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *  * Neither the name of the copyright holder nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *****************************************************************************/

/*----------------------------------------------------------------------------*/
/*! @file c_net_p2p_ctl.h
 *  $RCSfile: c_net_p2p_ctl.c,v $
 *  $Revision: #1 $
 *  $Date: 2015/07/28 $
 *  $Author: dtvbm11 $
 *
 *  @par Description:
 *         This file contains the prototype of control API of Wifi Driver for Application.
 */
/*----------------------------------------------------------------------------*/

#ifndef _C_NET_P2P_CTL_H
#define _C_NET_P2P_CTL_H

/*----------------------------------------------------------------------------*/
/*! @addtogroup groupMW_INET_WIFI
 *  @{
 */
/*----------------------------------------------------------------------------*/

#include "u_net_wlan.h"


INT32 c_net_wlan_p2p_find(x_net_wlan_notify_fct pfNotify);

INT32 c_net_wlan_p2p_stop_find(void);

INT32 c_net_wlan_p2p_connect(INT32 mode , const char * mac , const char * pin);

INT32 c_net_wlan_p2p_pin_connect(const char * mac , const char * pin);

INT32 c_net_wlan_p2p_pbc_connect(const char * mac);

INT32 c_net_wlan_p2p_pbc_accept(const char * mac);

INT32 c_net_wlan_p2p_disconnect();

BOOL c_net_wlan_p2p_set_del_client(const char * mac);

BOOL c_net_wlan_p2p_set_dev_name( const char * dev_name );

INT32 c_net_wlan_p2p_enable_nat( const char * if_name , char * dns);

INT32 c_net_wlan_p2p_disable_nat(void);

INT32 c_net_wlan_p2p_init_wfd_settings(void);

BOOL c_net_wlan_p2p_set_go_ssid(char *ssid,char *passphrase);

BOOL c_net_wlan_p2p_set_go_intent_value(UINT8 intent);

INT32 c_net_wlan_get_ifconfig(char *ifname, char *macbuf, char *ipbuf, char *maskbuf);

INT32 c_net_p2p_open_connection(void);

INT32 c_net_p2p_close_connection(void);

INT32 c_net_wlan_p2p_set_peer_ip(CHAR * ip , int len);

INT32 c_net_wlan_p2p_enable_wfd_mode(void);

INT32 c_net_wlan_p2p_disable_wfd_mode(void);

INT32 c_net_wlan_start_p2p_dhcpd_sever(char * addr,char * mask);

INT32 c_net_wlan_stop_p2p_dhcpd_sever(void );

INT32 c_net_wlan_p2p_signalPoll(char *reply);

INT32 c_net_wlan_p2p_wpsPbc();

INT32 c_net_wlan_p2p_wpsPin(const char *pin);

INT32 c_net_wlan_p2p_wpsCancel();

BOOL c_net_wlan_p2p_setPersistentReconnect(BOOL enabled);

BOOL c_net_wlan_p2p_setDeviceType(char *type);

BOOL c_net_wlan_p2p_setOperchannel(INT16 channel);

INT16 c_net_wlan_p2p_getOperchannel(void);

INT16 c_net_wlan_p2p_getAutoOprch(void);
BOOL c_net_wlan_p2p_listen();

BOOL c_net_wlan_p2p_setListenchannel(INT16 channel);

BOOL c_net_wlan_p2p_listen_timeout(int timeout);

BOOL c_net_wlan_p2p_flush();

BOOL c_net_wlan_p2p_cancelConnect();

BOOL c_net_wlan_p2p_groupAdd();

BOOL c_net_wlan_p2p_groupAdd_withssid(const char *ssid,const char *passphrase);

BOOL c_net_wlan_p2p_groupRemove(char *iface);

BOOL c_net_wlan_p2p_get_driver_version(char *version,UINT8 length);

BOOL c_net_wlan_p2p_reject(char *deviceAddress);

BOOL c_net_wlan_p2p_reinvoke(int netId, char *deviceAddress);

BOOL c_net_wlan_p2p_invite(char *groupInterface, char *groupOwnerDeviceAddress, char *deviceAddress);

INT32 c_net_wlan_p2p_peer(char *reply, char *deviceAddress);

INT32 c_net_wlan_p2p_getInterfaceAddress(char *interfaceAddress, char *deviceAddress);

INT32 c_net_wlan_p2p_set_ageout(char *mac, int time);
INT32 c_net_wlan_p2p_getDeviceAddress(char *deviceAddress);

INT32 c_net_wlan_p2p_get_go_ssid(char *gossid);

INT32 c_net_wlan_p2p_get_wpa_key(char *wpakey);

INT32 c_net_p2p_start_supplicant(x_net_wlan_notify_fct pfNotify);

INT32 c_net_p2p_stop_supplicant(x_net_wlan_notify_fct pfNotify);

INT32 c_net_wlan_p2p_pin_display_accept();

INT32 c_net_p2p_reg_cbk(x_net_wlan_notify_fct pfNotify);

INT32 c_net_p2p_unreg_cbk(x_net_wlan_notify_fct pfNotify);

INT32 c_net_p2p_start_dhcpc(char *name);//group start

INT32 c_net_p2p_restart_dhcpc(char *name);

INT32 c_net_p2p_stop_dhcpc(char *name);//group remove

INT32 c_net_p2p_get_current_ip_info(char *name, NW_IP_INFO_T* pt_ip_info);

INT32 c_net_wlan_p2p_is_wfd_mode(void);

INT32 c_net_p2p_send_to_socket(void);

INT32 c_net_p2p_get_other_ip(const char* mac);

INT32 c_net_p2p_isSupplicantReady();

INT32 c_net_wlan_check_p2p_init_state(void);

/*add for p2p persistent*/
INT32 c_net_wlan_p2p_set_persistent(BOOL enable);
INT32 c_net_wlan_setPersistentTable(PERSISTENT_ENTRY_T* per_entry);
INT32 c_net_wlan_getPersistentTable(char* mac,PERSISTENT_ENTRY_T* per_entry);

INT32 c_net_wlan_get_wifi_info(UINT16 *vID, UINT16 *pID);
INT32 c_net_wlan_wakeon_status(UINT8 *status);
INT32 c_net_wlan_get_rssiofap(INT32 *rssi0, INT32 *rssi1);

//add for sony service mode
INT32 c_net_wlan_p2p_get_clients_mac(CLIENT_MAC_ADD *client_table);

INT32 c_net_p2p_go_get_mac(P2P_GO_MAC_ADD *p2p_go_client_table);
INT32 c_net_p2p_gc_get_mac(CHAR *gc_mac);
INT32 c_net_p2p_go_get_phyrate(UINT32 *go_phyrate);
INT32 c_net_p2p_gc_get_phyrate(UINT32 *gc_phyrate);
INT32 c_net_p2p_go_get_rssiofp2p(INT16 *p2p_go_rssi_0, INT16 *p2p_go_rssi_1);
INT32 c_net_p2p_gc_get_rssiofp2p(INT16 *p2p_gc_rssi_0, INT16 *p2p_gc_rssi_1);
INT32 c_net_p2p_get_noiseofp2p(INT16 *p2p_noise_0, INT16 *p2p_noise_1);
INT32 c_net_p2p_go_get_gi(char *go_gi);
INT32 c_net_p2p_gc_get_gi(char *gc_gi);
INT32 c_net_p2p_go_get_bandwidth(INT16 *go_bandwidth);
INT32 c_net_p2p_gc_get_bandwidth(INT16 *gc_bandwidth);
INT32 c_net_wlan_get_rxtxrate(char * rx, char *tx);
INT32 c_net_p2p_go_get_rxtxrate(char *go_rx, char *go_tx);
INT32 c_net_p2p_gc_get_rxtxrate(char * gc_rx, char *gc_tx);
INT32 c_net_p2p_go_get_phymode(PHY_MODE *go_phymode);
INT32 c_net_p2p_gc_get_phymode(PHY_MODE *gc_phymode);
INT32 c_net_p2p_get_channel(INT16 *p2p_channel);



#endif
