* [PATCH v2 0/5] Clean up patches for rtl8723bs driver
@ 2025-04-01 16:59 Erick Karanja
2025-04-01 16:59 ` [PATCH v2 1/5] staging: rtl8723bs: use preferred comparison order Erick Karanja
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Erick Karanja @ 2025-04-01 16:59 UTC (permalink / raw)
To: gregkh, outreachy
Cc: karanja99erick, philipp.g.hortmann, linux-staging, linux-kernel
This is version 2 of the patch series that cleaned up the rtl8723bs
module.
Changes in v2:
- Dropped [PATCH 2/5]: Dropped the patch as requested and resubmit the patch
individually.
- Record more changes related to [PATCH 5/5]: add a new patch to
cover for changes related to this patch
- Redo [PATCH 4/5]: Remove all comments containing code so as to
adhere to the Linux kernel coding style
Patch 1, 3 and 5 remain unchanged from v1.
Erick Karanja (5):
staging: rtl8723bs: use preferred comparison order
staging: rtl8723bs: add spaces between ternary and binary operators
staging: rtl8723bs: Rename variables
staging: rtl8723bs: fix check lines should not end with a '('
staging: rtl8723bs: no space before tabs
.../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 1868 ++++++++---------
drivers/staging/rtl8723bs/hal/hal_btcoex.c | 55 +-
.../staging/rtl8723bs/hal/odm_CfoTracking.c | 4 +-
3 files changed, 902 insertions(+), 1025 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v2 1/5] staging: rtl8723bs: use preferred comparison order 2025-04-01 16:59 [PATCH v2 0/5] Clean up patches for rtl8723bs driver Erick Karanja @ 2025-04-01 16:59 ` Erick Karanja 2025-04-01 22:32 ` Julia Lawall 2025-04-01 16:59 ` [PATCH v2 2/5] staging: rtl8723bs: add spaces between ternary and binary operators Erick Karanja ` (3 subsequent siblings) 4 siblings, 1 reply; 11+ messages in thread From: Erick Karanja @ 2025-04-01 16:59 UTC (permalink / raw) To: gregkh, outreachy Cc: karanja99erick, philipp.g.hortmann, linux-staging, linux-kernel Refactor conditions check to follow the Linux kernel coding style, which prefers placing the variable on the left side of the comparison. Reported by checkpatch: WARNING: Comparisons should place the constant on the right side of the test Signed-off-by: Erick Karanja <karanja99erick@gmail.com> --- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index b72cf520d576..9105594d2dde 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -91,7 +91,7 @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist) stime = jiffies; do { ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE); - if (_SUCCESS == ready) + if (ready == _SUCCESS) break; utime = jiffies_to_msecs(jiffies - stime); @@ -668,7 +668,7 @@ static void halbtcoutsrc_WriteLocalReg1Byte(void *pBtcContext, u32 RegAddr, u8 D struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext; struct adapter *Adapter = pBtCoexist->Adapter; - if (BTC_INTF_SDIO == pBtCoexist->chipInterface) + if (pBtCoexist->chipInterface == BTC_INTF_SDIO) rtw_write8(Adapter, SDIO_LOCAL_BASE | RegAddr, Data); else rtw_write8(Adapter, RegAddr, Data); @@ -894,7 +894,7 @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) if (pBtCoexist->bManualControl) return; - if (IPS_NONE == type) + if (type == IPS_NONE) ipsType = BTC_IPS_LEAVE; else ipsType = BTC_IPS_ENTER; @@ -922,7 +922,7 @@ void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) if (pBtCoexist->bManualControl) return; - if (PS_MODE_ACTIVE == type) + if (type == PS_MODE_ACTIVE) lpsType = BTC_LPS_DISABLE; else lpsType = BTC_LPS_ENABLE; @@ -1000,7 +1000,7 @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum if (pBtCoexist->bManualControl) return; - if (RT_MEDIA_CONNECT == mediaStatus) + if (mediaStatus == RT_MEDIA_CONNECT) mStatus = BTC_MEDIA_CONNECT; else mStatus = BTC_MEDIA_DISCONNECT; @@ -1026,11 +1026,11 @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy if (pBtCoexist->bManualControl) return; - if (PACKET_DHCP == pktType) { + if (pktType == PACKET_DHCP) { packetType = BTC_PACKET_DHCP; - } else if (PACKET_EAPOL == pktType) { + } else if (pktType == PACKET_EAPOL) { packetType = BTC_PACKET_EAPOL; - } else if (PACKET_ARP == pktType) { + } else if (pktType == PACKET_ARP) { packetType = BTC_PACKET_ARP; } else { return; @@ -1114,13 +1114,13 @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist) void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) { - if (BT_COEX_ANT_TYPE_PG == type) { + if (type == BT_COEX_ANT_TYPE_PG) { GLBtCoexist.boardInfo.pgAntNum = antNum; GLBtCoexist.boardInfo.btdmAntNum = antNum; - } else if (BT_COEX_ANT_TYPE_ANTDIV == type) { + } else if (type == BT_COEX_ANT_TYPE_ANTDIV) { GLBtCoexist.boardInfo.btdmAntNum = antNum; /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ - } else if (BT_COEX_ANT_TYPE_DETECTED == type) { + } else if (type == BT_COEX_ANT_TYPE_DETECTED) { GLBtCoexist.boardInfo.btdmAntNum = antNum; /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ } -- 2.43.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/5] staging: rtl8723bs: use preferred comparison order 2025-04-01 16:59 ` [PATCH v2 1/5] staging: rtl8723bs: use preferred comparison order Erick Karanja @ 2025-04-01 22:32 ` Julia Lawall 0 siblings, 0 replies; 11+ messages in thread From: Julia Lawall @ 2025-04-01 22:32 UTC (permalink / raw) To: Erick Karanja Cc: gregkh, outreachy, philipp.g.hortmann, linux-staging, linux-kernel On Tue, 1 Apr 2025, Erick Karanja wrote: > Refactor conditions check to follow the Linux kernel > coding style, which prefers placing the variable on the left side > of the comparison. You have already done thing, which looks ok. But if you like, you could try writing a semantic patch that makes this change. constant c; is a metavariable that matches a constant, approximated as a word in full capital letters. julia > > Reported by checkpatch: > > WARNING: Comparisons should place the constant on the right side > of the test > > Signed-off-by: Erick Karanja <karanja99erick@gmail.com> > --- > drivers/staging/rtl8723bs/hal/hal_btcoex.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c > index b72cf520d576..9105594d2dde 100644 > --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c > +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c > @@ -91,7 +91,7 @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist) > stime = jiffies; > do { > ready = rtw_register_task_alive(padapter, BTCOEX_ALIVE); > - if (_SUCCESS == ready) > + if (ready == _SUCCESS) > break; > > utime = jiffies_to_msecs(jiffies - stime); > @@ -668,7 +668,7 @@ static void halbtcoutsrc_WriteLocalReg1Byte(void *pBtcContext, u32 RegAddr, u8 D > struct btc_coexist *pBtCoexist = (struct btc_coexist *)pBtcContext; > struct adapter *Adapter = pBtCoexist->Adapter; > > - if (BTC_INTF_SDIO == pBtCoexist->chipInterface) > + if (pBtCoexist->chipInterface == BTC_INTF_SDIO) > rtw_write8(Adapter, SDIO_LOCAL_BASE | RegAddr, Data); > else > rtw_write8(Adapter, RegAddr, Data); > @@ -894,7 +894,7 @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) > if (pBtCoexist->bManualControl) > return; > > - if (IPS_NONE == type) > + if (type == IPS_NONE) > ipsType = BTC_IPS_LEAVE; > else > ipsType = BTC_IPS_ENTER; > @@ -922,7 +922,7 @@ void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) > if (pBtCoexist->bManualControl) > return; > > - if (PS_MODE_ACTIVE == type) > + if (type == PS_MODE_ACTIVE) > lpsType = BTC_LPS_DISABLE; > else > lpsType = BTC_LPS_ENABLE; > @@ -1000,7 +1000,7 @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum > if (pBtCoexist->bManualControl) > return; > > - if (RT_MEDIA_CONNECT == mediaStatus) > + if (mediaStatus == RT_MEDIA_CONNECT) > mStatus = BTC_MEDIA_CONNECT; > else > mStatus = BTC_MEDIA_DISCONNECT; > @@ -1026,11 +1026,11 @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy > if (pBtCoexist->bManualControl) > return; > > - if (PACKET_DHCP == pktType) { > + if (pktType == PACKET_DHCP) { > packetType = BTC_PACKET_DHCP; > - } else if (PACKET_EAPOL == pktType) { > + } else if (pktType == PACKET_EAPOL) { > packetType = BTC_PACKET_EAPOL; > - } else if (PACKET_ARP == pktType) { > + } else if (pktType == PACKET_ARP) { > packetType = BTC_PACKET_ARP; > } else { > return; > @@ -1114,13 +1114,13 @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist) > > void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) > { > - if (BT_COEX_ANT_TYPE_PG == type) { > + if (type == BT_COEX_ANT_TYPE_PG) { > GLBtCoexist.boardInfo.pgAntNum = antNum; > GLBtCoexist.boardInfo.btdmAntNum = antNum; > - } else if (BT_COEX_ANT_TYPE_ANTDIV == type) { > + } else if (type == BT_COEX_ANT_TYPE_ANTDIV) { > GLBtCoexist.boardInfo.btdmAntNum = antNum; > /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ > - } else if (BT_COEX_ANT_TYPE_DETECTED == type) { > + } else if (type == BT_COEX_ANT_TYPE_DETECTED) { > GLBtCoexist.boardInfo.btdmAntNum = antNum; > /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ > } > -- > 2.43.0 > > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 2/5] staging: rtl8723bs: add spaces between ternary and binary operators 2025-04-01 16:59 [PATCH v2 0/5] Clean up patches for rtl8723bs driver Erick Karanja 2025-04-01 16:59 ` [PATCH v2 1/5] staging: rtl8723bs: use preferred comparison order Erick Karanja @ 2025-04-01 16:59 ` Erick Karanja 2025-04-01 22:30 ` Julia Lawall 2025-04-01 16:59 ` [PATCH v2 3/5] staging: rtl8723bs: Rename variables Erick Karanja ` (2 subsequent siblings) 4 siblings, 1 reply; 11+ messages in thread From: Erick Karanja @ 2025-04-01 16:59 UTC (permalink / raw) To: gregkh, outreachy Cc: karanja99erick, philipp.g.hortmann, linux-staging, linux-kernel Fix spacing around binary arithmetic (`+`) and shift (`>>`) operators to improve readability and adhere to the Linux kernel coding style. Reported by checkpatch: CHECK: spaces needed around 'operator' Signed-off-by: Erick Karanja <karanja99erick@gmail.com> --- drivers/staging/rtl8723bs/hal/odm_CfoTracking.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c index 928c58be6c9b..3b43f8cfd6f4 100644 --- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c +++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c @@ -155,9 +155,9 @@ void ODM_CfoTracking(void *pDM_VOID) /* 4 1.6 Big jump */ if (pCfoTrack->bAdjust) { if (CFO_ave > CFO_TH_XTAL_LOW) - Adjust_Xtal = Adjust_Xtal+((CFO_ave-CFO_TH_XTAL_LOW)>>2); + Adjust_Xtal = Adjust_Xtal + ((CFO_ave-CFO_TH_XTAL_LOW) >> 2); else if (CFO_ave < (-CFO_TH_XTAL_LOW)) - Adjust_Xtal = Adjust_Xtal+((CFO_TH_XTAL_LOW-CFO_ave)>>2); + Adjust_Xtal = Adjust_Xtal + ((CFO_TH_XTAL_LOW-CFO_ave) >> 2); } /* 4 1.7 Adjust Crystal Cap. */ -- 2.43.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/5] staging: rtl8723bs: add spaces between ternary and binary operators 2025-04-01 16:59 ` [PATCH v2 2/5] staging: rtl8723bs: add spaces between ternary and binary operators Erick Karanja @ 2025-04-01 22:30 ` Julia Lawall 0 siblings, 0 replies; 11+ messages in thread From: Julia Lawall @ 2025-04-01 22:30 UTC (permalink / raw) To: Erick Karanja Cc: gregkh, outreachy, philipp.g.hortmann, linux-staging, linux-kernel On Tue, 1 Apr 2025, Erick Karanja wrote: > Fix spacing around binary arithmetic (`+`) and shift (`>>`) operators > to improve readability and adhere to the Linux kernel coding style. > > Reported by checkpatch: > > CHECK: spaces needed around 'operator' > > Signed-off-by: Erick Karanja <karanja99erick@gmail.com> > --- > drivers/staging/rtl8723bs/hal/odm_CfoTracking.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c > index 928c58be6c9b..3b43f8cfd6f4 100644 > --- a/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c > +++ b/drivers/staging/rtl8723bs/hal/odm_CfoTracking.c > @@ -155,9 +155,9 @@ void ODM_CfoTracking(void *pDM_VOID) > /* 4 1.6 Big jump */ > if (pCfoTrack->bAdjust) { > if (CFO_ave > CFO_TH_XTAL_LOW) > - Adjust_Xtal = Adjust_Xtal+((CFO_ave-CFO_TH_XTAL_LOW)>>2); > + Adjust_Xtal = Adjust_Xtal + ((CFO_ave-CFO_TH_XTAL_LOW) >> 2); I think you have missed a - here: CFO_ave-CFO_TH_XTAL_LOW. Likewise below. julia > else if (CFO_ave < (-CFO_TH_XTAL_LOW)) > - Adjust_Xtal = Adjust_Xtal+((CFO_TH_XTAL_LOW-CFO_ave)>>2); > + Adjust_Xtal = Adjust_Xtal + ((CFO_TH_XTAL_LOW-CFO_ave) >> 2); > } > > /* 4 1.7 Adjust Crystal Cap. */ > -- > 2.43.0 > > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 3/5] staging: rtl8723bs: Rename variables 2025-04-01 16:59 [PATCH v2 0/5] Clean up patches for rtl8723bs driver Erick Karanja 2025-04-01 16:59 ` [PATCH v2 1/5] staging: rtl8723bs: use preferred comparison order Erick Karanja 2025-04-01 16:59 ` [PATCH v2 2/5] staging: rtl8723bs: add spaces between ternary and binary operators Erick Karanja @ 2025-04-01 16:59 ` Erick Karanja 2025-04-01 22:28 ` Julia Lawall 2025-04-01 16:59 ` [PATCH v2 4/5] staging: rtl8723bs: fix check lines should not end with a '(' Erick Karanja 2025-04-01 16:59 ` [PATCH v2 5/5] staging: rtl8723bs: no space before tabs Erick Karanja 4 siblings, 1 reply; 11+ messages in thread From: Erick Karanja @ 2025-04-01 16:59 UTC (permalink / raw) To: gregkh, outreachy Cc: karanja99erick, philipp.g.hortmann, linux-staging, linux-kernel Rename variables to adhere to Linux kernel coding standards by using snake_case instead of CamelCase and ensure proper encoding of the variables by removing initial 'p' for pointers and initial 'b' for boolean. Fixes checkpatch.pl warning: CHECK: Avoid CamelCase: <supportRateNum> Signed-off-by: Erick Karanja <karanja99erick@gmail.com> --- .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 1266 ++++++++--------- 1 file changed, 633 insertions(+), 633 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c index b3d7f50fac4c..e3c67f98e8c0 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c @@ -16,74 +16,74 @@ static struct coex_sta_8723b_1ant *pCoexSta = &GLCoexSta8723b1Ant; /* local function proto type if needed */ /* local function start with halbtc8723b1ant_ */ static u8 halbtc8723b1ant_BtRssiState( - u8 levelNum, u8 rssiThresh, u8 rssiThresh1 + u8 level_num, u8 rssi_thresh, u8 rssi_thresh1 ) { - s32 btRssi = 0; - u8 btRssiState = pCoexSta->preBtRssiState; + s32 bt_rssi = 0; + u8 bt_rssi_state = pCoexSta->preBtRssiState; - btRssi = pCoexSta->btRssi; + bt_rssi = pCoexSta->bt_rssi; - if (levelNum == 2) { + if (level_num == 2) { if ( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) ) { - if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) + if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) - btRssiState = BTC_RSSI_STATE_HIGH; + bt_rssi_state = BTC_RSSI_STATE_HIGH; else - btRssiState = BTC_RSSI_STATE_STAY_LOW; + bt_rssi_state = BTC_RSSI_STATE_STAY_LOW; } else { - if (btRssi < rssiThresh) - btRssiState = BTC_RSSI_STATE_LOW; + if (bt_rssi < rssi_thresh) + bt_rssi_state = BTC_RSSI_STATE_LOW; else - btRssiState = BTC_RSSI_STATE_STAY_HIGH; + bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH; } - } else if (levelNum == 3) { - if (rssiThresh > rssiThresh1) + } else if (level_num == 3) { + if (rssi_thresh > rssi_thresh1) return pCoexSta->preBtRssiState; if ( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) ) { - if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) - btRssiState = BTC_RSSI_STATE_MEDIUM; + if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) + bt_rssi_state = BTC_RSSI_STATE_MEDIUM; else - btRssiState = BTC_RSSI_STATE_STAY_LOW; + bt_rssi_state = BTC_RSSI_STATE_STAY_LOW; } else if ( (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM) ) { - if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) - btRssiState = BTC_RSSI_STATE_HIGH; - else if (btRssi < rssiThresh) - btRssiState = BTC_RSSI_STATE_LOW; + if (bt_rssi >= (rssi_thresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) + bt_rssi_state = BTC_RSSI_STATE_HIGH; + else if (bt_rssi < rssi_thresh) + bt_rssi_state = BTC_RSSI_STATE_LOW; else - btRssiState = BTC_RSSI_STATE_STAY_MEDIUM; + bt_rssi_state = BTC_RSSI_STATE_STAY_MEDIUM; } else { - if (btRssi < rssiThresh1) - btRssiState = BTC_RSSI_STATE_MEDIUM; + if (bt_rssi < rssi_thresh1) + bt_rssi_state = BTC_RSSI_STATE_MEDIUM; else - btRssiState = BTC_RSSI_STATE_STAY_HIGH; + bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH; } } - pCoexSta->preBtRssiState = btRssiState; + pCoexSta->preBtRssiState = bt_rssi_state; - return btRssiState; + return bt_rssi_state; } static void halbtc8723b1ant_UpdateRaMask( - struct btc_coexist *pBtCoexist, bool bForceExec, u32 disRateMask + struct btc_coexist *bt_coexist, bool force_exec, u32 dis_rate_mask ) { - pCoexDm->curRaMask = disRateMask; + pCoexDm->curRaMask = dis_rate_mask; - if (bForceExec || (pCoexDm->preRaMask != pCoexDm->curRaMask)) - pBtCoexist->fBtcSet( - pBtCoexist, + if (force_exec || (pCoexDm->preRaMask != pCoexDm->curRaMask)) + bt_coexist->fBtcSet( + bt_coexist, BTC_SET_ACT_UPDATE_RAMASK, &pCoexDm->curRaMask ); @@ -91,33 +91,33 @@ static void halbtc8723b1ant_UpdateRaMask( } static void halbtc8723b1ant_AutoRateFallbackRetry( - struct btc_coexist *pBtCoexist, bool bForceExec, u8 type + struct btc_coexist *bt_coexist, bool force_exec, u8 type ) { - bool bWifiUnderBMode = false; + bool wifi_under_b_mode = false; pCoexDm->curArfrType = type; - if (bForceExec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) { + if (force_exec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) { switch (pCoexDm->curArfrType) { case 0: /* normal mode */ - pBtCoexist->fBtcWrite4Byte( - pBtCoexist, 0x430, pCoexDm->backupArfrCnt1 + bt_coexist->fBtcWrite4Byte( + bt_coexist, 0x430, pCoexDm->backupArfrCnt1 ); - pBtCoexist->fBtcWrite4Byte( - pBtCoexist, 0x434, pCoexDm->backupArfrCnt2 + bt_coexist->fBtcWrite4Byte( + bt_coexist, 0x434, pCoexDm->backupArfrCnt2 ); break; case 1: - pBtCoexist->fBtcGet( - pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode + bt_coexist->fBtcGet( + bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode ); - if (bWifiUnderBMode) { - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0); - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x01010101); + if (wifi_under_b_mode) { + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x01010101); } else { - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0); - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x04030201); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x04030201); } break; default: @@ -129,23 +129,23 @@ static void halbtc8723b1ant_AutoRateFallbackRetry( } static void halbtc8723b1ant_RetryLimit( - struct btc_coexist *pBtCoexist, bool bForceExec, u8 type + struct btc_coexist *bt_coexist, bool force_exec, u8 type ) { pCoexDm->curRetryLimitType = type; if ( - bForceExec || + force_exec || (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType) ) { switch (pCoexDm->curRetryLimitType) { case 0: /* normal mode */ - pBtCoexist->fBtcWrite2Byte( - pBtCoexist, 0x42a, pCoexDm->backupRetryLimit + bt_coexist->fBtcWrite2Byte( + bt_coexist, 0x42a, pCoexDm->backupRetryLimit ); break; case 1: /* retry limit =8 */ - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x42a, 0x0808); + bt_coexist->fBtcWrite2Byte(bt_coexist, 0x42a, 0x0808); break; default: break; @@ -156,22 +156,22 @@ static void halbtc8723b1ant_RetryLimit( } static void halbtc8723b1ant_AmpduMaxTime( - struct btc_coexist *pBtCoexist, bool bForceExec, u8 type + struct btc_coexist *bt_coexist, bool force_exec, u8 type ) { pCoexDm->curAmpduTimeType = type; if ( - bForceExec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType) + force_exec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType) ) { switch (pCoexDm->curAmpduTimeType) { case 0: /* normal mode */ - pBtCoexist->fBtcWrite1Byte( - pBtCoexist, 0x456, pCoexDm->backupAmpduMaxTime + bt_coexist->fBtcWrite1Byte( + bt_coexist, 0x456, pCoexDm->backupAmpduMaxTime ); break; case 1: /* AMPDU timw = 0x38 * 32us */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, 0x38); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x456, 0x38); break; default: break; @@ -182,64 +182,64 @@ static void halbtc8723b1ant_AmpduMaxTime( } static void halbtc8723b1ant_LimitedTx( - struct btc_coexist *pBtCoexist, - bool bForceExec, - u8 raMaskType, - u8 arfrType, - u8 retryLimitType, - u8 ampduTimeType + struct btc_coexist *bt_coexist, + bool force_exec, + u8 ra_mask_type, + u8 arfr_type, + u8 retry_limit_type, + u8 ampdu_time_type ) { - switch (raMaskType) { + switch (ra_mask_type) { case 0: /* normal mode */ - halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0); + halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x0); break; case 1: /* disable cck 1/2 */ - halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x00000003); + halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x00000003); break; case 2: /* disable cck 1/2/5.5, ofdm 6/9/12/18/24, mcs 0/1/2/3/4 */ - halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0001f1f7); + halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x0001f1f7); break; default: break; } - halbtc8723b1ant_AutoRateFallbackRetry(pBtCoexist, bForceExec, arfrType); - halbtc8723b1ant_RetryLimit(pBtCoexist, bForceExec, retryLimitType); - halbtc8723b1ant_AmpduMaxTime(pBtCoexist, bForceExec, ampduTimeType); + halbtc8723b1ant_AutoRateFallbackRetry(bt_coexist, force_exec, arfr_type); + halbtc8723b1ant_RetryLimit(bt_coexist, force_exec, retry_limit_type); + halbtc8723b1ant_AmpduMaxTime(bt_coexist, force_exec, ampdu_time_type); } static void halbtc8723b1ant_LimitedRx( - struct btc_coexist *pBtCoexist, - bool bForceExec, - bool bRejApAggPkt, - bool bBtCtrlAggBufSize, - u8 aggBufSize + struct btc_coexist *bt_coexist, + bool force_exec, + bool rej_ap_agg_pkt, + bool bt_ctrl_agg_buf_size, + u8 agg_buf_size ) { - bool bRejectRxAgg = bRejApAggPkt; - bool bBtCtrlRxAggSize = bBtCtrlAggBufSize; - u8 rxAggSize = aggBufSize; + bool bRejectRxAgg = rej_ap_agg_pkt; + bool bBtCtrlRxAggSize = bt_ctrl_agg_buf_size; + u8 rxAggSize = agg_buf_size; /* */ /* Rx Aggregation related setting */ /* */ - pBtCoexist->fBtcSet( - pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg + bt_coexist->fBtcSet( + bt_coexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg ); /* decide BT control aggregation buf size or not */ - pBtCoexist->fBtcSet( - pBtCoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize + bt_coexist->fBtcSet( + bt_coexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize ); /* aggregation buf size, only work when BT control Rx aggregation size. */ - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize); /* real update aggregation setting */ - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); } -static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *bt_coexist) { u8 H2C_Parameter[1] = {0}; @@ -247,17 +247,17 @@ static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist) H2C_Parameter[0] |= BIT0; /* trigger */ - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x61, 1, H2C_Parameter); } -static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *bt_coexist) { u32 regHPTxRx, regLPTxRx, u4Tmp; u32 regHPTx = 0, regHPRx = 0, regLPTx = 0, regLPRx = 0; static u8 NumOfBtCounterChk; /* to avoid 0x76e[3] = 1 (WLAN_Act control by PTA) during IPS */ - /* if (! (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) & 0x8)) */ + /* if (! (bt_coexist->fBtcRead1Byte(bt_coexist, 0x76e) & 0x8)) */ if (pCoexSta->bUnderIps) { pCoexSta->highPriorityTx = 65535; @@ -270,11 +270,11 @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) regHPTxRx = 0x770; regLPTxRx = 0x774; - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regHPTxRx); + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, regHPTxRx); regHPTx = u4Tmp & bMaskLWord; regHPRx = (u4Tmp & bMaskHWord) >> 16; - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regLPTxRx); + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, regLPTxRx); regLPTx = u4Tmp & bMaskLWord; regLPRx = (u4Tmp & bMaskHWord) >> 16; @@ -287,28 +287,28 @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) pCoexSta->popEventCnt++; /* reset counter */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0xc); if ((regHPTx == 0) && (regHPRx == 0) && (regLPTx == 0) && (regLPRx == 0)) { NumOfBtCounterChk++; if (NumOfBtCounterChk >= 3) { - halbtc8723b1ant_QueryBtInfo(pBtCoexist); + halbtc8723b1ant_QueryBtInfo(bt_coexist); NumOfBtCounterChk = 0; } } } -static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *bt_coexist) { - s32 wifiRssi = 0; - bool bWifiBusy = false, bWifiUnderBMode = false; + s32 wifi_rssi = 0; + bool wifi_busy = false, wifi_under_b_mode = false; static u8 nCCKLockCounter; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); - pBtCoexist->fBtcGet( - pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); + bt_coexist->fBtcGet( + bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode ); if (pCoexSta->bUnderIps) { @@ -322,23 +322,23 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist) pCoexSta->nCRCErr_11n = 0; pCoexSta->nCRCErr_11nAgg = 0; } else { - pCoexSta->nCRCOK_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf88); - pCoexSta->nCRCOK_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf94); - pCoexSta->nCRCOK_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf90); - pCoexSta->nCRCOK_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfb8); + pCoexSta->nCRCOK_CCK = bt_coexist->fBtcRead4Byte(bt_coexist, 0xf88); + pCoexSta->nCRCOK_11g = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf94); + pCoexSta->nCRCOK_11n = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf90); + pCoexSta->nCRCOK_11nAgg = bt_coexist->fBtcRead2Byte(bt_coexist, 0xfb8); - pCoexSta->nCRCErr_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf84); - pCoexSta->nCRCErr_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf96); - pCoexSta->nCRCErr_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf92); - pCoexSta->nCRCErr_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfba); + pCoexSta->nCRCErr_CCK = bt_coexist->fBtcRead4Byte(bt_coexist, 0xf84); + pCoexSta->nCRCErr_11g = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf96); + pCoexSta->nCRCErr_11n = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf92); + pCoexSta->nCRCErr_11nAgg = bt_coexist->fBtcRead2Byte(bt_coexist, 0xfba); } /* reset counter */ - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x1); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x0); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x1); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x0); - if (bWifiBusy && (wifiRssi >= 30) && !bWifiUnderBMode) { + if (wifi_busy && (wifi_rssi >= 30) && !wifi_under_b_mode) { if ( (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) || @@ -385,24 +385,24 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist) } -static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist) +static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *bt_coexist) { static bool bPreWifiBusy, bPreUnder4way, bPreBtHsOn; - bool bWifiBusy = false, bUnder4way = false, bBtHsOn = false; + bool wifi_busy = false, bUnder4way = false, bBtHsOn = false; bool bWifiConnected = false; - pBtCoexist->fBtcGet( - pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected + bt_coexist->fBtcGet( + bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected ); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet( - pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + bt_coexist->fBtcGet( + bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way ); if (bWifiConnected) { - if (bWifiBusy != bPreWifiBusy) { - bPreWifiBusy = bWifiBusy; + if (wifi_busy != bPreWifiBusy) { + bPreWifiBusy = wifi_busy; return true; } @@ -420,12 +420,12 @@ static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist) return false; } -static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *bt_coexist) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; bool bBtHsOn = false; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); pBtLinkInfo->bBtLinkExist = pCoexSta->bBtLinkExist; pBtLinkInfo->bScoExist = pCoexSta->bScoExist; @@ -484,14 +484,14 @@ static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist) pBtLinkInfo->bHidOnly = false; } -static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) +static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; bool bBtHsOn = false; u8 algorithm = BT_8723B_1ANT_COEX_ALGO_UNDEFINED; u8 numOfDiffProfile = 0; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (!pBtLinkInfo->bBtLinkExist) return algorithm; @@ -594,7 +594,7 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) } static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( - struct btc_coexist *pBtCoexist, bool bLowPenaltyRa + struct btc_coexist *bt_coexist, bool bLowPenaltyRa ) { u8 H2C_Parameter[6] = {0}; @@ -609,46 +609,46 @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( H2C_Parameter[5] = 0xf9; /* MCS5 or OFDM36 */ } - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x69, 6, H2C_Parameter); } static void halbtc8723b1ant_LowPenaltyRa( - struct btc_coexist *pBtCoexist, bool bForceExec, bool bLowPenaltyRa + struct btc_coexist *bt_coexist, bool force_exec, bool bLowPenaltyRa ) { pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa; - if (!bForceExec) { + if (!force_exec) { if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa) return; } halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( - pBtCoexist, pCoexDm->bCurLowPenaltyRa + bt_coexist, pCoexDm->bCurLowPenaltyRa ); pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa; } static void halbtc8723b1ant_SetCoexTable( - struct btc_coexist *pBtCoexist, + struct btc_coexist *bt_coexist, u32 val0x6c0, u32 val0x6c4, u32 val0x6c8, u8 val0x6cc ) { - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c0, val0x6c0); - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c4, val0x6c4); - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c8, val0x6c8); - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cc, val0x6cc); } static void halbtc8723b1ant_CoexTable( - struct btc_coexist *pBtCoexist, - bool bForceExec, + struct btc_coexist *bt_coexist, + bool force_exec, u32 val0x6c0, u32 val0x6c4, u32 val0x6c8, @@ -660,7 +660,7 @@ static void halbtc8723b1ant_CoexTable( pCoexDm->curVal0x6c8 = val0x6c8; pCoexDm->curVal0x6cc = val0x6cc; - if (!bForceExec) { + if (!force_exec) { if ( (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) && (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) && @@ -671,7 +671,7 @@ static void halbtc8723b1ant_CoexTable( } halbtc8723b1ant_SetCoexTable( - pBtCoexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc + bt_coexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc ); pCoexDm->preVal0x6c0 = pCoexDm->curVal0x6c0; @@ -681,7 +681,7 @@ static void halbtc8723b1ant_CoexTable( } static void halbtc8723b1ant_CoexTableWithType( - struct btc_coexist *pBtCoexist, bool bForceExec, u8 type + struct btc_coexist *bt_coexist, bool force_exec, u8 type ) { pCoexSta->nCoexTableType = type; @@ -689,42 +689,42 @@ static void halbtc8723b1ant_CoexTableWithType( switch (type) { case 0: halbtc8723b1ant_CoexTable( - pBtCoexist, bForceExec, 0x55555555, 0x55555555, 0xffffff, 0x3 + bt_coexist, force_exec, 0x55555555, 0x55555555, 0xffffff, 0x3 ); break; case 1: halbtc8723b1ant_CoexTable( - pBtCoexist, bForceExec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3 + bt_coexist, force_exec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3 ); break; case 2: halbtc8723b1ant_CoexTable( - pBtCoexist, bForceExec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3 + bt_coexist, force_exec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3 ); break; case 3: halbtc8723b1ant_CoexTable( - pBtCoexist, bForceExec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3 + bt_coexist, force_exec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3 ); break; case 4: halbtc8723b1ant_CoexTable( - pBtCoexist, bForceExec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3 + bt_coexist, force_exec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3 ); break; case 5: halbtc8723b1ant_CoexTable( - pBtCoexist, bForceExec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3 + bt_coexist, force_exec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3 ); break; case 6: halbtc8723b1ant_CoexTable( - pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3 + bt_coexist, force_exec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3 ); break; case 7: halbtc8723b1ant_CoexTable( - pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3 + bt_coexist, force_exec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3 ); break; default: @@ -733,7 +733,7 @@ static void halbtc8723b1ant_CoexTableWithType( } static void halbtc8723b1ant_SetFwIgnoreWlanAct( - struct btc_coexist *pBtCoexist, bool bEnable + struct btc_coexist *bt_coexist, bool bEnable ) { u8 H2C_Parameter[1] = {0}; @@ -741,43 +741,43 @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct( if (bEnable) H2C_Parameter[0] |= BIT0; /* function enable */ - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x63, 1, H2C_Parameter); } static void halbtc8723b1ant_IgnoreWlanAct( - struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable + struct btc_coexist *bt_coexist, bool force_exec, bool bEnable ) { pCoexDm->bCurIgnoreWlanAct = bEnable; - if (!bForceExec) { + if (!force_exec) { if (pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct) return; } - halbtc8723b1ant_SetFwIgnoreWlanAct(pBtCoexist, bEnable); + halbtc8723b1ant_SetFwIgnoreWlanAct(bt_coexist, bEnable); pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct; } static void halbtc8723b1ant_SetLpsRpwm( - struct btc_coexist *pBtCoexist, u8 lpsVal, u8 rpwmVal + struct btc_coexist *bt_coexist, u8 lpsVal, u8 rpwmVal ) { u8 lps = lpsVal; u8 rpwm = rpwmVal; - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_LPS_VAL, &lps); - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RPWM_VAL, &rpwm); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_LPS_VAL, &lps); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_RPWM_VAL, &rpwm); } static void halbtc8723b1ant_LpsRpwm( - struct btc_coexist *pBtCoexist, bool bForceExec, u8 lpsVal, u8 rpwmVal + struct btc_coexist *bt_coexist, bool force_exec, u8 lpsVal, u8 rpwmVal ) { pCoexDm->curLps = lpsVal; pCoexDm->curRpwm = rpwmVal; - if (!bForceExec) { + if (!force_exec) { if ( (pCoexDm->preLps == pCoexDm->curLps) && (pCoexDm->preRpwm == pCoexDm->curRpwm) @@ -785,89 +785,89 @@ static void halbtc8723b1ant_LpsRpwm( return; } } - halbtc8723b1ant_SetLpsRpwm(pBtCoexist, lpsVal, rpwmVal); + halbtc8723b1ant_SetLpsRpwm(bt_coexist, lpsVal, rpwmVal); pCoexDm->preLps = pCoexDm->curLps; pCoexDm->preRpwm = pCoexDm->curRpwm; } static void halbtc8723b1ant_SwMechanism( - struct btc_coexist *pBtCoexist, bool bLowPenaltyRA + struct btc_coexist *bt_coexist, bool bLowPenaltyRA ) { - halbtc8723b1ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA); + halbtc8723b1ant_LowPenaltyRa(bt_coexist, NORMAL_EXEC, bLowPenaltyRA); } static void halbtc8723b1ant_SetAntPath( - struct btc_coexist *pBtCoexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff + struct btc_coexist *bt_coexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff ) { - struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo; + struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo; u32 fwVer = 0, u4Tmp = 0, cntBtCalChk = 0; bool bPgExtSwitch = false; bool bUseExtSwitch = false; bool bIsInMpMode = false; u8 H2C_Parameter[2] = {0}, u1Tmp = 0; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */ + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */ if ((fwVer > 0 && fwVer < 0xc0000) || bPgExtSwitch) bUseExtSwitch = true; if (bInitHwCfg) { - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); /* WiFi TRx Mask on */ - pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT TRx Mask on */ + bt_coexist->fBtcSetRfReg(bt_coexist, BTC_RF_A, 0x1, 0xfffff, 0x780); /* WiFi TRx Mask on */ + bt_coexist->fBtcSetBtReg(bt_coexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT TRx Mask on */ if (fwVer >= 0x180000) { /* Use H2C to set GNT_BT to HIGH */ H2C_Parameter[0] = 1; - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter); } else /* set grant_bt to high */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18); /* set wlan_act control by PTA */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x39, 0x8, 0x1); - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x974, 0xff); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x944, 0x3, 0x3); - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x930, 0x77); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x39, 0x8, 0x1); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x974, 0xff); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x944, 0x3, 0x3); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x930, 0x77); } else if (bWifiOff) { if (fwVer >= 0x180000) { /* Use H2C to set GNT_BT to HIGH */ H2C_Parameter[0] = 1; - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter); } else /* set grant_bt to high */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18); /* set wlan_act to always low */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode); if (!bIsInMpMode) - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x0); /* BT select s0/s1 is controlled by BT */ + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x0); /* BT select s0/s1 is controlled by BT */ else - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ /* 0x4c[24:23]= 00, Set Antenna control by BT_RFE_CTRL BT Vendor 0xac = 0xf002 */ - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c); u4Tmp &= ~BIT23; u4Tmp &= ~BIT24; - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp); } else { /* Use H2C to set GNT_BT to LOW */ if (fwVer >= 0x180000) { - if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765) != 0) { + if (bt_coexist->fBtcRead1Byte(bt_coexist, 0x765) != 0) { H2C_Parameter[0] = 0; - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter); } } else { /* BT calibration check */ while (cntBtCalChk <= 20) { - u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49d); + u1Tmp = bt_coexist->fBtcRead1Byte(bt_coexist, 0x49d); cntBtCalChk++; if (u1Tmp & BIT0) @@ -877,34 +877,34 @@ static void halbtc8723b1ant_SetAntPath( } /* set grant_bt to PTA */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x0); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x0); } - if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) != 0xc) + if (bt_coexist->fBtcRead1Byte(bt_coexist, 0x76e) != 0xc) /* set wlan_act control by PTA */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0xc); } if (bUseExtSwitch) { if (bInitHwCfg) { /* 0x4c[23]= 0, 0x4c[24]= 1 Antenna control by WL/BT */ - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c); u4Tmp &= ~BIT23; u4Tmp |= BIT24; - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp); - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); /* fixed internal switch S1->WiFi, S0->BT */ + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); /* fixed internal switch S1->WiFi, S0->BT */ if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) { /* tell firmware "no antenna inverse" */ H2C_Parameter[0] = 0; H2C_Parameter[1] = 1; /* ext switch type */ - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter); } else { /* tell firmware "antenna inverse" */ H2C_Parameter[0] = 1; H2C_Parameter[1] = 1; /* ext switch type */ - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter); } } @@ -913,48 +913,48 @@ static void halbtc8723b1ant_SetAntPath( switch (antPosType) { case BTC_ANT_PATH_WIFI: if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1); else - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2); break; case BTC_ANT_PATH_BT: if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2); else - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1); break; default: case BTC_ANT_PATH_PTA: if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1); else - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2); break; } } else { if (bInitHwCfg) { /* 0x4c[23]= 1, 0x4c[24]= 0 Antenna control by 0x64 */ - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c); u4Tmp |= BIT23; u4Tmp &= ~BIT24; - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp); /* Fix Ext switch Main->S1, Aux->S0 */ - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x64, 0x1, 0x0); if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) { /* tell firmware "no antenna inverse" */ H2C_Parameter[0] = 0; H2C_Parameter[1] = 0; /* internal switch type */ - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter); } else { /* tell firmware "antenna inverse" */ H2C_Parameter[0] = 1; H2C_Parameter[1] = 0; /* internal switch type */ - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter); } } @@ -963,36 +963,36 @@ static void halbtc8723b1ant_SetAntPath( switch (antPosType) { case BTC_ANT_PATH_WIFI: if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); else - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280); break; case BTC_ANT_PATH_BT: if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280); else - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); break; default: case BTC_ANT_PATH_PTA: if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x200); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x200); else - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x80); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x80); break; } } } static void halbtc8723b1ant_SetFwPstdma( - struct btc_coexist *pBtCoexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5 + struct btc_coexist *bt_coexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5 ) { u8 H2C_Parameter[5] = {0}; u8 realByte1 = byte1, realByte5 = byte5; bool bApEnable = false; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); if (bApEnable) { if (byte1 & BIT4 && !(byte1 & BIT5)) { @@ -1016,16 +1016,16 @@ static void halbtc8723b1ant_SetFwPstdma( pCoexDm->psTdmaPara[3] = byte4; pCoexDm->psTdmaPara[4] = realByte5; - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x60, 5, H2C_Parameter); } static void halbtc8723b1ant_PsTdma( - struct btc_coexist *pBtCoexist, bool bForceExec, bool bTurnOn, u8 type + struct btc_coexist *bt_coexist, bool force_exec, bool bTurnOn, u8 type ) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; - bool bWifiBusy = false; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; + bool wifi_busy = false; u8 rssiAdjustVal = 0; u8 psTdmaByte4Val = 0x50, psTdmaByte0Val = 0x51, psTdmaByte3Val = 0x10; s8 nWiFiDurationAdjust = 0x0; @@ -1034,9 +1034,9 @@ static void halbtc8723b1ant_PsTdma( pCoexDm->bCurPsTdmaOn = bTurnOn; pCoexDm->curPsTdma = type; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); - if (!bForceExec) { + if (!force_exec) { if ( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && (pCoexDm->prePsTdma == pCoexDm->curPsTdma) @@ -1066,12 +1066,12 @@ static void halbtc8723b1ant_PsTdma( switch (type) { default: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val + bt_coexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val ); break; case 1: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, + bt_coexist, psTdmaByte0Val, 0x3a + nWiFiDurationAdjust, 0x03, @@ -1081,7 +1081,7 @@ static void halbtc8723b1ant_PsTdma( break; case 2: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, + bt_coexist, psTdmaByte0Val, 0x2d + nWiFiDurationAdjust, 0x03, @@ -1091,35 +1091,35 @@ static void halbtc8723b1ant_PsTdma( break; case 3: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, 0x10 + bt_coexist, 0x51, 0x1d, 0x1d, 0x0, 0x10 ); break; case 4: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x93, 0x15, 0x3, 0x14, 0x0 + bt_coexist, 0x93, 0x15, 0x3, 0x14, 0x0 ); break; case 5: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x61, 0x15, 0x3, 0x11, 0x10 + bt_coexist, 0x61, 0x15, 0x3, 0x11, 0x10 ); break; case 6: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x61, 0x20, 0x3, 0x11, 0x11 + bt_coexist, 0x61, 0x20, 0x3, 0x11, 0x11 ); break; case 7: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xc, 0x5, 0x0, 0x0); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xc, 0x5, 0x0, 0x0); break; case 8: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0 + bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0 ); break; case 9: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, + bt_coexist, psTdmaByte0Val, 0x21, 0x3, @@ -1128,11 +1128,11 @@ static void halbtc8723b1ant_PsTdma( ); break; case 10: - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0xa, 0x0, 0x40); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xa, 0xa, 0x0, 0x40); break; case 11: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, + bt_coexist, psTdmaByte0Val, 0x21, 0x03, @@ -1142,124 +1142,124 @@ static void halbtc8723b1ant_PsTdma( break; case 12: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x51, 0x0a, 0x0a, 0x0, 0x50 + bt_coexist, 0x51, 0x0a, 0x0a, 0x0, 0x50 ); break; case 13: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x51, 0x12, 0x12, 0x0, 0x10 + bt_coexist, 0x51, 0x12, 0x12, 0x0, 0x10 ); break; case 14: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val + bt_coexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val ); break; case 15: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x13, 0xa, 0x3, 0x8, 0x0 + bt_coexist, 0x13, 0xa, 0x3, 0x8, 0x0 ); break; case 16: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x93, 0x15, 0x3, 0x10, 0x0 + bt_coexist, 0x93, 0x15, 0x3, 0x10, 0x0 ); break; case 18: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0 + bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0 ); break; case 20: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x61, 0x3f, 0x03, 0x11, 0x10 + bt_coexist, 0x61, 0x3f, 0x03, 0x11, 0x10 ); break; case 21: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x11 + bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x11 ); break; case 22: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x10 + bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x10 ); break; case 23: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x18 + bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x18 ); break; case 24: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xe3, 0x15, 0x3, 0x31, 0x18 + bt_coexist, 0xe3, 0x15, 0x3, 0x31, 0x18 ); break; case 25: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18 + bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18 ); break; case 26: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18 + bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18 ); break; case 27: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x98 + bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x98 ); break; case 28: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x69, 0x25, 0x3, 0x31, 0x0 + bt_coexist, 0x69, 0x25, 0x3, 0x31, 0x0 ); break; case 29: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xab, 0x1a, 0x1a, 0x1, 0x10 + bt_coexist, 0xab, 0x1a, 0x1a, 0x1, 0x10 ); break; case 30: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x51, 0x30, 0x3, 0x10, 0x10 + bt_coexist, 0x51, 0x30, 0x3, 0x10, 0x10 ); break; case 31: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58 + bt_coexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58 ); break; case 32: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x61, 0x35, 0x3, 0x11, 0x11 + bt_coexist, 0x61, 0x35, 0x3, 0x11, 0x11 ); break; case 33: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xa3, 0x25, 0x3, 0x30, 0x90 + bt_coexist, 0xa3, 0x25, 0x3, 0x30, 0x90 ); break; case 34: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x53, 0x1a, 0x1a, 0x0, 0x10 + bt_coexist, 0x53, 0x1a, 0x1a, 0x0, 0x10 ); break; case 35: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x63, 0x1a, 0x1a, 0x0, 0x10 + bt_coexist, 0x63, 0x1a, 0x1a, 0x0, 0x10 ); break; case 36: halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0xd3, 0x12, 0x3, 0x14, 0x50 + bt_coexist, 0xd3, 0x12, 0x3, 0x14, 0x50 ); break; case 40: /* SoftAP only with no sta associated, BT disable , TDMA mode for power saving */ /* here softap mode screen off will cost 70-80mA for phone */ halbtc8723b1ant_SetFwPstdma( - pBtCoexist, 0x23, 0x18, 0x00, 0x10, 0x24 + bt_coexist, 0x23, 0x18, 0x00, 0x10, 0x24 ); break; } @@ -1268,30 +1268,30 @@ static void halbtc8723b1ant_PsTdma( /* disable PS tdma */ switch (type) { case 8: /* PTA Control */ - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x8, 0x0, 0x0, 0x0, 0x0); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x8, 0x0, 0x0, 0x0, 0x0); halbtc8723b1ant_SetAntPath( - pBtCoexist, BTC_ANT_PATH_PTA, false, false + bt_coexist, BTC_ANT_PATH_PTA, false, false ); break; case 0: default: /* Software control, Antenna at BT side */ - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0); halbtc8723b1ant_SetAntPath( - pBtCoexist, BTC_ANT_PATH_BT, false, false + bt_coexist, BTC_ANT_PATH_BT, false, false ); break; case 9: /* Software control, Antenna at WiFi side */ - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0); halbtc8723b1ant_SetAntPath( - pBtCoexist, BTC_ANT_PATH_WIFI, false, false + bt_coexist, BTC_ANT_PATH_WIFI, false, false ); break; } } rssiAdjustVal = 0; - pBtCoexist->fBtcSet( - pBtCoexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal + bt_coexist->fBtcSet( + bt_coexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal ); /* update pre state */ @@ -1299,46 +1299,46 @@ static void halbtc8723b1ant_PsTdma( pCoexDm->prePsTdma = pCoexDm->curPsTdma; } -static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) +static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *bt_coexist) { - bool bCommon = false, bWifiConnected = false, bWifiBusy = false; + bool bCommon = false, bWifiConnected = false, wifi_busy = false; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); if ( !bWifiConnected && pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE ) { - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; } else if ( bWifiConnected && (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE) ) { - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; } else if ( !bWifiConnected && (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; } else if ( bWifiConnected && (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; } else if ( !bWifiConnected && (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; } else { @@ -1350,7 +1350,7 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) static void halbtc8723b1ant_TdmaDurationAdjustForAcl( - struct btc_coexist *pBtCoexist, u8 wifiStatus + struct btc_coexist *bt_coexist, u8 wifiStatus ) { static s32 up, dn, m, n, WaitCount; @@ -1368,7 +1368,7 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( pCoexDm->curPsTdma != 3 && pCoexDm->curPsTdma != 9 ) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); pCoexDm->psTdmaDuAdjType = 9; up = 0; @@ -1384,7 +1384,7 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( if (!pCoexDm->bAutoTdmaAdjust) { pCoexDm->bAutoTdmaAdjust = true; - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2); pCoexDm->psTdmaDuAdjType = 2; /* */ up = 0; @@ -1461,16 +1461,16 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) && ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2)) ) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); pCoexDm->psTdmaDuAdjType = 9; } else if (pCoexDm->curPsTdma == 1) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2); pCoexDm->psTdmaDuAdjType = 2; } else if (pCoexDm->curPsTdma == 2) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); pCoexDm->psTdmaDuAdjType = 9; } else if (pCoexDm->curPsTdma == 9) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 11); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 11); pCoexDm->psTdmaDuAdjType = 11; } } else if (result == 1) { @@ -1478,16 +1478,16 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) && ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2)) ) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); pCoexDm->psTdmaDuAdjType = 9; } else if (pCoexDm->curPsTdma == 11) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); pCoexDm->psTdmaDuAdjType = 9; } else if (pCoexDm->curPsTdma == 9) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2); pCoexDm->psTdmaDuAdjType = 2; } else if (pCoexDm->curPsTdma == 2) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 1); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 1); pCoexDm->psTdmaDuAdjType = 1; } } @@ -1499,27 +1499,27 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( pCoexDm->curPsTdma != 11 ) /* recover to previous adjust type */ halbtc8723b1ant_PsTdma( - pBtCoexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType + bt_coexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType ); } } static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState( - struct btc_coexist *pBtCoexist, bool bNewPsState + struct btc_coexist *bt_coexist, bool bNewPsState ) { u8 lpsMode = 0x0; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_LPS_MODE, &lpsMode); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_LPS_MODE, &lpsMode); if (lpsMode) { /* already under LPS state */ if (bNewPsState) { /* keep state under LPS, do nothing. */ } else /* will leave LPS state, turn off psTdma first */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0); } else { /* NO PS state */ if (bNewPsState) /* will enter LPS state, turn off psTdma first */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0); else { /* keep state under NO PS state, do nothing. */ } @@ -1527,7 +1527,7 @@ static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState( } static void halbtc8723b1ant_PowerSaveState( - struct btc_coexist *pBtCoexist, u8 psType, u8 lpsVal, u8 rpwmVal + struct btc_coexist *bt_coexist, u8 psType, u8 lpsVal, u8 rpwmVal ) { bool bLowPwrDisable = false; @@ -1536,27 +1536,27 @@ static void halbtc8723b1ant_PowerSaveState( case BTC_PS_WIFI_NATIVE: /* recover to original 32k low power setting */ bLowPwrDisable = false; - pBtCoexist->fBtcSet( - pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable + bt_coexist->fBtcSet( + bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable ); - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_NORMAL_LPS, NULL); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_NORMAL_LPS, NULL); pCoexSta->bForceLpsOn = false; break; case BTC_PS_LPS_ON: - halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, true); - halbtc8723b1ant_LpsRpwm(pBtCoexist, NORMAL_EXEC, lpsVal, rpwmVal); + halbtc8723b1ant_PsTdmaCheckForPowerSaveState(bt_coexist, true); + halbtc8723b1ant_LpsRpwm(bt_coexist, NORMAL_EXEC, lpsVal, rpwmVal); /* when coex force to enter LPS, do not enter 32k low power. */ bLowPwrDisable = true; - pBtCoexist->fBtcSet( - pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable + bt_coexist->fBtcSet( + bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable ); /* power save must executed before psTdma. */ - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_ENTER_LPS, NULL); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_ENTER_LPS, NULL); pCoexSta->bForceLpsOn = true; break; case BTC_PS_LPS_OFF: - halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, false); - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_LEAVE_LPS, NULL); + halbtc8723b1ant_PsTdmaCheckForPowerSaveState(bt_coexist, false); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_LEAVE_LPS, NULL); pCoexSta->bForceLpsOn = false; break; default: @@ -1575,86 +1575,86 @@ static void halbtc8723b1ant_PowerSaveState( /* Non-Software Coex Mechanism start */ /* */ /* */ -static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *bt_coexist) { - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); } -static void halbtc8723b1ant_ActionHs(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_ActionHs(struct btc_coexist *bt_coexist) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 5); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 5); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); } -static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *bt_coexist) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; bool bWifiConnected = false; bool bApEnable = false; - bool bWifiBusy = false; + bool wifi_busy = false; bool bBtBusy = false; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); if (!bWifiConnected && !pCoexSta->bWiFiIsHighPriTask) { - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0); } else if ( pBtLinkInfo->bScoExist || pBtLinkInfo->bHidExist || pBtLinkInfo->bA2dpExist ) { /* SCO/HID/A2DP busy */ - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); - } else if (pBtLinkInfo->bPanExist || bWifiBusy) { - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); + } else if (pBtLinkInfo->bPanExist || wifi_busy) { + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else { - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7); } } static void halbtc8723b1ant_ActionBtScoHidOnlyBusy( - struct btc_coexist *pBtCoexist, u8 wifiStatus + struct btc_coexist *bt_coexist, u8 wifiStatus ) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; bool bWifiConnected = false; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); /* tdma and coex table */ if (pBtLinkInfo->bScoExist) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 5); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 5); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 5); } else { /* HID */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 6); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 6); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 5); } } static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy( - struct btc_coexist *pBtCoexist, u8 wifiStatus + struct btc_coexist *bt_coexist, u8 wifiStatus ) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; halbtc8723b1ant_BtRssiState(2, 28, 0); @@ -1664,97 +1664,97 @@ static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy( pBtLinkInfo->bSlaveRole = false; if (pBtLinkInfo->bHidOnly) { /* HID */ - halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist, wifiStatus); + halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, wifiStatus); pCoexDm->bAutoTdmaAdjust = false; return; } else if (pBtLinkInfo->bA2dpOnly) { /* A2DP */ if (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = false; } else { - halbtc8723b1ant_TdmaDurationAdjustForAcl(pBtCoexist, wifiStatus); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_TdmaDurationAdjustForAcl(bt_coexist, wifiStatus); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = true; } } else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { /* HID+A2DP */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 14); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 14); pCoexDm->bAutoTdmaAdjust = false; - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else if ( pBtLinkInfo->bPanOnly || (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) ) { /* PAN(OPP, FTP), HID+PAN(OPP, FTP) */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 3); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 3); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = false; } else if ( (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) || (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) ) { /* A2DP+PAN(OPP, FTP), HID+A2DP+PAN(OPP, FTP) */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 13); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 13); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = false; } else { /* BT no-profile busy (0x9) */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = false; } } -static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *bt_coexist) { /* power save state */ - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ - halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); + halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0); } static void halbtc8723b1ant_ActionWifiNotConnectedScan( - struct btc_coexist *pBtCoexist + struct btc_coexist *bt_coexist ) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { if (pBtLinkInfo->bA2dpExist) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 22); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 22); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } } else if ( (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { halbtc8723b1ant_ActionBtScoHidOnlyBusy( - pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN + bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN ); } else { /* Bryant Add */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); } } static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth( - struct btc_coexist *pBtCoexist + struct btc_coexist *bt_coexist ) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ if ( @@ -1762,56 +1762,56 @@ static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth( (pBtLinkInfo->bHidExist) || (pBtLinkInfo->bA2dpExist) ) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else if (pBtLinkInfo->bPanExist) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); } } -static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *bt_coexist) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { if (pBtLinkInfo->bA2dpExist) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 22); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 22); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } } else if ( (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { halbtc8723b1ant_ActionBtScoHidOnlyBusy( - pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN + bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN ); } else { /* Bryant Add */ - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); } } static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket( - struct btc_coexist *pBtCoexist + struct btc_coexist *bt_coexist ) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ if ( @@ -1819,62 +1819,62 @@ static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket( (pBtLinkInfo->bHidExist) || (pBtLinkInfo->bA2dpExist) ) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else if (pBtLinkInfo->bPanExist) { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } else { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); } } -static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist) { - bool bWifiBusy = false; + bool wifi_busy = false; bool bScan = false, bLink = false, bRoam = false; bool bUnder4way = false, bApEnable = false; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way); if (bUnder4way) { - halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); + halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist); return; } - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_SCAN, &bScan); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_LINK, &bLink); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_ROAM, &bRoam); if (bScan || bLink || bRoam) { if (bScan) - halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist); + halbtc8723b1ant_ActionWifiConnectedScan(bt_coexist); else - halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); + halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist); return; } - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); /* power save state */ if ( !bApEnable && pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY && - !pBtCoexist->btLinkInfo.bHidOnly + !bt_coexist->btLinkInfo.bHidOnly ) { - if (pBtCoexist->btLinkInfo.bA2dpOnly) { /* A2DP */ - if (!bWifiBusy) + if (bt_coexist->btLinkInfo.bA2dpOnly) { /* A2DP */ + if (!wifi_busy) halbtc8723b1ant_PowerSaveState( - pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 + bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 ); else { /* busy */ if (pCoexSta->nScanAPNum >= BT_8723B_1ANT_WIFI_NOISY_THRESH) /* no force LPS, no PS-TDMA, use pure TDMA */ halbtc8723b1ant_PowerSaveState( - pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 + bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 ); else halbtc8723b1ant_PowerSaveState( - pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4 + bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4 ); } } else if ( @@ -1882,37 +1882,37 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) (!pCoexSta->bA2dpExist) && (!pCoexSta->bHidExist) ) - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); else - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4); } else - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ - if (!bWifiBusy) { + if (!wifi_busy) { if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { halbtc8723b1ant_ActionWifiConnectedBtAclBusy( - pBtCoexist, + bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE ); } else if ( (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { - halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist, + halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE); } else { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); if ((pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60) - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); else - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7); } } else { if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { halbtc8723b1ant_ActionWifiConnectedBtAclBusy( - pBtCoexist, + bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY ); } else if ( @@ -1920,60 +1920,60 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { halbtc8723b1ant_ActionBtScoHidOnlyBusy( - pBtCoexist, + bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY ); } else { - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); if ((pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60) - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); else - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7); } } } -static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *bt_coexist) { u8 algorithm = 0; - algorithm = halbtc8723b1ant_ActionAlgorithm(pBtCoexist); + algorithm = halbtc8723b1ant_ActionAlgorithm(bt_coexist); pCoexDm->curAlgorithm = algorithm; - if (halbtc8723b1ant_IsCommonAction(pBtCoexist)) { + if (halbtc8723b1ant_IsCommonAction(bt_coexist)) { } else { switch (pCoexDm->curAlgorithm) { case BT_8723B_1ANT_COEX_ALGO_SCO: - /* halbtc8723b1ant_ActionSco(pBtCoexist); */ + /* halbtc8723b1ant_ActionSco(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID: - /* halbtc8723b1ant_ActionHid(pBtCoexist); */ + /* halbtc8723b1ant_ActionHid(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_A2DP: - /* halbtc8723b1ant_ActionA2dp(pBtCoexist); */ + /* halbtc8723b1ant_ActionA2dp(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS: - /* halbtc8723b1ant_ActionA2dpPanHs(pBtCoexist); */ + /* halbtc8723b1ant_ActionA2dpPanHs(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR: - /* halbtc8723b1ant_ActionPanEdr(pBtCoexist); */ + /* halbtc8723b1ant_ActionPanEdr(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANHS: - /* halbtc8723b1ant_ActionPanHs(pBtCoexist); */ + /* halbtc8723b1ant_ActionPanHs(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP: - /* halbtc8723b1ant_ActionPanEdrA2dp(pBtCoexist); */ + /* halbtc8723b1ant_ActionPanEdrA2dp(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_PANEDR_HID: - /* halbtc8723b1ant_ActionPanEdrHid(pBtCoexist); */ + /* halbtc8723b1ant_ActionPanEdrHid(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR: - /* halbtc8723b1ant_ActionHidA2dpPanEdr(pBtCoexist); */ + /* halbtc8723b1ant_ActionHidA2dpPanEdr(bt_coexist); */ break; case BT_8723B_1ANT_COEX_ALGO_HID_A2DP: - /* halbtc8723b1ant_ActionHidA2dp(pBtCoexist); */ + /* halbtc8723b1ant_ActionHidA2dp(bt_coexist); */ break; default: break; @@ -1982,20 +1982,20 @@ static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist } } -static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *bt_coexist) { - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; bool bWifiConnected = false, bBtHsOn = false; bool bIncreaseScanDevNum = false; - bool bBtCtrlAggBufSize = false; - u8 aggBufSize = 5; + bool bt_ctrl_agg_buf_size = false; + u8 agg_buf_size = 5; u32 wifiLinkStatus = 0; u32 numOfWifiLink = 0; - if (pBtCoexist->bManualControl) + if (bt_coexist->bManualControl) return; - if (pBtCoexist->bStopCoexDm) + if (bt_coexist->bStopCoexDm) return; if (pCoexSta->bUnderIps) @@ -2009,61 +2009,61 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) bIncreaseScanDevNum = true; } - pBtCoexist->fBtcSet( - pBtCoexist, + bt_coexist->fBtcSet( + bt_coexist, BTC_SET_BL_INC_SCAN_DEV_NUM, &bIncreaseScanDevNum ); - pBtCoexist->fBtcGet( - pBtCoexist, + bt_coexist->fBtcGet( + bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected ); - pBtCoexist->fBtcGet( - pBtCoexist, + bt_coexist->fBtcGet( + bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus ); numOfWifiLink = wifiLinkStatus >> 16; if ((numOfWifiLink >= 2) || (wifiLinkStatus & WIFI_P2P_GO_CONNECTED)) { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize); + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size); if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage)) - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); + halbtc8723b1ant_ActionBtInquiry(bt_coexist); else - halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); + halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); return; } if ((pBtLinkInfo->bBtLinkExist) && (bWifiConnected)) { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 0, 1); + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 1, 1, 0, 1); if (pBtLinkInfo->bScoExist) - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, true, 0x5); + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, true, 0x5); else - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, true, 0x8); + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, true, 0x8); - halbtc8723b1ant_SwMechanism(pBtCoexist, true); - halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); /* just print debug message */ + halbtc8723b1ant_SwMechanism(bt_coexist, true); + halbtc8723b1ant_RunSwCoexistMechanism(bt_coexist); /* just print debug message */ } else { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x5); + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, false, 0x5); - halbtc8723b1ant_SwMechanism(pBtCoexist, false); - halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); /* just print debug message */ + halbtc8723b1ant_SwMechanism(bt_coexist, false); + halbtc8723b1ant_RunSwCoexistMechanism(bt_coexist); /* just print debug message */ } - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (pCoexSta->bC2hBtInquiryPage) { - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); + halbtc8723b1ant_ActionBtInquiry(bt_coexist); return; } else if (bBtHsOn) { - halbtc8723b1ant_ActionHs(pBtCoexist); + halbtc8723b1ant_ActionHs(bt_coexist); return; } @@ -2071,62 +2071,62 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) if (!bWifiConnected) { bool bScan = false, bLink = false, bRoam = false; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_SCAN, &bScan); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_LINK, &bLink); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_ROAM, &bRoam); if (bScan || bLink || bRoam) { if (bScan) - halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist); + halbtc8723b1ant_ActionWifiNotConnectedScan(bt_coexist); else - halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); + halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(bt_coexist); } else - halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); + halbtc8723b1ant_ActionWifiNotConnected(bt_coexist); } else /* wifi LPS/Busy */ - halbtc8723b1ant_ActionWifiConnected(pBtCoexist); + halbtc8723b1ant_ActionWifiConnected(bt_coexist); } -static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist) +static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist) { /* force to reset coex mechanism */ /* sw all off */ - halbtc8723b1ant_SwMechanism(pBtCoexist, false); + halbtc8723b1ant_SwMechanism(bt_coexist, false); - /* halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); */ - halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); + /* halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); */ + halbtc8723b1ant_CoexTableWithType(bt_coexist, FORCE_EXEC, 0); pCoexSta->popEventCnt = 0; } static void halbtc8723b1ant_InitHwConfig( - struct btc_coexist *pBtCoexist, + struct btc_coexist *bt_coexist, bool bBackUp, bool bWifiOnly ) { - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */ + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */ /* 0x790[5:0]= 0x5 */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x790, 0x5); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x790, 0x5); /* Enable counter statistics */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x1); - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x778, 0x1); + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x40, 0x20, 0x1); /* Antenna config */ if (bWifiOnly) { - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_WIFI, true, false); - halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 9); + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_WIFI, true, false); + halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 9); } else - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, true, false); + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, true, false); /* PTA parameter */ - halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); + halbtc8723b1ant_CoexTableWithType(bt_coexist, FORCE_EXEC, 0); - pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); - pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); - pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); + bt_coexist->fBtcRead4Byte(bt_coexist, 0x948); + bt_coexist->fBtcRead1Byte(bt_coexist, 0x765); + bt_coexist->fBtcRead1Byte(bt_coexist, 0x67); } /* */ @@ -2135,22 +2135,22 @@ static void halbtc8723b1ant_InitHwConfig( /* */ /* extern function start with EXhalbtc8723b1ant_ */ /* */ -void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist) +void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *bt_coexist) { - struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo; + struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo; u8 u1Tmp = 0x0; u16 u2Tmp = 0x0; - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x67, 0x20); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x67, 0x20); /* enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. */ - u2Tmp = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x2); - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp | BIT0 | BIT1); + u2Tmp = bt_coexist->fBtcRead2Byte(bt_coexist, 0x2); + bt_coexist->fBtcWrite2Byte(bt_coexist, 0x2, u2Tmp | BIT0 | BIT1); /* set GRAN_BT = 1 */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18); /* set WLAN_ACT = 0 */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4); /* */ /* S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) */ @@ -2159,71 +2159,71 @@ void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist) /* BIT1: "0" for internal switch; "1" for external switch */ /* BIT2: "0" for one antenna; "1" for two antenna */ /* NOTE: here default all internal switch and 1-antenna ==> BIT1 = 0 and BIT2 = 0 */ - if (pBtCoexist->chipInterface == BTC_INTF_USB) { + if (bt_coexist->chipInterface == BTC_INTF_USB) { /* fixed at S0 for USB interface */ - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); u1Tmp |= 0x1; /* antenna inverse */ - pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0xfe08, u1Tmp); + bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0xfe08, u1Tmp); pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT; } else { /* for PCIE and SDIO interface, we check efuse 0xc3[6] */ if (pBoardInfo->singleAntPath == 0) { /* set to S1 */ - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280); pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; } else if (pBoardInfo->singleAntPath == 1) { /* set to S0 */ - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); u1Tmp |= 0x1; /* antenna inverse */ pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT; } - if (pBtCoexist->chipInterface == BTC_INTF_PCI) - pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x384, u1Tmp); - else if (pBtCoexist->chipInterface == BTC_INTF_SDIO) - pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x60, u1Tmp); + if (bt_coexist->chipInterface == BTC_INTF_PCI) + bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0x384, u1Tmp); + else if (bt_coexist->chipInterface == BTC_INTF_SDIO) + bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0x60, u1Tmp); } } -void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOnly) +void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *bt_coexist, bool bWifiOnly) { - halbtc8723b1ant_InitHwConfig(pBtCoexist, true, bWifiOnly); + halbtc8723b1ant_InitHwConfig(bt_coexist, true, bWifiOnly); } -void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist) +void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist) { - pBtCoexist->bStopCoexDm = false; + bt_coexist->bStopCoexDm = false; - halbtc8723b1ant_InitCoexDm(pBtCoexist); + halbtc8723b1ant_InitCoexDm(bt_coexist); - halbtc8723b1ant_QueryBtInfo(pBtCoexist); + halbtc8723b1ant_QueryBtInfo(bt_coexist); } -void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) +void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *bt_coexist, u8 type) { - if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) + if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm) return; if (type == BTC_IPS_ENTER) { pCoexSta->bUnderIps = true; - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0); + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true); } else if (type == BTC_IPS_LEAVE) { pCoexSta->bUnderIps = false; - halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false); - halbtc8723b1ant_InitCoexDm(pBtCoexist); - halbtc8723b1ant_QueryBtInfo(pBtCoexist); + halbtc8723b1ant_InitHwConfig(bt_coexist, false, false); + halbtc8723b1ant_InitCoexDm(bt_coexist); + halbtc8723b1ant_QueryBtInfo(bt_coexist); } } -void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) +void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *bt_coexist, u8 type) { - if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) + if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm) return; if (type == BTC_LPS_ENABLE) @@ -2232,85 +2232,85 @@ void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) pCoexSta->bUnderLps = false; } -void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) +void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *bt_coexist, u8 type) { bool bWifiConnected = false, bBtHsOn = false; u32 wifiLinkStatus = 0; u32 numOfWifiLink = 0; - bool bBtCtrlAggBufSize = false; - u8 aggBufSize = 5; + bool bt_ctrl_agg_buf_size = false; + u8 agg_buf_size = 5; - if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) + if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm) return; if (type == BTC_SCAN_START) { pCoexSta->bWiFiIsHighPriTask = true; - halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */ - pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); - pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); - pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); + halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */ + bt_coexist->fBtcRead4Byte(bt_coexist, 0x948); + bt_coexist->fBtcRead1Byte(bt_coexist, 0x765); + bt_coexist->fBtcRead1Byte(bt_coexist, 0x67); } else { pCoexSta->bWiFiIsHighPriTask = false; - pBtCoexist->fBtcGet( - pBtCoexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum + bt_coexist->fBtcGet( + bt_coexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum ); } - if (pBtCoexist->btInfo.bBtDisabled) + if (bt_coexist->btInfo.bBtDisabled) return; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); - halbtc8723b1ant_QueryBtInfo(pBtCoexist); + halbtc8723b1ant_QueryBtInfo(bt_coexist); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); numOfWifiLink = wifiLinkStatus >> 16; if (numOfWifiLink >= 2) { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); halbtc8723b1ant_LimitedRx( - pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize + bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size ); - halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); + halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); return; } if (pCoexSta->bC2hBtInquiryPage) { - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); + halbtc8723b1ant_ActionBtInquiry(bt_coexist); return; } else if (bBtHsOn) { - halbtc8723b1ant_ActionHs(pBtCoexist); + halbtc8723b1ant_ActionHs(bt_coexist); return; } if (type == BTC_SCAN_START) { if (!bWifiConnected) /* non-connected scan */ - halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist); + halbtc8723b1ant_ActionWifiNotConnectedScan(bt_coexist); else /* wifi is connected */ - halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist); + halbtc8723b1ant_ActionWifiConnectedScan(bt_coexist); } else if (type == BTC_SCAN_FINISH) { if (!bWifiConnected) /* non-connected scan */ - halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); + halbtc8723b1ant_ActionWifiNotConnected(bt_coexist); else - halbtc8723b1ant_ActionWifiConnected(pBtCoexist); + halbtc8723b1ant_ActionWifiConnected(bt_coexist); } } -void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) +void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *bt_coexist, u8 type) { bool bWifiConnected = false, bBtHsOn = false; u32 wifiLinkStatus = 0; u32 numOfWifiLink = 0; - bool bBtCtrlAggBufSize = false; - u8 aggBufSize = 5; + bool bt_ctrl_agg_buf_size = false; + u8 agg_buf_size = 5; if ( - pBtCoexist->bManualControl || - pBtCoexist->bStopCoexDm || - pBtCoexist->btInfo.bBtDisabled + bt_coexist->bManualControl || + bt_coexist->bStopCoexDm || + bt_coexist->btInfo.bBtDisabled ) return; @@ -2322,79 +2322,79 @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) /* pCoexDm->nArpCnt = 0; */ } - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); numOfWifiLink = wifiLinkStatus >> 16; if (numOfWifiLink >= 2) { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize); - halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size); + halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); return; } - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (pCoexSta->bC2hBtInquiryPage) { - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); + halbtc8723b1ant_ActionBtInquiry(bt_coexist); return; } else if (bBtHsOn) { - halbtc8723b1ant_ActionHs(pBtCoexist); + halbtc8723b1ant_ActionHs(bt_coexist); return; } if (type == BTC_ASSOCIATE_START) { - halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); + halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(bt_coexist); } else if (type == BTC_ASSOCIATE_FINISH) { - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if (!bWifiConnected) /* non-connected scan */ - halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); + halbtc8723b1ant_ActionWifiNotConnected(bt_coexist); else - halbtc8723b1ant_ActionWifiConnected(pBtCoexist); + halbtc8723b1ant_ActionWifiConnected(bt_coexist); } } -void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type) +void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *bt_coexist, u8 type) { u8 H2C_Parameter[3] = {0}; u32 wifiBw; u8 wifiCentralChnl; - bool bWifiUnderBMode = false; + bool wifi_under_b_mode = false; if ( - pBtCoexist->bManualControl || - pBtCoexist->bStopCoexDm || - pBtCoexist->btInfo.bBtDisabled + bt_coexist->bManualControl || + bt_coexist->bStopCoexDm || + bt_coexist->btInfo.bBtDisabled ) return; if (type == BTC_MEDIA_CONNECT) { - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode); /* Set CCK Tx/Rx high Pri except 11b mode */ - if (bWifiUnderBMode) { - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x00); /* CCK Tx */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x00); /* CCK Rx */ + if (wifi_under_b_mode) { + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x00); /* CCK Tx */ + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x00); /* CCK Rx */ } else { - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x10); /* CCK Tx */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x10); /* CCK Rx */ + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x10); /* CCK Tx */ + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x10); /* CCK Rx */ } - pCoexDm->backupArfrCnt1 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430); - pCoexDm->backupArfrCnt2 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x434); - pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a); - pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456); + pCoexDm->backupArfrCnt1 = bt_coexist->fBtcRead4Byte(bt_coexist, 0x430); + pCoexDm->backupArfrCnt2 = bt_coexist->fBtcRead4Byte(bt_coexist, 0x434); + pCoexDm->backupRetryLimit = bt_coexist->fBtcRead2Byte(bt_coexist, 0x42a); + pCoexDm->backupAmpduMaxTime = bt_coexist->fBtcRead1Byte(bt_coexist, 0x456); } else { pCoexDm->nArpCnt = 0; - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x0); /* CCK Tx */ - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x0); /* CCK Rx */ + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x0); /* CCK Tx */ + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x0); /* CCK Rx */ } /* only 2.4G we need to inform bt the chnl mask */ - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); if ((type == BTC_MEDIA_CONNECT) && (wifiCentralChnl <= 14)) { /* H2C_Parameter[0] = 0x1; */ H2C_Parameter[0] = 0x0; H2C_Parameter[1] = wifiCentralChnl; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_BW, &wifiBw); if (wifiBw == BTC_WIFI_BW_HT40) H2C_Parameter[2] = 0x30; @@ -2406,21 +2406,21 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1]; pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2]; - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); + bt_coexist->fBtcFillH2c(bt_coexist, 0x66, 3, H2C_Parameter); } -void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 type) +void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 type) { bool bBtHsOn = false; u32 wifiLinkStatus = 0; u32 numOfWifiLink = 0; - bool bBtCtrlAggBufSize = false; - u8 aggBufSize = 5; + bool bt_ctrl_agg_buf_size = false; + u8 agg_buf_size = 5; if ( - pBtCoexist->bManualControl || - pBtCoexist->bStopCoexDm || - pBtCoexist->btInfo.bBtDisabled + bt_coexist->bManualControl || + bt_coexist->bStopCoexDm || + bt_coexist->btInfo.bBtDisabled ) return; @@ -2432,7 +2432,7 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty if (type == BTC_PACKET_ARP) { pCoexDm->nArpCnt++; - if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) */ + if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(bt_coexist) */ pCoexSta->bWiFiIsHighPriTask = false; else pCoexSta->bWiFiIsHighPriTask = true; @@ -2445,26 +2445,26 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty pCoexSta->specialPktPeriodCnt = 0; - pBtCoexist->fBtcGet( - pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus + bt_coexist->fBtcGet( + bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus ); numOfWifiLink = wifiLinkStatus >> 16; if (numOfWifiLink >= 2) { - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); halbtc8723b1ant_LimitedRx( - pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize + bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size ); - halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); + halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); return; } - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); if (pCoexSta->bC2hBtInquiryPage) { - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); + halbtc8723b1ant_ActionBtInquiry(bt_coexist); return; } else if (bBtHsOn) { - halbtc8723b1ant_ActionHs(pBtCoexist); + halbtc8723b1ant_ActionHs(bt_coexist); return; } @@ -2473,11 +2473,11 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty type == BTC_PACKET_EAPOL || ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask)) ) - halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); + halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist); } void EXhalbtc8723b1ant_BtInfoNotify( - struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length + struct btc_coexist *bt_coexist, u8 *tmpBuf, u8 length ) { u8 btInfo = 0; @@ -2509,32 +2509,32 @@ void EXhalbtc8723b1ant_BtInfoNotify( else pCoexSta->bC2hBtPage = false; - pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3] * 2 - 90; + pCoexSta->bt_rssi = pCoexSta->btInfoC2h[rspSource][3] * 2 - 90; /* pCoexSta->btInfoC2h[rspSource][3]*2+10; */ pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4]; pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2] & 0x40); - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); if (!pCoexSta->bBtTxRxMask) { /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */ - pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); + bt_coexist->fBtcSetBtReg(bt_coexist, BTC_BT_REG_RF, 0x3c, 0x15); } /* Here we need to resend some wifi info to BT */ /* because bt is reset and loss of the info. */ if (pCoexSta->btInfoExt & BIT1) { - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); if (bWifiConnected) - EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_CONNECT); + EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_CONNECT); else - EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); + EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_DISCONNECT); } if (pCoexSta->btInfoExt & BIT3) { - if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) - halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false); + if (!bt_coexist->bManualControl && !bt_coexist->bStopCoexDm) + halbtc8723b1ant_IgnoreWlanAct(bt_coexist, FORCE_EXEC, false); } else { /* BT already NOT ignore Wlan active, do nothing here. */ } @@ -2576,7 +2576,7 @@ void EXhalbtc8723b1ant_BtInfoNotify( pCoexSta->bScoExist = false; } - halbtc8723b1ant_UpdateBtLinkInfo(pBtCoexist); + halbtc8723b1ant_UpdateBtLinkInfo(bt_coexist); btInfo = btInfo & 0x1f; /* mask profile bit for connect-ilde identification (for CSR case: A2DP idle --> 0x41) */ @@ -2607,60 +2607,60 @@ void EXhalbtc8723b1ant_BtInfoNotify( bBtBusy = true; else bBtBusy = false; - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); - halbtc8723b1ant_RunCoexistMechanism(pBtCoexist); + halbtc8723b1ant_RunCoexistMechanism(bt_coexist); } -void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *pBtCoexist) +void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *bt_coexist) { - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 0); - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 0); + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true); - halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true); + halbtc8723b1ant_IgnoreWlanAct(bt_coexist, FORCE_EXEC, true); - EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); + EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_DISCONNECT); - pBtCoexist->bStopCoexDm = true; + bt_coexist->bStopCoexDm = true; } -void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) +void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *bt_coexist, u8 pnpState) { if (pnpState == BTC_WIFI_PNP_SLEEP) { - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0); + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true); - pBtCoexist->bStopCoexDm = true; + bt_coexist->bStopCoexDm = true; } else if (pnpState == BTC_WIFI_PNP_WAKE_UP) { - pBtCoexist->bStopCoexDm = false; - halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false); - halbtc8723b1ant_InitCoexDm(pBtCoexist); - halbtc8723b1ant_QueryBtInfo(pBtCoexist); + bt_coexist->bStopCoexDm = false; + halbtc8723b1ant_InitHwConfig(bt_coexist, false, false); + halbtc8723b1ant_InitCoexDm(bt_coexist); + halbtc8723b1ant_QueryBtInfo(bt_coexist); } } -void EXhalbtc8723b1ant_Periodical(struct btc_coexist *pBtCoexist) +void EXhalbtc8723b1ant_Periodical(struct btc_coexist *bt_coexist) { static u8 disVerInfoCnt; u32 fwVer = 0, btPatchVer = 0; if (disVerInfoCnt <= 5) { disVerInfoCnt += 1; - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); } - halbtc8723b1ant_MonitorBtCtr(pBtCoexist); - halbtc8723b1ant_MonitorWiFiCtr(pBtCoexist); + halbtc8723b1ant_MonitorBtCtr(bt_coexist); + halbtc8723b1ant_MonitorWiFiCtr(bt_coexist); if ( - halbtc8723b1ant_IsWifiStatusChanged(pBtCoexist) || + halbtc8723b1ant_IsWifiStatusChanged(bt_coexist) || pCoexDm->bAutoTdmaAdjust ) - halbtc8723b1ant_RunCoexistMechanism(pBtCoexist); + halbtc8723b1ant_RunCoexistMechanism(bt_coexist); pCoexSta->specialPktPeriodCnt++; } -- 2.43.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 3/5] staging: rtl8723bs: Rename variables 2025-04-01 16:59 ` [PATCH v2 3/5] staging: rtl8723bs: Rename variables Erick Karanja @ 2025-04-01 22:28 ` Julia Lawall 0 siblings, 0 replies; 11+ messages in thread From: Julia Lawall @ 2025-04-01 22:28 UTC (permalink / raw) To: Erick Karanja Cc: gregkh, outreachy, philipp.g.hortmann, linux-staging, linux-kernel On Tue, 1 Apr 2025, Erick Karanja wrote: > Rename variables to adhere to Linux kernel coding > standards by using snake_case instead of CamelCase > and ensure proper encoding of the variables by removing > initial 'p' for pointers and initial 'b' for boolean. > > Fixes checkpatch.pl warning: > CHECK: Avoid CamelCase: <supportRateNum> > > Signed-off-by: Erick Karanja <karanja99erick@gmail.com> > --- > .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 1266 ++++++++--------- > 1 file changed, 633 insertions(+), 633 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c > index b3d7f50fac4c..e3c67f98e8c0 100644 > --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c > +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c > @@ -16,74 +16,74 @@ static struct coex_sta_8723b_1ant *pCoexSta = &GLCoexSta8723b1Ant; > /* local function proto type if needed */ > /* local function start with halbtc8723b1ant_ */ > static u8 halbtc8723b1ant_BtRssiState( > - u8 levelNum, u8 rssiThresh, u8 rssiThresh1 > + u8 level_num, u8 rssi_thresh, u8 rssi_thresh1 > ) > { > - s32 btRssi = 0; > - u8 btRssiState = pCoexSta->preBtRssiState; > + s32 bt_rssi = 0; > + u8 bt_rssi_state = pCoexSta->preBtRssiState; > > - btRssi = pCoexSta->btRssi; > + bt_rssi = pCoexSta->bt_rssi; It seems that you have some criterion to choose which varikables to transform and which not to transform? pCoexSta starts with p for pointer, and it is written in camel case. The log message should say what that strategy is. julia > > - if (levelNum == 2) { > + if (level_num == 2) { > if ( > (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || > (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) > ) { > - if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) > + if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) > > - btRssiState = BTC_RSSI_STATE_HIGH; > + bt_rssi_state = BTC_RSSI_STATE_HIGH; > else > - btRssiState = BTC_RSSI_STATE_STAY_LOW; > + bt_rssi_state = BTC_RSSI_STATE_STAY_LOW; > } else { > - if (btRssi < rssiThresh) > - btRssiState = BTC_RSSI_STATE_LOW; > + if (bt_rssi < rssi_thresh) > + bt_rssi_state = BTC_RSSI_STATE_LOW; > else > - btRssiState = BTC_RSSI_STATE_STAY_HIGH; > + bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH; > } > - } else if (levelNum == 3) { > - if (rssiThresh > rssiThresh1) > + } else if (level_num == 3) { > + if (rssi_thresh > rssi_thresh1) > return pCoexSta->preBtRssiState; > > if ( > (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || > (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) > ) { > - if (btRssi >= (rssiThresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) > - btRssiState = BTC_RSSI_STATE_MEDIUM; > + if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) > + bt_rssi_state = BTC_RSSI_STATE_MEDIUM; > else > - btRssiState = BTC_RSSI_STATE_STAY_LOW; > + bt_rssi_state = BTC_RSSI_STATE_STAY_LOW; > } else if ( > (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || > (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM) > ) { > - if (btRssi >= (rssiThresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) > - btRssiState = BTC_RSSI_STATE_HIGH; > - else if (btRssi < rssiThresh) > - btRssiState = BTC_RSSI_STATE_LOW; > + if (bt_rssi >= (rssi_thresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) > + bt_rssi_state = BTC_RSSI_STATE_HIGH; > + else if (bt_rssi < rssi_thresh) > + bt_rssi_state = BTC_RSSI_STATE_LOW; > else > - btRssiState = BTC_RSSI_STATE_STAY_MEDIUM; > + bt_rssi_state = BTC_RSSI_STATE_STAY_MEDIUM; > } else { > - if (btRssi < rssiThresh1) > - btRssiState = BTC_RSSI_STATE_MEDIUM; > + if (bt_rssi < rssi_thresh1) > + bt_rssi_state = BTC_RSSI_STATE_MEDIUM; > else > - btRssiState = BTC_RSSI_STATE_STAY_HIGH; > + bt_rssi_state = BTC_RSSI_STATE_STAY_HIGH; > } > } > > - pCoexSta->preBtRssiState = btRssiState; > + pCoexSta->preBtRssiState = bt_rssi_state; > > - return btRssiState; > + return bt_rssi_state; > } > > static void halbtc8723b1ant_UpdateRaMask( > - struct btc_coexist *pBtCoexist, bool bForceExec, u32 disRateMask > + struct btc_coexist *bt_coexist, bool force_exec, u32 dis_rate_mask > ) > { > - pCoexDm->curRaMask = disRateMask; > + pCoexDm->curRaMask = dis_rate_mask; > > - if (bForceExec || (pCoexDm->preRaMask != pCoexDm->curRaMask)) > - pBtCoexist->fBtcSet( > - pBtCoexist, > + if (force_exec || (pCoexDm->preRaMask != pCoexDm->curRaMask)) > + bt_coexist->fBtcSet( > + bt_coexist, > BTC_SET_ACT_UPDATE_RAMASK, > &pCoexDm->curRaMask > ); > @@ -91,33 +91,33 @@ static void halbtc8723b1ant_UpdateRaMask( > } > > static void halbtc8723b1ant_AutoRateFallbackRetry( > - struct btc_coexist *pBtCoexist, bool bForceExec, u8 type > + struct btc_coexist *bt_coexist, bool force_exec, u8 type > ) > { > - bool bWifiUnderBMode = false; > + bool wifi_under_b_mode = false; > > pCoexDm->curArfrType = type; > > - if (bForceExec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) { > + if (force_exec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) { > switch (pCoexDm->curArfrType) { > case 0: /* normal mode */ > - pBtCoexist->fBtcWrite4Byte( > - pBtCoexist, 0x430, pCoexDm->backupArfrCnt1 > + bt_coexist->fBtcWrite4Byte( > + bt_coexist, 0x430, pCoexDm->backupArfrCnt1 > ); > - pBtCoexist->fBtcWrite4Byte( > - pBtCoexist, 0x434, pCoexDm->backupArfrCnt2 > + bt_coexist->fBtcWrite4Byte( > + bt_coexist, 0x434, pCoexDm->backupArfrCnt2 > ); > break; > case 1: > - pBtCoexist->fBtcGet( > - pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode > + bt_coexist->fBtcGet( > + bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode > ); > - if (bWifiUnderBMode) { > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0); > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x01010101); > + if (wifi_under_b_mode) { > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x01010101); > } else { > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x430, 0x0); > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x434, 0x04030201); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x04030201); > } > break; > default: > @@ -129,23 +129,23 @@ static void halbtc8723b1ant_AutoRateFallbackRetry( > } > > static void halbtc8723b1ant_RetryLimit( > - struct btc_coexist *pBtCoexist, bool bForceExec, u8 type > + struct btc_coexist *bt_coexist, bool force_exec, u8 type > ) > { > pCoexDm->curRetryLimitType = type; > > if ( > - bForceExec || > + force_exec || > (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType) > ) { > switch (pCoexDm->curRetryLimitType) { > case 0: /* normal mode */ > - pBtCoexist->fBtcWrite2Byte( > - pBtCoexist, 0x42a, pCoexDm->backupRetryLimit > + bt_coexist->fBtcWrite2Byte( > + bt_coexist, 0x42a, pCoexDm->backupRetryLimit > ); > break; > case 1: /* retry limit =8 */ > - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x42a, 0x0808); > + bt_coexist->fBtcWrite2Byte(bt_coexist, 0x42a, 0x0808); > break; > default: > break; > @@ -156,22 +156,22 @@ static void halbtc8723b1ant_RetryLimit( > } > > static void halbtc8723b1ant_AmpduMaxTime( > - struct btc_coexist *pBtCoexist, bool bForceExec, u8 type > + struct btc_coexist *bt_coexist, bool force_exec, u8 type > ) > { > pCoexDm->curAmpduTimeType = type; > > if ( > - bForceExec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType) > + force_exec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType) > ) { > switch (pCoexDm->curAmpduTimeType) { > case 0: /* normal mode */ > - pBtCoexist->fBtcWrite1Byte( > - pBtCoexist, 0x456, pCoexDm->backupAmpduMaxTime > + bt_coexist->fBtcWrite1Byte( > + bt_coexist, 0x456, pCoexDm->backupAmpduMaxTime > ); > break; > case 1: /* AMPDU timw = 0x38 * 32us */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x456, 0x38); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x456, 0x38); > break; > default: > break; > @@ -182,64 +182,64 @@ static void halbtc8723b1ant_AmpduMaxTime( > } > > static void halbtc8723b1ant_LimitedTx( > - struct btc_coexist *pBtCoexist, > - bool bForceExec, > - u8 raMaskType, > - u8 arfrType, > - u8 retryLimitType, > - u8 ampduTimeType > + struct btc_coexist *bt_coexist, > + bool force_exec, > + u8 ra_mask_type, > + u8 arfr_type, > + u8 retry_limit_type, > + u8 ampdu_time_type > ) > { > - switch (raMaskType) { > + switch (ra_mask_type) { > case 0: /* normal mode */ > - halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0); > + halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x0); > break; > case 1: /* disable cck 1/2 */ > - halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x00000003); > + halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x00000003); > break; > case 2: /* disable cck 1/2/5.5, ofdm 6/9/12/18/24, mcs 0/1/2/3/4 */ > - halbtc8723b1ant_UpdateRaMask(pBtCoexist, bForceExec, 0x0001f1f7); > + halbtc8723b1ant_UpdateRaMask(bt_coexist, force_exec, 0x0001f1f7); > break; > default: > break; > } > > - halbtc8723b1ant_AutoRateFallbackRetry(pBtCoexist, bForceExec, arfrType); > - halbtc8723b1ant_RetryLimit(pBtCoexist, bForceExec, retryLimitType); > - halbtc8723b1ant_AmpduMaxTime(pBtCoexist, bForceExec, ampduTimeType); > + halbtc8723b1ant_AutoRateFallbackRetry(bt_coexist, force_exec, arfr_type); > + halbtc8723b1ant_RetryLimit(bt_coexist, force_exec, retry_limit_type); > + halbtc8723b1ant_AmpduMaxTime(bt_coexist, force_exec, ampdu_time_type); > } > > static void halbtc8723b1ant_LimitedRx( > - struct btc_coexist *pBtCoexist, > - bool bForceExec, > - bool bRejApAggPkt, > - bool bBtCtrlAggBufSize, > - u8 aggBufSize > + struct btc_coexist *bt_coexist, > + bool force_exec, > + bool rej_ap_agg_pkt, > + bool bt_ctrl_agg_buf_size, > + u8 agg_buf_size > ) > { > - bool bRejectRxAgg = bRejApAggPkt; > - bool bBtCtrlRxAggSize = bBtCtrlAggBufSize; > - u8 rxAggSize = aggBufSize; > + bool bRejectRxAgg = rej_ap_agg_pkt; > + bool bBtCtrlRxAggSize = bt_ctrl_agg_buf_size; > + u8 rxAggSize = agg_buf_size; > > /* */ > /* Rx Aggregation related setting */ > /* */ > - pBtCoexist->fBtcSet( > - pBtCoexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg > + bt_coexist->fBtcSet( > + bt_coexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg > ); > /* decide BT control aggregation buf size or not */ > - pBtCoexist->fBtcSet( > - pBtCoexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize > + bt_coexist->fBtcSet( > + bt_coexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize > ); > /* aggregation buf size, only work when BT control Rx aggregation size. */ > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize); > /* real update aggregation setting */ > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_AGGREGATE_CTRL, NULL); > > > } > > -static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *bt_coexist) > { > u8 H2C_Parameter[1] = {0}; > > @@ -247,17 +247,17 @@ static void halbtc8723b1ant_QueryBtInfo(struct btc_coexist *pBtCoexist) > > H2C_Parameter[0] |= BIT0; /* trigger */ > > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x61, 1, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x61, 1, H2C_Parameter); > } > > -static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *bt_coexist) > { > u32 regHPTxRx, regLPTxRx, u4Tmp; > u32 regHPTx = 0, regHPRx = 0, regLPTx = 0, regLPRx = 0; > static u8 NumOfBtCounterChk; > > /* to avoid 0x76e[3] = 1 (WLAN_Act control by PTA) during IPS */ > - /* if (! (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) & 0x8)) */ > + /* if (! (bt_coexist->fBtcRead1Byte(bt_coexist, 0x76e) & 0x8)) */ > > if (pCoexSta->bUnderIps) { > pCoexSta->highPriorityTx = 65535; > @@ -270,11 +270,11 @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) > regHPTxRx = 0x770; > regLPTxRx = 0x774; > > - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regHPTxRx); > + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, regHPTxRx); > regHPTx = u4Tmp & bMaskLWord; > regHPRx = (u4Tmp & bMaskHWord) >> 16; > > - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, regLPTxRx); > + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, regLPTxRx); > regLPTx = u4Tmp & bMaskLWord; > regLPRx = (u4Tmp & bMaskHWord) >> 16; > > @@ -287,28 +287,28 @@ static void halbtc8723b1ant_MonitorBtCtr(struct btc_coexist *pBtCoexist) > pCoexSta->popEventCnt++; > > /* reset counter */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0xc); > > if ((regHPTx == 0) && (regHPRx == 0) && (regLPTx == 0) && (regLPRx == 0)) { > NumOfBtCounterChk++; > if (NumOfBtCounterChk >= 3) { > - halbtc8723b1ant_QueryBtInfo(pBtCoexist); > + halbtc8723b1ant_QueryBtInfo(bt_coexist); > NumOfBtCounterChk = 0; > } > } > } > > > -static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *bt_coexist) > { > - s32 wifiRssi = 0; > - bool bWifiBusy = false, bWifiUnderBMode = false; > + s32 wifi_rssi = 0; > + bool wifi_busy = false, wifi_under_b_mode = false; > static u8 nCCKLockCounter; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_S4_WIFI_RSSI, &wifiRssi); > - pBtCoexist->fBtcGet( > - pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); > + bt_coexist->fBtcGet( > + bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode > ); > > if (pCoexSta->bUnderIps) { > @@ -322,23 +322,23 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist) > pCoexSta->nCRCErr_11n = 0; > pCoexSta->nCRCErr_11nAgg = 0; > } else { > - pCoexSta->nCRCOK_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf88); > - pCoexSta->nCRCOK_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf94); > - pCoexSta->nCRCOK_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf90); > - pCoexSta->nCRCOK_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfb8); > + pCoexSta->nCRCOK_CCK = bt_coexist->fBtcRead4Byte(bt_coexist, 0xf88); > + pCoexSta->nCRCOK_11g = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf94); > + pCoexSta->nCRCOK_11n = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf90); > + pCoexSta->nCRCOK_11nAgg = bt_coexist->fBtcRead2Byte(bt_coexist, 0xfb8); > > - pCoexSta->nCRCErr_CCK = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0xf84); > - pCoexSta->nCRCErr_11g = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf96); > - pCoexSta->nCRCErr_11n = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xf92); > - pCoexSta->nCRCErr_11nAgg = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0xfba); > + pCoexSta->nCRCErr_CCK = bt_coexist->fBtcRead4Byte(bt_coexist, 0xf84); > + pCoexSta->nCRCErr_11g = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf96); > + pCoexSta->nCRCErr_11n = bt_coexist->fBtcRead2Byte(bt_coexist, 0xf92); > + pCoexSta->nCRCErr_11nAgg = bt_coexist->fBtcRead2Byte(bt_coexist, 0xfba); > } > > > /* reset counter */ > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x1); > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0xf16, 0x1, 0x0); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x1); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x0); > > - if (bWifiBusy && (wifiRssi >= 30) && !bWifiUnderBMode) { > + if (wifi_busy && (wifi_rssi >= 30) && !wifi_under_b_mode) { > if ( > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) || > @@ -385,24 +385,24 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *pBtCoexist) > > } > > -static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist) > +static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *bt_coexist) > { > static bool bPreWifiBusy, bPreUnder4way, bPreBtHsOn; > - bool bWifiBusy = false, bUnder4way = false, bBtHsOn = false; > + bool wifi_busy = false, bUnder4way = false, bBtHsOn = false; > bool bWifiConnected = false; > > - pBtCoexist->fBtcGet( > - pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected > + bt_coexist->fBtcGet( > + bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected > ); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > - pBtCoexist->fBtcGet( > - pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > + bt_coexist->fBtcGet( > + bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way > ); > > if (bWifiConnected) { > - if (bWifiBusy != bPreWifiBusy) { > - bPreWifiBusy = bWifiBusy; > + if (wifi_busy != bPreWifiBusy) { > + bPreWifiBusy = wifi_busy; > return true; > } > > @@ -420,12 +420,12 @@ static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *pBtCoexist) > return false; > } > > -static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *bt_coexist) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > bool bBtHsOn = false; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > > pBtLinkInfo->bBtLinkExist = pCoexSta->bBtLinkExist; > pBtLinkInfo->bScoExist = pCoexSta->bScoExist; > @@ -484,14 +484,14 @@ static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *pBtCoexist) > pBtLinkInfo->bHidOnly = false; > } > > -static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) > +static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > bool bBtHsOn = false; > u8 algorithm = BT_8723B_1ANT_COEX_ALGO_UNDEFINED; > u8 numOfDiffProfile = 0; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > > if (!pBtLinkInfo->bBtLinkExist) > return algorithm; > @@ -594,7 +594,7 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *pBtCoexist) > } > > static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( > - struct btc_coexist *pBtCoexist, bool bLowPenaltyRa > + struct btc_coexist *bt_coexist, bool bLowPenaltyRa > ) > { > u8 H2C_Parameter[6] = {0}; > @@ -609,46 +609,46 @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( > H2C_Parameter[5] = 0xf9; /* MCS5 or OFDM36 */ > } > > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x69, 6, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x69, 6, H2C_Parameter); > } > > static void halbtc8723b1ant_LowPenaltyRa( > - struct btc_coexist *pBtCoexist, bool bForceExec, bool bLowPenaltyRa > + struct btc_coexist *bt_coexist, bool force_exec, bool bLowPenaltyRa > ) > { > pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa; > > - if (!bForceExec) { > + if (!force_exec) { > if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa) > return; > } > halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( > - pBtCoexist, pCoexDm->bCurLowPenaltyRa > + bt_coexist, pCoexDm->bCurLowPenaltyRa > ); > > pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa; > } > > static void halbtc8723b1ant_SetCoexTable( > - struct btc_coexist *pBtCoexist, > + struct btc_coexist *bt_coexist, > u32 val0x6c0, > u32 val0x6c4, > u32 val0x6c8, > u8 val0x6cc > ) > { > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c0, val0x6c0); > > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c4, val0x6c4); > > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c8, val0x6c8); > > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cc, val0x6cc); > } > > static void halbtc8723b1ant_CoexTable( > - struct btc_coexist *pBtCoexist, > - bool bForceExec, > + struct btc_coexist *bt_coexist, > + bool force_exec, > u32 val0x6c0, > u32 val0x6c4, > u32 val0x6c8, > @@ -660,7 +660,7 @@ static void halbtc8723b1ant_CoexTable( > pCoexDm->curVal0x6c8 = val0x6c8; > pCoexDm->curVal0x6cc = val0x6cc; > > - if (!bForceExec) { > + if (!force_exec) { > if ( > (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) && > (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) && > @@ -671,7 +671,7 @@ static void halbtc8723b1ant_CoexTable( > } > > halbtc8723b1ant_SetCoexTable( > - pBtCoexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc > + bt_coexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc > ); > > pCoexDm->preVal0x6c0 = pCoexDm->curVal0x6c0; > @@ -681,7 +681,7 @@ static void halbtc8723b1ant_CoexTable( > } > > static void halbtc8723b1ant_CoexTableWithType( > - struct btc_coexist *pBtCoexist, bool bForceExec, u8 type > + struct btc_coexist *bt_coexist, bool force_exec, u8 type > ) > { > pCoexSta->nCoexTableType = type; > @@ -689,42 +689,42 @@ static void halbtc8723b1ant_CoexTableWithType( > switch (type) { > case 0: > halbtc8723b1ant_CoexTable( > - pBtCoexist, bForceExec, 0x55555555, 0x55555555, 0xffffff, 0x3 > + bt_coexist, force_exec, 0x55555555, 0x55555555, 0xffffff, 0x3 > ); > break; > case 1: > halbtc8723b1ant_CoexTable( > - pBtCoexist, bForceExec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3 > + bt_coexist, force_exec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3 > ); > break; > case 2: > halbtc8723b1ant_CoexTable( > - pBtCoexist, bForceExec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3 > + bt_coexist, force_exec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3 > ); > break; > case 3: > halbtc8723b1ant_CoexTable( > - pBtCoexist, bForceExec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3 > + bt_coexist, force_exec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3 > ); > break; > case 4: > halbtc8723b1ant_CoexTable( > - pBtCoexist, bForceExec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3 > + bt_coexist, force_exec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3 > ); > break; > case 5: > halbtc8723b1ant_CoexTable( > - pBtCoexist, bForceExec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3 > + bt_coexist, force_exec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3 > ); > break; > case 6: > halbtc8723b1ant_CoexTable( > - pBtCoexist, bForceExec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3 > + bt_coexist, force_exec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3 > ); > break; > case 7: > halbtc8723b1ant_CoexTable( > - pBtCoexist, bForceExec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3 > + bt_coexist, force_exec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3 > ); > break; > default: > @@ -733,7 +733,7 @@ static void halbtc8723b1ant_CoexTableWithType( > } > > static void halbtc8723b1ant_SetFwIgnoreWlanAct( > - struct btc_coexist *pBtCoexist, bool bEnable > + struct btc_coexist *bt_coexist, bool bEnable > ) > { > u8 H2C_Parameter[1] = {0}; > @@ -741,43 +741,43 @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct( > if (bEnable) > H2C_Parameter[0] |= BIT0; /* function enable */ > > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x63, 1, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x63, 1, H2C_Parameter); > } > > static void halbtc8723b1ant_IgnoreWlanAct( > - struct btc_coexist *pBtCoexist, bool bForceExec, bool bEnable > + struct btc_coexist *bt_coexist, bool force_exec, bool bEnable > ) > { > pCoexDm->bCurIgnoreWlanAct = bEnable; > > - if (!bForceExec) { > + if (!force_exec) { > if (pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct) > return; > } > - halbtc8723b1ant_SetFwIgnoreWlanAct(pBtCoexist, bEnable); > + halbtc8723b1ant_SetFwIgnoreWlanAct(bt_coexist, bEnable); > > pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct; > } > > static void halbtc8723b1ant_SetLpsRpwm( > - struct btc_coexist *pBtCoexist, u8 lpsVal, u8 rpwmVal > + struct btc_coexist *bt_coexist, u8 lpsVal, u8 rpwmVal > ) > { > u8 lps = lpsVal; > u8 rpwm = rpwmVal; > > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_LPS_VAL, &lps); > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_U1_RPWM_VAL, &rpwm); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_LPS_VAL, &lps); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_RPWM_VAL, &rpwm); > } > > static void halbtc8723b1ant_LpsRpwm( > - struct btc_coexist *pBtCoexist, bool bForceExec, u8 lpsVal, u8 rpwmVal > + struct btc_coexist *bt_coexist, bool force_exec, u8 lpsVal, u8 rpwmVal > ) > { > pCoexDm->curLps = lpsVal; > pCoexDm->curRpwm = rpwmVal; > > - if (!bForceExec) { > + if (!force_exec) { > if ( > (pCoexDm->preLps == pCoexDm->curLps) && > (pCoexDm->preRpwm == pCoexDm->curRpwm) > @@ -785,89 +785,89 @@ static void halbtc8723b1ant_LpsRpwm( > return; > } > } > - halbtc8723b1ant_SetLpsRpwm(pBtCoexist, lpsVal, rpwmVal); > + halbtc8723b1ant_SetLpsRpwm(bt_coexist, lpsVal, rpwmVal); > > pCoexDm->preLps = pCoexDm->curLps; > pCoexDm->preRpwm = pCoexDm->curRpwm; > } > > static void halbtc8723b1ant_SwMechanism( > - struct btc_coexist *pBtCoexist, bool bLowPenaltyRA > + struct btc_coexist *bt_coexist, bool bLowPenaltyRA > ) > { > - halbtc8723b1ant_LowPenaltyRa(pBtCoexist, NORMAL_EXEC, bLowPenaltyRA); > + halbtc8723b1ant_LowPenaltyRa(bt_coexist, NORMAL_EXEC, bLowPenaltyRA); > } > > static void halbtc8723b1ant_SetAntPath( > - struct btc_coexist *pBtCoexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff > + struct btc_coexist *bt_coexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff > ) > { > - struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo; > + struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo; > u32 fwVer = 0, u4Tmp = 0, cntBtCalChk = 0; > bool bPgExtSwitch = false; > bool bUseExtSwitch = false; > bool bIsInMpMode = false; > u8 H2C_Parameter[2] = {0}, u1Tmp = 0; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */ > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_EXT_SWITCH, &bPgExtSwitch); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); /* [31:16]=fw ver, [15:0]=fw sub ver */ > > if ((fwVer > 0 && fwVer < 0xc0000) || bPgExtSwitch) > bUseExtSwitch = true; > > if (bInitHwCfg) { > - pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1, 0xfffff, 0x780); /* WiFi TRx Mask on */ > - pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT TRx Mask on */ > + bt_coexist->fBtcSetRfReg(bt_coexist, BTC_RF_A, 0x1, 0xfffff, 0x780); /* WiFi TRx Mask on */ > + bt_coexist->fBtcSetBtReg(bt_coexist, BTC_BT_REG_RF, 0x3c, 0x15); /* BT TRx Mask on */ > > if (fwVer >= 0x180000) { > /* Use H2C to set GNT_BT to HIGH */ > H2C_Parameter[0] = 1; > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter); > } else /* set grant_bt to high */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18); > > /* set wlan_act control by PTA */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4); > > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ > > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x39, 0x8, 0x1); > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x974, 0xff); > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x944, 0x3, 0x3); > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x930, 0x77); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x39, 0x8, 0x1); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x974, 0xff); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x944, 0x3, 0x3); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x930, 0x77); > } else if (bWifiOff) { > if (fwVer >= 0x180000) { > /* Use H2C to set GNT_BT to HIGH */ > H2C_Parameter[0] = 1; > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter); > } else /* set grant_bt to high */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18); > > /* set wlan_act to always low */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4); > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_IS_IN_MP_MODE, &bIsInMpMode); > if (!bIsInMpMode) > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x0); /* BT select s0/s1 is controlled by BT */ > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x0); /* BT select s0/s1 is controlled by BT */ > else > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x67, 0x20, 0x1); /* BT select s0/s1 is controlled by WiFi */ > > /* 0x4c[24:23]= 00, Set Antenna control by BT_RFE_CTRL BT Vendor 0xac = 0xf002 */ > - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); > + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c); > u4Tmp &= ~BIT23; > u4Tmp &= ~BIT24; > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp); > } else { > /* Use H2C to set GNT_BT to LOW */ > if (fwVer >= 0x180000) { > - if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765) != 0) { > + if (bt_coexist->fBtcRead1Byte(bt_coexist, 0x765) != 0) { > H2C_Parameter[0] = 0; > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x6E, 1, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x6E, 1, H2C_Parameter); > } > } else { > /* BT calibration check */ > while (cntBtCalChk <= 20) { > - u1Tmp = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x49d); > + u1Tmp = bt_coexist->fBtcRead1Byte(bt_coexist, 0x49d); > cntBtCalChk++; > > if (u1Tmp & BIT0) > @@ -877,34 +877,34 @@ static void halbtc8723b1ant_SetAntPath( > } > > /* set grant_bt to PTA */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x0); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x0); > } > > - if (pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x76e) != 0xc) > + if (bt_coexist->fBtcRead1Byte(bt_coexist, 0x76e) != 0xc) > /* set wlan_act control by PTA */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0xc); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0xc); > } > > if (bUseExtSwitch) { > if (bInitHwCfg) { > /* 0x4c[23]= 0, 0x4c[24]= 1 Antenna control by WL/BT */ > - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); > + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c); > u4Tmp &= ~BIT23; > u4Tmp |= BIT24; > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp); > > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); /* fixed internal switch S1->WiFi, S0->BT */ > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); /* fixed internal switch S1->WiFi, S0->BT */ > > if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) { > /* tell firmware "no antenna inverse" */ > H2C_Parameter[0] = 0; > H2C_Parameter[1] = 1; /* ext switch type */ > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter); > } else { > /* tell firmware "antenna inverse" */ > H2C_Parameter[0] = 1; > H2C_Parameter[1] = 1; /* ext switch type */ > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter); > } > } > > @@ -913,48 +913,48 @@ static void halbtc8723b1ant_SetAntPath( > switch (antPosType) { > case BTC_ANT_PATH_WIFI: > if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1); > else > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2); > break; > case BTC_ANT_PATH_BT: > if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2); > else > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1); > break; > default: > case BTC_ANT_PATH_PTA: > if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x1); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x1); > else > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x92c, 0x3, 0x2); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x92c, 0x3, 0x2); > break; > } > > } else { > if (bInitHwCfg) { > /* 0x4c[23]= 1, 0x4c[24]= 0 Antenna control by 0x64 */ > - u4Tmp = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x4c); > + u4Tmp = bt_coexist->fBtcRead4Byte(bt_coexist, 0x4c); > u4Tmp |= BIT23; > u4Tmp &= ~BIT24; > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x4c, u4Tmp); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x4c, u4Tmp); > > /* Fix Ext switch Main->S1, Aux->S0 */ > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x64, 0x1, 0x0); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x64, 0x1, 0x0); > > if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) { > > /* tell firmware "no antenna inverse" */ > H2C_Parameter[0] = 0; > H2C_Parameter[1] = 0; /* internal switch type */ > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter); > } else { > > /* tell firmware "antenna inverse" */ > H2C_Parameter[0] = 1; > H2C_Parameter[1] = 0; /* internal switch type */ > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x65, 2, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x65, 2, H2C_Parameter); > } > } > > @@ -963,36 +963,36 @@ static void halbtc8723b1ant_SetAntPath( > switch (antPosType) { > case BTC_ANT_PATH_WIFI: > if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); > else > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280); > break; > case BTC_ANT_PATH_BT: > if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280); > else > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); > break; > default: > case BTC_ANT_PATH_PTA: > if (pBoardInfo->btdmAntPos == BTC_ANTENNA_AT_MAIN_PORT) > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x200); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x200); > else > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x80); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x80); > break; > } > } > } > > static void halbtc8723b1ant_SetFwPstdma( > - struct btc_coexist *pBtCoexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5 > + struct btc_coexist *bt_coexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5 > ) > { > u8 H2C_Parameter[5] = {0}; > u8 realByte1 = byte1, realByte5 = byte5; > bool bApEnable = false; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); > > if (bApEnable) { > if (byte1 & BIT4 && !(byte1 & BIT5)) { > @@ -1016,16 +1016,16 @@ static void halbtc8723b1ant_SetFwPstdma( > pCoexDm->psTdmaPara[3] = byte4; > pCoexDm->psTdmaPara[4] = realByte5; > > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x60, 5, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x60, 5, H2C_Parameter); > } > > > static void halbtc8723b1ant_PsTdma( > - struct btc_coexist *pBtCoexist, bool bForceExec, bool bTurnOn, u8 type > + struct btc_coexist *bt_coexist, bool force_exec, bool bTurnOn, u8 type > ) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > - bool bWifiBusy = false; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > + bool wifi_busy = false; > u8 rssiAdjustVal = 0; > u8 psTdmaByte4Val = 0x50, psTdmaByte0Val = 0x51, psTdmaByte3Val = 0x10; > s8 nWiFiDurationAdjust = 0x0; > @@ -1034,9 +1034,9 @@ static void halbtc8723b1ant_PsTdma( > pCoexDm->bCurPsTdmaOn = bTurnOn; > pCoexDm->curPsTdma = type; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); > > - if (!bForceExec) { > + if (!force_exec) { > if ( > (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && > (pCoexDm->prePsTdma == pCoexDm->curPsTdma) > @@ -1066,12 +1066,12 @@ static void halbtc8723b1ant_PsTdma( > switch (type) { > default: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val > + bt_coexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val > ); > break; > case 1: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, > + bt_coexist, > psTdmaByte0Val, > 0x3a + nWiFiDurationAdjust, > 0x03, > @@ -1081,7 +1081,7 @@ static void halbtc8723b1ant_PsTdma( > break; > case 2: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, > + bt_coexist, > psTdmaByte0Val, > 0x2d + nWiFiDurationAdjust, > 0x03, > @@ -1091,35 +1091,35 @@ static void halbtc8723b1ant_PsTdma( > break; > case 3: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x51, 0x1d, 0x1d, 0x0, 0x10 > + bt_coexist, 0x51, 0x1d, 0x1d, 0x0, 0x10 > ); > break; > case 4: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x93, 0x15, 0x3, 0x14, 0x0 > + bt_coexist, 0x93, 0x15, 0x3, 0x14, 0x0 > ); > break; > case 5: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x61, 0x15, 0x3, 0x11, 0x10 > + bt_coexist, 0x61, 0x15, 0x3, 0x11, 0x10 > ); > break; > case 6: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x61, 0x20, 0x3, 0x11, 0x11 > + bt_coexist, 0x61, 0x20, 0x3, 0x11, 0x11 > ); > break; > case 7: > - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xc, 0x5, 0x0, 0x0); > + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xc, 0x5, 0x0, 0x0); > break; > case 8: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0 > + bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0 > ); > break; > case 9: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, > + bt_coexist, > psTdmaByte0Val, > 0x21, > 0x3, > @@ -1128,11 +1128,11 @@ static void halbtc8723b1ant_PsTdma( > ); > break; > case 10: > - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x13, 0xa, 0xa, 0x0, 0x40); > + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xa, 0xa, 0x0, 0x40); > break; > case 11: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, > + bt_coexist, > psTdmaByte0Val, > 0x21, > 0x03, > @@ -1142,124 +1142,124 @@ static void halbtc8723b1ant_PsTdma( > break; > case 12: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x51, 0x0a, 0x0a, 0x0, 0x50 > + bt_coexist, 0x51, 0x0a, 0x0a, 0x0, 0x50 > ); > break; > case 13: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x51, 0x12, 0x12, 0x0, 0x10 > + bt_coexist, 0x51, 0x12, 0x12, 0x0, 0x10 > ); > break; > case 14: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val > + bt_coexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val > ); > break; > case 15: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x13, 0xa, 0x3, 0x8, 0x0 > + bt_coexist, 0x13, 0xa, 0x3, 0x8, 0x0 > ); > break; > case 16: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x93, 0x15, 0x3, 0x10, 0x0 > + bt_coexist, 0x93, 0x15, 0x3, 0x10, 0x0 > ); > break; > case 18: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x93, 0x25, 0x3, 0x10, 0x0 > + bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0 > ); > break; > case 20: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x61, 0x3f, 0x03, 0x11, 0x10 > + bt_coexist, 0x61, 0x3f, 0x03, 0x11, 0x10 > > ); > break; > case 21: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x11 > + bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x11 > ); > break; > case 22: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x61, 0x25, 0x03, 0x11, 0x10 > + bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x10 > ); > break; > case 23: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x18 > + bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x18 > ); > break; > case 24: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xe3, 0x15, 0x3, 0x31, 0x18 > + bt_coexist, 0xe3, 0x15, 0x3, 0x31, 0x18 > ); > break; > case 25: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18 > + bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18 > ); > break; > case 26: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xe3, 0xa, 0x3, 0x31, 0x18 > + bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18 > ); > break; > case 27: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xe3, 0x25, 0x3, 0x31, 0x98 > + bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x98 > ); > break; > case 28: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x69, 0x25, 0x3, 0x31, 0x0 > + bt_coexist, 0x69, 0x25, 0x3, 0x31, 0x0 > ); > break; > case 29: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xab, 0x1a, 0x1a, 0x1, 0x10 > + bt_coexist, 0xab, 0x1a, 0x1a, 0x1, 0x10 > ); > break; > case 30: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x51, 0x30, 0x3, 0x10, 0x10 > + bt_coexist, 0x51, 0x30, 0x3, 0x10, 0x10 > ); > break; > case 31: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58 > + bt_coexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58 > ); > break; > case 32: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x61, 0x35, 0x3, 0x11, 0x11 > + bt_coexist, 0x61, 0x35, 0x3, 0x11, 0x11 > ); > break; > case 33: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xa3, 0x25, 0x3, 0x30, 0x90 > + bt_coexist, 0xa3, 0x25, 0x3, 0x30, 0x90 > ); > break; > case 34: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x53, 0x1a, 0x1a, 0x0, 0x10 > + bt_coexist, 0x53, 0x1a, 0x1a, 0x0, 0x10 > ); > break; > case 35: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x63, 0x1a, 0x1a, 0x0, 0x10 > + bt_coexist, 0x63, 0x1a, 0x1a, 0x0, 0x10 > ); > break; > case 36: > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0xd3, 0x12, 0x3, 0x14, 0x50 > + bt_coexist, 0xd3, 0x12, 0x3, 0x14, 0x50 > ); > break; > case 40: /* SoftAP only with no sta associated, BT disable , TDMA mode for power saving */ > /* here softap mode screen off will cost 70-80mA for phone */ > halbtc8723b1ant_SetFwPstdma( > - pBtCoexist, 0x23, 0x18, 0x00, 0x10, 0x24 > + bt_coexist, 0x23, 0x18, 0x00, 0x10, 0x24 > ); > break; > } > @@ -1268,30 +1268,30 @@ static void halbtc8723b1ant_PsTdma( > /* disable PS tdma */ > switch (type) { > case 8: /* PTA Control */ > - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x8, 0x0, 0x0, 0x0, 0x0); > + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x8, 0x0, 0x0, 0x0, 0x0); > halbtc8723b1ant_SetAntPath( > - pBtCoexist, BTC_ANT_PATH_PTA, false, false > + bt_coexist, BTC_ANT_PATH_PTA, false, false > ); > break; > case 0: > default: /* Software control, Antenna at BT side */ > - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0); > + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0); > halbtc8723b1ant_SetAntPath( > - pBtCoexist, BTC_ANT_PATH_BT, false, false > + bt_coexist, BTC_ANT_PATH_BT, false, false > ); > break; > case 9: /* Software control, Antenna at WiFi side */ > - halbtc8723b1ant_SetFwPstdma(pBtCoexist, 0x0, 0x0, 0x0, 0x0, 0x0); > + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0); > halbtc8723b1ant_SetAntPath( > - pBtCoexist, BTC_ANT_PATH_WIFI, false, false > + bt_coexist, BTC_ANT_PATH_WIFI, false, false > ); > break; > } > } > > rssiAdjustVal = 0; > - pBtCoexist->fBtcSet( > - pBtCoexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal > + bt_coexist->fBtcSet( > + bt_coexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal > ); > > /* update pre state */ > @@ -1299,46 +1299,46 @@ static void halbtc8723b1ant_PsTdma( > pCoexDm->prePsTdma = pCoexDm->curPsTdma; > } > > -static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) > +static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *bt_coexist) > { > - bool bCommon = false, bWifiConnected = false, bWifiBusy = false; > + bool bCommon = false, bWifiConnected = false, wifi_busy = false; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); > > if ( > !bWifiConnected && > pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE > ) { > - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ > + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ > > bCommon = true; > } else if ( > bWifiConnected && > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE) > ) { > - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ > + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ > > bCommon = true; > } else if ( > !bWifiConnected && > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) > ) { > - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ > + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ > > bCommon = true; > } else if ( > bWifiConnected && > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) > ) { > - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ > + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ > > bCommon = true; > } else if ( > !bWifiConnected && > (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) > ) { > - /* halbtc8723b1ant_SwMechanism(pBtCoexist, false); */ > + /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ > > bCommon = true; > } else { > @@ -1350,7 +1350,7 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *pBtCoexist) > > > static void halbtc8723b1ant_TdmaDurationAdjustForAcl( > - struct btc_coexist *pBtCoexist, u8 wifiStatus > + struct btc_coexist *bt_coexist, u8 wifiStatus > ) > { > static s32 up, dn, m, n, WaitCount; > @@ -1368,7 +1368,7 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( > pCoexDm->curPsTdma != 3 && > pCoexDm->curPsTdma != 9 > ) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); > pCoexDm->psTdmaDuAdjType = 9; > > up = 0; > @@ -1384,7 +1384,7 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( > if (!pCoexDm->bAutoTdmaAdjust) { > pCoexDm->bAutoTdmaAdjust = true; > > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2); > pCoexDm->psTdmaDuAdjType = 2; > /* */ > up = 0; > @@ -1461,16 +1461,16 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( > BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) && > ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2)) > ) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); > pCoexDm->psTdmaDuAdjType = 9; > } else if (pCoexDm->curPsTdma == 1) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2); > pCoexDm->psTdmaDuAdjType = 2; > } else if (pCoexDm->curPsTdma == 2) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); > pCoexDm->psTdmaDuAdjType = 9; > } else if (pCoexDm->curPsTdma == 9) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 11); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 11); > pCoexDm->psTdmaDuAdjType = 11; > } > } else if (result == 1) { > @@ -1478,16 +1478,16 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( > BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) && > ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2)) > ) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); > pCoexDm->psTdmaDuAdjType = 9; > } else if (pCoexDm->curPsTdma == 11) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 9); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); > pCoexDm->psTdmaDuAdjType = 9; > } else if (pCoexDm->curPsTdma == 9) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 2); > pCoexDm->psTdmaDuAdjType = 2; > } else if (pCoexDm->curPsTdma == 2) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 1); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 1); > pCoexDm->psTdmaDuAdjType = 1; > } > } > @@ -1499,27 +1499,27 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( > pCoexDm->curPsTdma != 11 > ) /* recover to previous adjust type */ > halbtc8723b1ant_PsTdma( > - pBtCoexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType > + bt_coexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType > ); > } > } > > static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState( > - struct btc_coexist *pBtCoexist, bool bNewPsState > + struct btc_coexist *bt_coexist, bool bNewPsState > ) > { > u8 lpsMode = 0x0; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_LPS_MODE, &lpsMode); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_LPS_MODE, &lpsMode); > > if (lpsMode) { /* already under LPS state */ > if (bNewPsState) { > /* keep state under LPS, do nothing. */ > } else /* will leave LPS state, turn off psTdma first */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0); > } else { /* NO PS state */ > if (bNewPsState) /* will enter LPS state, turn off psTdma first */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0); > else { > /* keep state under NO PS state, do nothing. */ > } > @@ -1527,7 +1527,7 @@ static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState( > } > > static void halbtc8723b1ant_PowerSaveState( > - struct btc_coexist *pBtCoexist, u8 psType, u8 lpsVal, u8 rpwmVal > + struct btc_coexist *bt_coexist, u8 psType, u8 lpsVal, u8 rpwmVal > ) > { > bool bLowPwrDisable = false; > @@ -1536,27 +1536,27 @@ static void halbtc8723b1ant_PowerSaveState( > case BTC_PS_WIFI_NATIVE: > /* recover to original 32k low power setting */ > bLowPwrDisable = false; > - pBtCoexist->fBtcSet( > - pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable > + bt_coexist->fBtcSet( > + bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable > ); > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_NORMAL_LPS, NULL); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_NORMAL_LPS, NULL); > pCoexSta->bForceLpsOn = false; > break; > case BTC_PS_LPS_ON: > - halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, true); > - halbtc8723b1ant_LpsRpwm(pBtCoexist, NORMAL_EXEC, lpsVal, rpwmVal); > + halbtc8723b1ant_PsTdmaCheckForPowerSaveState(bt_coexist, true); > + halbtc8723b1ant_LpsRpwm(bt_coexist, NORMAL_EXEC, lpsVal, rpwmVal); > /* when coex force to enter LPS, do not enter 32k low power. */ > bLowPwrDisable = true; > - pBtCoexist->fBtcSet( > - pBtCoexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable > + bt_coexist->fBtcSet( > + bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable > ); > /* power save must executed before psTdma. */ > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_ENTER_LPS, NULL); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_ENTER_LPS, NULL); > pCoexSta->bForceLpsOn = true; > break; > case BTC_PS_LPS_OFF: > - halbtc8723b1ant_PsTdmaCheckForPowerSaveState(pBtCoexist, false); > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_ACT_LEAVE_LPS, NULL); > + halbtc8723b1ant_PsTdmaCheckForPowerSaveState(bt_coexist, false); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_LEAVE_LPS, NULL); > pCoexSta->bForceLpsOn = false; > break; > default: > @@ -1575,86 +1575,86 @@ static void halbtc8723b1ant_PowerSaveState( > /* Non-Software Coex Mechanism start */ > /* */ > /* */ > -static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_ActionWifiMultiPort(struct btc_coexist *bt_coexist) > { > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > } > > -static void halbtc8723b1ant_ActionHs(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_ActionHs(struct btc_coexist *bt_coexist) > { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 5); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 5); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > } > > -static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *bt_coexist) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > bool bWifiConnected = false; > bool bApEnable = false; > - bool bWifiBusy = false; > + bool wifi_busy = false; > bool bBtBusy = false; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); > > if (!bWifiConnected && !pCoexSta->bWiFiIsHighPriTask) { > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0); > } else if ( > pBtLinkInfo->bScoExist || > pBtLinkInfo->bHidExist || > pBtLinkInfo->bA2dpExist > ) { > /* SCO/HID/A2DP busy */ > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); > > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > - } else if (pBtLinkInfo->bPanExist || bWifiBusy) { > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > + } else if (pBtLinkInfo->bPanExist || wifi_busy) { > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); > > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else { > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7); > } > } > > static void halbtc8723b1ant_ActionBtScoHidOnlyBusy( > - struct btc_coexist *pBtCoexist, u8 wifiStatus > + struct btc_coexist *bt_coexist, u8 wifiStatus > ) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > bool bWifiConnected = false; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > > /* tdma and coex table */ > > if (pBtLinkInfo->bScoExist) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 5); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 5); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 5); > } else { /* HID */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 6); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 5); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 6); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 5); > } > } > > static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy( > - struct btc_coexist *pBtCoexist, u8 wifiStatus > + struct btc_coexist *bt_coexist, u8 wifiStatus > ) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > > halbtc8723b1ant_BtRssiState(2, 28, 0); > > @@ -1664,97 +1664,97 @@ static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy( > pBtLinkInfo->bSlaveRole = false; > > if (pBtLinkInfo->bHidOnly) { /* HID */ > - halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist, wifiStatus); > + halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, wifiStatus); > pCoexDm->bAutoTdmaAdjust = false; > return; > } else if (pBtLinkInfo->bA2dpOnly) { /* A2DP */ > if (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > pCoexDm->bAutoTdmaAdjust = false; > } else { > - halbtc8723b1ant_TdmaDurationAdjustForAcl(pBtCoexist, wifiStatus); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_TdmaDurationAdjustForAcl(bt_coexist, wifiStatus); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > pCoexDm->bAutoTdmaAdjust = true; > } > } else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { /* HID+A2DP */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 14); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 14); > pCoexDm->bAutoTdmaAdjust = false; > > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else if ( > pBtLinkInfo->bPanOnly || > (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) > ) { /* PAN(OPP, FTP), HID+PAN(OPP, FTP) */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 3); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 3); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > pCoexDm->bAutoTdmaAdjust = false; > } else if ( > (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) || > (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) > ) { /* A2DP+PAN(OPP, FTP), HID+A2DP+PAN(OPP, FTP) */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 13); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 13); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > pCoexDm->bAutoTdmaAdjust = false; > } else { > /* BT no-profile busy (0x9) */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > pCoexDm->bAutoTdmaAdjust = false; > } > } > > -static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *bt_coexist) > { > /* power save state */ > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > > /* tdma and coex table */ > - halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); > + halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0); > } > > static void halbtc8723b1ant_ActionWifiNotConnectedScan( > - struct btc_coexist *pBtCoexist > + struct btc_coexist *bt_coexist > ) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > > /* tdma and coex table */ > if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { > if (pBtLinkInfo->bA2dpExist) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 22); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 22); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } > } else if ( > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) > ) { > halbtc8723b1ant_ActionBtScoHidOnlyBusy( > - pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN > + bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN > ); > } else { > /* Bryant Add */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > } > } > > static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth( > - struct btc_coexist *pBtCoexist > + struct btc_coexist *bt_coexist > ) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > > /* tdma and coex table */ > if ( > @@ -1762,56 +1762,56 @@ static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth( > (pBtLinkInfo->bHidExist) || > (pBtLinkInfo->bA2dpExist) > ) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else if (pBtLinkInfo->bPanExist) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > } > } > > -static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *bt_coexist) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > > /* tdma and coex table */ > if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { > if (pBtLinkInfo->bA2dpExist) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else if (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 22); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 22); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } > } else if ( > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) > ) { > halbtc8723b1ant_ActionBtScoHidOnlyBusy( > - pBtCoexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN > + bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN > ); > } else { > /* Bryant Add */ > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > } > } > > static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket( > - struct btc_coexist *pBtCoexist > + struct btc_coexist *bt_coexist > ) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > > /* tdma and coex table */ > if ( > @@ -1819,62 +1819,62 @@ static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket( > (pBtLinkInfo->bHidExist) || > (pBtLinkInfo->bA2dpExist) > ) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 32); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else if (pBtLinkInfo->bPanExist) { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, true, 20); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 4); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); > } else { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > } > } > > -static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist) > { > - bool bWifiBusy = false; > + bool wifi_busy = false; > bool bScan = false, bLink = false, bRoam = false; > bool bUnder4way = false, bApEnable = false; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way); > if (bUnder4way) { > - halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); > + halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist); > return; > } > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_SCAN, &bScan); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_LINK, &bLink); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_ROAM, &bRoam); > if (bScan || bLink || bRoam) { > if (bScan) > - halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist); > + halbtc8723b1ant_ActionWifiConnectedScan(bt_coexist); > else > - halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); > + halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist); > return; > } > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_AP_MODE_ENABLE, &bApEnable); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); > > /* power save state */ > if ( > !bApEnable && > pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY && > - !pBtCoexist->btLinkInfo.bHidOnly > + !bt_coexist->btLinkInfo.bHidOnly > ) { > - if (pBtCoexist->btLinkInfo.bA2dpOnly) { /* A2DP */ > - if (!bWifiBusy) > + if (bt_coexist->btLinkInfo.bA2dpOnly) { /* A2DP */ > + if (!wifi_busy) > halbtc8723b1ant_PowerSaveState( > - pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 > + bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 > ); > else { /* busy */ > if (pCoexSta->nScanAPNum >= BT_8723B_1ANT_WIFI_NOISY_THRESH) /* no force LPS, no PS-TDMA, use pure TDMA */ > halbtc8723b1ant_PowerSaveState( > - pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 > + bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 > ); > else > halbtc8723b1ant_PowerSaveState( > - pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4 > + bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4 > ); > } > } else if ( > @@ -1882,37 +1882,37 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) > (!pCoexSta->bA2dpExist) && > (!pCoexSta->bHidExist) > ) > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > else > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_LPS_ON, 0x50, 0x4); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4); > } else > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > > /* tdma and coex table */ > - if (!bWifiBusy) { > + if (!wifi_busy) { > if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { > halbtc8723b1ant_ActionWifiConnectedBtAclBusy( > - pBtCoexist, > + bt_coexist, > BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE > ); > } else if ( > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) > ) { > - halbtc8723b1ant_ActionBtScoHidOnlyBusy(pBtCoexist, > + halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, > BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE); > } else { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > > if ((pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60) > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > else > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7); > } > } else { > if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { > halbtc8723b1ant_ActionWifiConnectedBtAclBusy( > - pBtCoexist, > + bt_coexist, > BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY > ); > } else if ( > @@ -1920,60 +1920,60 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *pBtCoexist) > (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) > ) { > halbtc8723b1ant_ActionBtScoHidOnlyBusy( > - pBtCoexist, > + bt_coexist, > BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY > ); > } else { > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 8); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); > > if ((pCoexSta->highPriorityTx) + (pCoexSta->highPriorityRx) <= 60) > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > else > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 7); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 7); > } > } > } > > -static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *bt_coexist) > { > u8 algorithm = 0; > > - algorithm = halbtc8723b1ant_ActionAlgorithm(pBtCoexist); > + algorithm = halbtc8723b1ant_ActionAlgorithm(bt_coexist); > pCoexDm->curAlgorithm = algorithm; > > - if (halbtc8723b1ant_IsCommonAction(pBtCoexist)) { > + if (halbtc8723b1ant_IsCommonAction(bt_coexist)) { > > } else { > switch (pCoexDm->curAlgorithm) { > case BT_8723B_1ANT_COEX_ALGO_SCO: > - /* halbtc8723b1ant_ActionSco(pBtCoexist); */ > + /* halbtc8723b1ant_ActionSco(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_HID: > - /* halbtc8723b1ant_ActionHid(pBtCoexist); */ > + /* halbtc8723b1ant_ActionHid(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_A2DP: > - /* halbtc8723b1ant_ActionA2dp(pBtCoexist); */ > + /* halbtc8723b1ant_ActionA2dp(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS: > - /* halbtc8723b1ant_ActionA2dpPanHs(pBtCoexist); */ > + /* halbtc8723b1ant_ActionA2dpPanHs(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_PANEDR: > - /* halbtc8723b1ant_ActionPanEdr(pBtCoexist); */ > + /* halbtc8723b1ant_ActionPanEdr(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_PANHS: > - /* halbtc8723b1ant_ActionPanHs(pBtCoexist); */ > + /* halbtc8723b1ant_ActionPanHs(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP: > - /* halbtc8723b1ant_ActionPanEdrA2dp(pBtCoexist); */ > + /* halbtc8723b1ant_ActionPanEdrA2dp(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_PANEDR_HID: > - /* halbtc8723b1ant_ActionPanEdrHid(pBtCoexist); */ > + /* halbtc8723b1ant_ActionPanEdrHid(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR: > - /* halbtc8723b1ant_ActionHidA2dpPanEdr(pBtCoexist); */ > + /* halbtc8723b1ant_ActionHidA2dpPanEdr(bt_coexist); */ > break; > case BT_8723B_1ANT_COEX_ALGO_HID_A2DP: > - /* halbtc8723b1ant_ActionHidA2dp(pBtCoexist); */ > + /* halbtc8723b1ant_ActionHidA2dp(bt_coexist); */ > break; > default: > break; > @@ -1982,20 +1982,20 @@ static void halbtc8723b1ant_RunSwCoexistMechanism(struct btc_coexist *pBtCoexist > } > } > > -static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *bt_coexist) > { > - struct btc_bt_link_info *pBtLinkInfo = &pBtCoexist->btLinkInfo; > + struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; > bool bWifiConnected = false, bBtHsOn = false; > bool bIncreaseScanDevNum = false; > - bool bBtCtrlAggBufSize = false; > - u8 aggBufSize = 5; > + bool bt_ctrl_agg_buf_size = false; > + u8 agg_buf_size = 5; > u32 wifiLinkStatus = 0; > u32 numOfWifiLink = 0; > > - if (pBtCoexist->bManualControl) > + if (bt_coexist->bManualControl) > return; > > - if (pBtCoexist->bStopCoexDm) > + if (bt_coexist->bStopCoexDm) > return; > > if (pCoexSta->bUnderIps) > @@ -2009,61 +2009,61 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) > bIncreaseScanDevNum = true; > } > > - pBtCoexist->fBtcSet( > - pBtCoexist, > + bt_coexist->fBtcSet( > + bt_coexist, > BTC_SET_BL_INC_SCAN_DEV_NUM, > &bIncreaseScanDevNum > ); > - pBtCoexist->fBtcGet( > - pBtCoexist, > + bt_coexist->fBtcGet( > + bt_coexist, > BTC_GET_BL_WIFI_CONNECTED, > &bWifiConnected > ); > > - pBtCoexist->fBtcGet( > - pBtCoexist, > + bt_coexist->fBtcGet( > + bt_coexist, > BTC_GET_U4_WIFI_LINK_STATUS, > &wifiLinkStatus > ); > numOfWifiLink = wifiLinkStatus >> 16; > > if ((numOfWifiLink >= 2) || (wifiLinkStatus & WIFI_P2P_GO_CONNECTED)) { > - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); > - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize); > + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); > + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size); > > if ((pBtLinkInfo->bA2dpExist) && (pCoexSta->bC2hBtInquiryPage)) > - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); > + halbtc8723b1ant_ActionBtInquiry(bt_coexist); > else > - halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); > + halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); > > return; > } > > if ((pBtLinkInfo->bBtLinkExist) && (bWifiConnected)) { > - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 1, 1, 0, 1); > + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 1, 1, 0, 1); > > if (pBtLinkInfo->bScoExist) > - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, true, 0x5); > + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, true, 0x5); > else > - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, true, 0x8); > + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, true, 0x8); > > - halbtc8723b1ant_SwMechanism(pBtCoexist, true); > - halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); /* just print debug message */ > + halbtc8723b1ant_SwMechanism(bt_coexist, true); > + halbtc8723b1ant_RunSwCoexistMechanism(bt_coexist); /* just print debug message */ > } else { > - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); > + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); > > - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, false, 0x5); > + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, false, 0x5); > > - halbtc8723b1ant_SwMechanism(pBtCoexist, false); > - halbtc8723b1ant_RunSwCoexistMechanism(pBtCoexist); /* just print debug message */ > + halbtc8723b1ant_SwMechanism(bt_coexist, false); > + halbtc8723b1ant_RunSwCoexistMechanism(bt_coexist); /* just print debug message */ > } > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > if (pCoexSta->bC2hBtInquiryPage) { > - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); > + halbtc8723b1ant_ActionBtInquiry(bt_coexist); > return; > } else if (bBtHsOn) { > - halbtc8723b1ant_ActionHs(pBtCoexist); > + halbtc8723b1ant_ActionHs(bt_coexist); > return; > } > > @@ -2071,62 +2071,62 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *pBtCoexist) > if (!bWifiConnected) { > bool bScan = false, bLink = false, bRoam = false; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_ROAM, &bRoam); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_SCAN, &bScan); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_LINK, &bLink); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_ROAM, &bRoam); > > if (bScan || bLink || bRoam) { > if (bScan) > - halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist); > + halbtc8723b1ant_ActionWifiNotConnectedScan(bt_coexist); > else > - halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); > + halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(bt_coexist); > } else > - halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); > + halbtc8723b1ant_ActionWifiNotConnected(bt_coexist); > } else /* wifi LPS/Busy */ > - halbtc8723b1ant_ActionWifiConnected(pBtCoexist); > + halbtc8723b1ant_ActionWifiConnected(bt_coexist); > } > > -static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist) > +static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist) > { > /* force to reset coex mechanism */ > > /* sw all off */ > - halbtc8723b1ant_SwMechanism(pBtCoexist, false); > + halbtc8723b1ant_SwMechanism(bt_coexist, false); > > - /* halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); */ > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); > + /* halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); */ > + halbtc8723b1ant_CoexTableWithType(bt_coexist, FORCE_EXEC, 0); > > pCoexSta->popEventCnt = 0; > } > > static void halbtc8723b1ant_InitHwConfig( > - struct btc_coexist *pBtCoexist, > + struct btc_coexist *bt_coexist, > bool bBackUp, > bool bWifiOnly > ) > { > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */ > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */ > > /* 0x790[5:0]= 0x5 */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x790, 0x5); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x790, 0x5); > > /* Enable counter statistics */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x778, 0x1); > - pBtCoexist->fBtcWrite1ByteBitMask(pBtCoexist, 0x40, 0x20, 0x1); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x778, 0x1); > + bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x40, 0x20, 0x1); > > /* Antenna config */ > if (bWifiOnly) { > - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_WIFI, true, false); > - halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 9); > + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_WIFI, true, false); > + halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 9); > } else > - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, true, false); > + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, true, false); > > /* PTA parameter */ > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, FORCE_EXEC, 0); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, FORCE_EXEC, 0); > > - pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); > - pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); > - pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); > + bt_coexist->fBtcRead4Byte(bt_coexist, 0x948); > + bt_coexist->fBtcRead1Byte(bt_coexist, 0x765); > + bt_coexist->fBtcRead1Byte(bt_coexist, 0x67); > } > > /* */ > @@ -2135,22 +2135,22 @@ static void halbtc8723b1ant_InitHwConfig( > /* */ > /* extern function start with EXhalbtc8723b1ant_ */ > /* */ > -void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist) > +void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *bt_coexist) > { > - struct btc_board_info *pBoardInfo = &pBtCoexist->boardInfo; > + struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo; > u8 u1Tmp = 0x0; > u16 u2Tmp = 0x0; > > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x67, 0x20); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x67, 0x20); > > /* enable BB, REG_SYS_FUNC_EN such that we can write 0x948 correctly. */ > - u2Tmp = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x2); > - pBtCoexist->fBtcWrite2Byte(pBtCoexist, 0x2, u2Tmp | BIT0 | BIT1); > + u2Tmp = bt_coexist->fBtcRead2Byte(bt_coexist, 0x2); > + bt_coexist->fBtcWrite2Byte(bt_coexist, 0x2, u2Tmp | BIT0 | BIT1); > > /* set GRAN_BT = 1 */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x765, 0x18); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x765, 0x18); > /* set WLAN_ACT = 0 */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x76e, 0x4); > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x76e, 0x4); > > /* */ > /* S0 or S1 setting and Local register setting(By the setting fw can get ant number, S0/S1, ... info) */ > @@ -2159,71 +2159,71 @@ void EXhalbtc8723b1ant_PowerOnSetting(struct btc_coexist *pBtCoexist) > /* BIT1: "0" for internal switch; "1" for external switch */ > /* BIT2: "0" for one antenna; "1" for two antenna */ > /* NOTE: here default all internal switch and 1-antenna ==> BIT1 = 0 and BIT2 = 0 */ > - if (pBtCoexist->chipInterface == BTC_INTF_USB) { > + if (bt_coexist->chipInterface == BTC_INTF_USB) { > /* fixed at S0 for USB interface */ > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); > > u1Tmp |= 0x1; /* antenna inverse */ > - pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0xfe08, u1Tmp); > + bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0xfe08, u1Tmp); > > pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT; > } else { > /* for PCIE and SDIO interface, we check efuse 0xc3[6] */ > if (pBoardInfo->singleAntPath == 0) { > /* set to S1 */ > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x280); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x280); > pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; > } else if (pBoardInfo->singleAntPath == 1) { > /* set to S0 */ > - pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x948, 0x0); > + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x948, 0x0); > u1Tmp |= 0x1; /* antenna inverse */ > pBoardInfo->btdmAntPos = BTC_ANTENNA_AT_AUX_PORT; > } > > - if (pBtCoexist->chipInterface == BTC_INTF_PCI) > - pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x384, u1Tmp); > - else if (pBtCoexist->chipInterface == BTC_INTF_SDIO) > - pBtCoexist->fBtcWriteLocalReg1Byte(pBtCoexist, 0x60, u1Tmp); > + if (bt_coexist->chipInterface == BTC_INTF_PCI) > + bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0x384, u1Tmp); > + else if (bt_coexist->chipInterface == BTC_INTF_SDIO) > + bt_coexist->fBtcWriteLocalReg1Byte(bt_coexist, 0x60, u1Tmp); > } > } > > -void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *pBtCoexist, bool bWifiOnly) > +void EXhalbtc8723b1ant_InitHwConfig(struct btc_coexist *bt_coexist, bool bWifiOnly) > { > - halbtc8723b1ant_InitHwConfig(pBtCoexist, true, bWifiOnly); > + halbtc8723b1ant_InitHwConfig(bt_coexist, true, bWifiOnly); > } > > -void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *pBtCoexist) > +void EXhalbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist) > { > - pBtCoexist->bStopCoexDm = false; > + bt_coexist->bStopCoexDm = false; > > - halbtc8723b1ant_InitCoexDm(pBtCoexist); > + halbtc8723b1ant_InitCoexDm(bt_coexist); > > - halbtc8723b1ant_QueryBtInfo(pBtCoexist); > + halbtc8723b1ant_QueryBtInfo(bt_coexist); > } > > -void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) > +void EXhalbtc8723b1ant_IpsNotify(struct btc_coexist *bt_coexist, u8 type) > { > - if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) > + if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm) > return; > > if (type == BTC_IPS_ENTER) { > pCoexSta->bUnderIps = true; > > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 0); > - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0); > + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true); > } else if (type == BTC_IPS_LEAVE) { > pCoexSta->bUnderIps = false; > > - halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false); > - halbtc8723b1ant_InitCoexDm(pBtCoexist); > - halbtc8723b1ant_QueryBtInfo(pBtCoexist); > + halbtc8723b1ant_InitHwConfig(bt_coexist, false, false); > + halbtc8723b1ant_InitCoexDm(bt_coexist); > + halbtc8723b1ant_QueryBtInfo(bt_coexist); > } > } > > -void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) > +void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *bt_coexist, u8 type) > { > - if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) > + if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm) > return; > > if (type == BTC_LPS_ENABLE) > @@ -2232,85 +2232,85 @@ void EXhalbtc8723b1ant_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) > pCoexSta->bUnderLps = false; > } > > -void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) > +void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *bt_coexist, u8 type) > { > bool bWifiConnected = false, bBtHsOn = false; > u32 wifiLinkStatus = 0; > u32 numOfWifiLink = 0; > - bool bBtCtrlAggBufSize = false; > - u8 aggBufSize = 5; > + bool bt_ctrl_agg_buf_size = false; > + u8 agg_buf_size = 5; > > - if (pBtCoexist->bManualControl || pBtCoexist->bStopCoexDm) > + if (bt_coexist->bManualControl || bt_coexist->bStopCoexDm) > return; > > if (type == BTC_SCAN_START) { > pCoexSta->bWiFiIsHighPriTask = true; > > - halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */ > - pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x948); > - pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x765); > - pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x67); > + halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 8); /* Force antenna setup for no scan result issue */ > + bt_coexist->fBtcRead4Byte(bt_coexist, 0x948); > + bt_coexist->fBtcRead1Byte(bt_coexist, 0x765); > + bt_coexist->fBtcRead1Byte(bt_coexist, 0x67); > } else { > pCoexSta->bWiFiIsHighPriTask = false; > > - pBtCoexist->fBtcGet( > - pBtCoexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum > + bt_coexist->fBtcGet( > + bt_coexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum > ); > } > > - if (pBtCoexist->btInfo.bBtDisabled) > + if (bt_coexist->btInfo.bBtDisabled) > return; > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > > - halbtc8723b1ant_QueryBtInfo(pBtCoexist); > + halbtc8723b1ant_QueryBtInfo(bt_coexist); > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); > numOfWifiLink = wifiLinkStatus >> 16; > > if (numOfWifiLink >= 2) { > - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); > + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); > halbtc8723b1ant_LimitedRx( > - pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize > + bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size > ); > - halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); > + halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); > return; > } > > if (pCoexSta->bC2hBtInquiryPage) { > - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); > + halbtc8723b1ant_ActionBtInquiry(bt_coexist); > return; > } else if (bBtHsOn) { > - halbtc8723b1ant_ActionHs(pBtCoexist); > + halbtc8723b1ant_ActionHs(bt_coexist); > return; > } > > if (type == BTC_SCAN_START) { > if (!bWifiConnected) /* non-connected scan */ > - halbtc8723b1ant_ActionWifiNotConnectedScan(pBtCoexist); > + halbtc8723b1ant_ActionWifiNotConnectedScan(bt_coexist); > else /* wifi is connected */ > - halbtc8723b1ant_ActionWifiConnectedScan(pBtCoexist); > + halbtc8723b1ant_ActionWifiConnectedScan(bt_coexist); > } else if (type == BTC_SCAN_FINISH) { > if (!bWifiConnected) /* non-connected scan */ > - halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); > + halbtc8723b1ant_ActionWifiNotConnected(bt_coexist); > else > - halbtc8723b1ant_ActionWifiConnected(pBtCoexist); > + halbtc8723b1ant_ActionWifiConnected(bt_coexist); > } > } > > -void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) > +void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *bt_coexist, u8 type) > { > bool bWifiConnected = false, bBtHsOn = false; > u32 wifiLinkStatus = 0; > u32 numOfWifiLink = 0; > - bool bBtCtrlAggBufSize = false; > - u8 aggBufSize = 5; > + bool bt_ctrl_agg_buf_size = false; > + u8 agg_buf_size = 5; > > if ( > - pBtCoexist->bManualControl || > - pBtCoexist->bStopCoexDm || > - pBtCoexist->btInfo.bBtDisabled > + bt_coexist->bManualControl || > + bt_coexist->bStopCoexDm || > + bt_coexist->btInfo.bBtDisabled > ) > return; > > @@ -2322,79 +2322,79 @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *pBtCoexist, u8 type) > /* pCoexDm->nArpCnt = 0; */ > } > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); > numOfWifiLink = wifiLinkStatus >> 16; > if (numOfWifiLink >= 2) { > - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); > - halbtc8723b1ant_LimitedRx(pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize); > - halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); > + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); > + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size); > + halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); > return; > } > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > if (pCoexSta->bC2hBtInquiryPage) { > - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); > + halbtc8723b1ant_ActionBtInquiry(bt_coexist); > return; > } else if (bBtHsOn) { > - halbtc8723b1ant_ActionHs(pBtCoexist); > + halbtc8723b1ant_ActionHs(bt_coexist); > return; > } > > if (type == BTC_ASSOCIATE_START) { > - halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(pBtCoexist); > + halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(bt_coexist); > } else if (type == BTC_ASSOCIATE_FINISH) { > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > if (!bWifiConnected) /* non-connected scan */ > - halbtc8723b1ant_ActionWifiNotConnected(pBtCoexist); > + halbtc8723b1ant_ActionWifiNotConnected(bt_coexist); > else > - halbtc8723b1ant_ActionWifiConnected(pBtCoexist); > + halbtc8723b1ant_ActionWifiConnected(bt_coexist); > } > } > > -void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type) > +void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *bt_coexist, u8 type) > { > u8 H2C_Parameter[3] = {0}; > u32 wifiBw; > u8 wifiCentralChnl; > - bool bWifiUnderBMode = false; > + bool wifi_under_b_mode = false; > > if ( > - pBtCoexist->bManualControl || > - pBtCoexist->bStopCoexDm || > - pBtCoexist->btInfo.bBtDisabled > + bt_coexist->bManualControl || > + bt_coexist->bStopCoexDm || > + bt_coexist->btInfo.bBtDisabled > ) > return; > > if (type == BTC_MEDIA_CONNECT) { > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &bWifiUnderBMode); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode); > > /* Set CCK Tx/Rx high Pri except 11b mode */ > - if (bWifiUnderBMode) { > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x00); /* CCK Tx */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x00); /* CCK Rx */ > + if (wifi_under_b_mode) { > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x00); /* CCK Tx */ > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x00); /* CCK Rx */ > } else { > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x10); /* CCK Tx */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x10); /* CCK Rx */ > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x10); /* CCK Tx */ > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x10); /* CCK Rx */ > } > > - pCoexDm->backupArfrCnt1 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x430); > - pCoexDm->backupArfrCnt2 = pBtCoexist->fBtcRead4Byte(pBtCoexist, 0x434); > - pCoexDm->backupRetryLimit = pBtCoexist->fBtcRead2Byte(pBtCoexist, 0x42a); > - pCoexDm->backupAmpduMaxTime = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x456); > + pCoexDm->backupArfrCnt1 = bt_coexist->fBtcRead4Byte(bt_coexist, 0x430); > + pCoexDm->backupArfrCnt2 = bt_coexist->fBtcRead4Byte(bt_coexist, 0x434); > + pCoexDm->backupRetryLimit = bt_coexist->fBtcRead2Byte(bt_coexist, 0x42a); > + pCoexDm->backupAmpduMaxTime = bt_coexist->fBtcRead1Byte(bt_coexist, 0x456); > } else { > pCoexDm->nArpCnt = 0; > > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cd, 0x0); /* CCK Tx */ > - pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cf, 0x0); /* CCK Rx */ > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cd, 0x0); /* CCK Tx */ > + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cf, 0x0); /* CCK Rx */ > } > > /* only 2.4G we need to inform bt the chnl mask */ > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_WIFI_CENTRAL_CHNL, &wifiCentralChnl); > if ((type == BTC_MEDIA_CONNECT) && (wifiCentralChnl <= 14)) { > /* H2C_Parameter[0] = 0x1; */ > H2C_Parameter[0] = 0x0; > H2C_Parameter[1] = wifiCentralChnl; > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_BW, &wifiBw); > > if (wifiBw == BTC_WIFI_BW_HT40) > H2C_Parameter[2] = 0x30; > @@ -2406,21 +2406,21 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *pBtCoexist, u8 type > pCoexDm->wifiChnlInfo[1] = H2C_Parameter[1]; > pCoexDm->wifiChnlInfo[2] = H2C_Parameter[2]; > > - pBtCoexist->fBtcFillH2c(pBtCoexist, 0x66, 3, H2C_Parameter); > + bt_coexist->fBtcFillH2c(bt_coexist, 0x66, 3, H2C_Parameter); > } > > -void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 type) > +void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 type) > { > bool bBtHsOn = false; > u32 wifiLinkStatus = 0; > u32 numOfWifiLink = 0; > - bool bBtCtrlAggBufSize = false; > - u8 aggBufSize = 5; > + bool bt_ctrl_agg_buf_size = false; > + u8 agg_buf_size = 5; > > if ( > - pBtCoexist->bManualControl || > - pBtCoexist->bStopCoexDm || > - pBtCoexist->btInfo.bBtDisabled > + bt_coexist->bManualControl || > + bt_coexist->bStopCoexDm || > + bt_coexist->btInfo.bBtDisabled > ) > return; > > @@ -2432,7 +2432,7 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty > if (type == BTC_PACKET_ARP) { > pCoexDm->nArpCnt++; > > - if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(pBtCoexist) */ > + if (pCoexDm->nArpCnt >= 10) /* if APR PKT > 10 after connect, do not go to ActionWifiConnectedSpecialPacket(bt_coexist) */ > pCoexSta->bWiFiIsHighPriTask = false; > else > pCoexSta->bWiFiIsHighPriTask = true; > @@ -2445,26 +2445,26 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty > > pCoexSta->specialPktPeriodCnt = 0; > > - pBtCoexist->fBtcGet( > - pBtCoexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus > + bt_coexist->fBtcGet( > + bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus > ); > numOfWifiLink = wifiLinkStatus >> 16; > > if (numOfWifiLink >= 2) { > - halbtc8723b1ant_LimitedTx(pBtCoexist, NORMAL_EXEC, 0, 0, 0, 0); > + halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); > halbtc8723b1ant_LimitedRx( > - pBtCoexist, NORMAL_EXEC, false, bBtCtrlAggBufSize, aggBufSize > + bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size > ); > - halbtc8723b1ant_ActionWifiMultiPort(pBtCoexist); > + halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); > return; > } > > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); > if (pCoexSta->bC2hBtInquiryPage) { > - halbtc8723b1ant_ActionBtInquiry(pBtCoexist); > + halbtc8723b1ant_ActionBtInquiry(bt_coexist); > return; > } else if (bBtHsOn) { > - halbtc8723b1ant_ActionHs(pBtCoexist); > + halbtc8723b1ant_ActionHs(bt_coexist); > return; > } > > @@ -2473,11 +2473,11 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 ty > type == BTC_PACKET_EAPOL || > ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask)) > ) > - halbtc8723b1ant_ActionWifiConnectedSpecialPacket(pBtCoexist); > + halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist); > } > > void EXhalbtc8723b1ant_BtInfoNotify( > - struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length > + struct btc_coexist *bt_coexist, u8 *tmpBuf, u8 length > ) > { > u8 btInfo = 0; > @@ -2509,32 +2509,32 @@ void EXhalbtc8723b1ant_BtInfoNotify( > else > pCoexSta->bC2hBtPage = false; > > - pCoexSta->btRssi = pCoexSta->btInfoC2h[rspSource][3] * 2 - 90; > + pCoexSta->bt_rssi = pCoexSta->btInfoC2h[rspSource][3] * 2 - 90; > /* pCoexSta->btInfoC2h[rspSource][3]*2+10; */ > > pCoexSta->btInfoExt = pCoexSta->btInfoC2h[rspSource][4]; > > pCoexSta->bBtTxRxMask = (pCoexSta->btInfoC2h[rspSource][2] & 0x40); > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TX_RX_MASK, &pCoexSta->bBtTxRxMask); > > if (!pCoexSta->bBtTxRxMask) { > /* BT into is responded by BT FW and BT RF REG 0x3C != 0x15 => Need to switch BT TRx Mask */ > - pBtCoexist->fBtcSetBtReg(pBtCoexist, BTC_BT_REG_RF, 0x3c, 0x15); > + bt_coexist->fBtcSetBtReg(bt_coexist, BTC_BT_REG_RF, 0x3c, 0x15); > } > > /* Here we need to resend some wifi info to BT */ > /* because bt is reset and loss of the info. */ > if (pCoexSta->btInfoExt & BIT1) { > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); > if (bWifiConnected) > - EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_CONNECT); > + EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_CONNECT); > else > - EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); > + EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_DISCONNECT); > } > > if (pCoexSta->btInfoExt & BIT3) { > - if (!pBtCoexist->bManualControl && !pBtCoexist->bStopCoexDm) > - halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, false); > + if (!bt_coexist->bManualControl && !bt_coexist->bStopCoexDm) > + halbtc8723b1ant_IgnoreWlanAct(bt_coexist, FORCE_EXEC, false); > } else { > /* BT already NOT ignore Wlan active, do nothing here. */ > } > @@ -2576,7 +2576,7 @@ void EXhalbtc8723b1ant_BtInfoNotify( > pCoexSta->bScoExist = false; > } > > - halbtc8723b1ant_UpdateBtLinkInfo(pBtCoexist); > + halbtc8723b1ant_UpdateBtLinkInfo(bt_coexist); > > btInfo = btInfo & 0x1f; /* mask profile bit for connect-ilde identification (for CSR case: A2DP idle --> 0x41) */ > > @@ -2607,60 +2607,60 @@ void EXhalbtc8723b1ant_BtInfoNotify( > bBtBusy = true; > else > bBtBusy = false; > - pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); > + bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_TRAFFIC_BUSY, &bBtBusy); > > - halbtc8723b1ant_RunCoexistMechanism(pBtCoexist); > + halbtc8723b1ant_RunCoexistMechanism(bt_coexist); > } > > -void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *pBtCoexist) > +void EXhalbtc8723b1ant_HaltNotify(struct btc_coexist *bt_coexist) > { > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > - halbtc8723b1ant_PsTdma(pBtCoexist, FORCE_EXEC, false, 0); > - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PsTdma(bt_coexist, FORCE_EXEC, false, 0); > + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true); > > - halbtc8723b1ant_IgnoreWlanAct(pBtCoexist, FORCE_EXEC, true); > + halbtc8723b1ant_IgnoreWlanAct(bt_coexist, FORCE_EXEC, true); > > - EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT); > + EXhalbtc8723b1ant_MediaStatusNotify(bt_coexist, BTC_MEDIA_DISCONNECT); > > - pBtCoexist->bStopCoexDm = true; > + bt_coexist->bStopCoexDm = true; > } > > -void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *pBtCoexist, u8 pnpState) > +void EXhalbtc8723b1ant_PnpNotify(struct btc_coexist *bt_coexist, u8 pnpState) > { > if (pnpState == BTC_WIFI_PNP_SLEEP) { > - halbtc8723b1ant_PowerSaveState(pBtCoexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > - halbtc8723b1ant_PsTdma(pBtCoexist, NORMAL_EXEC, false, 0); > - halbtc8723b1ant_CoexTableWithType(pBtCoexist, NORMAL_EXEC, 2); > - halbtc8723b1ant_SetAntPath(pBtCoexist, BTC_ANT_PATH_BT, false, true); > + halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); > + halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 0); > + halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 2); > + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, true); > > - pBtCoexist->bStopCoexDm = true; > + bt_coexist->bStopCoexDm = true; > } else if (pnpState == BTC_WIFI_PNP_WAKE_UP) { > - pBtCoexist->bStopCoexDm = false; > - halbtc8723b1ant_InitHwConfig(pBtCoexist, false, false); > - halbtc8723b1ant_InitCoexDm(pBtCoexist); > - halbtc8723b1ant_QueryBtInfo(pBtCoexist); > + bt_coexist->bStopCoexDm = false; > + halbtc8723b1ant_InitHwConfig(bt_coexist, false, false); > + halbtc8723b1ant_InitCoexDm(bt_coexist); > + halbtc8723b1ant_QueryBtInfo(bt_coexist); > } > } > > -void EXhalbtc8723b1ant_Periodical(struct btc_coexist *pBtCoexist) > +void EXhalbtc8723b1ant_Periodical(struct btc_coexist *bt_coexist) > { > static u8 disVerInfoCnt; > u32 fwVer = 0, btPatchVer = 0; > > if (disVerInfoCnt <= 5) { > disVerInfoCnt += 1; > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); > - pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_BT_PATCH_VER, &btPatchVer); > + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_FW_VER, &fwVer); > } > > - halbtc8723b1ant_MonitorBtCtr(pBtCoexist); > - halbtc8723b1ant_MonitorWiFiCtr(pBtCoexist); > + halbtc8723b1ant_MonitorBtCtr(bt_coexist); > + halbtc8723b1ant_MonitorWiFiCtr(bt_coexist); > > if ( > - halbtc8723b1ant_IsWifiStatusChanged(pBtCoexist) || > + halbtc8723b1ant_IsWifiStatusChanged(bt_coexist) || > pCoexDm->bAutoTdmaAdjust > ) > - halbtc8723b1ant_RunCoexistMechanism(pBtCoexist); > + halbtc8723b1ant_RunCoexistMechanism(bt_coexist); > > pCoexSta->specialPktPeriodCnt++; > } > -- > 2.43.0 > > > ^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v2 4/5] staging: rtl8723bs: fix check lines should not end with a '(' 2025-04-01 16:59 [PATCH v2 0/5] Clean up patches for rtl8723bs driver Erick Karanja ` (2 preceding siblings ...) 2025-04-01 16:59 ` [PATCH v2 3/5] staging: rtl8723bs: Rename variables Erick Karanja @ 2025-04-01 16:59 ` Erick Karanja 2025-04-01 16:59 ` [PATCH v2 5/5] staging: rtl8723bs: no space before tabs Erick Karanja 4 siblings, 0 replies; 11+ messages in thread From: Erick Karanja @ 2025-04-01 16:59 UTC (permalink / raw) To: gregkh, outreachy Cc: karanja99erick, philipp.g.hortmann, linux-staging, linux-kernel Fix Line should not end with a '(' so as to adhere to the Linux kernel coding-style guidelines. Reported by checkpatch: CHECK: line should not end with a '(' Signed-off-by: Erick Karanja <karanja99erick@gmail.com> --- .../staging/rtl8723bs/hal/HalBtc8723b1Ant.c | 898 ++++++++---------- 1 file changed, 398 insertions(+), 500 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c index e3c67f98e8c0..6edb76cb3b6c 100644 --- a/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c +++ b/drivers/staging/rtl8723bs/hal/HalBtc8723b1Ant.c @@ -15,9 +15,7 @@ static struct coex_sta_8723b_1ant *pCoexSta = &GLCoexSta8723b1Ant; /* local function proto type if needed */ /* local function start with halbtc8723b1ant_ */ -static u8 halbtc8723b1ant_BtRssiState( - u8 level_num, u8 rssi_thresh, u8 rssi_thresh1 -) +static u8 halbtc8723b1ant_BtRssiState(u8 level_num, u8 rssi_thresh, u8 rssi_thresh1) { s32 bt_rssi = 0; u8 bt_rssi_state = pCoexSta->preBtRssiState; @@ -25,9 +23,8 @@ static u8 halbtc8723b1ant_BtRssiState( bt_rssi = pCoexSta->bt_rssi; if (level_num == 2) { - if ( - (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || - (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) + if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || + (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) ) { if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) @@ -44,16 +41,14 @@ static u8 halbtc8723b1ant_BtRssiState( if (rssi_thresh > rssi_thresh1) return pCoexSta->preBtRssiState; - if ( - (pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || - (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) + if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_LOW) || + (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_LOW) ) { if (bt_rssi >= (rssi_thresh + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) bt_rssi_state = BTC_RSSI_STATE_MEDIUM; else bt_rssi_state = BTC_RSSI_STATE_STAY_LOW; - } else if ( - (pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || + } else if ((pCoexSta->preBtRssiState == BTC_RSSI_STATE_MEDIUM) || (pCoexSta->preBtRssiState == BTC_RSSI_STATE_STAY_MEDIUM) ) { if (bt_rssi >= (rssi_thresh1 + BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT)) @@ -75,24 +70,21 @@ static u8 halbtc8723b1ant_BtRssiState( return bt_rssi_state; } -static void halbtc8723b1ant_UpdateRaMask( - struct btc_coexist *bt_coexist, bool force_exec, u32 dis_rate_mask -) +static void halbtc8723b1ant_UpdateRaMask(struct btc_coexist *bt_coexist, bool force_exec, + u32 dis_rate_mask) { pCoexDm->curRaMask = dis_rate_mask; if (force_exec || (pCoexDm->preRaMask != pCoexDm->curRaMask)) - bt_coexist->fBtcSet( - bt_coexist, - BTC_SET_ACT_UPDATE_RAMASK, - &pCoexDm->curRaMask + bt_coexist->fBtcSet(bt_coexist, + BTC_SET_ACT_UPDATE_RAMASK, + &pCoexDm->curRaMask ); pCoexDm->preRaMask = pCoexDm->curRaMask; } -static void halbtc8723b1ant_AutoRateFallbackRetry( - struct btc_coexist *bt_coexist, bool force_exec, u8 type -) +static void halbtc8723b1ant_AutoRateFallbackRetry(struct btc_coexist *bt_coexist, bool force_exec, + u8 type) { bool wifi_under_b_mode = false; @@ -101,17 +93,12 @@ static void halbtc8723b1ant_AutoRateFallbackRetry( if (force_exec || (pCoexDm->preArfrType != pCoexDm->curArfrType)) { switch (pCoexDm->curArfrType) { case 0: /* normal mode */ - bt_coexist->fBtcWrite4Byte( - bt_coexist, 0x430, pCoexDm->backupArfrCnt1 - ); - bt_coexist->fBtcWrite4Byte( - bt_coexist, 0x434, pCoexDm->backupArfrCnt2 - ); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, pCoexDm->backupArfrCnt1); + bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, pCoexDm->backupArfrCnt2); break; case 1: - bt_coexist->fBtcGet( - bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode - ); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, + &wifi_under_b_mode); if (wifi_under_b_mode) { bt_coexist->fBtcWrite4Byte(bt_coexist, 0x430, 0x0); bt_coexist->fBtcWrite4Byte(bt_coexist, 0x434, 0x01010101); @@ -128,21 +115,14 @@ static void halbtc8723b1ant_AutoRateFallbackRetry( pCoexDm->preArfrType = pCoexDm->curArfrType; } -static void halbtc8723b1ant_RetryLimit( - struct btc_coexist *bt_coexist, bool force_exec, u8 type -) +static void halbtc8723b1ant_RetryLimit(struct btc_coexist *bt_coexist, bool force_exec, u8 type) { pCoexDm->curRetryLimitType = type; - if ( - force_exec || - (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType) - ) { + if (force_exec || (pCoexDm->preRetryLimitType != pCoexDm->curRetryLimitType)) { switch (pCoexDm->curRetryLimitType) { case 0: /* normal mode */ - bt_coexist->fBtcWrite2Byte( - bt_coexist, 0x42a, pCoexDm->backupRetryLimit - ); + bt_coexist->fBtcWrite2Byte(bt_coexist, 0x42a, pCoexDm->backupRetryLimit); break; case 1: /* retry limit =8 */ bt_coexist->fBtcWrite2Byte(bt_coexist, 0x42a, 0x0808); @@ -155,20 +135,15 @@ static void halbtc8723b1ant_RetryLimit( pCoexDm->preRetryLimitType = pCoexDm->curRetryLimitType; } -static void halbtc8723b1ant_AmpduMaxTime( - struct btc_coexist *bt_coexist, bool force_exec, u8 type -) +static void halbtc8723b1ant_AmpduMaxTime(struct btc_coexist *bt_coexist, bool force_exec, u8 type) { pCoexDm->curAmpduTimeType = type; - if ( - force_exec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType) + if (force_exec || (pCoexDm->preAmpduTimeType != pCoexDm->curAmpduTimeType) ) { switch (pCoexDm->curAmpduTimeType) { case 0: /* normal mode */ - bt_coexist->fBtcWrite1Byte( - bt_coexist, 0x456, pCoexDm->backupAmpduMaxTime - ); + bt_coexist->fBtcWrite1Byte(bt_coexist, 0x456, pCoexDm->backupAmpduMaxTime); break; case 1: /* AMPDU timw = 0x38 * 32us */ bt_coexist->fBtcWrite1Byte(bt_coexist, 0x456, 0x38); @@ -181,14 +156,9 @@ static void halbtc8723b1ant_AmpduMaxTime( pCoexDm->preAmpduTimeType = pCoexDm->curAmpduTimeType; } -static void halbtc8723b1ant_LimitedTx( - struct btc_coexist *bt_coexist, - bool force_exec, - u8 ra_mask_type, - u8 arfr_type, - u8 retry_limit_type, - u8 ampdu_time_type -) +static void halbtc8723b1ant_LimitedTx(struct btc_coexist *bt_coexist, bool force_exec, + u8 ra_mask_type, u8 arfr_type, + u8 retry_limit_type, u8 ampdu_time_type) { switch (ra_mask_type) { case 0: /* normal mode */ @@ -209,13 +179,11 @@ static void halbtc8723b1ant_LimitedTx( halbtc8723b1ant_AmpduMaxTime(bt_coexist, force_exec, ampdu_time_type); } -static void halbtc8723b1ant_LimitedRx( - struct btc_coexist *bt_coexist, - bool force_exec, - bool rej_ap_agg_pkt, - bool bt_ctrl_agg_buf_size, - u8 agg_buf_size -) +static void halbtc8723b1ant_LimitedRx(struct btc_coexist *bt_coexist, + bool force_exec, + bool rej_ap_agg_pkt, + bool bt_ctrl_agg_buf_size, + u8 agg_buf_size) { bool bRejectRxAgg = rej_ap_agg_pkt; bool bBtCtrlRxAggSize = bt_ctrl_agg_buf_size; @@ -224,13 +192,9 @@ static void halbtc8723b1ant_LimitedRx( /* */ /* Rx Aggregation related setting */ /* */ - bt_coexist->fBtcSet( - bt_coexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg - ); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_TO_REJ_AP_AGG_PKT, &bRejectRxAgg); /* decide BT control aggregation buf size or not */ - bt_coexist->fBtcSet( - bt_coexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize - ); + bt_coexist->fBtcSet(bt_coexist, BTC_SET_BL_BT_CTRL_AGG_SIZE, &bBtCtrlRxAggSize); /* aggregation buf size, only work when BT control Rx aggregation size. */ bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_AGG_BUF_SIZE, &rxAggSize); /* real update aggregation setting */ @@ -307,9 +271,7 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *bt_coexist) bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); bt_coexist->fBtcGet(bt_coexist, BTC_GET_S4_WIFI_RSSI, &wifi_rssi); - bt_coexist->fBtcGet( - bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode - ); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_UNDER_B_MODE, &wifi_under_b_mode); if (pCoexSta->bUnderIps) { pCoexSta->nCRCOK_CCK = 0; @@ -339,17 +301,13 @@ static void halbtc8723b1ant_MonitorWiFiCtr(struct btc_coexist *bt_coexist) bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0xf16, 0x1, 0x0); if (wifi_busy && (wifi_rssi >= 30) && !wifi_under_b_mode) { - if ( - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) + if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) ) { - if ( - pCoexSta->nCRCOK_CCK > ( - pCoexSta->nCRCOK_11g + - pCoexSta->nCRCOK_11n + - pCoexSta->nCRCOK_11nAgg - ) + if (pCoexSta->nCRCOK_CCK > (pCoexSta->nCRCOK_11g + + pCoexSta->nCRCOK_11n + + pCoexSta->nCRCOK_11nAgg) ) { if (nCCKLockCounter < 5) nCCKLockCounter++; @@ -391,14 +349,10 @@ static bool halbtc8723b1ant_IsWifiStatusChanged(struct btc_coexist *bt_coexist) bool wifi_busy = false, bUnder4way = false, bBtHsOn = false; bool bWifiConnected = false; - bt_coexist->fBtcGet( - bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected - ); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_HS_OPERATION, &bBtHsOn); - bt_coexist->fBtcGet( - bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way - ); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_4_WAY_PROGRESS, &bUnder4way); if (bWifiConnected) { if (wifi_busy != bPreWifiBusy) { @@ -440,44 +394,40 @@ static void halbtc8723b1ant_UpdateBtLinkInfo(struct btc_coexist *bt_coexist) } /* check if Sco only */ - if ( - pBtLinkInfo->bScoExist && - !pBtLinkInfo->bA2dpExist && - !pBtLinkInfo->bPanExist && - !pBtLinkInfo->bHidExist + if (pBtLinkInfo->bScoExist && + !pBtLinkInfo->bA2dpExist && + !pBtLinkInfo->bPanExist && + !pBtLinkInfo->bHidExist ) pBtLinkInfo->bScoOnly = true; else pBtLinkInfo->bScoOnly = false; /* check if A2dp only */ - if ( - !pBtLinkInfo->bScoExist && - pBtLinkInfo->bA2dpExist && - !pBtLinkInfo->bPanExist && - !pBtLinkInfo->bHidExist + if (!pBtLinkInfo->bScoExist && + pBtLinkInfo->bA2dpExist && + !pBtLinkInfo->bPanExist && + !pBtLinkInfo->bHidExist ) pBtLinkInfo->bA2dpOnly = true; else pBtLinkInfo->bA2dpOnly = false; /* check if Pan only */ - if ( - !pBtLinkInfo->bScoExist && - !pBtLinkInfo->bA2dpExist && - pBtLinkInfo->bPanExist && - !pBtLinkInfo->bHidExist + if (!pBtLinkInfo->bScoExist && + !pBtLinkInfo->bA2dpExist && + pBtLinkInfo->bPanExist && + !pBtLinkInfo->bHidExist ) pBtLinkInfo->bPanOnly = true; else pBtLinkInfo->bPanOnly = false; /* check if Hid only */ - if ( - !pBtLinkInfo->bScoExist && - !pBtLinkInfo->bA2dpExist && - !pBtLinkInfo->bPanExist && - pBtLinkInfo->bHidExist + if (!pBtLinkInfo->bScoExist && + !pBtLinkInfo->bA2dpExist && + !pBtLinkInfo->bPanExist && + pBtLinkInfo->bHidExist ) pBtLinkInfo->bHidOnly = true; else @@ -551,9 +501,7 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist) if (pBtLinkInfo->bScoExist) { if (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist) { algorithm = BT_8723B_1ANT_COEX_ALGO_HID; - } else if ( - pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist - ) { + } else if (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) { if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; else @@ -565,10 +513,9 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist) algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; } } else { - if ( - pBtLinkInfo->bHidExist && - pBtLinkInfo->bPanExist && - pBtLinkInfo->bA2dpExist + if (pBtLinkInfo->bHidExist && + pBtLinkInfo->bPanExist && + pBtLinkInfo->bA2dpExist ) { if (bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_HID_A2DP; @@ -578,10 +525,9 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist) } } else if (numOfDiffProfile >= 3) { if (pBtLinkInfo->bScoExist) { - if ( - pBtLinkInfo->bHidExist && - pBtLinkInfo->bPanExist && - pBtLinkInfo->bA2dpExist + if (pBtLinkInfo->bHidExist && + pBtLinkInfo->bPanExist && + pBtLinkInfo->bA2dpExist ) { if (!bBtHsOn) algorithm = BT_8723B_1ANT_COEX_ALGO_PANEDR_HID; @@ -593,9 +539,8 @@ static u8 halbtc8723b1ant_ActionAlgorithm(struct btc_coexist *bt_coexist) return algorithm; } -static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( - struct btc_coexist *bt_coexist, bool bLowPenaltyRa -) +static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(struct btc_coexist *bt_coexist, + bool bLowPenaltyRa) { u8 H2C_Parameter[6] = {0}; @@ -612,9 +557,8 @@ static void halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( bt_coexist->fBtcFillH2c(bt_coexist, 0x69, 6, H2C_Parameter); } -static void halbtc8723b1ant_LowPenaltyRa( - struct btc_coexist *bt_coexist, bool force_exec, bool bLowPenaltyRa -) +static void halbtc8723b1ant_LowPenaltyRa(struct btc_coexist *bt_coexist, + bool force_exec, bool bLowPenaltyRa) { pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa; @@ -622,19 +566,17 @@ static void halbtc8723b1ant_LowPenaltyRa( if (pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa) return; } - halbtc8723b1ant_SetSwPenaltyTxRateAdaptive( - bt_coexist, pCoexDm->bCurLowPenaltyRa - ); + halbtc8723b1ant_SetSwPenaltyTxRateAdaptive(bt_coexist, + pCoexDm->bCurLowPenaltyRa); pCoexDm->bPreLowPenaltyRa = pCoexDm->bCurLowPenaltyRa; } -static void halbtc8723b1ant_SetCoexTable( - struct btc_coexist *bt_coexist, - u32 val0x6c0, - u32 val0x6c4, - u32 val0x6c8, - u8 val0x6cc +static void halbtc8723b1ant_SetCoexTable(struct btc_coexist *bt_coexist, + u32 val0x6c0, + u32 val0x6c4, + u32 val0x6c8, + u8 val0x6cc ) { bt_coexist->fBtcWrite4Byte(bt_coexist, 0x6c0, val0x6c0); @@ -646,13 +588,12 @@ static void halbtc8723b1ant_SetCoexTable( bt_coexist->fBtcWrite1Byte(bt_coexist, 0x6cc, val0x6cc); } -static void halbtc8723b1ant_CoexTable( - struct btc_coexist *bt_coexist, - bool force_exec, - u32 val0x6c0, - u32 val0x6c4, - u32 val0x6c8, - u8 val0x6cc +static void halbtc8723b1ant_CoexTable(struct btc_coexist *bt_coexist, + bool force_exec, + u32 val0x6c0, + u32 val0x6c4, + u32 val0x6c8, + u8 val0x6cc ) { pCoexDm->curVal0x6c0 = val0x6c0; @@ -661,8 +602,7 @@ static void halbtc8723b1ant_CoexTable( pCoexDm->curVal0x6cc = val0x6cc; if (!force_exec) { - if ( - (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) && + if ((pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) && (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) && (pCoexDm->preVal0x6c8 == pCoexDm->curVal0x6c8) && (pCoexDm->preVal0x6cc == pCoexDm->curVal0x6cc) @@ -670,9 +610,7 @@ static void halbtc8723b1ant_CoexTable( return; } - halbtc8723b1ant_SetCoexTable( - bt_coexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc - ); + halbtc8723b1ant_SetCoexTable(bt_coexist, val0x6c0, val0x6c4, val0x6c8, val0x6cc); pCoexDm->preVal0x6c0 = pCoexDm->curVal0x6c0; pCoexDm->preVal0x6c4 = pCoexDm->curVal0x6c4; @@ -680,61 +618,82 @@ static void halbtc8723b1ant_CoexTable( pCoexDm->preVal0x6cc = pCoexDm->curVal0x6cc; } -static void halbtc8723b1ant_CoexTableWithType( - struct btc_coexist *bt_coexist, bool force_exec, u8 type -) +static void halbtc8723b1ant_CoexTableWithType(struct btc_coexist *bt_coexist, bool force_exec, + u8 type) { pCoexSta->nCoexTableType = type; switch (type) { case 0: - halbtc8723b1ant_CoexTable( - bt_coexist, force_exec, 0x55555555, 0x55555555, 0xffffff, 0x3 - ); + halbtc8723b1ant_CoexTable(bt_coexist, + force_exec, + 0x55555555, + 0x55555555, + 0xffffff, + 0x3); break; case 1: - halbtc8723b1ant_CoexTable( - bt_coexist, force_exec, 0x55555555, 0x5a5a5a5a, 0xffffff, 0x3 - ); + halbtc8723b1ant_CoexTable(bt_coexist, + force_exec, + 0x55555555, + 0x5a5a5a5a, + 0xffffff, + 0x3); break; case 2: - halbtc8723b1ant_CoexTable( - bt_coexist, force_exec, 0x5a5a5a5a, 0x5a5a5a5a, 0xffffff, 0x3 - ); + halbtc8723b1ant_CoexTable(bt_coexist, + force_exec, + 0x5a5a5a5a, + 0x5a5a5a5a, + 0xffffff, + 0x3); break; case 3: - halbtc8723b1ant_CoexTable( - bt_coexist, force_exec, 0xaaaa5555, 0xaaaa5a5a, 0xffffff, 0x3 - ); + halbtc8723b1ant_CoexTable(bt_coexist, + force_exec, + 0xaaaa5555, + 0xaaaa5a5a, + 0xffffff, + 0x3); break; case 4: - halbtc8723b1ant_CoexTable( - bt_coexist, force_exec, 0x55555555, 0xaaaa5a5a, 0xffffff, 0x3 - ); + halbtc8723b1ant_CoexTable(bt_coexist, + force_exec, + 0x55555555, + 0xaaaa5a5a, + 0xffffff, + 0x3); break; case 5: - halbtc8723b1ant_CoexTable( - bt_coexist, force_exec, 0x5a5a5a5a, 0xaaaa5a5a, 0xffffff, 0x3 - ); + halbtc8723b1ant_CoexTable(bt_coexist, + force_exec, + 0x5a5a5a5a, + 0xaaaa5a5a, + 0xffffff, + 0x3); break; case 6: - halbtc8723b1ant_CoexTable( - bt_coexist, force_exec, 0x55555555, 0xaaaaaaaa, 0xffffff, 0x3 - ); + halbtc8723b1ant_CoexTable(bt_coexist, + force_exec, + 0x55555555, + 0xaaaaaaaa, + 0xffffff, + 0x3); break; case 7: - halbtc8723b1ant_CoexTable( - bt_coexist, force_exec, 0xaaaaaaaa, 0xaaaaaaaa, 0xffffff, 0x3 - ); + halbtc8723b1ant_CoexTable(bt_coexist, + force_exec, + 0xaaaaaaaa, + 0xaaaaaaaa, + 0xffffff, + 0x3); break; default: break; } } -static void halbtc8723b1ant_SetFwIgnoreWlanAct( - struct btc_coexist *bt_coexist, bool bEnable -) +static void halbtc8723b1ant_SetFwIgnoreWlanAct(struct btc_coexist *bt_coexist, bool bEnable) { u8 H2C_Parameter[1] = {0}; @@ -744,8 +703,9 @@ static void halbtc8723b1ant_SetFwIgnoreWlanAct( bt_coexist->fBtcFillH2c(bt_coexist, 0x63, 1, H2C_Parameter); } -static void halbtc8723b1ant_IgnoreWlanAct( - struct btc_coexist *bt_coexist, bool force_exec, bool bEnable +static void halbtc8723b1ant_IgnoreWlanAct(struct btc_coexist *bt_coexist, + bool force_exec, + bool bEnable ) { pCoexDm->bCurIgnoreWlanAct = bEnable; @@ -759,9 +719,7 @@ static void halbtc8723b1ant_IgnoreWlanAct( pCoexDm->bPreIgnoreWlanAct = pCoexDm->bCurIgnoreWlanAct; } -static void halbtc8723b1ant_SetLpsRpwm( - struct btc_coexist *bt_coexist, u8 lpsVal, u8 rpwmVal -) +static void halbtc8723b1ant_SetLpsRpwm(struct btc_coexist *bt_coexist, u8 lpsVal, u8 rpwmVal) { u8 lps = lpsVal; u8 rpwm = rpwmVal; @@ -770,17 +728,18 @@ static void halbtc8723b1ant_SetLpsRpwm( bt_coexist->fBtcSet(bt_coexist, BTC_SET_U1_RPWM_VAL, &rpwm); } -static void halbtc8723b1ant_LpsRpwm( - struct btc_coexist *bt_coexist, bool force_exec, u8 lpsVal, u8 rpwmVal +static void halbtc8723b1ant_LpsRpwm(struct btc_coexist *bt_coexist, + bool force_exec, + u8 lpsVal, + u8 rpwmVal ) { pCoexDm->curLps = lpsVal; pCoexDm->curRpwm = rpwmVal; if (!force_exec) { - if ( - (pCoexDm->preLps == pCoexDm->curLps) && - (pCoexDm->preRpwm == pCoexDm->curRpwm) + if ((pCoexDm->preLps == pCoexDm->curLps) && + (pCoexDm->preRpwm == pCoexDm->curRpwm) ) { return; } @@ -791,15 +750,17 @@ static void halbtc8723b1ant_LpsRpwm( pCoexDm->preRpwm = pCoexDm->curRpwm; } -static void halbtc8723b1ant_SwMechanism( - struct btc_coexist *bt_coexist, bool bLowPenaltyRA +static void halbtc8723b1ant_SwMechanism(struct btc_coexist *bt_coexist, + bool bLowPenaltyRA ) { halbtc8723b1ant_LowPenaltyRa(bt_coexist, NORMAL_EXEC, bLowPenaltyRA); } -static void halbtc8723b1ant_SetAntPath( - struct btc_coexist *bt_coexist, u8 antPosType, bool bInitHwCfg, bool bWifiOff +static void halbtc8723b1ant_SetAntPath(struct btc_coexist *bt_coexist, + u8 antPosType, + bool bInitHwCfg, + bool bWifiOff ) { struct btc_board_info *pBoardInfo = &bt_coexist->boardInfo; @@ -984,8 +945,9 @@ static void halbtc8723b1ant_SetAntPath( } } -static void halbtc8723b1ant_SetFwPstdma( - struct btc_coexist *bt_coexist, u8 byte1, u8 byte2, u8 byte3, u8 byte4, u8 byte5 +static void halbtc8723b1ant_SetFwPstdma(struct btc_coexist *bt_coexist, + u8 byte1, u8 byte2, u8 byte3, + u8 byte4, u8 byte5 ) { u8 H2C_Parameter[5] = {0}; @@ -1020,8 +982,9 @@ static void halbtc8723b1ant_SetFwPstdma( } -static void halbtc8723b1ant_PsTdma( - struct btc_coexist *bt_coexist, bool force_exec, bool bTurnOn, u8 type +static void halbtc8723b1ant_PsTdma(struct btc_coexist *bt_coexist, + bool force_exec, + bool bTurnOn, u8 type ) { struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; @@ -1037,9 +1000,8 @@ static void halbtc8723b1ant_PsTdma( bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); if (!force_exec) { - if ( - (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && - (pCoexDm->prePsTdma == pCoexDm->curPsTdma) + if ((pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) && + (pCoexDm->prePsTdma == pCoexDm->curPsTdma) ) return; } @@ -1065,202 +1027,180 @@ static void halbtc8723b1ant_PsTdma( switch (type) { default: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x51, 0x1a, 0x1a, 0x0, psTdmaByte4Val + halbtc8723b1ant_SetFwPstdma(bt_coexist, + 0x51, + 0x1a, + 0x1a, + 0x0, + psTdmaByte4Val ); break; case 1: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, - psTdmaByte0Val, - 0x3a + nWiFiDurationAdjust, - 0x03, - psTdmaByte3Val, - psTdmaByte4Val + halbtc8723b1ant_SetFwPstdma(bt_coexist, + psTdmaByte0Val, + 0x3a + nWiFiDurationAdjust, + 0x03, + psTdmaByte3Val, + psTdmaByte4Val ); break; case 2: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, - psTdmaByte0Val, - 0x2d + nWiFiDurationAdjust, - 0x03, - psTdmaByte3Val, - psTdmaByte4Val + halbtc8723b1ant_SetFwPstdma(bt_coexist, + psTdmaByte0Val, + 0x2d + nWiFiDurationAdjust, + 0x03, + psTdmaByte3Val, + psTdmaByte4Val ); break; case 3: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x51, 0x1d, 0x1d, 0x0, 0x10 + halbtc8723b1ant_SetFwPstdma(bt_coexist, + 0x51, + 0x1d, + 0x1d, + 0x0, + 0x10 ); break; case 4: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x93, 0x15, 0x3, 0x14, 0x0 + halbtc8723b1ant_SetFwPstdma(bt_coexist, + 0x93, + 0x15, + 0x3, + 0x14, + 0x0 ); break; case 5: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x61, 0x15, 0x3, 0x11, 0x10 + halbtc8723b1ant_SetFwPstdma(bt_coexist, + 0x61, + 0x15, + 0x3, + 0x11, + 0x10 ); break; case 6: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x61, 0x20, 0x3, 0x11, 0x11 + halbtc8723b1ant_SetFwPstdma(bt_coexist, + 0x61, + 0x20, + 0x3, + 0x11, + 0x11 ); break; case 7: - halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xc, 0x5, 0x0, 0x0); + halbtc8723b1ant_SetFwPstdma(bt_coexist, + 0x13, + 0xc, + 0x5, + 0x0, + 0x0 + ); break; case 8: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0 + halbtc8723b1ant_SetFwPstdma(bt_coexist, + 0x93, + 0x25, + 0x3, + 0x10, + 0x0 ); break; case 9: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, - psTdmaByte0Val, - 0x21, - 0x3, - psTdmaByte3Val, - psTdmaByte4Val + halbtc8723b1ant_SetFwPstdma(bt_coexist, + psTdmaByte0Val, + 0x21, + 0x3, + psTdmaByte3Val, + psTdmaByte4Val ); break; case 10: halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xa, 0xa, 0x0, 0x40); break; case 11: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, - psTdmaByte0Val, - 0x21, - 0x03, - psTdmaByte3Val, - psTdmaByte4Val + halbtc8723b1ant_SetFwPstdma(bt_coexist, + psTdmaByte0Val, + 0x21, + 0x03, + psTdmaByte3Val, + psTdmaByte4Val ); break; case 12: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x51, 0x0a, 0x0a, 0x0, 0x50 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x51, 0x0a, 0x0a, 0x0, 0x50); break; case 13: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x51, 0x12, 0x12, 0x0, 0x10 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x51, 0x12, 0x12, 0x0, 0x10); break; case 14: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x51, 0x21, 0x3, 0x10, psTdmaByte4Val - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x51, 0x21, 0x3, 0x10, + psTdmaByte4Val); break; case 15: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x13, 0xa, 0x3, 0x8, 0x0 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x13, 0xa, 0x3, 0x8, 0x0); break; case 16: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x93, 0x15, 0x3, 0x10, 0x0 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x93, 0x15, 0x3, 0x10, 0x0); break; case 18: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x93, 0x25, 0x3, 0x10, 0x0); break; case 20: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x61, 0x3f, 0x03, 0x11, 0x10 - - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x61, 0x3f, 0x03, 0x11, 0x10); break; case 21: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x11 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x11); break; case 22: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x10 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x61, 0x25, 0x03, 0x11, 0x10); break; case 23: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x18 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x18); break; case 24: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xe3, 0x15, 0x3, 0x31, 0x18 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0x15, 0x3, 0x31, 0x18); break; case 25: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18); break; case 26: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0xa, 0x3, 0x31, 0x18); break; case 27: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x98 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xe3, 0x25, 0x3, 0x31, 0x98); break; case 28: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x69, 0x25, 0x3, 0x31, 0x0 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x69, 0x25, 0x3, 0x31, 0x0); break; case 29: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xab, 0x1a, 0x1a, 0x1, 0x10 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xab, 0x1a, 0x1a, 0x1, 0x10); break; case 30: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x51, 0x30, 0x3, 0x10, 0x10 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x51, 0x30, 0x3, 0x10, 0x10); break; case 31: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xd3, 0x1a, 0x1a, 0x0, 0x58); break; case 32: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x61, 0x35, 0x3, 0x11, 0x11 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x61, 0x35, 0x3, 0x11, 0x11); break; case 33: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xa3, 0x25, 0x3, 0x30, 0x90 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xa3, 0x25, 0x3, 0x30, 0x90); break; case 34: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x53, 0x1a, 0x1a, 0x0, 0x10 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x53, 0x1a, 0x1a, 0x0, 0x10); break; case 35: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x63, 0x1a, 0x1a, 0x0, 0x10 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x63, 0x1a, 0x1a, 0x0, 0x10); break; case 36: - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0xd3, 0x12, 0x3, 0x14, 0x50 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0xd3, 0x12, 0x3, 0x14, 0x50); break; case 40: /* SoftAP only with no sta associated, BT disable , TDMA mode for power saving */ /* here softap mode screen off will cost 70-80mA for phone */ - halbtc8723b1ant_SetFwPstdma( - bt_coexist, 0x23, 0x18, 0x00, 0x10, 0x24 - ); + halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x23, 0x18, 0x00, 0x10, 0x24); break; } } else { @@ -1269,29 +1209,24 @@ static void halbtc8723b1ant_PsTdma( switch (type) { case 8: /* PTA Control */ halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x8, 0x0, 0x0, 0x0, 0x0); - halbtc8723b1ant_SetAntPath( - bt_coexist, BTC_ANT_PATH_PTA, false, false - ); + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_PTA, false, false); break; case 0: default: /* Software control, Antenna at BT side */ halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0); - halbtc8723b1ant_SetAntPath( - bt_coexist, BTC_ANT_PATH_BT, false, false - ); + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_BT, false, false); break; case 9: /* Software control, Antenna at WiFi side */ halbtc8723b1ant_SetFwPstdma(bt_coexist, 0x0, 0x0, 0x0, 0x0, 0x0); - halbtc8723b1ant_SetAntPath( - bt_coexist, BTC_ANT_PATH_WIFI, false, false - ); + halbtc8723b1ant_SetAntPath(bt_coexist, BTC_ANT_PATH_WIFI, false, false); break; } } rssiAdjustVal = 0; - bt_coexist->fBtcSet( - bt_coexist, BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, &rssiAdjustVal + bt_coexist->fBtcSet(bt_coexist, + BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE, + &rssiAdjustVal ); /* update pre state */ @@ -1306,37 +1241,32 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *bt_coexist) bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected); bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); - if ( - !bWifiConnected && - pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE + if (!bWifiConnected && + pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE ) { /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; - } else if ( - bWifiConnected && - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE) + } else if (bWifiConnected && + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE) ) { /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; - } else if ( - !bWifiConnected && - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) + } else if (!bWifiConnected && + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; - } else if ( - bWifiConnected && - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) + } else if (bWifiConnected && + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ bCommon = true; - } else if ( - !bWifiConnected && - (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) + } else if (!bWifiConnected && + (pCoexDm->btStatus != BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE) ) { /* halbtc8723b1ant_SwMechanism(bt_coexist, false); */ @@ -1349,24 +1279,20 @@ static bool halbtc8723b1ant_IsCommonAction(struct btc_coexist *bt_coexist) } -static void halbtc8723b1ant_TdmaDurationAdjustForAcl( - struct btc_coexist *bt_coexist, u8 wifiStatus -) +static void halbtc8723b1ant_TdmaDurationAdjustForAcl(struct btc_coexist *bt_coexist, u8 wifiStatus) { static s32 up, dn, m, n, WaitCount; s32 result; /* 0: no change, +1: increase WiFi duration, -1: decrease WiFi duration */ u8 retryCount = 0, btInfoExt; - if ( - (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN) || - (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN) || - (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT) + if ((wifiStatus == BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN) || + (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN) || + (wifiStatus == BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT) ) { - if ( - pCoexDm->curPsTdma != 1 && - pCoexDm->curPsTdma != 2 && - pCoexDm->curPsTdma != 3 && - pCoexDm->curPsTdma != 9 + if (pCoexDm->curPsTdma != 1 && + pCoexDm->curPsTdma != 2 && + pCoexDm->curPsTdma != 3 && + pCoexDm->curPsTdma != 9 ) { halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); pCoexDm->psTdmaDuAdjType = 9; @@ -1457,9 +1383,8 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( } if (result == -1) { - if ( - BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) && - ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2)) + if (BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) && + ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2)) ) { halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); pCoexDm->psTdmaDuAdjType = 9; @@ -1474,9 +1399,8 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( pCoexDm->psTdmaDuAdjType = 11; } } else if (result == 1) { - if ( - BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) && - ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2)) + if (BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(btInfoExt) && + ((pCoexDm->curPsTdma == 1) || (pCoexDm->curPsTdma == 2)) ) { halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 9); pCoexDm->psTdmaDuAdjType = 9; @@ -1492,20 +1416,21 @@ static void halbtc8723b1ant_TdmaDurationAdjustForAcl( } } - if ( - pCoexDm->curPsTdma != 1 && - pCoexDm->curPsTdma != 2 && - pCoexDm->curPsTdma != 9 && - pCoexDm->curPsTdma != 11 + if (pCoexDm->curPsTdma != 1 && + pCoexDm->curPsTdma != 2 && + pCoexDm->curPsTdma != 9 && + pCoexDm->curPsTdma != 11 ) /* recover to previous adjust type */ - halbtc8723b1ant_PsTdma( - bt_coexist, NORMAL_EXEC, true, pCoexDm->psTdmaDuAdjType + halbtc8723b1ant_PsTdma(bt_coexist, + NORMAL_EXEC, + true, + pCoexDm->psTdmaDuAdjType ); } } -static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState( - struct btc_coexist *bt_coexist, bool bNewPsState +static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState(struct btc_coexist *bt_coexist, + bool bNewPsState ) { u8 lpsMode = 0x0; @@ -1526,8 +1451,10 @@ static void halbtc8723b1ant_PsTdmaCheckForPowerSaveState( } } -static void halbtc8723b1ant_PowerSaveState( - struct btc_coexist *bt_coexist, u8 psType, u8 lpsVal, u8 rpwmVal +static void halbtc8723b1ant_PowerSaveState(struct btc_coexist *bt_coexist, + u8 psType, + u8 lpsVal, + u8 rpwmVal ) { bool bLowPwrDisable = false; @@ -1536,8 +1463,9 @@ static void halbtc8723b1ant_PowerSaveState( case BTC_PS_WIFI_NATIVE: /* recover to original 32k low power setting */ bLowPwrDisable = false; - bt_coexist->fBtcSet( - bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable + bt_coexist->fBtcSet(bt_coexist, + BTC_SET_ACT_DISABLE_LOW_POWER, + &bLowPwrDisable ); bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_NORMAL_LPS, NULL); pCoexSta->bForceLpsOn = false; @@ -1547,8 +1475,9 @@ static void halbtc8723b1ant_PowerSaveState( halbtc8723b1ant_LpsRpwm(bt_coexist, NORMAL_EXEC, lpsVal, rpwmVal); /* when coex force to enter LPS, do not enter 32k low power. */ bLowPwrDisable = true; - bt_coexist->fBtcSet( - bt_coexist, BTC_SET_ACT_DISABLE_LOW_POWER, &bLowPwrDisable + bt_coexist->fBtcSet(bt_coexist, + BTC_SET_ACT_DISABLE_LOW_POWER, + &bLowPwrDisable ); /* power save must executed before psTdma. */ bt_coexist->fBtcSet(bt_coexist, BTC_SET_ACT_ENTER_LPS, NULL); @@ -1607,10 +1536,9 @@ static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *bt_coexist) halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, false, 8); halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0); - } else if ( - pBtLinkInfo->bScoExist || - pBtLinkInfo->bHidExist || - pBtLinkInfo->bA2dpExist + } else if (pBtLinkInfo->bScoExist || + pBtLinkInfo->bHidExist || + pBtLinkInfo->bA2dpExist ) { /* SCO/HID/A2DP busy */ halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); @@ -1630,8 +1558,8 @@ static void halbtc8723b1ant_ActionBtInquiry(struct btc_coexist *bt_coexist) } } -static void halbtc8723b1ant_ActionBtScoHidOnlyBusy( - struct btc_coexist *bt_coexist, u8 wifiStatus +static void halbtc8723b1ant_ActionBtScoHidOnlyBusy(struct btc_coexist *bt_coexist, + u8 wifiStatus ) { struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; @@ -1650,8 +1578,8 @@ static void halbtc8723b1ant_ActionBtScoHidOnlyBusy( } } -static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy( - struct btc_coexist *bt_coexist, u8 wifiStatus +static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy(struct btc_coexist *bt_coexist, + u8 wifiStatus ) { struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; @@ -1682,16 +1610,14 @@ static void halbtc8723b1ant_ActionWifiConnectedBtAclBusy( pCoexDm->bAutoTdmaAdjust = false; halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); - } else if ( - pBtLinkInfo->bPanOnly || - (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) + } else if (pBtLinkInfo->bPanOnly || + (pBtLinkInfo->bHidExist && pBtLinkInfo->bPanExist) ) { /* PAN(OPP, FTP), HID+PAN(OPP, FTP) */ halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 3); halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); pCoexDm->bAutoTdmaAdjust = false; - } else if ( - (pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) || - (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) + } else if ((pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) || + (pBtLinkInfo->bHidExist && pBtLinkInfo->bA2dpExist && pBtLinkInfo->bPanExist) ) { /* A2DP+PAN(OPP, FTP), HID+A2DP+PAN(OPP, FTP) */ halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 13); halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); @@ -1714,9 +1640,7 @@ static void halbtc8723b1ant_ActionWifiNotConnected(struct btc_coexist *bt_coexis halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 0); } -static void halbtc8723b1ant_ActionWifiNotConnectedScan( - struct btc_coexist *bt_coexist -) +static void halbtc8723b1ant_ActionWifiNotConnectedScan(struct btc_coexist *bt_coexist) { struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; @@ -1734,12 +1658,11 @@ static void halbtc8723b1ant_ActionWifiNotConnectedScan( halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } - } else if ( - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) + } else if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { - halbtc8723b1ant_ActionBtScoHidOnlyBusy( - bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN + halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, + BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN ); } else { /* Bryant Add */ @@ -1748,19 +1671,16 @@ static void halbtc8723b1ant_ActionWifiNotConnectedScan( } } -static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth( - struct btc_coexist *bt_coexist -) +static void halbtc8723b1ant_ActionWifiNotConnectedAssoAuth(struct btc_coexist *bt_coexist) { struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ - if ( - (pBtLinkInfo->bScoExist) || - (pBtLinkInfo->bHidExist) || - (pBtLinkInfo->bA2dpExist) + if ((pBtLinkInfo->bScoExist) || + (pBtLinkInfo->bHidExist) || + (pBtLinkInfo->bA2dpExist) ) { halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); @@ -1791,12 +1711,11 @@ static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *bt_coexi halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 20); halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); } - } else if ( - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) + } else if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { - halbtc8723b1ant_ActionBtScoHidOnlyBusy( - bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN + halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, + BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN ); } else { /* Bryant Add */ @@ -1805,19 +1724,16 @@ static void halbtc8723b1ant_ActionWifiConnectedScan(struct btc_coexist *bt_coexi } } -static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket( - struct btc_coexist *bt_coexist -) +static void halbtc8723b1ant_ActionWifiConnectedSpecialPacket(struct btc_coexist *bt_coexist) { struct btc_bt_link_info *pBtLinkInfo = &bt_coexist->btLinkInfo; halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); /* tdma and coex table */ - if ( - (pBtLinkInfo->bScoExist) || - (pBtLinkInfo->bHidExist) || - (pBtLinkInfo->bA2dpExist) + if ((pBtLinkInfo->bScoExist) || + (pBtLinkInfo->bHidExist) || + (pBtLinkInfo->bA2dpExist) ) { halbtc8723b1ant_PsTdma(bt_coexist, NORMAL_EXEC, true, 32); halbtc8723b1ant_CoexTableWithType(bt_coexist, NORMAL_EXEC, 4); @@ -1857,30 +1773,34 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist) bt_coexist->fBtcGet(bt_coexist, BTC_GET_BL_WIFI_BUSY, &wifi_busy); /* power save state */ - if ( - !bApEnable && - pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY && - !bt_coexist->btLinkInfo.bHidOnly + if (!bApEnable && + pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY && + !bt_coexist->btLinkInfo.bHidOnly ) { if (bt_coexist->btLinkInfo.bA2dpOnly) { /* A2DP */ if (!wifi_busy) - halbtc8723b1ant_PowerSaveState( - bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 + halbtc8723b1ant_PowerSaveState(bt_coexist, + BTC_PS_WIFI_NATIVE, + 0x0, + 0x0 ); else { /* busy */ if (pCoexSta->nScanAPNum >= BT_8723B_1ANT_WIFI_NOISY_THRESH) /* no force LPS, no PS-TDMA, use pure TDMA */ - halbtc8723b1ant_PowerSaveState( - bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0 + halbtc8723b1ant_PowerSaveState(bt_coexist, + BTC_PS_WIFI_NATIVE, + 0x0, + 0x0 ); else - halbtc8723b1ant_PowerSaveState( - bt_coexist, BTC_PS_LPS_ON, 0x50, 0x4 + halbtc8723b1ant_PowerSaveState(bt_coexist, + BTC_PS_LPS_ON, + 0x50, + 0x4 ); } - } else if ( - (!pCoexSta->bPanExist) && - (!pCoexSta->bA2dpExist) && - (!pCoexSta->bHidExist) + } else if ((!pCoexSta->bPanExist) && + (!pCoexSta->bA2dpExist) && + (!pCoexSta->bHidExist) ) halbtc8723b1ant_PowerSaveState(bt_coexist, BTC_PS_WIFI_NATIVE, 0x0, 0x0); else @@ -1891,13 +1811,11 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist) /* tdma and coex table */ if (!wifi_busy) { if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { - halbtc8723b1ant_ActionWifiConnectedBtAclBusy( - bt_coexist, + halbtc8723b1ant_ActionWifiConnectedBtAclBusy(bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE ); - } else if ( - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) + } else if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE); @@ -1911,16 +1829,13 @@ static void halbtc8723b1ant_ActionWifiConnected(struct btc_coexist *bt_coexist) } } else { if (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) { - halbtc8723b1ant_ActionWifiConnectedBtAclBusy( - bt_coexist, + halbtc8723b1ant_ActionWifiConnectedBtAclBusy(bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY ); - } else if ( - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) + } else if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) { - halbtc8723b1ant_ActionBtScoHidOnlyBusy( - bt_coexist, + halbtc8723b1ant_ActionBtScoHidOnlyBusy(bt_coexist, BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY ); } else { @@ -2001,29 +1916,25 @@ static void halbtc8723b1ant_RunCoexistMechanism(struct btc_coexist *bt_coexist) if (pCoexSta->bUnderIps) return; - if ( - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) + if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ){ bIncreaseScanDevNum = true; } - bt_coexist->fBtcSet( - bt_coexist, - BTC_SET_BL_INC_SCAN_DEV_NUM, - &bIncreaseScanDevNum + bt_coexist->fBtcSet(bt_coexist, + BTC_SET_BL_INC_SCAN_DEV_NUM, + &bIncreaseScanDevNum ); - bt_coexist->fBtcGet( - bt_coexist, - BTC_GET_BL_WIFI_CONNECTED, - &bWifiConnected + bt_coexist->fBtcGet(bt_coexist, + BTC_GET_BL_WIFI_CONNECTED, + &bWifiConnected ); - bt_coexist->fBtcGet( - bt_coexist, - BTC_GET_U4_WIFI_LINK_STATUS, - &wifiLinkStatus + bt_coexist->fBtcGet(bt_coexist, + BTC_GET_U4_WIFI_LINK_STATUS, + &wifiLinkStatus ); numOfWifiLink = wifiLinkStatus >> 16; @@ -2099,10 +2010,9 @@ static void halbtc8723b1ant_InitCoexDm(struct btc_coexist *bt_coexist) pCoexSta->popEventCnt = 0; } -static void halbtc8723b1ant_InitHwConfig( - struct btc_coexist *bt_coexist, - bool bBackUp, - bool bWifiOnly +static void halbtc8723b1ant_InitHwConfig(struct btc_coexist *bt_coexist, + bool bBackUp, + bool bWifiOnly ) { bt_coexist->fBtcWrite1ByteBitMask(bt_coexist, 0x550, 0x8, 0x1); /* enable TBTT nterrupt */ @@ -2253,9 +2163,7 @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *bt_coexist, u8 type) } else { pCoexSta->bWiFiIsHighPriTask = false; - bt_coexist->fBtcGet( - bt_coexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum - ); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U1_AP_NUM, &pCoexSta->nScanAPNum); } if (bt_coexist->btInfo.bBtDisabled) @@ -2271,8 +2179,7 @@ void EXhalbtc8723b1ant_ScanNotify(struct btc_coexist *bt_coexist, u8 type) if (numOfWifiLink >= 2) { halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); - halbtc8723b1ant_LimitedRx( - bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size + halbtc8723b1ant_LimitedRx(bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size ); halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); return; @@ -2307,10 +2214,9 @@ void EXhalbtc8723b1ant_ConnectNotify(struct btc_coexist *bt_coexist, u8 type) bool bt_ctrl_agg_buf_size = false; u8 agg_buf_size = 5; - if ( - bt_coexist->bManualControl || - bt_coexist->bStopCoexDm || - bt_coexist->btInfo.bBtDisabled + if (bt_coexist->bManualControl || + bt_coexist->bStopCoexDm || + bt_coexist->btInfo.bBtDisabled ) return; @@ -2358,10 +2264,9 @@ void EXhalbtc8723b1ant_MediaStatusNotify(struct btc_coexist *bt_coexist, u8 type u8 wifiCentralChnl; bool wifi_under_b_mode = false; - if ( - bt_coexist->bManualControl || - bt_coexist->bStopCoexDm || - bt_coexist->btInfo.bBtDisabled + if (bt_coexist->bManualControl || + bt_coexist->bStopCoexDm || + bt_coexist->btInfo.bBtDisabled ) return; @@ -2417,17 +2322,15 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 ty bool bt_ctrl_agg_buf_size = false; u8 agg_buf_size = 5; - if ( - bt_coexist->bManualControl || - bt_coexist->bStopCoexDm || - bt_coexist->btInfo.bBtDisabled + if (bt_coexist->bManualControl || + bt_coexist->bStopCoexDm || + bt_coexist->btInfo.bBtDisabled ) return; - if ( - type == BTC_PACKET_DHCP || - type == BTC_PACKET_EAPOL || - type == BTC_PACKET_ARP + if (type == BTC_PACKET_DHCP || + type == BTC_PACKET_EAPOL || + type == BTC_PACKET_ARP ) { if (type == BTC_PACKET_ARP) { pCoexDm->nArpCnt++; @@ -2445,15 +2348,16 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 ty pCoexSta->specialPktPeriodCnt = 0; - bt_coexist->fBtcGet( - bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus - ); + bt_coexist->fBtcGet(bt_coexist, BTC_GET_U4_WIFI_LINK_STATUS, &wifiLinkStatus); numOfWifiLink = wifiLinkStatus >> 16; if (numOfWifiLink >= 2) { halbtc8723b1ant_LimitedTx(bt_coexist, NORMAL_EXEC, 0, 0, 0, 0); - halbtc8723b1ant_LimitedRx( - bt_coexist, NORMAL_EXEC, false, bt_ctrl_agg_buf_size, agg_buf_size + halbtc8723b1ant_LimitedRx(bt_coexist, + NORMAL_EXEC, + false, + bt_ctrl_agg_buf_size, + agg_buf_size ); halbtc8723b1ant_ActionWifiMultiPort(bt_coexist); return; @@ -2468,17 +2372,14 @@ void EXhalbtc8723b1ant_SpecialPacketNotify(struct btc_coexist *bt_coexist, u8 ty return; } - if ( - type == BTC_PACKET_DHCP || - type == BTC_PACKET_EAPOL || - ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask)) + if (type == BTC_PACKET_DHCP || + type == BTC_PACKET_EAPOL || + ((type == BTC_PACKET_ARP) && (pCoexSta->bWiFiIsHighPriTask)) ) halbtc8723b1ant_ActionWifiConnectedSpecialPacket(bt_coexist); } -void EXhalbtc8723b1ant_BtInfoNotify( - struct btc_coexist *bt_coexist, u8 *tmpBuf, u8 length -) +void EXhalbtc8723b1ant_BtInfoNotify(struct btc_coexist *bt_coexist, u8 *tmpBuf, u8 length) { u8 btInfo = 0; u8 i, rspSource = 0; @@ -2585,9 +2486,8 @@ void EXhalbtc8723b1ant_BtInfoNotify( } else if (btInfo == BT_INFO_8723B_1ANT_B_CONNECTION) { /* connection exists but no busy */ pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE; - } else if ( - (btInfo & BT_INFO_8723B_1ANT_B_SCO_ESCO) || - (btInfo & BT_INFO_8723B_1ANT_B_SCO_BUSY) + } else if ((btInfo & BT_INFO_8723B_1ANT_B_SCO_ESCO) || + (btInfo & BT_INFO_8723B_1ANT_B_SCO_BUSY) ) { pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_SCO_BUSY; } else if (btInfo & BT_INFO_8723B_1ANT_B_ACL_BUSY) { @@ -2599,10 +2499,9 @@ void EXhalbtc8723b1ant_BtInfoNotify( pCoexDm->btStatus = BT_8723B_1ANT_BT_STATUS_MAX; } - if ( - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || - (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) + if ((pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_SCO_BUSY) || + (pCoexDm->btStatus == BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY) ) bBtBusy = true; else @@ -2656,9 +2555,8 @@ void EXhalbtc8723b1ant_Periodical(struct btc_coexist *bt_coexist) halbtc8723b1ant_MonitorBtCtr(bt_coexist); halbtc8723b1ant_MonitorWiFiCtr(bt_coexist); - if ( - halbtc8723b1ant_IsWifiStatusChanged(bt_coexist) || - pCoexDm->bAutoTdmaAdjust + if (halbtc8723b1ant_IsWifiStatusChanged(bt_coexist) || + pCoexDm->bAutoTdmaAdjust ) halbtc8723b1ant_RunCoexistMechanism(bt_coexist); -- 2.43.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v2 5/5] staging: rtl8723bs: no space before tabs 2025-04-01 16:59 [PATCH v2 0/5] Clean up patches for rtl8723bs driver Erick Karanja ` (3 preceding siblings ...) 2025-04-01 16:59 ` [PATCH v2 4/5] staging: rtl8723bs: fix check lines should not end with a '(' Erick Karanja @ 2025-04-01 16:59 ` Erick Karanja 2025-04-01 18:18 ` Greg KH 2025-04-01 22:25 ` Julia Lawall 4 siblings, 2 replies; 11+ messages in thread From: Erick Karanja @ 2025-04-01 16:59 UTC (permalink / raw) To: gregkh, outreachy Cc: karanja99erick, philipp.g.hortmann, linux-staging, linux-kernel Remove spaces before tabs to comply with the Linux kernel coding style guidelines. Proper indentation using tabs improves code consistency and readability. Reported by checkpatch: WARNING: please, no space before tabs Signed-off-by: Erick Karanja <karanja99erick@gmail.com> --- drivers/staging/rtl8723bs/hal/hal_btcoex.c | 33 ++++------------------ 1 file changed, 6 insertions(+), 27 deletions(-) diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 9105594d2dde..44f73baf1cb4 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -9,14 +9,14 @@ #include <hal_btcoex.h> #include <Mp_Precomp.h> -/* Global variables */ +/*Global variables */ struct btc_coexist GLBtCoexist; static u8 GLBtcWiFiInScanState; static u8 GLBtcWiFiInIQKState; /* */ -/* Debug related function */ +/*Debug related function */ /* */ static u8 halbtcoutsrc_IsBtCoexistAvailable(struct btc_coexist *pBtCoexist) { @@ -84,9 +84,9 @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist) ready = _FAIL; #ifdef LPS_RPWM_WAIT_MS timeout = LPS_RPWM_WAIT_MS; -#else /* !LPS_RPWM_WAIT_MS */ +#else timeout = 30; -#endif /* !LPS_RPWM_WAIT_MS */ +#endif stime = jiffies; do { @@ -401,9 +401,6 @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) case BTC_GET_U1_MAC_PHY_MODE: *pu8 = BTC_SMSP; -/* *pU1Tmp = BTC_DMSP; */ -/* *pU1Tmp = BTC_DMDP; */ -/* *pU1Tmp = BTC_MP_UNKNOWN; */ break; case BTC_GET_U1_AP_NUM: @@ -561,7 +558,7 @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) } /* */ -/* IO related function */ +/* IO related function */ /* */ static u8 halbtcoutsrc_Read1Byte(void *pBtcContext, u32 RegAddr) { @@ -772,7 +769,7 @@ static void halbtcoutsrc_FillH2cCmd(void *pBtcContext, u8 elementId, u32 cmdLen, } /* */ -/* Extern functions called by other module */ +/* Extern functions called by other module */ /* */ static u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter) { @@ -808,8 +805,6 @@ void hal_btcoex_Initialize(void *padapter) pBtCoexist = &GLBtCoexist; - /* pBtCoexist->statistics.cntBind++; */ - pBtCoexist->chipInterface = BTC_INTF_SDIO; EXhalbtcoutsrc_BindBtCoexWithAdapter(padapter); @@ -900,14 +895,12 @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) ipsType = BTC_IPS_ENTER; /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_IpsNotify(pBtCoexist, ipsType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_IpsNotify(pBtCoexist, ipsType); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) @@ -952,14 +945,12 @@ void EXhalbtcoutsrc_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) } /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_ScanNotify(pBtCoexist, scanType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_ScanNotify(pBtCoexist, scanType); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action) @@ -978,14 +969,12 @@ void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action) assoType = BTC_ASSOCIATE_FINISH; /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_ConnectNotify(pBtCoexist, assoType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_ConnectNotify(pBtCoexist, assoType); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum @@ -1006,14 +995,12 @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum mStatus = BTC_MEDIA_DISCONNECT; /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_MediaStatusNotify(pBtCoexist, mStatus); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, mStatus); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktType) @@ -1037,14 +1024,12 @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy } /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_SpecialPacketNotify(pBtCoexist, packetType); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_SpecialPacketNotify(pBtCoexist, packetType); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length) @@ -1055,14 +1040,12 @@ void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 pBtCoexist->statistics.cntBtInfoNotify++; /* All notify is called in cmd thread, don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_BtInfoNotify(pBtCoexist, tmpBuf, length); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_BtInfoNotify(pBtCoexist, tmpBuf, length); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_HaltNotify(struct btc_coexist *pBtCoexist) @@ -1102,14 +1085,12 @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist) /* Periodical should be called in cmd thread, */ /* don't need to leave low power again */ -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ if (pBtCoexist->boardInfo.btdmAntNum == 2) EXhalbtc8723b2ant_Periodical(pBtCoexist); else if (pBtCoexist->boardInfo.btdmAntNum == 1) EXhalbtc8723b1ant_Periodical(pBtCoexist); -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ } void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) @@ -1119,10 +1100,8 @@ void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) GLBtCoexist.boardInfo.btdmAntNum = antNum; } else if (type == BT_COEX_ANT_TYPE_ANTDIV) { GLBtCoexist.boardInfo.btdmAntNum = antNum; - /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ } else if (type == BT_COEX_ANT_TYPE_DETECTED) { GLBtCoexist.boardInfo.btdmAntNum = antNum; - /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ } } -- 2.43.0 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 5/5] staging: rtl8723bs: no space before tabs 2025-04-01 16:59 ` [PATCH v2 5/5] staging: rtl8723bs: no space before tabs Erick Karanja @ 2025-04-01 18:18 ` Greg KH 2025-04-01 22:25 ` Julia Lawall 1 sibling, 0 replies; 11+ messages in thread From: Greg KH @ 2025-04-01 18:18 UTC (permalink / raw) To: Erick Karanja; +Cc: outreachy, philipp.g.hortmann, linux-staging, linux-kernel On Tue, Apr 01, 2025 at 07:59:37PM +0300, Erick Karanja wrote: > Remove spaces before tabs to comply with the Linux kernel coding style > guidelines. Proper indentation using tabs improves code consistency > and readability. > > Reported by checkpatch: > > WARNING: please, no space before tabs > > Signed-off-by: Erick Karanja <karanja99erick@gmail.com> > --- > drivers/staging/rtl8723bs/hal/hal_btcoex.c | 33 ++++------------------ > 1 file changed, 6 insertions(+), 27 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c > index 9105594d2dde..44f73baf1cb4 100644 > --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c > +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c > @@ -9,14 +9,14 @@ > #include <hal_btcoex.h> > #include <Mp_Precomp.h> > > -/* Global variables */ > +/*Global variables */ Does that look right? (hint, it isn't...) Always put a space after the /* and before text. You removed the one that was there already :( thanks, greg k-h ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 5/5] staging: rtl8723bs: no space before tabs 2025-04-01 16:59 ` [PATCH v2 5/5] staging: rtl8723bs: no space before tabs Erick Karanja 2025-04-01 18:18 ` Greg KH @ 2025-04-01 22:25 ` Julia Lawall 1 sibling, 0 replies; 11+ messages in thread From: Julia Lawall @ 2025-04-01 22:25 UTC (permalink / raw) To: Erick Karanja Cc: gregkh, outreachy, philipp.g.hortmann, linux-staging, linux-kernel On Tue, 1 Apr 2025, Erick Karanja wrote: > Remove spaces before tabs to comply with the Linux kernel coding style > guidelines. Proper indentation using tabs improves code consistency > and readability. Now you are mixing spaces and tabs with simply deleting commented code in one patch. They should be in separate patches, because those are different things. > > Reported by checkpatch: > > WARNING: please, no space before tabs > > Signed-off-by: Erick Karanja <karanja99erick@gmail.com> > --- > drivers/staging/rtl8723bs/hal/hal_btcoex.c | 33 ++++------------------ > 1 file changed, 6 insertions(+), 27 deletions(-) > > diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c > index 9105594d2dde..44f73baf1cb4 100644 > --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c > +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c > @@ -9,14 +9,14 @@ > #include <hal_btcoex.h> > #include <Mp_Precomp.h> > > -/* Global variables */ > +/*Global variables */ There should be a space after the /* > > struct btc_coexist GLBtCoexist; > static u8 GLBtcWiFiInScanState; > static u8 GLBtcWiFiInIQKState; > > /* */ > -/* Debug related function */ > +/*Debug related function */ > /* */ > static u8 halbtcoutsrc_IsBtCoexistAvailable(struct btc_coexist *pBtCoexist) > { > @@ -84,9 +84,9 @@ static void halbtcoutsrc_LeaveLowPower(struct btc_coexist *pBtCoexist) > ready = _FAIL; > #ifdef LPS_RPWM_WAIT_MS > timeout = LPS_RPWM_WAIT_MS; > -#else /* !LPS_RPWM_WAIT_MS */ > +#else > timeout = 30; > -#endif /* !LPS_RPWM_WAIT_MS */ > +#endif I would be inclined to keep the comments on the #else and #endif. That's more documentation about which #if they belong with. julia > > stime = jiffies; > do { > @@ -401,9 +401,6 @@ static u8 halbtcoutsrc_Get(void *pBtcContext, u8 getType, void *pOutBuf) > > case BTC_GET_U1_MAC_PHY_MODE: > *pu8 = BTC_SMSP; > -/* *pU1Tmp = BTC_DMSP; */ > -/* *pU1Tmp = BTC_DMDP; */ > -/* *pU1Tmp = BTC_MP_UNKNOWN; */ > break; > > case BTC_GET_U1_AP_NUM: > @@ -561,7 +558,7 @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) > } > > /* */ > -/* IO related function */ > +/* IO related function */ > /* */ > static u8 halbtcoutsrc_Read1Byte(void *pBtcContext, u32 RegAddr) > { > @@ -772,7 +769,7 @@ static void halbtcoutsrc_FillH2cCmd(void *pBtcContext, u8 elementId, u32 cmdLen, > } > > /* */ > -/* Extern functions called by other module */ > +/* Extern functions called by other module */ > /* */ > static u8 EXhalbtcoutsrc_BindBtCoexWithAdapter(void *padapter) > { > @@ -808,8 +805,6 @@ void hal_btcoex_Initialize(void *padapter) > > pBtCoexist = &GLBtCoexist; > > - /* pBtCoexist->statistics.cntBind++; */ > - > pBtCoexist->chipInterface = BTC_INTF_SDIO; > > EXhalbtcoutsrc_BindBtCoexWithAdapter(padapter); > @@ -900,14 +895,12 @@ void EXhalbtcoutsrc_IpsNotify(struct btc_coexist *pBtCoexist, u8 type) > ipsType = BTC_IPS_ENTER; > > /* All notify is called in cmd thread, don't need to leave low power again */ > -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ > > if (pBtCoexist->boardInfo.btdmAntNum == 2) > EXhalbtc8723b2ant_IpsNotify(pBtCoexist, ipsType); > else if (pBtCoexist->boardInfo.btdmAntNum == 1) > EXhalbtc8723b1ant_IpsNotify(pBtCoexist, ipsType); > > -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ > } > > void EXhalbtcoutsrc_LpsNotify(struct btc_coexist *pBtCoexist, u8 type) > @@ -952,14 +945,12 @@ void EXhalbtcoutsrc_ScanNotify(struct btc_coexist *pBtCoexist, u8 type) > } > > /* All notify is called in cmd thread, don't need to leave low power again */ > -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ > > if (pBtCoexist->boardInfo.btdmAntNum == 2) > EXhalbtc8723b2ant_ScanNotify(pBtCoexist, scanType); > else if (pBtCoexist->boardInfo.btdmAntNum == 1) > EXhalbtc8723b1ant_ScanNotify(pBtCoexist, scanType); > > -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ > } > > void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action) > @@ -978,14 +969,12 @@ void EXhalbtcoutsrc_ConnectNotify(struct btc_coexist *pBtCoexist, u8 action) > assoType = BTC_ASSOCIATE_FINISH; > > /* All notify is called in cmd thread, don't need to leave low power again */ > -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ > > if (pBtCoexist->boardInfo.btdmAntNum == 2) > EXhalbtc8723b2ant_ConnectNotify(pBtCoexist, assoType); > else if (pBtCoexist->boardInfo.btdmAntNum == 1) > EXhalbtc8723b1ant_ConnectNotify(pBtCoexist, assoType); > > -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ > } > > void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum > @@ -1006,14 +995,12 @@ void EXhalbtcoutsrc_MediaStatusNotify(struct btc_coexist *pBtCoexist, enum > mStatus = BTC_MEDIA_DISCONNECT; > > /* All notify is called in cmd thread, don't need to leave low power again */ > -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ > > if (pBtCoexist->boardInfo.btdmAntNum == 2) > EXhalbtc8723b2ant_MediaStatusNotify(pBtCoexist, mStatus); > else if (pBtCoexist->boardInfo.btdmAntNum == 1) > EXhalbtc8723b1ant_MediaStatusNotify(pBtCoexist, mStatus); > > -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ > } > > void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktType) > @@ -1037,14 +1024,12 @@ void EXhalbtcoutsrc_SpecialPacketNotify(struct btc_coexist *pBtCoexist, u8 pktTy > } > > /* All notify is called in cmd thread, don't need to leave low power again */ > -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ > > if (pBtCoexist->boardInfo.btdmAntNum == 2) > EXhalbtc8723b2ant_SpecialPacketNotify(pBtCoexist, packetType); > else if (pBtCoexist->boardInfo.btdmAntNum == 1) > EXhalbtc8723b1ant_SpecialPacketNotify(pBtCoexist, packetType); > > -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ > } > > void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 length) > @@ -1055,14 +1040,12 @@ void EXhalbtcoutsrc_BtInfoNotify(struct btc_coexist *pBtCoexist, u8 *tmpBuf, u8 > pBtCoexist->statistics.cntBtInfoNotify++; > > /* All notify is called in cmd thread, don't need to leave low power again */ > -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ > > if (pBtCoexist->boardInfo.btdmAntNum == 2) > EXhalbtc8723b2ant_BtInfoNotify(pBtCoexist, tmpBuf, length); > else if (pBtCoexist->boardInfo.btdmAntNum == 1) > EXhalbtc8723b1ant_BtInfoNotify(pBtCoexist, tmpBuf, length); > > -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ > } > > void EXhalbtcoutsrc_HaltNotify(struct btc_coexist *pBtCoexist) > @@ -1102,14 +1085,12 @@ void EXhalbtcoutsrc_Periodical(struct btc_coexist *pBtCoexist) > > /* Periodical should be called in cmd thread, */ > /* don't need to leave low power again */ > -/* halbtcoutsrc_LeaveLowPower(pBtCoexist); */ > > if (pBtCoexist->boardInfo.btdmAntNum == 2) > EXhalbtc8723b2ant_Periodical(pBtCoexist); > else if (pBtCoexist->boardInfo.btdmAntNum == 1) > EXhalbtc8723b1ant_Periodical(pBtCoexist); > > -/* halbtcoutsrc_NormalLowPower(pBtCoexist); */ > } > > void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) > @@ -1119,10 +1100,8 @@ void EXhalbtcoutsrc_SetAntNum(u8 type, u8 antNum) > GLBtCoexist.boardInfo.btdmAntNum = antNum; > } else if (type == BT_COEX_ANT_TYPE_ANTDIV) { > GLBtCoexist.boardInfo.btdmAntNum = antNum; > - /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ > } else if (type == BT_COEX_ANT_TYPE_DETECTED) { > GLBtCoexist.boardInfo.btdmAntNum = antNum; > - /* GLBtCoexist.boardInfo.btdmAntPos = BTC_ANTENNA_AT_MAIN_PORT; */ > } > } > > -- > 2.43.0 > > > ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2025-04-01 22:32 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-01 16:59 [PATCH v2 0/5] Clean up patches for rtl8723bs driver Erick Karanja
2025-04-01 16:59 ` [PATCH v2 1/5] staging: rtl8723bs: use preferred comparison order Erick Karanja
2025-04-01 22:32 ` Julia Lawall
2025-04-01 16:59 ` [PATCH v2 2/5] staging: rtl8723bs: add spaces between ternary and binary operators Erick Karanja
2025-04-01 22:30 ` Julia Lawall
2025-04-01 16:59 ` [PATCH v2 3/5] staging: rtl8723bs: Rename variables Erick Karanja
2025-04-01 22:28 ` Julia Lawall
2025-04-01 16:59 ` [PATCH v2 4/5] staging: rtl8723bs: fix check lines should not end with a '(' Erick Karanja
2025-04-01 16:59 ` [PATCH v2 5/5] staging: rtl8723bs: no space before tabs Erick Karanja
2025-04-01 18:18 ` Greg KH
2025-04-01 22:25 ` Julia Lawall
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox