1
Address different checkpatch warnings and checks
1
This is version 2 of the patch series that cleaned up the rtl8723bs
2
for the staging/rtl8723bs driver.
2
module.
3
The patches can be applied in any sequence.
3
4
Changes in v2:
5
    - Dropped [PATCH 2/5]: Dropped the patch as requested and resubmit the patch
6
    individually.
7
    - Record more changes related to [PATCH 5/5]: add a new patch to
8
    cover for changes related to this patch
9
    - Redo [PATCH 4/5]: Remove all comments containing code so as to
10
    adhere to the Linux kernel coding style
11
Patch 1, 3 and 5 remain unchanged from v1.
12
    
4
13
5
Erick Karanja (5):
14
Erick Karanja (5):
6
staging: rtl8723bs: use preferred comparison order
15
staging: rtl8723bs: use preferred comparison order
7
staging: rtl8723bs: replace kmalloc + memset with kzalloc
8
staging: rtl8723bs: add spaces between ternary and binary operators
16
staging: rtl8723bs: add spaces between ternary and binary operators
17
staging: rtl8723bs: Rename variables
18
staging: rtl8723bs: fix check lines should not end with a '('
9
staging: rtl8723bs: no space before tabs
19
staging: rtl8723bs: no space before tabs
10
staging: rtl8723bs: Rename variables
11
20
12
.../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 1266 ++++++++---------
21
.../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 1868 ++++++++---------
13
drivers/staging/rtl8723bs/hal/hal_btcoex.c | 64 +-
22
drivers/staging/rtl8723bs/hal/hal_btcoex.c | 55 +-
14
.../staging/rtl8723bs/hal/odm_CfoTracking.c | 4 +-
23
.../staging/rtl8723bs/hal/odm_CfoTracking.c | 4 +-
15
.../staging/rtl8723bs/os_dep/osdep_service.c | 7 +-
24
3 files changed, 902 insertions(+), 1025 deletions(-)
16
4 files changed, 668 insertions(+), 673 deletions(-)
17
25
18
--
26
--
19
2.43.0
27
2.43.0
diff view generated by jsdifflib
1
Refactor conditions check to follow the Linux kernel
1
Refactor conditions check to follow the Linux kernel
2
coding style, which prefers placing the variable on the left side
2
coding style, which prefers placing the variable on the left side
3
of the comparison.
3
of the comparison.
4
4
5
Reported by checkpatch:
5
Reported by checkpatch:
6
6
7
    WARNING: Comparisons should place the constant on the right side
7
    WARNING: Comparisons should place the constant on the right side
8
of the test
8
of the test
9
9
10
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
10
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
11
---
11
---
12
drivers/staging/rtl8723bs/hal/hal_btcoex.c | 22 +++++++++++-----------
12
drivers/staging/rtl8723bs/hal/hal_btcoex.c | 22 +++++++++++-----------
13
1 file changed, 11 insertions(+), 11 deletions(-)
13
1 file changed, 11 insertions(+), 11 deletions(-)
14
14
15
diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
15
diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
16
index XXXXXXX..XXXXXXX 100644
16
index XXXXXXX..XXXXXXX 100644
17
--- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c
17
--- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c
18
+++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
18
+++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
19
@@ -XXX,XX +XXX,XX @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist)
19
@@ -XXX,XX +XXX,XX @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist)
20
    stime = jiffies;
20
    stime = jiffies;
21
    do {
21
    do {
22
        ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE);
22
        ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE);
23
-        if (_SUCCESS == ready)
23
-        if (_SUCCESS == ready)
24
+        if (ready == _SUCCESS)
24
+        if (ready == _SUCCESS)
25
            break;
25
            break;
26
26
27
        utime = jiffies_to_msecs(jiffies - stime);
27
        utime = jiffies_to_msecs(jiffies - stime);
28
@@ -XXX,XX +XXX,XX @@ static void halbtcoutsrc_WriteLocalReg1Byte(void *pBtcContext, u32 RegAddr, u8 D
28
@@ -XXX,XX +XXX,XX @@ static void halbtcoutsrc_WriteLocalReg1Byte(void *pBtcContext, u32 RegAddr, u8 D
29
    struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext;
29
    struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext;
30
    struct adapter *Adapter = pBtCoexist->Adapter;
30
    struct adapter *Adapter = pBtCoexist->Adapter;
31
31
32
-    if (BTC_INTF_SDIO == pBtCoexist->chipInterface)
32
-    if (BTC_INTF_SDIO == pBtCoexist->chipInterface)
33
+    if (pBtCoexist->chipInterface == BTC_INTF_SDIO)
33
+    if (pBtCoexist->chipInterface == BTC_INTF_SDIO)
34
        rtw_write8(Adapter, SDIO_LOCAL_BASE | RegAddr, Data);
34
        rtw_write8(Adapter, SDIO_LOCAL_BASE | RegAddr, Data);
35
    else
35
    else
36
        rtw_write8(Adapter, RegAddr, Data);
36
        rtw_write8(Adapter, RegAddr, Data);
37
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type)
37
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type)
38
    if (pBtCoexist->bManualControl)
38
    if (pBtCoexist->bManualControl)
39
        return;
39
        return;
40
40
41
-    if (IPS_NONE == type)
41
-    if (IPS_NONE == type)
42
+    if (type == IPS_NONE)
42
+    if (type == IPS_NONE)
43
        ipsType = BTC_IPS_LEAVE;
43
        ipsType = BTC_IPS_LEAVE;
44
    else
44
    else
45
        ipsType = BTC_IPS_ENTER;
45
        ipsType = BTC_IPS_ENTER;
46
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
46
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
47
    if (pBtCoexist->bManualControl)
47
    if (pBtCoexist->bManualControl)
48
        return;
48
        return;
49
49
50
-    if (PS_MODE_ACTIVE == type)
50
-    if (PS_MODE_ACTIVE == type)
51
+    if (type == PS_MODE_ACTIVE)
51
+    if (type == PS_MODE_ACTIVE)
52
        lpsType = BTC_LPS_DISABLE;
52
        lpsType = BTC_LPS_DISABLE;
53
    else
53
    else
54
        lpsType = BTC_LPS_ENABLE;
54
        lpsType = BTC_LPS_ENABLE;
55
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum
55
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum
56
    if (pBtCoexist->bManualControl)
56
    if (pBtCoexist->bManualControl)
57
        return;
57
        return;
58
58
59
-    if (RT_MEDIA_CONNECT == mediaStatus)
59
-    if (RT_MEDIA_CONNECT == mediaStatus)
60
+    if (mediaStatus == RT_MEDIA_CONNECT)
60
+    if (mediaStatus == RT_MEDIA_CONNECT)
61
        mStatus = BTC_MEDIA_CONNECT;
61
        mStatus = BTC_MEDIA_CONNECT;
62
    else
62
    else
63
        mStatus = BTC_MEDIA_DISCONNECT;
63
        mStatus = BTC_MEDIA_DISCONNECT;
64
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy
64
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy
65
    if (pBtCoexist->bManualControl)
65
    if (pBtCoexist->bManualControl)
66
        return;
66
        return;
67
67
68
-    if (PACKET_DHCP == pktType) {
68
-    if (PACKET_DHCP == pktType) {
69
+    if (pktType == PACKET_DHCP) {
69
+    if (pktType == PACKET_DHCP) {
70
        packetType = BTC_PACKET_DHCP;
70
        packetType = BTC_PACKET_DHCP;
71
-    } else if (PACKET_EAPOL == pktType) {
71
-    } else if (PACKET_EAPOL == pktType) {
72
+    } else if (pktType == PACKET_EAPOL) {
72
+    } else if (pktType == PACKET_EAPOL) {
73
        packetType = BTC_PACKET_EAPOL;
73
        packetType = BTC_PACKET_EAPOL;
74
-    } else if (PACKET_ARP == pktType) {
74
-    } else if (PACKET_ARP == pktType) {
75
+    } else if (pktType == PACKET_ARP) {
75
+    } else if (pktType == PACKET_ARP) {
76
        packetType = BTC_PACKET_ARP;
76
        packetType = BTC_PACKET_ARP;
77
    } else {
77
    } else {
78
        return;
78
        return;
79
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist)
79
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist)
80
80
81
void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum)
81
void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum)
82
{
82
{
83
-    if (BT_COEX_ANT_TYPE_PG == type) {
83
-    if (BT_COEX_ANT_TYPE_PG == type) {
84
+    if (type == BT_COEX_ANT_TYPE_PG) {
84
+    if (type == BT_COEX_ANT_TYPE_PG) {
85
        GLBtCoexist.boardInfo.pgAntNum = antNum;
85
        GLBtCoexist.boardInfo.pgAntNum = antNum;
86
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
86
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
87
-    } else if (BT_COEX_ANT_TYPE_ANTDIV == type) {
87
-    } else if (BT_COEX_ANT_TYPE_ANTDIV == type) {
88
+    } else if (type == BT_COEX_ANT_TYPE_ANTDIV) {
88
+    } else if (type == BT_COEX_ANT_TYPE_ANTDIV) {
89
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
89
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
90
        /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */
90
        /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */
91
-    } else if (BT_COEX_ANT_TYPE_DETECTED == type) {
91
-    } else if (BT_COEX_ANT_TYPE_DETECTED == type) {
92
+    } else if (type == BT_COEX_ANT_TYPE_DETECTED) {
92
+    } else if (type == BT_COEX_ANT_TYPE_DETECTED) {
93
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
93
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
94
        /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */
94
        /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */
95
    }
95
    }
96
--
96
--
97
2.43.0
97
2.43.0
diff view generated by jsdifflib
1
Fix spacing around binary arithmetic (`+`) and shift (`>>`) operators
1
Fix spacing around binary arithmetic (`+`) and shift (`>>`) operators
2
to improve readability and adhere to the Linux kernel coding style.
2
to improve readability and adhere to the Linux kernel coding style.
3
3
4
Reported by checkpatch:
4
Reported by checkpatch:
5
5
6
    CHECK: spaces needed around 'operator'
6
    CHECK: spaces needed around 'operator'
7
7
8
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
8
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
9
---
9
---
10
drivers/staging/rtl8723bs/hal/odm_CfoTracking.c | 4 ++--
10
drivers/staging/rtl8723bs/hal/odm_CfoTracking.c | 4 ++--
11
1 file changed, 2 insertions(+), 2 deletions(-)
11
1 file changed, 2 insertions(+), 2 deletions(-)
12
12
13
diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
13
diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
14
index XXXXXXX..XXXXXXX 100644
14
index XXXXXXX..XXXXXXX 100644
15
--- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
15
--- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
16
+++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
16
+++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c
17
@@ -XXX,XX +XXX,XX @@ void ODM_CfoTracking(void *pDM_VOID)
17
@@ -XXX,XX +XXX,XX @@ void ODM_CfoTracking(void *pDM_VOID)
18
        /* 4 1.6 Big jump */
18
        /* 4 1.6 Big jump */
19
        if (pCfoTrack->bAdjust) {
19
        if (pCfoTrack->bAdjust) {
20
            if (CFO_ave > CFO_TH_XTAL_LOW)
20
            if (CFO_ave > CFO_TH_XTAL_LOW)
21
-                Adjust_Xtal = Adjust_Xtal+((CFO_ave-CFO_TH_XTAL_LOW)>>2);
21
-                Adjust_Xtal = Adjust_Xtal+((CFO_ave-CFO_TH_XTAL_LOW)>>2);
22
+                Adjust_Xtal = Adjust_Xtal + ((CFO_ave-CFO_TH_XTAL_LOW) >> 2);
22
+                Adjust_Xtal = Adjust_Xtal + ((CFO_ave-CFO_TH_XTAL_LOW) >> 2);
23
            else if (CFO_ave < (-CFO_TH_XTAL_LOW))
23
            else if (CFO_ave < (-CFO_TH_XTAL_LOW))
24
-                Adjust_Xtal = Adjust_Xtal+((CFO_TH_XTAL_LOW-CFO_ave)>>2);
24
-                Adjust_Xtal = Adjust_Xtal+((CFO_TH_XTAL_LOW-CFO_ave)>>2);
25
+                Adjust_Xtal = Adjust_Xtal + ((CFO_TH_XTAL_LOW-CFO_ave) >> 2);
25
+                Adjust_Xtal = Adjust_Xtal + ((CFO_TH_XTAL_LOW-CFO_ave) >> 2);
26
        }
26
        }
27
27
28
        /* 4 1.7 Adjust Crystal Cap. */
28
        /* 4 1.7 Adjust Crystal Cap. */
29
--
29
--
30
2.43.0
30
2.43.0
diff view generated by jsdifflib
1
Rename variables to adhere to Linux kernel coding
1
Rename variables to adhere to Linux kernel coding
2
standards by using snake_case instead of CamelCase
2
standards by using snake_case instead of CamelCase
3
and ensure proper encoding of the variables by removing
3
and ensure proper encoding of the variables by removing
4
initial 'p' for pointers and initial 'b' for boolean.
4
initial 'p' for pointers and initial 'b' for boolean.
5
5
6
Fixes checkpatch.pl warning:
6
Fixes checkpatch.pl warning:
7
CHECK: Avoid CamelCase: <supportRateNum>
7
CHECK: Avoid CamelCase: <supportRateNum>
8
8
9
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
9
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
10
---
10
---
11
.../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 1266 ++++++++---------
11
.../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 1266 ++++++++---------
12
1 file changed, 633 insertions(+), 633 deletions(-)
12
1 file changed, 633 insertions(+), 633 deletions(-)
13
13
14
diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
14
diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
15
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
16
--- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
16
--- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
17
+++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
17
+++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
18
@@ -XXX,XX +XXX,XX @@ static struct coex_sta_8723b_1ant *pCoexSta = &GLCoexSta8723b1Ant;
18
@@ -XXX,XX +XXX,XX @@ static struct coex_sta_8723b_1ant *pCoexSta = &GLCoexSta8723b1Ant;
19
/* local function proto type if needed */
19
/* local function proto type if needed */
20
/* local function start with halbtc8723b1ant_ */
20
/* local function start with halbtc8723b1ant_ */
21
static u8 halbtc8723b1ant_BtRssiState(
21
static u8 halbtc8723b1ant_BtRssiState(
22
-    u8 levelNum, u8 rssiThresh, u8 rssiThresh1
22
-    u8 levelNum, u8 rssiThresh, u8 rssiThresh1
23
+    u8 level_num, u8 rssi_thresh, u8 rssi_thresh1
23
+    u8 level_num, u8 rssi_thresh, u8 rssi_thresh1
24
)
24
)
25
{
25
{
26
-    s32 btRssi = 0;
26
-    s32 btRssi = 0;
27
-    u8 btRssiState = pCoexSta->preBtRssiState;
27
-    u8 btRssiState = pCoexSta->preBtRssiState;
28
+    s32 bt_rssi = 0;
28
+    s32 bt_rssi = 0;
29
+    u8 bt_rssi_state = pCoexSta->preBtRssiState;
29
+    u8 bt_rssi_state = pCoexSta->preBtRssiState;
30
30
31
-    btRssi = pCoexSta->btRssi;
31
-    btRssi = pCoexSta->btRssi;
32
+    bt_rssi = pCoexSta->bt_rssi;
32
+    bt_rssi = pCoexSta->bt_rssi;
33
33
34
-    if (levelNum == 2) {
34
-    if (levelNum == 2) {
35
+    if (level_num == 2) {
35
+    if (level_num == 2) {
36
        if (
36
        if (
37
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
37
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
38
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
38
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
39
        ) {
39
        ) {
40
-            if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
40
-            if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
41
+            if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
41
+            if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
42
42
43
-                btRssiState = BTC_RSSI_STATE_HIGH;
43
-                btRssiState = BTC_RSSI_STATE_HIGH;
44
+                bt_rssi_state = BTC_RSSI_STATE_HIGH;
44
+                bt_rssi_state = BTC_RSSI_STATE_HIGH;
45
            else
45
            else
46
-                btRssiState = BTC_RSSI_STATE_STAY_LOW;
46
-                btRssiState = BTC_RSSI_STATE_STAY_LOW;
47
+                bt_rssi_state = BTC_RSSI_STATE_STAY_LOW;
47
+                bt_rssi_state = BTC_RSSI_STATE_STAY_LOW;
48
        } else {
48
        } else {
49
-            if (btRssi < rssiThresh)
49
-            if (btRssi < rssiThresh)
50
-                btRssiState = BTC_RSSI_STATE_LOW;
50
-                btRssiState = BTC_RSSI_STATE_LOW;
51
+            if (bt_rssi < rssi_thresh)
51
+            if (bt_rssi < rssi_thresh)
52
+                bt_rssi_state = BTC_RSSI_STATE_LOW;
52
+                bt_rssi_state = BTC_RSSI_STATE_LOW;
53
            else
53
            else
54
-                btRssiState = BTC_RSSI_STATE_STAY_HIGH;
54
-                btRssiState = BTC_RSSI_STATE_STAY_HIGH;
55
+                bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH;
55
+                bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH;
56
        }
56
        }
57
-    } else if (levelNum == 3) {
57
-    } else if (levelNum == 3) {
58
-        if (rssiThresh > rssiThresh1)
58
-        if (rssiThresh > rssiThresh1)
59
+    } else if (level_num == 3) {
59
+    } else if (level_num == 3) {
60
+        if (rssi_thresh > rssi_thresh1)
60
+        if (rssi_thresh > rssi_thresh1)
61
            return pCoexSta->preBtRssiState;
61
            return pCoexSta->preBtRssiState;
62
62
63
        if (
63
        if (
64
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
64
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
65
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
65
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
66
        ) {
66
        ) {
67
-            if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
67
-            if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
68
-                btRssiState = BTC_RSSI_STATE_MEDIUM;
68
-                btRssiState = BTC_RSSI_STATE_MEDIUM;
69
+            if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
69
+            if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
70
+                bt_rssi_state = BTC_RSSI_STATE_MEDIUM;
70
+                bt_rssi_state = BTC_RSSI_STATE_MEDIUM;
71
            else
71
            else
72
-                btRssiState = BTC_RSSI_STATE_STAY_LOW;
72
-                btRssiState = BTC_RSSI_STATE_STAY_LOW;
73
+                bt_rssi_state = BTC_RSSI_STATE_STAY_LOW;
73
+                bt_rssi_state = BTC_RSSI_STATE_STAY_LOW;
74
        } else if (
74
        } else if (
75
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) ||
75
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) ||
76
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM)
76
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM)
77
        ) {
77
        ) {
78
-            if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
78
-            if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
79
-                btRssiState = BTC_RSSI_STATE_HIGH;
79
-                btRssiState = BTC_RSSI_STATE_HIGH;
80
-            else if (btRssi < rssiThresh)
80
-            else if (btRssi < rssiThresh)
81
-                btRssiState = BTC_RSSI_STATE_LOW;
81
-                btRssiState = BTC_RSSI_STATE_LOW;
82
+            if (bt_rssi >= (rssi_thresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
82
+            if (bt_rssi >= (rssi_thresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
83
+                bt_rssi_state = BTC_RSSI_STATE_HIGH;
83
+                bt_rssi_state = BTC_RSSI_STATE_HIGH;
84
+            else if (bt_rssi < rssi_thresh)
84
+            else if (bt_rssi < rssi_thresh)
85
+                bt_rssi_state = BTC_RSSI_STATE_LOW;
85
+                bt_rssi_state = BTC_RSSI_STATE_LOW;
86
            else
86
            else
87
-                btRssiState = BTC_RSSI_STATE_STAY_MEDIUM;
87
-                btRssiState = BTC_RSSI_STATE_STAY_MEDIUM;
88
+                bt_rssi_state = BTC_RSSI_STATE_STAY_MEDIUM;
88
+                bt_rssi_state = BTC_RSSI_STATE_STAY_MEDIUM;
89
        } else {
89
        } else {
90
-            if (btRssi < rssiThresh1)
90
-            if (btRssi < rssiThresh1)
91
-                btRssiState = BTC_RSSI_STATE_MEDIUM;
91
-                btRssiState = BTC_RSSI_STATE_MEDIUM;
92
+            if (bt_rssi < rssi_thresh1)
92
+            if (bt_rssi < rssi_thresh1)
93
+                bt_rssi_state = BTC_RSSI_STATE_MEDIUM;
93
+                bt_rssi_state = BTC_RSSI_STATE_MEDIUM;
94
            else
94
            else
95
-                btRssiState = BTC_RSSI_STATE_STAY_HIGH;
95
-                btRssiState = BTC_RSSI_STATE_STAY_HIGH;
96
+                bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH;
96
+                bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH;
97
        }
97
        }
98
    }
98
    }
99
99
100
-    pCoexSta->preBtRssiState = btRssiState;
100
-    pCoexSta->preBtRssiState = btRssiState;
101
+    pCoexSta->preBtRssiState = bt_rssi_state;
101
+    pCoexSta->preBtRssiState = bt_rssi_state;
102
102
103
-    return btRssiState;
103
-    return btRssiState;
104
+    return bt_rssi_state;
104
+    return bt_rssi_state;
105
}
105
}
106
106
107
static void halbtc8723b1ant_UpdateRaMask(
107
static void halbtc8723b1ant_UpdateRaMask(
108
-    struct btc_coexist *pBtCoexist, bool bForceExec, u32 disRateMask
108
-    struct btc_coexist *pBtCoexist, bool bForceExec, u32 disRateMask
109
+    struct btc_coexist *bt_coexist, bool force_exec, u32 dis_rate_mask
109
+    struct btc_coexist *bt_coexist, bool force_exec, u32 dis_rate_mask
110
)
110
)
111
{
111
{
112
-    pCoexDm->curRaMask = disRateMask;
112
-    pCoexDm->curRaMask = disRateMask;
113
+    pCoexDm->curRaMask = dis_rate_mask;
113
+    pCoexDm->curRaMask = dis_rate_mask;
114
114
115
-    if (bForceExec || (pCoexDm->preRaMask != pCoexDm->curRaMask))
115
-    if (bForceExec || (pCoexDm->preRaMask != pCoexDm->curRaMask))
116
-        pBtCoexist->fBtcSet(
116
-        pBtCoexist->fBtcSet(
117
-            pBtCoexist,
117
-            pBtCoexist,
118
+    if (force_exec || (pCoexDm->preRaMask != pCoexDm->curRaMask))
118
+    if (force_exec || (pCoexDm->preRaMask != pCoexDm->curRaMask))
119
+        bt_coexist->fBtcSet(
119
+        bt_coexist->fBtcSet(
120
+            bt_coexist,
120
+            bt_coexist,
121
            BTC_SET_ACT_UPDATE_RAMASK,
121
            BTC_SET_ACT_UPDATE_RAMASK,
122
            &pCoexDm->curRaMask
122
            &pCoexDm->curRaMask
123
        );
123
        );
124
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_UpdateRaMask(
124
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_UpdateRaMask(
125
}
125
}
126
126
127
static void halbtc8723b1ant_AutoRateFallbackRetry(
127
static void halbtc8723b1ant_AutoRateFallbackRetry(
128
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
128
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
129
+    struct btc_coexist *bt_coexist, bool force_exec, u8 type
129
+    struct btc_coexist *bt_coexist, bool force_exec, u8 type
130
)
130
)
131
{
131
{
132
-    bool bWifiUnderBMode = false;
132
-    bool bWifiUnderBMode = false;
133
+    bool wifi_under_b_mode = false;
133
+    bool wifi_under_b_mode = false;
134
134
135
    pCoexDm->curArfrType = type;
135
    pCoexDm->curArfrType = type;
136
136
137
-    if (bForceExec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) {
137
-    if (bForceExec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) {
138
+    if (force_exec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) {
138
+    if (force_exec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) {
139
        switch (pCoexDm->curArfrType) {
139
        switch (pCoexDm->curArfrType) {
140
        case 0:    /* normal mode */
140
        case 0:    /* normal mode */
141
-            pBtCoexist->fBtcWrite4Byte(
141
-            pBtCoexist->fBtcWrite4Byte(
142
-                pBtCoexist, 0x430, pCoexDm->backupArfrCnt1
142
-                pBtCoexist, 0x430, pCoexDm->backupArfrCnt1
143
+            bt_coexist->fBtcWrite4Byte(
143
+            bt_coexist->fBtcWrite4Byte(
144
+                bt_coexist, 0x430, pCoexDm->backupArfrCnt1
144
+                bt_coexist, 0x430, pCoexDm->backupArfrCnt1
145
            );
145
            );
146
-            pBtCoexist->fBtcWrite4Byte(
146
-            pBtCoexist->fBtcWrite4Byte(
147
-                pBtCoexist, 0x434, pCoexDm->backupArfrCnt2
147
-                pBtCoexist, 0x434, pCoexDm->backupArfrCnt2
148
+            bt_coexist->fBtcWrite4Byte(
148
+            bt_coexist->fBtcWrite4Byte(
149
+                bt_coexist, 0x434, pCoexDm->backupArfrCnt2
149
+                bt_coexist, 0x434, pCoexDm->backupArfrCnt2
150
            );
150
            );
151
            break;
151
            break;
152
        case 1:
152
        case 1:
153
-            pBtCoexist->fBtcGet(
153
-            pBtCoexist->fBtcGet(
154
-                pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode
154
-                pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode
155
+            bt_coexist->fBtcGet(
155
+            bt_coexist->fBtcGet(
156
+                bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode
156
+                bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode
157
            );
157
            );
158
-            if (bWifiUnderBMode) {
158
-            if (bWifiUnderBMode) {
159
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0);
159
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0);
160
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x01010101);
160
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x01010101);
161
+            if (wifi_under_b_mode) {
161
+            if (wifi_under_b_mode) {
162
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0);
162
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0);
163
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x01010101);
163
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x01010101);
164
            } else {
164
            } else {
165
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0);
165
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0);
166
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x04030201);
166
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x04030201);
167
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0);
167
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0);
168
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x04030201);
168
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x04030201);
169
            }
169
            }
170
            break;
170
            break;
171
        default:
171
        default:
172
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_AutoRateFallbackRetry(
172
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_AutoRateFallbackRetry(
173
}
173
}
174
174
175
static void halbtc8723b1ant_RetryLimit(
175
static void halbtc8723b1ant_RetryLimit(
176
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
176
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
177
+    struct btc_coexist *bt_coexist, bool force_exec, u8 type
177
+    struct btc_coexist *bt_coexist, bool force_exec, u8 type
178
)
178
)
179
{
179
{
180
    pCoexDm->curRetryLimitType = type;
180
    pCoexDm->curRetryLimitType = type;
181
181
182
    if (
182
    if (
183
-        bForceExec ||
183
-        bForceExec ||
184
+        force_exec ||
184
+        force_exec ||
185
        (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)
185
        (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)
186
    ) {
186
    ) {
187
        switch (pCoexDm->curRetryLimitType) {
187
        switch (pCoexDm->curRetryLimitType) {
188
        case 0:    /* normal mode */
188
        case 0:    /* normal mode */
189
-            pBtCoexist->fBtcWrite2Byte(
189
-            pBtCoexist->fBtcWrite2Byte(
190
-                pBtCoexist, 0x42a, pCoexDm->backupRetryLimit
190
-                pBtCoexist, 0x42a, pCoexDm->backupRetryLimit
191
+            bt_coexist->fBtcWrite2Byte(
191
+            bt_coexist->fBtcWrite2Byte(
192
+                bt_coexist, 0x42a, pCoexDm->backupRetryLimit
192
+                bt_coexist, 0x42a, pCoexDm->backupRetryLimit
193
            );
193
            );
194
            break;
194
            break;
195
        case 1:    /* retry limit =8 */
195
        case 1:    /* retry limit =8 */
196
-            pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x42a, 0x0808);
196
-            pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x42a, 0x0808);
197
+            bt_coexist->fBtcWrite2Byte(bt_coexist, 0x42a, 0x0808);
197
+            bt_coexist->fBtcWrite2Byte(bt_coexist, 0x42a, 0x0808);
198
            break;
198
            break;
199
        default:
199
        default:
200
            break;
200
            break;
201
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RetryLimit(
201
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RetryLimit(
202
}
202
}
203
203
204
static void halbtc8723b1ant_AmpduMaxTime(
204
static void halbtc8723b1ant_AmpduMaxTime(
205
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
205
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
206
+    struct btc_coexist *bt_coexist, bool force_exec, u8 type
206
+    struct btc_coexist *bt_coexist, bool force_exec, u8 type
207
)
207
)
208
{
208
{
209
    pCoexDm->curAmpduTimeType = type;
209
    pCoexDm->curAmpduTimeType = type;
210
210
211
    if (
211
    if (
212
-        bForceExec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)
212
-        bForceExec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)
213
+        force_exec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)
213
+        force_exec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)
214
    ) {
214
    ) {
215
        switch (pCoexDm->curAmpduTimeType) {
215
        switch (pCoexDm->curAmpduTimeType) {
216
        case 0:    /* normal mode */
216
        case 0:    /* normal mode */
217
-            pBtCoexist->fBtcWrite1Byte(
217
-            pBtCoexist->fBtcWrite1Byte(
218
-                pBtCoexist, 0x456, pCoexDm->backupAmpduMaxTime
218
-                pBtCoexist, 0x456, pCoexDm->backupAmpduMaxTime
219
+            bt_coexist->fBtcWrite1Byte(
219
+            bt_coexist->fBtcWrite1Byte(
220
+                bt_coexist, 0x456, pCoexDm->backupAmpduMaxTime
220
+                bt_coexist, 0x456, pCoexDm->backupAmpduMaxTime
221
            );
221
            );
222
            break;
222
            break;
223
        case 1:    /* AMPDU timw = 0x38 * 32us */
223
        case 1:    /* AMPDU timw = 0x38 * 32us */
224
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, 0x38);
224
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, 0x38);
225
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x456, 0x38);
225
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x456, 0x38);
226
            break;
226
            break;
227
        default:
227
        default:
228
            break;
228
            break;
229
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_AmpduMaxTime(
229
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_AmpduMaxTime(
230
}
230
}
231
231
232
static void halbtc8723b1ant_LimitedTx(
232
static void halbtc8723b1ant_LimitedTx(
233
-    struct btc_coexist *pBtCoexist,
233
-    struct btc_coexist *pBtCoexist,
234
-    bool bForceExec,
234
-    bool bForceExec,
235
-    u8 raMaskType,
235
-    u8 raMaskType,
236
-    u8 arfrType,
236
-    u8 arfrType,
237
-    u8 retryLimitType,
237
-    u8 retryLimitType,
238
-    u8 ampduTimeType
238
-    u8 ampduTimeType
239
+    struct btc_coexist *bt_coexist,
239
+    struct btc_coexist *bt_coexist,
240
+    bool force_exec,
240
+    bool force_exec,
241
+    u8 ra_mask_type,
241
+    u8 ra_mask_type,
242
+    u8 arfr_type,
242
+    u8 arfr_type,
243
+    u8 retry_limit_type,
243
+    u8 retry_limit_type,
244
+    u8 ampdu_time_type
244
+    u8 ampdu_time_type
245
)
245
)
246
{
246
{
247
-    switch (raMaskType) {
247
-    switch (raMaskType) {
248
+    switch (ra_mask_type) {
248
+    switch (ra_mask_type) {
249
    case 0:    /* normal mode */
249
    case 0:    /* normal mode */
250
-        halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0);
250
-        halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0);
251
+        halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x0);
251
+        halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x0);
252
        break;
252
        break;
253
    case 1:    /* disable cck 1/2 */
253
    case 1:    /* disable cck 1/2 */
254
-        halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x00000003);
254
-        halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x00000003);
255
+        halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x00000003);
255
+        halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x00000003);
256
        break;
256
        break;
257
    case 2:    /* disable cck 1/2/5.5, ofdm 6/9/12/18/24, mcs 0/1/2/3/4 */
257
    case 2:    /* disable cck 1/2/5.5, ofdm 6/9/12/18/24, mcs 0/1/2/3/4 */
258
-        halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0001f1f7);
258
-        halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0001f1f7);
259
+        halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x0001f1f7);
259
+        halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x0001f1f7);
260
        break;
260
        break;
261
    default:
261
    default:
262
        break;
262
        break;
263
    }
263
    }
264
264
265
-    halbtc8723b1ant_AutoRateFallbackRetry(pBtCoexist, bForceExec, arfrType);
265
-    halbtc8723b1ant_AutoRateFallbackRetry(pBtCoexist, bForceExec, arfrType);
266
-    halbtc8723b1ant_RetryLimit(pBtCoexist, bForceExec, retryLimitType);
266
-    halbtc8723b1ant_RetryLimit(pBtCoexist, bForceExec, retryLimitType);
267
-    halbtc8723b1ant_AmpduMaxTime(pBtCoexist, bForceExec, ampduTimeType);
267
-    halbtc8723b1ant_AmpduMaxTime(pBtCoexist, bForceExec, ampduTimeType);
268
+    halbtc8723b1ant_AutoRateFallbackRetry(bt_coexist, force_exec, arfr_type);
268
+    halbtc8723b1ant_AutoRateFallbackRetry(bt_coexist, force_exec, arfr_type);
269
+    halbtc8723b1ant_RetryLimit(bt_coexist, force_exec, retry_limit_type);
269
+    halbtc8723b1ant_RetryLimit(bt_coexist, force_exec, retry_limit_type);
270
+    halbtc8723b1ant_AmpduMaxTime(bt_coexist, force_exec, ampdu_time_type);
270
+    halbtc8723b1ant_AmpduMaxTime(bt_coexist, force_exec, ampdu_time_type);
271
}
271
}
272
272
273
static void halbtc8723b1ant_LimitedRx(
273
static void halbtc8723b1ant_LimitedRx(
274
-    struct btc_coexist *pBtCoexist,
274
-    struct btc_coexist *pBtCoexist,
275
-    bool bForceExec,
275
-    bool bForceExec,
276
-    bool bRejApAggPkt,
276
-    bool bRejApAggPkt,
277
-    bool bBtCtrlAggBufSize,
277
-    bool bBtCtrlAggBufSize,
278
-    u8 aggBufSize
278
-    u8 aggBufSize
279
+    struct btc_coexist *bt_coexist,
279
+    struct btc_coexist *bt_coexist,
280
+    bool force_exec,
280
+    bool force_exec,
281
+    bool rej_ap_agg_pkt,
281
+    bool rej_ap_agg_pkt,
282
+    bool bt_ctrl_agg_buf_size,
282
+    bool bt_ctrl_agg_buf_size,
283
+    u8 agg_buf_size
283
+    u8 agg_buf_size
284
)
284
)
285
{
285
{
286
-    bool bRejectRxAgg = bRejApAggPkt;
286
-    bool bRejectRxAgg = bRejApAggPkt;
287
-    bool bBtCtrlRxAggSize = bBtCtrlAggBufSize;
287
-    bool bBtCtrlRxAggSize = bBtCtrlAggBufSize;
288
-    u8 rxAggSize = aggBufSize;
288
-    u8 rxAggSize = aggBufSize;
289
+    bool bRejectRxAgg = rej_ap_agg_pkt;
289
+    bool bRejectRxAgg = rej_ap_agg_pkt;
290
+    bool bBtCtrlRxAggSize = bt_ctrl_agg_buf_size;
290
+    bool bBtCtrlRxAggSize = bt_ctrl_agg_buf_size;
291
+    u8 rxAggSize = agg_buf_size;
291
+    u8 rxAggSize = agg_buf_size;
292
292
293
    /* */
293
    /* */
294
    /*    Rx Aggregation related setting */
294
    /*    Rx Aggregation related setting */
295
    /* */
295
    /* */
296
-    pBtCoexist->fBtcSet(
296
-    pBtCoexist->fBtcSet(
297
-        pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg
297
-        pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg
298
+    bt_coexist->fBtcSet(
298
+    bt_coexist->fBtcSet(
299
+        bt_coexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg
299
+        bt_coexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg
300
    );
300
    );
301
    /* decide BT control aggregation buf size or not */
301
    /* decide BT control aggregation buf size or not */
302
-    pBtCoexist->fBtcSet(
302
-    pBtCoexist->fBtcSet(
303
-        pBtCoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize
303
-        pBtCoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize
304
+    bt_coexist->fBtcSet(
304
+    bt_coexist->fBtcSet(
305
+        bt_coexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize
305
+        bt_coexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize
306
    );
306
    );
307
    /* aggregation buf size, only work when BT control Rx aggregation size. */
307
    /* aggregation buf size, only work when BT control Rx aggregation size. */
308
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize);
308
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize);
309
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize);
309
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize);
310
    /* real update aggregation setting */
310
    /* real update aggregation setting */
311
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL);
311
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL);
312
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL);
312
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL);
313
313
314
314
315
}
315
}
316
316
317
-static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist)
317
-static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist)
318
+static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *bt_coexist)
318
+static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *bt_coexist)
319
{
319
{
320
    u8 H2C_Parameter[1] = {0};
320
    u8 H2C_Parameter[1] = {0};
321
321
322
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist)
322
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist)
323
323
324
    H2C_Parameter[0] |= BIT0;    /* trigger */
