Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 35c9e7fd authored by Mark Einon's avatar Mark Einon Committed by Greg Kroah-Hartman
Browse files

staging: rtl8821ae: Fix halbtc8192e2ant.c 'should it be static?' sparse warnings



In halbtc8192e2ant.c, fix all instances of the sparse warning:

warning: symbol 'xxx' was not declared. Should it be static?

Signed-off-by: default avatarMark Einon <mark@einon.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 88a67339
Loading
Loading
Loading
Loading
+114 −104
Original line number Original line Diff line number Diff line
@@ -21,14 +21,14 @@ static struct coex_dm_8192e_2ant *coex_dm = &glcoex_dm_8192e_2ant;
static struct coex_sta_8192e_2ant glcoex_sta_8192e_2ant;
static struct coex_sta_8192e_2ant glcoex_sta_8192e_2ant;
static struct coex_sta_8192e_2ant *coex_sta = &glcoex_sta_8192e_2ant;
static struct coex_sta_8192e_2ant *coex_sta = &glcoex_sta_8192e_2ant;


const char *const GLBtInfoSrc8192e2Ant[]={
static const char *const GLBtInfoSrc8192e2Ant[]={
	"BT Info[wifi fw]",
	"BT Info[wifi fw]",
	"BT Info[bt rsp]",
	"BT Info[bt rsp]",
	"BT Info[bt auto report]",
	"BT Info[bt auto report]",
};
};


u32 glcoex_ver_date_8192e_2ant = 20130902;
static u32 glcoex_ver_date_8192e_2ant = 20130902;
u32 glcoex_ver_8192e_2ant = 0x34;
static u32 glcoex_ver_8192e_2ant = 0x34;


/**************************************************************
/**************************************************************
 *   local function proto type if needed
 *   local function proto type if needed
@@ -36,7 +36,8 @@ u32 glcoex_ver_8192e_2ant = 0x34;
/**************************************************************
/**************************************************************
 *   local function start with halbtc8192e2ant_
 *   local function start with halbtc8192e2ant_
 **************************************************************/
 **************************************************************/
u8 halbtc8192e2ant_btrssi_state(u8 level_num, u8 rssi_thresh, u8 rssi_thresh1)
static u8 halbtc8192e2ant_btrssi_state(u8 level_num, u8 rssi_thresh,
				       u8 rssi_thresh1)
{
{
	int btrssi=0;
	int btrssi=0;
	u8 btrssi_state = coex_sta->pre_bt_rssi_state;
	u8 btrssi_state = coex_sta->pre_bt_rssi_state;
@@ -132,8 +133,9 @@ u8 halbtc8192e2ant_btrssi_state(u8 level_num, u8 rssi_thresh, u8 rssi_thresh1)
	return btrssi_state;
	return btrssi_state;
}
}


u8 halbtc8192e2ant_wifirssi_state(struct btc_coexist * btcoexist, u8 index,
static u8 halbtc8192e2ant_wifirssi_state(struct btc_coexist * btcoexist,
				  u8 level_num, u8 rssi_thresh, u8 rssi_thresh1)
					 u8 index, u8 level_num,
					 u8 rssi_thresh, u8 rssi_thresh1)
{
{
	int wifirssi = 0;
	int wifirssi = 0;
	u8 wifirssi_state = coex_sta->pre_wifi_rssi_state[index];
	u8 wifirssi_state = coex_sta->pre_wifi_rssi_state[index];
@@ -234,7 +236,7 @@ u8 halbtc8192e2ant_wifirssi_state(struct btc_coexist * btcoexist, u8 index,
	return wifirssi_state;
	return wifirssi_state;
}
}


void halbtc8192e2ant_monitor_bt_enable_disable(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_monitor_bt_enable_disable(struct btc_coexist *btcoexist)
{
{
	static bool pre_bt_disabled = false;
	static bool pre_bt_disabled = false;
	static u32 bt_disable_cnt = 0;
	static u32 bt_disable_cnt = 0;
@@ -283,7 +285,7 @@ void halbtc8192e2ant_monitor_bt_enable_disable(struct btc_coexist *btcoexist)
	}
	}
}
}


