linux/drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hal_bt_coexist.h

/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright(c) 2009-2012  Realtek Corporation.*/

#ifndef __RTL8723E_HAL_BT_COEXIST_H__
#define __RTL8723E_HAL_BT_COEXIST_H__

#include "../wifi.h"

/* The reg define is for 8723 */
#define REG_HIGH_PRIORITY_TXRX
#define REG_LOW_PRIORITY_TXRX

#define BT_FW_COEX_THRESH_TOL
#define BT_FW_COEX_THRESH_20
#define BT_FW_COEX_THRESH_23
#define BT_FW_COEX_THRESH_25
#define BT_FW_COEX_THRESH_30
#define BT_FW_COEX_THRESH_35
#define BT_FW_COEX_THRESH_40
#define BT_FW_COEX_THRESH_45
#define BT_FW_COEX_THRESH_47
#define BT_FW_COEX_THRESH_50
#define BT_FW_COEX_THRESH_55

#define BT_COEX_STATE_BT30
#define BT_COEX_STATE_WIFI_HT20
#define BT_COEX_STATE_WIFI_HT40
#define BT_COEX_STATE_WIFI_LEGACY

#define BT_COEX_STATE_WIFI_RSSI_LOW
#define BT_COEX_STATE_WIFI_RSSI_MEDIUM
#define BT_COEX_STATE_WIFI_RSSI_HIGH
#define BT_COEX_STATE_DEC_BT_POWER

#define BT_COEX_STATE_WIFI_IDLE
#define BT_COEX_STATE_WIFI_UPLINK
#define BT_COEX_STATE_WIFI_DOWNLINK

#define BT_COEX_STATE_BT_INQ_PAGE
#define BT_COEX_STATE_BT_IDLE
#define BT_COEX_STATE_BT_UPLINK
#define BT_COEX_STATE_BT_DOWNLINK

#define BT_COEX_STATE_HOLD_FOR_BT_OPERATION
#define BT_COEX_STATE_BT_RSSI_LOW

#define BT_COEX_STATE_PROFILE_HID
#define BT_COEX_STATE_PROFILE_A2DP
#define BT_COEX_STATE_PROFILE_PAN
#define BT_COEX_STATE_PROFILE_SCO

#define BT_COEX_STATE_WIFI_RSSI_1_LOW
#define BT_COEX_STATE_WIFI_RSSI_1_MEDIUM
#define BT_COEX_STATE_WIFI_RSSI_1_HIGH

#define BT_COEX_STATE_BTINFO_COMMON
#define BT_COEX_STATE_BTINFO_B_HID_SCOESCO
#define BT_COEX_STATE_BTINFO_B_FTP_A2DP

#define BT_COEX_STATE_BT_CNT_LEVEL_0
#define BT_COEX_STATE_BT_CNT_LEVEL_1
#define BT_COEX_STATE_BT_CNT_LEVEL_2
#define BT_COEX_STATE_BT_CNT_LEVEL_3

#define BT_RSSI_STATE_HIGH
#define BT_RSSI_STATE_MEDIUM
#define BT_RSSI_STATE_LOW
#define BT_RSSI_STATE_STAY_HIGH
#define BT_RSSI_STATE_STAY_MEDIUM
#define BT_RSSI_STATE_STAY_LOW

#define BT_AGCTABLE_OFF
#define BT_AGCTABLE_ON
#define BT_BB_BACKOFF_OFF
#define BT_BB_BACKOFF_ON
#define BT_FW_NAV_OFF
#define BT_FW_NAV_ON

#define BT_COEX_MECH_NONE
#define BT_COEX_MECH_SCO
#define BT_COEX_MECH_HID
#define BT_COEX_MECH_A2DP
#define BT_COEX_MECH_PAN
#define BT_COEX_MECH_HID_A2DP
#define BT_COEX_MECH_HID_PAN
#define BT_COEX_MECH_PAN_A2DP
#define BT_COEX_MECH_HID_SCO_ESCO
#define BT_COEX_MECH_FTP_A2DP
#define BT_COEX_MECH_COMMON
#define BT_COEX_MECH_MAX

#define BT_DBG_PROFILE_NONE
#define BT_DBG_PROFILE_SCO
#define BT_DBG_PROFILE_HID
#define BT_DBG_PROFILE_A2DP
#define BT_DBG_PROFILE_PAN
#define BT_DBG_PROFILE_HID_A2DP
#define BT_DBG_PROFILE_HID_PAN
#define BT_DBG_PROFILE_PAN_A2DP
#define BT_DBG_PROFILE_MAX

#define BTINFO_B_FTP
#define BTINFO_B_A2DP
#define BTINFO_B_HID
#define BTINFO_B_SCO_BUSY
#define BTINFO_B_ACL_BUSY
#define BTINFO_B_INQ_PAGE
#define BTINFO_B_SCO_ESCO
#define BTINFO_B_CONNECTION

void rtl8723e_btdm_coex_all_off(struct ieee80211_hw *hw);
void rtl8723e_dm_bt_fw_coex_all_off(struct ieee80211_hw *hw);

void rtl8723e_dm_bt_sw_coex_all_off(struct ieee80211_hw *hw);
void rtl8723e_dm_bt_hw_coex_all_off(struct ieee80211_hw *hw);
long rtl8723e_dm_bt_get_rx_ss(struct ieee80211_hw *hw);
void rtl8723e_dm_bt_balance(struct ieee80211_hw *hw,
			    bool balance_on, u8 ms0, u8 ms1);
void rtl8723e_dm_bt_agc_table(struct ieee80211_hw *hw, u8 type);
void rtl8723e_dm_bt_bb_back_off_level(struct ieee80211_hw *hw, u8 type);
u8 rtl8723e_dm_bt_check_coex_rssi_state(struct ieee80211_hw *hw,
					u8 level_num, u8 rssi_thresh,
					u8 rssi_thresh1);
u8 rtl8723e_dm_bt_check_coex_rssi_state1(struct ieee80211_hw *hw,
					 u8 level_num, u8 rssi_thresh,
					 u8 rssi_thresh1);
void _rtl8723_dm_bt_check_wifi_state(struct ieee80211_hw *hw);
void rtl8723e_dm_bt_reject_ap_aggregated_packet(struct ieee80211_hw *hw,
						bool b_reject);
bool rtl8723e_dm_bt_is_coexist_state_changed(struct ieee80211_hw *hw);
bool rtl8723e_dm_bt_is_wifi_up_link(struct ieee80211_hw *hw);

#endif