324
    H2C_Parameter[0] |= BIT0;    /* trigger */
325
325
326
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter);
326
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter);
327
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x61, 1, H2C_Parameter);
327
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x61, 1, H2C_Parameter);
328
}
328
}
329
329
330
-static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist)
330
-static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist)
331
+static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *bt_coexist)
331
+static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *bt_coexist)
332
{
332
{
333
    u32 regHPTxRx, regLPTxRx, u4Tmp;
333
    u32 regHPTxRx, regLPTxRx, u4Tmp;
334
    u32 regHPTx = 0, regHPRx = 0, regLPTx = 0, regLPRx = 0;
334
    u32 regHPTx = 0, regHPRx = 0, regLPTx = 0, regLPRx = 0;
335
    static u8 NumOfBtCounterChk;
335
    static u8 NumOfBtCounterChk;
336
336
337
/* to avoid 0x76e[3] = 1 (WLAN_Act control by PTA) during IPS */
337
/* to avoid 0x76e[3] = 1 (WLAN_Act control by PTA) during IPS */
338
-    /* if (! (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) & 0x8)) */
338
-    /* if (! (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) & 0x8)) */
339
+    /* if (! (bt_coexist->fBtcRead1Byte(bt_coexist, 0x76e) & 0x8)) */
339
+    /* if (! (bt_coexist->fBtcRead1Byte(bt_coexist, 0x76e) & 0x8)) */
340
340
341
    if (pCoexSta->bUnderIps) {
341
    if (pCoexSta->bUnderIps) {
342
        pCoexSta->highPriorityTx = 65535;
342
        pCoexSta->highPriorityTx = 65535;
343
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist)
343
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist)
344
    regHPTxRx = 0x770;
344
    regHPTxRx = 0x770;
345
    regLPTxRx = 0x774;
345
    regLPTxRx = 0x774;
346
346
347
-    u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regHPTxRx);
347
-    u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regHPTxRx);
348
+    u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, regHPTxRx);
348
+    u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, regHPTxRx);
349
    regHPTx = u4Tmp & bMaskLWord;
349
    regHPTx = u4Tmp & bMaskLWord;
350
    regHPRx = (u4Tmp & bMaskHWord) >> 16;
350
    regHPRx = (u4Tmp & bMaskHWord) >> 16;
351
351
352
-    u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regLPTxRx);
352
-    u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regLPTxRx);
353
+    u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, regLPTxRx);
353
+    u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, regLPTxRx);
354
    regLPTx = u4Tmp & bMaskLWord;
354
    regLPTx = u4Tmp & bMaskLWord;
355
    regLPRx = (u4Tmp & bMaskHWord) >> 16;
355
    regLPRx = (u4Tmp & bMaskHWord) >> 16;
356
356
357
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist)
357
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist)
358
        pCoexSta->popEventCnt++;
358
        pCoexSta->popEventCnt++;
359
359
360
    /* reset counter */
360
    /* reset counter */
361
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc);
361
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc);
362
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0xc);
362
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0xc);
363
363
364
    if ((regHPTx == 0) && (regHPRx == 0) && (regLPTx == 0) && (regLPRx == 0)) {
364
    if ((regHPTx == 0) && (regHPRx == 0) && (regLPTx == 0) && (regLPRx == 0)) {
365
        NumOfBtCounterChk++;
365
        NumOfBtCounterChk++;
366
        if (NumOfBtCounterChk >= 3) {
366
        if (NumOfBtCounterChk >= 3) {
367
-            halbtc8723b1ant_QueryBtInfo(pBtCoexist);
367
-            halbtc8723b1ant_QueryBtInfo(pBtCoexist);
368
+            halbtc8723b1ant_QueryBtInfo(bt_coexist);
368
+            halbtc8723b1ant_QueryBtInfo(bt_coexist);
369
            NumOfBtCounterChk = 0;
369
            NumOfBtCounterChk = 0;
370
        }
370
        }
371
    }
371
    }
372
}
372
}
373
373
374
374
375
-static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
375
-static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
376
+static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *bt_coexist)
376
+static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *bt_coexist)
377
{
377
{
378
-    s32    wifiRssi = 0;
378
-    s32    wifiRssi = 0;
379
-    bool bWifiBusy = false, bWifiUnderBMode = false;
379
-    bool bWifiBusy = false, bWifiUnderBMode = false;
380
+    s32    wifi_rssi = 0;
380
+    s32    wifi_rssi = 0;
381
+    bool wifi_busy = false, wifi_under_b_mode = false;
381
+    bool wifi_busy = false, wifi_under_b_mode = false;
382
    static u8 nCCKLockCounter;
382
    static u8 nCCKLockCounter;
383
383
384
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
384
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
385
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi);
385
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi);
386
-    pBtCoexist->fBtcGet(
386
-    pBtCoexist->fBtcGet(
387
-        pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode
387
-        pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode
388
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
388
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
389
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
389
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
390
+    bt_coexist->fBtcGet(
390
+    bt_coexist->fBtcGet(
391
+        bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode
391
+        bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode
392
    );
392
    );
393
393
394
    if (pCoexSta->bUnderIps) {
394
    if (pCoexSta->bUnderIps) {
395
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
395
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
396
        pCoexSta->nCRCErr_11n = 0;
396
        pCoexSta->nCRCErr_11n = 0;
397
        pCoexSta->nCRCErr_11nAgg = 0;
397
        pCoexSta->nCRCErr_11nAgg = 0;
398
    } else {
398
    } else {
399
-        pCoexSta->nCRCOK_CCK    = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf88);
399
-        pCoexSta->nCRCOK_CCK    = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf88);
400
-        pCoexSta->nCRCOK_11g    = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf94);
400
-        pCoexSta->nCRCOK_11g    = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf94);
401
-        pCoexSta->nCRCOK_11n    = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf90);
401
-        pCoexSta->nCRCOK_11n    = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf90);
402
-        pCoexSta->nCRCOK_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfb8);
402
-        pCoexSta->nCRCOK_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfb8);
403
+        pCoexSta->nCRCOK_CCK    = bt_coexist->fBtcRead4Byte(bt_coexist, 0xf88);
403
+        pCoexSta->nCRCOK_CCK    = bt_coexist->fBtcRead4Byte(bt_coexist, 0xf88);
404
+        pCoexSta->nCRCOK_11g    = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf94);
404
+        pCoexSta->nCRCOK_11g    = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf94);
405
+        pCoexSta->nCRCOK_11n    = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf90);
405
+        pCoexSta->nCRCOK_11n    = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf90);
406
+        pCoexSta->nCRCOK_11nAgg = bt_coexist->fBtcRead2Byte(bt_coexist, 0xfb8);
406
+        pCoexSta->nCRCOK_11nAgg = bt_coexist->fBtcRead2Byte(bt_coexist, 0xfb8);
407
407
408
-        pCoexSta->nCRCErr_CCK     = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf84);
408
-        pCoexSta->nCRCErr_CCK     = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf84);
409
-        pCoexSta->nCRCErr_11g     = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf96);
409
-        pCoexSta->nCRCErr_11g     = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf96);
410
-        pCoexSta->nCRCErr_11n     = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf92);
410
-        pCoexSta->nCRCErr_11n     = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf92);
411
-        pCoexSta->nCRCErr_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfba);
411
-        pCoexSta->nCRCErr_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfba);
412
+        pCoexSta->nCRCErr_CCK     = bt_coexist->fBtcRead4Byte(bt_coexist, 0xf84);
412
+        pCoexSta->nCRCErr_CCK     = bt_coexist->fBtcRead4Byte(bt_coexist, 0xf84);
413
+        pCoexSta->nCRCErr_11g     = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf96);
413
+        pCoexSta->nCRCErr_11g     = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf96);
414
+        pCoexSta->nCRCErr_11n     = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf92);
414
+        pCoexSta->nCRCErr_11n     = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf92);
415
+        pCoexSta->nCRCErr_11nAgg = bt_coexist->fBtcRead2Byte(bt_coexist, 0xfba);
415
+        pCoexSta->nCRCErr_11nAgg = bt_coexist->fBtcRead2Byte(bt_coexist, 0xfba);
416
    }
416
    }
417
417
418
418
419
    /* reset counter */
419
    /* reset counter */
420
-    pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x1);
420
-    pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x1);
421
-    pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x0);
421
-    pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x0);
422
+    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x1);
422
+    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x1);
423
+    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x0);
423
+    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x0);
424
424
425
-    if (bWifiBusy && (wifiRssi >= 30) && !bWifiUnderBMode) {
425
-    if (bWifiBusy && (wifiRssi >= 30) && !bWifiUnderBMode) {
426
+    if (wifi_busy && (wifi_rssi >= 30) && !wifi_under_b_mode) {
426
+    if (wifi_busy && (wifi_rssi >= 30) && !wifi_under_b_mode) {
427
        if (
427
        if (
428
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
428
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
429
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ||
429
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ||
430
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
430
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist)
431
431
432
}
432
}
433
433
434
-static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist)
434
-static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist)
435
+static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *bt_coexist)
435
+static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *bt_coexist)
436
{
436
{
437
    static bool    bPreWifiBusy, bPreUnder4way, bPreBtHsOn;
437
    static bool    bPreWifiBusy, bPreUnder4way, bPreBtHsOn;
438
-    bool bWifiBusy = false, bUnder4way = false, bBtHsOn = false;
438
-    bool bWifiBusy = false, bUnder4way = false, bBtHsOn = false;
439
+    bool wifi_busy = false, bUnder4way = false, bBtHsOn = false;
439
+    bool wifi_busy = false, bUnder4way = false, bBtHsOn = false;
440
    bool bWifiConnected = false;
440
    bool bWifiConnected = false;
441
441
442
-    pBtCoexist->fBtcGet(
442
-    pBtCoexist->fBtcGet(
443
-        pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected
443
-        pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected
444
+    bt_coexist->fBtcGet(
444
+    bt_coexist->fBtcGet(
445
+        bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected
445
+        bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected
446
    );
446
    );
447
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
447
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
448
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
448
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
449
-    pBtCoexist->fBtcGet(
449
-    pBtCoexist->fBtcGet(
450
-        pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way
450
-        pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way
451
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
451
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
452
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
452
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
453
+    bt_coexist->fBtcGet(
453
+    bt_coexist->fBtcGet(
454
+        bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way
454
+        bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way
455
    );
455
    );
456
456
457
    if (bWifiConnected) {
457
    if (bWifiConnected) {
458
-        if (bWifiBusy != bPreWifiBusy) {
458
-        if (bWifiBusy != bPreWifiBusy) {
459
-            bPreWifiBusy = bWifiBusy;
459
-            bPreWifiBusy = bWifiBusy;
460
+        if (wifi_busy != bPreWifiBusy) {
460
+        if (wifi_busy != bPreWifiBusy) {
461
+            bPreWifiBusy = wifi_busy;
461
+            bPreWifiBusy = wifi_busy;
462
            return true;
462
            return true;
463
        }
463
        }
464
464
465
@@ -XXX,XX +XXX,XX @@ static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist)
465
@@ -XXX,XX +XXX,XX @@ static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist)
466
    return false;
466
    return false;
467
}
467
}
468
468
469
-static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist)
469
-static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist)
470
+static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *bt_coexist)
470
+static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *bt_coexist)
471
{
471
{
472
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
472
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
473
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
473
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
474
    bool bBtHsOn = false;
474
    bool bBtHsOn = false;
475
475
476
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
476
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
477
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
477
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
478
478
479
    pBtLinkInfo->bBtLinkExist = pCoexSta->bBtLinkExist;
479
    pBtLinkInfo->bBtLinkExist = pCoexSta->bBtLinkExist;
480
    pBtLinkInfo->bScoExist = pCoexSta->bScoExist;
480
    pBtLinkInfo->bScoExist = pCoexSta->bScoExist;
481
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist)
481
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist)
482
        pBtLinkInfo->bHidOnly = false;
482
        pBtLinkInfo->bHidOnly = false;
483
}
483
}
484
484
485
-static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
485
-static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
486
+static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist)
486
+static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist)
487
{
487
{
488
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
488
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
489
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
489
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
490
    bool bBtHsOn = false;
490
    bool bBtHsOn = false;
491
    u8 algorithm = BT_8723B_1ANT_COEX_ALGO_UNDEFINED;
491
    u8 algorithm = BT_8723B_1ANT_COEX_ALGO_UNDEFINED;
492
    u8 numOfDiffProfile = 0;
492
    u8 numOfDiffProfile = 0;
493
493
494
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
494
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
495
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
495
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
496
496
497
    if (!pBtLinkInfo->bBtLinkExist)
497
    if (!pBtLinkInfo->bBtLinkExist)
498
        return algorithm;
498
        return algorithm;
499
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
499
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist)
500
}
500
}
501
501
502
static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
502
static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
503
-    struct btc_coexist *pBtCoexist, bool bLowPenaltyRa
503
-    struct btc_coexist *pBtCoexist, bool bLowPenaltyRa
504
+    struct btc_coexist *bt_coexist, bool bLowPenaltyRa
504
+    struct btc_coexist *bt_coexist, bool bLowPenaltyRa
505
)
505
)
506
{
506
{
507
    u8 H2C_Parameter[6] = {0};
507
    u8 H2C_Parameter[6] = {0};
508
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
508
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
509
        H2C_Parameter[5] = 0xf9;    /* MCS5 or OFDM36 */
509
        H2C_Parameter[5] = 0xf9;    /* MCS5 or OFDM36 */
510
    }
510
    }
511
511
512
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter);
512
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter);
513
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x69, 6, H2C_Parameter);
513
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x69, 6, H2C_Parameter);
514
}
514
}
515
515
516
static void halbtc8723b1ant_LowPenaltyRa(
516
static void halbtc8723b1ant_LowPenaltyRa(
517
-    struct btc_coexist *pBtCoexist, bool bForceExec, bool bLowPenaltyRa
517
-    struct btc_coexist *pBtCoexist, bool bForceExec, bool bLowPenaltyRa
518
+    struct btc_coexist *bt_coexist, bool force_exec, bool bLowPenaltyRa
518
+    struct btc_coexist *bt_coexist, bool force_exec, bool bLowPenaltyRa
519
)
519
)
520
{
520
{
521
    pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa;
521
    pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa;
522
522
523
-    if (!bForceExec) {
523
-    if (!bForceExec) {
524
+    if (!force_exec) {
524
+    if (!force_exec) {
525
        if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa)
525
        if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa)
526
            return;
526
            return;
527
    }
527
    }
528
    halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
528
    halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
529
-        pBtCoexist, pCoexDm->bCurLowPenaltyRa
529
-        pBtCoexist, pCoexDm->bCurLowPenaltyRa
530
+        bt_coexist, pCoexDm->bCurLowPenaltyRa
530
+        bt_coexist, pCoexDm->bCurLowPenaltyRa
531
    );
531
    );
532
532
533
    pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa;
533
    pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa;
534
}
534
}
535
535
536
static void halbtc8723b1ant_SetCoexTable(
536
static void halbtc8723b1ant_SetCoexTable(
537
-    struct btc_coexist *pBtCoexist,
537
-    struct btc_coexist *pBtCoexist,
538
+    struct btc_coexist *bt_coexist,
538
+    struct btc_coexist *bt_coexist,
539
    u32 val0x6c0,
539
    u32 val0x6c0,
540
    u32 val0x6c4,
540
    u32 val0x6c4,
541
    u32 val0x6c8,
541
    u32 val0x6c8,
542
    u8 val0x6cc
542
    u8 val0x6cc
543
)
543
)
544
{
544
{
545
-    pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0);
545
-    pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0);
546
+    bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c0, val0x6c0);
546
+    bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c0, val0x6c0);
547
547
548
-    pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4);
548
-    pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4);
549
+    bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c4, val0x6c4);
549
+    bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c4, val0x6c4);
550
550
551
-    pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8);
551
-    pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8);
552
+    bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c8, val0x6c8);
552
+    bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c8, val0x6c8);
553
553
554
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc);
554
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc);
555
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cc, val0x6cc);
555
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cc, val0x6cc);
556
}
556
}
557
557
558
static void halbtc8723b1ant_CoexTable(
558
static void halbtc8723b1ant_CoexTable(
559
-    struct btc_coexist *pBtCoexist,
559
-    struct btc_coexist *pBtCoexist,
560
-    bool bForceExec,
560
-    bool bForceExec,
561
+    struct btc_coexist *bt_coexist,
561
+    struct btc_coexist *bt_coexist,
562
+    bool force_exec,
562
+    bool force_exec,
563
    u32 val0x6c0,
563
    u32 val0x6c0,
564
    u32 val0x6c4,
564
    u32 val0x6c4,
565
    u32 val0x6c8,
565
    u32 val0x6c8,
566
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
566
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
567
    pCoexDm->curVal0x6c8 = val0x6c8;
567
    pCoexDm->curVal0x6c8 = val0x6c8;
568
    pCoexDm->curVal0x6cc = val0x6cc;
568
    pCoexDm->curVal0x6cc = val0x6cc;
569
569
570
-    if (!bForceExec) {
570
-    if (!bForceExec) {
571
+    if (!force_exec) {
571
+    if (!force_exec) {
572
        if (
572
        if (
573
            (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) &&
573
            (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) &&
574
         (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) &&
574
         (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) &&
575
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
575
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
576
    }
576
    }
577
577
578
    halbtc8723b1ant_SetCoexTable(
578
    halbtc8723b1ant_SetCoexTable(
579
-        pBtCoexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc
579
-        pBtCoexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc
580
+        bt_coexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc
580
+        bt_coexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc
581
    );
581
    );
582
582
583
    pCoexDm->preVal0x6c0 = pCoexDm->curVal0x6c0;
583
    pCoexDm->preVal0x6c0 = pCoexDm->curVal0x6c0;
584
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
584
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
585
}
585
}
586
586
587
static void halbtc8723b1ant_CoexTableWithType(
587
static void halbtc8723b1ant_CoexTableWithType(
588
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
588
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 type
589
+    struct btc_coexist *bt_coexist, bool force_exec, u8 type
589
+    struct btc_coexist *bt_coexist, bool force_exec, u8 type
590
)
590
)
591
{
591
{
592
    pCoexSta->nCoexTableType = type;
592
    pCoexSta->nCoexTableType = type;
593
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTableWithType(
593
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTableWithType(
594
    switch (type) {
594
    switch (type) {
595
    case 0:
595
    case 0:
596
        halbtc8723b1ant_CoexTable(
596
        halbtc8723b1ant_CoexTable(
597
-            pBtCoexist, bForceExec, 0x55555555, 0x55555555, 0xffffff, 0x3
597
-            pBtCoexist, bForceExec, 0x55555555, 0x55555555, 0xffffff, 0x3
598
+            bt_coexist, force_exec, 0x55555555, 0x55555555, 0xffffff, 0x3
598
+            bt_coexist, force_exec, 0x55555555, 0x55555555, 0xffffff, 0x3
599
        );
599
        );
600
        break;
600
        break;
601
    case 1:
601
    case 1:
602
        halbtc8723b1ant_CoexTable(
602
        halbtc8723b1ant_CoexTable(
603
-            pBtCoexist, bForceExec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3
603
-            pBtCoexist, bForceExec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3
604
+            bt_coexist, force_exec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3
604
+            bt_coexist, force_exec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3
605
        );
605
        );
606
        break;
606
        break;
607
    case 2:
607
    case 2:
608
        halbtc8723b1ant_CoexTable(
608
        halbtc8723b1ant_CoexTable(
609
-            pBtCoexist, bForceExec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3
609
-            pBtCoexist, bForceExec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3
610
+            bt_coexist, force_exec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3
610
+            bt_coexist, force_exec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3
611
        );
611
        );
612
        break;
612
        break;
613
    case 3:
613
    case 3:
614
        halbtc8723b1ant_CoexTable(
614
        halbtc8723b1ant_CoexTable(
615
-            pBtCoexist, bForceExec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3
615
-            pBtCoexist, bForceExec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3
616
+            bt_coexist, force_exec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3
616
+            bt_coexist, force_exec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3
617
        );
617
        );
618
        break;
618
        break;
619
    case 4:
619
    case 4:
620
        halbtc8723b1ant_CoexTable(
620
        halbtc8723b1ant_CoexTable(
621
-            pBtCoexist, bForceExec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3
621
-            pBtCoexist, bForceExec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3
622
+            bt_coexist, force_exec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3
622
+            bt_coexist, force_exec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3
623
        );
623
        );
624
        break;
624
        break;
625
    case 5:
625
    case 5:
626
        halbtc8723b1ant_CoexTable(
626
        halbtc8723b1ant_CoexTable(
627
-            pBtCoexist, bForceExec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3
627
-            pBtCoexist, bForceExec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3
628
+            bt_coexist, force_exec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3
628
+            bt_coexist, force_exec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3
629
        );
629
        );
630
        break;
630
        break;
631
    case 6:
631
    case 6:
632
        halbtc8723b1ant_CoexTable(
632
        halbtc8723b1ant_CoexTable(
633
-            pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3
633
-            pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3
634
+            bt_coexist, force_exec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3
634
+            bt_coexist, force_exec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3
635
        );
635
        );
636
        break;
636
        break;
637
    case 7:
637
    case 7:
638
        halbtc8723b1ant_CoexTable(
638
        halbtc8723b1ant_CoexTable(
639
-            pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3
639
-            pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3
640
+            bt_coexist, force_exec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3
640
+            bt_coexist, force_exec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3
641
        );
641
        );
642
        break;
642
        break;
643
    default:
643
    default:
644
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTableWithType(
644
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTableWithType(
645
}
645
}
646
646
647
static void halbtc8723b1ant_SetFwIgnoreWlanAct(
647
static void halbtc8723b1ant_SetFwIgnoreWlanAct(
648
-    struct btc_coexist *pBtCoexist, bool bEnable
648
-    struct btc_coexist *pBtCoexist, bool bEnable
649
+    struct btc_coexist *bt_coexist, bool bEnable
649
+    struct btc_coexist *bt_coexist, bool bEnable
650
)
650
)
651
{
651
{
652
    u8 H2C_Parameter[1] = {0};
652
    u8 H2C_Parameter[1] = {0};
653
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct(
653
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct(
654
    if (bEnable)
654
    if (bEnable)
655
        H2C_Parameter[0] |= BIT0; /* function enable */
655
        H2C_Parameter[0] |= BIT0; /* function enable */
656
656
657
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter);
657
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter);
658
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x63, 1, H2C_Parameter);
658
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x63, 1, H2C_Parameter);
659
}
659
}
660
660
661
static void halbtc8723b1ant_IgnoreWlanAct(
661
static void halbtc8723b1ant_IgnoreWlanAct(
662
-    struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable
662
-    struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable
663
+    struct btc_coexist *bt_coexist, bool force_exec, bool bEnable
663
+    struct btc_coexist *bt_coexist, bool force_exec, bool bEnable
664
)
664
)
665
{
665
{
666
    pCoexDm->bCurIgnoreWlanAct = bEnable;
666
    pCoexDm->bCurIgnoreWlanAct = bEnable;
667
667
668
-    if (!bForceExec) {
668
-    if (!bForceExec) {
669
+    if (!force_exec) {
669
+    if (!force_exec) {
670
        if (pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct)
670
        if (pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct)
671
            return;
671
            return;
672
    }
672
    }
673
-    halbtc8723b1ant_SetFwIgnoreWlanAct(pBtCoexist, bEnable);
673
-    halbtc8723b1ant_SetFwIgnoreWlanAct(pBtCoexist, bEnable);
674
+    halbtc8723b1ant_SetFwIgnoreWlanAct(bt_coexist, bEnable);
674
+    halbtc8723b1ant_SetFwIgnoreWlanAct(bt_coexist, bEnable);
675
675
676
    pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct;
676
    pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct;
677
}
677
}
678
678
679
static void halbtc8723b1ant_SetLpsRpwm(
679
static void halbtc8723b1ant_SetLpsRpwm(
680
-    struct btc_coexist *pBtCoexist, u8 lpsVal, u8 rpwmVal
680
-    struct btc_coexist *pBtCoexist, u8 lpsVal, u8 rpwmVal
681
+    struct btc_coexist *bt_coexist, u8 lpsVal, u8 rpwmVal
681
+    struct btc_coexist *bt_coexist, u8 lpsVal, u8 rpwmVal
682
)
682
)
683
{
683
{
684
    u8 lps = lpsVal;
684
    u8 lps = lpsVal;
685
    u8 rpwm = rpwmVal;
685
    u8 rpwm = rpwmVal;
686
686
687
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_LPS_VAL, &lps);
687
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_LPS_VAL, &lps);
688
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RPWM_VAL, &rpwm);
688
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RPWM_VAL, &rpwm);
689
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_LPS_VAL, &lps);
689
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_LPS_VAL, &lps);
690
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_RPWM_VAL, &rpwm);
690
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_RPWM_VAL, &rpwm);
691
}
691
}
692
692
693
static void halbtc8723b1ant_LpsRpwm(
693
static void halbtc8723b1ant_LpsRpwm(
694
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 lpsVal, u8 rpwmVal
694
-    struct btc_coexist *pBtCoexist, bool bForceExec, u8 lpsVal, u8 rpwmVal
695
+    struct btc_coexist *bt_coexist, bool force_exec, u8 lpsVal, u8 rpwmVal
695
+    struct btc_coexist *bt_coexist, bool force_exec, u8 lpsVal, u8 rpwmVal
696
)
696
)
697
{
697
{
698
    pCoexDm->curLps = lpsVal;
698
    pCoexDm->curLps = lpsVal;
699
    pCoexDm->curRpwm = rpwmVal;
699
    pCoexDm->curRpwm = rpwmVal;
700
700
701
-    if (!bForceExec) {
701
-    if (!bForceExec) {
702
+    if (!force_exec) {
702
+    if (!force_exec) {
703
        if (
703
        if (
704
            (pCoexDm->preLps == pCoexDm->curLps) &&
704
            (pCoexDm->preLps == pCoexDm->curLps) &&
705
            (pCoexDm->preRpwm == pCoexDm->curRpwm)
705
            (pCoexDm->preRpwm == pCoexDm->curRpwm)
706
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_LpsRpwm(
706
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_LpsRpwm(
707
            return;
707
            return;
708
        }
708
        }
709
    }
709
    }
710
-    halbtc8723b1ant_SetLpsRpwm(pBtCoexist, lpsVal, rpwmVal);
710
-    halbtc8723b1ant_SetLpsRpwm(pBtCoexist, lpsVal, rpwmVal);
711
+    halbtc8723b1ant_SetLpsRpwm(bt_coexist, lpsVal, rpwmVal);
711
+    halbtc8723b1ant_SetLpsRpwm(bt_coexist, lpsVal, rpwmVal);
712
712
713
    pCoexDm->preLps = pCoexDm->curLps;
713
    pCoexDm->preLps = pCoexDm->curLps;
714
    pCoexDm->preRpwm = pCoexDm->curRpwm;
714
    pCoexDm->preRpwm = pCoexDm->curRpwm;
715
}
715
}
716
716
717
static void halbtc8723b1ant_SwMechanism(
717
static void halbtc8723b1ant_SwMechanism(
718
-    struct btc_coexist *pBtCoexist, bool bLowPenaltyRA
718
-    struct btc_coexist *pBtCoexist, bool bLowPenaltyRA
719
+    struct btc_coexist *bt_coexist, bool bLowPenaltyRA
719
+    struct btc_coexist *bt_coexist, bool bLowPenaltyRA
720
)
720
)
721
{
721
{
722
-    halbtc8723b1ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA);
722
-    halbtc8723b1ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA);
723
+    halbtc8723b1ant_LowPenaltyRa(bt_coexist, NORMAL_EXEC, bLowPenaltyRA);
723
+    halbtc8723b1ant_LowPenaltyRa(bt_coexist, NORMAL_EXEC, bLowPenaltyRA);
724
}
724
}
725
725
726
static void halbtc8723b1ant_SetAntPath(
726
static void halbtc8723b1ant_SetAntPath(
727
-    struct btc_coexist *pBtCoexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff
727
-    struct btc_coexist *pBtCoexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff
728
+    struct btc_coexist *bt_coexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff
728
+    struct btc_coexist *bt_coexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff
729
)
729
)
730
{
730
{
731
-    struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo;
731
-    struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo;
732
+    struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo;
732
+    struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo;
733
    u32 fwVer = 0, u4Tmp = 0, cntBtCalChk = 0;
733
    u32 fwVer = 0, u4Tmp = 0, cntBtCalChk = 0;
734
    bool bPgExtSwitch = false;
734
    bool bPgExtSwitch = false;
735
    bool bUseExtSwitch = false;
735
    bool bUseExtSwitch = false;
736
    bool bIsInMpMode = false;
736
    bool bIsInMpMode = false;
737
    u8 H2C_Parameter[2] = {0}, u1Tmp = 0;
737
    u8 H2C_Parameter[2] = {0}, u1Tmp = 0;
738
738
739
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch);
739
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch);
740
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */
740
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */
741
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch);
741
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch);
742
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */
742
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */
743
743
744
    if ((fwVer > 0 && fwVer < 0xc0000) || bPgExtSwitch)
744
    if ((fwVer > 0 && fwVer < 0xc0000) || bPgExtSwitch)
745
        bUseExtSwitch = true;
745
        bUseExtSwitch = true;
746
746
747
    if (bInitHwCfg) {
747
    if (bInitHwCfg) {
748
-        pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); /* WiFi TRx Mask on */
748
-        pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); /* WiFi TRx Mask on */
749
-        pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT TRx Mask on */
749
-        pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT TRx Mask on */
750
+        bt_coexist->fBtcSetRfReg(bt_coexist, BTC_RF_A, 0x1, 0xfffff, 0x780); /* WiFi TRx Mask on */
750
+        bt_coexist->fBtcSetRfReg(bt_coexist, BTC_RF_A, 0x1, 0xfffff, 0x780); /* WiFi TRx Mask on */
751
+        bt_coexist->fBtcSetBtReg(bt_coexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT TRx Mask on */
751
+        bt_coexist->fBtcSetBtReg(bt_coexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT TRx Mask on */
752
752
753
        if (fwVer >= 0x180000) {
753
        if (fwVer >= 0x180000) {
754
            /* Use H2C to set GNT_BT to HIGH */
754
            /* Use H2C to set GNT_BT to HIGH */
755
            H2C_Parameter[0] = 1;
755
            H2C_Parameter[0] = 1;
756
-            pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter);
756
-            pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter);
757
+            bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter);
757
+            bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter);
758
        } else /* set grant_bt to high */
758
        } else /* set grant_bt to high */
759
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18);
759
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18);
760
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18);
760
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18);
761
761
762
        /* set wlan_act control by PTA */
762
        /* set wlan_act control by PTA */
763
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4);
763
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4);
764
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4);
764
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4);
765
765
766
-        pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
766
-        pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
767
+        bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
767
+        bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
768
768
769
-        pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x39, 0x8, 0x1);
769
-        pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x39, 0x8, 0x1);
770
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x974, 0xff);
770
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x974, 0xff);
771
-        pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x944, 0x3, 0x3);
771
-        pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x944, 0x3, 0x3);
772
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x930, 0x77);
772
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x930, 0x77);
773
+        bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x39, 0x8, 0x1);
773
+        bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x39, 0x8, 0x1);
774
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x974, 0xff);
774
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x974, 0xff);
775
+        bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x944, 0x3, 0x3);
775
+        bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x944, 0x3, 0x3);
776
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x930, 0x77);
776
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x930, 0x77);
777
    } else if (bWifiOff) {
777
    } else if (bWifiOff) {
778
        if (fwVer >= 0x180000) {
778
        if (fwVer >= 0x180000) {
779
            /* Use H2C to set GNT_BT to HIGH */
779
            /* Use H2C to set GNT_BT to HIGH */
780
            H2C_Parameter[0] = 1;
780
            H2C_Parameter[0] = 1;
781
-            pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter);
781
-            pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter);
782
+            bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter);
782
+            bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter);
783
        } else /* set grant_bt to high */