u32 halbtc8192e2ant_decidera_mask(struct btc_coexist *btcoexist,
static u32 halbtc8192e2ant_decidera_mask(struct btc_coexist *btcoexist,
				  u8 sstype, u32 ra_masktype)
				  u8 sstype, u32 ra_masktype)
{
{
	u32 disra_mask = 0x0;
	u32 disra_mask = 0x0;
@@ -314,7 +316,7 @@ u32 halbtc8192e2ant_decidera_mask(struct btc_coexist *btcoexist,
	return disra_mask;
	return disra_mask;
}
}


void halbtc8192e2ant_Updatera_mask(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_Updatera_mask(struct btc_coexist *btcoexist,
					  bool force_exec, u32 dis_ratemask)
					  bool force_exec, u32 dis_ratemask)
{
{
	coex_dm->curra_mask = dis_ratemask;
	coex_dm->curra_mask = dis_ratemask;
@@ -325,7 +327,7 @@ void halbtc8192e2ant_Updatera_mask(struct btc_coexist *btcoexist,
	coex_dm->prera_mask = coex_dm->curra_mask;
	coex_dm->prera_mask = coex_dm->curra_mask;
}
}


void halbtc8192e2ant_autorate_fallback_retry(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_autorate_fallback_retry(struct btc_coexist *btcoexist,
						    bool force_exec, u8 type)
						    bool force_exec, u8 type)
{
{
	bool wifi_under_bmode = false;
	bool wifi_under_bmode = false;
@@ -364,7 +366,7 @@ void halbtc8192e2ant_autorate_fallback_retry(struct btc_coexist *btcoexist,
	coex_dm->pre_arfrtype = coex_dm->cur_arfrtype;
	coex_dm->pre_arfrtype = coex_dm->cur_arfrtype;
}
}


void halbtc8192e2ant_retrylimit(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_retrylimit(struct btc_coexist *btcoexist,
				       bool force_exec, u8 type)
				       bool force_exec, u8 type)
{
{
	coex_dm->cur_retrylimit_type = type;
	coex_dm->cur_retrylimit_type = type;
@@ -388,7 +390,7 @@ void halbtc8192e2ant_retrylimit(struct btc_coexist *btcoexist,
	coex_dm->pre_retrylimit_type = coex_dm->cur_retrylimit_type;
	coex_dm->pre_retrylimit_type = coex_dm->cur_retrylimit_type;
}
}


void halbtc8192e2ant_ampdu_maxtime(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_ampdu_maxtime(struct btc_coexist *btcoexist,
					  bool force_exec, u8 type)
					  bool force_exec, u8 type)
{
{
	coex_dm->cur_ampdutime_type = type;
	coex_dm->cur_ampdutime_type = type;
@@ -411,9 +413,10 @@ void halbtc8192e2ant_ampdu_maxtime(struct btc_coexist *btcoexist,
	coex_dm->pre_ampdutime_type = coex_dm->cur_ampdutime_type;
	coex_dm->pre_ampdutime_type = coex_dm->cur_ampdutime_type;
}
}


void halbtc8192e2ant_limited_tx(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_limited_tx(struct btc_coexist *btcoexist,
				bool force_exec, u8 ra_masktype, u8 arfr_type,
				       bool force_exec, u8 ra_masktype,
				u8 retrylimit_type, u8 ampdutime_type)
				       u8 arfr_type, u8 retrylimit_type,
				       u8 ampdutime_type)
{
{
	u32 disra_mask = 0x0;
	u32 disra_mask = 0x0;


@@ -429,7 +432,7 @@ void halbtc8192e2ant_limited_tx(struct btc_coexist *btcoexist,
	halbtc8192e2ant_ampdu_maxtime(btcoexist, force_exec, ampdutime_type);
	halbtc8192e2ant_ampdu_maxtime(btcoexist, force_exec, ampdutime_type);
}
}


void halbtc8192e2ant_limited_rx(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_limited_rx(struct btc_coexist *btcoexist,
				       bool force_exec, bool rej_ap_agg_pkt,
				       bool force_exec, bool rej_ap_agg_pkt,
				       bool b_bt_ctrl_agg_buf_size,
				       bool b_bt_ctrl_agg_buf_size,
				       u8 agg_buf_size)
				       u8 agg_buf_size)
@@ -455,7 +458,7 @@ void halbtc8192e2ant_limited_rx(struct btc_coexist *btcoexist,


}
}


void halbtc8192e2ant_monitor_bt_ctr(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_monitor_bt_ctr(struct btc_coexist *btcoexist)
{
{
	u32 reg_hp_txrx, reg_lp_txrx, u32tmp;
	u32 reg_hp_txrx, reg_lp_txrx, u32tmp;
	u32 reg_hp_tx = 0, reg_hp_rx = 0, reg_lp_tx = 0, reg_lp_rx = 0;
	u32 reg_hp_tx = 0, reg_hp_rx = 0, reg_lp_tx = 0, reg_lp_rx = 0;
@@ -487,7 +490,7 @@ void halbtc8192e2ant_monitor_bt_ctr(struct btc_coexist *btcoexist)
	btcoexist->btc_write_1byte(btcoexist, 0x76e, 0xc);
	btcoexist->btc_write_1byte(btcoexist, 0x76e, 0xc);
}
}


void halbtc8192e2ant_querybt_info(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_querybt_info(struct btc_coexist *btcoexist)
{
{
	u8 h2c_parameter[1] ={0};
	u8 h2c_parameter[1] ={0};


@@ -502,7 +505,7 @@ void halbtc8192e2ant_querybt_info(struct btc_coexist *btcoexist)
	btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter);
	btcoexist->btc_fill_h2c(btcoexist, 0x61, 1, h2c_parameter);
}
}


bool halbtc8192e2ant_iswifi_status_changed(struct btc_coexist *btcoexist)
static bool halbtc8192e2ant_iswifi_status_changed(struct btc_coexist *btcoexist)
{
{
	static bool pre_wifi_busy = false;
	static bool pre_wifi_busy = false;
	static bool pre_under_4way = false, pre_bt_hson = false;
	static bool pre_under_4way = false, pre_bt_hson = false;
@@ -534,7 +537,7 @@ bool halbtc8192e2ant_iswifi_status_changed(struct btc_coexist *btcoexist)
	return false;
	return false;
}
}


void halbtc8192e2ant_update_btlink_info(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_update_btlink_info(struct btc_coexist *btcoexist)
{
{
	struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
	struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
	bool bt_hson = false;
	bool bt_hson = false;
@@ -590,7 +593,7 @@ void halbtc8192e2ant_update_btlink_info(struct btc_coexist *btcoexist)
		bt_link_info->hid_only = false;
		bt_link_info->hid_only = false;
}
}


u8 halbtc8192e2ant_action_algorithm(struct btc_coexist *btcoexist)
static u8 halbtc8192e2ant_action_algorithm(struct btc_coexist *btcoexist)
{
{
	struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
	struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
	struct btc_stack_info *stack_info = &btcoexist->stack_info;
	struct btc_stack_info *stack_info = &btcoexist->stack_info;
@@ -777,7 +780,7 @@ u8 halbtc8192e2ant_action_algorithm(struct btc_coexist *btcoexist)
	return algorithm;
	return algorithm;
}
}


void halbtc8192e2ant_setfw_dac_swinglevel(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_setfw_dac_swinglevel(struct btc_coexist *btcoexist,
						 u8 dac_swinglvl)
						 u8 dac_swinglvl)
{
{
	u8 h2c_parameter[1] ={0};
	u8 h2c_parameter[1] ={0};
@@ -794,7 +797,7 @@ void halbtc8192e2ant_setfw_dac_swinglevel(struct btc_coexist *btcoexist,
	btcoexist->btc_fill_h2c(btcoexist, 0x64, 1, h2c_parameter);
	btcoexist->btc_fill_h2c(btcoexist, 0x64, 1, h2c_parameter);
}
}


void halbtc8192e2ant_set_fwdec_btpwr(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_set_fwdec_btpwr(struct btc_coexist *btcoexist,
					    u8 dec_btpwr_lvl)
					    u8 dec_btpwr_lvl)
{
{
	u8 h2c_parameter[1] ={0};
	u8 h2c_parameter[1] ={0};
@@ -808,7 +811,7 @@ void halbtc8192e2ant_set_fwdec_btpwr(struct btc_coexist *btcoexist,
	btcoexist->btc_fill_h2c(btcoexist, 0x62, 1, h2c_parameter);
	btcoexist->btc_fill_h2c(btcoexist, 0x62, 1, h2c_parameter);
}
}


void halbtc8192e2ant_dec_btpwr(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_dec_btpwr(struct btc_coexist *btcoexist,
				      bool force_exec, u8 dec_btpwr_lvl)
				      bool force_exec, u8 dec_btpwr_lvl)
{
{
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW,
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW,
@@ -826,7 +829,7 @@ void halbtc8192e2ant_dec_btpwr(struct btc_coexist *btcoexist,
	coex_dm->pre_dec_bt_pwr = coex_dm->cur_dec_bt_pwr;
	coex_dm->pre_dec_bt_pwr = coex_dm->cur_dec_bt_pwr;
}
}


void halbtc8192e2ant_set_bt_autoreport(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_set_bt_autoreport(struct btc_coexist *btcoexist,
					      bool enable_autoreport)
					      bool enable_autoreport)
{
{
	u8 h2c_parameter[1] ={0};
	u8 h2c_parameter[1] ={0};
@@ -844,8 +847,9 @@ void halbtc8192e2ant_set_bt_autoreport(struct btc_coexist *btcoexist,
	btcoexist->btc_fill_h2c(btcoexist, 0x68, 1, h2c_parameter);
	btcoexist->btc_fill_h2c(btcoexist, 0x68, 1, h2c_parameter);
}
}


void halbtc8192e2ant_bt_autoreport(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_bt_autoreport(struct btc_coexist *btcoexist,
				   bool force_exec, bool enable_autoreport)
					  bool force_exec,
					  bool enable_autoreport)
{
{
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW,
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW,
		  "[BTCoex], %s BT Auto report = %s\n",
		  "[BTCoex], %s BT Auto report = %s\n",
@@ -868,7 +872,7 @@ void halbtc8192e2ant_bt_autoreport(struct btc_coexist *btcoexist,
	coex_dm->pre_bt_auto_report = coex_dm->cur_bt_auto_report;
	coex_dm->pre_bt_auto_report = coex_dm->cur_bt_auto_report;
}
}


void halbtc8192e2ant_fw_dac_swinglvl(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_fw_dac_swinglvl(struct btc_coexist *btcoexist,
					    bool force_exec, u8 fw_dac_swinglvl)
					    bool force_exec, u8 fw_dac_swinglvl)
{
{
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW,
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW,
@@ -893,7 +897,7 @@ void halbtc8192e2ant_fw_dac_swinglvl(struct btc_coexist *btcoexist,
	coex_dm->pre_fw_dac_swing_lvl = coex_dm->cur_fw_dac_swing_lvl;
	coex_dm->pre_fw_dac_swing_lvl = coex_dm->cur_fw_dac_swing_lvl;
}
}


void halbtc8192e2ant_set_sw_rf_rx_lpf_corner(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_set_sw_rf_rx_lpf_corner(struct btc_coexist *btcoexist,
						    bool rx_rf_shrink_on)
						    bool rx_rf_shrink_on)
{
{
	if (rx_rf_shrink_on) {
	if (rx_rf_shrink_on) {
@@ -915,7 +919,7 @@ void halbtc8192e2ant_set_sw_rf_rx_lpf_corner(struct btc_coexist *btcoexist,
	}
	}
}
}


void halbtc8192e2ant_rf_shrink(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_rf_shrink(struct btc_coexist *btcoexist,
				      bool force_exec, bool rx_rf_shrink_on)
				      bool force_exec, bool rx_rf_shrink_on)
{
{
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW,
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW,
@@ -939,7 +943,7 @@ void halbtc8192e2ant_rf_shrink(struct btc_coexist *btcoexist,
	coex_dm->pre_rf_rx_lpf_shrink = coex_dm->cur_rf_rx_lpf_shrink;
	coex_dm->pre_rf_rx_lpf_shrink = coex_dm->cur_rf_rx_lpf_shrink;
}
}


void halbtc8192e2ant_set_sw_penalty_tx_rateadaptive(
static void halbtc8192e2ant_set_sw_penalty_tx_rateadaptive(
						struct btc_coexist *btcoexist,
						struct btc_coexist *btcoexist,
						bool low_penalty_ra)
						bool low_penalty_ra)
{
{
@@ -963,7 +967,7 @@ void halbtc8192e2ant_set_sw_penalty_tx_rateadaptive(
	btcoexist->btc_fill_h2c(btcoexist, 0x69, 6, h2c_parameter);
	btcoexist->btc_fill_h2c(btcoexist, 0x69, 6, h2c_parameter);
}
}


void halbtc8192e2ant_low_penalty_ra(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_low_penalty_ra(struct btc_coexist *btcoexist,
					   bool force_exec, bool low_penalty_ra)
					   bool force_exec, bool low_penalty_ra)
{
{
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW,
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW,
@@ -987,7 +991,7 @@ void halbtc8192e2ant_low_penalty_ra(struct btc_coexist *btcoexist,
	coex_dm->pre_low_penalty_ra = coex_dm->cur_low_penalty_ra;
	coex_dm->pre_low_penalty_ra = coex_dm->cur_low_penalty_ra;
}
}


void halbtc8192e2ant_set_dac_swingreg(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_set_dac_swingreg(struct btc_coexist *btcoexist,
					     u32 level)
					     u32 level)
{
{
	u8 val = (u8)level;
	u8 val = (u8)level;
@@ -997,7 +1001,7 @@ void halbtc8192e2ant_set_dac_swingreg(struct btc_coexist *btcoexist,
	btcoexist->btc_write_1byte_bitmask(btcoexist, 0x883, 0x3e, val);
	btcoexist->btc_write_1byte_bitmask(btcoexist, 0x883, 0x3e, val);
}
}


void halbtc8192e2ant_setsw_fulltime_dacswing(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_setsw_fulltime_dacswing(struct btc_coexist *btcoexist,
						    bool sw_dac_swingon,
						    bool sw_dac_swingon,
						    u32 sw_dac_swinglvl)
						    u32 sw_dac_swinglvl)
{
{
@@ -1007,8 +1011,7 @@ void halbtc8192e2ant_setsw_fulltime_dacswing(struct btc_coexist *btcoexist,
		halbtc8192e2ant_set_dac_swingreg(btcoexist, 0x18);
		halbtc8192e2ant_set_dac_swingreg(btcoexist, 0x18);
}
}



static void halbtc8192e2ant_DacSwing(struct btc_coexist *btcoexist,
void halbtc8192e2ant_DacSwing(struct btc_coexist *btcoexist,
				     bool force_exec, bool dac_swingon,
				     bool force_exec, bool dac_swingon,
				     u32 dac_swinglvl)
				     u32 dac_swinglvl)
{
{
@@ -1041,7 +1044,7 @@ void halbtc8192e2ant_DacSwing(struct btc_coexist *btcoexist,
	coex_dm->pre_dac_swing_lvl = coex_dm->cur_dac_swing_lvl;
	coex_dm->pre_dac_swing_lvl = coex_dm->cur_dac_swing_lvl;
}
}


void halbtc8192e2ant_set_agc_table(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_set_agc_table(struct btc_coexist *btcoexist,
					  bool agc_table_en)
					  bool agc_table_en)
{
{


@@ -1067,7 +1070,7 @@ void halbtc8192e2ant_set_agc_table(struct btc_coexist *btcoexist,
	}
	}
}
}


void halbtc8192e2ant_AgcTable(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_AgcTable(struct btc_coexist *btcoexist,
				     bool force_exec, bool agc_table_en)
				     bool force_exec, bool agc_table_en)
{
{
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW,
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW,
@@ -1089,7 +1092,7 @@ void halbtc8192e2ant_AgcTable(struct btc_coexist *btcoexist,
	coex_dm->pre_agc_table_en = coex_dm->cur_agc_table_en;
	coex_dm->pre_agc_table_en = coex_dm->cur_agc_table_en;
}
}


void halbtc8192e2ant_set_coex_table(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_set_coex_table(struct btc_coexist *btcoexist,
					   u32 val0x6c0, u32 val0x6c4,
					   u32 val0x6c0, u32 val0x6c4,
					   u32 val0x6c8, u8 val0x6cc)
					   u32 val0x6c8, u8 val0x6cc)
{
{
@@ -1110,7 +1113,8 @@ void halbtc8192e2ant_set_coex_table(struct btc_coexist *btcoexist,
	btcoexist->btc_write_1byte(btcoexist, 0x6cc, val0x6cc);
	btcoexist->btc_write_1byte(btcoexist, 0x6cc, val0x6cc);
}
}


void halbtc8192e2ant_coex_table(struct btc_coexist *btcoexist, bool force_exec,
static void halbtc8192e2ant_coex_table(struct btc_coexist *btcoexist,
				       bool force_exec,
				       u32 val0x6c0, u32 val0x6c4,
				       u32 val0x6c0, u32 val0x6c4,
				       u32 val0x6c8, u8 val0x6cc)
				       u32 val0x6c8, u8 val0x6cc)
{
{
@@ -1154,7 +1158,7 @@ void halbtc8192e2ant_coex_table(struct btc_coexist *btcoexist, bool force_exec,
	coex_dm->pre_val0x6cc = coex_dm->cur_val0x6cc;
	coex_dm->pre_val0x6cc = coex_dm->cur_val0x6cc;
}
}


void halbtc8192e2ant_coex_table_with_type(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_coex_table_with_type(struct btc_coexist *btcoexist,
						 bool force_exec, u8 type)
						 bool force_exec, u8 type)
{
{
	switch (type) {
	switch (type) {
@@ -1183,7 +1187,7 @@ void halbtc8192e2ant_coex_table_with_type(struct btc_coexist *btcoexist,
	}
	}
}
}


void halbtc8192e2ant_set_fw_ignore_wlanact(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_set_fw_ignore_wlanact(struct btc_coexist *btcoexist,
						  bool enable)
						  bool enable)
{
{
	u8 h2c_parameter[1] ={0};
	u8 h2c_parameter[1] ={0};
@@ -1198,7 +1202,7 @@ void halbtc8192e2ant_set_fw_ignore_wlanact(struct btc_coexist *btcoexist,
	btcoexist->btc_fill_h2c(btcoexist, 0x63, 1, h2c_parameter);
	btcoexist->btc_fill_h2c(btcoexist, 0x63, 1, h2c_parameter);
}
}


void halbtc8192e2ant_IgnoreWlanAct(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_IgnoreWlanAct(struct btc_coexist *btcoexist,
					  bool force_exec, bool enable)
					  bool force_exec, bool enable)
{
{
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW,
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW,
@@ -1223,7 +1227,7 @@ void halbtc8192e2ant_IgnoreWlanAct(struct btc_coexist *btcoexist,
	coex_dm->pre_ignore_wlan_act = coex_dm->cur_ignore_wlan_act;
	coex_dm->pre_ignore_wlan_act = coex_dm->cur_ignore_wlan_act;
}
}


void halbtc8192e2ant_SetFwPstdma(struct btc_coexist *btcoexist, u8 byte1,
static void halbtc8192e2ant_SetFwPstdma(struct btc_coexist *btcoexist, u8 byte1,
					u8 byte2, u8 byte3, u8 byte4, u8 byte5)
					u8 byte2, u8 byte3, u8 byte4, u8 byte5)
{
{
	u8 h2c_parameter[5] ={0};
	u8 h2c_parameter[5] ={0};
@@ -1249,23 +1253,27 @@ void halbtc8192e2ant_SetFwPstdma(struct btc_coexist *btcoexist, u8 byte1,
	btcoexist->btc_fill_h2c(btcoexist, 0x60, 5, h2c_parameter);
	btcoexist->btc_fill_h2c(btcoexist, 0x60, 5, h2c_parameter);
}
}


void halbtc8192e2ant_sw_mechanism1(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_sw_mechanism1(struct btc_coexist *btcoexist,
				   bool shrink_rx_lpf, bool low_penalty_ra,
					  bool shrink_rx_lpf,
				   bool limited_dig, bool btlan_constrain)
					  bool low_penalty_ra,
					  bool limited_dig,
					  bool btlan_constrain)
{
{
	halbtc8192e2ant_rf_shrink(btcoexist, NORMAL_EXEC, shrink_rx_lpf);
	halbtc8192e2ant_rf_shrink(btcoexist, NORMAL_EXEC, shrink_rx_lpf);
}
}


void halbtc8192e2ant_sw_mechanism2(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_sw_mechanism2(struct btc_coexist *btcoexist,
				   bool agc_table_shift, bool adc_backoff,
					  bool agc_table_shift,
				   bool sw_dac_swing, u32 dac_swinglvl)
					  bool adc_backoff,
					  bool sw_dac_swing,
					  u32 dac_swinglvl)
{
{
	halbtc8192e2ant_AgcTable(btcoexist, NORMAL_EXEC, agc_table_shift);
	halbtc8192e2ant_AgcTable(btcoexist, NORMAL_EXEC, agc_table_shift);
	halbtc8192e2ant_DacSwing(btcoexist, NORMAL_EXEC, sw_dac_swing,
	halbtc8192e2ant_DacSwing(btcoexist, NORMAL_EXEC, sw_dac_swing,
				 dac_swinglvl);
				 dac_swinglvl);
}
}


void halbtc8192e2ant_ps_tdma(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_ps_tdma(struct btc_coexist *btcoexist,
				    bool force_exec, bool turn_on, u8 type)
				    bool force_exec, bool turn_on, u8 type)
{
{


@@ -1402,7 +1410,8 @@ void halbtc8192e2ant_ps_tdma(struct btc_coexist *btcoexist,
	coex_dm->pre_ps_tdma = coex_dm->cur_ps_tdma;
	coex_dm->pre_ps_tdma = coex_dm->cur_ps_tdma;
}
}


void halbtc8192e2ant_set_switch_sstype(struct btc_coexist *btcoexist, u8 sstype)
static void halbtc8192e2ant_set_switch_sstype(struct btc_coexist *btcoexist,
					      u8 sstype)
{
{
	u8 mimops = BTC_MIMO_PS_DYNAMIC;
	u8 mimops = BTC_MIMO_PS_DYNAMIC;
	u32 disra_mask = 0x0;
	u32 disra_mask = 0x0;
@@ -1437,7 +1446,7 @@ void halbtc8192e2ant_set_switch_sstype(struct btc_coexist *btcoexist, u8 sstype)
	btcoexist->btc_set(btcoexist, BTC_SET_ACT_SEND_MIMO_PS, &mimops);
	btcoexist->btc_set(btcoexist, BTC_SET_ACT_SEND_MIMO_PS, &mimops);
}
}


void halbtc8192e2ant_switch_sstype(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_switch_sstype(struct btc_coexist *btcoexist,
				   bool force_exec, u8 new_sstype)
				   bool force_exec, u8 new_sstype)
{
{
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE,
	BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE,
@@ -1454,7 +1463,7 @@ void halbtc8192e2ant_switch_sstype(struct btc_coexist *btcoexist,
	coex_dm->pre_sstype = coex_dm->cur_sstype;
	coex_dm->pre_sstype = coex_dm->cur_sstype;
}
}


void halbtc8192e2ant_coex_alloff(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_coex_alloff(struct btc_coexist *btcoexist)
{
{
	/* fw all off */
	/* fw all off */
	halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1);
	halbtc8192e2ant_ps_tdma(btcoexist, NORMAL_EXEC, false, 1);
@@ -1469,7 +1478,7 @@ void halbtc8192e2ant_coex_alloff(struct btc_coexist *btcoexist)
	halbtc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
	halbtc8192e2ant_coex_table_with_type(btcoexist, NORMAL_EXEC, 0);
}
}


void halbtc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist)
{
{
	/* force to reset coex mechanism */
	/* force to reset coex mechanism */


@@ -1484,7 +1493,7 @@ void halbtc8192e2ant_init_coex_dm(struct btc_coexist *btcoexist)
	halbtc8192e2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
	halbtc8192e2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
}
}


void halbtc8192e2ant_action_bt_inquiry(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_bt_inquiry(struct btc_coexist *btcoexist)
{
{
	bool low_pwr_disable = true;
	bool low_pwr_disable = true;


@@ -1502,7 +1511,7 @@ void halbtc8192e2ant_action_bt_inquiry(struct btc_coexist *btcoexist)
	halbtc8192e2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
	halbtc8192e2ant_sw_mechanism2(btcoexist, false, false, false, 0x18);
}
}


bool halbtc8192e2ant_is_common_action(struct btc_coexist *btcoexist)
static bool halbtc8192e2ant_is_common_action(struct btc_coexist *btcoexist)
{
{
	struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
	struct btc_bt_link_info *bt_link_info = &btcoexist->bt_link_info;
	bool common = false, wifi_connected = false, wifi_busy = false;
	bool common = false, wifi_connected = false, wifi_busy = false;
@@ -1647,7 +1656,7 @@ bool halbtc8192e2ant_is_common_action(struct btc_coexist *btcoexist)
	return common;
	return common;
}
}


void halbtc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
static void halbtc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
						 bool sco_hid, bool tx_pause,
						 bool sco_hid, bool tx_pause,
						 u8 max_interval)
						 u8 max_interval)
{
{
@@ -2704,7 +2713,7 @@ void halbtc8192e2ant_tdma_duration_adjust(struct btc_coexist *btcoexist,
}
}


/* SCO only or SCO+PAN(HS) */
/* SCO only or SCO+PAN(HS) */
void halbtc8192e2ant_action_sco(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_sco(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_STAY_LOW;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_STAY_LOW;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -2766,7 +2775,7 @@ void halbtc8192e2ant_action_sco(struct btc_coexist *btcoexist)
	}
	}
}
}


void halbtc8192e2ant_action_sco_pan(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_sco_pan(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_STAY_LOW;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_STAY_LOW;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -2828,7 +2837,7 @@ void halbtc8192e2ant_action_sco_pan(struct btc_coexist *btcoexist)
	}
	}
}
}


void halbtc8192e2ant_action_hid(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_hid(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state=BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state=BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -2890,7 +2899,7 @@ void halbtc8192e2ant_action_hid(struct btc_coexist *btcoexist)
}
}


/* A2DP only / PAN(EDR) only/ A2DP+PAN(HS) */
/* A2DP only / PAN(EDR) only/ A2DP+PAN(HS) */
void halbtc8192e2ant_action_a2dp(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_a2dp(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -2979,7 +2988,7 @@ void halbtc8192e2ant_action_a2dp(struct btc_coexist *btcoexist)
	}
	}
}
}


void halbtc8192e2ant_action_a2dp_pan_hs(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_a2dp_pan_hs(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -3040,7 +3049,7 @@ void halbtc8192e2ant_action_a2dp_pan_hs(struct btc_coexist *btcoexist)
	}
	}
}
}


void halbtc8192e2ant_action_pan_edr(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_pan_edr(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -3101,7 +3110,7 @@ void halbtc8192e2ant_action_pan_edr(struct btc_coexist *btcoexist)
}
}


/* PAN(HS) only */
/* PAN(HS) only */
void halbtc8192e2ant_action_pan_hs(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_pan_hs(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -3159,7 +3168,7 @@ void halbtc8192e2ant_action_pan_hs(struct btc_coexist *btcoexist)
}
}


/* PAN(EDR)+A2DP */
/* PAN(EDR)+A2DP */
void halbtc8192e2ant_action_pan_edr_a2dp(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_pan_edr_a2dp(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state=BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state=BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -3222,7 +3231,7 @@ void halbtc8192e2ant_action_pan_edr_a2dp(struct btc_coexist *btcoexist)
	}
	}
}
}


void halbtc8192e2ant_action_pan_edr_hid(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_pan_edr_hid(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -3284,7 +3293,7 @@ void halbtc8192e2ant_action_pan_edr_hid(struct btc_coexist *btcoexist)
}
}


/* HID+A2DP+PAN(EDR) */
/* HID+A2DP+PAN(EDR) */
void halbtc8192e2ant_action_hid_a2dp_pan_edr(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_hid_a2dp_pan_edr(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -3345,7 +3354,7 @@ void halbtc8192e2ant_action_hid_a2dp_pan_edr(struct btc_coexist *btcoexist)
	}
	}
}
}


void halbtc8192e2ant_action_hid_a2dp(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_action_hid_a2dp(struct btc_coexist *btcoexist)
{
{
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u8 wifirssi_state, btrssi_state = BTC_RSSI_STATE_HIGH;
	u32 wifi_bw;
	u32 wifi_bw;
@@ -3404,7 +3413,7 @@ void halbtc8192e2ant_action_hid_a2dp(struct btc_coexist *btcoexist)
	}
	}
}
}


void halbtc8192e2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
static void halbtc8192e2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
{
{
	u8 algorithm = 0;
	u8 algorithm = 0;


@@ -3514,7 +3523,8 @@ void halbtc8192e2ant_run_coexist_mechanism(struct btc_coexist *btcoexist)
	}
	}
}
}


void halbtc8192e2ant_init_hwconfig(struct btc_coexist *btcoexist, bool backup)
static void halbtc8192e2ant_init_hwconfig(struct btc_coexist *btcoexist,
					  bool backup)
{
{
	u16 u16tmp = 0;
	u16 u16tmp = 0;
	u8 u8tmp = 0;
	u8 u8tmp = 0;