mirror of
https://github.com/aircrack-ng/rtl8812au.git
synced 2025-01-06 06:06:09 +00:00
Code cleanup
This commit is contained in:
parent
72d78a19f5
commit
53ebbdd11a
@ -78,8 +78,7 @@ s32 FillH2CCmd_8814(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
|
|||||||
pHalData = GET_HAL_DATA(padapter);
|
pHalData = GET_HAL_DATA(padapter);
|
||||||
|
|
||||||
|
|
||||||
if(padapter->bFWReady == _FALSE)
|
if(padapter->bFWReady == _FALSE) {
|
||||||
{
|
|
||||||
//RTW_INFO("FillH2CCmd_8814(): return H2C cmd because fw is not ready\n");
|
//RTW_INFO("FillH2CCmd_8814(): return H2C cmd because fw is not ready\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -107,8 +106,7 @@ s32 FillH2CCmd_8814(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
|
|||||||
|
|
||||||
*(u8*)(&h2c_cmd) = ElementID;
|
*(u8*)(&h2c_cmd) = ElementID;
|
||||||
|
|
||||||
if(CmdLen<=3)
|
if(CmdLen<=3) {
|
||||||
{
|
|
||||||
_rtw_memcpy((u8*)(&h2c_cmd)+1, pCmdBuffer, CmdLen );
|
_rtw_memcpy((u8*)(&h2c_cmd)+1, pCmdBuffer, CmdLen );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -194,15 +192,13 @@ u8 Get_VHT_ENI(
|
|||||||
{
|
{
|
||||||
u8 Ret = 0;
|
u8 Ret = 0;
|
||||||
|
|
||||||
if(WirelessMode == WIRELESS_11_24AC)
|
if (WirelessMode == WIRELESS_11_24AC) {
|
||||||
{
|
|
||||||
if (ratr_bitmap & 0xfff00000) // Mix , 2SS
|
if (ratr_bitmap & 0xfff00000) // Mix , 2SS
|
||||||
Ret = 3;
|
Ret = 3;
|
||||||
else // Mix, 1SS
|
else // Mix, 1SS
|
||||||
Ret = 2;
|
Ret = 2;
|
||||||
}
|
}
|
||||||
else if(WirelessMode == WIRELESS_11_5AC)
|
else if (WirelessMode == WIRELESS_11_5AC) {
|
||||||
{
|
|
||||||
Ret = 1; // VHT
|
Ret = 1; // VHT
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -248,15 +244,13 @@ Set_RA_LDPC_8814(
|
|||||||
if (psta == NULL)
|
if (psta == NULL)
|
||||||
return;
|
return;
|
||||||
#ifdef CONFIG_80211AC_VHT
|
#ifdef CONFIG_80211AC_VHT
|
||||||
if(psta->wireless_mode == WIRELESS_11_5AC)
|
if (psta->wireless_mode == WIRELESS_11_5AC) {
|
||||||
{
|
|
||||||
if (bLDPC && TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
|
if (bLDPC && TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
|
||||||
SET_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
|
SET_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
|
||||||
else
|
else
|
||||||
CLEAR_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
|
CLEAR_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
|
||||||
}
|
}
|
||||||
else if(IsSupportedHT(psta->wireless_mode) || IsSupportedVHT(psta->wireless_mode))
|
else if(IsSupportedHT(psta->wireless_mode) || IsSupportedVHT(psta->wireless_mode)) {
|
||||||
{
|
|
||||||
if (bLDPC && TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
|
if (bLDPC && TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
|
||||||
SET_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX);
|
SET_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX);
|
||||||
else
|
else
|
||||||
@ -289,14 +283,12 @@ Get_RA_LDPC_8814(
|
|||||||
else
|
else
|
||||||
bLDPC = 0;
|
bLDPC = 0;
|
||||||
}
|
}
|
||||||
else if(IsSupportedHT(psta->wireless_mode))
|
else if (IsSupportedHT(psta->wireless_mode)) {
|
||||||
{
|
|
||||||
if (TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
|
if (TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
|
||||||
bLDPC =1;
|
bLDPC =1;
|
||||||
else
|
else
|
||||||
bLDPC =0;
|
bLDPC =0;
|
||||||
}
|
} else
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
bLDPC = 0;
|
bLDPC = 0;
|
||||||
}
|
}
|
||||||
@ -326,8 +318,7 @@ void rtl8814_set_raid_cmd(PADAPTER padapter, u64 bitmap, u8* arg, u8 bw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(pHalData->fw_ractrl == _TRUE)
|
if (pHalData->fw_ractrl == _TRUE) {
|
||||||
{
|
|
||||||
u8 H2CCommand[7] ={0};
|
u8 H2CCommand[7] ={0};
|
||||||
|
|
||||||
shortGIrate = Get_RA_ShortGI_8814(padapter, psta, shortGIrate, bitmap);
|
shortGIrate = Get_RA_ShortGI_8814(padapter, psta, shortGIrate, bitmap);
|
||||||
@ -340,8 +331,7 @@ void rtl8814_set_raid_cmd(PADAPTER padapter, u64 bitmap, u8* arg, u8 bw)
|
|||||||
if (pHalData->bDisableTXPowerTraining) {
|
if (pHalData->bDisableTXPowerTraining) {
|
||||||
H2CCommand[2] |= BIT6;
|
H2CCommand[2] |= BIT6;
|
||||||
RTW_INFO("%s,Disable PWT by driver\n",__FUNCTION__);
|
RTW_INFO("%s,Disable PWT by driver\n",__FUNCTION__);
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
PDM_ODM_T pDM_OutSrc = &pHalData->odmpriv;
|
PDM_ODM_T pDM_OutSrc = &pHalData->odmpriv;
|
||||||
|
|
||||||
if (pDM_OutSrc->bDisablePowerTraining){
|
if (pDM_OutSrc->bDisablePowerTraining){
|
||||||
@ -408,11 +398,9 @@ void rtl8814_set_FwPwrMode_cmd(PADAPTER padapter, u8 PSMode)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Mode > PS_MODE_ACTIVE)
|
if (Mode > PS_MODE_ACTIVE) {
|
||||||
{
|
|
||||||
#ifdef CONFIG_BT_COEXIST
|
#ifdef CONFIG_BT_COEXIST
|
||||||
if ((rtw_btcoex_IsBtControlLps(padapter) == _TRUE) && (_TRUE == pHalData->EEPROMBluetoothCoexist))
|
if ((rtw_btcoex_IsBtControlLps(padapter) == _TRUE) && (_TRUE == pHalData->EEPROMBluetoothCoexist)) {
|
||||||
{
|
|
||||||
PowerState = rtw_btcoex_RpwmVal(padapter);
|
PowerState = rtw_btcoex_RpwmVal(padapter);
|
||||||
pwrModeByte5 = rtw_btcoex_LpsVal(padapter);
|
pwrModeByte5 = rtw_btcoex_LpsVal(padapter);
|
||||||
}
|
}
|
||||||
@ -426,9 +414,7 @@ void rtl8814_set_FwPwrMode_cmd(PADAPTER padapter, u8 PSMode)
|
|||||||
#ifdef CONFIG_EXT_CLK
|
#ifdef CONFIG_EXT_CLK
|
||||||
Mode |= BIT(7);//supporting 26M XTAL CLK_Request feature.
|
Mode |= BIT(7);//supporting 26M XTAL CLK_Request feature.
|
||||||
#endif //CONFIG_EXT_CLK
|
#endif //CONFIG_EXT_CLK
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
PowerState = 0x0C;// AllON(0x0C), RFON(0x04), RFOFF(0x00)
|
PowerState = 0x0C;// AllON(0x0C), RFON(0x04), RFOFF(0x00)
|
||||||
pwrModeByte5 = 0x40;
|
pwrModeByte5 = 0x40;
|
||||||
}
|
}
|
||||||
@ -508,8 +494,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
|
|||||||
pframe += 2;
|
pframe += 2;
|
||||||
pktlen += 2;
|
pktlen += 2;
|
||||||
|
|
||||||
if( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
|
if ( (pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE) {
|
||||||
{
|
|
||||||
//RTW_INFO("ie len=%d\n", cur_network->IELength);
|
//RTW_INFO("ie len=%d\n", cur_network->IELength);
|
||||||
pktlen += cur_network->IELength - sizeof(NDIS_802_11_FIXED_IEs);
|
pktlen += cur_network->IELength - sizeof(NDIS_802_11_FIXED_IEs);
|
||||||
_rtw_memcpy(pframe, cur_network->IEs+sizeof(NDIS_802_11_FIXED_IEs), pktlen);
|
_rtw_memcpy(pframe, cur_network->IEs+sizeof(NDIS_802_11_FIXED_IEs), pktlen);
|
||||||
@ -529,8 +514,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
|
|||||||
// DS parameter set
|
// DS parameter set
|
||||||
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen);
|
pframe = rtw_set_ie(pframe, _DSSET_IE_, 1, (unsigned char *)&(cur_network->Configuration.DSConfig), &pktlen);
|
||||||
|
|
||||||
if( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE)
|
if ( (pmlmeinfo->state&0x03) == WIFI_FW_ADHOC_STATE) {
|
||||||
{
|
|
||||||
u32 ATIMWindow;
|
u32 ATIMWindow;
|
||||||
// IBSS Parameter Set...
|
// IBSS Parameter Set...
|
||||||
//ATIMWindow = cur->Configuration.ATIMWindow;
|
//ATIMWindow = cur->Configuration.ATIMWindow;
|
||||||
@ -543,8 +527,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
|
|||||||
|
|
||||||
|
|
||||||
// EXTERNDED SUPPORTED RATE
|
// EXTERNDED SUPPORTED RATE
|
||||||
if (rate_len > 8)
|
if (rate_len > 8) {
|
||||||
{
|
|
||||||
pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen);
|
pframe = rtw_set_ie(pframe, _EXT_SUPPORTEDRATES_IE_, (rate_len - 8), (cur_network->SupportedRates + 8), &pktlen);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -553,8 +536,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
|
|||||||
|
|
||||||
_ConstructBeacon:
|
_ConstructBeacon:
|
||||||
|
|
||||||
if ((pktlen + TXDESC_SIZE) > 512)
|
if ((pktlen + TXDESC_SIZE) > 512) {
|
||||||
{
|
|
||||||
RTW_INFO("beacon frame too large\n");
|
RTW_INFO("beacon frame too large\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -620,8 +602,7 @@ void ConstructNullFunctionData(
|
|||||||
|
|
||||||
fctrl = &pwlanhdr->frame_ctl;
|
fctrl = &pwlanhdr->frame_ctl;
|
||||||
*(fctrl) = 0;
|
*(fctrl) = 0;
|
||||||
if (bForcePowerSave)
|
if (bForcePowerSave) {
|
||||||
{
|
|
||||||
SetPwrMgt(fctrl);
|
SetPwrMgt(fctrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -678,7 +659,6 @@ void ConstructProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr
|
|||||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||||
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
|
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
|
||||||
|
|
||||||
|
|
||||||
//RTW_INFO("%s\n", __FUNCTION__);
|
//RTW_INFO("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
|
||||||
@ -758,8 +738,7 @@ static void ConstructGTKResponse(
|
|||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
// Qos Header: leave space for it if necessary.
|
// Qos Header: leave space for it if necessary.
|
||||||
//-------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
if(pStaQos->CurrentQosMode > QOS_DISABLE)
|
if(pStaQos->CurrentQosMode > QOS_DISABLE) {
|
||||||
{
|
|
||||||
SET_80211_HDR_QOS_EN(pGTKRspPkt, 1);
|
SET_80211_HDR_QOS_EN(pGTKRspPkt, 1);
|
||||||
PlatformZeroMemory(&(Buffer[*pLength]), sQoSCtlLng);
|
PlatformZeroMemory(&(Buffer[*pLength]), sQoSCtlLng);
|
||||||
*pLength += sQoSCtlLng;
|
*pLength += sQoSCtlLng;
|
||||||
@ -791,8 +770,7 @@ static void ConstructGTKResponse(
|
|||||||
EncryptionHeadOverhead = 0;
|
EncryptionHeadOverhead = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(EncryptionHeadOverhead > 0)
|
if (EncryptionHeadOverhead > 0) {
|
||||||
{
|
|
||||||
_rtw_memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead);
|
_rtw_memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead);
|
||||||
*pLength += EncryptionHeadOverhead;
|
*pLength += EncryptionHeadOverhead;
|
||||||
//SET_80211_HDR_WEP(pGTKRspPkt, 1); //Suggested by CCW.
|
//SET_80211_HDR_WEP(pGTKRspPkt, 1); //Suggested by CCW.
|
||||||
@ -833,8 +811,7 @@ CheckFwRsvdPageContent(
|
|||||||
HAL_DATA_TYPE* pHalData = GET_HAL_DATA(Adapter);
|
HAL_DATA_TYPE* pHalData = GET_HAL_DATA(Adapter);
|
||||||
u32 MaxBcnPageNum;
|
u32 MaxBcnPageNum;
|
||||||
|
|
||||||
if(pHalData->FwRsvdPageStartOffset != 0)
|
if(pHalData->FwRsvdPageStartOffset != 0) {
|
||||||
{
|
|
||||||
/*MaxBcnPageNum = PageNum_128(pMgntInfo->MaxBeaconSize);
|
/*MaxBcnPageNum = PageNum_128(pMgntInfo->MaxBeaconSize);
|
||||||
RT_ASSERT((MaxBcnPageNum <= pHalData->FwRsvdPageStartOffset),
|
RT_ASSERT((MaxBcnPageNum <= pHalData->FwRsvdPageStartOffset),
|
||||||
("CheckFwRsvdPageContent(): The reserved page content has been"\
|
("CheckFwRsvdPageContent(): The reserved page content has been"\
|
||||||
@ -855,12 +832,9 @@ GetTxBufferRsvdPageNum8814(_adapter *Adapter, bool bWoWLANBoundary)
|
|||||||
u8 RsvdPageNum=0;
|
u8 RsvdPageNum=0;
|
||||||
u16 TxPageBndy= LAST_ENTRY_OF_TX_PKT_BUFFER_8814A; // default reseved 1 page for the IC type which is undefined.
|
u16 TxPageBndy= LAST_ENTRY_OF_TX_PKT_BUFFER_8814A; // default reseved 1 page for the IC type which is undefined.
|
||||||
|
|
||||||
if(bWoWLANBoundary)
|
if(bWoWLANBoundary) {
|
||||||
{
|
|
||||||
rtw_hal_get_def_var(Adapter, HAL_DEF_TX_PAGE_BOUNDARY_WOWLAN, (u8 *)&TxPageBndy);
|
rtw_hal_get_def_var(Adapter, HAL_DEF_TX_PAGE_BOUNDARY_WOWLAN, (u8 *)&TxPageBndy);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
rtw_hal_get_def_var(Adapter, HAL_DEF_TX_PAGE_BOUNDARY, (u8 *)&TxPageBndy);
|
rtw_hal_get_def_var(Adapter, HAL_DEF_TX_PAGE_BOUNDARY, (u8 *)&TxPageBndy);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -869,7 +843,6 @@ GetTxBufferRsvdPageNum8814(_adapter *Adapter, bool bWoWLANBoundary)
|
|||||||
return RsvdPageNum;
|
return RsvdPageNum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
|
void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
|
||||||
{
|
{
|
||||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||||
@ -882,8 +855,7 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
|
|||||||
|
|
||||||
RTW_INFO("%s mstatus(%x)\n", __FUNCTION__,mstatus);
|
RTW_INFO("%s mstatus(%x)\n", __FUNCTION__,mstatus);
|
||||||
|
|
||||||
if(mstatus == 1)
|
if(mstatus == 1) {
|
||||||
{
|
|
||||||
// We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C.
|
// We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C.
|
||||||
// Suggested by filen. Added by tynli.
|
// Suggested by filen. Added by tynli.
|
||||||
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid));
|
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid));
|
||||||
@ -906,8 +878,7 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
|
|||||||
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)&(~BIT(3)));
|
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)&(~BIT(3)));
|
||||||
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)|BIT(4));
|
rtw_write8(padapter, REG_BCN_CTRL, rtw_read8(padapter, REG_BCN_CTRL)|BIT(4));
|
||||||
|
|
||||||
if(pHalData->RegFwHwTxQCtrl&BIT6)
|
if(pHalData->RegFwHwTxQCtrl&BIT6) {
|
||||||
{
|
|
||||||
RTW_INFO("HalDownloadRSVDPage(): There is an Adapter is sending beacon.\n");
|
RTW_INFO("HalDownloadRSVDPage(): There is an Adapter is sending beacon.\n");
|
||||||
bSendBeacon = _TRUE;
|
bSendBeacon = _TRUE;
|
||||||
}
|
}
|
||||||
@ -920,13 +891,11 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
|
|||||||
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
||||||
DLBcnCount = 0;
|
DLBcnCount = 0;
|
||||||
poll = 0;
|
poll = 0;
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
// download rsvd page.
|
// download rsvd page.
|
||||||
rtw_hal_set_fw_rsvd_page(padapter, _FALSE);
|
rtw_hal_set_fw_rsvd_page(padapter, _FALSE);
|
||||||
DLBcnCount++;
|
DLBcnCount++;
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
rtw_yield_os();
|
rtw_yield_os();
|
||||||
//rtw_mdelay_os(10);
|
//rtw_mdelay_os(10);
|
||||||
// check rsvd page download OK.
|
// check rsvd page download OK.
|
||||||
@ -955,21 +924,17 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
|
|||||||
// the beacon TCB in the following code. 2011.11.23. by tynli.
|
// the beacon TCB in the following code. 2011.11.23. by tynli.
|
||||||
//
|
//
|
||||||
//if(bcn_valid && padapter->bEnterPnpSleep)
|
//if(bcn_valid && padapter->bEnterPnpSleep)
|
||||||
if(0)
|
if(0) {
|
||||||
{
|
if(bSendBeacon) {
|
||||||
if(bSendBeacon)
|
|
||||||
{
|
|
||||||
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
||||||
DLBcnCount = 0;
|
DLBcnCount = 0;
|
||||||
poll = 0;
|
poll = 0;
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
//SetFwRsvdPagePkt_8812(padapter, _TRUE);
|
//SetFwRsvdPagePkt_8812(padapter, _TRUE);
|
||||||
rtw_hal_set_fw_rsvd_page(padapter, _TRUE);
|
rtw_hal_set_fw_rsvd_page(padapter, _TRUE);
|
||||||
DLBcnCount++;
|
DLBcnCount++;
|
||||||
|
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
rtw_yield_os();
|
rtw_yield_os();
|
||||||
//rtw_mdelay_os(10);
|
//rtw_mdelay_os(10);
|
||||||
// check rsvd page download OK.
|
// check rsvd page download OK.
|
||||||
@ -999,8 +964,7 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
|
|||||||
// prevent from setting 0x422[6] to 0 after download reserved page, or it will cause
|
// prevent from setting 0x422[6] to 0 after download reserved page, or it will cause
|
||||||
// the beacon cannot be sent by HW.
|
// the beacon cannot be sent by HW.
|
||||||
// 2010.06.23. Added by tynli.
|
// 2010.06.23. Added by tynli.
|
||||||
if(bSendBeacon)
|
if(bSendBeacon) {
|
||||||
{
|
|
||||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, (pHalData->RegFwHwTxQCtrl|BIT6));
|
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, (pHalData->RegFwHwTxQCtrl|BIT6));
|
||||||
pHalData->RegFwHwTxQCtrl |= BIT6;
|
pHalData->RegFwHwTxQCtrl |= BIT6;
|
||||||
}
|
}
|
||||||
@ -1008,8 +972,7 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
|
|||||||
//
|
//
|
||||||
// Update RSVD page location H2C to Fw.
|
// Update RSVD page location H2C to Fw.
|
||||||
//
|
//
|
||||||
if(bcn_valid)
|
if(bcn_valid) {
|
||||||
{
|
|
||||||
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
|
||||||
RTW_INFO("Set RSVD page location to Fw.\n");
|
RTW_INFO("Set RSVD page location to Fw.\n");
|
||||||
//FillH2CCmd88E(Adapter, H2C_88E_RSVDPAGE, H2C_RSVDPAGE_LOC_LENGTH, pMgntInfo->u1RsvdPageLoc);
|
//FillH2CCmd88E(Adapter, H2C_88E_RSVDPAGE, H2C_RSVDPAGE_LOC_LENGTH, pMgntInfo->u1RsvdPageLoc);
|
||||||
@ -1047,15 +1010,13 @@ void rtl8814_set_p2p_ps_offload_cmd(_adapter* padapter, u8 p2p_ps_state)
|
|||||||
case P2P_PS_ENABLE:
|
case P2P_PS_ENABLE:
|
||||||
RTW_INFO("P2P_PS_ENABLE \n");
|
RTW_INFO("P2P_PS_ENABLE \n");
|
||||||
// update CTWindow value.
|
// update CTWindow value.
|
||||||
if( pwdinfo->ctwindow > 0 )
|
if( pwdinfo->ctwindow > 0 ) {
|
||||||
{
|
|
||||||
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_CTWINDOW_EN(p2p_ps_offload, 1);
|
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_CTWINDOW_EN(p2p_ps_offload, 1);
|
||||||
rtw_write8(padapter, REG_P2P_CTWIN, pwdinfo->ctwindow);
|
rtw_write8(padapter, REG_P2P_CTWIN, pwdinfo->ctwindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
// hw only support 2 set of NoA
|
// hw only support 2 set of NoA
|
||||||
for( i=0 ; i<pwdinfo->noa_num ; i++)
|
for ( i = 0 ; i<pwdinfo->noa_num ; i++) {
|
||||||
{
|
|
||||||
// To control the register setting for which NOA
|
// To control the register setting for which NOA
|
||||||
rtw_write8(padapter, REG_NOA_DESC_SEL, (i << 4));
|
rtw_write8(padapter, REG_NOA_DESC_SEL, (i << 4));
|
||||||
if (i == 0) {
|
if (i == 0) {
|
||||||
@ -1078,21 +1039,17 @@ void rtl8814_set_p2p_ps_offload_cmd(_adapter* padapter, u8 p2p_ps_state)
|
|||||||
rtw_write8(padapter, REG_NOA_DESC_COUNT, pwdinfo->noa_count[i]);
|
rtw_write8(padapter, REG_NOA_DESC_COUNT, pwdinfo->noa_count[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if( (pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0) )
|
if( (pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0) ) {
|
||||||
{
|
|
||||||
// rst p2p circuit: reg 0x5F0
|
// rst p2p circuit: reg 0x5F0
|
||||||
rtw_write8(padapter, REG_P2P_RST_8814A, BIT(0)); //rst p2p 0 circuit NOA 0
|
rtw_write8(padapter, REG_P2P_RST_8814A, BIT(0)); //rst p2p 0 circuit NOA 0
|
||||||
|
|
||||||
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ENABLE(p2p_ps_offload, 1);
|
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ENABLE(p2p_ps_offload, 1);
|
||||||
|
|
||||||
if(pwdinfo->role == P2P_ROLE_GO)
|
if (pwdinfo->role == P2P_ROLE_GO) {
|
||||||
{
|
|
||||||
// 1: Owner, 0: Client
|
// 1: Owner, 0: Client
|
||||||
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ROLE(p2p_ps_offload, 1);
|
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ROLE(p2p_ps_offload, 1);
|
||||||
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(p2p_ps_offload, 0);
|
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(p2p_ps_offload, 0);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// 1: Owner, 0: Client
|
// 1: Owner, 0: Client
|
||||||
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ROLE(p2p_ps_offload, 0);
|
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ROLE(p2p_ps_offload, 0);
|
||||||
}
|
}
|
||||||
@ -1465,16 +1422,14 @@ void ConstructBtNullFunctionData(
|
|||||||
|
|
||||||
pwlanhdr = (struct rtw_ieee80211_hdr*)pframe;
|
pwlanhdr = (struct rtw_ieee80211_hdr*)pframe;
|
||||||
|
|
||||||
if (NULL == StaAddr)
|
if (NULL == StaAddr) {
|
||||||
{
|
|
||||||
_rtw_memcpy(bssid, adapter_mac_addr(padapter), ETH_ALEN);
|
_rtw_memcpy(bssid, adapter_mac_addr(padapter), ETH_ALEN);
|
||||||
StaAddr = bssid;
|
StaAddr = bssid;
|
||||||
}
|
}
|
||||||
|
|
||||||
fctrl = &pwlanhdr->frame_ctl;
|
fctrl = &pwlanhdr->frame_ctl;
|
||||||
*(fctrl) = 0;
|
*(fctrl) = 0;
|
||||||
if (bForcePowerSave)
|
if (bForcePowerSave) {
|
||||||
{
|
|
||||||
SetPwrMgt(fctrl);
|
SetPwrMgt(fctrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1556,8 +1511,7 @@ static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
|
|||||||
CurtPktPageNum = (u8)PageNum(TxDescLen + BeaconLength, PageSize);
|
CurtPktPageNum = (u8)PageNum(TxDescLen + BeaconLength, PageSize);
|
||||||
|
|
||||||
//If we don't add 1 more page, the WOWLAN function has a problem. Baron thinks it's a bug of firmware
|
//If we don't add 1 more page, the WOWLAN function has a problem. Baron thinks it's a bug of firmware
|
||||||
if (CurtPktPageNum == 1)
|
if (CurtPktPageNum == 1) {
|
||||||
{
|
|
||||||
CurtPktPageNum += 1;
|
CurtPktPageNum += 1;
|
||||||
}
|
}
|
||||||
TotalPageNum += CurtPktPageNum;
|
TotalPageNum += CurtPktPageNum;
|
||||||
@ -1565,8 +1519,7 @@ static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
|
|||||||
BufIndex += (CurtPktPageNum*PageSize);
|
BufIndex += (CurtPktPageNum*PageSize);
|
||||||
|
|
||||||
// Jump to lastest page
|
// Jump to lastest page
|
||||||
if (BufIndex < (MaxRsvdPageBufSize - PageSize))
|
if (BufIndex < (MaxRsvdPageBufSize - PageSize)) {
|
||||||
{
|
|
||||||
BufIndex = TxDescOffset + (MaxRsvdPageBufSize - PageSize);
|
BufIndex = TxDescOffset + (MaxRsvdPageBufSize - PageSize);
|
||||||
TotalPageNum = BCNQ_PAGE_NUM_8814-1;
|
TotalPageNum = BCNQ_PAGE_NUM_8814-1;
|
||||||
|
|
||||||
@ -1590,14 +1543,11 @@ static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
|
|||||||
TotalPageNum += CurtPktPageNum;
|
TotalPageNum += CurtPktPageNum;
|
||||||
|
|
||||||
TotalPacketLen = BufIndex + BTQosNullLength;
|
TotalPacketLen = BufIndex + BTQosNullLength;
|
||||||
if(TotalPacketLen > MaxRsvdPageBufSize)
|
if(TotalPacketLen > MaxRsvdPageBufSize) {
|
||||||
{
|
|
||||||
RTW_INFO("%s(): ERROR: The rsvd page size is not enough!!TotalPacketLen %d, MaxRsvdPageBufSize %d\n",__FUNCTION__,
|
RTW_INFO("%s(): ERROR: The rsvd page size is not enough!!TotalPacketLen %d, MaxRsvdPageBufSize %d\n",__FUNCTION__,
|
||||||
TotalPacketLen,MaxRsvdPageBufSize);
|
TotalPacketLen,MaxRsvdPageBufSize);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
// update attribute
|
// update attribute
|
||||||
pattrib = &pcmdframe->attrib;
|
pattrib = &pcmdframe->attrib;
|
||||||
update_mgntframe_attrib(padapter, pattrib);
|
update_mgntframe_attrib(padapter, pattrib);
|
||||||
@ -1673,12 +1623,10 @@ void rtl8812a_download_BTCoex_AP_mode_rsvd_page(PADAPTER padapter)
|
|||||||
|
|
||||||
DLBcnCount = 0;
|
DLBcnCount = 0;
|
||||||
poll = 0;
|
poll = 0;
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
SetFwRsvdPagePkt_BTCoex(padapter);
|
SetFwRsvdPagePkt_BTCoex(padapter);
|
||||||
DLBcnCount++;
|
DLBcnCount++;
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
rtw_yield_os();
|
rtw_yield_os();
|
||||||
//rtw_mdelay_os(10);
|
//rtw_mdelay_os(10);
|
||||||
// check rsvd page download OK.
|
// check rsvd page download OK.
|
||||||
@ -1711,8 +1659,7 @@ void rtl8812a_download_BTCoex_AP_mode_rsvd_page(PADAPTER padapter)
|
|||||||
// prevent from setting 0x422[6] to 0 after download reserved page, or it will cause
|
// prevent from setting 0x422[6] to 0 after download reserved page, or it will cause
|
||||||
// the beacon cannot be sent by HW.
|
// the beacon cannot be sent by HW.
|
||||||
// 2010.06.23. Added by tynli.
|
// 2010.06.23. Added by tynli.
|
||||||
if(bRecover)
|
if (bRecover) {
|
||||||
{
|
|
||||||
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl | BIT(6));
|
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, pHalData->RegFwHwTxQCtrl | BIT(6));
|
||||||
pHalData->RegFwHwTxQCtrl |= BIT(6);
|
pHalData->RegFwHwTxQCtrl |= BIT(6);
|
||||||
}
|
}
|
||||||
@ -1727,4 +1674,3 @@ void rtl8812a_download_BTCoex_AP_mode_rsvd_page(PADAPTER padapter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif // CONFIG_BT_COEXIST
|
#endif // CONFIG_BT_COEXIST
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user