783
        } else /* set grant_bt to high */
784
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18);
784
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18);
785
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18);
785
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18);
786
786
787
        /* set wlan_act to always low */
787
        /* set wlan_act to always low */
788
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4);
788
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4);
789
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4);
789
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4);
790
790
791
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode);
791
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode);
792
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode);
792
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode);
793
        if (!bIsInMpMode)
793
        if (!bIsInMpMode)
794
-            pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x0); /* BT select s0/s1 is controlled by BT */
794
-            pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x0); /* BT select s0/s1 is controlled by BT */
795
+            bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x0); /* BT select s0/s1 is controlled by BT */
795
+            bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x0); /* BT select s0/s1 is controlled by BT */
796
        else
796
        else
797
-            pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
797
-            pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
798
+            bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
798
+            bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */
799
799
800
        /* 0x4c[24:23]= 00, Set Antenna control by BT_RFE_CTRL    BT Vendor 0xac = 0xf002 */
800
        /* 0x4c[24:23]= 00, Set Antenna control by BT_RFE_CTRL    BT Vendor 0xac = 0xf002 */
801
-        u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c);
801
-        u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c);
802
+        u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c);
802
+        u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c);
803
        u4Tmp &= ~BIT23;
803
        u4Tmp &= ~BIT23;
804
        u4Tmp &= ~BIT24;
804
        u4Tmp &= ~BIT24;
805
-        pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp);
805
-        pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp);
806
+        bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp);
806
+        bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp);
807
    } else {
807
    } else {
808
        /* Use H2C to set GNT_BT to LOW */
808
        /* Use H2C to set GNT_BT to LOW */
809
        if (fwVer >= 0x180000) {
809
        if (fwVer >= 0x180000) {
810
-            if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765) != 0) {
810
-            if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765) != 0) {
811
+            if (bt_coexist->fBtcRead1Byte(bt_coexist, 0x765) != 0) {
811
+            if (bt_coexist->fBtcRead1Byte(bt_coexist, 0x765) != 0) {
812
                H2C_Parameter[0] = 0;
812
                H2C_Parameter[0] = 0;
813
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter);
813
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter);
814
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter);
814
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter);
815
            }
815
            }
816
        } else {
816
        } else {
817
            /* BT calibration check */
817
            /* BT calibration check */
818
            while (cntBtCalChk <= 20) {
818
            while (cntBtCalChk <= 20) {
819
-                u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49d);
819
-                u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49d);
820
+                u1Tmp = bt_coexist->fBtcRead1Byte(bt_coexist, 0x49d);
820
+                u1Tmp = bt_coexist->fBtcRead1Byte(bt_coexist, 0x49d);
821
                cntBtCalChk++;
821
                cntBtCalChk++;
822
822
823
                if (u1Tmp & BIT0)
823
                if (u1Tmp & BIT0)
824
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetAntPath(
824
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetAntPath(
825
            }
825
            }
826
826
827
            /* set grant_bt to PTA */
827
            /* set grant_bt to PTA */
828
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x0);
828
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x0);
829
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x0);
829
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x0);
830
        }
830
        }
831
831
832
-        if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) != 0xc)
832
-        if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) != 0xc)
833
+        if (bt_coexist->fBtcRead1Byte(bt_coexist, 0x76e) != 0xc)
833
+        if (bt_coexist->fBtcRead1Byte(bt_coexist, 0x76e) != 0xc)
834
            /* set wlan_act control by PTA */
834
            /* set wlan_act control by PTA */
835
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc);
835
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc);
836
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0xc);
836
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0xc);
837
    }
837
    }
838
838
839
    if (bUseExtSwitch) {
839
    if (bUseExtSwitch) {
840
        if (bInitHwCfg) {
840
        if (bInitHwCfg) {
841
            /* 0x4c[23]= 0, 0x4c[24]= 1 Antenna control by WL/BT */
841
            /* 0x4c[23]= 0, 0x4c[24]= 1 Antenna control by WL/BT */
842
-            u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c);
842
-            u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c);
843
+            u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c);
843
+            u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c);
844
            u4Tmp &= ~BIT23;
844
            u4Tmp &= ~BIT23;
845
            u4Tmp |= BIT24;
845
            u4Tmp |= BIT24;
846
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp);
846
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp);
847
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp);
847
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp);
848
848
849
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); /* fixed internal switch S1->WiFi, S0->BT */
849
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); /* fixed internal switch S1->WiFi, S0->BT */
850
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); /* fixed internal switch S1->WiFi, S0->BT */
850
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); /* fixed internal switch S1->WiFi, S0->BT */
851
851
852
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) {
852
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) {
853
                /* tell firmware "no antenna inverse" */
853
                /* tell firmware "no antenna inverse" */
854
                H2C_Parameter[0] = 0;
854
                H2C_Parameter[0] = 0;
855
                H2C_Parameter[1] = 1; /* ext switch type */
855
                H2C_Parameter[1] = 1; /* ext switch type */
856
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter);
856
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter);
857
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter);
857
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter);
858
            } else {
858
            } else {
859
                /* tell firmware "antenna inverse" */
859
                /* tell firmware "antenna inverse" */
860
                H2C_Parameter[0] = 1;
860
                H2C_Parameter[0] = 1;
861
                H2C_Parameter[1] = 1; /* ext switch type */
861
                H2C_Parameter[1] = 1; /* ext switch type */
862
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter);
862
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter);
863
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter);
863
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter);
864
            }
864
            }
865
        }
865
        }
866
866
867
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetAntPath(
867
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetAntPath(
868
        switch (antPosType) {
868
        switch (antPosType) {
869
        case BTC_ANT_PATH_WIFI:
869
        case BTC_ANT_PATH_WIFI:
870
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
870
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
871
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1);
871
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1);
872
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1);
872
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1);
873
            else
873
            else
874
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2);
874
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2);
875
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2);
875
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2);
876
            break;
876
            break;
877
        case BTC_ANT_PATH_BT:
877
        case BTC_ANT_PATH_BT:
878
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
878
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
879
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2);
879
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2);
880
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2);
880
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2);
881
            else
881
            else
882
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1);
882
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1);
883
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1);
883
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1);
884
            break;
884
            break;
885
        default:
885
        default:
886
        case BTC_ANT_PATH_PTA:
886
        case BTC_ANT_PATH_PTA:
887
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
887
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
888
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1);
888
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1);
889
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1);
889
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1);
890
            else
890
            else
891
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2);
891
-                pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2);
892
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2);
892
+                bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2);
893
            break;
893
            break;
894
        }
894
        }
895
895
896
    } else {
896
    } else {
897
        if (bInitHwCfg) {
897
        if (bInitHwCfg) {
898
            /* 0x4c[23]= 1, 0x4c[24]= 0 Antenna control by 0x64 */
898
            /* 0x4c[23]= 1, 0x4c[24]= 0 Antenna control by 0x64 */
899
-            u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c);
899
-            u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c);
900
+            u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c);
900
+            u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c);
901
            u4Tmp |= BIT23;
901
            u4Tmp |= BIT23;
902
            u4Tmp &= ~BIT24;
902
            u4Tmp &= ~BIT24;
903
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp);
903
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp);
904
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp);
904
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp);
905
905
906
            /* Fix Ext switch Main->S1, Aux->S0 */
906
            /* Fix Ext switch Main->S1, Aux->S0 */
907
-            pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0);
907
-            pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0);
908
+            bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x64, 0x1, 0x0);
908
+            bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x64, 0x1, 0x0);
909
909
910
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) {
910
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) {
911
911
912
                /* tell firmware "no antenna inverse" */
912
                /* tell firmware "no antenna inverse" */
913
                H2C_Parameter[0] = 0;
913
                H2C_Parameter[0] = 0;
914
                H2C_Parameter[1] = 0; /* internal switch type */
914
                H2C_Parameter[1] = 0; /* internal switch type */
915
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter);
915
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter);
916
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter);
916
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter);
917
            } else {
917
            } else {
918
918
919
                /* tell firmware "antenna inverse" */
919
                /* tell firmware "antenna inverse" */
920
                H2C_Parameter[0] = 1;
920
                H2C_Parameter[0] = 1;
921
                H2C_Parameter[1] = 0; /* internal switch type */
921
                H2C_Parameter[1] = 0; /* internal switch type */
922
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter);
922
-                pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter);
923
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter);
923
+                bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter);
924
            }
924
            }
925
        }
925
        }
926
926
927
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetAntPath(
927
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetAntPath(
928
        switch (antPosType) {
928
        switch (antPosType) {
929
        case BTC_ANT_PATH_WIFI:
929
        case BTC_ANT_PATH_WIFI:
930
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
930
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
931
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0);
931
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0);
932
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0);
932
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0);
933
            else
933
            else
934
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280);
934
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280);
935
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280);
935
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280);
936
            break;
936
            break;
937
        case BTC_ANT_PATH_BT:
937
        case BTC_ANT_PATH_BT:
938
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
938
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
939
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280);
939
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280);
940
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280);
940
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280);
941
            else
941
            else
942
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0);
942
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0);
943
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0);
943
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0);
944
            break;
944
            break;
945
        default:
945
        default:
946
        case BTC_ANT_PATH_PTA:
946
        case BTC_ANT_PATH_PTA:
947
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
947
            if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT)
948
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x200);
948
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x200);
949
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x200);
949
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x200);
950
            else
950
            else
951
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x80);
951
-                pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x80);
952
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x80);
952
+                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x80);
953
            break;
953
            break;
954
        }
954
        }
955
    }
955
    }
956
}
956
}
957
957
958
static void halbtc8723b1ant_SetFwPstdma(
958
static void halbtc8723b1ant_SetFwPstdma(
959
-    struct btc_coexist *pBtCoexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5
959
-    struct btc_coexist *pBtCoexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5
960
+    struct btc_coexist *bt_coexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5
960
+    struct btc_coexist *bt_coexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5
961
)
961
)
962
{
962
{
963
    u8 H2C_Parameter[5] = {0};
963
    u8 H2C_Parameter[5] = {0};
964
    u8 realByte1 = byte1, realByte5 = byte5;
964
    u8 realByte1 = byte1, realByte5 = byte5;
965
    bool bApEnable = false;
965
    bool bApEnable = false;
966
966
967
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
967
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
968
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
968
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
969
969
970
    if (bApEnable) {
970
    if (bApEnable) {
971
        if (byte1 & BIT4 && !(byte1 & BIT5)) {
971
        if (byte1 & BIT4 && !(byte1 & BIT5)) {
972
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetFwPstdma(
972
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetFwPstdma(
973
    pCoexDm->psTdmaPara[3] = byte4;
973
    pCoexDm->psTdmaPara[3] = byte4;
974
    pCoexDm->psTdmaPara[4] = realByte5;
974
    pCoexDm->psTdmaPara[4] = realByte5;
975
975
976
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter);
976
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter);
977
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x60, 5, H2C_Parameter);
977
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x60, 5, H2C_Parameter);
978
}
978
}
979
979
980
980
981
static void halbtc8723b1ant_PsTdma(
981
static void halbtc8723b1ant_PsTdma(
982
-    struct btc_coexist *pBtCoexist, bool bForceExec, bool bTurnOn, u8 type
982
-    struct btc_coexist *pBtCoexist, bool bForceExec, bool bTurnOn, u8 type
983
+    struct btc_coexist *bt_coexist, bool force_exec, bool bTurnOn, u8 type
983
+    struct btc_coexist *bt_coexist, bool force_exec, bool bTurnOn, u8 type
984
)
984
)
985
{
985
{
986
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
986
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
987
-    bool bWifiBusy = false;
987
-    bool bWifiBusy = false;
988
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
988
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
989
+    bool wifi_busy = false;
989
+    bool wifi_busy = false;
990
    u8 rssiAdjustVal = 0;
990
    u8 rssiAdjustVal = 0;
991
    u8 psTdmaByte4Val = 0x50, psTdmaByte0Val = 0x51, psTdmaByte3Val = 0x10;
991
    u8 psTdmaByte4Val = 0x50, psTdmaByte0Val = 0x51, psTdmaByte3Val = 0x10;
992
    s8 nWiFiDurationAdjust = 0x0;
992
    s8 nWiFiDurationAdjust = 0x0;
993
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
993
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
994
    pCoexDm->bCurPsTdmaOn = bTurnOn;
994
    pCoexDm->bCurPsTdmaOn = bTurnOn;
995
    pCoexDm->curPsTdma = type;
995
    pCoexDm->curPsTdma = type;
996
996
997
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
997
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
998
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
998
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
999
999
1000
-    if (!bForceExec) {
1000
-    if (!bForceExec) {
1001
+    if (!force_exec) {
1001
+    if (!force_exec) {
1002
        if (
1002
        if (
1003
            (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) &&
1003
            (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) &&
1004
            (pCoexDm->prePsTdma == pCoexDm->curPsTdma)
1004
            (pCoexDm->prePsTdma == pCoexDm->curPsTdma)
1005
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1005
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1006
        switch (type) {
1006
        switch (type) {
1007
        default:
1007
        default:
1008
            halbtc8723b1ant_SetFwPstdma(
1008
            halbtc8723b1ant_SetFwPstdma(
1009
-                pBtCoexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val
1009
-                pBtCoexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val
1010
+                bt_coexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val
1010
+                bt_coexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val
1011
            );
1011
            );
1012
            break;
1012
            break;
1013
        case 1:
1013
        case 1:
1014
            halbtc8723b1ant_SetFwPstdma(
1014
            halbtc8723b1ant_SetFwPstdma(
1015
-                pBtCoexist,
1015
-                pBtCoexist,
1016
+                bt_coexist,
1016
+                bt_coexist,
1017
                psTdmaByte0Val,
1017
                psTdmaByte0Val,
1018
                0x3a + nWiFiDurationAdjust,
1018
                0x3a + nWiFiDurationAdjust,
1019
                0x03,
1019
                0x03,
1020
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1020
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1021
            break;
1021
            break;
1022
        case 2:
1022
        case 2:
1023
            halbtc8723b1ant_SetFwPstdma(
1023
            halbtc8723b1ant_SetFwPstdma(
1024
-                pBtCoexist,
1024
-                pBtCoexist,
1025
+                bt_coexist,
1025
+                bt_coexist,
1026
                psTdmaByte0Val,
1026
                psTdmaByte0Val,
1027
                0x2d + nWiFiDurationAdjust,
1027
                0x2d + nWiFiDurationAdjust,
1028
                0x03,
1028
                0x03,
1029
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1029
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1030
            break;
1030
            break;
1031
        case 3:
1031
        case 3:
1032
            halbtc8723b1ant_SetFwPstdma(
1032
            halbtc8723b1ant_SetFwPstdma(
1033
-                pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, 0x10
1033
-                pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, 0x10
1034
+                bt_coexist, 0x51, 0x1d, 0x1d, 0x0, 0x10
1034
+                bt_coexist, 0x51, 0x1d, 0x1d, 0x0, 0x10
1035
            );
1035
            );
1036
            break;
1036
            break;
1037
        case 4:
1037
        case 4:
1038
            halbtc8723b1ant_SetFwPstdma(
1038
            halbtc8723b1ant_SetFwPstdma(
1039
-                pBtCoexist, 0x93, 0x15, 0x3, 0x14, 0x0
1039
-                pBtCoexist, 0x93, 0x15, 0x3, 0x14, 0x0
1040
+                bt_coexist, 0x93, 0x15, 0x3, 0x14, 0x0
1040
+                bt_coexist, 0x93, 0x15, 0x3, 0x14, 0x0
1041
            );
1041
            );
1042
            break;
1042
            break;
1043
        case 5:
1043
        case 5:
1044
            halbtc8723b1ant_SetFwPstdma(
1044
            halbtc8723b1ant_SetFwPstdma(
1045
-                pBtCoexist, 0x61, 0x15, 0x3, 0x11, 0x10
1045
-                pBtCoexist, 0x61, 0x15, 0x3, 0x11, 0x10
1046
+                bt_coexist, 0x61, 0x15, 0x3, 0x11, 0x10
1046
+                bt_coexist, 0x61, 0x15, 0x3, 0x11, 0x10
1047
            );
1047
            );
1048
            break;
1048
            break;
1049
        case 6:
1049
        case 6:
1050
            halbtc8723b1ant_SetFwPstdma(
1050
            halbtc8723b1ant_SetFwPstdma(
1051
-                pBtCoexist, 0x61, 0x20, 0x3, 0x11, 0x11
1051
-                pBtCoexist, 0x61, 0x20, 0x3, 0x11, 0x11
1052
+                bt_coexist, 0x61, 0x20, 0x3, 0x11, 0x11
1052
+                bt_coexist, 0x61, 0x20, 0x3, 0x11, 0x11
1053
            );
1053
            );
1054
            break;
1054
            break;
1055
        case 7:
1055
        case 7:
1056
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xc, 0x5, 0x0, 0x0);
1056
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xc, 0x5, 0x0, 0x0);
1057
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xc, 0x5, 0x0, 0x0);
1057
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xc, 0x5, 0x0, 0x0);
1058
            break;
1058
            break;
1059
        case 8:
1059
        case 8:
1060
            halbtc8723b1ant_SetFwPstdma(
1060
            halbtc8723b1ant_SetFwPstdma(
1061
-                pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0
1061
-                pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0
1062
+                bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0
1062
+                bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0
1063
            );
1063
            );
1064
            break;
1064
            break;
1065
        case 9:
1065
        case 9:
1066
            halbtc8723b1ant_SetFwPstdma(
1066
            halbtc8723b1ant_SetFwPstdma(
1067
-                pBtCoexist,
1067
-                pBtCoexist,
1068
+                bt_coexist,
1068
+                bt_coexist,
1069
                psTdmaByte0Val,
1069
                psTdmaByte0Val,
1070
                0x21,
1070
                0x21,
1071
                0x3,
1071
                0x3,
1072
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1072
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1073
            );
1073
            );
1074
            break;
1074
            break;
1075
        case 10:
1075
        case 10:
1076
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0xa, 0x0, 0x40);
1076
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0xa, 0x0, 0x40);
1077
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xa, 0xa, 0x0, 0x40);
1077
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xa, 0xa, 0x0, 0x40);
1078
            break;
1078
            break;
1079
        case 11:
1079
        case 11:
1080
            halbtc8723b1ant_SetFwPstdma(
1080
            halbtc8723b1ant_SetFwPstdma(
1081
-                pBtCoexist,
1081
-                pBtCoexist,
1082
+                bt_coexist,
1082
+                bt_coexist,
1083
                psTdmaByte0Val,
1083
                psTdmaByte0Val,
1084
                0x21,
1084
                0x21,
1085
                0x03,
1085
                0x03,
1086
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1086
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1087
            break;
1087
            break;
1088
        case 12:
1088
        case 12:
1089
            halbtc8723b1ant_SetFwPstdma(
1089
            halbtc8723b1ant_SetFwPstdma(
1090
-                pBtCoexist, 0x51, 0x0a, 0x0a, 0x0, 0x50
1090
-                pBtCoexist, 0x51, 0x0a, 0x0a, 0x0, 0x50
1091
+                bt_coexist, 0x51, 0x0a, 0x0a, 0x0, 0x50
1091
+                bt_coexist, 0x51, 0x0a, 0x0a, 0x0, 0x50
1092
            );
1092
            );
1093
            break;
1093
            break;
1094
        case 13:
1094
        case 13:
1095
            halbtc8723b1ant_SetFwPstdma(
1095
            halbtc8723b1ant_SetFwPstdma(
1096
-                pBtCoexist, 0x51, 0x12, 0x12, 0x0, 0x10
1096
-                pBtCoexist, 0x51, 0x12, 0x12, 0x0, 0x10
1097
+                bt_coexist, 0x51, 0x12, 0x12, 0x0, 0x10
1097
+                bt_coexist, 0x51, 0x12, 0x12, 0x0, 0x10
1098
            );
1098
            );
1099
            break;
1099
            break;
1100
        case 14:
1100
        case 14:
1101
            halbtc8723b1ant_SetFwPstdma(
1101
            halbtc8723b1ant_SetFwPstdma(
1102
-                pBtCoexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val
1102
-                pBtCoexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val
1103
+                bt_coexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val
1103
+                bt_coexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val
1104
            );
1104
            );
1105
            break;
1105
            break;
1106
        case 15:
1106
        case 15:
1107
            halbtc8723b1ant_SetFwPstdma(
1107
            halbtc8723b1ant_SetFwPstdma(
1108
-                pBtCoexist, 0x13, 0xa, 0x3, 0x8, 0x0
1108
-                pBtCoexist, 0x13, 0xa, 0x3, 0x8, 0x0
1109
+                bt_coexist, 0x13, 0xa, 0x3, 0x8, 0x0
1109
+                bt_coexist, 0x13, 0xa, 0x3, 0x8, 0x0
1110
            );
1110
            );
1111
            break;
1111
            break;
1112
        case 16:
1112
        case 16:
1113
            halbtc8723b1ant_SetFwPstdma(
1113
            halbtc8723b1ant_SetFwPstdma(
1114
-                pBtCoexist, 0x93, 0x15, 0x3, 0x10, 0x0
1114
-                pBtCoexist, 0x93, 0x15, 0x3, 0x10, 0x0
1115
+                bt_coexist, 0x93, 0x15, 0x3, 0x10, 0x0
1115
+                bt_coexist, 0x93, 0x15, 0x3, 0x10, 0x0
1116
            );
1116
            );
1117
            break;
1117
            break;
1118
        case 18:
1118
        case 18:
1119
            halbtc8723b1ant_SetFwPstdma(
1119
            halbtc8723b1ant_SetFwPstdma(
1120
-                pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0
1120
-                pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0
1121
+                bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0
1121
+                bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0
1122
            );
1122
            );
1123
            break;
1123
            break;
1124
        case 20:
1124
        case 20:
1125
            halbtc8723b1ant_SetFwPstdma(
1125
            halbtc8723b1ant_SetFwPstdma(
1126
-                pBtCoexist, 0x61, 0x3f, 0x03, 0x11, 0x10
1126
-                pBtCoexist, 0x61, 0x3f, 0x03, 0x11, 0x10
1127
+                bt_coexist, 0x61, 0x3f, 0x03, 0x11, 0x10
1127
+                bt_coexist, 0x61, 0x3f, 0x03, 0x11, 0x10
1128
1128
1129
            );
1129
            );
1130
            break;
1130
            break;
1131
        case 21:
1131
        case 21:
1132
            halbtc8723b1ant_SetFwPstdma(
1132
            halbtc8723b1ant_SetFwPstdma(
1133
-                pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x11
1133
-                pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x11
1134
+                bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x11
1134
+                bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x11
1135
            );
1135
            );
1136
            break;
1136
            break;
1137
        case 22:
1137
        case 22:
1138
            halbtc8723b1ant_SetFwPstdma(
1138
            halbtc8723b1ant_SetFwPstdma(
1139
-                pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x10
1139
-                pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x10
1140
+                bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x10
1140
+                bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x10
1141
            );
1141
            );
1142
            break;
1142
            break;
1143
        case 23:
1143
        case 23:
1144
            halbtc8723b1ant_SetFwPstdma(
1144
            halbtc8723b1ant_SetFwPstdma(
1145
-                pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x18
1145
-                pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x18
1146
+                bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x18
1146
+                bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x18
1147
            );
1147
            );
1148
            break;
1148
            break;
1149
        case 24:
1149
        case 24:
1150
            halbtc8723b1ant_SetFwPstdma(
1150
            halbtc8723b1ant_SetFwPstdma(
1151
-                pBtCoexist, 0xe3, 0x15, 0x3, 0x31, 0x18
1151
-                pBtCoexist, 0xe3, 0x15, 0x3, 0x31, 0x18
1152
+                bt_coexist, 0xe3, 0x15, 0x3, 0x31, 0x18
1152
+                bt_coexist, 0xe3, 0x15, 0x3, 0x31, 0x18
1153
            );
1153
            );
1154
            break;
1154
            break;
1155
        case 25:
1155
        case 25:
1156
            halbtc8723b1ant_SetFwPstdma(
1156
            halbtc8723b1ant_SetFwPstdma(
1157
-                pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18
1157
-                pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18
1158
+                bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18
1158
+                bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18
1159
            );
1159
            );
1160
            break;
1160
            break;
1161
        case 26:
1161
        case 26:
1162
            halbtc8723b1ant_SetFwPstdma(
1162
            halbtc8723b1ant_SetFwPstdma(
1163
-                pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18
1163
-                pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18
1164
+                bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18
1164
+                bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18
1165
            );
1165
            );
1166
            break;
1166
            break;
1167
        case 27:
1167
        case 27:
1168
            halbtc8723b1ant_SetFwPstdma(
1168
            halbtc8723b1ant_SetFwPstdma(
1169
-                pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x98
1169
-                pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x98
1170
+                bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x98
1170
+                bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x98
1171
            );
1171
            );
1172
            break;
1172
            break;
1173
        case 28:
1173
        case 28:
1174
            halbtc8723b1ant_SetFwPstdma(
1174
            halbtc8723b1ant_SetFwPstdma(
1175
-                pBtCoexist, 0x69, 0x25, 0x3, 0x31, 0x0
1175
-                pBtCoexist, 0x69, 0x25, 0x3, 0x31, 0x0
1176
+                bt_coexist, 0x69, 0x25, 0x3, 0x31, 0x0
1176
+                bt_coexist, 0x69, 0x25, 0x3, 0x31, 0x0
1177
            );
1177
            );
1178
            break;
1178
            break;
1179
        case 29:
1179
        case 29:
1180
            halbtc8723b1ant_SetFwPstdma(
1180
            halbtc8723b1ant_SetFwPstdma(
1181
-                pBtCoexist, 0xab, 0x1a, 0x1a, 0x1, 0x10
1181
-                pBtCoexist, 0xab, 0x1a, 0x1a, 0x1, 0x10
1182
+                bt_coexist, 0xab, 0x1a, 0x1a, 0x1, 0x10
1182
+                bt_coexist, 0xab, 0x1a, 0x1a, 0x1, 0x10
1183
            );
1183
            );
1184
            break;
1184
            break;
1185
        case 30:
1185
        case 30:
1186
            halbtc8723b1ant_SetFwPstdma(
1186
            halbtc8723b1ant_SetFwPstdma(
1187
-                pBtCoexist, 0x51, 0x30, 0x3, 0x10, 0x10
1187
-                pBtCoexist, 0x51, 0x30, 0x3, 0x10, 0x10
1188
+                bt_coexist, 0x51, 0x30, 0x3, 0x10, 0x10
1188
+                bt_coexist, 0x51, 0x30, 0x3, 0x10, 0x10
1189
            );
1189
            );
1190
            break;
1190
            break;
1191
        case 31:
1191
        case 31:
1192
            halbtc8723b1ant_SetFwPstdma(
1192
            halbtc8723b1ant_SetFwPstdma(
1193
-                pBtCoexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58
1193
-                pBtCoexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58
1194
+                bt_coexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58
1194
+                bt_coexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58
1195
            );
1195
            );
1196
            break;
1196
            break;
1197
        case 32:
1197
        case 32:
1198
            halbtc8723b1ant_SetFwPstdma(
1198
            halbtc8723b1ant_SetFwPstdma(
1199
-                pBtCoexist, 0x61, 0x35, 0x3, 0x11, 0x11
1199
-                pBtCoexist, 0x61, 0x35, 0x3, 0x11, 0x11
1200
+                bt_coexist, 0x61, 0x35, 0x3, 0x11, 0x11
1200
+                bt_coexist, 0x61, 0x35, 0x3, 0x11, 0x11
1201
            );
1201
            );
1202
            break;
1202
            break;
1203
        case 33:
1203
        case 33:
1204
            halbtc8723b1ant_SetFwPstdma(
1204
            halbtc8723b1ant_SetFwPstdma(
1205
-                pBtCoexist, 0xa3, 0x25, 0x3, 0x30, 0x90
1205
-                pBtCoexist, 0xa3, 0x25, 0x3, 0x30, 0x90
1206
+                bt_coexist, 0xa3, 0x25, 0x3, 0x30, 0x90
1206
+                bt_coexist, 0xa3, 0x25, 0x3, 0x30, 0x90
1207
            );
1207
            );
1208
            break;
1208
            break;
1209
        case 34:
1209
        case 34:
1210
            halbtc8723b1ant_SetFwPstdma(
1210
            halbtc8723b1ant_SetFwPstdma(
1211
-                pBtCoexist, 0x53, 0x1a, 0x1a, 0x0, 0x10
1211
-                pBtCoexist, 0x53, 0x1a, 0x1a, 0x0, 0x10
1212
+                bt_coexist, 0x53, 0x1a, 0x1a, 0x0, 0x10
1212
+                bt_coexist, 0x53, 0x1a, 0x1a, 0x0, 0x10
1213
            );
1213
            );
1214
            break;
1214
            break;
1215
        case 35:
1215
        case 35:
1216
            halbtc8723b1ant_SetFwPstdma(
1216
            halbtc8723b1ant_SetFwPstdma(
1217
-                pBtCoexist, 0x63, 0x1a, 0x1a, 0x0, 0x10
1217
-                pBtCoexist, 0x63, 0x1a, 0x1a, 0x0, 0x10
1218
+                bt_coexist, 0x63, 0x1a, 0x1a, 0x0, 0x10
1218
+                bt_coexist, 0x63, 0x1a, 0x1a, 0x0, 0x10
1219
            );
1219
            );
1220
            break;
1220
            break;
1221
        case 36:
1221
        case 36:
1222
            halbtc8723b1ant_SetFwPstdma(
1222
            halbtc8723b1ant_SetFwPstdma(
1223
-                pBtCoexist, 0xd3, 0x12, 0x3, 0x14, 0x50
1223
-                pBtCoexist, 0xd3, 0x12, 0x3, 0x14, 0x50
1224
+                bt_coexist, 0xd3, 0x12, 0x3, 0x14, 0x50
1224
+                bt_coexist, 0xd3, 0x12, 0x3, 0x14, 0x50
1225
            );
1225
            );
1226
            break;
1226
            break;
1227
        case 40: /* SoftAP only with no sta associated, BT disable , TDMA mode for power saving */
1227
        case 40: /* SoftAP only with no sta associated, BT disable , TDMA mode for power saving */
1228
            /* here softap mode screen off will cost 70-80mA for phone */
1228
            /* here softap mode screen off will cost 70-80mA for phone */
1229
            halbtc8723b1ant_SetFwPstdma(
1229
            halbtc8723b1ant_SetFwPstdma(
1230
-                pBtCoexist, 0x23, 0x18, 0x00, 0x10, 0x24
1230
-                pBtCoexist, 0x23, 0x18, 0x00, 0x10, 0x24
1231
+                bt_coexist, 0x23, 0x18, 0x00, 0x10, 0x24
1231
+                bt_coexist, 0x23, 0x18, 0x00, 0x10, 0x24
1232
            );
1232
            );
1233
            break;
1233
            break;
1234
        }
1234
        }
1235
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1235
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1236
        /* disable PS tdma */
1236
        /* disable PS tdma */
1237
        switch (type) {
1237
        switch (type) {
1238
        case 8: /* PTA Control */
1238
        case 8: /* PTA Control */
1239
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x8, 0x0, 0x0, 0x0, 0x0);
1239
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x8, 0x0, 0x0, 0x0, 0x0);
1240
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x8, 0x0, 0x0, 0x0, 0x0);
1240
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x8, 0x0, 0x0, 0x0, 0x0);
1241
            halbtc8723b1ant_SetAntPath(
1241
            halbtc8723b1ant_SetAntPath(
1242
-                pBtCoexist, BTC_ANT_PATH_PTA, false, false
1242
-                pBtCoexist, BTC_ANT_PATH_PTA, false, false
1243
+                bt_coexist, BTC_ANT_PATH_PTA, false, false
1243
+                bt_coexist, BTC_ANT_PATH_PTA, false, false
1244
            );
1244
            );
1245
            break;
1245
            break;
1246
        case 0:
1246
        case 0:
1247
        default: /* Software control, Antenna at BT side */
1247
        default: /* Software control, Antenna at BT side */
1248
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0);
1248
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0);
1249
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0);
1249
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0);
1250
            halbtc8723b1ant_SetAntPath(
1250
            halbtc8723b1ant_SetAntPath(
1251
-                pBtCoexist, BTC_ANT_PATH_BT, false, false
1251
-                pBtCoexist, BTC_ANT_PATH_BT, false, false
1252
+                bt_coexist, BTC_ANT_PATH_BT, false, false
1252
+                bt_coexist, BTC_ANT_PATH_BT, false, false
1253
            );
1253
            );
1254
            break;
1254
            break;
1255
        case 9: /* Software control, Antenna at WiFi side */
1255
        case 9: /* Software control, Antenna at WiFi side */
1256
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0);
1256
-            halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0);
1257
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0);
1257
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0);
1258
            halbtc8723b1ant_SetAntPath(
1258
            halbtc8723b1ant_SetAntPath(
1259
-                pBtCoexist, BTC_ANT_PATH_WIFI, false, false
1259
-                pBtCoexist, BTC_ANT_PATH_WIFI, false, false
1260
+                bt_coexist, BTC_ANT_PATH_WIFI, false, false
1260
+                bt_coexist, BTC_ANT_PATH_WIFI, false, false
1261
            );
1261
            );
1262
            break;
1262
            break;
1263
        }
1263
        }
1264
    }
1264
    }
1265
1265
1266
    rssiAdjustVal = 0;
1266
    rssiAdjustVal = 0;
