Skip to content

Commit ed364ab

Browse files
lwfingerlinvjw
authored andcommitted
rtlwifi: btcoexist: Update remaining old parts of the driver
This patch makes halbtcoutsrc.{c,h} work with the new pieces of the driver. Also included are some modifications to various header files. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: troy_tan@realsil.com.cn Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent c96fd20 commit ed364ab

7 files changed

Lines changed: 65 additions & 89 deletions

File tree

‎drivers/net/wireless/rtlwifi/btcoexist/halbt_precomp.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,13 @@
3737

3838
#include "halbtcoutsrc.h"
3939

40+
#include "halbtc8192e2ant.h"
41+
#include "halbtc8723b1ant.h"
4042
#include "halbtc8723b2ant.h"
43+
#include "halbtc8821a2ant.h"
44+
#include "halbtc8821a1ant.h"
45+
46+
#define GetDefaultAdapter(padapter) padapter
4147

4248
#define BIT0 0x00000001
4349
#define BIT1 0x00000002

‎drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.c‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ static bool halbtc_set(void *void_btcoexist, u8 set_type, void *in_buf)
389389
btcoexist->bt_info.reject_agg_pkt = *bool_tmp;
390390
break;
391391
case BTC_SET_BL_BT_CTRL_AGG_SIZE:
392-
btcoexist->bt_info.b_bt_ctrl_buf_size = *bool_tmp;
392+
btcoexist->bt_info.bt_ctrl_buf_size = *bool_tmp;
393393
break;
394394
case BTC_SET_BL_INC_SCAN_DEV_NUM:
395395
btcoexist->bt_info.increase_scan_dev_num = *bool_tmp;
@@ -417,10 +417,10 @@ static bool halbtc_set(void *void_btcoexist, u8 set_type, void *in_buf)
417417
/* rtlpriv->mlmepriv.scan_compensation = *u8_tmp; */
418418
break;
419419
case BTC_SET_U1_1ANT_LPS:
420-
btcoexist->bt_info.lps_1ant = *u8_tmp;
420+
btcoexist->bt_info.lps_val = *u8_tmp;
421421
break;
422422
case BTC_SET_U1_1ANT_RPWM:
423-
btcoexist->bt_info.rpwm_1ant = *u8_tmp;
423+
btcoexist->bt_info.rpwm_val = *u8_tmp;
424424
break;
425425
/* the following are some action which will be triggered */
426426
case BTC_SET_ACT_LEAVE_LPS:
@@ -506,7 +506,7 @@ static void halbtc_write_1byte(void *bt_context, u32 reg_addr, u8 data)
506506
}
507507

508508
static void halbtc_bitmask_write_1byte(void *bt_context, u32 reg_addr,
509-
u32 bit_mask, u8 data)
509+
u8 bit_mask, u8 data)
510510
{
511511
struct btc_coexist *btcoexist = (struct btc_coexist *)bt_context;
512512
struct rtl_priv *rtlpriv = btcoexist->adapter;
@@ -654,7 +654,7 @@ bool exhalbtc_initlize_variables(struct rtl_priv *adapter)
654654

655655
btcoexist->cli_buf = &btc_dbg_buf[0];
656656

657-
btcoexist->bt_info.b_bt_ctrl_buf_size = false;
657+
btcoexist->bt_info.bt_ctrl_buf_size = false;
658658
btcoexist->bt_info.agg_buf_size = 5;
659659

660660
btcoexist->bt_info.increase_scan_dev_num = false;
@@ -786,10 +786,8 @@ void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action)
786786
}
787787

