diff options
Diffstat (limited to 'drivers/staging/rtl8723bs/hal/hal_btcoex.c')
-rw-r--r-- | drivers/staging/rtl8723bs/hal/hal_btcoex.c | 66 |
1 files changed, 25 insertions, 41 deletions
diff --git a/drivers/staging/rtl8723bs/hal/hal_btcoex.c b/drivers/staging/rtl8723bs/hal/hal_btcoex.c index 6caddd7834a1..5257287b4f4d 100644 --- a/drivers/staging/rtl8723bs/hal/hal_btcoex.c +++ b/drivers/staging/rtl8723bs/hal/hal_btcoex.c @@ -112,9 +112,9 @@ void DBG_BT_INFO(u8 *dbgmsg) /* */ static u8 halbtcoutsrc_IsBtCoexistAvailable(PBTC_COEXIST pBtCoexist) { - if (!pBtCoexist->bBinded || !pBtCoexist->Adapter){ + if (!pBtCoexist->bBinded || !pBtCoexist->Adapter) return false; - } + return true; } @@ -195,7 +195,6 @@ static void halbtcoutsrc_NormalLps(PBTC_COEXIST pBtCoexist) static void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist) { struct adapter *padapter; - struct hal_com_data *pHalData; s32 ready; unsigned long stime; unsigned long utime; @@ -203,7 +202,6 @@ static void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist) padapter = pBtCoexist->Adapter; - pHalData = GET_HAL_DATA(padapter); ready = _FAIL; #ifdef LPS_RPWM_WAIT_MS timeout = LPS_RPWM_WAIT_MS; @@ -256,13 +254,11 @@ static void halbtcoutsrc_AggregationCheck(PBTC_COEXIST pBtCoexist) padapter = pBtCoexist->Adapter; bNeedToAct = false; - if (pBtCoexist->btInfo.bRejectAggPkt) + if (pBtCoexist->btInfo.bRejectAggPkt) { rtw_btcoex_RejectApAggregatedPacket(padapter, true); - else { - + } else { if (pBtCoexist->btInfo.bPreBtCtrlAggBufSize != - pBtCoexist->btInfo.bBtCtrlAggBufSize){ - + pBtCoexist->btInfo.bBtCtrlAggBufSize) { bNeedToAct = true; pBtCoexist->btInfo.bPreBtCtrlAggBufSize = pBtCoexist->btInfo.bBtCtrlAggBufSize; } @@ -292,7 +288,7 @@ static u8 halbtcoutsrc_IsWifiBusy(struct adapter *padapter) if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) return true; - if (true == pmlmepriv->LinkDetectInfo.bBusyTraffic) + if (pmlmepriv->LinkDetectInfo.bBusyTraffic) return true; } @@ -312,12 +308,12 @@ static u32 _halbtcoutsrc_GetWifiLinkStatus(struct adapter *padapter) if (check_fwstate(pmlmepriv, WIFI_ASOC_STATE) == true) { if (check_fwstate(pmlmepriv, WIFI_AP_STATE) == true) { - if (true == bp2p) + if (bp2p) portConnectedStatus |= WIFI_P2P_GO_CONNECTED; else portConnectedStatus |= WIFI_AP_CONNECTED; } else { - if (true == bp2p) + if (bp2p) portConnectedStatus |= WIFI_P2P_GC_CONNECTED; else portConnectedStatus |= WIFI_STA_CONNECTED; @@ -362,15 +358,9 @@ static u32 halbtcoutsrc_GetBtPatchVer(PBTC_COEXIST pBtCoexist) static s32 halbtcoutsrc_GetWifiRssi(struct adapter *padapter) { - struct hal_com_data *pHalData; - s32 UndecoratedSmoothedPWDB = 0; + struct hal_com_data *pHalData = GET_HAL_DATA(padapter); - - pHalData = GET_HAL_DATA(padapter); - - UndecoratedSmoothedPWDB = pHalData->dmpriv.EntryMinUndecoratedSmoothedPWDB; - - return UndecoratedSmoothedPWDB; + return pHalData->dmpriv.EntryMinUndecoratedSmoothedPWDB; } static u8 halbtcoutsrc_GetWifiScanAPNum(struct adapter *padapter) @@ -380,7 +370,7 @@ static u8 halbtcoutsrc_GetWifiScanAPNum(struct adapter *padapter) pmlmeext = &padapter->mlmeextpriv; - if (GLBtcWiFiInScanState == false) { + if (!GLBtcWiFiInScanState) { if (pmlmeext->sitesurvey_res.bss_cnt > 0xFF) scan_AP_num = 0xFF; else @@ -566,18 +556,14 @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) { PBTC_COEXIST pBtCoexist; struct adapter *padapter; - struct hal_com_data *pHalData; u8 *pu8; - u8 *pU1Tmp; u32 *pU4Tmp; u8 ret; pBtCoexist = (PBTC_COEXIST)pBtcContext; padapter = pBtCoexist->Adapter; - pHalData = GET_HAL_DATA(padapter); pu8 = pInBuf; - pU1Tmp = pInBuf; pU4Tmp = pInBuf; ret = true; @@ -620,11 +606,11 @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) /* set some u8 type variables. */ case BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON: - pBtCoexist->btInfo.rssiAdjustForAgcTableOn = *pU1Tmp; + pBtCoexist->btInfo.rssiAdjustForAgcTableOn = *pu8; break; case BTC_SET_U1_AGG_BUF_SIZE: - pBtCoexist->btInfo.aggBufSize = *pU1Tmp; + pBtCoexist->btInfo.aggBufSize = *pu8; break; /* the following are some action which will be triggered */ @@ -639,15 +625,15 @@ static u8 halbtcoutsrc_Set(void *pBtcContext, u8 setType, void *pInBuf) /* 1Ant =========== */ /* set some u8 type variables. */ case BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE: - pBtCoexist->btInfo.rssiAdjustFor1AntCoexType = *pU1Tmp; + pBtCoexist->btInfo.rssiAdjustFor1AntCoexType = *pu8; break; case BTC_SET_U1_LPS_VAL: - pBtCoexist->btInfo.lpsVal = *pU1Tmp; + pBtCoexist->btInfo.lpsVal = *pu8; break; case BTC_SET_U1_RPWM_VAL: - pBtCoexist->btInfo.rpwmVal = *pU1Tmp; + pBtCoexist->btInfo.rpwmVal = *pu8; break; /* the following are some action which will be triggered */ @@ -822,11 +808,10 @@ static void halbtcoutsrc_WriteLocalReg1Byte(void *pBtcContext, u32 RegAddr, u8 D PBTC_COEXIST pBtCoexist = (PBTC_COEXIST)pBtcContext; struct adapter *Adapter = pBtCoexist->Adapter; - if (BTC_INTF_SDIO == pBtCoexist->chipInterface) { + if (BTC_INTF_SDIO == pBtCoexist->chipInterface) rtw_write8(Adapter, SDIO_LOCAL_BASE | RegAddr, Data); - } else { + else rtw_write8(Adapter, RegAddr, Data); - } } static void halbtcoutsrc_SetBbReg(void *pBtcContext, u32 RegAddr, u32 BitMask, u32 Data) @@ -1202,14 +1187,13 @@ void EXhalbtcoutsrc_SpecialPacketNotify(PBTC_COEXIST pBtCoexist, u8 pktType) if (pBtCoexist->bManualControl) return; - if (PACKET_DHCP == pktType) + if (PACKET_DHCP == pktType) { packetType = BTC_PACKET_DHCP; - else if (PACKET_EAPOL == pktType) + } else if (PACKET_EAPOL == pktType) { packetType = BTC_PACKET_EAPOL; - else if (PACKET_ARP == pktType) + } else if (PACKET_ARP == pktType) { packetType = BTC_PACKET_ARP; - else { - packetType = BTC_PACKET_UNKNOWN; + } else { return; } @@ -1362,7 +1346,7 @@ u8 hal_btcoex_IsBtExist(struct adapter *padapter) return pHalData->bt_coexist.bBtExist; } -u8 hal_btcoex_IsBtDisabled(struct adapter *padapter) +bool hal_btcoex_IsBtDisabled(struct adapter *padapter) { if (!hal_btcoex_IsBtExist(padapter)) return true; @@ -1457,7 +1441,7 @@ void hal_btcoex_IQKNotify(struct adapter *padapter, u8 state) void hal_btcoex_BtInfoNotify(struct adapter *padapter, u8 length, u8 *tmpBuf) { - if (GLBtcWiFiInIQKState == true) + if (GLBtcWiFiInIQKState) return; EXhalbtcoutsrc_BtInfoNotify(&GLBtCoexist, tmpBuf, length); @@ -1478,7 +1462,7 @@ void hal_btcoex_HaltNotify(struct adapter *padapter) EXhalbtcoutsrc_HaltNotify(&GLBtCoexist); } -void hal_btcoex_Hanlder(struct adapter *padapter) +void hal_btcoex_Handler(struct adapter *padapter) { EXhalbtcoutsrc_Periodical(&GLBtCoexist); } |