1267
-    pBtCoexist->fBtcSet(
1267
-    pBtCoexist->fBtcSet(
1268
-        pBtCoexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal
1268
-        pBtCoexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal
1269
+    bt_coexist->fBtcSet(
1269
+    bt_coexist->fBtcSet(
1270
+        bt_coexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal
1270
+        bt_coexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal
1271
    );
1271
    );
1272
1272
1273
    /* update pre state */
1273
    /* update pre state */
1274
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1274
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
1275
    pCoexDm->prePsTdma = pCoexDm->curPsTdma;
1275
    pCoexDm->prePsTdma = pCoexDm->curPsTdma;
1276
}
1276
}
1277
1277
1278
-static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist)
1278
-static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist)
1279
+static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *bt_coexist)
1279
+static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *bt_coexist)
1280
{
1280
{
1281
-    bool bCommon = false, bWifiConnected = false, bWifiBusy = false;
1281
-    bool bCommon = false, bWifiConnected = false, bWifiBusy = false;
1282
+    bool bCommon = false, bWifiConnected = false, wifi_busy = false;
1282
+    bool bCommon = false, bWifiConnected = false, wifi_busy = false;
1283
1283
1284
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1284
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1285
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
1285
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
1286
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1286
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1287
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1287
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1288
1288
1289
    if (
1289
    if (
1290
        !bWifiConnected &&
1290
        !bWifiConnected &&
1291
        pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE
1291
        pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE
1292
    ) {
1292
    ) {
1293
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1293
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1294
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1294
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1295
1295
1296
        bCommon = true;
1296
        bCommon = true;
1297
    } else if (
1297
    } else if (
1298
        bWifiConnected &&
1298
        bWifiConnected &&
1299
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE)
1299
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE)
1300
    ) {
1300
    ) {
1301
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1301
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1302
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1302
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1303
1303
1304
        bCommon = true;
1304
        bCommon = true;
1305
    } else if (
1305
    } else if (
1306
        !bWifiConnected &&
1306
        !bWifiConnected &&
1307
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1307
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1308
    ) {
1308
    ) {
1309
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1309
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1310
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1310
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1311
1311
1312
        bCommon = true;
1312
        bCommon = true;
1313
    } else if (
1313
    } else if (
1314
        bWifiConnected &&
1314
        bWifiConnected &&
1315
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1315
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1316
    ) {
1316
    ) {
1317
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1317
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1318
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1318
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1319
1319
1320
        bCommon = true;
1320
        bCommon = true;
1321
    } else if (
1321
    } else if (
1322
        !bWifiConnected &&
1322
        !bWifiConnected &&
1323
        (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1323
        (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1324
    ) {
1324
    ) {
1325
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1325
-        /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */
1326
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1326
+        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1327
1327
1328
        bCommon = true;
1328
        bCommon = true;
1329
    } else {
1329
    } else {
1330
@@ -XXX,XX +XXX,XX @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist)
1330
@@ -XXX,XX +XXX,XX @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist)
1331
1331
1332
1332
1333
static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1333
static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1334
-    struct btc_coexist *pBtCoexist, u8 wifiStatus
1334
-    struct btc_coexist *pBtCoexist, u8 wifiStatus
1335
+    struct btc_coexist *bt_coexist, u8 wifiStatus
1335
+    struct btc_coexist *bt_coexist, u8 wifiStatus
1336
)
1336
)
1337
{
1337
{
1338
    static s32 up, dn, m, n, WaitCount;
1338
    static s32 up, dn, m, n, WaitCount;
1339
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1339
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1340
            pCoexDm->curPsTdma != 3 &&
1340
            pCoexDm->curPsTdma != 3 &&
1341
            pCoexDm->curPsTdma != 9
1341
            pCoexDm->curPsTdma != 9
1342
        ) {
1342
        ) {
1343
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1343
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1344
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1344
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1345
            pCoexDm->psTdmaDuAdjType = 9;
1345
            pCoexDm->psTdmaDuAdjType = 9;
1346
1346
1347
            up = 0;
1347
            up = 0;
1348
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1348
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1349
    if (!pCoexDm->bAutoTdmaAdjust) {
1349
    if (!pCoexDm->bAutoTdmaAdjust) {
1350
        pCoexDm->bAutoTdmaAdjust = true;
1350
        pCoexDm->bAutoTdmaAdjust = true;
1351
1351
1352
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2);
1352
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2);
1353
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2);
1353
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2);
1354
        pCoexDm->psTdmaDuAdjType = 2;
1354
        pCoexDm->psTdmaDuAdjType = 2;
1355
        /* */
1355
        /* */
1356
        up = 0;
1356
        up = 0;
1357
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1357
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1358
                BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) &&
1358
                BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) &&
1359
                ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2))
1359
                ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2))
1360
            ) {
1360
            ) {
1361
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1361
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1362
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1362
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1363
                pCoexDm->psTdmaDuAdjType = 9;
1363
                pCoexDm->psTdmaDuAdjType = 9;
1364
            } else if (pCoexDm->curPsTdma == 1) {
1364
            } else if (pCoexDm->curPsTdma == 1) {
1365
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2);
1365
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2);
1366
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2);
1366
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2);
1367
                pCoexDm->psTdmaDuAdjType = 2;
1367
                pCoexDm->psTdmaDuAdjType = 2;
1368
            } else if (pCoexDm->curPsTdma == 2) {
1368
            } else if (pCoexDm->curPsTdma == 2) {
1369
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1369
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1370
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1370
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1371
                pCoexDm->psTdmaDuAdjType = 9;
1371
                pCoexDm->psTdmaDuAdjType = 9;
1372
            } else if (pCoexDm->curPsTdma == 9) {
1372
            } else if (pCoexDm->curPsTdma == 9) {
1373
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 11);
1373
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 11);
1374
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 11);
1374
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 11);
1375
                pCoexDm->psTdmaDuAdjType = 11;
1375
                pCoexDm->psTdmaDuAdjType = 11;
1376
            }
1376
            }
1377
        } else if (result == 1) {
1377
        } else if (result == 1) {
1378
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1378
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1379
                BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) &&
1379
                BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) &&
1380
                ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2))
1380
                ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2))
1381
            ) {
1381
            ) {
1382
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1382
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1383
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1383
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1384
                pCoexDm->psTdmaDuAdjType = 9;
1384
                pCoexDm->psTdmaDuAdjType = 9;
1385
            } else if (pCoexDm->curPsTdma == 11) {
1385
            } else if (pCoexDm->curPsTdma == 11) {
1386
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1386
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9);
1387
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1387
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1388
                pCoexDm->psTdmaDuAdjType = 9;
1388
                pCoexDm->psTdmaDuAdjType = 9;
1389
            } else if (pCoexDm->curPsTdma == 9) {
1389
            } else if (pCoexDm->curPsTdma == 9) {
1390
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2);
1390
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2);
1391
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2);
1391
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2);
1392
                pCoexDm->psTdmaDuAdjType = 2;
1392
                pCoexDm->psTdmaDuAdjType = 2;
1393
            } else if (pCoexDm->curPsTdma == 2) {
1393
            } else if (pCoexDm->curPsTdma == 2) {
1394
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 1);
1394
-                halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 1);
1395
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 1);
1395
+                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 1);
1396
                pCoexDm->psTdmaDuAdjType = 1;
1396
                pCoexDm->psTdmaDuAdjType = 1;
1397
            }
1397
            }
1398
        }
1398
        }
1399
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1399
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1400
            pCoexDm->curPsTdma != 11
1400
            pCoexDm->curPsTdma != 11
1401
        ) /* recover to previous adjust type */
1401
        ) /* recover to previous adjust type */
1402
            halbtc8723b1ant_PsTdma(
1402
            halbtc8723b1ant_PsTdma(
1403
-                pBtCoexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType
1403
-                pBtCoexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType
1404
+                bt_coexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType
1404
+                bt_coexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType
1405
            );
1405
            );
1406
    }
1406
    }
1407
}
1407
}
1408
1408
1409
static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState(
1409
static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState(
1410
-    struct btc_coexist *pBtCoexist, bool bNewPsState
1410
-    struct btc_coexist *pBtCoexist, bool bNewPsState
1411
+    struct btc_coexist *bt_coexist, bool bNewPsState
1411
+    struct btc_coexist *bt_coexist, bool bNewPsState
1412
)
1412
)
1413
{
1413
{
1414
    u8 lpsMode = 0x0;
1414
    u8 lpsMode = 0x0;
1415
1415
1416
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_LPS_MODE, &lpsMode);
1416
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_LPS_MODE, &lpsMode);
1417
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_LPS_MODE, &lpsMode);
1417
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_LPS_MODE, &lpsMode);
1418
1418
1419
    if (lpsMode) {    /* already under LPS state */
1419
    if (lpsMode) {    /* already under LPS state */
1420
        if (bNewPsState) {
1420
        if (bNewPsState) {
1421
            /* keep state under LPS, do nothing. */
1421
            /* keep state under LPS, do nothing. */
1422
        } else /* will leave LPS state, turn off psTdma first */
1422
        } else /* will leave LPS state, turn off psTdma first */
1423
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0);
1423
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0);
1424
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0);
1424
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0);
1425
    } else {                        /* NO PS state */
1425
    } else {                        /* NO PS state */
1426
        if (bNewPsState) /* will enter LPS state, turn off psTdma first */
1426
        if (bNewPsState) /* will enter LPS state, turn off psTdma first */
1427
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0);
1427
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0);
1428
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0);
1428
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0);
1429
        else {
1429
        else {
1430
            /* keep state under NO PS state, do nothing. */
1430
            /* keep state under NO PS state, do nothing. */
1431
        }
1431
        }
1432
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState(
1432
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState(
1433
}
1433
}
1434
1434
1435
static void halbtc8723b1ant_PowerSaveState(
1435
static void halbtc8723b1ant_PowerSaveState(
1436
-    struct btc_coexist *pBtCoexist, u8 psType, u8 lpsVal, u8 rpwmVal
1436
-    struct btc_coexist *pBtCoexist, u8 psType, u8 lpsVal, u8 rpwmVal
1437
+    struct btc_coexist *bt_coexist, u8 psType, u8 lpsVal, u8 rpwmVal
1437
+    struct btc_coexist *bt_coexist, u8 psType, u8 lpsVal, u8 rpwmVal
1438
)
1438
)
1439
{
1439
{
1440
    bool bLowPwrDisable = false;
1440
    bool bLowPwrDisable = false;
1441
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PowerSaveState(
1441
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PowerSaveState(
1442
    case BTC_PS_WIFI_NATIVE:
1442
    case BTC_PS_WIFI_NATIVE:
1443
        /* recover to original 32k low power setting */
1443
        /* recover to original 32k low power setting */
1444
        bLowPwrDisable = false;
1444
        bLowPwrDisable = false;
1445
-        pBtCoexist->fBtcSet(
1445
-        pBtCoexist->fBtcSet(
1446
-            pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1446
-            pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1447
+        bt_coexist->fBtcSet(
1447
+        bt_coexist->fBtcSet(
1448
+            bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1448
+            bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1449
        );
1449
        );
1450
-        pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_NORMAL_LPS, NULL);
1450
-        pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_NORMAL_LPS, NULL);
1451
+        bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_NORMAL_LPS, NULL);
1451
+        bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_NORMAL_LPS, NULL);
1452
        pCoexSta->bForceLpsOn = false;
1452
        pCoexSta->bForceLpsOn = false;
1453
        break;
1453
        break;
1454
    case BTC_PS_LPS_ON:
1454
    case BTC_PS_LPS_ON:
1455
-        halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, true);
1455
-        halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, true);
1456
-        halbtc8723b1ant_LpsRpwm(pBtCoexist, NORMAL_EXEC, lpsVal, rpwmVal);
1456
-        halbtc8723b1ant_LpsRpwm(pBtCoexist, NORMAL_EXEC, lpsVal, rpwmVal);
1457
+        halbtc8723b1ant_PsTdmaCheckForPowerSaveState(bt_coexist, true);
1457
+        halbtc8723b1ant_PsTdmaCheckForPowerSaveState(bt_coexist, true);
1458
+        halbtc8723b1ant_LpsRpwm(bt_coexist, NORMAL_EXEC, lpsVal, rpwmVal);
1458
+        halbtc8723b1ant_LpsRpwm(bt_coexist, NORMAL_EXEC, lpsVal, rpwmVal);
1459
        /* when coex force to enter LPS, do not enter 32k low power. */
1459
        /* when coex force to enter LPS, do not enter 32k low power. */
1460
        bLowPwrDisable = true;
1460
        bLowPwrDisable = true;
1461
-        pBtCoexist->fBtcSet(
1461
-        pBtCoexist->fBtcSet(
1462
-            pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1462
-            pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1463
+        bt_coexist->fBtcSet(
1463
+        bt_coexist->fBtcSet(
1464
+            bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1464
+            bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1465
        );
1465
        );
1466
        /* power save must executed before psTdma. */
1466
        /* power save must executed before psTdma. */
1467
-        pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_ENTER_LPS, NULL);
1467
-        pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_ENTER_LPS, NULL);
1468
+        bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_ENTER_LPS, NULL);
1468
+        bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_ENTER_LPS, NULL);
1469
        pCoexSta->bForceLpsOn = true;
1469
        pCoexSta->bForceLpsOn = true;
1470
        break;
1470
        break;
1471
    case BTC_PS_LPS_OFF:
1471
    case BTC_PS_LPS_OFF:
1472
-        halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, false);
1472
-        halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, false);
1473
-        pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_LEAVE_LPS, NULL);
1473
-        pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_LEAVE_LPS, NULL);
1474
+        halbtc8723b1ant_PsTdmaCheckForPowerSaveState(bt_coexist, false);
1474
+        halbtc8723b1ant_PsTdmaCheckForPowerSaveState(bt_coexist, false);
1475
+        bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_LEAVE_LPS, NULL);
1475
+        bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_LEAVE_LPS, NULL);
1476
        pCoexSta->bForceLpsOn = false;
1476
        pCoexSta->bForceLpsOn = false;
1477
        break;
1477
        break;
1478
    default:
1478
    default:
1479
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PowerSaveState(
1479
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PowerSaveState(
1480
/*    Non-Software Coex Mechanism start */
1480
/*    Non-Software Coex Mechanism start */
1481
/* */
1481
/* */
1482
/* */
1482
/* */
1483
-static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *pBtCoexist)
1483
-static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *pBtCoexist)
1484
+static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *bt_coexist)
1484
+static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *bt_coexist)
1485
{
1485
{
1486
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1486
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1487
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1487
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1488
1488
1489
-    halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1489
-    halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1490
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1490
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1491
+    halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1491
+    halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1492
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1492
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1493
}
1493
}
1494
1494
1495
-static void halbtc8723b1ant_ActionHs(struct btc_coexist *pBtCoexist)
1495
-static void halbtc8723b1ant_ActionHs(struct btc_coexist *pBtCoexist)
1496
+static void halbtc8723b1ant_ActionHs(struct btc_coexist *bt_coexist)
1496
+static void halbtc8723b1ant_ActionHs(struct btc_coexist *bt_coexist)
1497
{
1497
{
1498
-    halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 5);
1498
-    halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 5);
1499
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1499
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1500
+    halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 5);
1500
+    halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 5);
1501
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1501
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1502
}
1502
}
1503
1503
1504
-static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *pBtCoexist)
1504
-static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *pBtCoexist)
1505
+static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *bt_coexist)
1505
+static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *bt_coexist)
1506
{
1506
{
1507
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1507
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1508
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1508
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1509
    bool bWifiConnected = false;
1509
    bool bWifiConnected = false;
1510
    bool bApEnable = false;
1510
    bool bApEnable = false;
1511
-    bool bWifiBusy = false;
1511
-    bool bWifiBusy = false;
1512
+    bool wifi_busy = false;
1512
+    bool wifi_busy = false;
1513
    bool bBtBusy = false;
1513
    bool bBtBusy = false;
1514
1514
1515
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
1515
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
1516
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1516
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1517
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
1517
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
1518
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy);
1518
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy);
1519
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
1519
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
1520
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1520
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1521
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1521
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1522
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy);
1522
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy);
1523
1523
1524
    if (!bWifiConnected && !pCoexSta->bWiFiIsHighPriTask) {
1524
    if (!bWifiConnected && !pCoexSta->bWiFiIsHighPriTask) {
1525
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1525
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1526
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1526
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1527
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1527
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1528
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1528
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1529
1529
1530
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0);
1530
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0);
1531
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0);
1531
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0);
1532
    } else if (
1532
    } else if (
1533
        pBtLinkInfo->bScoExist ||
1533
        pBtLinkInfo->bScoExist ||
1534
        pBtLinkInfo->bHidExist ||
1534
        pBtLinkInfo->bHidExist ||
1535
        pBtLinkInfo->bA2dpExist
1535
        pBtLinkInfo->bA2dpExist
1536
    ) {
1536
    ) {
1537
        /* SCO/HID/A2DP busy */
1537
        /* SCO/HID/A2DP busy */
1538
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1538
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1539
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1539
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1540
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1540
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1541
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1541
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1542
1542
1543
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1543
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1544
-    } else if (pBtLinkInfo->bPanExist || bWifiBusy) {
1544
-    } else if (pBtLinkInfo->bPanExist || bWifiBusy) {
1545
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1545
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1546
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1546
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1547
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1547
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1548
+    } else if (pBtLinkInfo->bPanExist || wifi_busy) {
1548
+    } else if (pBtLinkInfo->bPanExist || wifi_busy) {
1549
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1549
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1550
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1550
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1551
1551
1552
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1552
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1553
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1553
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1554
    } else {
1554
    } else {
1555
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1555
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1556
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1556
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1557
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1557
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1558
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1558
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1559
1559
1560
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7);
1560
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7);
1561
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7);
1561
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7);
1562
    }
1562
    }
1563
}
1563
}
1564
1564
1565
static void halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1565
static void halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1566
-    struct btc_coexist *pBtCoexist, u8 wifiStatus
1566
-    struct btc_coexist *pBtCoexist, u8 wifiStatus
1567
+    struct btc_coexist *bt_coexist, u8 wifiStatus
1567
+    struct btc_coexist *bt_coexist, u8 wifiStatus
1568
)
1568
)
1569
{
1569
{
1570
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1570
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1571
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1571
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1572
    bool bWifiConnected = false;
1572
    bool bWifiConnected = false;
1573
1573
1574
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1574
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1575
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1575
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1576
1576
1577
    /* tdma and coex table */
1577
    /* tdma and coex table */
1578
1578
1579
    if (pBtLinkInfo->bScoExist) {
1579
    if (pBtLinkInfo->bScoExist) {
1580
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 5);
1580
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 5);
1581
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5);
1581
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5);
1582
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 5);
1582
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 5);
1583
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 5);
1583
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 5);
1584
    } else { /* HID */
1584
    } else { /* HID */
1585
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 6);
1585
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 6);
1586
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5);
1586
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5);
1587
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 6);
1587
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 6);
1588
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 5);
1588
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 5);
1589
    }
1589
    }
1590
}
1590
}
1591
1591
1592
static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1592
static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1593
-    struct btc_coexist *pBtCoexist, u8 wifiStatus
1593
-    struct btc_coexist *pBtCoexist, u8 wifiStatus
1594
+    struct btc_coexist *bt_coexist, u8 wifiStatus
1594
+    struct btc_coexist *bt_coexist, u8 wifiStatus
1595
)
1595
)
1596
{
1596
{
1597
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1597
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1598
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1598
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1599
1599
1600
    halbtc8723b1ant_BtRssiState(2, 28, 0);
1600
    halbtc8723b1ant_BtRssiState(2, 28, 0);
1601
1601
1602
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1602
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1603
        pBtLinkInfo->bSlaveRole = false;
1603
        pBtLinkInfo->bSlaveRole = false;
1604
1604
1605
    if (pBtLinkInfo->bHidOnly) { /* HID */
1605
    if (pBtLinkInfo->bHidOnly) { /* HID */
1606
-        halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist, wifiStatus);
1606
-        halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist, wifiStatus);
1607
+        halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, wifiStatus);
1607
+        halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, wifiStatus);
1608
        pCoexDm->bAutoTdmaAdjust = false;
1608
        pCoexDm->bAutoTdmaAdjust = false;
1609
        return;
1609
        return;
1610
    } else if (pBtLinkInfo->bA2dpOnly) { /* A2DP */
1610
    } else if (pBtLinkInfo->bA2dpOnly) { /* A2DP */
1611
        if (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE) {
1611
        if (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE) {
1612
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1612
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1613
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1613
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1614
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1614
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1615
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1615
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1616
            pCoexDm->bAutoTdmaAdjust = false;
1616
            pCoexDm->bAutoTdmaAdjust = false;
1617
        } else {
1617
        } else {
1618
-            halbtc8723b1ant_TdmaDurationAdjustForAcl(pBtCoexist, wifiStatus);
1618
-            halbtc8723b1ant_TdmaDurationAdjustForAcl(pBtCoexist, wifiStatus);
1619
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1619
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1620
+            halbtc8723b1ant_TdmaDurationAdjustForAcl(bt_coexist, wifiStatus);
1620
+            halbtc8723b1ant_TdmaDurationAdjustForAcl(bt_coexist, wifiStatus);
1621
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1621
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1622
            pCoexDm->bAutoTdmaAdjust = true;
1622
            pCoexDm->bAutoTdmaAdjust = true;
1623
        }
1623
        }
1624
    } else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { /* HID+A2DP */
1624
    } else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { /* HID+A2DP */
1625
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 14);
1625
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 14);
1626
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 14);
1626
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 14);
1627
        pCoexDm->bAutoTdmaAdjust = false;
1627
        pCoexDm->bAutoTdmaAdjust = false;
1628
1628
1629
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1629
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1630
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1630
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1631
    } else if (
1631
    } else if (
1632
        pBtLinkInfo->bPanOnly ||
1632
        pBtLinkInfo->bPanOnly ||
1633
        (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist)
1633
        (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist)
1634
    ) { /* PAN(OPP, FTP), HID+PAN(OPP, FTP) */
1634
    ) { /* PAN(OPP, FTP), HID+PAN(OPP, FTP) */
1635
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 3);
1635
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 3);
1636
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1636
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1637
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 3);
1637
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 3);
1638
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1638
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1639
        pCoexDm->bAutoTdmaAdjust = false;
1639
        pCoexDm->bAutoTdmaAdjust = false;
1640
    } else if (
1640
    } else if (
1641
        (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) ||
1641
        (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) ||
1642
        (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist)
1642
        (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist)
1643
    ) { /* A2DP+PAN(OPP, FTP), HID+A2DP+PAN(OPP, FTP) */
1643
    ) { /* A2DP+PAN(OPP, FTP), HID+A2DP+PAN(OPP, FTP) */
1644
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 13);
1644
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 13);
1645
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1645
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1646
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 13);
1646
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 13);
1647
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1647
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1648
        pCoexDm->bAutoTdmaAdjust = false;
1648
        pCoexDm->bAutoTdmaAdjust = false;
1649
    } else {
1649
    } else {
1650
        /* BT no-profile busy (0x9) */
1650
        /* BT no-profile busy (0x9) */
1651
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1651
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1652
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1652
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1653
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1653
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1654
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1654
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1655
        pCoexDm->bAutoTdmaAdjust = false;
1655
        pCoexDm->bAutoTdmaAdjust = false;
1656
    }
1656
    }
1657
}
1657
}
1658
1658
1659
-static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *pBtCoexist)
1659
-static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *pBtCoexist)
1660
+static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *bt_coexist)
1660
+static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *bt_coexist)
1661
{
1661
{
1662
    /* power save state */
1662
    /* power save state */
1663
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1663
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1664
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1664
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1665
1665
1666
    /* tdma and coex table */
1666
    /* tdma and coex table */
1667
-    halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8);
1667
-    halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8);
1668
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0);
1668
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0);
1669
+    halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8);
1669
+    halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8);
1670
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0);
1670
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0);
1671
}
1671
}
1672
1672
1673
static void halbtc8723b1ant_ActionWifiNotConnectedScan(
1673
static void halbtc8723b1ant_ActionWifiNotConnectedScan(
1674
-    struct btc_coexist *pBtCoexist
1674
-    struct btc_coexist *pBtCoexist
1675
+    struct btc_coexist *bt_coexist
1675
+    struct btc_coexist *bt_coexist
1676
)
1676
)
1677
{
1677
{
1678
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1678
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1679
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1679
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1680
1680
1681
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1681
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1682
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1682
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1683
1683
1684
    /* tdma and coex table */
1684
    /* tdma and coex table */
1685
    if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1685
    if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1686
        if (pBtLinkInfo->bA2dpExist) {
1686
        if (pBtLinkInfo->bA2dpExist) {
1687
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1687
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1688
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1688
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1689
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1689
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1690
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1690
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1691
        } else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) {
1691
        } else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) {
1692
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 22);
1692
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 22);
1693
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1693
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1694
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 22);
1694
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 22);
1695
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1695
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1696
        } else {
1696
        } else {
1697
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1697
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1698
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1698
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1699
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1699
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1700
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1700
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1701
        }
1701
        }
1702
    } else if (
1702
    } else if (
1703
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1703
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1704
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1704
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1705
    ) {
1705
    ) {
1706
        halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1706
        halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1707
-            pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1707
-            pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1708
+            bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1708
+            bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1709
        );
1709
        );
1710
    } else {
1710
    } else {
1711
        /* Bryant Add */
1711
        /* Bryant Add */
1712
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1712
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1713
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1713
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1714
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1714
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1715
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1715
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1716
    }
1716
    }
1717
}
1717
}
1718
1718
1719
static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(
1719
static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(
1720
-    struct btc_coexist *pBtCoexist
1720
-    struct btc_coexist *pBtCoexist
1721
+    struct btc_coexist *bt_coexist
1721
+    struct btc_coexist *bt_coexist
1722
)
1722
)
1723
{
1723
{
1724
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1724
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1725
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1725
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1726
1726
1727
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1727
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1728
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1728
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1729
1729
1730
    /* tdma and coex table */
1730
    /* tdma and coex table */
1731
    if (
1731
    if (
1732
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(
1732
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(
1733
        (pBtLinkInfo->bHidExist) ||
1733
        (pBtLinkInfo->bHidExist) ||
1734
        (pBtLinkInfo->bA2dpExist)
1734
        (pBtLinkInfo->bA2dpExist)
1735
    ) {
1735
    ) {
1736
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1736
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1737
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1737
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1738
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1738
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1739
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1739
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1740
    } else if (pBtLinkInfo->bPanExist) {
1740
    } else if (pBtLinkInfo->bPanExist) {
1741
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1741
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1742
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1742
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1743
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1743
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1744
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1744
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1745
    } else {
1745
    } else {
1746
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1746
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1747
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1747
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1748
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1748
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1749
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1749
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1750
    }
1750
    }
1751
}
1751
}
1752
1752
1753
-static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *pBtCoexist)
1753
-static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *pBtCoexist)
1754
+static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *bt_coexist)
1754
+static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *bt_coexist)
1755
{
1755
{
1756
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1756
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1757
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1757
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1758
1758
1759
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1759
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1760
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1760
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1761
1761
1762
    /* tdma and coex table */
1762
    /* tdma and coex table */
1763
    if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1763
    if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1764
        if (pBtLinkInfo->bA2dpExist) {
1764
        if (pBtLinkInfo->bA2dpExist) {
1765
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1765
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1766
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1766
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1767
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1767
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1768
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1768
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1769
        } else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) {
1769
        } else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) {
1770
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 22);
1770
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 22);
1771
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1771
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1772
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 22);
1772
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 22);
1773
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1773
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1774
        } else {
1774
        } else {
1775
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1775
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1776
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1776
-            halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1777
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1777
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1778
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1778
+            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1779
        }
1779
        }
1780
    } else if (
1780
    } else if (
1781
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1781
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1782
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1782
        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1783
    ) {
1783
    ) {
1784
        halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1784
        halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1785
-            pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1785
-            pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1786
+            bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1786
+            bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1787
        );
1787
        );
1788
    } else {
1788
    } else {
1789
        /* Bryant Add */
1789
        /* Bryant Add */
1790
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1790
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1791
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1791
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1792
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1792
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1793
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1793
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1794
    }
1794
    }
1795
}
1795
}
1796
1796
1797
static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket(
1797
static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket(
1798
-    struct btc_coexist *pBtCoexist
1798
-    struct btc_coexist *pBtCoexist
1799
+    struct btc_coexist *bt_coexist
1799
+    struct btc_coexist *bt_coexist
1800
)
1800
)
1801
{
1801
{
1802
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1802
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
1803
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1803
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1804
1804
1805
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1805
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1806
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1806
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1807
1807
1808
    /* tdma and coex table */
1808
    /* tdma and coex table */
1809
    if (
1809
    if (
1810
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket(
1810
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket(
1811
        (pBtLinkInfo->bHidExist) ||
1811
        (pBtLinkInfo->bHidExist) ||
1812
        (pBtLinkInfo->bA2dpExist)
1812
        (pBtLinkInfo->bA2dpExist)
1813
    ) {
1813
    ) {
1814
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1814
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32);
1815
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1815
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1816
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1816
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1817
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1817
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1818
    } else if (pBtLinkInfo->bPanExist) {
1818
    } else if (pBtLinkInfo->bPanExist) {
1819
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1819
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20);
1820
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1820
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4);
1821
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1821
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1822
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1822
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1823
    } else {
1823
    } else {
1824
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1824
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1825
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1825
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1826
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1826
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1827
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1827
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1828
    }
1828
    }
1829
}
1829
}
1830
1830
1831
-static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist)
1831
-static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist)
1832
+static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist)
1832
+static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist)
1833
{
1833
{
1834
-    bool bWifiBusy = false;
1834
-    bool bWifiBusy = false;
1835
+    bool wifi_busy = false;
1835
+    bool wifi_busy = false;
1836
    bool bScan = false, bLink = false, bRoam = false;
1836
    bool bScan = false, bLink = false, bRoam = false;
1837
    bool bUnder4way = false, bApEnable = false;
1837
    bool bUnder4way = false, bApEnable = false;
1838
1838
1839
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way);
1839
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way);
1840
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way);
1840
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way);
1841
    if (bUnder4way) {
1841
    if (bUnder4way) {
1842
-        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist);
1842
-        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist);
1843
+        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist);
1843
+        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist);
1844
        return;
1844
        return;
1845
    }
1845
    }
1846
1846
1847
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan);
1847
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan);
1848
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink);
1848
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink);
1849
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam);
1849
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam);
1850
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_SCAN, &bScan);
1850
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_SCAN, &bScan);
1851
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_LINK, &bLink);
1851
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_LINK, &bLink);
1852
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_ROAM, &bRoam);
1852
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_ROAM, &bRoam);
1853
    if (bScan || bLink || bRoam) {
1853
    if (bScan || bLink || bRoam) {
1854
        if (bScan)
1854
        if (bScan)
1855
-            halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist);
1855
-            halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist);
1856
+            halbtc8723b1ant_ActionWifiConnectedScan(bt_coexist);
1856
+            halbtc8723b1ant_ActionWifiConnectedScan(bt_coexist);
1857
        else
1857
        else
1858
-            halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist);
1858
-            halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist);
1859
+            halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist);
1859
+            halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist);
1860
        return;
1860
        return;
1861
    }
1861
    }
1862
1862
1863
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
1863
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
1864
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
1864
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
1865
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
1865
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable);
1866
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1866
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1867
1867
1868
    /* power save state */
1868
    /* power save state */
1869
    if (
1869
    if (
1870
        !bApEnable &&
1870
        !bApEnable &&
1871
        pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY &&
1871
        pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY &&
1872
-        !pBtCoexist->btLinkInfo.bHidOnly
1872
-        !pBtCoexist->btLinkInfo.bHidOnly
1873
+        !bt_coexist->btLinkInfo.bHidOnly
1873
+        !bt_coexist->btLinkInfo.bHidOnly
1874
    ) {
1874
    ) {
1875
-        if (pBtCoexist->btLinkInfo.bA2dpOnly) { /* A2DP */
1875
-        if (pBtCoexist->btLinkInfo.bA2dpOnly) { /* A2DP */
1876
-            if (!bWifiBusy)
1876
-            if (!bWifiBusy)
1877
+        if (bt_coexist->btLinkInfo.bA2dpOnly) { /* A2DP */
1877
+        if (bt_coexist->btLinkInfo.bA2dpOnly) { /* A2DP */
1878
+            if (!wifi_busy)
1878
+            if (!wifi_busy)
1879
                halbtc8723b1ant_PowerSaveState(
1879
                halbtc8723b1ant_PowerSaveState(
1880
-                    pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1880
-                    pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1881
+                    bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1881
+                    bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1882
                );
1882
                );
1883
            else { /* busy */
1883
            else { /* busy */
1884
                if (pCoexSta->nScanAPNum >= BT_8723B_1ANT_WIFI_NOISY_THRESH) /* no force LPS, no PS-TDMA, use pure TDMA */
1884
                if (pCoexSta->nScanAPNum >= BT_8723B_1ANT_WIFI_NOISY_THRESH) /* no force LPS, no PS-TDMA, use pure TDMA */
1885
                    halbtc8723b1ant_PowerSaveState(
1885
                    halbtc8723b1ant_PowerSaveState(
1886
-                        pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1886
-                        pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1887
+                        bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1887
+                        bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1888
                    );
1888
                    );
1889
                else
1889
                else
1890
                    halbtc8723b1ant_PowerSaveState(
1890
                    halbtc8723b1ant_PowerSaveState(
1891
-                        pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4
1891
-                        pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4
1892
+                        bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4
1892
+                        bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4
1893
                    );
1893
                    );
1894
            }
1894
            }
1895
        } else if (
1895
        } else if (
1896
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist)
1896
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist)
1897
            (!pCoexSta->bA2dpExist) &&
1897
            (!pCoexSta->bA2dpExist) &&
1898
            (!pCoexSta->bHidExist)
1898
            (!pCoexSta->bHidExist)
1899
        )
1899
        )
1900
-            halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1900
-            halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1901
+            halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1901
+            halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1902
        else
1902
        else
1903
-            halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4);
1903
-            halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4);
1904
+            halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4);
1904
+            halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4);
1905
    } else
1905
    } else
1906
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1906
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1907
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1907
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1908
1908
1909
    /* tdma and coex table */
1909
    /* tdma and coex table */