788788
void exhalbtc_mediastatus_notify(struct btc_coexist *btcoexist,
789-
enum _RT_MEDIA_STATUS media_status)
789+
enum rt_media_status media_status)
790790
{
791-
struct rtl_priv *rtlpriv = btcoexist->adapter;
792-
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
793791
u8 status;
794792

795793
if (!halbtc_is_bt_coexist_available(btcoexist))
@@ -846,8 +844,6 @@ void exhalbtc_bt_info_notify(struct btc_coexist *btcoexist,
846844

847845
void exhalbtc_stack_operation_notify(struct btc_coexist *btcoexist, u8 type)
848846
{
849-
struct rtl_priv *rtlpriv = btcoexist->adapter;
850-
struct rtl_hal *rtlhal = rtl_hal(rtlpriv);
851847
u8 stack_op_type;
852848

853849
if (!halbtc_is_bt_coexist_available(btcoexist))

‎drivers/net/wireless/rtlwifi/btcoexist/halbtcoutsrc.h‎

Lines changed: 37 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,6 @@
6666
#define BTC_ANT_WIFI_AT_CPL_MAIN 0
6767
#define BTC_ANT_WIFI_AT_CPL_AUX 1
6868

69-
#define BTC_ANT_PATH_WIFI 0
70-
#define BTC_ANT_PATH_BT 1
71-
#define BTC_ANT_PATH_PTA 2
72-
7369
enum btc_chip_interface {
7470
BTC_INTF_UNKNOWN = 0,
7571
BTC_INTF_PCI = 1,
@@ -79,7 +75,7 @@ enum btc_chip_interface {
7975
BTC_INTF_MAX
8076
};
8177

82-
enum BTC_CHIP_TYPE {
78+
enum btc_chip_type {
8379
BTC_CHIP_UNDEF = 0,
8480
BTC_CHIP_CSR_BC4 = 1,
8581
BTC_CHIP_CSR_BC8 = 2,
@@ -89,11 +85,12 @@ enum BTC_CHIP_TYPE {
8985
BTC_CHIP_MAX
9086
};
9187

92-
enum BTC_MSG_TYPE {
88+
enum btc_msg_type {
9389
BTC_MSG_INTERFACE = 0x0,
9490
BTC_MSG_ALGORITHM = 0x1,
9591
BTC_MSG_MAX
9692
};
93+
9794
extern u32 btc_dbg_type[];
9895

9996
/* following is for BTC_MSG_INTERFACE */
@@ -112,20 +109,15 @@ extern u32 btc_dbg_type[];
112109
#define ALGO_TRACE_SW_DETAIL BIT8
113110
#define ALGO_TRACE_SW_EXEC BIT9
114111

115-
#define BT_COEX_ANT_TYPE_PG 0
116-
#define BT_COEX_ANT_TYPE_ANTDIV 1
117-
#define BT_COEX_ANT_TYPE_DETECTED 2
118-
#define BTC_MIMO_PS_STATIC 0
119-
#define BTC_MIMO_PS_DYNAMIC 1
120-
#define BTC_RATE_DISABLE 0
121-
#define BTC_RATE_ENABLE 1
122-
#define BTC_ANT_PATH_WIFI 0
123-
#define BTC_ANT_PATH_BT 1
124-
#define BTC_ANT_PATH_PTA 2
125-
112+
/* following is for wifi link status */
113+
#define WIFI_STA_CONNECTED BIT0
114+
#define WIFI_AP_CONNECTED BIT1
115+
#define WIFI_HS_CONNECTED BIT2
116+
#define WIFI_P2P_GO_CONNECTED BIT3
117+
#define WIFI_P2P_GC_CONNECTED BIT4
126118

127119
#define CL_SPRINTF snprintf
128-
#define CL_PRINTF(buf) printk("%s", buf)
120+
#define CL_PRINTF printk
129121

130122
#define BTC_PRINT(dbgtype, dbgflag, printstr, ...) \
131123
do { \
@@ -134,47 +126,6 @@ extern u32 btc_dbg_type[];
134126
} \
135127
} while (0)
136128

137-
#define BTC_PRINT_F(dbgtype, dbgflag, printstr, ...) \
138-
do { \
139-
if (unlikely(btc_dbg_type[dbgtype] & dbgflag)) {\
140-
pr_info("%s: ", __func__); \
141-
printk(printstr, ##__VA_ARGS__); \
142-
} \
143-
} while (0)
144-
145-
#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _ptr) \
146-
do { \
147-
if (unlikely(btc_dbg_type[dbgtype] & dbgflag)) { \
148-
int __i; \
149-
u8 *__ptr = (u8 *)_ptr; \
150-
printk printstr; \
151-
for (__i = 0; __i < 6; __i++) \
152-
printk("%02X%s", __ptr[__i], (__i == 5) ? \
153-
"" : "-"); \
154-
pr_info("\n"); \
155-
} \
156-
} while (0)
157-
158-
#define BTC_PRINT_DATA(dbgtype, dbgflag, _titlestring, _hexdata, _hexdatalen) \
159-
do { \
160-
if (unlikely(btc_dbg_type[dbgtype] & dbgflag)) { \
161-
int __i; \
162-
u8 *__ptr = (u8 *)_hexdata; \
163-
printk(_titlestring); \
164-
for (__i = 0; __i < (int)_hexdatalen; __i++) { \
165-
printk("%02X%s", __ptr[__i], (((__i + 1) % 4) \
166-
== 0) ? " " : " ");\
167-
if (((__i + 1) % 16) == 0) \
168-
printk("\n"); \
169-
} \
170-
pr_debug("\n"); \
171-
} \
172-
} while (0)
173-
174-
#define BTC_ANT_PATH_WIFI 0
175-
#define BTC_ANT_PATH_BT 1
176-
#define BTC_ANT_PATH_PTA 2
177-
178129
#define BTC_RSSI_HIGH(_rssi_) \
179130
((_rssi_ == BTC_RSSI_STATE_HIGH || \
180131
_rssi_ == BTC_RSSI_STATE_STAY_HIGH) ? true : false)
@@ -245,7 +196,6 @@ enum btc_wifi_pnp {
245196
BTC_WIFI_PNP_MAX
246197
};
247198

248-
249199
enum btc_get_type {
250200
/* type bool */
251201
BTC_GET_BL_HS_OPERATION,
@@ -274,6 +224,7 @@ enum btc_get_type {
274224
BTC_GET_U4_WIFI_BW,
275225
BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
276226
BTC_GET_U4_WIFI_FW_VER,
227+
BTC_GET_U4_WIFI_LINK_STATUS,
277228
BTC_GET_U4_BT_PATCH_VER,
278229

279230
/* type u1Byte */
@@ -292,7 +243,6 @@ enum btc_get_type {
292243
BTC_GET_MAX
293244
};
294245

295-
296246
enum btc_set_type {
297247
/* type bool */
298248
BTC_SET_BL_BT_DISABLE,
@@ -305,7 +255,6 @@ enum btc_set_type {
305255

306256
/* type u1Byte */
307257
BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON,
308-
BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE,
309258
BTC_SET_UI_SCAN_SIG_COMPENSATION,
310259
BTC_SET_U1_AGG_BUF_SIZE,
311260

@@ -317,6 +266,9 @@ enum btc_set_type {
317266
/* type bool */
318267
BTC_SET_BL_BT_SCO_BUSY,
319268
/* type u1Byte */
269+
BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE,
270+
BTC_SET_U1_LPS_VAL,
271+
BTC_SET_U1_RPWM_VAL,
320272
BTC_SET_U1_1ANT_LPS,
321273
BTC_SET_U1_1ANT_RPWM,
322274
/* type trigger some action */
@@ -380,14 +332,27 @@ enum btc_notify_type_special_packet {
380332
BTC_PACKET_MAX
381333
};
382334

335+
enum hci_ext_bt_operation {
336+
HCI_BT_OP_NONE = 0x0,
337+
HCI_BT_OP_INQUIRY_START = 0x1,
338+
HCI_BT_OP_INQUIRY_FINISH = 0x2,
339+
HCI_BT_OP_PAGING_START = 0x3,
340+
HCI_BT_OP_PAGING_SUCCESS = 0x4,
341+
HCI_BT_OP_PAGING_UNSUCCESS = 0x5,
342+
HCI_BT_OP_PAIRING_START = 0x6,
343+
HCI_BT_OP_PAIRING_FINISH = 0x7,
344+
HCI_BT_OP_BT_DEV_ENABLE = 0x8,
345+
HCI_BT_OP_BT_DEV_DISABLE = 0x9,
346+
HCI_BT_OP_MAX
347+
};
348+
383349
enum btc_notify_type_stack_operation {
384350
BTC_STACK_OP_NONE = 0x0,
385351
BTC_STACK_OP_INQ_PAGE_PAIR_START = 0x1,
386352
BTC_STACK_OP_INQ_PAGE_PAIR_FINISH = 0x2,
387353
BTC_STACK_OP_MAX
388354
};
389355

390-
391356
typedef u8 (*bfp_btc_r1)(void *btc_context, u32 reg_addr);
392357

393358
typedef u16 (*bfp_btc_r2)(void *btc_context, u32 reg_addr);
@@ -397,7 +362,7 @@ typedef u32 (*bfp_btc_r4)(void *btc_context, u32 reg_addr);
397362
typedef void (*bfp_btc_w1)(void *btc_context, u32 reg_addr, u8 data);
398363

399364
typedef void (*bfp_btc_w1_bit_mak)(void *btc_context, u32 reg_addr,
400-
u32 bit_mask, u8 data1b);
365+
u8 bit_mask, u8 data1b);
401366

402367
typedef void (*bfp_btc_w2)(void *btc_context, u32 reg_addr, u16 data);
403368

@@ -435,20 +400,22 @@ struct btc_bt_info {
435400
u8 agg_buf_size;
436401
bool limited_dig;
437402
bool reject_agg_pkt;
438-
bool b_bt_ctrl_buf_size;
403+
bool bt_ctrl_buf_size;
439404
bool increase_scan_dev_num;
440405
u16 bt_hci_ver;
441406
u16 bt_real_fw_ver;
442407
u8 bt_fw_ver;
443408

409+
bool bt_disable_low_pwr;
410+
444411
/* the following is for 1Ant solution */
445412
bool bt_ctrl_lps;
446413
bool bt_pwr_save_mode;
447414
bool bt_lps_on;
448415
bool force_to_roam;
449416
u8 force_exec_pwr_cmd_cnt;
450-
u8 lps_1ant;
451-
u8 rpwm_1ant;
417+
u8 lps_val;
418+
u8 rpwm_val;
452419
u32 ra_mask;
453420
};
454421

@@ -479,6 +446,7 @@ struct btc_statistics {
479446
u32 cnt_special_packet_notify;
480447
u32 cnt_bt_info_notify;
481448
u32 cnt_periodical;
449+
u32 cnt_coex_dm_switch;
482450
u32 cnt_stack_operation_notify;
483451
u32 cnt_dbg_ctrl;
484452
};
@@ -531,7 +499,6 @@ struct btc_coexist {
531499
bfp_btc_set_bb_reg btc_set_bb_reg;
532500
bfp_btc_get_bb_reg btc_get_bb_reg;
533501

534-
535502
bfp_btc_set_rf_reg btc_set_rf_reg;
536503
bfp_btc_get_rf_reg btc_get_rf_reg;
537504

@@ -555,13 +522,14 @@ void exhalbtc_lps_notify(struct btc_coexist *btcoexist, u8 type);
555522
void exhalbtc_scan_notify(struct btc_coexist *btcoexist, u8 type);
556523
void exhalbtc_connect_notify(struct btc_coexist *btcoexist, u8 action);
557524
void exhalbtc_mediastatus_notify(struct btc_coexist *btcoexist,
558-
enum _RT_MEDIA_STATUS media_status);
525+
enum rt_media_status media_status);
559526
void exhalbtc_special_packet_notify(struct btc_coexist *btcoexist, u8 pkt_type);
560527
void exhalbtc_bt_info_notify(struct btc_coexist *btcoexist, u8 *tmp_buf,
561528
u8 length);
562529
void exhalbtc_stack_operation_notify(struct btc_coexist *btcoexist, u8 type);
563530
void exhalbtc_halt_notify(struct btc_coexist *btcoexist);
564531
void exhalbtc_pnp_notify(struct btc_coexist *btcoexist, u8 pnp_state);
532+
void exhalbtc_coex_dm_switch(struct btc_coexist *btcoexist);
565533
void exhalbtc_periodical(struct btc_coexist *btcoexist);
566534
void exhalbtc_dbg_control(struct btc_coexist *btcoexist, u8 code, u8 len,
567535
u8 *data);

‎drivers/net/wireless/rtlwifi/btcoexist/rtl_btc.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ void rtl_btc_connect_notify(struct rtl_priv *rtlpriv, u8 action)
102102
}
103103

104104
void rtl_btc_mediastatus_notify(struct rtl_priv *rtlpriv,
105-
enum _RT_MEDIA_STATUS mstatus)
105+
enum rt_media_status mstatus)
106106
{
107107
exhalbtc_mediastatus_notify(&gl_bt_coexist, mstatus);
108108
}
@@ -187,11 +187,11 @@ u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv)
187187
return num;
188188
}
189189

190-
enum _RT_MEDIA_STATUS mgnt_link_status_query(struct ieee80211_hw *hw)
190+
enum rt_media_status mgnt_link_status_query(struct ieee80211_hw *hw)
191191
{
192192
struct rtl_priv *rtlpriv = rtl_priv(hw);
193193
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
194-
enum _RT_MEDIA_STATUS m_status = RT_MEDIA_DISCONNECT;
194+
enum rt_media_status m_status = RT_MEDIA_DISCONNECT;
195195

196196
u8 bibss = (mac->opmode == NL80211_IFTYPE_ADHOC) ? 1 : 0;
197197

‎drivers/net/wireless/rtlwifi/btcoexist/rtl_btc.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void rtl_btc_lps_notify(struct rtl_priv *rtlpriv, u8 type);
3535
void rtl_btc_scan_notify(struct rtl_priv *rtlpriv, u8 scantype);
3636
void rtl_btc_connect_notify(struct rtl_priv *rtlpriv, u8 action);
3737
void rtl_btc_mediastatus_notify(struct rtl_priv *rtlpriv,
38-
enum _RT_MEDIA_STATUS mstatus);
38+
enum rt_media_status mstatus);
3939
void rtl_btc_periodical(struct rtl_priv *rtlpriv);
4040
void rtl_btc_halt_notify(void);
4141
void rtl_btc_btinfo_notify(struct rtl_priv *rtlpriv, u8 *tmpbuf, u8 length);
@@ -49,6 +49,6 @@ struct rtl_btc_ops *rtl_btc_get_ops_pointer(void);
4949
u8 rtl_get_hwpg_ant_num(struct rtl_priv *rtlpriv);
5050
u8 rtl_get_hwpg_bt_exist(struct rtl_priv *rtlpriv);
5151
u8 rtl_get_hwpg_bt_type(struct rtl_priv *rtlpriv);
52-
enum _RT_MEDIA_STATUS mgnt_link_status_query(struct ieee80211_hw *hw);
52+
enum rt_media_status mgnt_link_status_query(struct ieee80211_hw *hw);
5353

5454
#endif

‎drivers/net/wireless/rtlwifi/rtl8723ae/hal_btc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ void rtl8723ae_bt_coex_off_before_lps(struct ieee80211_hw *hw)
5656
}
5757
}
5858

59-
static enum _RT_MEDIA_STATUS mgnt_link_status_query(struct ieee80211_hw *hw)
59+
static enum rt_media_status mgnt_link_status_query(struct ieee80211_hw *hw)
6060
{
6161
struct rtl_priv *rtlpriv = rtl_priv(hw);
6262
struct rtl_mac *mac = rtl_mac(rtl_priv(hw));
63-
enum _RT_MEDIA_STATUS m_status = RT_MEDIA_DISCONNECT;
63+
enum rt_media_status m_status = RT_MEDIA_DISCONNECT;
6464

6565
u8 bibss = (mac->opmode == NL80211_IFTYPE_ADHOC) ? 1 : 0;
6666

0 commit comments

Comments
 (0)