Merge pull request #74 from kimocoder/v5.1.5

Cleanup + Monitor crash fix
This commit is contained in:
Christian B 2017-12-21 19:21:49 +01:00 committed by GitHub
commit cd1535f2fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 1112 additions and 1664 deletions

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
@ -21,7 +21,7 @@
#include "Hal8814PwrSeq.h"
#include <rtl8814a_hal.h>
/*
/*
drivers should parse below arrays and do the corresponding actions
*/
//3 Power on Array
@ -50,7 +50,7 @@ WLAN_PWR_CFG rtl8814A_card_disable_flow[RTL8814A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8
WLAN_PWR_CFG rtl8814A_card_enable_flow[RTL8814A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8814A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8814A_TRANS_END_STEPS]=
{
RTL8814A_TRANS_CARDDIS_TO_CARDEMU
RTL8814A_TRANS_CARDEMU_TO_ACT
RTL8814A_TRANS_CARDEMU_TO_ACT
RTL8814A_TRANS_END
};
@ -70,29 +70,26 @@ WLAN_PWR_CFG rtl8814A_resume_flow[RTL8814A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8814A_T
RTL8814A_TRANS_END
};
//3HWPDN Array
WLAN_PWR_CFG rtl8814A_hwpdn_flow[RTL8814A_TRANS_ACT_TO_CARDEMU_STEPS+RTL8814A_TRANS_CARDEMU_TO_PDN_STEPS+RTL8814A_TRANS_END_STEPS]=
{
RTL8814A_TRANS_ACT_TO_CARDEMU
RTL8814A_TRANS_CARDEMU_TO_PDN
RTL8814A_TRANS_CARDEMU_TO_PDN
RTL8814A_TRANS_END
};
//3 Enter LPS
//3 Enter LPS
WLAN_PWR_CFG rtl8814A_enter_lps_flow[RTL8814A_TRANS_ACT_TO_LPS_STEPS+RTL8814A_TRANS_END_STEPS]=
{
//FW behavior
RTL8814A_TRANS_ACT_TO_LPS
RTL8814A_TRANS_ACT_TO_LPS
RTL8814A_TRANS_END
};
//3 Leave LPS
//3 Leave LPS
WLAN_PWR_CFG rtl8814A_leave_lps_flow[RTL8814A_TRANS_LPS_TO_ACT_STEPS+RTL8814A_TRANS_END_STEPS]=
{
//FW behavior
RTL8814A_TRANS_LPS_TO_ACT
RTL8814A_TRANS_END
};

View File

@ -39,14 +39,14 @@ static u8 _is_fw_read_cmd_down(_adapter* padapter, u8 msgbox_num)
//RTW_INFO(" _is_fw_read_cmd_down ,reg_1cc(%x),msg_box(%d)...\n",rtw_read8(padapter,REG_HMETFR),msgbox_num);
do{
do {
valid = rtw_read8(padapter,REG_HMETFR) & BIT(msgbox_num);
if(0 == valid ){
if (0 == valid ){
read_down = _TRUE;
}
else
rtw_msleep_os(1);
}while( (!read_down) && (retry_cnts--));
} while( (!read_down) && (retry_cnts--));
return read_down;
@ -74,12 +74,11 @@ s32 FillH2CCmd_8814(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
u32 h2c_cmd_ex = 0;
s32 ret = _FAIL;
padapter = GET_PRIMARY_ADAPTER(padapter);
padapter = GET_PRIMARY_ADAPTER(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");
return ret;
}
@ -97,29 +96,28 @@ s32 FillH2CCmd_8814(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
goto exit;
//pay attention to if race condition happened in H2C cmd setting.
do{
do {
h2c_box_num = pHalData->LastHMEBoxNum;
if(!_is_fw_read_cmd_down(padapter, h2c_box_num)){
if (!_is_fw_read_cmd_down(padapter, h2c_box_num)){
RTW_INFO(" fw read cmd failed...\n");
goto exit;
}
*(u8*)(&h2c_cmd) = ElementID;
if(CmdLen<=3)
{
if(CmdLen<=3) {
_rtw_memcpy((u8*)(&h2c_cmd)+1, pCmdBuffer, CmdLen );
}
else{
else {
_rtw_memcpy((u8*)(&h2c_cmd)+1, pCmdBuffer,3);
ext_cmd_len = CmdLen-3;
ext_cmd_len = CmdLen-3;
_rtw_memcpy((u8*)(&h2c_cmd_ex), pCmdBuffer+3,ext_cmd_len );
//Write Ext command
msgbox_ex_addr = REG_HMEBOX_EXT0_8814A + (h2c_box_num *RTL8814_EX_MESSAGE_BOX_SIZE);
#ifdef CONFIG_H2C_EF
for(cmd_idx=0;cmd_idx<ext_cmd_len;cmd_idx++ ){
for (cmd_idx=0;cmd_idx<ext_cmd_len;cmd_idx++ ){
rtw_write8(padapter,msgbox_ex_addr+cmd_idx,*((u8*)(&h2c_cmd_ex)+cmd_idx));
}
#else
@ -130,7 +128,7 @@ s32 FillH2CCmd_8814(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
// Write command
msgbox_addr =REG_HMEBOX_0 + (h2c_box_num *RTL8814_MESSAGE_BOX_SIZE);
#ifdef CONFIG_H2C_EF
for(cmd_idx=0;cmd_idx<RTL8814_MESSAGE_BOX_SIZE;cmd_idx++ ){
for (cmd_idx=0;cmd_idx<RTL8814_MESSAGE_BOX_SIZE;cmd_idx++ ){
rtw_write8(padapter,msgbox_addr+cmd_idx,*((u8*)(&h2c_cmd)+cmd_idx));
}
#else
@ -142,14 +140,14 @@ s32 FillH2CCmd_8814(PADAPTER padapter, u8 ElementID, u32 CmdLen, u8 *pCmdBuffer)
//,pHalData->LastHMEBoxNum ,CmdLen,msgbox_addr,h2c_cmd,msgbox_ex_addr,h2c_cmd_ex);
pHalData->LastHMEBoxNum = (h2c_box_num+1) % RTL8814_MAX_H2C_BOX_NUMS;
}while(0);
} while(0);
ret = _SUCCESS;
exit:
_exit_critical_mutex(&(adapter_to_dvobj(padapter)->h2c_fwcmd_mutex), NULL);
_exit_critical_mutex(&(adapter_to_dvobj(padapter)->h2c_fwcmd_mutex), NULL);
return ret;
}
@ -170,7 +168,7 @@ void rtl8814_fw_update_beacon_cmd(_adapter *padapter)
{
u8 param[2] = {0};
u16 txpktbuf_bndy;
SET_8814A_H2CCMD_BCNHWSEQ_EN(param, 1);
SET_8814A_H2CCMD_BCNHWSEQ_BCN_NUMBER(param, 0);
SET_8814A_H2CCMD_BCNHWSEQ_HWSEQ(param, 1);
@ -181,7 +179,7 @@ void rtl8814_fw_update_beacon_cmd(_adapter *padapter)
FillH2CCmd_8814(padapter, 0xC2, 2, param);
else
FillH2CCmd_8814(padapter, H2C_BCNHWSEQ, 2, param);
/*RTW_INFO("%s, %d, correct beacon HW sequence, FirmwareVersion=%d, H2C_BCNHWSEQ=%d\n", __func__, __LINE__, GET_HAL_DATA(padapter)->FirmwareVersion, H2C_BCNHWSEQ);*/
}
@ -194,29 +192,27 @@ u8 Get_VHT_ENI(
{
u8 Ret = 0;
if(WirelessMode == WIRELESS_11_24AC)
{
if(ratr_bitmap & 0xfff00000) // Mix , 2SS
if (WirelessMode == WIRELESS_11_24AC) {
if (ratr_bitmap & 0xfff00000) // Mix , 2SS
Ret = 3;
else // Mix, 1SS
Ret = 2;
}
else if(WirelessMode == WIRELESS_11_5AC)
{
else if (WirelessMode == WIRELESS_11_5AC) {
Ret = 1; // VHT
}
return (Ret << 4);
}
BOOLEAN
Get_RA_ShortGI_8814(
BOOLEAN
Get_RA_ShortGI_8814(
PADAPTER Adapter,
struct sta_info *psta,
u8 shortGIrate,
u32 ratr_bitmap
)
{
{
BOOLEAN bShortGI;
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
@ -224,13 +220,13 @@ Get_RA_ShortGI_8814(
bShortGI = shortGIrate;
#ifdef CONFIG_80211AC_VHT
if( bShortGI &&
if ( bShortGI &&
IsSupportedVHT(psta->wireless_mode) &&
(pmlmeinfo->assoc_AP_vendor == HT_IOT_PEER_REALTEK_JAGUAR_CCUTAP) &&
TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX)
)
{
if(ratr_bitmap & 0xC0000000)
if (ratr_bitmap & 0xC0000000)
bShortGI = _FALSE;
}
#endif //CONFIG_80211AC_VHT
@ -245,19 +241,17 @@ Set_RA_LDPC_8814(
BOOLEAN bLDPC
)
{
if(psta == NULL)
if (psta == NULL)
return;
#ifdef CONFIG_80211AC_VHT
if(psta->wireless_mode == WIRELESS_11_5AC)
{
if(bLDPC && TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
if (psta->wireless_mode == WIRELESS_11_5AC) {
if (bLDPC && TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
SET_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
else
CLEAR_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_ENABLE_TX);
}
else if(IsSupportedHT(psta->wireless_mode) || IsSupportedVHT(psta->wireless_mode))
{
if(bLDPC && TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
else if(IsSupportedHT(psta->wireless_mode) || IsSupportedVHT(psta->wireless_mode)) {
if (bLDPC && TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
SET_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX);
else
CLEAR_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_ENABLE_TX);
@ -270,33 +264,31 @@ Set_RA_LDPC_8814(
}
u8
u8
Get_RA_LDPC_8814(
struct sta_info *psta
)
{
{
u8 bLDPC = 0;
if (psta != NULL) {
if(psta->mac_id == 1) {
if (psta->mac_id == 1) {
bLDPC = 0;
} else {
#ifdef CONFIG_80211AC_VHT
if(IsSupportedVHT(psta->wireless_mode))
if (IsSupportedVHT(psta->wireless_mode))
{
if(TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
if (TEST_FLAG(psta->vhtpriv.ldpc_cap, LDPC_VHT_CAP_TX))
bLDPC = 1;
else
bLDPC = 0;
}
else if(IsSupportedHT(psta->wireless_mode))
{
if(TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
}
else if (IsSupportedHT(psta->wireless_mode)) {
if (TEST_FLAG(psta->htpriv.ldpc_cap, LDPC_HT_CAP_TX))
bLDPC =1;
else
bLDPC =0;
}
else
} else
#endif
bLDPC = 0;
}
@ -326,29 +318,27 @@ 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};
shortGIrate = Get_RA_ShortGI_8814(padapter, psta, shortGIrate, bitmap);
H2CCommand[0] = macid;
H2CCommand[1] = (raid & 0x1F) | (shortGIrate?0x80:0x00) ;
H2CCommand[2] = (psta->bw_mode & 0x3) |Get_RA_LDPC_8814(psta) |Get_VHT_ENI(0, psta->wireless_mode, bitmap);
//DisableTXPowerTraining
if(pHalData->bDisableTXPowerTraining){
if (pHalData->bDisableTXPowerTraining) {
H2CCommand[2] |= BIT6;
RTW_INFO("%s,Disable PWT by driver\n",__FUNCTION__);
}
else{
} else {
PDM_ODM_T pDM_OutSrc = &pHalData->odmpriv;
if(pDM_OutSrc->bDisablePowerTraining){
if (pDM_OutSrc->bDisablePowerTraining){
H2CCommand[2] |= BIT6;
RTW_INFO("%s, Disable PWT by DM\n",__FUNCTION__);
}
}
}
H2CCommand[3] = (u8)(bitmap & 0x000000ff);
H2CCommand[4] = (u8)((bitmap & 0x0000ff00) >>8);
@ -360,11 +350,11 @@ void rtl8814_set_raid_cmd(PADAPTER padapter, u64 bitmap, u8* arg, u8 bw)
FillH2CCmd_8814(padapter, H2C_MACID_CFG, 7, H2CCommand);
// For 3SS rate, extend H2C cmd
// For 3SS rate, extend H2C cmd
H2CCommand[3] = (u8)((bitmap>>32) & 0x000000ff);
H2CCommand[4] = (u8)(((bitmap>>32) & 0x0000ff00) >>8);
FillH2CCmd_8814(padapter, H2C_RA_MASK_3SS, 5, H2CCommand);
}
if (shortGIrate==_TRUE)
@ -408,11 +398,9 @@ void rtl8814_set_FwPwrMode_cmd(PADAPTER padapter, u8 PSMode)
break;
}
if (Mode > PS_MODE_ACTIVE)
{
if (Mode > PS_MODE_ACTIVE) {
#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);
pwrModeByte5 = rtw_btcoex_LpsVal(padapter);
}
@ -426,16 +414,14 @@ void rtl8814_set_FwPwrMode_cmd(PADAPTER padapter, u8 PSMode)
#ifdef CONFIG_EXT_CLK
Mode |= BIT(7);//supporting 26M XTAL CLK_Request feature.
#endif //CONFIG_EXT_CLK
}
else
{
} else {
PowerState = 0x0C;// AllON(0x0C), RFON(0x04), RFOFF(0x00)
pwrModeByte5 = 0x40;
}
// 0: Active, 1: LPS, 2: WMMPS
SET_8814A_H2CCMD_PWRMODE_PARM_MODE(u1H2CSetPwrMode, Mode);
// 0:Min, 1:Max , 2:User define
SET_8814A_H2CCMD_PWRMODE_PARM_RLBM(u1H2CSetPwrMode, RLBM);
@ -508,8 +494,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
pframe += 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);
pktlen += cur_network->IELength - sizeof(NDIS_802_11_FIXED_IEs);
_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
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;
// IBSS Parameter Set...
//ATIMWindow = cur->Configuration.ATIMWindow;
@ -543,8 +527,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
// 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);
}
@ -553,8 +536,7 @@ void ConstructBeacon(_adapter *padapter, u8 *pframe, u32 *pLength)
_ConstructBeacon:
if ((pktlen + TXDESC_SIZE) > 512)
{
if ((pktlen + TXDESC_SIZE) > 512) {
RTW_INFO("beacon frame too large\n");
return;
}
@ -620,8 +602,7 @@ void ConstructNullFunctionData(
fctrl = &pwlanhdr->frame_ctl;
*(fctrl) = 0;
if (bForcePowerSave)
{
if (bForcePowerSave) {
SetPwrMgt(fctrl);
}
@ -678,7 +659,6 @@ void ConstructProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network);
//RTW_INFO("%s\n", __FUNCTION__);
pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;
@ -698,7 +678,7 @@ void ConstructProbeRsp(_adapter *padapter, u8 *pframe, u32 *pLength, u8 *StaAddr
pktlen = sizeof(struct rtw_ieee80211_hdr_3addr);
pframe += pktlen;
if(cur_network->IELength>MAX_IE_SZ)
if (cur_network->IELength>MAX_IE_SZ)
return;
_rtw_memcpy(pframe, cur_network->IEs, cur_network->IELength);
@ -758,8 +738,7 @@ static void ConstructGTKResponse(
//-------------------------------------------------------------------------
// 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);
PlatformZeroMemory(&(Buffer[*pLength]), sQoSCtlLng);
*pLength += sQoSCtlLng;
@ -777,8 +756,8 @@ static void ConstructGTKResponse(
EncryptionHeadOverhead = 4;
break;
case _TKIP_:
EncryptionHeadOverhead = 8;
break;
EncryptionHeadOverhead = 8;
break;
case _AES_:
EncryptionHeadOverhead = 8;
break;
@ -790,29 +769,28 @@ static void ConstructGTKResponse(
default:
EncryptionHeadOverhead = 0;
}
if(EncryptionHeadOverhead > 0)
{
if (EncryptionHeadOverhead > 0) {
_rtw_memset(&(pframe[*pLength]), 0,EncryptionHeadOverhead);
*pLength += EncryptionHeadOverhead;
//SET_80211_HDR_WEP(pGTKRspPkt, 1); //Suggested by CCW.
//GTK's privacy bit is done by FW
//SetPrivacy(fctrl);
}
}
#endif //1
//-------------------------------------------------------------------------
// Frame Body.
//-------------------------------------------------------------------------
pGTKRspPkt = (u8*)(pframe+ *pLength);
pGTKRspPkt = (u8*)(pframe+ *pLength);
// LLC header
_rtw_memcpy(pGTKRspPkt, LLCHeader, 8);
_rtw_memcpy(pGTKRspPkt, LLCHeader, 8);
*pLength += 8;
// GTK element
pGTKRspPkt += 8;
//GTK frame body after LLC, part 1
_rtw_memcpy(pGTKRspPkt, GTKbody_a, 11);
_rtw_memcpy(pGTKRspPkt, GTKbody_a, 11);
*pLength += 11;
pGTKRspPkt += 11;
//GTK frame body after LLC, part 2
@ -833,8 +811,7 @@ CheckFwRsvdPageContent(
HAL_DATA_TYPE* pHalData = GET_HAL_DATA(Adapter);
u32 MaxBcnPageNum;
if(pHalData->FwRsvdPageStartOffset != 0)
{
if(pHalData->FwRsvdPageStartOffset != 0) {
/*MaxBcnPageNum = PageNum_128(pMgntInfo->MaxBeaconSize);
RT_ASSERT((MaxBcnPageNum <= pHalData->FwRsvdPageStartOffset),
("CheckFwRsvdPageContent(): The reserved page content has been"\
@ -855,21 +832,17 @@ GetTxBufferRsvdPageNum8814(_adapter *Adapter, bool bWoWLANBoundary)
u8 RsvdPageNum=0;
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);
}
else
{
} else {
rtw_hal_get_def_var(Adapter, HAL_DEF_TX_PAGE_BOUNDARY, (u8 *)&TxPageBndy);
}
RsvdPageNum = LAST_ENTRY_OF_TX_PKT_BUFFER_8814A -TxPageBndy + 1;
return RsvdPageNum;
}
void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
{
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);
if(mstatus == 1)
{
if(mstatus == 1) {
// We should set AID, correct TSF, HW seq enable before set JoinBssReport to Fw in 88/92C.
// Suggested by filen. Added by tynli.
rtw_write16(padapter, REG_BCN_PSR_RPT, (0xC000|pmlmeinfo->aid));
@ -897,7 +869,7 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
pHalData->RegCR_1 |= BIT0;
rtw_write8(padapter, REG_CR+1, pHalData->RegCR_1);
/*RTW_INFO("%s-%d: enable SW BCN, REG_CR=0x%x\n", __func__, __LINE__, rtw_read32(padapter, REG_CR));*/
// Disable Hw protection for a time which revserd for Hw sending beacon.
// Fix download reserved page packet fail that access collision with the protection time.
// 2010.05.11. Added by tynli.
@ -905,9 +877,8 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
//SetBcnCtrlReg(padapter, BIT4, 0);
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));
if(pHalData->RegFwHwTxQCtrl&BIT6)
{
if(pHalData->RegFwHwTxQCtrl&BIT6) {
RTW_INFO("HalDownloadRSVDPage(): There is an Adapter is sending beacon.\n");
bSendBeacon = _TRUE;
}
@ -920,22 +891,20 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
DLBcnCount = 0;
poll = 0;
do
{
do {
// download rsvd page.
rtw_hal_set_fw_rsvd_page(padapter, _FALSE);
DLBcnCount++;
do
{
do {
rtw_yield_os();
//rtw_mdelay_os(10);
// check rsvd page download OK.
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8*)(&bcn_valid));
poll++;
} while (!bcn_valid && (poll%10) != 0 && !RTW_CANNOT_RUN(padapter));
} while (!bcn_valid && DLBcnCount <= 100 && !RTW_CANNOT_RUN(padapter));
//RT_ASSERT(bcn_valid, ("HalDownloadRSVDPage88ES(): 1 Download RSVD page failed!\n"));
if (RTW_CANNOT_RUN(padapter))
;
@ -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.
//
//if(bcn_valid && padapter->bEnterPnpSleep)
if(0)
{
if(bSendBeacon)
{
if(0) {
if(bSendBeacon) {
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
DLBcnCount = 0;
poll = 0;
do
{
do {
//SetFwRsvdPagePkt_8812(padapter, _TRUE);
rtw_hal_set_fw_rsvd_page(padapter, _TRUE);
DLBcnCount++;
do
{
do {
rtw_yield_os();
//rtw_mdelay_os(10);
// check rsvd page download OK.
@ -977,7 +942,7 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
poll++;
} while (!bcn_valid && (poll%10) != 0 && !RTW_CANNOT_RUN(padapter));
} while (!bcn_valid && DLBcnCount <= 100 && !RTW_CANNOT_RUN(padapter));
//RT_ASSERT(bcn_valid, ("HalDownloadRSVDPage(): 2 Download RSVD page failed!\n"));
if (RTW_CANNOT_RUN(padapter))
;
@ -996,11 +961,10 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
// To make sure that if there exists an adapter which would like to send beacon.
// If exists, the origianl value of 0x422[6] will be 1, we should check this to
// 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.
// 2010.06.23. Added by tynli.
if(bSendBeacon)
{
if(bSendBeacon) {
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, (pHalData->RegFwHwTxQCtrl|BIT6));
pHalData->RegFwHwTxQCtrl |= BIT6;
}
@ -1008,13 +972,12 @@ void rtl8814_set_FwJoinBssReport_cmd(PADAPTER padapter, u8 mstatus)
//
// Update RSVD page location H2C to Fw.
//
if(bcn_valid)
{
if(bcn_valid) {
rtw_hal_set_hwreg(padapter, HW_VAR_BCN_VALID, NULL);
RTW_INFO("Set RSVD page location to Fw.\n");
//FillH2CCmd88E(Adapter, H2C_88E_RSVDPAGE, H2C_RSVDPAGE_LOC_LENGTH, pMgntInfo->u1RsvdPageLoc);
}
// Do not enable HW DMA BCN or it will cause Pcie interface hang by timing issue. 2011.11.24. by tynli.
//if(!padapter->bEnterPnpSleep)
{
@ -1047,18 +1010,16 @@ void rtl8814_set_p2p_ps_offload_cmd(_adapter* padapter, u8 p2p_ps_state)
case P2P_PS_ENABLE:
RTW_INFO("P2P_PS_ENABLE \n");
// update CTWindow value.
if( pwdinfo->ctwindow > 0 )
{
if( pwdinfo->ctwindow > 0 ) {
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
for( i=0 ; i<pwdinfo->noa_num ; i++)
{
for ( i = 0 ; i<pwdinfo->noa_num ; i++) {
// To control the register setting for which NOA
rtw_write8(padapter, REG_NOA_DESC_SEL, (i << 4));
if(i == 0) {
if (i == 0) {
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_NOA0_EN(p2p_ps_offload, 1);
} else {
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_NOA1_EN(p2p_ps_offload, 1);
@ -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]);
}
if( (pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0) )
{
if( (pwdinfo->opp_ps == 1) || (pwdinfo->noa_num > 0) ) {
// rst p2p circuit: reg 0x5F0
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);
if(pwdinfo->role == P2P_ROLE_GO)
{
if (pwdinfo->role == P2P_ROLE_GO) {
// 1: Owner, 0: Client
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ROLE(p2p_ps_offload, 1);
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ALLSTASLEEP(p2p_ps_offload, 0);
}
else
{
} else {
// 1: Owner, 0: Client
SET_8814A_H2CCMD_P2P_PS_OFFLOAD_ROLE(p2p_ps_offload, 0);
}
@ -1125,7 +1082,7 @@ void rtl8814_set_p2p_ps_offload_cmd(_adapter* padapter, u8 p2p_ps_state)
ask FW to Reset sync register at Beacon early interrupt
*/
u8 rtl8814_reset_tsf(_adapter *padapter, u8 reset_port )
{
{
u8 buf[2];
u8 res=_SUCCESS;
@ -1180,7 +1137,7 @@ static void rtl8814_set_FwRsvdPage_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvdpage
SET_H2CCMD_RSVDPAGE_LOC_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocNullData);
SET_H2CCMD_RSVDPAGE_LOC_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocQosNull);
SET_H2CCMD_RSVDPAGE_LOC_BT_QOS_NULL_DATA(u1H2CRsvdPageParm, rsvdpageloc->LocBTQosNull);
RTW_INFO_DUMP("u1H2CRsvdPageParm:", u1H2CRsvdPageParm, H2C_RSVDPAGE_LOC_LEN);
FillH2CCmd_8814(padapter, H2C_RSVD_PAGE, H2C_RSVDPAGE_LOC_LEN, u1H2CRsvdPageParm);
}
@ -1191,7 +1148,7 @@ static void rtl8814_set_FwAoacRsvdPage_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvd
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
u8 res = 0, count = 0;
#ifdef CONFIG_WOWLAN
#ifdef CONFIG_WOWLAN
u8 u1H2CAoacRsvdPageParm[H2C_AOAC_RSVDPAGE_LOC_LEN]={0};
RTW_INFO("8192EAOACRsvdPageLoc: RWC=%d ArpRsp=%d NbrAdv=%d GtkRsp=%d GtkInfo=%d ProbeReq=%d NetworkList=%d\n",
@ -1258,7 +1215,7 @@ void rtl8814_iqk_done(_adapter* padapter)
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
struct submit_ctx *iqk_sctx = &pHalData->iqk_sctx;
rtw_sctx_done(&iqk_sctx);
}
@ -1299,7 +1256,7 @@ C2HTxFeedbackHandler_8814(
s32
_C2HContentParsing8814(
IN PADAPTER Adapter,
IN u8 c2hCmdId,
IN u8 c2hCmdId,
IN u8 c2hCmdLen,
IN u8 *tmpBuf
)
@ -1402,7 +1359,7 @@ C2HPacketHandler_8814(
c2hCmdSeq = Buffer[1];
c2hCmdLen = Length -2;
tmpBuf = Buffer+2;
//RTW_INFO("[C2H packet], c2hCmdId=0x%x, c2hCmdSeq=0x%x, c2hCmdLen=%d\n", c2hCmdId, c2hCmdSeq, c2hCmdLen);
#ifdef CONFIG_BT_COEXIST
@ -1424,7 +1381,7 @@ C2HPacketHandler_8814(
#endif /* CONFIG_BT_COEXIST */
{
/* handle directly */
#ifdef CONFIG_BEAMFORMING
#ifdef CONFIG_BEAMFORMING
if (c2hCmdId == C2H_TXBF) {
/* enqueue */
c2h_evt = (struct c2h_evt_hdr_88xx *)rtw_zmalloc(16);
@ -1465,16 +1422,14 @@ void ConstructBtNullFunctionData(
pwlanhdr = (struct rtw_ieee80211_hdr*)pframe;
if (NULL == StaAddr)
{
if (NULL == StaAddr) {
_rtw_memcpy(bssid, adapter_mac_addr(padapter), ETH_ALEN);
StaAddr = bssid;
}
fctrl = &pwlanhdr->frame_ctl;
*(fctrl) = 0;
if (bForcePowerSave)
{
if (bForcePowerSave) {
SetPwrMgt(fctrl);
}
@ -1509,7 +1464,7 @@ void ConstructBtNullFunctionData(
static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
{
PHAL_DATA_TYPE pHalData;
struct xmit_frame *pcmdframe;
struct xmit_frame *pcmdframe;
struct pkt_attrib *pattrib;
struct xmit_priv *pxmitpriv;
struct mlme_ext_priv *pmlmeext;
@ -1554,10 +1509,9 @@ static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
// When we count the first page size, we need to reserve description size for the RSVD
// packet, it will be filled in front of the packet in TXPKTBUF.
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 (CurtPktPageNum == 1)
{
if (CurtPktPageNum == 1) {
CurtPktPageNum += 1;
}
TotalPageNum += CurtPktPageNum;
@ -1565,13 +1519,12 @@ static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
BufIndex += (CurtPktPageNum*PageSize);
// Jump to lastest page
if (BufIndex < (MaxRsvdPageBufSize - PageSize))
{
if (BufIndex < (MaxRsvdPageBufSize - PageSize)) {
BufIndex = TxDescOffset + (MaxRsvdPageBufSize - PageSize);
TotalPageNum = BCNQ_PAGE_NUM_8814-1;
}
//3 (6) BT Qos null data
RsvdPageLoc.LocBTQosNull = TotalPageNum;
ConstructBtNullFunctionData(
@ -1582,7 +1535,7 @@ static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
_TRUE, 0, 0, _FALSE);
rtl8814a_fill_fake_txdesc(padapter, &ReservedPagePacket[BufIndex-TxDescLen], BTQosNullLength, _FALSE, _TRUE, _FALSE);
//RTW_INFO("%s(): HW_VAR_SET_TX_CMD: BT QOS NULL DATA %p %d\n",
//RTW_INFO("%s(): HW_VAR_SET_TX_CMD: BT QOS NULL DATA %p %d\n",
// __FUNCTION__, &ReservedPagePacket[BufIndex-TxDescLen], (BTQosNullLength+TxDescLen));
CurtPktPageNum = (u8)PageNum(TxDescLen + BTQosNullLength,PageSize);
@ -1590,14 +1543,11 @@ static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
TotalPageNum += CurtPktPageNum;
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__,
TotalPacketLen,MaxRsvdPageBufSize);
goto error;
}
else
{
} else {
// update attribute
pattrib = &pcmdframe->attrib;
update_mgntframe_attrib(padapter, pattrib);
@ -1611,13 +1561,13 @@ static void SetFwRsvdPagePkt_BTCoex(PADAPTER padapter)
}
RTW_INFO("%s: Set RSVD page location to Fw ,TotalPacketLen(%d), TotalPageNum(%d)\n", __FUNCTION__,TotalPacketLen,TotalPageNum);
if(check_fwstate(pmlmepriv, _FW_LINKED)) {
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
rtl8814_set_FwRsvdPage_cmd(padapter, &RsvdPageLoc);
#ifdef CONFIG_WOWLAN
rtl8814_set_FwAoacRsvdPage_cmd(padapter, &RsvdPageLoc);
#endif
}
}
return;
error:
@ -1673,24 +1623,22 @@ void rtl8812a_download_BTCoex_AP_mode_rsvd_page(PADAPTER padapter)
DLBcnCount = 0;
poll = 0;
do
{
do {
SetFwRsvdPagePkt_BTCoex(padapter);
DLBcnCount++;
do
{
do {
rtw_yield_os();
//rtw_mdelay_os(10);
// check rsvd page download OK.
rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8*)(&bcn_valid));
poll++;
} while (!bcn_valid && (poll%10) != 0 && !RTW_CANNOT_RUN(padapter));
} while (!bcn_valid && DLBcnCount <= 100 && !RTW_CANNOT_RUN(padapter));
if (RTW_CANNOT_RUN(padapter))
;
else if(!bcn_valid)
else if (!bcn_valid)
RTW_INFO(ADPT_FMT": 1 DL RSVD page failed! DLBcnCount:%u, poll:%u\n",
ADPT_ARG(padapter) ,DLBcnCount, poll);
else {
@ -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
// the beacon cannot be sent by HW.
// 2010.06.23. Added by tynli.
if(bRecover)
{
if (bRecover) {
rtw_write8(padapter, REG_FWHW_TXQ_CTRL+2, 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

View File

@ -46,18 +46,15 @@ dm_CheckProtection(
PMGNT_INFO pMgntInfo = &(Adapter->MgntInfo);
u1Byte CurRate, RateThreshold;
if(pMgntInfo->pHTInfo->bCurBW40MHz)
if (pMgntInfo->pHTInfo->bCurBW40MHz)
RateThreshold = MGN_MCS1;
else
RateThreshold = MGN_MCS3;
if(Adapter->TxStats.CurrentInitTxRate <= RateThreshold)
{
if(Adapter->TxStats.CurrentInitTxRate <= RateThreshold) {
pMgntInfo->bDmDisableProtect = TRUE;
DbgPrint("Forced disable protect: %x\n", Adapter->TxStats.CurrentInitTxRate);
}
else
{
} else {
pMgntInfo->bDmDisableProtect = FALSE;
DbgPrint("Enable protect: %x\n", Adapter->TxStats.CurrentInitTxRate);
}
@ -70,7 +67,7 @@ dm_CheckStatistics(
)
{
#if 0
if(!Adapter->MgntInfo.bMediaConnect)
if (!Adapter->MgntInfo.bMediaConnect)
return;
//2008.12.10 tynli Add for getting Current_Tx_Rate_Reg flexibly.
@ -98,14 +95,13 @@ static void dm_CheckPbcGPIO(_adapter *padapter)
#endif /* CONFIG_BT_COEXIST */
#if defined(CONFIG_USB_HCI) || defined(CONFIG_SDIO_HCI)
tmp1byte = rtw_read8(padapter, REG_GPIO_EXT_CTRL_8814A);
//DBG_871X("CheckPbcGPIO - %x\n", tmp1byte);
if (tmp1byte == 0xff)
return ;
else if (tmp1byte & BIT3)
{
else if (tmp1byte & BIT3) {
// Here we only set bPbcPressed to TRUE. After trigger PBC, the variable will be set to FALSE
DBG_871X("CheckPbcGPIO - PBC is pressed\n");
bPbcPressed = _TRUE;
@ -113,8 +109,7 @@ static void dm_CheckPbcGPIO(_adapter *padapter)
#endif
if( _TRUE == bPbcPressed)
{
if ( _TRUE == bPbcPressed) {
// Here we only set bPbcPressed to true
// After trigger PBC, the variable will be set to false
DBG_871X("CheckPbcGPIO - PBC is pressed\n");
@ -145,7 +140,6 @@ dm_InterruptMigration(
BOOLEAN IntMtToSet = _FALSE;
BOOLEAN ACIntToSet = _FALSE;
// Retrieve current interrupt migration and Tx four ACs IMR settings first.
bCurrentIntMt = pHalData->bInterruptMigration;
bCurrentACIntDisable = pHalData->bDisableTxInt;
@ -154,22 +148,21 @@ dm_InterruptMigration(
// <Roger_Notes> Currently we use busy traffic for reference instead of RxIntOK counts to prevent non-linear Rx statistics
// when interrupt migration is set before. 2010.03.05.
//
if(!Adapter->registrypriv.wifi_spec &&
if (!Adapter->registrypriv.wifi_spec &&
(check_fwstate(pmlmepriv, _FW_LINKED)== _TRUE) &&
pmlmepriv->LinkDetectInfo.bHigherBusyTraffic)
{
IntMtToSet = _TRUE;
// To check whether we should disable Tx interrupt or not.
if(pmlmepriv->LinkDetectInfo.bHigherBusyRxTraffic)
if (pmlmepriv->LinkDetectInfo.bHigherBusyRxTraffic)
ACIntToSet = _TRUE;
}
//Update current settings.
if( bCurrentIntMt != IntMtToSet ){
if ( bCurrentIntMt != IntMtToSet ) {
DBG_8192C("%s(): Update interrrupt migration(%d)\n",__FUNCTION__,IntMtToSet);
if(IntMtToSet)
{
if(IntMtToSet) {
//
// <Roger_Notes> Set interrrupt migration timer and corresponging Tx/Rx counter.
// timer 25ns*0xfa0=100us for 0xf packets.
@ -177,9 +170,7 @@ dm_InterruptMigration(
//
rtw_write32(Adapter, REG_INT_MIG, 0xff000fa0);// 0x306:Rx, 0x307:Tx
pHalData->bInterruptMigration = IntMtToSet;
}
else
{
} else {
// Reset all interrupt migration settings.
rtw_write32(Adapter, REG_INT_MIG, 0);
pHalData->bInterruptMigration = IntMtToSet;
@ -232,7 +223,7 @@ dm_InitGPIOSetting(
//============================================================
static void Init_ODM_ComInfo_8814(PADAPTER Adapter)
{
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
u32 SupportAbility = 0;
@ -243,20 +234,20 @@ static void Init_ODM_ComInfo_8814(PADAPTER Adapter)
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_IC_TYPE, ODM_RTL8814A);
fab_ver = ODM_TSMC;
if(IS_A_CUT(pHalData->VersionID))
if (IS_A_CUT(pHalData->VersionID))
cut_ver = ODM_CUT_A;
else if(IS_B_CUT(pHalData->VersionID))
else if (IS_B_CUT(pHalData->VersionID))
cut_ver = ODM_CUT_B;
else if(IS_C_CUT(pHalData->VersionID))
else if (IS_C_CUT(pHalData->VersionID))
cut_ver = ODM_CUT_C;
else if(IS_D_CUT(pHalData->VersionID))
else if (IS_D_CUT(pHalData->VersionID))
cut_ver = ODM_CUT_D;
else if(IS_E_CUT(pHalData->VersionID))
else if (IS_E_CUT(pHalData->VersionID))
cut_ver = ODM_CUT_E;
else
cut_ver = ODM_CUT_A;
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_FAB_VER,fab_ver);
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_FAB_VER,fab_ver);
ODM_CmnInfoInit(pDM_Odm,ODM_CMNINFO_CUT_VER,cut_ver);
ODM_CmnInfoInit(pDM_Odm, ODM_CMNINFO_RF_ANTENNA_TYPE, pHalData->TRxAntDivType);
@ -268,13 +259,13 @@ static void Init_ODM_ComInfo_8814(PADAPTER Adapter)
#else
SupportAbility = ODM_RF_CALIBRATION|
ODM_RF_TX_PWR_TRACK
;
;
/*if(pHalData->AntDivCfg)
SupportAbility |= ODM_BB_ANT_DIV;*/
#endif
#endif
ODM_CmnInfoUpdate(pDM_Odm,ODM_CMNINFO_ABILITY,SupportAbility);
}
static void Update_ODM_ComInfo_8814(PADAPTER Adapter)
@ -301,7 +292,7 @@ static void Update_ODM_ComInfo_8814(PADAPTER Adapter)
SupportAbility |= ODM_BB_ADAPTIVITY;
}
if(pHalData->AntDivCfg)
if (pHalData->AntDivCfg)
SupportAbility |= ODM_BB_ANT_DIV;
#if (MP_DRIVER==1)
@ -372,7 +363,7 @@ rtl8814_HalDmWatchDog(
#ifdef CONFIG_P2P_PS
// Fw is under p2p powersaving mode, driver should stop dynamic mechanism.
// modifed by thomas. 2011.06.11.
if(Adapter->wdinfo.p2p_ps_mode)
if (Adapter->wdinfo.p2p_ps_mode)
bFwPSAwake = _FALSE;
#endif //CONFIG_P2P_PS
@ -381,7 +372,7 @@ rtl8814_HalDmWatchDog(
//
// Calculate Tx/Rx statistics.
//
dm_CheckStatistics(Adapter);
dm_CheckStatistics(Adapter);
rtw_hal_check_rxfifo_full(Adapter);
//
// Dynamically switch RTS/CTS protection.
@ -396,12 +387,11 @@ rtl8814_HalDmWatchDog(
//if(Adapter->HalFunc.TxCheckStuckHandler(Adapter))
// PlatformScheduleWorkItem(&(GET_HAL_DATA(Adapter)->HalResetWorkItem));
#endif
}
//ODM
if (rtw_is_hw_init_completed(Adapter))
{
if (rtw_is_hw_init_completed(Adapter)) {
u8 bLinked=_FALSE;
u8 bsta_state=_FALSE;
u8 bBtDisabled = _TRUE;
@ -410,16 +400,16 @@ rtl8814_HalDmWatchDog(
pHalData->odmpriv.SupportAbility = 0;
#endif
if(rtw_linked_check(Adapter)){
if (rtw_linked_check(Adapter)) {
bLinked = _TRUE;
if (check_fwstate(&Adapter->mlmepriv, WIFI_STATION_STATE))
bsta_state = _TRUE;
}
#ifdef CONFIG_CONCURRENT_MODE
if(pbuddy_adapter && rtw_linked_check(pbuddy_adapter)){
if (pbuddy_adapter && rtw_linked_check(pbuddy_adapter)){
bLinked = _TRUE;
if(pbuddy_adapter && check_fwstate(&pbuddy_adapter->mlmepriv, WIFI_STATION_STATE))
if (pbuddy_adapter && check_fwstate(&pbuddy_adapter->mlmepriv, WIFI_STATION_STATE))
bsta_state = _TRUE;
}
#endif //CONFIG_CONCURRENT_MODE
@ -433,7 +423,7 @@ rtl8814_HalDmWatchDog(
ODM_CmnInfoUpdate(&pHalData->odmpriv, ODM_CMNINFO_BT_ENABLED, ((bBtDisabled == _TRUE)?_FALSE:_TRUE));
ODM_DMWatchdog(&pHalData->odmpriv);
}
skip_dm:
@ -463,7 +453,7 @@ void rtl8814_init_dm_priv(IN PADAPTER Adapter)
}
Init_ODM_ComInfo_8814(Adapter);
ODM_InitAllTimers(podmpriv );
ODM_InitAllTimers(podmpriv );
PHYDM_InitDebugSetting(podmpriv);
pHalData->CurrentTxPwrIdx = 18;
@ -475,7 +465,7 @@ void rtl8814_deinit_dm_priv(IN PADAPTER Adapter)
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
PDM_ODM_T podmpriv = &pHalData->odmpriv;
//_rtw_spinlock_free(&pHalData->odm_stainfo_lock);
ODM_CancelAllTimers(podmpriv);
ODM_CancelAllTimers(podmpriv);
}
@ -486,17 +476,15 @@ void rtl8814_deinit_dm_priv(IN PADAPTER Adapter)
void AntDivCompare8814(PADAPTER Adapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src)
{
//PADAPTER Adapter = pDM_Odm->Adapter ;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
if(0 != pHalData->AntDivCfg )
{
if (0 != pHalData->AntDivCfg ) {
//DBG_8192C("update_network=> orgRSSI(%d)(%d),newRSSI(%d)(%d)\n",dst->Rssi,query_rx_pwr_percentage(dst->Rssi),
// src->Rssi,query_rx_pwr_percentage(src->Rssi));
//select optimum_antenna for before linked =>For antenna diversity
if(dst->Rssi >= src->Rssi )//keep org parameter
{
if (dst->Rssi >= src->Rssi ) { //keep org parameter
src->Rssi = dst->Rssi;
src->PhyInfo.Optimum_antenna = dst->PhyInfo.Optimum_antenna;
src->PhyInfo.Optimum_antenna = dst->PhyInfo.Optimum_antenna;
}
}
}
@ -504,26 +492,24 @@ void AntDivCompare8814(PADAPTER Adapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src)
// Add new function to reset the state of antenna diversity before link.
u8 AntDivBeforeLink8814(PADAPTER Adapter )
{
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
PDM_ODM_T pDM_Odm =&pHalData->odmpriv;
SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
// Condition that does not need to use antenna diversity.
if(pHalData->AntDivCfg==0)
{
if (pHalData->AntDivCfg==0) {
//DBG_8192C("odm_AntDivBeforeLink8192C(): No AntDiv Mechanism.\n");
return _FALSE;
}
if(check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE)
{
if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) {
return _FALSE;
}
if(pDM_SWAT_Table->SWAS_NoLink_State == 0){
if (pDM_SWAT_Table->SWAS_NoLink_State == 0) {
//switch channel
pDM_SWAT_Table->SWAS_NoLink_State = 1;
pDM_SWAT_Table->CurAntenna = (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?AUX_ANT:MAIN_ANT;
@ -532,13 +518,10 @@ u8 AntDivBeforeLink8814(PADAPTER Adapter )
rtw_antenna_select_cmd(Adapter, pDM_SWAT_Table->CurAntenna, _FALSE);
//DBG_8192C("%s change antenna to ANT_( %s ).....\n",__FUNCTION__, (pDM_SWAT_Table->CurAntenna==MAIN_ANT)?"MAIN":"AUX");
return _TRUE;
}
else
{
} else {
pDM_SWAT_Table->SWAS_NoLink_State = 0;
return _FALSE;
}
}
}
#endif //CONFIG_ANTENNA_DIVERSITY

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -42,8 +42,7 @@ PHY_RF6052SetBandwidth8814A(
IN PADAPTER Adapter,
IN CHANNEL_WIDTH Bandwidth) //20M or 40M
{
switch(Bandwidth)
{
switch (Bandwidth) {
case CHANNEL_WIDTH_20:
/*RTW_INFO("PHY_RF6052SetBandwidth8814A(), set 20MHz\n");*/
PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW_Jaguar, BIT11|BIT10, 3);
@ -51,26 +50,26 @@ PHY_RF6052SetBandwidth8814A(
PHY_SetRFReg(Adapter, RF_PATH_C, RF_CHNLBW_Jaguar, BIT11|BIT10, 3);
PHY_SetRFReg(Adapter, RF_PATH_D, RF_CHNLBW_Jaguar, BIT11|BIT10, 3);
break;
case CHANNEL_WIDTH_40:
/*RTW_INFO("PHY_RF6052SetBandwidth8814A(), set 40MHz\n");*/
PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW_Jaguar, BIT11|BIT10, 1);
PHY_SetRFReg(Adapter, RF_PATH_B, RF_CHNLBW_Jaguar, BIT11|BIT10, 1);
PHY_SetRFReg(Adapter, RF_PATH_C, RF_CHNLBW_Jaguar, BIT11|BIT10, 1);
PHY_SetRFReg(Adapter, RF_PATH_D, RF_CHNLBW_Jaguar, BIT11|BIT10, 1);
PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW_Jaguar, BIT11|BIT10, 1);
PHY_SetRFReg(Adapter, RF_PATH_B, RF_CHNLBW_Jaguar, BIT11|BIT10, 1);
PHY_SetRFReg(Adapter, RF_PATH_C, RF_CHNLBW_Jaguar, BIT11|BIT10, 1);
PHY_SetRFReg(Adapter, RF_PATH_D, RF_CHNLBW_Jaguar, BIT11|BIT10, 1);
break;
case CHANNEL_WIDTH_80:
/*RTW_INFO("PHY_RF6052SetBandwidth8814A(), set 80MHz\n");*/
PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW_Jaguar, BIT11|BIT10, 0);
PHY_SetRFReg(Adapter, RF_PATH_B, RF_CHNLBW_Jaguar, BIT11|BIT10, 0);
PHY_SetRFReg(Adapter, RF_PATH_C, RF_CHNLBW_Jaguar, BIT11|BIT10, 0);
PHY_SetRFReg(Adapter, RF_PATH_A, RF_CHNLBW_Jaguar, BIT11|BIT10, 0);
PHY_SetRFReg(Adapter, RF_PATH_B, RF_CHNLBW_Jaguar, BIT11|BIT10, 0);
PHY_SetRFReg(Adapter, RF_PATH_C, RF_CHNLBW_Jaguar, BIT11|BIT10, 0);
PHY_SetRFReg(Adapter, RF_PATH_D, RF_CHNLBW_Jaguar, BIT11|BIT10, 0);
break;
default:
RTW_INFO("PHY_RF6052SetBandwidth8814A(): unknown Bandwidth: %#X\n",Bandwidth );
break;
break;
}
}
@ -101,18 +100,16 @@ phy_RF6052_Config_ParaFile_8814A(
//3// <2> Initialize RF
//3//-----------------------------------------------------------------
//for(eRFPath = RF_PATH_A; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
for(eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++)
{
for (eRFPath = 0; eRFPath <pHalData->NumTotalRFPath; eRFPath++) {
/*----Initialize RF fom connfiguration file----*/
switch(eRFPath)
{
switch (eRFPath) {
case RF_PATH_A:
#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
if (PHY_ConfigRFWithParaFile(Adapter, pszRadioAFile, eRFPath) == _FAIL)
#endif //CONFIG_LOAD_PHY_PARA_FROM_FILE
{
#ifdef CONFIG_EMBEDDED_FWIMG
if(HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
if (HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
rtStatus = _FAIL;
#endif //CONFIG_EMBEDDED_FWIMG
}
@ -123,7 +120,7 @@ phy_RF6052_Config_ParaFile_8814A(
#endif //CONFIG_LOAD_PHY_PARA_FROM_FILE
{
#ifdef CONFIG_EMBEDDED_FWIMG
if(HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
if (HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
rtStatus = _FAIL;
#endif //CONFIG_EMBEDDED_FWIMG
}
@ -134,7 +131,7 @@ phy_RF6052_Config_ParaFile_8814A(
#endif //CONFIG_LOAD_PHY_PARA_FROM_FILE
{
#ifdef CONFIG_EMBEDDED_FWIMG
if(HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
if (HAL_STATUS_FAILURE ==ODM_ConfigRFWithHeaderFile(&pHalData->odmpriv,CONFIG_RF_RADIO, (ODM_RF_RADIO_PATH_E)eRFPath))
rtStatus = _FAIL;
#endif //CONFIG_EMBEDDED_FWIMG
}
@ -154,20 +151,20 @@ phy_RF6052_Config_ParaFile_8814A(
break;
}
if(rtStatus != _SUCCESS){
if (rtStatus != _SUCCESS) {
RTW_INFO("%s():Radio[%d] Fail!!", __FUNCTION__, eRFPath);
goto phy_RF6052_Config_ParaFile_Fail;
}
}
u4RegValue = PHY_QueryRFReg(Adapter, RF_PATH_A, RF_RCK1_Jaguar, bRFRegOffsetMask);
PHY_SetRFReg(Adapter, RF_PATH_B, RF_RCK1_Jaguar, bRFRegOffsetMask, u4RegValue);
PHY_SetRFReg(Adapter, RF_PATH_C, RF_RCK1_Jaguar, bRFRegOffsetMask, u4RegValue);
PHY_SetRFReg(Adapter, RF_PATH_D, RF_RCK1_Jaguar, bRFRegOffsetMask, u4RegValue);
//3 -----------------------------------------------------------------
//3 Configuration of Tx Power Tracking
//3 Configuration of Tx Power Tracking
//3 -----------------------------------------------------------------
#ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE
@ -185,7 +182,6 @@ phy_RF6052_Config_ParaFile_Fail:
return rtStatus;
}
int
PHY_RF6052_Config_8814A(
IN PADAPTER Adapter)
@ -205,6 +201,4 @@ PHY_RF6052_Config_8814A(
}
/* End of HalRf6052.c */

View File

@ -32,8 +32,8 @@ void rtl8814_sreset_xmit_status_check(_adapter *padapter)
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
unsigned int diff_time;
u32 txdma_status;
if( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00){
if ( (txdma_status=rtw_read32(padapter, REG_TXDMA_STATUS)) !=0x00) {
RTW_INFO("%s REG_TXDMA_STATUS:0x%08x\n", __FUNCTION__, txdma_status);
rtw_hal_sreset_reset(padapter);
}
@ -51,7 +51,7 @@ void rtl8814_sreset_xmit_status_check(_adapter *padapter)
if (psrtpriv->last_tx_complete_time == 0) {
psrtpriv->last_tx_complete_time = current_time;
}
else{
else {
diff_time = rtw_get_passing_time_ms(psrtpriv->last_tx_complete_time);
if (diff_time > 4000) {
u32 ability = 0;
@ -84,9 +84,9 @@ void rtl8814_sreset_linked_status_check(_adapter *padapter)
u32 rx_dma_status = 0;
rx_dma_status = rtw_read32(padapter,REG_RXDMA_STATUS);
if(rx_dma_status!= 0x00){
if (rx_dma_status!= 0x00) {
RTW_INFO("%s REG_RXDMA_STATUS:0x%08x\n",__FUNCTION__,rx_dma_status);
}
}
#if 0
u32 regc50,regc58,reg824,reg800;
regc50 = rtw_read32(padapter,0xc50);
@ -111,4 +111,3 @@ void rtl8814_sreset_linked_status_check(_adapter *padapter)
}
}
#endif

View File

@ -28,22 +28,22 @@ void _dbg_dump_tx_info(_adapter *padapter,int frame_tag, u8 *ptxdesc)
u8 bDumpTxDesc = _FALSE;
rtw_hal_get_def_var(padapter, HAL_DEF_DBG_DUMP_TXPKT, &(bDumpTxPkt));
if(bDumpTxPkt ==1){//dump txdesc for data frame
if (bDumpTxPkt ==1) { //dump txdesc for data frame
RTW_INFO("dump tx_desc for data frame\n");
if((frame_tag&0x0f) == DATA_FRAMETAG){
bDumpTxDesc = _TRUE;
if ((frame_tag&0x0f) == DATA_FRAMETAG){
bDumpTxDesc = _TRUE;
}
}
else if(bDumpTxPkt ==2){//dump txdesc for mgnt frame
RTW_INFO("dump tx_desc for mgnt frame\n");
if((frame_tag&0x0f) == MGNT_FRAMETAG){
bDumpTxDesc = _TRUE;
}
}
else if(bDumpTxPkt ==3){//dump early info
}
if(bDumpTxDesc){
else if (bDumpTxPkt ==2) { //dump txdesc for mgnt frame
RTW_INFO("dump tx_desc for mgnt frame\n");
if ((frame_tag&0x0f) == MGNT_FRAMETAG) {
bDumpTxDesc = _TRUE;
}
}
else if (bDumpTxPkt ==3) { //dump early info
}
if (bDumpTxDesc) {
// ptxdesc->txdw4 = cpu_to_le32(0x00001006);//RTS Rate=24M
// ptxdesc->txdw6 = 0x6666f800;
RTW_INFO("=====================================\n");
@ -75,7 +75,7 @@ void _dbg_dump_tx_info(_adapter *padapter,int frame_tag, u8 *ptxdesc)
//#define DBG_EMINFO
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
#define EARLY_MODE_MAX_PKT_NUM 10
#else
#define EARLY_MODE_MAX_PKT_NUM 5
@ -100,65 +100,65 @@ InsertEMContent_8814(
#endif
_rtw_memset(VirtualAddress, 0, EARLY_MODE_INFO_SIZE);
if(pEMInfo->EMPktNum==0)
if (pEMInfo->EMPktNum==0)
return;
#ifdef DBG_EMINFO
{
int i;
RTW_INFO("\n%s ==> pEMInfo->EMPktNum =%d\n",__FUNCTION__,pEMInfo->EMPktNum);
for(i=0;i< EARLY_MODE_MAX_PKT_NUM;i++){
for (i = 0;i< EARLY_MODE_MAX_PKT_NUM;i++) {
RTW_INFO("%s ==> pEMInfo->EMPktLen[%d] =%d\n",__FUNCTION__,i,pEMInfo->EMPktLen[i]);
}
}
#endif
#if RTL8188E_EARLY_MODE_PKT_NUM_10 == 1
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
if(pEMInfo->EMPktNum == 1){
if (pEMInfo->EMPktNum == 1) {
dwtmp = pEMInfo->EMPktLen[0];
}else{
} else {
dwtmp = pEMInfo->EMPktLen[0];
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
dwtmp += pEMInfo->EMPktLen[1];
}
SET_EARLYMODE_LEN0(VirtualAddress, dwtmp);
if(pEMInfo->EMPktNum <= 3){
if (pEMInfo->EMPktNum <= 3) {
dwtmp = pEMInfo->EMPktLen[2];
}else{
} else {
dwtmp = pEMInfo->EMPktLen[2];
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
dwtmp += pEMInfo->EMPktLen[3];
}
SET_EARLYMODE_LEN1(VirtualAddress, dwtmp);
if(pEMInfo->EMPktNum <= 5){
if (pEMInfo->EMPktNum <= 5) {
dwtmp = pEMInfo->EMPktLen[4];
}else{
} else {
dwtmp = pEMInfo->EMPktLen[4];
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
dwtmp += pEMInfo->EMPktLen[5];
}
SET_EARLYMODE_LEN2_1(VirtualAddress, dwtmp&0xF);
SET_EARLYMODE_LEN2_2(VirtualAddress, dwtmp>>4);
if(pEMInfo->EMPktNum <= 7){
if (pEMInfo->EMPktNum <= 7) {
dwtmp = pEMInfo->EMPktLen[6];
}else{
} else {
dwtmp = pEMInfo->EMPktLen[6];
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
dwtmp += pEMInfo->EMPktLen[7];
}
SET_EARLYMODE_LEN3(VirtualAddress, dwtmp);
if(pEMInfo->EMPktNum <= 9){
if (pEMInfo->EMPktNum <= 9) {
dwtmp = pEMInfo->EMPktLen[8];
}else{
} else {
dwtmp = pEMInfo->EMPktLen[8];
dwtmp += ((dwtmp%4)?(4-dwtmp%4):0)+4;
dwtmp += pEMInfo->EMPktLen[9];
}
SET_EARLYMODE_LEN4(VirtualAddress, dwtmp);
#else
#else
SET_EARLYMODE_PKTNUM(VirtualAddress, pEMInfo->EMPktNum);
SET_EARLYMODE_LEN0(VirtualAddress, pEMInfo->EMPktLen[0]);
SET_EARLYMODE_LEN1(VirtualAddress, pEMInfo->EMPktLen[1]);
@ -166,7 +166,7 @@ InsertEMContent_8814(
SET_EARLYMODE_LEN2_2(VirtualAddress, pEMInfo->EMPktLen[2]>>4);
SET_EARLYMODE_LEN3(VirtualAddress, pEMInfo->EMPktLen[3]);
SET_EARLYMODE_LEN4(VirtualAddress, pEMInfo->EMPktLen[4]);
#endif
#endif
//RT_PRINT_DATA(COMP_SEND, DBG_LOUD, "EMHdr:", VirtualAddress, 8);
}
@ -179,72 +179,68 @@ void UpdateEarlyModeInfo8814(struct xmit_priv *pxmitpriv,struct xmit_buf *pxmitb
int index,j;
u16 offset,pktlen;
PTXDESC_8814 ptxdesc;
u8 *pmem,*pEMInfo_mem;
s8 node_num_0=0,node_num_1=0;
struct EMInfo eminfo;
struct agg_pkt_info *paggpkt;
struct xmit_frame *pframe = (struct xmit_frame*)pxmitbuf->priv_data;
pmem= pframe->buf_addr;
#ifdef DBG_EMINFO
struct xmit_frame *pframe = (struct xmit_frame*)pxmitbuf->priv_data;
pmem= pframe->buf_addr;
#ifdef DBG_EMINFO
RTW_INFO("\n%s ==> agg_num:%d\n",__FUNCTION__, pframe->agg_num);
for(index=0;index<pframe->agg_num;index++){
for (index=0;index<pframe->agg_num;index++){
offset = pxmitpriv->agg_pkt[index].offset;
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
RTW_INFO("%s ==> agg_pkt[%d].offset=%d\n",__FUNCTION__,index,offset);
RTW_INFO("%s ==> agg_pkt[%d].pkt_len=%d\n",__FUNCTION__,index,pktlen);
}
#endif
if( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM)
{
if ( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM) {
node_num_0 = pframe->agg_num;
node_num_1= EARLY_MODE_MAX_PKT_NUM-1;
}
for(index=0;index<pframe->agg_num;index++){
for (index=0;index<pframe->agg_num;index++) {
offset = pxmitpriv->agg_pkt[index].offset;
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
pktlen = pxmitpriv->agg_pkt[index].pkt_len;
_rtw_memset(&eminfo,0,sizeof(struct EMInfo));
if( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM){
if(node_num_0 > EARLY_MODE_MAX_PKT_NUM){
if ( pframe->agg_num > EARLY_MODE_MAX_PKT_NUM) {
if (node_num_0 > EARLY_MODE_MAX_PKT_NUM) {
eminfo.EMPktNum = EARLY_MODE_MAX_PKT_NUM;
node_num_0--;
}
else{
} else{
eminfo.EMPktNum = node_num_1;
node_num_1--;
}
node_num_1--;
}
} else {
eminfo.EMPktNum = pframe->agg_num-(index+1);
}
else{
eminfo.EMPktNum = pframe->agg_num-(index+1);
}
for(j=0;j< eminfo.EMPktNum ;j++){
for (j = 0;j< eminfo.EMPktNum ;j++) {
eminfo.EMPktLen[j] = pxmitpriv->agg_pkt[index+1+j].pkt_len+4;// 4 bytes CRC
}
if(pmem){
if(index==0){
if (pmem) {
if (index==0) {
ptxdesc = (PTXDESC_8814)(pmem);
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
}
else{
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
} else{
pmem = pmem + pxmitpriv->agg_pkt[index-1].offset;
ptxdesc = (PTXDESC_8814)(pmem);
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
pEMInfo_mem = ((u8 *)ptxdesc)+TXDESC_SIZE;
}
#ifdef DBG_EMINFO
RTW_INFO("%s ==> desc.pkt_len=%d\n",__FUNCTION__,ptxdesc->pktlen);
#endif
InsertEMContent_8814(&eminfo,pEMInfo_mem);
}
}
}
}
_rtw_memset(pxmitpriv->agg_pkt,0,sizeof(struct agg_pkt_info)*MAX_AGG_PKT_NUM);
}
@ -268,7 +264,7 @@ void rtl8814a_cal_txdesc_chksum(u8 *ptxdesc)
// Clear first
SET_TX_DESC_TX_DESC_CHECKSUM_8814A(ptxdesc, 0);
for(index = 0 ; index < count ; index++){
for (index = 0 ; index < count ; index++) {
checksum = checksum ^ le16_to_cpu(*(usPtr + index));
}
@ -310,53 +306,47 @@ void rtl8814a_fill_fake_txdesc(
}
//Set NAVUSEHDR to prevent Ps-poll AId filed to be changed to error vlaue by Hw.
if (IsPsPoll)
{
SET_TX_DESC_NAV_USE_HDR_8814A(pDesc, 1);
}
else
{
if (IsPsPoll) {
SET_TX_DESC_NAV_USE_HDR_8814A(pDesc, 1);
} else {
SET_TX_DESC_HWSEQ_EN_8814A(pDesc, 1); // Hw set sequence number
}
#if 0 //todo
if(IsBTQosNull)
{
if (IsBTQosNull) {
SET_TX_DESC_BT_INT_8812(pDesc, 1);
}
#endif //0
SET_TX_DESC_USE_RATE_8814A(pDesc, 1);
//8814 no OWN bit?
//SET_TX_DESC_OWN_8812(pDesc, 1);
//
// Encrypt the data frame if under security mode excepct null data. Suggested by CCW.
//
if (_TRUE ==bDataFrame)
{
if (_TRUE ==bDataFrame) {
u32 EncAlg;
EncAlg = padapter->securitypriv.dot11PrivacyAlgrthm;
switch (EncAlg)
{
switch (EncAlg) {
case _NO_PRIVACY_:
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x0);
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x0);
break;
case _WEP40_:
case _WEP104_:
case _TKIP_:
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x1);
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x1);
break;
case _SMS4_:
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x2);
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x2);
break;
case _AES_:
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x3);
break;
default:
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x0);
break;
SET_TX_DESC_SEC_TYPE_8814A(pDesc, 0x0);
break;
}
}
SET_TX_DESC_TX_RATE_8814A(pDesc, MRateToHwRate(pmlmeext->tx_rate));
@ -370,15 +360,13 @@ void rtl8814a_fill_fake_txdesc(
void rtl8814a_fill_txdesc_sectype(struct pkt_attrib *pattrib, u8 *ptxdesc)
{
if ((pattrib->encrypt > 0) && !pattrib->bswenc)
{
switch (pattrib->encrypt)
{
if ((pattrib->encrypt > 0) && !pattrib->bswenc) {
switch (pattrib->encrypt) {
//SEC_TYPE : 0:NO_ENC,1:WEP40/TKIP,2:WAPI,3:AES
case _WEP40_:
case _WEP104_:
case _TKIP_:
case _TKIP_WTMIC_:
case _TKIP_WTMIC_:
SET_TX_DESC_SEC_TYPE_8814A(ptxdesc, 0x1);
break;
#ifdef CONFIG_WAPI_SUPPORT
@ -393,9 +381,9 @@ void rtl8814a_fill_txdesc_sectype(struct pkt_attrib *pattrib, u8 *ptxdesc)
default:
SET_TX_DESC_SEC_TYPE_8814A(ptxdesc, 0x0);
break;
}
}
}
@ -405,12 +393,11 @@ void rtl8814a_fill_txdesc_vcs(PADAPTER padapter, struct pkt_attrib *pattrib, u8
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
//RTW_INFO("vcs_mode=%d\n", pattrib->vcs_mode);
//RTW_INFO("vcs_mode=%d\n", pattrib->vcs_mode);
if (pattrib->vcs_mode) {
switch(pattrib->vcs_mode)
{
switch (pattrib->vcs_mode) {
case RTS_CTS:
SET_TX_DESC_RTS_ENABLE_8814A(ptxdesc, 1);
break;
@ -428,12 +415,12 @@ void rtl8814a_fill_txdesc_vcs(PADAPTER padapter, struct pkt_attrib *pattrib, u8
SET_TX_DESC_RTS_RATE_8814A(ptxdesc, 0x8);//RTS Rate=24M
SET_TX_DESC_RTS_RATE_FB_LIMIT_8814A(ptxdesc, 0xf);
}
}
u8
u8
BWMapping_8814(
IN PADAPTER Adapter,
IN struct pkt_attrib *pattrib
@ -444,18 +431,16 @@ BWMapping_8814(
//RTW_INFO("BWMapping pHalData->CurrentChannelBW %d, pattrib->bwmode %d \n",pHalData->CurrentChannelBW,pattrib->bwmode);
if(pHalData->CurrentChannelBW== CHANNEL_WIDTH_80)
{
if(pattrib->bwmode == CHANNEL_WIDTH_80)
if (pHalData->CurrentChannelBW== CHANNEL_WIDTH_80) {
if (pattrib->bwmode == CHANNEL_WIDTH_80)
BWSettingOfDesc= 2;
else if(pattrib->bwmode == CHANNEL_WIDTH_40)
else if (pattrib->bwmode == CHANNEL_WIDTH_40)
BWSettingOfDesc = 1;
else
BWSettingOfDesc = 0;
}
else if(pHalData->CurrentChannelBW== CHANNEL_WIDTH_40)
{
if((pattrib->bwmode == CHANNEL_WIDTH_40) || (pattrib->bwmode == CHANNEL_WIDTH_80))
else if(pHalData->CurrentChannelBW== CHANNEL_WIDTH_40) {
if ((pattrib->bwmode == CHANNEL_WIDTH_40) || (pattrib->bwmode == CHANNEL_WIDTH_80))
BWSettingOfDesc = 1;
else
BWSettingOfDesc = 0;
@ -466,7 +451,7 @@ BWMapping_8814(
return BWSettingOfDesc;
}
u8
u8
SCMapping_8814(
IN PADAPTER Adapter,
IN struct pkt_attrib *pattrib
@ -475,63 +460,48 @@ SCMapping_8814(
u8 SCSettingOfDesc = 0;
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
//RTW_INFO("SCMapping: pHalData->CurrentChannelBW %d, pHalData->nCur80MhzPrimeSC %d, pHalData->nCur40MhzPrimeSC %d \n",pHalData->CurrentChannelBW,pHalData->nCur80MhzPrimeSC,pHalData->nCur40MhzPrimeSC);
if(pHalData->CurrentChannelBW == CHANNEL_WIDTH_80)
{
if(pattrib->bwmode == CHANNEL_WIDTH_80)
{
if (pHalData->CurrentChannelBW == CHANNEL_WIDTH_80) {
if (pattrib->bwmode == CHANNEL_WIDTH_80) {
SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE;
}
else if(pattrib->bwmode == CHANNEL_WIDTH_40)
{
if(pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
else if (pattrib->bwmode == CHANNEL_WIDTH_40) {
if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
SCSettingOfDesc = VHT_DATA_SC_40_LOWER_OF_80MHZ;
else if(pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
else if (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
SCSettingOfDesc = VHT_DATA_SC_40_UPPER_OF_80MHZ;
else
RTW_INFO("SCMapping: DONOT CARE Mode Setting\n");
}
else
{
if((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER))
} else {
if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER))
SCSettingOfDesc = VHT_DATA_SC_20_LOWEST_OF_80MHZ;
else if((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER))
else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER))
SCSettingOfDesc = VHT_DATA_SC_20_LOWER_OF_80MHZ;
else if((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER))
else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER))
SCSettingOfDesc = VHT_DATA_SC_20_UPPER_OF_80MHZ;
else if((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER))
else if ((pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) && (pHalData->nCur80MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER))
SCSettingOfDesc = VHT_DATA_SC_20_UPPERST_OF_80MHZ;
else
RTW_INFO("SCMapping: DONOT CARE Mode Setting\n");
}
}
else if(pHalData->CurrentChannelBW== CHANNEL_WIDTH_40)
{
else if (pHalData->CurrentChannelBW== CHANNEL_WIDTH_40) {
//RTW_INFO("SCMapping: HT Case: pHalData->CurrentChannelBW %d, pHalData->nCur40MhzPrimeSC %d \n",pHalData->CurrentChannelBW,pHalData->nCur40MhzPrimeSC);
if(pattrib->bwmode == CHANNEL_WIDTH_40)
{
if (pattrib->bwmode == CHANNEL_WIDTH_40) {
SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE;
}
else if(pattrib->bwmode == CHANNEL_WIDTH_20)
{
if(pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER)
{
else if (pattrib->bwmode == CHANNEL_WIDTH_20) {
if (pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_UPPER) {
SCSettingOfDesc = VHT_DATA_SC_20_UPPER_OF_80MHZ;
}
else if(pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER)
{
else if(pHalData->nCur40MhzPrimeSC == HAL_PRIME_CHNL_OFFSET_LOWER) {
SCSettingOfDesc = VHT_DATA_SC_20_LOWER_OF_80MHZ;
}
else
{
} else {
SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE;
}
}
}
else
{
} else {
SCSettingOfDesc = VHT_DATA_SC_DONOT_CARE;
}
@ -543,13 +513,10 @@ void rtl8814a_fill_txdesc_phy(PADAPTER padapter, struct pkt_attrib *pattrib, u8
{
//RTW_INFO("bwmode=%d, ch_off=%d\n", pattrib->bwmode, pattrib->ch_offset);
if(pattrib->ht_en)
{
if (pattrib->ht_en) {
// Set Bandwidth and sub-channel settings.
SET_TX_DESC_DATA_BW_8814A(ptxdesc, BWMapping_8814(padapter,pattrib));
SET_TX_DESC_DATA_SC_8814A(ptxdesc, SCMapping_8814(padapter,pattrib));
}
}

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
@ -33,7 +33,7 @@
//================================================================================
// LED_819xUsb routines.
// LED_819xUsb routines.
//================================================================================
//
@ -42,7 +42,7 @@
//
static void
SwLedOn_8814AU(
PADAPTER padapter,
PADAPTER padapter,
PLED_USB pLed
)
{
@ -73,7 +73,7 @@ SwLedOn_8814AU(
//
static void
SwLedOff_8814AU(
PADAPTER padapter,
PADAPTER padapter,
PLED_USB pLed
)
{
@ -144,4 +144,3 @@ rtl8814au_DeInitSwLeds(
DeInitLed( &(ledpriv->SwLed1) );
DeInitLed( &(ledpriv->SwLed2) );
}

View File

@ -1,7 +1,7 @@
/******************************************************************************
*
* Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
@ -31,4 +31,3 @@ void rtl8814au_free_recv_priv(_adapter *padapter)
{
usb_free_recv_priv(padapter, INTERRUPT_MSG_FORMAT_LEN);
}

View File

@ -60,10 +60,8 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
u8 DriverFixedRate = 0x0;
#ifndef CONFIG_USE_USB_BUFFER_ALLOC_TX
if (padapter->registrypriv.mp_mode == 0)
{
if((PACKET_OFFSET_SZ != 0) && (!bagg_pkt) &&(rtw_usb_bulk_size_boundary(padapter,TXDESC_SIZE+sz)==_FALSE))
{
if (padapter->registrypriv.mp_mode == 0) {
if((PACKET_OFFSET_SZ != 0) && (!bagg_pkt) &&(rtw_usb_bulk_size_boundary(padapter,TXDESC_SIZE+sz)==_FALSE)) {
ptxdesc = (pmem+PACKET_OFFSET_SZ);
//RTW_INFO("==> non-agg-pkt,shift pointer...\n");
pull = 1;
@ -84,7 +82,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
offset = TXDESC_SIZE + OFFSET_SZ;
#ifdef CONFIG_TX_EARLY_MODE
if(bagg_pkt){
if (bagg_pkt) {
offset += EARLY_MODE_INFO_SIZE ;//0x28
}
#endif
@ -121,7 +119,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
if (!pattrib->qos_en) {
/* HW sequence, to fix to use 0 queue. todo: 4AC packets to use auto queue select */
if(pattrib->sw_seq == _FALSE)
if (pattrib->sw_seq == _FALSE)
SET_TX_DESC_HWSEQ_EN_8814A(ptxdesc, 1); // Hw set sequence number
else
SET_TX_DESC_SEQ_8814A(ptxdesc, pattrib->seqnum);
@ -164,8 +162,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
SET_TX_DESC_MAX_AGG_NUM_8814A(ptxdesc, 0x1f);
// Set A-MPDU aggregation.
SET_TX_DESC_AMPDU_DENSITY_8814A(ptxdesc, pattrib->ampdu_spacing);
}
else {
} else {
SET_TX_DESC_BK_8814A(ptxdesc, 1);
}
@ -173,12 +170,9 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
//DATA Rate FB LMT
//SET_TX_DESC_DATA_RATE_FB_LIMIT_8814A(ptxdesc, 0x1f);
if(pHalData->CurrentBandType == BAND_ON_5G)
{
if (pHalData->CurrentBandType == BAND_ON_5G) {
SET_TX_DESC_DATA_RATE_FB_LIMIT_8814A(ptxdesc, 4);
}
else
{
} else {
SET_TX_DESC_DATA_RATE_FB_LIMIT_8814A(ptxdesc, 0);
}
@ -211,9 +205,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
//work arond before fixing RA
//SET_TX_DESC_USE_RATE_8814A(ptxdesc, 1);
//SET_TX_DESC_TX_RATE_8814A(ptxdesc, 0x10);
}
else
{
} else {
// EAP data packet and ARP packet and DHCP.
// Use the 1M data rate to send the EAP/ARP packet.
// This will maybe make the handshake smooth.
@ -231,15 +223,14 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
}
}
else if((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG)
{
else if ((pxmitframe->frame_tag&0x0f)== MGNT_FRAMETAG) {
//RTW_INFO("pxmitframe->frame_tag == MGNT_FRAMETAG\n");
SET_TX_DESC_USE_RATE_8814A(ptxdesc, 1);
DriverFixedRate = 0x01;
#ifdef CONFIG_INTEL_PROXIM
if((padapter->proximity.proxim_on==_TRUE)&&(pattrib->intel_proxim==_TRUE)){
if ((padapter->proximity.proxim_on==_TRUE)&&(pattrib->intel_proxim==_TRUE)){
RTW_INFO("\n %s pattrib->rate=%d\n",__FUNCTION__,pattrib->rate);
SET_TX_DESC_TX_RATE_8814A(ptxdesc, pattrib->rate);
}
@ -250,7 +241,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
}
// VHT NDPA or HT NDPA Packet for Beamformer.
if((pattrib->subtype == WIFI_NDPA) ||
if ((pattrib->subtype == WIFI_NDPA) ||
((pattrib->subtype == WIFI_ACTION_NOACK) && (pattrib->order == 1)))
{
SET_TX_DESC_NAV_USE_HDR_8814A(ptxdesc, 1);
@ -270,9 +261,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
{
SET_TX_DESC_NDPA_8814A(ptxdesc, 1);
}
}
else
{
} else {
SET_TX_DESC_RETRY_LIMIT_ENABLE_8814A(ptxdesc, 1);
if (pattrib->retry_ctrl == _TRUE) {
SET_TX_DESC_DATA_RETRY_LIMIT_8814A(ptxdesc, 6);
@ -291,8 +280,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
}
#endif //CONFIG_XMIT_ACK
}
else if((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG)
{
else if ((pxmitframe->frame_tag&0x0f) == TXAGG_FRAMETAG) {
RTW_INFO("pxmitframe->frame_tag == TXAGG_FRAMETAG\n");
}
#ifdef CONFIG_MP_INCLUDED
@ -318,14 +306,14 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
SET_TX_DESC_PAID_8814A(ptxdesc, pattrib->txbf_p_aid);
/* injected frame */
if(pattrib->inject == 0xa5) {
if (pattrib->inject == 0xa5) {
SET_TX_DESC_RETRY_LIMIT_ENABLE_8814A(ptxdesc, 1);
if (pattrib->retry_ctrl == _TRUE) {
SET_TX_DESC_DATA_RETRY_LIMIT_8814A(ptxdesc, 6);
} else {
SET_TX_DESC_DATA_RETRY_LIMIT_8814A(ptxdesc, 0);
}
if(pattrib->sgi == _TRUE) {
if (pattrib->sgi == _TRUE) {
SET_TX_DESC_DATA_SHORT_8814A(ptxdesc, 1);
} else {
SET_TX_DESC_DATA_SHORT_8814A(ptxdesc, 0);
@ -383,7 +371,7 @@ s32 rtl8814au_xmit_buf_handler(PADAPTER padapter)
return _FAIL;
}
if(check_pending_xmitbuf(pxmitpriv) == _FALSE)
if (check_pending_xmitbuf(pxmitpriv) == _FALSE)
return _SUCCESS;
#ifdef CONFIG_LPS_LCLK
@ -438,36 +426,29 @@ static s32 rtw_dump_xframe(_adapter *padapter, struct xmit_frame *pxmitframe)
//RTW_INFO("rtw_dump_xframe()\n");
for (t = 0; t < pattrib->nr_frags; t++)
{
for (t = 0; t < pattrib->nr_frags; t++) {
if (inner_ret != _SUCCESS && ret == _SUCCESS)
ret = _FAIL;
if (t != (pattrib->nr_frags - 1))
{
if (t != (pattrib->nr_frags - 1)) {
RT_TRACE(_module_rtl871x_xmit_c_,_drv_err_,("pattrib->nr_frags=%d\n", pattrib->nr_frags));
sz = pxmitpriv->frag_len;
sz = sz - 4 - (psecuritypriv->sw_encrypt ? 0 : pattrib->icv_len);
}
else //no frag
{
} else { //no frag
sz = pattrib->last_txcmdsz;
}
pull = update_txdesc(pxmitframe, mem_addr, sz, _FALSE);
if(pull)
{
if (pull) {
mem_addr += PACKET_OFFSET_SZ; //pull txdesc head
//pxmitbuf ->pbuf = mem_addr;
pxmitframe->buf_addr = mem_addr;
w_sz = sz + TXDESC_SIZE;
}
else
{
} else {
w_sz = sz + TXDESC_SIZE + PACKET_OFFSET_SZ;
}
@ -512,7 +493,7 @@ static u32 xmitframe_need_length(struct xmit_frame *pxmitframe)
pattrib->pktlen +
((pattrib->bswenc) ? pattrib->icv_len : 0);
if(pattrib->encrypt ==_TKIP_)
if (pattrib->encrypt ==_TKIP_)
len += 8;
return len;
@ -679,12 +660,11 @@ s32 rtl8814au_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
xmitframe_phead = get_list_head(&ptxservq->sta_pending);
xmitframe_plist = get_next(xmitframe_phead);
while (rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist) == _FALSE)
{
while (rtw_end_of_queue_search(xmitframe_phead, xmitframe_plist) == _FALSE) {
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
xmitframe_plist = get_next(xmitframe_plist);
if(_FAIL == rtw_hal_busagg_qsel_check(padapter,pfirstframe->attrib.qsel,pxmitframe->attrib.qsel))
if (_FAIL == rtw_hal_busagg_qsel_check(padapter,pfirstframe->attrib.qsel,pxmitframe->attrib.qsel))
break;
pxmitframe->agg_num = 0; // not first frame of aggregation
@ -842,11 +822,9 @@ s32 rtl8814au_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("xmitframe_complete()\n"));
if(pxmitbuf==NULL)
{
if (pxmitbuf==NULL) {
pxmitbuf = rtw_alloc_xmitbuf(pxmitpriv);
if(!pxmitbuf)
{
if (!pxmitbuf) {
return _FALSE;
}
}
@ -855,48 +833,40 @@ s32 rtl8814au_xmitframe_complete(_adapter *padapter, struct xmit_priv *pxmitpriv
{
pxmitframe = rtw_dequeue_xframe(pxmitpriv, phwxmits, hwentry);
if(pxmitframe)
{
if (pxmitframe) {
pxmitframe->pxmitbuf = pxmitbuf;
pxmitframe->buf_addr = pxmitbuf->pbuf;
pxmitbuf->priv_data = pxmitframe;
if((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG)
{
if(pxmitframe->attrib.priority<=15)//TID0~15
{
if ((pxmitframe->frame_tag&0x0f) == DATA_FRAMETAG) {
if (pxmitframe->attrib.priority<=15) { //TID0~15
res = rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
}
//RTW_INFO("==> pxmitframe->attrib.priority:%d\n",pxmitframe->attrib.priority);
rtw_os_xmit_complete(padapter, pxmitframe);//always return ndis_packet after rtw_xmitframe_coalesce
rtw_os_xmit_complete(padapter, pxmitframe);//always return ndis_packet after rtw_xmitframe_coalesce
}
RT_TRACE(_module_rtl871x_xmit_c_,_drv_info_,("xmitframe_complete(): rtw_dump_xframe\n"));
if(res == _SUCCESS)
{
if (res == _SUCCESS) {
rtw_dump_xframe(padapter, pxmitframe);
}
else
{
} else {
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
rtw_free_xmitframe(pxmitpriv, pxmitframe);
}
xcnt++;
}
else
{
} else {
rtw_free_xmitbuf(pxmitpriv, pxmitbuf);
return _FALSE;
}
break;
}while(0/*xcnt < (NR_XMITFRAME >> 3)*/);
} while (0/*xcnt < (NR_XMITFRAME >> 3)*/);
return _TRUE;
@ -911,8 +881,7 @@ static s32 xmitframe_direct(_adapter *padapter, struct xmit_frame *pxmitframe)
res = rtw_xmitframe_coalesce(padapter, pxmitframe->pkt, pxmitframe);
if (res == _SUCCESS) {
rtw_dump_xframe(padapter, pxmitframe);
}
else{
} else {
RTW_INFO("==> %s xmitframe_coalsece failed\n",__FUNCTION__);
}
@ -936,8 +905,7 @@ static s32 pre_xmitframe(_adapter *padapter, struct xmit_frame *pxmitframe)
_enter_critical_bh(&pxmitpriv->lock, &irqL);
if (rtw_txframes_sta_ac_pending(padapter, pattrib) > 0)
{
if (rtw_txframes_sta_ac_pending(padapter, pattrib) > 0) {
//RTW_INFO("enqueue AC(%d)\n",pattrib->priority);
goto enqueue;
}
@ -1000,14 +968,11 @@ s32 rtl8814au_hal_xmitframe_enqueue(_adapter *padapter, struct xmit_frame *pxmi
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
s32 err;
if ((err=rtw_xmitframe_enqueue(padapter, pxmitframe)) != _SUCCESS)
{
if ((err=rtw_xmitframe_enqueue(padapter, pxmitframe)) != _SUCCESS) {
rtw_free_xmitframe(pxmitpriv, pxmitframe);
pxmitpriv->tx_drop++;
}
else
{
} else {
#ifdef PLATFORM_LINUX
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
#endif
@ -1060,7 +1025,7 @@ s32 rtl8814au_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
pxmit_skb = rtw_skb_alloc(len + TXDESC_SIZE);
if(!pxmit_skb)
if (!pxmit_skb)
goto _exit;
pxmitbuf = pxmit_skb->data;
@ -1079,8 +1044,7 @@ s32 rtl8814au_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt)
ptxdesc->txdw0 |= cpu_to_le32(((TXDESC_SIZE+OFFSET_SZ)<<OFFSET_SHT)&0x00ff0000);//default = 32 bytes for TX Desc
ptxdesc->txdw0 |= cpu_to_le32(OWN | FSG | LSG);
if(bmcst)
{
if (bmcst) {
ptxdesc->txdw0 |= cpu_to_le32(BIT(24));
}

View File

@ -796,12 +796,15 @@ check_bss:
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) || defined(COMPAT_KERNEL_RELEASE)
RTW_INFO("pwdev->sme_state(b)=%d\n", pwdev->sme_state);
#endif
if (NULL != pmlmepriv->assoc_req && NULL != pmlmepriv->assoc_rsp)
cfg80211_connect_result(padapter->pnetdev, cur_network->network.MacAddress
, pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2
, pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2
, pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6
, pmlmepriv->assoc_rsp_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 6
, WLAN_STATUS_SUCCESS, GFP_ATOMIC);
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) || defined(COMPAT_KERNEL_RELEASE)
RTW_INFO("pwdev->sme_state(a)=%d\n", pwdev->sme_state);
#endif