1910
-    if (!bWifiBusy) {
1910
-    if (!bWifiBusy) {
1911
+    if (!wifi_busy) {
1911
+    if (!wifi_busy) {
1912
        if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1912
        if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1913
            halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1913
            halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1914
-                pBtCoexist,
1914
-                pBtCoexist,
1915
+                bt_coexist,
1915
+                bt_coexist,
1916
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE
1916
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE
1917
            );
1917
            );
1918
        } else if (
1918
        } else if (
1919
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1919
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1920
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1920
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1921
        ) {
1921
        ) {
1922
-            halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist,
1922
-            halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist,
1923
+            halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist,
1923
+            halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist,
1924
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE);
1924
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE);
1925
        } else {
1925
        } else {
1926
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1926
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1927
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1927
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1928
1928
1929
            if ((pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60)
1929
            if ((pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60)
1930
-                halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1930
-                halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1931
+                halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1931
+                halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1932
            else
1932
            else
1933
-                halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7);
1933
-                halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7);
1934
+                halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7);
1934
+                halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7);
1935
        }
1935
        }
1936
    } else {
1936
    } else {
1937
        if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1937
        if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1938
            halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1938
            halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1939
-                pBtCoexist,
1939
-                pBtCoexist,
1940
+                bt_coexist,
1940
+                bt_coexist,
1941
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY
1941
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY
1942
            );
1942
            );
1943
        } else if (
1943
        } else if (
1944
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist)
1944
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist)
1945
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1945
            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1946
        ) {
1946
        ) {
1947
            halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1947
            halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1948
-                pBtCoexist,
1948
-                pBtCoexist,
1949
+                bt_coexist,
1949
+                bt_coexist,
1950
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY
1950
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY
1951
            );
1951
            );
1952
        } else {
1952
        } else {
1953
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1953
-            halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8);
1954
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1954
+            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1955
1955
1956
            if ((pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60)
1956
            if ((pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60)
1957
-                halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1957
-                halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
1958
+                halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1958
+                halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
1959
            else
1959
            else
1960
-                halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7);
1960
-                halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7);
1961
+                halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7);
1961
+                halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7);
1962
        }
1962
        }
1963
    }
1963
    }
1964
}
1964
}
1965
1965
1966
-static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist)
1966
-static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist)
1967
+static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *bt_coexist)
1967
+static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *bt_coexist)
1968
{
1968
{
1969
    u8 algorithm = 0;
1969
    u8 algorithm = 0;
1970
1970
1971
-    algorithm = halbtc8723b1ant_ActionAlgorithm(pBtCoexist);
1971
-    algorithm = halbtc8723b1ant_ActionAlgorithm(pBtCoexist);
1972
+    algorithm = halbtc8723b1ant_ActionAlgorithm(bt_coexist);
1972
+    algorithm = halbtc8723b1ant_ActionAlgorithm(bt_coexist);
1973
    pCoexDm->curAlgorithm = algorithm;
1973
    pCoexDm->curAlgorithm = algorithm;
1974
1974
1975
-    if (halbtc8723b1ant_IsCommonAction(pBtCoexist)) {
1975
-    if (halbtc8723b1ant_IsCommonAction(pBtCoexist)) {
1976
+    if (halbtc8723b1ant_IsCommonAction(bt_coexist)) {
1976
+    if (halbtc8723b1ant_IsCommonAction(bt_coexist)) {
1977
1977
1978
    } else {
1978
    } else {
1979
        switch (pCoexDm->curAlgorithm) {
1979
        switch (pCoexDm->curAlgorithm) {
1980
        case BT_8723B_1ANT_COEX_ALGO_SCO:
1980
        case BT_8723B_1ANT_COEX_ALGO_SCO:
1981
-            /* halbtc8723b1ant_ActionSco(pBtCoexist); */
1981
-            /* halbtc8723b1ant_ActionSco(pBtCoexist); */
1982
+            /* halbtc8723b1ant_ActionSco(bt_coexist); */
1982
+            /* halbtc8723b1ant_ActionSco(bt_coexist); */
1983
            break;
1983
            break;
1984
        case BT_8723B_1ANT_COEX_ALGO_HID:
1984
        case BT_8723B_1ANT_COEX_ALGO_HID:
1985
-            /* halbtc8723b1ant_ActionHid(pBtCoexist); */
1985
-            /* halbtc8723b1ant_ActionHid(pBtCoexist); */
1986
+            /* halbtc8723b1ant_ActionHid(bt_coexist); */
1986
+            /* halbtc8723b1ant_ActionHid(bt_coexist); */
1987
            break;
1987
            break;
1988
        case BT_8723B_1ANT_COEX_ALGO_A2DP:
1988
        case BT_8723B_1ANT_COEX_ALGO_A2DP:
1989
-            /* halbtc8723b1ant_ActionA2dp(pBtCoexist); */
1989
-            /* halbtc8723b1ant_ActionA2dp(pBtCoexist); */
1990
+            /* halbtc8723b1ant_ActionA2dp(bt_coexist); */
1990
+            /* halbtc8723b1ant_ActionA2dp(bt_coexist); */
1991
            break;
1991
            break;
1992
        case BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS:
1992
        case BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS:
1993
-            /* halbtc8723b1ant_ActionA2dpPanHs(pBtCoexist); */
1993
-            /* halbtc8723b1ant_ActionA2dpPanHs(pBtCoexist); */
1994
+            /* halbtc8723b1ant_ActionA2dpPanHs(bt_coexist); */
1994
+            /* halbtc8723b1ant_ActionA2dpPanHs(bt_coexist); */
1995
            break;
1995
            break;
1996
        case BT_8723B_1ANT_COEX_ALGO_PANEDR:
1996
        case BT_8723B_1ANT_COEX_ALGO_PANEDR:
1997
-            /* halbtc8723b1ant_ActionPanEdr(pBtCoexist); */
1997
-            /* halbtc8723b1ant_ActionPanEdr(pBtCoexist); */
1998
+            /* halbtc8723b1ant_ActionPanEdr(bt_coexist); */
1998
+            /* halbtc8723b1ant_ActionPanEdr(bt_coexist); */
1999
            break;
1999
            break;
2000
        case BT_8723B_1ANT_COEX_ALGO_PANHS:
2000
        case BT_8723B_1ANT_COEX_ALGO_PANHS:
2001
-            /* halbtc8723b1ant_ActionPanHs(pBtCoexist); */
2001
-            /* halbtc8723b1ant_ActionPanHs(pBtCoexist); */
2002
+            /* halbtc8723b1ant_ActionPanHs(bt_coexist); */
2002
+            /* halbtc8723b1ant_ActionPanHs(bt_coexist); */
2003
            break;
2003
            break;
2004
        case BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP:
2004
        case BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP:
2005
-            /* halbtc8723b1ant_ActionPanEdrA2dp(pBtCoexist); */
2005
-            /* halbtc8723b1ant_ActionPanEdrA2dp(pBtCoexist); */
2006
+            /* halbtc8723b1ant_ActionPanEdrA2dp(bt_coexist); */
2006
+            /* halbtc8723b1ant_ActionPanEdrA2dp(bt_coexist); */
2007
            break;
2007
            break;
2008
        case BT_8723B_1ANT_COEX_ALGO_PANEDR_HID:
2008
        case BT_8723B_1ANT_COEX_ALGO_PANEDR_HID:
2009
-            /* halbtc8723b1ant_ActionPanEdrHid(pBtCoexist); */
2009
-            /* halbtc8723b1ant_ActionPanEdrHid(pBtCoexist); */
2010
+            /* halbtc8723b1ant_ActionPanEdrHid(bt_coexist); */
2010
+            /* halbtc8723b1ant_ActionPanEdrHid(bt_coexist); */
2011
            break;
2011
            break;
2012
        case BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR:
2012
        case BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR:
2013
-            /* halbtc8723b1ant_ActionHidA2dpPanEdr(pBtCoexist); */
2013
-            /* halbtc8723b1ant_ActionHidA2dpPanEdr(pBtCoexist); */
2014
+            /* halbtc8723b1ant_ActionHidA2dpPanEdr(bt_coexist); */
2014
+            /* halbtc8723b1ant_ActionHidA2dpPanEdr(bt_coexist); */
2015
            break;
2015
            break;
2016
        case BT_8723B_1ANT_COEX_ALGO_HID_A2DP:
2016
        case BT_8723B_1ANT_COEX_ALGO_HID_A2DP:
2017
-            /* halbtc8723b1ant_ActionHidA2dp(pBtCoexist); */
2017
-            /* halbtc8723b1ant_ActionHidA2dp(pBtCoexist); */
2018
+            /* halbtc8723b1ant_ActionHidA2dp(bt_coexist); */
2018
+            /* halbtc8723b1ant_ActionHidA2dp(bt_coexist); */
2019
            break;
2019
            break;
2020
        default:
2020
        default:
2021
            break;
2021
            break;
2022
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist
2022
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist
2023
    }
2023
    }
2024
}
2024
}
2025
2025
2026
-static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
2026
-static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
2027
+static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *bt_coexist)
2027
+static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *bt_coexist)
2028
{
2028
{
2029
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
2029
-    struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo;
2030
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
2030
+    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
2031
    bool bWifiConnected = false, bBtHsOn = false;
2031
    bool bWifiConnected = false, bBtHsOn = false;
2032
    bool bIncreaseScanDevNum = false;
2032
    bool bIncreaseScanDevNum = false;
2033
-    bool bBtCtrlAggBufSize = false;
2033
-    bool bBtCtrlAggBufSize = false;
2034
-    u8 aggBufSize = 5;
2034
-    u8 aggBufSize = 5;
2035
+    bool bt_ctrl_agg_buf_size = false;
2035
+    bool bt_ctrl_agg_buf_size = false;
2036
+    u8 agg_buf_size = 5;
2036
+    u8 agg_buf_size = 5;
2037
    u32 wifiLinkStatus = 0;
2037
    u32 wifiLinkStatus = 0;
2038
    u32 numOfWifiLink = 0;
2038
    u32 numOfWifiLink = 0;
2039
2039
2040
-    if (pBtCoexist->bManualControl)
2040
-    if (pBtCoexist->bManualControl)
2041
+    if (bt_coexist->bManualControl)
2041
+    if (bt_coexist->bManualControl)
2042
        return;
2042
        return;
2043
2043
2044
-    if (pBtCoexist->bStopCoexDm)
2044
-    if (pBtCoexist->bStopCoexDm)
2045
+    if (bt_coexist->bStopCoexDm)
2045
+    if (bt_coexist->bStopCoexDm)
2046
        return;
2046
        return;
2047
2047
2048
    if (pCoexSta->bUnderIps)
2048
    if (pCoexSta->bUnderIps)
2049
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
2049
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
2050
        bIncreaseScanDevNum = true;
2050
        bIncreaseScanDevNum = true;
2051
    }
2051
    }
2052
2052
2053
-    pBtCoexist->fBtcSet(
2053
-    pBtCoexist->fBtcSet(
2054
-        pBtCoexist,
2054
-        pBtCoexist,
2055
+    bt_coexist->fBtcSet(
2055
+    bt_coexist->fBtcSet(
2056
+        bt_coexist,
2056
+        bt_coexist,
2057
        BTC_SET_BL_INC_SCAN_DEV_NUM,
2057
        BTC_SET_BL_INC_SCAN_DEV_NUM,
2058
        &bIncreaseScanDevNum
2058
        &bIncreaseScanDevNum
2059
    );
2059
    );
2060
-    pBtCoexist->fBtcGet(
2060
-    pBtCoexist->fBtcGet(
2061
-        pBtCoexist,
2061
-        pBtCoexist,
2062
+    bt_coexist->fBtcGet(
2062
+    bt_coexist->fBtcGet(
2063
+        bt_coexist,
2063
+        bt_coexist,
2064
        BTC_GET_BL_WIFI_CONNECTED,
2064
        BTC_GET_BL_WIFI_CONNECTED,
2065
        &bWifiConnected
2065
        &bWifiConnected
2066
    );
2066
    );
2067
2067
2068
-    pBtCoexist->fBtcGet(
2068
-    pBtCoexist->fBtcGet(
2069
-        pBtCoexist,
2069
-        pBtCoexist,
2070
+    bt_coexist->fBtcGet(
2070
+    bt_coexist->fBtcGet(
2071
+        bt_coexist,
2071
+        bt_coexist,
2072
        BTC_GET_U4_WIFI_LINK_STATUS,
2072
        BTC_GET_U4_WIFI_LINK_STATUS,
2073
        &wifiLinkStatus
2073
        &wifiLinkStatus
2074
    );
2074
    );
2075
    numOfWifiLink = wifiLinkStatus >> 16;
2075
    numOfWifiLink = wifiLinkStatus >> 16;
2076
2076
2077
    if ((numOfWifiLink >= 2) || (wifiLinkStatus & WIFI_P2P_GO_CONNECTED)) {
2077
    if ((numOfWifiLink >= 2) || (wifiLinkStatus & WIFI_P2P_GO_CONNECTED)) {
2078
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2078
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2079
-        halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize);
2079
-        halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize);
2080
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2080
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2081
+        halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size);
2081
+        halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size);
2082
2082
2083
        if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage))
2083
        if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage))
2084
-            halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2084
-            halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2085
+            halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2085
+            halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2086
        else
2086
        else
2087
-            halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);
2087
-            halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);
2088
+            halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
2088
+            halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
2089
2089
2090
        return;
2090
        return;
2091
    }
2091
    }
2092
2092
2093
    if ((pBtLinkInfo->bBtLinkExist) && (bWifiConnected)) {
2093
    if ((pBtLinkInfo->bBtLinkExist) && (bWifiConnected)) {
2094
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 0, 1);
2094
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 0, 1);
2095
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 1, 1, 0, 1);
2095
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 1, 1, 0, 1);
2096
2096
2097
        if (pBtLinkInfo->bScoExist)
2097
        if (pBtLinkInfo->bScoExist)
2098
-            halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, true, 0x5);
2098
-            halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, true, 0x5);
2099
+            halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, true, 0x5);
2099
+            halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, true, 0x5);
2100
        else
2100
        else
2101
-            halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, true, 0x8);
2101
-            halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, true, 0x8);
2102
+            halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, true, 0x8);
2102
+            halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, true, 0x8);
2103
2103
2104
-        halbtc8723b1ant_SwMechanism(pBtCoexist, true);
2104
-        halbtc8723b1ant_SwMechanism(pBtCoexist, true);
2105
-        halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); /* just print debug message */
2105
-        halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); /* just print debug message */
2106
+        halbtc8723b1ant_SwMechanism(bt_coexist, true);
2106
+        halbtc8723b1ant_SwMechanism(bt_coexist, true);
2107
+        halbtc8723b1ant_RunSwCoexistMechanism(bt_coexist); /* just print debug message */
2107
+        halbtc8723b1ant_RunSwCoexistMechanism(bt_coexist); /* just print debug message */
2108
    } else {
2108
    } else {
2109
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2109
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2110
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2110
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2111
2111
2112
-        halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x5);
2112
-        halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x5);
2113
+        halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, false, 0x5);
2113
+        halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, false, 0x5);
2114
2114
2115
-        halbtc8723b1ant_SwMechanism(pBtCoexist, false);
2115
-        halbtc8723b1ant_SwMechanism(pBtCoexist, false);
2116
-        halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); /* just print debug message */
2116
-        halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); /* just print debug message */
2117
+        halbtc8723b1ant_SwMechanism(bt_coexist, false);
2117
+        halbtc8723b1ant_SwMechanism(bt_coexist, false);
2118
+        halbtc8723b1ant_RunSwCoexistMechanism(bt_coexist); /* just print debug message */
2118
+        halbtc8723b1ant_RunSwCoexistMechanism(bt_coexist); /* just print debug message */
2119
    }
2119
    }
2120
2120
2121
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2121
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2122
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2122
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2123
    if (pCoexSta->bC2hBtInquiryPage) {
2123
    if (pCoexSta->bC2hBtInquiryPage) {
2124
-        halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2124
-        halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2125
+        halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2125
+        halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2126
        return;
2126
        return;
2127
    } else if (bBtHsOn) {
2127
    } else if (bBtHsOn) {
2128
-        halbtc8723b1ant_ActionHs(pBtCoexist);
2128
-        halbtc8723b1ant_ActionHs(pBtCoexist);
2129
+        halbtc8723b1ant_ActionHs(bt_coexist);
2129
+        halbtc8723b1ant_ActionHs(bt_coexist);
2130
        return;
2130
        return;
2131
    }
2131
    }
2132
2132
2133
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
2133
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist)
2134
    if (!bWifiConnected) {
2134
    if (!bWifiConnected) {
2135
        bool bScan = false, bLink = false, bRoam = false;
2135
        bool bScan = false, bLink = false, bRoam = false;
2136
2136
2137
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan);
2137
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan);
2138
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink);
2138
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink);
2139
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam);
2139
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam);
2140
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_SCAN, &bScan);
2140
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_SCAN, &bScan);
2141
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_LINK, &bLink);
2141
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_LINK, &bLink);
2142
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_ROAM, &bRoam);
2142
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_ROAM, &bRoam);
2143
2143
2144
        if (bScan || bLink || bRoam) {
2144
        if (bScan || bLink || bRoam) {
2145
            if (bScan)
2145
            if (bScan)
2146
-                halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist);
2146
-                halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist);
2147
+                halbtc8723b1ant_ActionWifiNotConnectedScan(bt_coexist);
2147
+                halbtc8723b1ant_ActionWifiNotConnectedScan(bt_coexist);
2148
            else
2148
            else
2149
-                halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist);
2149
-                halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist);
2150
+                halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(bt_coexist);
2150
+                halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(bt_coexist);
2151
        } else
2151
        } else
2152
-            halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist);
2152
-            halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist);
2153
+            halbtc8723b1ant_ActionWifiNotConnected(bt_coexist);
2153
+            halbtc8723b1ant_ActionWifiNotConnected(bt_coexist);
2154
    } else /* wifi LPS/Busy */
2154
    } else /* wifi LPS/Busy */
2155
-        halbtc8723b1ant_ActionWifiConnected(pBtCoexist);
2155
-        halbtc8723b1ant_ActionWifiConnected(pBtCoexist);
2156
+        halbtc8723b1ant_ActionWifiConnected(bt_coexist);
2156
+        halbtc8723b1ant_ActionWifiConnected(bt_coexist);
2157
}
2157
}
2158
2158
2159
-static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist)
2159
-static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist)
2160
+static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist)
2160
+static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist)
2161
{
2161
{
2162
    /* force to reset coex mechanism */
2162
    /* force to reset coex mechanism */
2163
2163
2164
    /* sw all off */
2164
    /* sw all off */
2165
-    halbtc8723b1ant_SwMechanism(pBtCoexist, false);
2165
-    halbtc8723b1ant_SwMechanism(pBtCoexist, false);
2166
+    halbtc8723b1ant_SwMechanism(bt_coexist, false);
2166
+    halbtc8723b1ant_SwMechanism(bt_coexist, false);
2167
2167
2168
-    /* halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); */
2168
-    /* halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); */
2169
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0);
2169
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0);
2170
+    /* halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); */
2170
+    /* halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); */
2171
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, FORCE_EXEC, 0);
2171
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, FORCE_EXEC, 0);
2172
2172
2173
    pCoexSta->popEventCnt = 0;
2173
    pCoexSta->popEventCnt = 0;
2174
}
2174
}
2175
2175
2176
static void halbtc8723b1ant_InitHwConfig(
2176
static void halbtc8723b1ant_InitHwConfig(
2177
-    struct btc_coexist *pBtCoexist,
2177
-    struct btc_coexist *pBtCoexist,
2178
+    struct btc_coexist *bt_coexist,
2178
+    struct btc_coexist *bt_coexist,
2179
    bool bBackUp,
2179
    bool bBackUp,
2180
    bool bWifiOnly
2180
    bool bWifiOnly
2181
)
2181
)
2182
{
2182
{
2183
-    pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */
2183
-    pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */
2184
+    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */
2184
+    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */
2185
2185
2186
    /* 0x790[5:0]= 0x5 */
2186
    /* 0x790[5:0]= 0x5 */
2187
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x790, 0x5);
2187
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x790, 0x5);
2188
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x790, 0x5);
2188
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x790, 0x5);
2189
2189
2190
    /* Enable counter statistics */
2190
    /* Enable counter statistics */
2191
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x1);
2191
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x1);
2192
-    pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1);
2192
-    pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1);
2193
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x778, 0x1);
2193
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x778, 0x1);
2194
+    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x40, 0x20, 0x1);
2194
+    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x40, 0x20, 0x1);
2195
2195
2196
    /* Antenna config */
2196
    /* Antenna config */
2197
    if (bWifiOnly) {
2197
    if (bWifiOnly) {
2198
-        halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_WIFI, true, false);
2198
-        halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_WIFI, true, false);
2199
-        halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 9);
2199
-        halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 9);
2200
+        halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_WIFI, true, false);
2200
+        halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_WIFI, true, false);
2201
+        halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 9);
2201
+        halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 9);
2202
    } else
2202
    } else
2203
-        halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, true, false);
2203
-        halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, true, false);
2204
+        halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, true, false);
2204
+        halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, true, false);
2205
2205
2206
    /* PTA parameter */
2206
    /* PTA parameter */
2207
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0);
2207
-    halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0);
2208
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, FORCE_EXEC, 0);
2208
+    halbtc8723b1ant_CoexTableWithType(bt_coexist, FORCE_EXEC, 0);
2209
2209
2210
-    pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948);
2210
-    pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948);
2211
-    pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765);
2211
-    pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765);
2212
-    pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67);
2212
-    pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67);
2213
+    bt_coexist->fBtcRead4Byte(bt_coexist, 0x948);
2213
+    bt_coexist->fBtcRead4Byte(bt_coexist, 0x948);
2214
+    bt_coexist->fBtcRead1Byte(bt_coexist, 0x765);
2214
+    bt_coexist->fBtcRead1Byte(bt_coexist, 0x765);
2215
+    bt_coexist->fBtcRead1Byte(bt_coexist, 0x67);
2215
+    bt_coexist->fBtcRead1Byte(bt_coexist, 0x67);
2216
}
2216
}
2217
2217
2218
/* */
2218
/* */
2219
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_InitHwConfig(
2219
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_InitHwConfig(
2220
/* */
2220
/* */
2221
/* extern function start with EXhalbtc8723b1ant_ */
2221
/* extern function start with EXhalbtc8723b1ant_ */
2222
/* */
2222
/* */
2223
-void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist)
2223
-void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist)
2224
+void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *bt_coexist)
2224
+void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *bt_coexist)
2225
{
2225
{
2226
-    struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo;
2226
-    struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo;
2227
+    struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo;
2227
+    struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo;
2228
    u8 u1Tmp = 0x0;
2228
    u8 u1Tmp = 0x0;
2229
    u16 u2Tmp = 0x0;
2229
    u16 u2Tmp = 0x0;
2230
2230
2231
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x67, 0x20);
2231
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x67, 0x20);
2232
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x67, 0x20);
2232
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x67, 0x20);
2233
2233
2234
    /* enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. */
2234
    /* enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. */
2235
-    u2Tmp = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x2);
2235
-    u2Tmp = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x2);
2236
-    pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp | BIT0 | BIT1);
2236
-    pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp | BIT0 | BIT1);
2237
+    u2Tmp = bt_coexist->fBtcRead2Byte(bt_coexist, 0x2);
2237
+    u2Tmp = bt_coexist->fBtcRead2Byte(bt_coexist, 0x2);
2238
+    bt_coexist->fBtcWrite2Byte(bt_coexist, 0x2, u2Tmp | BIT0 | BIT1);
2238
+    bt_coexist->fBtcWrite2Byte(bt_coexist, 0x2, u2Tmp | BIT0 | BIT1);
2239
2239
2240
    /* set GRAN_BT = 1 */
2240
    /* set GRAN_BT = 1 */
2241
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18);
2241
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18);
2242
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18);
2242
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18);
2243
    /* set WLAN_ACT = 0 */
2243
    /* set WLAN_ACT = 0 */
2244
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4);
2244
-    pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4);
2245
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4);
2245
+    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4);
2246
2246
2247
    /* */
2247
    /* */
2248
    /* S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) */
2248
    /* S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) */
2249
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist)
2249
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist)
2250
    /*    BIT1: "0" for internal switch; "1" for external switch */
2250
    /*    BIT1: "0" for internal switch; "1" for external switch */
2251
    /*    BIT2: "0" for one antenna; "1" for two antenna */
2251
    /*    BIT2: "0" for one antenna; "1" for two antenna */
2252
    /* NOTE: here default all internal switch and 1-antenna ==> BIT1 = 0 and BIT2 = 0 */
2252
    /* NOTE: here default all internal switch and 1-antenna ==> BIT1 = 0 and BIT2 = 0 */
2253
-    if (pBtCoexist->chipInterface == BTC_INTF_USB) {
2253
-    if (pBtCoexist->chipInterface == BTC_INTF_USB) {
2254
+    if (bt_coexist->chipInterface == BTC_INTF_USB) {
2254
+    if (bt_coexist->chipInterface == BTC_INTF_USB) {
2255
        /* fixed at S0 for USB interface */
2255
        /* fixed at S0 for USB interface */
2256
-        pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0);
2256
-        pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0);
2257
+        bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0);
2257
+        bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0);
2258
2258
2259
        u1Tmp |= 0x1;    /* antenna inverse */
2259
        u1Tmp |= 0x1;    /* antenna inverse */
2260
-        pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0xfe08, u1Tmp);
2260
-        pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0xfe08, u1Tmp);
2261
+        bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0xfe08, u1Tmp);
2261
+        bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0xfe08, u1Tmp);
2262
2262
2263
        pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT;
2263
        pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT;
2264
    } else {
2264
    } else {
2265
        /* for PCIE and SDIO interface, we check efuse 0xc3[6] */
2265
        /* for PCIE and SDIO interface, we check efuse 0xc3[6] */
2266
        if (pBoardInfo->singleAntPath == 0) {
2266
        if (pBoardInfo->singleAntPath == 0) {
2267
            /* set to S1 */
2267
            /* set to S1 */
2268
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280);
2268
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280);
2269
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280);
2269
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280);
2270
            pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT;
2270
            pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT;
2271
        } else if (pBoardInfo->singleAntPath == 1) {
2271
        } else if (pBoardInfo->singleAntPath == 1) {
2272
            /* set to S0 */
2272
            /* set to S0 */
2273
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0);
2273
-            pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0);
2274
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0);
2274
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0);
2275
            u1Tmp |= 0x1;    /* antenna inverse */
2275
            u1Tmp |= 0x1;    /* antenna inverse */
2276
            pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT;
2276
            pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT;
2277
        }
2277
        }
2278
2278
2279
-        if (pBtCoexist->chipInterface == BTC_INTF_PCI)
2279
-        if (pBtCoexist->chipInterface == BTC_INTF_PCI)
2280
-            pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x384, u1Tmp);
2280
-            pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x384, u1Tmp);
2281
-        else if (pBtCoexist->chipInterface == BTC_INTF_SDIO)
2281
-        else if (pBtCoexist->chipInterface == BTC_INTF_SDIO)
2282
-            pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x60, u1Tmp);
2282
-            pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x60, u1Tmp);
2283
+        if (bt_coexist->chipInterface == BTC_INTF_PCI)
2283
+        if (bt_coexist->chipInterface == BTC_INTF_PCI)
2284
+            bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0x384, u1Tmp);
2284
+            bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0x384, u1Tmp);
2285
+        else if (bt_coexist->chipInterface == BTC_INTF_SDIO)
2285
+        else if (bt_coexist->chipInterface == BTC_INTF_SDIO)
2286
+            bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0x60, u1Tmp);
2286
+            bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0x60, u1Tmp);
2287
    }
2287
    }
2288
}
2288
}
2289
2289
2290
-void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOnly)
2290
-void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOnly)
2291
+void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *bt_coexist, bool bWifiOnly)
2291
+void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *bt_coexist, bool bWifiOnly)
2292
{
2292
{
2293
-    halbtc8723b1ant_InitHwConfig(pBtCoexist, true, bWifiOnly);
2293
-    halbtc8723b1ant_InitHwConfig(pBtCoexist, true, bWifiOnly);
2294
+    halbtc8723b1ant_InitHwConfig(bt_coexist, true, bWifiOnly);
2294
+    halbtc8723b1ant_InitHwConfig(bt_coexist, true, bWifiOnly);
2295
}
2295
}
2296
2296
2297
-void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist)
2297
-void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist)
2298
+void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist)
2298
+void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist)
2299
{
2299
{
2300
-    pBtCoexist->bStopCoexDm = false;
2300
-    pBtCoexist->bStopCoexDm = false;
2301
+    bt_coexist->bStopCoexDm = false;
2301
+    bt_coexist->bStopCoexDm = false;
2302
2302
2303
-    halbtc8723b1ant_InitCoexDm(pBtCoexist);
2303
-    halbtc8723b1ant_InitCoexDm(pBtCoexist);
2304
+    halbtc8723b1ant_InitCoexDm(bt_coexist);
2304
+    halbtc8723b1ant_InitCoexDm(bt_coexist);
2305
2305
2306
-    halbtc8723b1ant_QueryBtInfo(pBtCoexist);
2306
-    halbtc8723b1ant_QueryBtInfo(pBtCoexist);
2307
+    halbtc8723b1ant_QueryBtInfo(bt_coexist);
2307
+    halbtc8723b1ant_QueryBtInfo(bt_coexist);
2308
}
2308
}
2309
2309
2310
-void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type)
2310
-void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type)
2311
+void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *bt_coexist, u8 type)
2311
+void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *bt_coexist, u8 type)
2312
{
2312
{
2313
-    if (pBtCoexist->bManualControl ||    pBtCoexist->bStopCoexDm)
2313
-    if (pBtCoexist->bManualControl ||    pBtCoexist->bStopCoexDm)
2314
+    if (bt_coexist->bManualControl ||    bt_coexist->bStopCoexDm)
2314
+    if (bt_coexist->bManualControl ||    bt_coexist->bStopCoexDm)
2315
        return;
2315
        return;
2316
2316
2317
    if (type == BTC_IPS_ENTER) {
2317
    if (type == BTC_IPS_ENTER) {
2318
        pCoexSta->bUnderIps = true;
2318
        pCoexSta->bUnderIps = true;
2319
2319
2320
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0);
2320
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0);
2321
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0);
2321
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0);
2322
-        halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true);
2322
-        halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true);
2323
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0);
2323
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0);
2324
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0);
2324
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0);
2325
+        halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true);
2325
+        halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true);
2326
    } else if (type == BTC_IPS_LEAVE) {
2326
    } else if (type == BTC_IPS_LEAVE) {
2327
        pCoexSta->bUnderIps = false;
2327
        pCoexSta->bUnderIps = false;
2328
2328
2329
-        halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false);
2329
-        halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false);
2330
-        halbtc8723b1ant_InitCoexDm(pBtCoexist);
2330
-        halbtc8723b1ant_InitCoexDm(pBtCoexist);
2331
-        halbtc8723b1ant_QueryBtInfo(pBtCoexist);
2331
-        halbtc8723b1ant_QueryBtInfo(pBtCoexist);
2332
+        halbtc8723b1ant_InitHwConfig(bt_coexist, false, false);
2332
+        halbtc8723b1ant_InitHwConfig(bt_coexist, false, false);
2333
+        halbtc8723b1ant_InitCoexDm(bt_coexist);
2333
+        halbtc8723b1ant_InitCoexDm(bt_coexist);
2334
+        halbtc8723b1ant_QueryBtInfo(bt_coexist);
2334
+        halbtc8723b1ant_QueryBtInfo(bt_coexist);
2335
    }
2335
    }
2336
}
2336
}
2337
2337
2338
-void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
2338
-void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
2339
+void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *bt_coexist, u8 type)
2339
+void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *bt_coexist, u8 type)
2340
{
2340
{
2341
-    if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm)
2341
-    if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm)
2342
+    if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm)
2342
+    if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm)
2343
        return;
2343
        return;
2344
2344
2345
    if (type == BTC_LPS_ENABLE)
2345
    if (type == BTC_LPS_ENABLE)
2346
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
2346
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
2347
        pCoexSta->bUnderLps = false;
2347
        pCoexSta->bUnderLps = false;
2348
}
2348
}
2349
2349
2350
-void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type)
2350
-void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type)
2351
+void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *bt_coexist, u8 type)
2351
+void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *bt_coexist, u8 type)
2352
{
2352
{
2353
    bool bWifiConnected = false, bBtHsOn = false;
2353
    bool bWifiConnected = false, bBtHsOn = false;
2354
    u32 wifiLinkStatus = 0;
2354
    u32 wifiLinkStatus = 0;
2355
    u32 numOfWifiLink = 0;
2355
    u32 numOfWifiLink = 0;
2356
-    bool bBtCtrlAggBufSize = false;
2356
-    bool bBtCtrlAggBufSize = false;
2357
-    u8 aggBufSize = 5;
2357
-    u8 aggBufSize = 5;
2358
+    bool bt_ctrl_agg_buf_size = false;
2358
+    bool bt_ctrl_agg_buf_size = false;
2359
+    u8 agg_buf_size = 5;
2359
+    u8 agg_buf_size = 5;
2360
2360
2361
-    if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm)
2361
-    if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm)
2362
+    if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm)
2362
+    if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm)
2363
        return;
2363
        return;
2364
2364
2365
    if (type == BTC_SCAN_START) {
2365
    if (type == BTC_SCAN_START) {
2366
        pCoexSta->bWiFiIsHighPriTask = true;
2366
        pCoexSta->bWiFiIsHighPriTask = true;
2367
2367
2368
-        halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */
2368
-        halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */
2369
-        pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948);
2369
-        pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948);
2370
-        pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765);
2370
-        pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765);
2371
-        pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67);
2371
-        pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67);
2372
+        halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */
2372
+        halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */
2373
+        bt_coexist->fBtcRead4Byte(bt_coexist, 0x948);
2373
+        bt_coexist->fBtcRead4Byte(bt_coexist, 0x948);
2374
+        bt_coexist->fBtcRead1Byte(bt_coexist, 0x765);
2374
+        bt_coexist->fBtcRead1Byte(bt_coexist, 0x765);
2375
+        bt_coexist->fBtcRead1Byte(bt_coexist, 0x67);
2375
+        bt_coexist->fBtcRead1Byte(bt_coexist, 0x67);
2376
    } else {
2376
    } else {
2377
        pCoexSta->bWiFiIsHighPriTask = false;
2377
        pCoexSta->bWiFiIsHighPriTask = false;
2378
2378
2379
-        pBtCoexist->fBtcGet(
2379
-        pBtCoexist->fBtcGet(
2380
-            pBtCoexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum
2380
-            pBtCoexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum
2381
+        bt_coexist->fBtcGet(
2381
+        bt_coexist->fBtcGet(
2382
+            bt_coexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum
2382
+            bt_coexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum
2383
        );
2383
        );
2384
    }
2384
    }
2385
2385
2386
-    if (pBtCoexist->btInfo.bBtDisabled)
2386
-    if (pBtCoexist->btInfo.bBtDisabled)
2387
+    if (bt_coexist->btInfo.bBtDisabled)
2387
+    if (bt_coexist->btInfo.bBtDisabled)
2388
        return;
2388
        return;
2389
2389
2390
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2390
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2391
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2391
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2392
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2392
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2393
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2393
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2394
2394
2395
-    halbtc8723b1ant_QueryBtInfo(pBtCoexist);
2395
-    halbtc8723b1ant_QueryBtInfo(pBtCoexist);
2396
+    halbtc8723b1ant_QueryBtInfo(bt_coexist);
2396
+    halbtc8723b1ant_QueryBtInfo(bt_coexist);
2397
2397
2398
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
2398
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
2399
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
2399
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
2400
    numOfWifiLink = wifiLinkStatus >> 16;
2400
    numOfWifiLink = wifiLinkStatus >> 16;
2401
2401
2402
    if (numOfWifiLink >= 2) {
2402
    if (numOfWifiLink >= 2) {
2403
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2403
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2404
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2404
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2405
        halbtc8723b1ant_LimitedRx(
2405
        halbtc8723b1ant_LimitedRx(
2406
-            pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize
2406
-            pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize
2407
+            bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size
2407
+            bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size
2408
        );
2408
        );
2409
-        halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);
2409
-        halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);
2410
+        halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
2410
+        halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
2411
        return;
2411
        return;
2412
    }
2412
    }
2413
2413
2414
    if (pCoexSta->bC2hBtInquiryPage) {
2414
    if (pCoexSta->bC2hBtInquiryPage) {
2415
-        halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2415
-        halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2416
+        halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2416
+        halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2417
        return;
2417
        return;
2418
    } else if (bBtHsOn) {
2418
    } else if (bBtHsOn) {
2419
-        halbtc8723b1ant_ActionHs(pBtCoexist);
2419
-        halbtc8723b1ant_ActionHs(pBtCoexist);
2420
+        halbtc8723b1ant_ActionHs(bt_coexist);
2420
+        halbtc8723b1ant_ActionHs(bt_coexist);
2421
        return;
2421
        return;
2422
    }
2422
    }
2423
2423
2424
    if (type == BTC_SCAN_START) {
2424
    if (type == BTC_SCAN_START) {
2425
        if (!bWifiConnected)    /* non-connected scan */
2425
        if (!bWifiConnected)    /* non-connected scan */
2426
-            halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist);
2426
-            halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist);
2427
+            halbtc8723b1ant_ActionWifiNotConnectedScan(bt_coexist);
2427
+            halbtc8723b1ant_ActionWifiNotConnectedScan(bt_coexist);
2428
        else    /* wifi is connected */
2428
        else    /* wifi is connected */
2429
-            halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist);
2429
-            halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist);
2430
+            halbtc8723b1ant_ActionWifiConnectedScan(bt_coexist);
2430
+            halbtc8723b1ant_ActionWifiConnectedScan(bt_coexist);
2431
    } else if (type == BTC_SCAN_FINISH) {
2431
    } else if (type == BTC_SCAN_FINISH) {
2432
        if (!bWifiConnected)    /* non-connected scan */
2432
        if (!bWifiConnected)    /* non-connected scan */
2433
-            halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist);
2433
-            halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist);
2434
+            halbtc8723b1ant_ActionWifiNotConnected(bt_coexist);
2434
+            halbtc8723b1ant_ActionWifiNotConnected(bt_coexist);
2435
        else
2435
        else
2436
-            halbtc8723b1ant_ActionWifiConnected(pBtCoexist);
2436
-            halbtc8723b1ant_ActionWifiConnected(pBtCoexist);
2437
+            halbtc8723b1ant_ActionWifiConnected(bt_coexist);
2437
+            halbtc8723b1ant_ActionWifiConnected(bt_coexist);
2438
    }
2438
    }
2439
}
2439
}
2440
2440
2441
-void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type)
2441
-void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type)
2442
+void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *bt_coexist, u8 type)
2442
+void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *bt_coexist, u8 type)
2443
{
2443
{
2444
    bool bWifiConnected = false, bBtHsOn = false;
2444
    bool bWifiConnected = false, bBtHsOn = false;
2445
    u32 wifiLinkStatus = 0;
2445
    u32 wifiLinkStatus = 0;
2446
    u32 numOfWifiLink = 0;
2446
    u32 numOfWifiLink = 0;
2447
-    bool bBtCtrlAggBufSize = false;
2447
-    bool bBtCtrlAggBufSize = false;
2448
-    u8 aggBufSize = 5;
2448
-    u8 aggBufSize = 5;
2449
+    bool bt_ctrl_agg_buf_size = false;
2449
+    bool bt_ctrl_agg_buf_size = false;
2450
+    u8 agg_buf_size = 5;
2450
+    u8 agg_buf_size = 5;
2451
2451
2452
    if (
2452
    if (
2453
-        pBtCoexist->bManualControl ||
2453
-        pBtCoexist->bManualControl ||
2454
-        pBtCoexist->bStopCoexDm ||
2454
-        pBtCoexist->bStopCoexDm ||
2455
-        pBtCoexist->btInfo.bBtDisabled
2455
-        pBtCoexist->btInfo.bBtDisabled
2456
+        bt_coexist->bManualControl ||
2456
+        bt_coexist->bManualControl ||
2457
+        bt_coexist->bStopCoexDm ||
2457
+        bt_coexist->bStopCoexDm ||
2458
+        bt_coexist->btInfo.bBtDisabled
2458
+        bt_coexist->btInfo.bBtDisabled
2459
    )
2459
    )
2460
        return;
2460
        return;
2461
2461
2462
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type)
2462
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type)
2463
        /* pCoexDm->nArpCnt = 0; */
2463
        /* pCoexDm->nArpCnt = 0; */
2464
    }
2464
    }
2465
2465
2466
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
2466
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
2467
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
2467
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
2468
    numOfWifiLink = wifiLinkStatus >> 16;
2468
    numOfWifiLink = wifiLinkStatus >> 16;
2469
    if (numOfWifiLink >= 2) {
2469
    if (numOfWifiLink >= 2) {
2470
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2470
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2471
-        halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize);
2471
-        halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize);
2472
-        halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);
2472
-        halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);
2473
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2473
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2474
+        halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size);
2474
+        halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size);
2475
+        halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
2475
+        halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
2476
        return;
2476
        return;
2477
    }
2477
    }
2478
2478
2479
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2479
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2480
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2480
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2481
    if (pCoexSta->bC2hBtInquiryPage) {
2481
    if (pCoexSta->bC2hBtInquiryPage) {
2482
-        halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2482
-        halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2483
+        halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2483
+        halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2484
        return;
2484
        return;
2485
    } else if (bBtHsOn) {
2485
    } else if (bBtHsOn) {
2486
-        halbtc8723b1ant_ActionHs(pBtCoexist);
2486
-        halbtc8723b1ant_ActionHs(pBtCoexist);
2487
+        halbtc8723b1ant_ActionHs(bt_coexist);
2487
+        halbtc8723b1ant_ActionHs(bt_coexist);
2488
        return;
2488
        return;
2489
    }
2489
    }
2490
2490
2491
    if (type == BTC_ASSOCIATE_START) {
2491
    if (type == BTC_ASSOCIATE_START) {
2492
-        halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist);
2492
-        halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist);
2493
+        halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(bt_coexist);
2493
+        halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(bt_coexist);
2494
    } else if (type == BTC_ASSOCIATE_FINISH) {
2494
    } else if (type == BTC_ASSOCIATE_FINISH) {
2495
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2495
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2496
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2496
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2497
        if (!bWifiConnected) /* non-connected scan */
2497
        if (!bWifiConnected) /* non-connected scan */
2498
-            halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist);
2498
-            halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist);
2499
+            halbtc8723b1ant_ActionWifiNotConnected(bt_coexist);
2499
+            halbtc8723b1ant_ActionWifiNotConnected(bt_coexist);
2500
        else
2500
        else
2501
-            halbtc8723b1ant_ActionWifiConnected(pBtCoexist);
2501
-            halbtc8723b1ant_ActionWifiConnected(pBtCoexist);
2502
+            halbtc8723b1ant_ActionWifiConnected(bt_coexist);
2502
+            halbtc8723b1ant_ActionWifiConnected(bt_coexist);
2503
    }
2503
    }
2504
}
2504
}
2505
2505
2506
-void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type)
2506
-void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type)
2507
+void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *bt_coexist, u8 type)
2507
+void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *bt_coexist, u8 type)
2508
{
2508
{
2509
    u8 H2C_Parameter[3] = {0};
2509
    u8 H2C_Parameter[3] = {0};
2510
    u32 wifiBw;
2510
    u32 wifiBw;
2511
    u8 wifiCentralChnl;
2511
    u8 wifiCentralChnl;
2512
-    bool bWifiUnderBMode = false;
2512
-    bool bWifiUnderBMode = false;
2513
+    bool wifi_under_b_mode = false;
2513
+    bool wifi_under_b_mode = false;
2514
2514
2515
    if (
2515
    if (
2516
-        pBtCoexist->bManualControl ||
2516
-        pBtCoexist->bManualControl ||
2517
-        pBtCoexist->bStopCoexDm ||
2517
-        pBtCoexist->bStopCoexDm ||
2518
-        pBtCoexist->btInfo.bBtDisabled
2518
-        pBtCoexist->btInfo.bBtDisabled
2519
+        bt_coexist->bManualControl ||
2519
+        bt_coexist->bManualControl ||
2520
+        bt_coexist->bStopCoexDm ||
2520
+        bt_coexist->bStopCoexDm ||
2521
+        bt_coexist->btInfo.bBtDisabled
2521
+        bt_coexist->btInfo.bBtDisabled
2522
    )
2522
    )
2523
        return;
2523
        return;
2524
2524
2525
    if (type == BTC_MEDIA_CONNECT) {
2525
    if (type == BTC_MEDIA_CONNECT) {
2526
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode);
2526
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode);
2527
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode);
2527
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode);
2528
2528
2529
        /* Set CCK Tx/Rx high Pri except 11b mode */
2529
        /* Set CCK Tx/Rx high Pri except 11b mode */
2530
-        if (bWifiUnderBMode) {
2530
-        if (bWifiUnderBMode) {
2531
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x00); /* CCK Tx */
2531
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x00); /* CCK Tx */
2532
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x00); /* CCK Rx */
2532
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x00); /* CCK Rx */
2533
+        if (wifi_under_b_mode) {
2533
+        if (wifi_under_b_mode) {
2534
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x00); /* CCK Tx */
2534
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x00); /* CCK Tx */
2535
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x00); /* CCK Rx */
2535
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x00); /* CCK Rx */
2536
        } else {
2536
        } else {
2537
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x10); /* CCK Tx */
2537
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x10); /* CCK Tx */
2538
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x10); /* CCK Rx */
2538
-            pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x10); /* CCK Rx */
2539
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x10); /* CCK Tx */
2539
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x10); /* CCK Tx */
2540
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x10); /* CCK Rx */
2540
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x10); /* CCK Rx */
2541
        }
2541
        }
2542
2542
2543
-        pCoexDm->backupArfrCnt1 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430);
2543
-        pCoexDm->backupArfrCnt1 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430);
2544
-        pCoexDm->backupArfrCnt2 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x434);
2544
-        pCoexDm->backupArfrCnt2 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x434);
2545
-        pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a);
2545
-        pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a);
2546
-        pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456);
2546
-        pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456);
2547
+        pCoexDm->backupArfrCnt1 = bt_coexist->fBtcRead4Byte(bt_coexist, 0x430);
2547
+        pCoexDm->backupArfrCnt1 = bt_coexist->fBtcRead4Byte(bt_coexist, 0x430);
2548
+        pCoexDm->backupArfrCnt2 = bt_coexist->fBtcRead4Byte(bt_coexist, 0x434);
2548
+        pCoexDm->backupArfrCnt2 = bt_coexist->fBtcRead4Byte(bt_coexist, 0x434);
2549
+        pCoexDm->backupRetryLimit = bt_coexist->fBtcRead2Byte(bt_coexist, 0x42a);
2549
+        pCoexDm->backupRetryLimit = bt_coexist->fBtcRead2Byte(bt_coexist, 0x42a);
2550
+        pCoexDm->backupAmpduMaxTime = bt_coexist->fBtcRead1Byte(bt_coexist, 0x456);
2550
+        pCoexDm->backupAmpduMaxTime = bt_coexist->fBtcRead1Byte(bt_coexist, 0x456);
2551
    } else {
2551
    } else {
2552
        pCoexDm->nArpCnt = 0;
2552
        pCoexDm->nArpCnt = 0;
2553
2553
2554
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x0); /* CCK Tx */
2554
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x0); /* CCK Tx */
2555
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x0); /* CCK Rx */
2555
-        pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x0); /* CCK Rx */
2556
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x0); /* CCK Tx */
2556
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x0); /* CCK Tx */
2557
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x0); /* CCK Rx */
2557
+        bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x0); /* CCK Rx */
2558
    }
2558
    }
2559
2559
2560
    /* only 2.4G we need to inform bt the chnl mask */
2560
    /* only 2.4G we need to inform bt the chnl mask */
2561
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl);
2561
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl);
2562
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl);
2562
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl);
2563
    if ((type == BTC_MEDIA_CONNECT) && (wifiCentralChnl <= 14)) {
2563
    if ((type == BTC_MEDIA_CONNECT) && (wifiCentralChnl <= 14)) {
2564
        /* H2C_Parameter[0] = 0x1; */
2564
        /* H2C_Parameter[0] = 0x1; */
2565
        H2C_Parameter[0] = 0x0;
2565
        H2C_Parameter[0] = 0x0;
2566
        H2C_Parameter[1] = wifiCentralChnl;
2566
        H2C_Parameter[1] = wifiCentralChnl;
2567
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw);
2567
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw);
2568
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_BW, &wifiBw);
2568
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_BW, &wifiBw);
2569
2569
2570
        if (wifiBw == BTC_WIFI_BW_HT40)
2570
        if (wifiBw == BTC_WIFI_BW_HT40)
2571
            H2C_Parameter[2] = 0x30;
2571
            H2C_Parameter[2] = 0x30;
2572
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type
2572
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type
2573
    pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1];
2573
    pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1];
2574
    pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2];
2574
    pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2];
2575
2575
2576
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter);
2576
-    pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter);
2577
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x66, 3, H2C_Parameter);
2577
+    bt_coexist->fBtcFillH2c(bt_coexist, 0x66, 3, H2C_Parameter);
2578
}
2578
}
2579
2579
2580
-void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 type)
2580
-void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 type)
2581
+void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 type)
2581
+void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 type)
2582
{
2582
{
2583
    bool bBtHsOn = false;
2583
    bool bBtHsOn = false;
2584
    u32 wifiLinkStatus = 0;
2584
    u32 wifiLinkStatus = 0;
2585
    u32 numOfWifiLink = 0;
2585
    u32 numOfWifiLink = 0;
2586
-    bool bBtCtrlAggBufSize = false;
2586
-    bool bBtCtrlAggBufSize = false;
2587
-    u8 aggBufSize = 5;
2587
-    u8 aggBufSize = 5;
2588
+    bool bt_ctrl_agg_buf_size = false;
2588
+    bool bt_ctrl_agg_buf_size = false;
2589
+    u8 agg_buf_size = 5;
2589
+    u8 agg_buf_size = 5;
2590
2590
2591
    if (
2591
    if (
2592
-        pBtCoexist->bManualControl ||
2592
-        pBtCoexist->bManualControl ||
2593
-        pBtCoexist->bStopCoexDm ||
2593
-        pBtCoexist->bStopCoexDm ||
2594
-        pBtCoexist->btInfo.bBtDisabled
2594
-        pBtCoexist->btInfo.bBtDisabled
2595
+        bt_coexist->bManualControl ||
2595
+        bt_coexist->bManualControl ||
2596
+        bt_coexist->bStopCoexDm ||
2596
+        bt_coexist->bStopCoexDm ||
2597
+        bt_coexist->btInfo.bBtDisabled
2597
+        bt_coexist->btInfo.bBtDisabled
2598
    )
2598
    )
2599
        return;
2599
        return;
2600
2600
2601
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty
2601
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty
2602
        if (type == BTC_PACKET_ARP) {
2602
        if (type == BTC_PACKET_ARP) {
2603
            pCoexDm->nArpCnt++;
2603
            pCoexDm->nArpCnt++;
2604
2604
2605
-            if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) */
2605
-            if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) */
2606
+            if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(bt_coexist) */
2606
+            if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(bt_coexist) */
2607
                pCoexSta->bWiFiIsHighPriTask = false;
2607
                pCoexSta->bWiFiIsHighPriTask = false;
2608
            else
2608
            else
2609
                pCoexSta->bWiFiIsHighPriTask = true;
2609
                pCoexSta->bWiFiIsHighPriTask = true;
2610
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty
2610
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty
2611
2611
2612
    pCoexSta->specialPktPeriodCnt = 0;
2612
    pCoexSta->specialPktPeriodCnt = 0;
2613
2613
2614
-    pBtCoexist->fBtcGet(
2614
-    pBtCoexist->fBtcGet(
2615
-        pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus
2615
-        pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus
2616
+    bt_coexist->fBtcGet(
2616
+    bt_coexist->fBtcGet(
2617
+        bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus
2617
+        bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus
2618
    );
2618
    );
2619
    numOfWifiLink = wifiLinkStatus >> 16;
2619
    numOfWifiLink = wifiLinkStatus >> 16;
2620
2620
2621
    if (numOfWifiLink >= 2) {
2621
    if (numOfWifiLink >= 2) {
2622
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2622
-        halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0);
2623
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2623
+        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
2624
        halbtc8723b1ant_LimitedRx(
2624
        halbtc8723b1ant_LimitedRx(
2625
-            pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize
2625
-            pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize
2626
+            bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size
2626
+            bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size
2627
        );
2627
        );
2628
-        halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);
2628
-        halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist);
2629
+        halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
2629
+        halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
2630
        return;
2630
        return;
2631
    }
2631
    }
2632
2632
2633
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2633
-    pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2634
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2634
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
2635
    if (pCoexSta->bC2hBtInquiryPage) {
2635
    if (pCoexSta->bC2hBtInquiryPage) {
2636
-        halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2636
-        halbtc8723b1ant_ActionBtInquiry(pBtCoexist);
2637
+        halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2637
+        halbtc8723b1ant_ActionBtInquiry(bt_coexist);
2638
        return;
2638
        return;
2639
    } else if (bBtHsOn) {
2639
    } else if (bBtHsOn) {
2640
-        halbtc8723b1ant_ActionHs(pBtCoexist);
2640
-        halbtc8723b1ant_ActionHs(pBtCoexist);
2641
+        halbtc8723b1ant_ActionHs(bt_coexist);
2641
+        halbtc8723b1ant_ActionHs(bt_coexist);
2642
        return;
2642
        return;
2643
    }
2643
    }
2644
2644
2645
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty
2645
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty
2646
        type == BTC_PACKET_EAPOL ||
2646
        type == BTC_PACKET_EAPOL ||
2647
        ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask))
2647
        ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask))
2648
    )
2648
    )
2649
-        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist);
2649
-        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist);
2650
+        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist);
2650
+        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist);
2651
}
2651
}
2652
2652
2653
void EXhalbtc8723b1ant_BtInfoNotify(
2653
void EXhalbtc8723b1ant_BtInfoNotify(
2654
-    struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length
2654
-    struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length
2655
+    struct btc_coexist *bt_coexist, u8 *tmpBuf, u8 length
2655
+    struct btc_coexist *bt_coexist, u8 *tmpBuf, u8 length
2656
)
2656
)
2657
{
2657
{
2658
    u8 btInfo = 0;
2658
    u8 btInfo = 0;
2659
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_BtInfoNotify(
2659
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_BtInfoNotify(
2660
        else
2660
        else
2661
            pCoexSta->bC2hBtPage = false;
2661
            pCoexSta->bC2hBtPage = false;
2662
2662
2663
-        pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3] * 2 - 90;
2663
-        pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3] * 2 - 90;
2664
+        pCoexSta->bt_rssi = pCoexSta->btInfoC2h[rspSource][3] * 2 - 90;
2664
+        pCoexSta->bt_rssi = pCoexSta->btInfoC2h[rspSource][3] * 2 - 90;
2665
        /* pCoexSta->btInfoC2h[rspSource][3]*2+10; */
2665
        /* pCoexSta->btInfoC2h[rspSource][3]*2+10; */
2666
2666
2667
        pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4];
2667
        pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4];
2668
2668
2669
        pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2] & 0x40);
2669
        pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2] & 0x40);
2670
-        pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask);
2670
-        pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask);
2671
+        bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask);
2671
+        bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask);
2672
2672
2673
        if (!pCoexSta->bBtTxRxMask) {
2673
        if (!pCoexSta->bBtTxRxMask) {
2674
            /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */
2674
            /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */
2675
-            pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15);
2675
-            pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15);
2676
+            bt_coexist->fBtcSetBtReg(bt_coexist, BTC_BT_REG_RF, 0x3c, 0x15);
2676
+            bt_coexist->fBtcSetBtReg(bt_coexist, BTC_BT_REG_RF, 0x3c, 0x15);
2677
        }
2677
        }
2678
2678
2679
        /* Here we need to resend some wifi info to BT */
2679
        /* Here we need to resend some wifi info to BT */
2680
        /* because bt is reset and loss of the info. */
2680
        /* because bt is reset and loss of the info. */
2681
        if (pCoexSta->btInfoExt & BIT1) {
2681
        if (pCoexSta->btInfoExt & BIT1) {
2682
-            pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2682
-            pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2683
+            bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2683
+            bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
2684
            if (bWifiConnected)
2684
            if (bWifiConnected)
2685
-                EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_CONNECT);
2685
-                EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_CONNECT);
2686
+                EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_CONNECT);
2686
+                EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_CONNECT);
2687
            else
2687
            else
2688
-                EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT);
2688
-                EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT);
2689
+                EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_DISCONNECT);
2689
+                EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_DISCONNECT);
2690
        }
2690
        }
2691
2691
2692
        if (pCoexSta->btInfoExt & BIT3) {
2692
        if (pCoexSta->btInfoExt & BIT3) {
2693
-            if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm)
2693
-            if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm)
2694
-                halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false);
2694
-                halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false);
2695
+            if (!bt_coexist->bManualControl && !bt_coexist->bStopCoexDm)
2695
+            if (!bt_coexist->bManualControl && !bt_coexist->bStopCoexDm)
2696
+                halbtc8723b1ant_IgnoreWlanAct(bt_coexist, FORCE_EXEC, false);
2696
+                halbtc8723b1ant_IgnoreWlanAct(bt_coexist, FORCE_EXEC, false);
2697
        } else {
2697
        } else {
2698
            /* BT already NOT ignore Wlan active, do nothing here. */
2698
            /* BT already NOT ignore Wlan active, do nothing here. */
2699
        }
2699
        }
2700
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_BtInfoNotify(
2700
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_BtInfoNotify(
2701
            pCoexSta->bScoExist = false;
2701
            pCoexSta->bScoExist = false;
2702
    }
2702
    }
2703
2703
2704
-    halbtc8723b1ant_UpdateBtLinkInfo(pBtCoexist);
2704
-    halbtc8723b1ant_UpdateBtLinkInfo(pBtCoexist);
2705
+    halbtc8723b1ant_UpdateBtLinkInfo(bt_coexist);
2705
+    halbtc8723b1ant_UpdateBtLinkInfo(bt_coexist);
2706
2706
2707
    btInfo = btInfo & 0x1f; /* mask profile bit for connect-ilde identification (for CSR case: A2DP idle --> 0x41) */
2707
    btInfo = btInfo & 0x1f; /* mask profile bit for connect-ilde identification (for CSR case: A2DP idle --> 0x41) */
2708
2708
2709
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_BtInfoNotify(
2709
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_BtInfoNotify(
2710
        bBtBusy = true;
2710
        bBtBusy = true;
2711
    else
2711
    else
2712
        bBtBusy = false;
2712
        bBtBusy = false;
2713
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy);
2713
-    pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy);
2714
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy);
2714
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy);
2715
2715
2716
-    halbtc8723b1ant_RunCoexistMechanism(pBtCoexist);
2716
-    halbtc8723b1ant_RunCoexistMechanism(pBtCoexist);
2717
+    halbtc8723b1ant_RunCoexistMechanism(bt_coexist);
2717
+    halbtc8723b1ant_RunCoexistMechanism(bt_coexist);
2718
}
2718
}
2719
2719
2720
-void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *pBtCoexist)
2720
-void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *pBtCoexist)
2721
+void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *bt_coexist)
2721
+void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *bt_coexist)
2722
{
2722
{
2723
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
2723
-    halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
2724
-    halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 0);
2724
-    halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 0);
2725
-    halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true);
2725
-    halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true);
2726
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
2726
+    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
2727
+    halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 0);
2727
+    halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 0);
2728
+    halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true);
2728
+    halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true);
2729
2729
2730
-    halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true);
2730
-    halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true);
2731
+    halbtc8723b1ant_IgnoreWlanAct(bt_coexist, FORCE_EXEC, true);
2731
+    halbtc8723b1ant_IgnoreWlanAct(bt_coexist, FORCE_EXEC, true);
2732
2732
2733
-    EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT);
2733
-    EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT);
2734
+    EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_DISCONNECT);
2734
+    EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_DISCONNECT);
2735
2735
2736
-    pBtCoexist->bStopCoexDm = true;
2736
-    pBtCoexist->bStopCoexDm = true;
2737
+    bt_coexist->bStopCoexDm = true;
2737
+    bt_coexist->bStopCoexDm = true;
2738
}
2738
}
2739
2739
2740
-void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState)
2740
-void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState)
2741
+void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *bt_coexist, u8 pnpState)
2741
+void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *bt_coexist, u8 pnpState)
2742
{
2742
{
2743
    if (pnpState == BTC_WIFI_PNP_SLEEP) {
2743
    if (pnpState == BTC_WIFI_PNP_SLEEP) {
2744
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
2744
-        halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
2745
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0);
2745
-        halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0);
2746
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
2746
-        halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2);
2747
-        halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true);
2747
-        halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true);
2748
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
2748
+        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
2749
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0);
2749
+        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0);
2750
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
2750
+        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2);
2751
+        halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true);
2751
+        halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true);
2752
2752
2753
-        pBtCoexist->bStopCoexDm = true;
2753
-        pBtCoexist->bStopCoexDm = true;
2754
+        bt_coexist->bStopCoexDm = true;
2754
+        bt_coexist->bStopCoexDm = true;
2755
    } else if (pnpState == BTC_WIFI_PNP_WAKE_UP) {
2755
    } else if (pnpState == BTC_WIFI_PNP_WAKE_UP) {
2756
-        pBtCoexist->bStopCoexDm = false;
2756
-        pBtCoexist->bStopCoexDm = false;
2757
-        halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false);
2757
-        halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false);
2758
-        halbtc8723b1ant_InitCoexDm(pBtCoexist);
2758
-        halbtc8723b1ant_InitCoexDm(pBtCoexist);
2759
-        halbtc8723b1ant_QueryBtInfo(pBtCoexist);
2759
-        halbtc8723b1ant_QueryBtInfo(pBtCoexist);
2760
+        bt_coexist->bStopCoexDm = false;
2760
+        bt_coexist->bStopCoexDm = false;
2761
+        halbtc8723b1ant_InitHwConfig(bt_coexist, false, false);
2761
+        halbtc8723b1ant_InitHwConfig(bt_coexist, false, false);
2762
+        halbtc8723b1ant_InitCoexDm(bt_coexist);
2762
+        halbtc8723b1ant_InitCoexDm(bt_coexist);
2763
+        halbtc8723b1ant_QueryBtInfo(bt_coexist);
2763
+        halbtc8723b1ant_QueryBtInfo(bt_coexist);
2764
    }
2764
    }
2765
}
2765
}
2766
2766
2767
-void EXhalbtc8723b1ant_Periodical(struct btc_coexist *pBtCoexist)
2767
-void EXhalbtc8723b1ant_Periodical(struct btc_coexist *pBtCoexist)
2768
+void EXhalbtc8723b1ant_Periodical(struct btc_coexist *bt_coexist)
2768
+void EXhalbtc8723b1ant_Periodical(struct btc_coexist *bt_coexist)
2769
{
2769
{
2770
    static u8 disVerInfoCnt;
2770
    static u8 disVerInfoCnt;
2771
    u32 fwVer = 0, btPatchVer = 0;
2771
    u32 fwVer = 0, btPatchVer = 0;
2772
2772
2773
    if (disVerInfoCnt <= 5) {
2773
    if (disVerInfoCnt <= 5) {
2774
        disVerInfoCnt += 1;
2774
        disVerInfoCnt += 1;
2775
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer);
2775
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer);
2776
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer);
2776
-        pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer);
2777
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer);
2777
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer);
2778
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_FW_VER, &fwVer);
2778
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_FW_VER, &fwVer);
2779
    }
2779
    }
2780
2780
2781
-    halbtc8723b1ant_MonitorBtCtr(pBtCoexist);
2781
-    halbtc8723b1ant_MonitorBtCtr(pBtCoexist);
2782
-    halbtc8723b1ant_MonitorWiFiCtr(pBtCoexist);
2782
-    halbtc8723b1ant_MonitorWiFiCtr(pBtCoexist);
2783
+    halbtc8723b1ant_MonitorBtCtr(bt_coexist);
2783
+    halbtc8723b1ant_MonitorBtCtr(bt_coexist);
2784
+    halbtc8723b1ant_MonitorWiFiCtr(bt_coexist);
2784
+    halbtc8723b1ant_MonitorWiFiCtr(bt_coexist);
2785
2785
2786
    if (
2786
    if (
2787
-        halbtc8723b1ant_IsWifiStatusChanged(pBtCoexist) ||
2787
-        halbtc8723b1ant_IsWifiStatusChanged(pBtCoexist) ||
2788
+        halbtc8723b1ant_IsWifiStatusChanged(bt_coexist) ||
2788
+        halbtc8723b1ant_IsWifiStatusChanged(bt_coexist) ||
2789
        pCoexDm->bAutoTdmaAdjust
2789
        pCoexDm->bAutoTdmaAdjust
2790
    )
2790
    )
2791
-        halbtc8723b1ant_RunCoexistMechanism(pBtCoexist);
2791
-        halbtc8723b1ant_RunCoexistMechanism(pBtCoexist);
2792
+        halbtc8723b1ant_RunCoexistMechanism(bt_coexist);
2792
+        halbtc8723b1ant_RunCoexistMechanism(bt_coexist);
2793
2793
2794
    pCoexSta->specialPktPeriodCnt++;
2794
    pCoexSta->specialPktPeriodCnt++;
2795
}
2795
}
2796
--
2796
--
2797
2.43.0
2797
2.43.0
diff view generated by jsdifflib
1
Replace a call to kmalloc followed by memset with a single call to
1
Fix Line should not end with a '('
2
kzalloc, which both allocates memory and zeroes it in one step.
2
so as to adhere to the Linux kernel
3
coding-style guidelines.
3
4
4
This change improves readability and reduces redundant code.
5
Reported by checkpatch:
6
    CHECK: line should not end with a '('
5
7
6
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
8
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
7
---
9
---
8
drivers/staging/rtl8723bs/os_dep/osdep_service.c | 7 +------
10
.../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 898 ++++++++----------
9
1 file changed, 1 insertion(+), 6 deletions(-)
11
1 file changed, 398 insertions(+), 500 deletions(-)
10
12
11
diff --git a/drivers/staging/rtl8723bs/os_dep/osdep_service.c b/drivers/staging/rtl8723bs/os_dep/osdep_service.c
13
diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
12
index XXXXXXX..XXXXXXX 100644
14
index XXXXXXX..XXXXXXX 100644
13
--- a/drivers/staging/rtl8723bs/os_dep/osdep_service.c
15
--- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
14
+++ b/drivers/staging/rtl8723bs/os_dep/osdep_service.c
16
+++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c
15
@@ -XXX,XX +XXX,XX @@ void *_rtw_malloc(u32 sz)
17
@@ -XXX,XX +XXX,XX @@ static struct coex_sta_8723b_1ant *pCoexSta = &GLCoexSta8723b1Ant;
16
18
17
void *_rtw_zmalloc(u32 sz)
19
/* local function proto type if needed */
18
{
20
/* local function start with halbtc8723b1ant_ */
19
-    void *pbuf = _rtw_malloc(sz);
21
-static u8 halbtc8723b1ant_BtRssiState(
22
-    u8 level_num, u8 rssi_thresh, u8 rssi_thresh1
23
-)
24
+static u8 halbtc8723b1ant_BtRssiState(u8 level_num, u8 rssi_thresh, u8 rssi_thresh1)
25
{
26
    s32 bt_rssi = 0;
27
    u8 bt_rssi_state = pCoexSta->preBtRssiState;
28
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_BtRssiState(
29
    bt_rssi = pCoexSta->bt_rssi;
30
31
    if (level_num == 2) {
32
-        if (
33
-            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
34
-            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
35
+        if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
36
+         (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
37
        ) {
38
            if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
39
40
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_BtRssiState(
41
        if (rssi_thresh > rssi_thresh1)
42
            return pCoexSta->preBtRssiState;
43
44
-        if (
45
-            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
46
-            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
47
+        if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) ||
48
+         (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW)
49
        ) {
50
            if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
51
                bt_rssi_state = BTC_RSSI_STATE_MEDIUM;
52
            else
53
                bt_rssi_state = BTC_RSSI_STATE_STAY_LOW;
54
-        } else if (
55
-            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) ||
56
+        } else if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) ||
57
            (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM)
58
        ) {
59
            if (bt_rssi >= (rssi_thresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT))
60
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_BtRssiState(
61
    return bt_rssi_state;
62
}
63
64
-static void halbtc8723b1ant_UpdateRaMask(
65
-    struct btc_coexist *bt_coexist, bool force_exec, u32 dis_rate_mask
66
-)
67
+static void halbtc8723b1ant_UpdateRaMask(struct btc_coexist *bt_coexist, bool force_exec,
68
+                     u32 dis_rate_mask)
69
{
70
    pCoexDm->curRaMask = dis_rate_mask;
71
72
    if (force_exec || (pCoexDm->preRaMask != pCoexDm->curRaMask))
73
-        bt_coexist->fBtcSet(
74
-            bt_coexist,
75
-            BTC_SET_ACT_UPDATE_RAMASK,
76
-            &pCoexDm->curRaMask
77
+        bt_coexist->fBtcSet(bt_coexist,
78
+                 BTC_SET_ACT_UPDATE_RAMASK,
79
+                 &pCoexDm->curRaMask
80
        );
81
    pCoexDm->preRaMask = pCoexDm->curRaMask;
82
}
83
84
-static void halbtc8723b1ant_AutoRateFallbackRetry(
85
-    struct btc_coexist *bt_coexist, bool force_exec, u8 type
86
-)
87
+static void halbtc8723b1ant_AutoRateFallbackRetry(struct btc_coexist *bt_coexist, bool force_exec,
88
+                         u8 type)
89
{
90
    bool wifi_under_b_mode = false;
91
92
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_AutoRateFallbackRetry(
93
    if (force_exec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) {
94
        switch (pCoexDm->curArfrType) {
95
        case 0:    /* normal mode */
96
-            bt_coexist->fBtcWrite4Byte(
97
-                bt_coexist, 0x430, pCoexDm->backupArfrCnt1
98
-            );
99
-            bt_coexist->fBtcWrite4Byte(
100
-                bt_coexist, 0x434, pCoexDm->backupArfrCnt2
101
-            );
102
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, pCoexDm->backupArfrCnt1);
103
+            bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, pCoexDm->backupArfrCnt2);
104
            break;
105
        case 1:
106
-            bt_coexist->fBtcGet(
107
-                bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode
108
-            );
109
+            bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE,
110
+                     &wifi_under_b_mode);
111
            if (wifi_under_b_mode) {
112
                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0);
113
                bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x01010101);
114
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_AutoRateFallbackRetry(
115
    pCoexDm->preArfrType = pCoexDm->curArfrType;
116
}
117
118
-static void halbtc8723b1ant_RetryLimit(
119
-    struct btc_coexist *bt_coexist, bool force_exec, u8 type
120
-)
121
+static void halbtc8723b1ant_RetryLimit(struct btc_coexist *bt_coexist, bool force_exec, u8 type)
122
{
123
    pCoexDm->curRetryLimitType = type;
124
125
-    if (
126
-        force_exec ||
127
-        (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)
128
-    ) {
129
+    if (force_exec || (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)) {
130
        switch (pCoexDm->curRetryLimitType) {
131
        case 0:    /* normal mode */
132
-            bt_coexist->fBtcWrite2Byte(
133
-                bt_coexist, 0x42a, pCoexDm->backupRetryLimit
134
-            );
135
+            bt_coexist->fBtcWrite2Byte(bt_coexist, 0x42a, pCoexDm->backupRetryLimit);
136
            break;
137
        case 1:    /* retry limit =8 */
138
            bt_coexist->fBtcWrite2Byte(bt_coexist, 0x42a, 0x0808);
139
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RetryLimit(
140
    pCoexDm->preRetryLimitType = pCoexDm->curRetryLimitType;
141
}
142
143
-static void halbtc8723b1ant_AmpduMaxTime(
144
-    struct btc_coexist *bt_coexist, bool force_exec, u8 type
145
-)
146
+static void halbtc8723b1ant_AmpduMaxTime(struct btc_coexist *bt_coexist, bool force_exec, u8 type)
147
{
148
    pCoexDm->curAmpduTimeType = type;
149
150
-    if (
151
-        force_exec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)
152
+    if (force_exec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType)
153
    ) {
154
        switch (pCoexDm->curAmpduTimeType) {
155
        case 0:    /* normal mode */
156
-            bt_coexist->fBtcWrite1Byte(
157
-                bt_coexist, 0x456, pCoexDm->backupAmpduMaxTime
158
-            );
159
+            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x456, pCoexDm->backupAmpduMaxTime);
160
            break;
161
        case 1:    /* AMPDU timw = 0x38 * 32us */
162
            bt_coexist->fBtcWrite1Byte(bt_coexist, 0x456, 0x38);
163
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_AmpduMaxTime(
164
    pCoexDm->preAmpduTimeType = pCoexDm->curAmpduTimeType;
165
}
166
167
-static void halbtc8723b1ant_LimitedTx(
168
-    struct btc_coexist *bt_coexist,
169
-    bool force_exec,
170
-    u8 ra_mask_type,
171
-    u8 arfr_type,
172
-    u8 retry_limit_type,
173
-    u8 ampdu_time_type
174
-)
175
+static void halbtc8723b1ant_LimitedTx(struct btc_coexist *bt_coexist, bool force_exec,
176
+                 u8 ra_mask_type, u8 arfr_type,
177
+                 u8 retry_limit_type, u8 ampdu_time_type)
178
{
179
    switch (ra_mask_type) {
180
    case 0:    /* normal mode */
181
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_LimitedTx(
182
    halbtc8723b1ant_AmpduMaxTime(bt_coexist, force_exec, ampdu_time_type);
183
}
184
185
-static void halbtc8723b1ant_LimitedRx(
186
-    struct btc_coexist *bt_coexist,
187
-    bool force_exec,
188
-    bool rej_ap_agg_pkt,
189
-    bool bt_ctrl_agg_buf_size,
190
-    u8 agg_buf_size
191
-)
192
+static void halbtc8723b1ant_LimitedRx(struct btc_coexist *bt_coexist,
193
+                 bool force_exec,
194
+                 bool rej_ap_agg_pkt,
195
+                 bool bt_ctrl_agg_buf_size,
196
+                 u8 agg_buf_size)
197
{
198
    bool bRejectRxAgg = rej_ap_agg_pkt;
199
    bool bBtCtrlRxAggSize = bt_ctrl_agg_buf_size;
200
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_LimitedRx(
201
    /* */
202
    /*    Rx Aggregation related setting */
203
    /* */
204
-    bt_coexist->fBtcSet(
205
-        bt_coexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg
206
-    );
207
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg);
208
    /* decide BT control aggregation buf size or not */
209
-    bt_coexist->fBtcSet(
210
-        bt_coexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize
211
-    );
212
+    bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize);
213
    /* aggregation buf size, only work when BT control Rx aggregation size. */
214
    bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize);
215
    /* real update aggregation setting */
216
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *bt_coexist)
217
218
    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
219
    bt_coexist->fBtcGet(bt_coexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi);
220
-    bt_coexist->fBtcGet(
221
-        bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode
222
-    );
223
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode);
224
225
    if (pCoexSta->bUnderIps) {
226
        pCoexSta->nCRCOK_CCK = 0;
227
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *bt_coexist)
228
    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x0);
229
230
    if (wifi_busy && (wifi_rssi >= 30) && !wifi_under_b_mode) {
231
-        if (
232
-            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
233
-            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ||
234
-            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY)
235
+        if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
236
+         (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ||
237
+         (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY)
238
        ) {
239
-            if (
240
-                pCoexSta->nCRCOK_CCK > (
241
-                    pCoexSta->nCRCOK_11g +
242
-                    pCoexSta->nCRCOK_11n +
243
-                    pCoexSta->nCRCOK_11nAgg
244
-                )
245
+            if (pCoexSta->nCRCOK_CCK > (pCoexSta->nCRCOK_11g +
246
+                         pCoexSta->nCRCOK_11n +
247
+                         pCoexSta->nCRCOK_11nAgg)
248
            ) {
249
                if (nCCKLockCounter < 5)
250
                    nCCKLockCounter++;
251
@@ -XXX,XX +XXX,XX @@ static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *bt_coexist)
252
    bool wifi_busy = false, bUnder4way = false, bBtHsOn = false;
253
    bool bWifiConnected = false;
254
255
-    bt_coexist->fBtcGet(
256
-        bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected
257
-    );
258
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
259
    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
260
    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn);
261
-    bt_coexist->fBtcGet(
262
-        bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way
263
-    );
264
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way);
265
266
    if (bWifiConnected) {
267
        if (wifi_busy != bPreWifiBusy) {
268
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *bt_coexist)
269
    }
270
271
    /* check if Sco only */
272
-    if (
273
-        pBtLinkInfo->bScoExist &&
274
-        !pBtLinkInfo->bA2dpExist &&
275
-        !pBtLinkInfo->bPanExist &&
276
-        !pBtLinkInfo->bHidExist
277
+    if (pBtLinkInfo->bScoExist &&
278
+     !pBtLinkInfo->bA2dpExist &&
279
+     !pBtLinkInfo->bPanExist &&
280
+     !pBtLinkInfo->bHidExist
281
    )
282
        pBtLinkInfo->bScoOnly = true;
283
    else
284
        pBtLinkInfo->bScoOnly = false;
285
286
    /* check if A2dp only */
287
-    if (
288
-        !pBtLinkInfo->bScoExist &&
289
-        pBtLinkInfo->bA2dpExist &&
290
-        !pBtLinkInfo->bPanExist &&
291
-        !pBtLinkInfo->bHidExist
292
+    if (!pBtLinkInfo->bScoExist &&
293
+     pBtLinkInfo->bA2dpExist &&
294
+     !pBtLinkInfo->bPanExist &&
295
+     !pBtLinkInfo->bHidExist
296
    )
297
        pBtLinkInfo->bA2dpOnly = true;
298
    else
299
        pBtLinkInfo->bA2dpOnly = false;
300
301
    /* check if Pan only */
302
-    if (
303
-        !pBtLinkInfo->bScoExist &&
304
-        !pBtLinkInfo->bA2dpExist &&
305
-        pBtLinkInfo->bPanExist &&
306
-        !pBtLinkInfo->bHidExist
307
+    if (!pBtLinkInfo->bScoExist &&
308
+     !pBtLinkInfo->bA2dpExist &&
309
+     pBtLinkInfo->bPanExist &&
310
+     !pBtLinkInfo->bHidExist
311
    )
312
        pBtLinkInfo->bPanOnly = true;
313
    else
314
        pBtLinkInfo->bPanOnly = false;
315
316
    /* check if Hid only */
317
-    if (
318
-        !pBtLinkInfo->bScoExist &&
319
-        !pBtLinkInfo->bA2dpExist &&
320
-        !pBtLinkInfo->bPanExist &&
321
-        pBtLinkInfo->bHidExist
322
+    if (!pBtLinkInfo->bScoExist &&
323
+     !pBtLinkInfo->bA2dpExist &&
324
+     !pBtLinkInfo->bPanExist &&
325
+     pBtLinkInfo->bHidExist
326
    )
327
        pBtLinkInfo->bHidOnly = true;
328
    else
329
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist)
330
        if (pBtLinkInfo->bScoExist) {
331
            if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) {
332
                algorithm = BT_8723B_1ANT_COEX_ALGO_HID;
333
-            } else if (
334
-                pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist
335
-            ) {
336
+            } else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) {
337
                if (bBtHsOn)
338
                    algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
339
                else
340
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist)
341
                    algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
342
            }
343
        } else {
344
-            if (
345
-                pBtLinkInfo->bHidExist &&
346
-                pBtLinkInfo->bPanExist &&
347
-                pBtLinkInfo->bA2dpExist
348
+            if (pBtLinkInfo->bHidExist &&
349
+             pBtLinkInfo->bPanExist &&
350
+             pBtLinkInfo->bA2dpExist
351
            ) {
352
                if (bBtHsOn)
353
                    algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP;
354
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist)
355
        }
356
    } else if (numOfDiffProfile >= 3) {
357
        if (pBtLinkInfo->bScoExist) {
358
-            if (
359
-                pBtLinkInfo->bHidExist &&
360
-                pBtLinkInfo->bPanExist &&
361
-                pBtLinkInfo->bA2dpExist
362
+            if (pBtLinkInfo->bHidExist &&
363
+             pBtLinkInfo->bPanExist &&
364
+             pBtLinkInfo->bA2dpExist
365
            ) {
366
                if (!bBtHsOn)
367
                    algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID;
368
@@ -XXX,XX +XXX,XX @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist)
369
    return algorithm;
370
}
371
372
-static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
373
-    struct btc_coexist *bt_coexist, bool bLowPenaltyRa
374
-)
375
+static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(struct btc_coexist *bt_coexist,
376
+                         bool bLowPenaltyRa)
377
{
378
    u8 H2C_Parameter[6] = {0};
379
380
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
381
    bt_coexist->fBtcFillH2c(bt_coexist, 0x69, 6, H2C_Parameter);
382
}
383
384
-static void halbtc8723b1ant_LowPenaltyRa(
385
-    struct btc_coexist *bt_coexist, bool force_exec, bool bLowPenaltyRa
386
-)
387
+static void halbtc8723b1ant_LowPenaltyRa(struct btc_coexist *bt_coexist,
388
+                     bool force_exec, bool bLowPenaltyRa)
389
{
390
    pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa;
391
392
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_LowPenaltyRa(
393
        if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa)
394
            return;
395
    }
396
-    halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(
397
-        bt_coexist, pCoexDm->bCurLowPenaltyRa
398
-    );
399
+    halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(bt_coexist,
400
+                         pCoexDm->bCurLowPenaltyRa);
401
402
    pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa;
403
}
404
405
-static void halbtc8723b1ant_SetCoexTable(
406
-    struct btc_coexist *bt_coexist,
407
-    u32 val0x6c0,
408
-    u32 val0x6c4,
409
-    u32 val0x6c8,
410
-    u8 val0x6cc
411
+static void halbtc8723b1ant_SetCoexTable(struct btc_coexist *bt_coexist,
412
+                     u32 val0x6c0,
413
+                     u32 val0x6c4,
414
+                     u32 val0x6c8,
415
+                     u8 val0x6cc
416
)
417
{
418
    bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c0, val0x6c0);
419
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetCoexTable(
420
    bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cc, val0x6cc);
421
}
422
423
-static void halbtc8723b1ant_CoexTable(
424
-    struct btc_coexist *bt_coexist,
425
-    bool force_exec,
426
-    u32 val0x6c0,
427
-    u32 val0x6c4,
428
-    u32 val0x6c8,
429
-    u8 val0x6cc
430
+static void halbtc8723b1ant_CoexTable(struct btc_coexist *bt_coexist,
431
+                 bool force_exec,
432
+                 u32 val0x6c0,
433
+                 u32 val0x6c4,
434
+                 u32 val0x6c8,
435
+                 u8 val0x6cc
436
)
437
{
438
    pCoexDm->curVal0x6c0 = val0x6c0;
439
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
440
    pCoexDm->curVal0x6cc = val0x6cc;
441
442
    if (!force_exec) {
443
-        if (
444
-            (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) &&
445
+        if ((pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) &&
446
         (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) &&
447
         (pCoexDm->preVal0x6c8 == pCoexDm->curVal0x6c8) &&
448
         (pCoexDm->preVal0x6cc == pCoexDm->curVal0x6cc)
449
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
450
            return;
451
    }
452
453
-    halbtc8723b1ant_SetCoexTable(
454
-        bt_coexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc
455
-    );
456
+    halbtc8723b1ant_SetCoexTable(bt_coexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc);
457
458
    pCoexDm->preVal0x6c0 = pCoexDm->curVal0x6c0;
459
    pCoexDm->preVal0x6c4 = pCoexDm->curVal0x6c4;
460
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_CoexTable(
461
    pCoexDm->preVal0x6cc = pCoexDm->curVal0x6cc;
462
}
463
464
-static void halbtc8723b1ant_CoexTableWithType(
465
-    struct btc_coexist *bt_coexist, bool force_exec, u8 type
466
-)
467
+static void halbtc8723b1ant_CoexTableWithType(struct btc_coexist *bt_coexist, bool force_exec,
468
+                     u8 type)
469
{
470
    pCoexSta->nCoexTableType = type;
471
472
    switch (type) {
473
    case 0:
474
-        halbtc8723b1ant_CoexTable(
475
-            bt_coexist, force_exec, 0x55555555, 0x55555555, 0xffffff, 0x3
476
-        );
477
+        halbtc8723b1ant_CoexTable(bt_coexist,
478
+                     force_exec,
479
+                     0x55555555,
480
+                     0x55555555,
481
+                     0xffffff,
482
+                     0x3);
483
        break;
484
    case 1:
485
-        halbtc8723b1ant_CoexTable(
486
-            bt_coexist, force_exec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3
487
-        );
488
+        halbtc8723b1ant_CoexTable(bt_coexist,
489
+                     force_exec,
490
+                     0x55555555,
491
+                     0x5a5a5a5a,
492
+                     0xffffff,
493
+                     0x3);
494
        break;
495
    case 2:
496
-        halbtc8723b1ant_CoexTable(
497
-            bt_coexist, force_exec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3
498
-        );
499
+        halbtc8723b1ant_CoexTable(bt_coexist,
500
+                     force_exec,
501
+                     0x5a5a5a5a,
502
+                     0x5a5a5a5a,
503
+                     0xffffff,
504
+                     0x3);
505
        break;
506
    case 3:
507
-        halbtc8723b1ant_CoexTable(
508
-            bt_coexist, force_exec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3
509
-        );
510
+        halbtc8723b1ant_CoexTable(bt_coexist,
511
+                     force_exec,
512
+                     0xaaaa5555,
513
+                     0xaaaa5a5a,
514
+                     0xffffff,
515
+                     0x3);
516
        break;
517
    case 4:
518
-        halbtc8723b1ant_CoexTable(
519
-            bt_coexist, force_exec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3
520
-        );
521
+        halbtc8723b1ant_CoexTable(bt_coexist,
522
+                     force_exec,
523
+                     0x55555555,
524
+                     0xaaaa5a5a,
525
+                     0xffffff,
526
+                     0x3);
527
        break;
528
    case 5:
529
-        halbtc8723b1ant_CoexTable(
530
-            bt_coexist, force_exec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3
531
-        );
532
+        halbtc8723b1ant_CoexTable(bt_coexist,
533
+                     force_exec,
534
+                     0x5a5a5a5a,
535
+                     0xaaaa5a5a,
536
+                     0xffffff,
537
+                     0x3);
538
        break;
539
    case 6:
540
-        halbtc8723b1ant_CoexTable(
541
-            bt_coexist, force_exec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3
542
-        );
543
+        halbtc8723b1ant_CoexTable(bt_coexist,
544
+                     force_exec,
545
+                     0x55555555,
546
+                     0xaaaaaaaa,
547
+                     0xffffff,
548
+                     0x3);
549
        break;
550
    case 7:
551
-        halbtc8723b1ant_CoexTable(
552
-            bt_coexist, force_exec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3
553
-        );
554
+        halbtc8723b1ant_CoexTable(bt_coexist,
555
+                     force_exec,
556
+                     0xaaaaaaaa,
557
+                     0xaaaaaaaa,
558
+                     0xffffff,
559
+                     0x3);
560
        break;
561
    default:
562
        break;
563
    }
564
}
565
566
-static void halbtc8723b1ant_SetFwIgnoreWlanAct(
567
-    struct btc_coexist *bt_coexist, bool bEnable
568
-)
569
+static void halbtc8723b1ant_SetFwIgnoreWlanAct(struct btc_coexist *bt_coexist, bool bEnable)
570
{
571
    u8 H2C_Parameter[1] = {0};
572
573
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct(
574
    bt_coexist->fBtcFillH2c(bt_coexist, 0x63, 1, H2C_Parameter);
575
}
576
577
-static void halbtc8723b1ant_IgnoreWlanAct(
578
-    struct btc_coexist *bt_coexist, bool force_exec, bool bEnable
579
+static void halbtc8723b1ant_IgnoreWlanAct(struct btc_coexist *bt_coexist,
580
+                     bool force_exec,
581
+                     bool bEnable
582
)
583
{
584
    pCoexDm->bCurIgnoreWlanAct = bEnable;
585
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_IgnoreWlanAct(
586
    pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct;
587
}
588
589
-static void halbtc8723b1ant_SetLpsRpwm(
590
-    struct btc_coexist *bt_coexist, u8 lpsVal, u8 rpwmVal
591
-)
592
+static void halbtc8723b1ant_SetLpsRpwm(struct btc_coexist *bt_coexist, u8 lpsVal, u8 rpwmVal)
593
{
594
    u8 lps = lpsVal;
595
    u8 rpwm = rpwmVal;
596
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetLpsRpwm(
597
    bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_RPWM_VAL, &rpwm);
598
}
599
600
-static void halbtc8723b1ant_LpsRpwm(
601
-    struct btc_coexist *bt_coexist, bool force_exec, u8 lpsVal, u8 rpwmVal
602
+static void halbtc8723b1ant_LpsRpwm(struct btc_coexist *bt_coexist,
603
+                 bool force_exec,
604
+                 u8 lpsVal,
605
+                 u8 rpwmVal
606
)
607
{
608
    pCoexDm->curLps = lpsVal;
609
    pCoexDm->curRpwm = rpwmVal;
610
611
    if (!force_exec) {
612
-        if (
613
-            (pCoexDm->preLps == pCoexDm->curLps) &&
614
-            (pCoexDm->preRpwm == pCoexDm->curRpwm)
615
+        if ((pCoexDm->preLps == pCoexDm->curLps) &&
616
+         (pCoexDm->preRpwm == pCoexDm->curRpwm)
617
        ) {
618
            return;
619
        }
620
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_LpsRpwm(
621
    pCoexDm->preRpwm = pCoexDm->curRpwm;
622
}
623
624
-static void halbtc8723b1ant_SwMechanism(
625
-    struct btc_coexist *bt_coexist, bool bLowPenaltyRA
626
+static void halbtc8723b1ant_SwMechanism(struct btc_coexist *bt_coexist,
627
+                    bool bLowPenaltyRA
628
)
629
{
630
    halbtc8723b1ant_LowPenaltyRa(bt_coexist, NORMAL_EXEC, bLowPenaltyRA);
631
}
632
633
-static void halbtc8723b1ant_SetAntPath(
634
-    struct btc_coexist *bt_coexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff
635
+static void halbtc8723b1ant_SetAntPath(struct btc_coexist *bt_coexist,
636
+                 u8 antPosType,
637
+                 bool bInitHwCfg,
638
+                 bool bWifiOff
639
)
640
{
641
    struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo;
642
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetAntPath(
643
    }
644
}
645
646
-static void halbtc8723b1ant_SetFwPstdma(
647
-    struct btc_coexist *bt_coexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5
648
+static void halbtc8723b1ant_SetFwPstdma(struct btc_coexist *bt_coexist,
649
+                    u8 byte1, u8 byte2, u8 byte3,
650
+                    u8 byte4, u8 byte5
651
)
652
{
653
    u8 H2C_Parameter[5] = {0};
654
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_SetFwPstdma(
655
}
656
657
658
-static void halbtc8723b1ant_PsTdma(
659
-    struct btc_coexist *bt_coexist, bool force_exec, bool bTurnOn, u8 type
660
+static void halbtc8723b1ant_PsTdma(struct btc_coexist *bt_coexist,
661
+                 bool force_exec,
662
+                 bool bTurnOn, u8 type
663
)
664
{
665
    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
666
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
667
    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
668
669
    if (!force_exec) {
670
-        if (
671
-            (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) &&
672
-            (pCoexDm->prePsTdma == pCoexDm->curPsTdma)
673
+        if ((pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) &&
674
+         (pCoexDm->prePsTdma == pCoexDm->curPsTdma)
675
        )
676
            return;
677
    }
678
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
679
680
        switch (type) {
681
        default:
682
-            halbtc8723b1ant_SetFwPstdma(
683
-                bt_coexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val
684
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
685
+                         0x51,
686
+                         0x1a,
687
+                         0x1a,
688
+                         0x0,
689
+                         psTdmaByte4Val
690
            );
691
            break;
692
        case 1:
693
-            halbtc8723b1ant_SetFwPstdma(
694
-                bt_coexist,
695
-                psTdmaByte0Val,
696
-                0x3a + nWiFiDurationAdjust,
697
-                0x03,
698
-                psTdmaByte3Val,
699
-                psTdmaByte4Val
700
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
701
+                         psTdmaByte0Val,
702
+                         0x3a + nWiFiDurationAdjust,
703
+                         0x03,
704
+                         psTdmaByte3Val,
705
+                         psTdmaByte4Val
706
            );
707
            break;
708
        case 2:
709
-            halbtc8723b1ant_SetFwPstdma(
710
-                bt_coexist,
711
-                psTdmaByte0Val,
712
-                0x2d + nWiFiDurationAdjust,
713
-                0x03,
714
-                psTdmaByte3Val,
715
-                psTdmaByte4Val
716
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
717
+                         psTdmaByte0Val,
718
+                         0x2d + nWiFiDurationAdjust,
719
+                         0x03,
720
+                         psTdmaByte3Val,
721
+                         psTdmaByte4Val
722
            );
723
            break;
724
        case 3:
725
-            halbtc8723b1ant_SetFwPstdma(
726
-                bt_coexist, 0x51, 0x1d, 0x1d, 0x0, 0x10
727
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
728
+                         0x51,
729
+                         0x1d,
730
+                         0x1d,
731
+                         0x0,
732
+                         0x10
733
            );
734
            break;
735
        case 4:
736
-            halbtc8723b1ant_SetFwPstdma(
737
-                bt_coexist, 0x93, 0x15, 0x3, 0x14, 0x0
738
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
739
+                         0x93,
740
+                         0x15,
741
+                         0x3,
742
+                         0x14,
743
+                         0x0
744
            );
745
            break;
746
        case 5:
747
-            halbtc8723b1ant_SetFwPstdma(
748
-                bt_coexist, 0x61, 0x15, 0x3, 0x11, 0x10
749
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
750
+                         0x61,
751
+                         0x15,
752
+                         0x3,
753
+                         0x11,
754
+                         0x10
755
            );
756
            break;
757
        case 6:
758
-            halbtc8723b1ant_SetFwPstdma(
759
-                bt_coexist, 0x61, 0x20, 0x3, 0x11, 0x11
760
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
761
+                         0x61,
762
+                         0x20,
763
+                         0x3,
764
+                         0x11,
765
+                         0x11
766
            );
767
            break;
768
        case 7:
769
-            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xc, 0x5, 0x0, 0x0);
770
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
771
+                         0x13,
772
+                         0xc,
773
+                         0x5,
774
+                         0x0,
775
+                         0x0
776
+            );
777
            break;
778
        case 8:
779
-            halbtc8723b1ant_SetFwPstdma(
780
-                bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0
781
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
782
+                         0x93,
783
+                         0x25,
784
+                         0x3,
785
+                         0x10,
786
+                         0x0
787
            );
788
            break;
789
        case 9:
790
-            halbtc8723b1ant_SetFwPstdma(
791
-                bt_coexist,
792
-                psTdmaByte0Val,
793
-                0x21,
794
-                0x3,
795
-                psTdmaByte3Val,
796
-                psTdmaByte4Val
797
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
798
+                         psTdmaByte0Val,
799
+                         0x21,
800
+                         0x3,
801
+                         psTdmaByte3Val,
802
+                         psTdmaByte4Val
803
            );
804
            break;
805
        case 10:
806
            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xa, 0xa, 0x0, 0x40);
807
            break;
808
        case 11:
809
-            halbtc8723b1ant_SetFwPstdma(
810
-                bt_coexist,
811
-                psTdmaByte0Val,
812
-                0x21,
813
-                0x03,
814
-                psTdmaByte3Val,
815
-                psTdmaByte4Val
816
+            halbtc8723b1ant_SetFwPstdma(bt_coexist,
817
+                         psTdmaByte0Val,
818
+                         0x21,
819
+                         0x03,
820
+                         psTdmaByte3Val,
821
+                         psTdmaByte4Val
822
            );
823
            break;
824
        case 12:
825
-            halbtc8723b1ant_SetFwPstdma(
826
-                bt_coexist, 0x51, 0x0a, 0x0a, 0x0, 0x50
827
-            );
828
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x51, 0x0a, 0x0a, 0x0, 0x50);
829
            break;
830
        case 13:
831
-            halbtc8723b1ant_SetFwPstdma(
832
-                bt_coexist, 0x51, 0x12, 0x12, 0x0, 0x10
833
-            );
834
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x51, 0x12, 0x12, 0x0, 0x10);
835
            break;
836
        case 14:
837
-            halbtc8723b1ant_SetFwPstdma(
838
-                bt_coexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val
839
-            );
840
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x51, 0x21, 0x3, 0x10,
841
+                         psTdmaByte4Val);
842
            break;
843
        case 15:
844
-            halbtc8723b1ant_SetFwPstdma(
845
-                bt_coexist, 0x13, 0xa, 0x3, 0x8, 0x0
846
-            );
847
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xa, 0x3, 0x8, 0x0);
848
            break;
849
        case 16:
850
-            halbtc8723b1ant_SetFwPstdma(
851
-                bt_coexist, 0x93, 0x15, 0x3, 0x10, 0x0
852
-            );
853
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x93, 0x15, 0x3, 0x10, 0x0);
854
            break;
855
        case 18:
856
-            halbtc8723b1ant_SetFwPstdma(
857
-                bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0
858
-            );
859
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0);
860
            break;
861
        case 20:
862
-            halbtc8723b1ant_SetFwPstdma(
863
-                bt_coexist, 0x61, 0x3f, 0x03, 0x11, 0x10
20
-
864
-
21
-    if (pbuf)
865
-            );
22
-        memset(pbuf, 0, sz);
866
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x61, 0x3f, 0x03, 0x11, 0x10);
23
-
867
            break;
24
-    return pbuf;
868
        case 21:
25
+    return kzalloc(sz, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
869
-            halbtc8723b1ant_SetFwPstdma(
26
}
870
-                bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x11
27
871
-            );
28
inline struct sk_buff *_rtw_skb_alloc(u32 sz)
872
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x11);
873
            break;
874
        case 22:
875
-            halbtc8723b1ant_SetFwPstdma(
876
-                bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x10
877
-            );
878
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x10);
879
            break;
880
        case 23:
881
-            halbtc8723b1ant_SetFwPstdma(
882
-                bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x18
883
-            );
884
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x18);
885
            break;
886
        case 24:
887
-            halbtc8723b1ant_SetFwPstdma(
888
-                bt_coexist, 0xe3, 0x15, 0x3, 0x31, 0x18
889
-            );
890
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0x15, 0x3, 0x31, 0x18);
891
            break;
892
        case 25:
893
-            halbtc8723b1ant_SetFwPstdma(
894
-                bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18
895
-            );
896
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18);
897
            break;
898
        case 26:
899
-            halbtc8723b1ant_SetFwPstdma(
900
-                bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18
901
-            );
902
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18);
903
            break;
904
        case 27:
905
-            halbtc8723b1ant_SetFwPstdma(
906
-                bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x98
907
-            );
908
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x98);
909
            break;
910
        case 28:
911
-            halbtc8723b1ant_SetFwPstdma(
912
-                bt_coexist, 0x69, 0x25, 0x3, 0x31, 0x0
913
-            );
914
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x69, 0x25, 0x3, 0x31, 0x0);
915
            break;
916
        case 29:
917
-            halbtc8723b1ant_SetFwPstdma(
918
-                bt_coexist, 0xab, 0x1a, 0x1a, 0x1, 0x10
919
-            );
920
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xab, 0x1a, 0x1a, 0x1, 0x10);
921
            break;
922
        case 30:
923
-            halbtc8723b1ant_SetFwPstdma(
924
-                bt_coexist, 0x51, 0x30, 0x3, 0x10, 0x10
925
-            );
926
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x51, 0x30, 0x3, 0x10, 0x10);
927
            break;
928
        case 31:
929
-            halbtc8723b1ant_SetFwPstdma(
930
-                bt_coexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58
931
-            );
932
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58);
933
            break;
934
        case 32:
935
-            halbtc8723b1ant_SetFwPstdma(
936
-                bt_coexist, 0x61, 0x35, 0x3, 0x11, 0x11
937
-            );
938
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x61, 0x35, 0x3, 0x11, 0x11);
939
            break;
940
        case 33:
941
-            halbtc8723b1ant_SetFwPstdma(
942
-                bt_coexist, 0xa3, 0x25, 0x3, 0x30, 0x90
943
-            );
944
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xa3, 0x25, 0x3, 0x30, 0x90);
945
            break;
946
        case 34:
947
-            halbtc8723b1ant_SetFwPstdma(
948
-                bt_coexist, 0x53, 0x1a, 0x1a, 0x0, 0x10
949
-            );
950
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x53, 0x1a, 0x1a, 0x0, 0x10);
951
            break;
952
        case 35:
953
-            halbtc8723b1ant_SetFwPstdma(
954
-                bt_coexist, 0x63, 0x1a, 0x1a, 0x0, 0x10
955
-            );
956
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x63, 0x1a, 0x1a, 0x0, 0x10);
957
            break;
958
        case 36:
959
-            halbtc8723b1ant_SetFwPstdma(
960
-                bt_coexist, 0xd3, 0x12, 0x3, 0x14, 0x50
961
-            );
962
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xd3, 0x12, 0x3, 0x14, 0x50);
963
            break;
964
        case 40: /* SoftAP only with no sta associated, BT disable , TDMA mode for power saving */
965
            /* here softap mode screen off will cost 70-80mA for phone */
966
-            halbtc8723b1ant_SetFwPstdma(
967
-                bt_coexist, 0x23, 0x18, 0x00, 0x10, 0x24
968
-            );
969
+            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x23, 0x18, 0x00, 0x10, 0x24);
970
            break;
971
        }
972
    } else {
973
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdma(
974
        switch (type) {
975
        case 8: /* PTA Control */
976
            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x8, 0x0, 0x0, 0x0, 0x0);
977
-            halbtc8723b1ant_SetAntPath(
978
-                bt_coexist, BTC_ANT_PATH_PTA, false, false
979
-            );
980
+            halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_PTA, false, false);
981
            break;
982
        case 0:
983
        default: /* Software control, Antenna at BT side */
984
            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0);
985
-            halbtc8723b1ant_SetAntPath(
986
-                bt_coexist, BTC_ANT_PATH_BT, false, false
987
-            );
988
+            halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, false);
989
            break;
990
        case 9: /* Software control, Antenna at WiFi side */
991
            halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0);
992
-            halbtc8723b1ant_SetAntPath(
993
-                bt_coexist, BTC_ANT_PATH_WIFI, false, false
994
-            );
995
+            halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_WIFI, false, false);
996
            break;
997
        }
998
    }
999
1000
    rssiAdjustVal = 0;
1001
-    bt_coexist->fBtcSet(
1002
-        bt_coexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal
1003
+    bt_coexist->fBtcSet(bt_coexist,
1004
+             BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE,
1005
+             &rssiAdjustVal
1006
    );
1007
1008
    /* update pre state */
1009
@@ -XXX,XX +XXX,XX @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *bt_coexist)
1010
    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
1011
    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1012
1013
-    if (
1014
-        !bWifiConnected &&
1015
-        pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE
1016
+    if (!bWifiConnected &&
1017
+     pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE
1018
    ) {
1019
        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1020
1021
        bCommon = true;
1022
-    } else if (
1023
-        bWifiConnected &&
1024
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE)
1025
+    } else if (bWifiConnected &&
1026
+         (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE)
1027
    ) {
1028
        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1029
1030
        bCommon = true;
1031
-    } else if (
1032
-        !bWifiConnected &&
1033
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1034
+    } else if (!bWifiConnected &&
1035
+         (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1036
    ) {
1037
        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1038
1039
        bCommon = true;
1040
-    } else if (
1041
-        bWifiConnected &&
1042
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1043
+    } else if (bWifiConnected &&
1044
+         (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1045
    ) {
1046
        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1047
1048
        bCommon = true;
1049
-    } else if (
1050
-        !bWifiConnected &&
1051
-        (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1052
+    } else if (!bWifiConnected &&
1053
+         (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE)
1054
    ) {
1055
        /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */
1056
1057
@@ -XXX,XX +XXX,XX @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *bt_coexist)
1058
}
1059
1060
1061
-static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1062
-    struct btc_coexist *bt_coexist, u8 wifiStatus
1063
-)
1064
+static void halbtc8723b1ant_TdmaDurationAdjustForAcl(struct btc_coexist *bt_coexist, u8 wifiStatus)
1065
{
1066
    static s32 up, dn, m, n, WaitCount;
1067
    s32 result; /* 0: no change, +1: increase WiFi duration, -1: decrease WiFi duration */
1068
    u8 retryCount = 0, btInfoExt;
1069
1070
-    if (
1071
-        (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN) ||
1072
-        (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN) ||
1073
-        (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT)
1074
+    if ((wifiStatus == BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN) ||
1075
+     (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN) ||
1076
+     (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT)
1077
    ) {
1078
-        if (
1079
-            pCoexDm->curPsTdma != 1 &&
1080
-            pCoexDm->curPsTdma != 2 &&
1081
-            pCoexDm->curPsTdma != 3 &&
1082
-            pCoexDm->curPsTdma != 9
1083
+        if (pCoexDm->curPsTdma != 1 &&
1084
+         pCoexDm->curPsTdma != 2 &&
1085
+         pCoexDm->curPsTdma != 3 &&
1086
+         pCoexDm->curPsTdma != 9
1087
        ) {
1088
            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1089
            pCoexDm->psTdmaDuAdjType = 9;
1090
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1091
        }
1092
1093
        if (result == -1) {
1094
-            if (
1095
-                BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) &&
1096
-                ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2))
1097
+            if (BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) &&
1098
+             ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2))
1099
            ) {
1100
                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1101
                pCoexDm->psTdmaDuAdjType = 9;
1102
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1103
                pCoexDm->psTdmaDuAdjType = 11;
1104
            }
1105
        } else if (result == 1) {
1106
-            if (
1107
-                BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) &&
1108
-                ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2))
1109
+            if (BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) &&
1110
+             ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2))
1111
            ) {
1112
                halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9);
1113
                pCoexDm->psTdmaDuAdjType = 9;
1114
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl(
1115
            }
1116
        }
1117
1118
-        if (
1119
-            pCoexDm->curPsTdma != 1 &&
1120
-            pCoexDm->curPsTdma != 2 &&
1121
-            pCoexDm->curPsTdma != 9 &&
1122
-            pCoexDm->curPsTdma != 11
1123
+        if (pCoexDm->curPsTdma != 1 &&
1124
+         pCoexDm->curPsTdma != 2 &&
1125
+         pCoexDm->curPsTdma != 9 &&
1126
+         pCoexDm->curPsTdma != 11
1127
        ) /* recover to previous adjust type */
1128
-            halbtc8723b1ant_PsTdma(
1129
-                bt_coexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType
1130
+            halbtc8723b1ant_PsTdma(bt_coexist,
1131
+                     NORMAL_EXEC,
1132
+                     true,
1133
+                     pCoexDm->psTdmaDuAdjType
1134
            );
1135
    }
1136
}
1137
1138
-static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState(
1139
-    struct btc_coexist *bt_coexist, bool bNewPsState
1140
+static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState(struct btc_coexist *bt_coexist,
1141
+                             bool bNewPsState
1142
)
1143
{
1144
    u8 lpsMode = 0x0;
1145
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState(
1146
    }
1147
}
1148
1149
-static void halbtc8723b1ant_PowerSaveState(
1150
-    struct btc_coexist *bt_coexist, u8 psType, u8 lpsVal, u8 rpwmVal
1151
+static void halbtc8723b1ant_PowerSaveState(struct btc_coexist *bt_coexist,
1152
+                     u8 psType,
1153
+                     u8 lpsVal,
1154
+                     u8 rpwmVal
1155
)
1156
{
1157
    bool bLowPwrDisable = false;
1158
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PowerSaveState(
1159
    case BTC_PS_WIFI_NATIVE:
1160
        /* recover to original 32k low power setting */
1161
        bLowPwrDisable = false;
1162
-        bt_coexist->fBtcSet(
1163
-            bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1164
+        bt_coexist->fBtcSet(bt_coexist,
1165
+                 BTC_SET_ACT_DISABLE_LOW_POWER,
1166
+                 &bLowPwrDisable
1167
        );
1168
        bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_NORMAL_LPS, NULL);
1169
        pCoexSta->bForceLpsOn = false;
1170
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_PowerSaveState(
1171
        halbtc8723b1ant_LpsRpwm(bt_coexist, NORMAL_EXEC, lpsVal, rpwmVal);
1172
        /* when coex force to enter LPS, do not enter 32k low power. */
1173
        bLowPwrDisable = true;
1174
-        bt_coexist->fBtcSet(
1175
-            bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable
1176
+        bt_coexist->fBtcSet(bt_coexist,
1177
+                 BTC_SET_ACT_DISABLE_LOW_POWER,
1178
+                 &bLowPwrDisable
1179
        );
1180
        /* power save must executed before psTdma. */
1181
        bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_ENTER_LPS, NULL);
1182
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *bt_coexist)
1183
        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8);
1184
1185
        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0);
1186
-    } else if (
1187
-        pBtLinkInfo->bScoExist ||
1188
-        pBtLinkInfo->bHidExist ||
1189
-        pBtLinkInfo->bA2dpExist
1190
+    } else if (pBtLinkInfo->bScoExist ||
1191
+         pBtLinkInfo->bHidExist ||
1192
+         pBtLinkInfo->bA2dpExist
1193
    ) {
1194
        /* SCO/HID/A2DP busy */
1195
        halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1196
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *bt_coexist)
1197
    }
1198
}
1199
1200
-static void halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1201
-    struct btc_coexist *bt_coexist, u8 wifiStatus
1202
+static void halbtc8723b1ant_ActionBtScoHidOnlyBusy(struct btc_coexist *bt_coexist,
1203
+                         u8 wifiStatus
1204
)
1205
{
1206
    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1207
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1208
    }
1209
}
1210
1211
-static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1212
-    struct btc_coexist *bt_coexist, u8 wifiStatus
1213
+static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy(struct btc_coexist *bt_coexist,
1214
+                             u8 wifiStatus
1215
)
1216
{
1217
    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1218
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1219
        pCoexDm->bAutoTdmaAdjust = false;
1220
1221
        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1222
-    } else if (
1223
-        pBtLinkInfo->bPanOnly ||
1224
-        (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist)
1225
+    } else if (pBtLinkInfo->bPanOnly ||
1226
+         (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist)
1227
    ) { /* PAN(OPP, FTP), HID+PAN(OPP, FTP) */
1228
        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 3);
1229
        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1230
        pCoexDm->bAutoTdmaAdjust = false;
1231
-    } else if (
1232
-        (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) ||
1233
-        (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist)
1234
+    } else if ((pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) ||
1235
+         (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist)
1236
    ) { /* A2DP+PAN(OPP, FTP), HID+A2DP+PAN(OPP, FTP) */
1237
        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 13);
1238
        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1239
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *bt_coexis
1240
    halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0);
1241
}
1242
1243
-static void halbtc8723b1ant_ActionWifiNotConnectedScan(
1244
-    struct btc_coexist *bt_coexist
1245
-)
1246
+static void halbtc8723b1ant_ActionWifiNotConnectedScan(struct btc_coexist *bt_coexist)
1247
{
1248
    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1249
1250
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiNotConnectedScan(
1251
            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1252
            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1253
        }
1254
-    } else if (
1255
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1256
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1257
+    } else if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1258
+         (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1259
    ) {
1260
-        halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1261
-            bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1262
+        halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist,
1263
+                         BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1264
        );
1265
    } else {
1266
        /* Bryant Add */
1267
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiNotConnectedScan(
1268
    }
1269
}
1270
1271
-static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(
1272
-    struct btc_coexist *bt_coexist
1273
-)
1274
+static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(struct btc_coexist *bt_coexist)
1275
{
1276
    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1277
1278
    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1279
1280
    /* tdma and coex table */
1281
-    if (
1282
-        (pBtLinkInfo->bScoExist) ||
1283
-        (pBtLinkInfo->bHidExist) ||
1284
-        (pBtLinkInfo->bA2dpExist)
1285
+    if ((pBtLinkInfo->bScoExist) ||
1286
+     (pBtLinkInfo->bHidExist) ||
1287
+     (pBtLinkInfo->bA2dpExist)
1288
    ) {
1289
        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1290
        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1291
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *bt_coexi
1292
            halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20);
1293
            halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1294
        }
1295
-    } else if (
1296
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1297
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1298
+    } else if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1299
+         (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1300
    ) {
1301
-        halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1302
-            bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1303
+        halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist,
1304
+                         BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN
1305
        );
1306
    } else {
1307
        /* Bryant Add */
1308
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *bt_coexi
1309
    }
1310
}
1311
1312
-static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket(
1313
-    struct btc_coexist *bt_coexist
1314
-)
1315
+static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket(struct btc_coexist *bt_coexist)
1316
{
1317
    struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo;
1318
1319
    halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1320
1321
    /* tdma and coex table */
1322
-    if (
1323
-        (pBtLinkInfo->bScoExist) ||
1324
-        (pBtLinkInfo->bHidExist) ||
1325
-        (pBtLinkInfo->bA2dpExist)
1326
+    if ((pBtLinkInfo->bScoExist) ||
1327
+     (pBtLinkInfo->bHidExist) ||
1328
+     (pBtLinkInfo->bA2dpExist)
1329
    ) {
1330
        halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32);
1331
        halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4);
1332
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist)
1333
    bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy);
1334
1335
    /* power save state */
1336
-    if (
1337
-        !bApEnable &&
1338
-        pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY &&
1339
-        !bt_coexist->btLinkInfo.bHidOnly
1340
+    if (!bApEnable &&
1341
+     pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY &&
1342
+     !bt_coexist->btLinkInfo.bHidOnly
1343
    ) {
1344
        if (bt_coexist->btLinkInfo.bA2dpOnly) { /* A2DP */
1345
            if (!wifi_busy)
1346
-                halbtc8723b1ant_PowerSaveState(
1347
-                    bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1348
+                halbtc8723b1ant_PowerSaveState(bt_coexist,
1349
+                             BTC_PS_WIFI_NATIVE,
1350
+                             0x0,
1351
+                             0x0
1352
                );
1353
            else { /* busy */
1354
                if (pCoexSta->nScanAPNum >= BT_8723B_1ANT_WIFI_NOISY_THRESH) /* no force LPS, no PS-TDMA, use pure TDMA */
1355
-                    halbtc8723b1ant_PowerSaveState(
1356
-                        bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0
1357
+                    halbtc8723b1ant_PowerSaveState(bt_coexist,
1358
+                                 BTC_PS_WIFI_NATIVE,
1359
+                                 0x0,
1360
+                                 0x0
1361
                    );
1362
                else
1363
-                    halbtc8723b1ant_PowerSaveState(
1364
-                        bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4
1365
+                    halbtc8723b1ant_PowerSaveState(bt_coexist,
1366
+                                 BTC_PS_LPS_ON,
1367
+                                 0x50,
1368
+                                 0x4
1369
                    );
1370
            }
1371
-        } else if (
1372
-            (!pCoexSta->bPanExist) &&
1373
-            (!pCoexSta->bA2dpExist) &&
1374
-            (!pCoexSta->bHidExist)
1375
+        } else if ((!pCoexSta->bPanExist) &&
1376
+             (!pCoexSta->bA2dpExist) &&
1377
+             (!pCoexSta->bHidExist)
1378
        )
1379
            halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0);
1380
        else
1381
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist)
1382
    /* tdma and coex table */
1383
    if (!wifi_busy) {
1384
        if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1385
-            halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1386
-                bt_coexist,
1387
+            halbtc8723b1ant_ActionWifiConnectedBtAclBusy(bt_coexist,
1388
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE
1389
            );
1390
-        } else if (
1391
-            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1392
-            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1393
+        } else if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1394
+             (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1395
        ) {
1396
            halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist,
1397
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE);
1398
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist)
1399
        }
1400
    } else {
1401
        if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) {
1402
-            halbtc8723b1ant_ActionWifiConnectedBtAclBusy(
1403
-                bt_coexist,
1404
+            halbtc8723b1ant_ActionWifiConnectedBtAclBusy(bt_coexist,
1405
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY
1406
            );
1407
-        } else if (
1408
-            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1409
-            (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1410
+        } else if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1411
+             (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1412
        ) {
1413
-            halbtc8723b1ant_ActionBtScoHidOnlyBusy(
1414
-                bt_coexist,
1415
+            halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist,
1416
                BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY
1417
            );
1418
        } else {
1419
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *bt_coexist)
1420
    if (pCoexSta->bUnderIps)
1421
        return;
1422
1423
-    if (
1424
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
1425
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1426
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1427
+    if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
1428
+     (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1429
+     (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1430
    ){
1431
        bIncreaseScanDevNum = true;
1432
    }
1433
1434
-    bt_coexist->fBtcSet(
1435
-        bt_coexist,
1436
-        BTC_SET_BL_INC_SCAN_DEV_NUM,
1437
-        &bIncreaseScanDevNum
1438
+    bt_coexist->fBtcSet(bt_coexist,
1439
+             BTC_SET_BL_INC_SCAN_DEV_NUM,
1440
+             &bIncreaseScanDevNum
1441
    );
1442
-    bt_coexist->fBtcGet(
1443
-        bt_coexist,
1444
-        BTC_GET_BL_WIFI_CONNECTED,
1445
-        &bWifiConnected
1446
+    bt_coexist->fBtcGet(bt_coexist,
1447
+             BTC_GET_BL_WIFI_CONNECTED,
1448
+             &bWifiConnected
1449
    );
1450
1451
-    bt_coexist->fBtcGet(
1452
-        bt_coexist,
1453
-        BTC_GET_U4_WIFI_LINK_STATUS,
1454
-        &wifiLinkStatus
1455
+    bt_coexist->fBtcGet(bt_coexist,
1456
+             BTC_GET_U4_WIFI_LINK_STATUS,
1457
+             &wifiLinkStatus
1458
    );
1459
    numOfWifiLink = wifiLinkStatus >> 16;
1460
1461
@@ -XXX,XX +XXX,XX @@ static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist)
1462
    pCoexSta->popEventCnt = 0;
1463
}
1464
1465
-static void halbtc8723b1ant_InitHwConfig(
1466
-    struct btc_coexist *bt_coexist,
1467
-    bool bBackUp,
1468
-    bool bWifiOnly
1469
+static void halbtc8723b1ant_InitHwConfig(struct btc_coexist *bt_coexist,
1470
+                     bool bBackUp,
1471
+                     bool bWifiOnly
1472
)
1473
{
1474
    bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */
1475
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *bt_coexist, u8 type)
1476
    } else {
1477
        pCoexSta->bWiFiIsHighPriTask = false;
1478
1479
-        bt_coexist->fBtcGet(
1480
-            bt_coexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum
1481
-        );
1482
+        bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum);
1483
    }
1484
1485
    if (bt_coexist->btInfo.bBtDisabled)
1486
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *bt_coexist, u8 type)
1487
1488
    if (numOfWifiLink >= 2) {
1489
        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
1490
-        halbtc8723b1ant_LimitedRx(
1491
-            bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size
1492
+        halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size
1493
        );
1494
        halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
1495
        return;
1496
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *bt_coexist, u8 type)
1497
    bool bt_ctrl_agg_buf_size = false;
1498
    u8 agg_buf_size = 5;
1499
1500
-    if (
1501
-        bt_coexist->bManualControl ||
1502
-        bt_coexist->bStopCoexDm ||
1503
-        bt_coexist->btInfo.bBtDisabled
1504
+    if (bt_coexist->bManualControl ||
1505
+     bt_coexist->bStopCoexDm ||
1506
+     bt_coexist->btInfo.bBtDisabled
1507
    )
1508
        return;
1509
1510
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *bt_coexist, u8 type
1511
    u8 wifiCentralChnl;
1512
    bool wifi_under_b_mode = false;
1513
1514
-    if (
1515
-        bt_coexist->bManualControl ||
1516
-        bt_coexist->bStopCoexDm ||
1517
-        bt_coexist->btInfo.bBtDisabled
1518
+    if (bt_coexist->bManualControl ||
1519
+     bt_coexist->bStopCoexDm ||
1520
+     bt_coexist->btInfo.bBtDisabled
1521
    )
1522
        return;
1523
1524
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 ty
1525
    bool bt_ctrl_agg_buf_size = false;
1526
    u8 agg_buf_size = 5;
1527
1528
-    if (
1529
-        bt_coexist->bManualControl ||
1530
-        bt_coexist->bStopCoexDm ||
1531
-        bt_coexist->btInfo.bBtDisabled
1532
+    if (bt_coexist->bManualControl ||
1533
+     bt_coexist->bStopCoexDm ||
1534
+     bt_coexist->btInfo.bBtDisabled
1535
    )
1536
        return;
1537
1538
-    if (
1539
-        type == BTC_PACKET_DHCP ||
1540
-        type == BTC_PACKET_EAPOL ||
1541
-        type == BTC_PACKET_ARP
1542
+    if (type == BTC_PACKET_DHCP ||
1543
+     type == BTC_PACKET_EAPOL ||
1544
+     type == BTC_PACKET_ARP
1545
    ) {
1546
        if (type == BTC_PACKET_ARP) {
1547
            pCoexDm->nArpCnt++;
1548
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 ty
1549
1550
    pCoexSta->specialPktPeriodCnt = 0;
1551
1552
-    bt_coexist->fBtcGet(
1553
-        bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus
1554
-    );
1555
+    bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus);
1556
    numOfWifiLink = wifiLinkStatus >> 16;
1557
1558
    if (numOfWifiLink >= 2) {
1559
        halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0);
1560
-        halbtc8723b1ant_LimitedRx(
1561
-            bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size
1562
+        halbtc8723b1ant_LimitedRx(bt_coexist,
1563
+                     NORMAL_EXEC,
1564
+                     false,
1565
+                     bt_ctrl_agg_buf_size,
1566
+                     agg_buf_size
1567
        );
1568
        halbtc8723b1ant_ActionWifiMultiPort(bt_coexist);
1569
        return;
1570
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 ty
1571
        return;
1572
    }
1573
1574
-    if (
1575
-        type == BTC_PACKET_DHCP ||
1576
-        type == BTC_PACKET_EAPOL ||
1577
-        ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask))
1578
+    if (type == BTC_PACKET_DHCP ||
1579
+     type == BTC_PACKET_EAPOL ||
1580
+     ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask))
1581
    )
1582
        halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist);
1583
}
1584
1585
-void EXhalbtc8723b1ant_BtInfoNotify(
1586
-    struct btc_coexist *bt_coexist, u8 *tmpBuf, u8 length
1587
-)
1588
+void EXhalbtc8723b1ant_BtInfoNotify(struct btc_coexist *bt_coexist, u8 *tmpBuf, u8 length)
1589
{
1590
    u8 btInfo = 0;
1591
    u8 i, rspSource = 0;
1592
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_BtInfoNotify(
1593
    } else if (btInfo == BT_INFO_8723B_1ANT_B_CONNECTION)    {
1594
        /* connection exists but no busy */
1595
        pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE;
1596
-    } else if (
1597
-        (btInfo & BT_INFO_8723B_1ANT_B_SCO_ESCO) ||
1598
-        (btInfo & BT_INFO_8723B_1ANT_B_SCO_BUSY)
1599
+    } else if ((btInfo & BT_INFO_8723B_1ANT_B_SCO_ESCO) ||
1600
+         (btInfo & BT_INFO_8723B_1ANT_B_SCO_BUSY)
1601
    ) {
1602
        pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_SCO_BUSY;
1603
    } else if (btInfo & BT_INFO_8723B_1ANT_B_ACL_BUSY) {
1604
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_BtInfoNotify(
1605
        pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_MAX;
1606
    }
1607
1608
-    if (
1609
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
1610
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1611
-        (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1612
+    if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) ||
1613
+     (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ||
1614
+     (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY)
1615
    )
1616
        bBtBusy = true;
1617
    else
1618
@@ -XXX,XX +XXX,XX @@ void EXhalbtc8723b1ant_Periodical(struct btc_coexist *bt_coexist)
1619
    halbtc8723b1ant_MonitorBtCtr(bt_coexist);
1620
    halbtc8723b1ant_MonitorWiFiCtr(bt_coexist);
1621
1622
-    if (
1623
-        halbtc8723b1ant_IsWifiStatusChanged(bt_coexist) ||
1624
-        pCoexDm->bAutoTdmaAdjust
1625
+    if (halbtc8723b1ant_IsWifiStatusChanged(bt_coexist) ||
1626
+     pCoexDm->bAutoTdmaAdjust
1627
    )
1628
        halbtc8723b1ant_RunCoexistMechanism(bt_coexist);
1629
29
--
1630
--
30
2.43.0
1631
2.43.0
diff view generated by jsdifflib
...
...
6
6
7
WARNING: please, no space before tabs
7
WARNING: please, no space before tabs
8
8
9
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
9
Signed-off-by: Erick Karanja <karanja99erick@gmail.com>
10
---
10
---
11
drivers/staging/rtl8723bs/hal/hal_btcoex.c | 42 +++++++++++-----------
11
drivers/staging/rtl8723bs/hal/hal_btcoex.c | 33 ++++------------------
12
1 file changed, 21 insertions(+), 21 deletions(-)
12
1 file changed, 6 insertions(+), 27 deletions(-)
13
13
14
diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
14
diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
15
index XXXXXXX..XXXXXXX 100644
15
index XXXXXXX..XXXXXXX 100644
16
--- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c
16
--- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c
17
+++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
17
+++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c
...
...
30
-/*         Debug related function */
30
-/*         Debug related function */
31
+/*Debug related function */
31
+/*Debug related function */
32
/* */
32
/* */
33
static u8 halbtcoutsrc_IsBtCoexistAvailable(struct btc_coexist *pBtCoexist)
33
static u8 halbtcoutsrc_IsBtCoexistAvailable(struct btc_coexist *pBtCoexist)
34
{
34
{
35
@@ -XXX,XX +XXX,XX @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist)
36
    ready = _FAIL;
37
#ifdef LPS_RPWM_WAIT_MS
38
    timeout = LPS_RPWM_WAIT_MS;
39
-#else /* !LPS_RPWM_WAIT_MS */
40
+#else
41
    timeout = 30;
42
-#endif /* !LPS_RPWM_WAIT_MS */
43
+#endif
44
45
    stime = jiffies;
46
    do {
35
@@ -XXX,XX +XXX,XX @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
47
@@ -XXX,XX +XXX,XX @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf)
36
48
37
    case BTC_GET_U1_MAC_PHY_MODE:
49
    case BTC_GET_U1_MAC_PHY_MODE:
38
        *pu8 = BTC_SMSP;
50
        *pu8 = BTC_SMSP;
39
-/*             *pU1Tmp = BTC_DMSP; */
51
-/*             *pU1Tmp = BTC_DMSP; */
40
-/*             *pU1Tmp = BTC_DMDP; */
52
-/*             *pU1Tmp = BTC_DMDP; */
41
-/*             *pU1Tmp = BTC_MP_UNKNOWN; */
53
-/*             *pU1Tmp = BTC_MP_UNKNOWN; */
42
+/* *pU1Tmp = BTC_DMSP; */
43
+/* *pU1Tmp = BTC_DMDP; */
44
+/* *pU1Tmp = BTC_MP_UNKNOWN; */
45
        break;
54
        break;
46
55
47
    case BTC_GET_U1_AP_NUM:
56
    case BTC_GET_U1_AP_NUM:
48
@@ -XXX,XX +XXX,XX @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
57
@@ -XXX,XX +XXX,XX @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf)
49
}
58
}
...
...
61
-/*         Extern functions called by other module */
70
-/*         Extern functions called by other module */
62
+/* Extern functions called by other module */
71
+/* Extern functions called by other module */
63
/* */
72
/* */
64
static u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter)
73
static u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter)
65
{
74
{
75
@@ -XXX,XX +XXX,XX @@ void hal_btcoex_Initialize(void *padapter)
76
77
    pBtCoexist = &GLBtCoexist;
78
79
-    /* pBtCoexist->statistics.cntBind++; */
80
-
81
    pBtCoexist->chipInterface = BTC_INTF_SDIO;
82
83
    EXhalbtcoutsrc_BindBtCoexWithAdapter(padapter);
66
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type)
84
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type)
67
        ipsType = BTC_IPS_ENTER;
85
        ipsType = BTC_IPS_ENTER;
68
86
69
    /* All notify is called in cmd thread, don't need to leave low power again */
87
    /* All notify is called in cmd thread, don't need to leave low power again */
70
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
88
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
71
+    /* halbtcoutsrc_LeaveLowPower(pBtCoexist); */
72
89
73
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
90
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
74
        EXhalbtc8723b2ant_IpsNotify(pBtCoexist, ipsType);
91
        EXhalbtc8723b2ant_IpsNotify(pBtCoexist, ipsType);
75
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
92
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
76
        EXhalbtc8723b1ant_IpsNotify(pBtCoexist, ipsType);
93
        EXhalbtc8723b1ant_IpsNotify(pBtCoexist, ipsType);
77
94
78
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
95
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
79
+    /* halbtcoutsrc_NormalLowPower(pBtCoexist); */
96
}
80
}
81
97
82
void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
98
void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type)
83
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_ScanNotify(struct btc_coexist *pBtCoexist, u8 type)
99
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_ScanNotify(struct btc_coexist *pBtCoexist, u8 type)
84
    }
100
    }
85
101
86
    /* All notify is called in cmd thread, don't need to leave low power again */
102
    /* All notify is called in cmd thread, don't need to leave low power again */
87
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
103
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
88
+    /* halbtcoutsrc_LeaveLowPower(pBtCoexist); */
89
104
90
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
105
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
91
        EXhalbtc8723b2ant_ScanNotify(pBtCoexist, scanType);
106
        EXhalbtc8723b2ant_ScanNotify(pBtCoexist, scanType);
92
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
107
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
93
        EXhalbtc8723b1ant_ScanNotify(pBtCoexist, scanType);
108
        EXhalbtc8723b1ant_ScanNotify(pBtCoexist, scanType);
94
109
95
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
110
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
96
+    /* halbtcoutsrc_NormalLowPower(pBtCoexist); */
111
}
97
}
98
112
99
void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action)
113
void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action)
100
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action)
114
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action)
101
        assoType = BTC_ASSOCIATE_FINISH;
115
        assoType = BTC_ASSOCIATE_FINISH;
102
116
103
    /* All notify is called in cmd thread, don't need to leave low power again */
117
    /* All notify is called in cmd thread, don't need to leave low power again */
104
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
118
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
105
+    /* halbtcoutsrc_LeaveLowPower(pBtCoexist); */
106
119
107
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
120
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
108
        EXhalbtc8723b2ant_ConnectNotify(pBtCoexist, assoType);
121
        EXhalbtc8723b2ant_ConnectNotify(pBtCoexist, assoType);
109
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
122
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
110
        EXhalbtc8723b1ant_ConnectNotify(pBtCoexist, assoType);
123
        EXhalbtc8723b1ant_ConnectNotify(pBtCoexist, assoType);
111
124
112
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
125
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
113
+    /* halbtcoutsrc_NormalLowPower(pBtCoexist); */
126
}
114
}
115
127
116
void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum
128
void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum
117
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum
129
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum
118
        mStatus = BTC_MEDIA_DISCONNECT;
130
        mStatus = BTC_MEDIA_DISCONNECT;
119
131
120
    /* All notify is called in cmd thread, don't need to leave low power again */
132
    /* All notify is called in cmd thread, don't need to leave low power again */
121
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
133
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
122
+    /* halbtcoutsrc_LeaveLowPower(pBtCoexist); */
123
134
124
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
135
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
125
        EXhalbtc8723b2ant_MediaStatusNotify(pBtCoexist, mStatus);
136
        EXhalbtc8723b2ant_MediaStatusNotify(pBtCoexist, mStatus);
126
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
137
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
127
        EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, mStatus);
138
        EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, mStatus);
128
139
129
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
140
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
130
+    /* halbtcoutsrc_NormalLowPower(pBtCoexist); */
141
}
131
}
132
142
133
void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktType)
143
void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktType)
134
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy
144
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy
135
    }
145
    }
136
146
137
    /* All notify is called in cmd thread, don't need to leave low power again */
147
    /* All notify is called in cmd thread, don't need to leave low power again */
138
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
148
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
139
+    /* halbtcoutsrc_LeaveLowPower(pBtCoexist); */
140
149
141
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
150
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
142
        EXhalbtc8723b2ant_SpecialPacketNotify(pBtCoexist, packetType);
151
        EXhalbtc8723b2ant_SpecialPacketNotify(pBtCoexist, packetType);
143
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
152
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
144
        EXhalbtc8723b1ant_SpecialPacketNotify(pBtCoexist, packetType);
153
        EXhalbtc8723b1ant_SpecialPacketNotify(pBtCoexist, packetType);
145
154
146
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
155
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
147
+    /* halbtcoutsrc_NormalLowPower(pBtCoexist); */
156
}
148
}
149
157
150
void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length)
158
void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length)
151
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8
159
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8
152
    pBtCoexist->statistics.cntBtInfoNotify++;
160
    pBtCoexist->statistics.cntBtInfoNotify++;
153
161
154
    /* All notify is called in cmd thread, don't need to leave low power again */
162
    /* All notify is called in cmd thread, don't need to leave low power again */
155
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
163
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
156
+    /* halbtcoutsrc_LeaveLowPower(pBtCoexist); */
157
164
158
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
165
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
159
        EXhalbtc8723b2ant_BtInfoNotify(pBtCoexist, tmpBuf, length);
166
        EXhalbtc8723b2ant_BtInfoNotify(pBtCoexist, tmpBuf, length);
160
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
167
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
161
        EXhalbtc8723b1ant_BtInfoNotify(pBtCoexist, tmpBuf, length);
168
        EXhalbtc8723b1ant_BtInfoNotify(pBtCoexist, tmpBuf, length);
162
169
163
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
170
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
164
+    /* halbtcoutsrc_NormalLowPower(pBtCoexist); */
171
}
165
}
166
172
167
void EXhalbtcoutsrc_HaltNotify(struct btc_coexist *pBtCoexist)
173
void EXhalbtcoutsrc_HaltNotify(struct btc_coexist *pBtCoexist)
168
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist)
174
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist)
169
175
170
    /* Periodical should be called in cmd thread, */
176
    /* Periodical should be called in cmd thread, */
171
    /* don't need to leave low power again */
177
    /* don't need to leave low power again */
172
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
178
-/*     halbtcoutsrc_LeaveLowPower(pBtCoexist); */
173
+    /* halbtcoutsrc_LeaveLowPower(pBtCoexist); */
174
179
175
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
180
    if (pBtCoexist->boardInfo.btdmAntNum == 2)
176
        EXhalbtc8723b2ant_Periodical(pBtCoexist);
181
        EXhalbtc8723b2ant_Periodical(pBtCoexist);
177
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
182
    else if (pBtCoexist->boardInfo.btdmAntNum == 1)
178
        EXhalbtc8723b1ant_Periodical(pBtCoexist);
183
        EXhalbtc8723b1ant_Periodical(pBtCoexist);
179
184
180
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
185
-/*     halbtcoutsrc_NormalLowPower(pBtCoexist); */
181
+    /* halbtcoutsrc_NormalLowPower(pBtCoexist); */
186
}
182
}
183
187
184
void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum)
188
void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum)
189
@@ -XXX,XX +XXX,XX @@ void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum)
190
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
191
    } else if (type == BT_COEX_ANT_TYPE_ANTDIV) {
192
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
193
-        /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */
194
    } else if (type == BT_COEX_ANT_TYPE_DETECTED) {
195
        GLBtCoexist.boardInfo.btdmAntNum = antNum;
196
-        /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */
197
    }
198
}
199
185
--
200
--
186
2.43.0
201
2.43.0
diff view generated by jsdifflib