net: wireless: rockchip_wlan: update rtl8189es wifi driver to version v4.3.18.4_22798.20170620
Change-Id: I257bf2273e34ea9fcc5e1f4199abed892bc1c0d4 Signed-off-by: huweiguo <hwg@rock-chips.com>
This commit is contained in:
parent
235e4db801
commit
32d2c0fd14
455 changed files with 130149 additions and 62129 deletions
|
|
@ -19,6 +19,7 @@ menuconfig RTL_WIRELESS_SOLUTION
|
|||
|
||||
source "drivers/net/wireless/rockchip_wlan/rtl8188eu/Kconfig"
|
||||
source "drivers/net/wireless/rockchip_wlan/rtl8188fu/Kconfig"
|
||||
source "drivers/net/wireless/rockchip_wlan/rtl8189es/Kconfig"
|
||||
source "drivers/net/wireless/rockchip_wlan/rtl8723cs/Kconfig"
|
||||
source "drivers/net/wireless/rockchip_wlan/rtl8822be/Kconfig"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
obj-$(CONFIG_AP6XXX) += rkwifi/
|
||||
obj-$(CONFIG_RTL8188EU) += rtl8188eu/
|
||||
obj-$(CONFIG_RTL8188FU) += rtl8188fu/
|
||||
obj-$(CONFIG_RTL8189ES) += rtl8189es/
|
||||
obj-$(CONFIG_RTL8723CS) += rtl8723cs/
|
||||
obj-$(CONFIG_RTL8822BE) += rtl8822be/
|
||||
obj-$(CONFIG_WL_ROCKCHIP) += wifi_sys/rkwifi_sys_iface.o
|
||||
|
|
|
|||
11
drivers/net/wireless/rockchip_wlan/rtl8189es/Kconfig
Executable file → Normal file
11
drivers/net/wireless/rockchip_wlan/rtl8189es/Kconfig
Executable file → Normal file
|
|
@ -1,8 +1,5 @@
|
|||
config RTL8189ES
|
||||
tristate "Realtek 8189ES/ETV SDIO WiFi Support"
|
||||
depends on MMC
|
||||
select WIRELESS_EXT
|
||||
select WEXT_PRIV
|
||||
select IEEE80211
|
||||
---help---
|
||||
Help message of RTL8189ETV & RTL8189ES
|
||||
tristate "Realtek 8189E SDIO WiFi"
|
||||
depends on USB
|
||||
---help---
|
||||
Help message of RTL8189ES
|
||||
|
|
|
|||
760
drivers/net/wireless/rockchip_wlan/rtl8189es/Makefile
Executable file → Normal file
760
drivers/net/wireless/rockchip_wlan/rtl8189es/Makefile
Executable file → Normal file
File diff suppressed because it is too large
Load diff
0
drivers/net/wireless/rockchip_wlan/rtl8189es/clean
Executable file → Normal file
0
drivers/net/wireless/rockchip_wlan/rtl8189es/clean
Executable file → Normal file
505
drivers/net/wireless/rockchip_wlan/rtl8189es/core/efuse/rtw_efuse.c
Executable file → Normal file
505
drivers/net/wireless/rockchip_wlan/rtl8189es/core/efuse/rtw_efuse.c
Executable file → Normal file
|
|
@ -22,6 +22,7 @@
|
|||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
#include "../hal/efuse/efuse_mask.h"
|
||||
|
||||
/*------------------------Define local variable------------------------------*/
|
||||
u8 fakeEfuseBank=0;
|
||||
|
|
@ -39,6 +40,8 @@ u32 fakeBTEfuseUsedBytes=0;
|
|||
u8 fakeBTEfuseContent[EFUSE_MAX_BT_BANK][EFUSE_MAX_HW_SIZE];
|
||||
u8 fakeBTEfuseInitMap[EFUSE_BT_MAX_MAP_LEN]={0};
|
||||
u8 fakeBTEfuseModifiedMap[EFUSE_BT_MAX_MAP_LEN]={0};
|
||||
|
||||
u8 maskfileBuffer[32];
|
||||
/*------------------------Define local variable------------------------------*/
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
@ -433,7 +436,8 @@ efuse_OneByteRead(
|
|||
u32 tmpidx = 0;
|
||||
u8 bResult;
|
||||
u8 readbyte;
|
||||
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
//DBG_871X("===> EFUSE_OneByteRead(), addr = %x\n", addr);
|
||||
//DBG_871X("===> EFUSE_OneByteRead() start, 0x34 = 0x%X\n", rtw_read32(pAdapter, EFUSE_TEST));
|
||||
|
||||
|
|
@ -442,9 +446,11 @@ efuse_OneByteRead(
|
|||
bResult = Efuse_Read1ByteFromFakeContent(pAdapter, addr, data);
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
||||
if( IS_HARDWARE_TYPE_8723B(pAdapter) ||
|
||||
(IS_HARDWARE_TYPE_8192E(pAdapter) && IS_VENDOR_8192E_B_CUT(pAdapter)))
|
||||
(IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) ||
|
||||
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) || (IS_CHIP_VENDOR_SMIC(pHalData->VersionID))
|
||||
)
|
||||
{
|
||||
// <20130121, Kordan> For SMIC EFUSE specificatoin.
|
||||
//0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8])
|
||||
|
|
@ -495,7 +501,8 @@ efuse_OneByteWrite(
|
|||
u8 tmpidx = 0;
|
||||
u8 bResult=_FALSE;
|
||||
u32 efuseValue = 0;
|
||||
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
//DBG_871X("===> EFUSE_OneByteWrite(), addr = %x data=%x\n", addr, data);
|
||||
//DBG_871X("===> EFUSE_OneByteWrite() start, 0x34 = 0x%X\n", rtw_read32(pAdapter, EFUSE_TEST));
|
||||
|
||||
|
|
@ -505,6 +512,7 @@ efuse_OneByteWrite(
|
|||
return bResult;
|
||||
}
|
||||
|
||||
Efuse_PowerSwitch(pAdapter, _TRUE, _TRUE);
|
||||
|
||||
// -----------------e-fuse reg ctrl ---------------------------------
|
||||
//address
|
||||
|
|
@ -515,10 +523,11 @@ efuse_OneByteWrite(
|
|||
efuseValue &= ~(0x3FFFF);
|
||||
efuseValue |= ((addr<<8 | data) & 0x3FFFF);
|
||||
|
||||
|
||||
// <20130227, Kordan> 8192E MP chip A-cut had better not set 0x34[11] until B-Cut.
|
||||
if (IS_HARDWARE_TYPE_8723B(pAdapter)||(IS_HARDWARE_TYPE_8192E(pAdapter) && IS_VENDOR_8192E_B_CUT(pAdapter)))
|
||||
{
|
||||
if ( IS_HARDWARE_TYPE_8723B(pAdapter) ||
|
||||
(IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) ||
|
||||
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) || (IS_CHIP_VENDOR_SMIC(pHalData->VersionID))
|
||||
) {
|
||||
// <20130121, Kordan> For SMIC EFUSE specificatoin.
|
||||
//0x34[11]: SW force PGMEN input of efuse to high. (for the bank selected by 0x34[9:8])
|
||||
//PHY_SetMacReg(pAdapter, 0x34, BIT11, 1);
|
||||
|
|
@ -548,11 +557,15 @@ efuse_OneByteWrite(
|
|||
}
|
||||
|
||||
// disable Efuse program enable
|
||||
if (IS_HARDWARE_TYPE_8723B(pAdapter))
|
||||
{
|
||||
if ( IS_HARDWARE_TYPE_8723B(pAdapter) ||
|
||||
(IS_HARDWARE_TYPE_8192E(pAdapter) && (!IS_A_CUT(pHalData->VersionID))) ||
|
||||
(IS_VENDOR_8188E_I_CUT_SERIES(pAdapter)) || (IS_CHIP_VENDOR_SMIC(pHalData->VersionID))
|
||||
) {
|
||||
PHY_SetMacReg(pAdapter, EFUSE_TEST, BIT(11), 0);
|
||||
}
|
||||
|
||||
Efuse_PowerSwitch(pAdapter, _TRUE, _FALSE);
|
||||
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
|
@ -711,6 +724,8 @@ u8 rtw_efuse_access(PADAPTER padapter, u8 bWrite, u16 start_addr, u16 cnts, u8 *
|
|||
u16 efuse_GetMaxSize(PADAPTER padapter)
|
||||
{
|
||||
u16 max_size;
|
||||
|
||||
max_size = 0;
|
||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI , TYPE_AVAILABLE_EFUSE_BYTES_TOTAL, (PVOID)&max_size, _FALSE);
|
||||
return max_size;
|
||||
}
|
||||
|
|
@ -759,10 +774,165 @@ u8 rtw_BT_efuse_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
BOOLEAN rtw_file_efuse_IsMasked(
|
||||
PADAPTER pAdapter,
|
||||
u16 Offset
|
||||
)
|
||||
{
|
||||
int r = Offset/16;
|
||||
int c = (Offset%16) / 2;
|
||||
int result = 0;
|
||||
|
||||
if(pAdapter->registrypriv.boffefusemask)
|
||||
return FALSE;
|
||||
|
||||
//DBG_871X(" %s ,Offset=%x r= %d , c=%d , maskfileBuffer[r]= %x \n",__func__,Offset,r,c,maskfileBuffer[r]);
|
||||
if (c < 4) // Upper double word
|
||||
result = (maskfileBuffer[r] & (0x10 << c));
|
||||
else
|
||||
result = (maskfileBuffer[r] & (0x01 << (c-4)));
|
||||
|
||||
return (result > 0) ? 0 : 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
u8 rtw_efuse_file_read(PADAPTER padapter,u8 *filepatch,u8 *buf,u32 len)
|
||||
{
|
||||
char *ptmp;
|
||||
char *ptmpbuf=NULL;
|
||||
u32 rtStatus;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
ptmpbuf = rtw_zmalloc(2048);
|
||||
|
||||
if (ptmpbuf == NULL)
|
||||
return _FALSE;
|
||||
|
||||
_rtw_memset(ptmpbuf,'\0',2048);
|
||||
|
||||
rtStatus = rtw_retrieve_from_file(filepatch, ptmpbuf, 2048);
|
||||
|
||||
if( rtStatus > 100 )
|
||||
{
|
||||
u32 i,j;
|
||||
for(i=0,j=0;j<len;i+=2,j++)
|
||||
{
|
||||
if (( ptmpbuf[i] == ' ' ) && (ptmpbuf[i+1] != '\n' && ptmpbuf[i+1] != '\0')) {
|
||||
i++;
|
||||
}
|
||||
if( (ptmpbuf[i+1] != '\n' && ptmpbuf[i+1] != '\0'))
|
||||
{
|
||||
buf[j] = simple_strtoul(&ptmpbuf[i],&ptmp, 16);
|
||||
DBG_871X(" i=%d,j=%d, %x \n",i,j,buf[j]);
|
||||
|
||||
} else {
|
||||
j--;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
DBG_871X(" %s ,filepatch %s , FAIL %d\n", __func__, filepatch, rtStatus);
|
||||
return _FALSE;
|
||||
}
|
||||
rtw_mfree(ptmpbuf, 2048);
|
||||
DBG_871X(" %s ,filepatch %s , done %d\n", __func__, filepatch, rtStatus);
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN
|
||||
efuse_IsMasked(
|
||||
PADAPTER pAdapter,
|
||||
u16 Offset
|
||||
)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
|
||||
//if (bEfuseMaskOFF(pAdapter))
|
||||
if(pAdapter->registrypriv.boffefusemask)
|
||||
return FALSE;
|
||||
|
||||
#if DEV_BUS_TYPE == RT_USB_INTERFACE
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return (IS_MASKED(8188E,_MUSB,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8812A)
|
||||
if (IS_HARDWARE_TYPE_8812(pAdapter))
|
||||
return (IS_MASKED(8812A,_MUSB,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8821A)
|
||||
//if (IS_HARDWARE_TYPE_8811AU(pAdapter))
|
||||
// return (IS_MASKED(8811A,_MUSB,Offset)) ? TRUE : FALSE;
|
||||
if (IS_HARDWARE_TYPE_8821(pAdapter))
|
||||
return (IS_MASKED(8821A,_MUSB,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192E)
|
||||
if (IS_HARDWARE_TYPE_8192E(pAdapter))
|
||||
return (IS_MASKED(8192E,_MUSB,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8723B)
|
||||
if (IS_HARDWARE_TYPE_8723B(pAdapter))
|
||||
return (IS_MASKED(8723B,_MUSB,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8814A)
|
||||
if (IS_HARDWARE_TYPE_8814A(pAdapter))
|
||||
return (IS_MASKED(8814A, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8188F)
|
||||
if (IS_HARDWARE_TYPE_8188F(pAdapter))
|
||||
return (IS_MASKED(8188F, _MUSB, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#elif DEV_BUS_TYPE == RT_PCI_INTERFACE
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return (IS_MASKED(8188E,_MPCIE,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8192E)
|
||||
if (IS_HARDWARE_TYPE_8192E(pAdapter))
|
||||
return (IS_MASKED(8192E,_MPCIE,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8812A)
|
||||
if (IS_HARDWARE_TYPE_8812(pAdapter))
|
||||
return (IS_MASKED(8812A,_MPCIE,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8821A)
|
||||
if (IS_HARDWARE_TYPE_8821(pAdapter))
|
||||
return (IS_MASKED(8821A,_MPCIE,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8723B)
|
||||
if (IS_HARDWARE_TYPE_8723B(pAdapter))
|
||||
return (IS_MASKED(8723B,_MPCIE,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#if defined(CONFIG_RTL8814A)
|
||||
if (IS_HARDWARE_TYPE_8814A(pAdapter))
|
||||
return (IS_MASKED(8814A, _MPCIE, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
//else if (IS_HARDWARE_TYPE_8821B(pAdapter))
|
||||
// return (IS_MASKED(8821B,_MPCIE,Offset)) ? TRUE : FALSE;
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE
|
||||
#ifdef CONFIG_RTL8188E_SDIO
|
||||
if (IS_HARDWARE_TYPE_8188E(pAdapter))
|
||||
return (IS_MASKED(8188E,_MSDIO,Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#ifdef CONFIG_RTL8188F_SDIO
|
||||
if (IS_HARDWARE_TYPE_8188F(pAdapter))
|
||||
return (IS_MASKED(8188F, _MSDIO, Offset)) ? TRUE : FALSE;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
||||
{
|
||||
#define RT_ASSERT_RET(expr) \
|
||||
#define RT_EFUSE_ASSERT_RET(expr) \
|
||||
if(!(expr)) { \
|
||||
printk( "Assertion failed! %s at ......\n", #expr); \
|
||||
printk( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
|
||||
|
|
@ -775,7 +945,6 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
s32 i, j, idx;
|
||||
u8 ret = _SUCCESS;
|
||||
u16 mapLen=0;
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
|
||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, _FALSE);
|
||||
|
|
@ -783,8 +952,8 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
if ((addr + cnts) > mapLen)
|
||||
return _FAIL;
|
||||
|
||||
RT_ASSERT_RET(PGPKT_DATA_SIZE == 8); // have to be 8 byte alignment
|
||||
RT_ASSERT_RET((mapLen & 0x7) == 0); // have to be PGPKT_DATA_SIZE alignment for memcpy
|
||||
RT_EFUSE_ASSERT_RET(PGPKT_DATA_SIZE == 8); // have to be 8 byte alignment
|
||||
RT_EFUSE_ASSERT_RET((mapLen & 0x7) == 0); // have to be PGPKT_DATA_SIZE alignment for memcpy
|
||||
|
||||
map = rtw_zmalloc(mapLen);
|
||||
if(map == NULL){
|
||||
|
|
@ -796,7 +965,24 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
ret = rtw_efuse_map_read(padapter, 0, mapLen, map);
|
||||
if (ret == _FAIL) goto exit;
|
||||
|
||||
Efuse_PowerSwitch(padapter, _TRUE, _TRUE);
|
||||
if(padapter->registrypriv.boffefusemask==0)
|
||||
{
|
||||
for (i =0; i < cnts; i++)
|
||||
{
|
||||
if(padapter->registrypriv.bFileMaskEfuse==_TRUE)
|
||||
{
|
||||
if (rtw_file_efuse_IsMasked(padapter, addr+i)) /*use file efuse mask. */
|
||||
data[i] = map[addr+i];
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( efuse_IsMasked(padapter, addr+i ))
|
||||
data[i] = map[addr+i];
|
||||
}
|
||||
DBG_8192C("%s , data[%d] = %x, map[addr+i]= %x\n", __func__, i, data[i], map[addr+i]);
|
||||
}
|
||||
}
|
||||
/*Efuse_PowerSwitch(padapter, _TRUE, _TRUE);*/
|
||||
|
||||
idx = 0;
|
||||
offset = (addr >> 3);
|
||||
|
|
@ -816,10 +1002,10 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
{
|
||||
if (IS_C_CUT(pHalData->VersionID) || IS_B_CUT(pHalData->VersionID))
|
||||
{
|
||||
if(pEEPROM->adjuseVoltageVal == 6)
|
||||
if(pHalData->adjuseVoltageVal == 6)
|
||||
{
|
||||
newdata[i] = map[addr + idx];
|
||||
DBG_8192C(" %s ,\n adjuseVoltageVal = %d ,newdata[%d] = %x \n",__func__,pEEPROM->adjuseVoltageVal,i,newdata[i]);
|
||||
DBG_8192C(" %s ,\n adjuseVoltageVal = %d ,newdata[%d] = %x \n",__func__,pHalData->adjuseVoltageVal,i,newdata[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -842,7 +1028,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
offset++;
|
||||
}
|
||||
|
||||
Efuse_PowerSwitch(padapter, _TRUE, _FALSE);
|
||||
/*Efuse_PowerSwitch(padapter, _TRUE, _FALSE);*/
|
||||
|
||||
exit:
|
||||
|
||||
|
|
@ -851,11 +1037,38 @@ exit:
|
|||
return ret;
|
||||
}
|
||||
|
||||
u8 rtw_efuse_mask_map_read(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
||||
{
|
||||
u8 ret = _SUCCESS;
|
||||
u16 mapLen = 0, i = 0;
|
||||
|
||||
EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, _FALSE);
|
||||
|
||||
ret = rtw_efuse_map_read(padapter, addr, cnts , data);
|
||||
|
||||
if (padapter->registrypriv.boffefusemask == 0) {
|
||||
|
||||
for (i = 0; i < cnts; i++) {
|
||||
if (padapter->registrypriv.bFileMaskEfuse == _TRUE) {
|
||||
if (rtw_file_efuse_IsMasked(padapter, addr+i)) /*use file efuse mask.*/
|
||||
data[i] = 0xff;
|
||||
} else {
|
||||
/*DBG_8192C(" %s , data[%d] = %x\n", __func__, i, data[i]);*/
|
||||
if (efuse_IsMasked(padapter, addr+i)) {
|
||||
data[i] = 0xff;
|
||||
/*DBG_8192C(" %s ,mask data[%d] = %x\n", __func__, i, data[i]);*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
u8 rtw_BT_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
||||
{
|
||||
#define RT_ASSERT_RET(expr) \
|
||||
#define RT_EFUSE_ASSERT_RET(expr) \
|
||||
if(!(expr)) { \
|
||||
printk( "Assertion failed! %s at ......\n", #expr); \
|
||||
printk( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
|
||||
|
|
@ -874,8 +1087,8 @@ u8 rtw_BT_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data)
|
|||
if ((addr + cnts) > mapLen)
|
||||
return _FAIL;
|
||||
|
||||
RT_ASSERT_RET(PGPKT_DATA_SIZE == 8); // have to be 8 byte alignment
|
||||
RT_ASSERT_RET((mapLen & 0x7) == 0); // have to be PGPKT_DATA_SIZE alignment for memcpy
|
||||
RT_EFUSE_ASSERT_RET(PGPKT_DATA_SIZE == 8); // have to be 8 byte alignment
|
||||
RT_EFUSE_ASSERT_RET((mapLen & 0x7) == 0); // have to be PGPKT_DATA_SIZE alignment for memcpy
|
||||
|
||||
map = rtw_zmalloc(mapLen);
|
||||
if(map == NULL){
|
||||
|
|
@ -1005,9 +1218,9 @@ efuse_ShadowRead1Byte(
|
|||
IN u16 Offset,
|
||||
IN OUT u8 *Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
*Value = pEEPROM->efuse_eeprom_data[Offset];
|
||||
*Value = pHalData->efuse_eeprom_data[Offset];
|
||||
|
||||
} // EFUSE_ShadowRead1Byte
|
||||
|
||||
|
|
@ -1018,10 +1231,10 @@ efuse_ShadowRead2Byte(
|
|||
IN u16 Offset,
|
||||
IN OUT u16 *Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
*Value = pEEPROM->efuse_eeprom_data[Offset];
|
||||
*Value |= pEEPROM->efuse_eeprom_data[Offset+1]<<8;
|
||||
*Value = pHalData->efuse_eeprom_data[Offset];
|
||||
*Value |= pHalData->efuse_eeprom_data[Offset+1]<<8;
|
||||
|
||||
} // EFUSE_ShadowRead2Byte
|
||||
|
||||
|
|
@ -1032,12 +1245,12 @@ efuse_ShadowRead4Byte(
|
|||
IN u16 Offset,
|
||||
IN OUT u32 *Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
*Value = pEEPROM->efuse_eeprom_data[Offset];
|
||||
*Value |= pEEPROM->efuse_eeprom_data[Offset+1]<<8;
|
||||
*Value |= pEEPROM->efuse_eeprom_data[Offset+2]<<16;
|
||||
*Value |= pEEPROM->efuse_eeprom_data[Offset+3]<<24;
|
||||
*Value = pHalData->efuse_eeprom_data[Offset];
|
||||
*Value |= pHalData->efuse_eeprom_data[Offset+1]<<8;
|
||||
*Value |= pHalData->efuse_eeprom_data[Offset+2]<<16;
|
||||
*Value |= pHalData->efuse_eeprom_data[Offset+3]<<24;
|
||||
|
||||
} // efuse_ShadowRead4Byte
|
||||
|
||||
|
|
@ -1073,9 +1286,9 @@ efuse_ShadowWrite1Byte(
|
|||
IN u16 Offset,
|
||||
IN u8 Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
pEEPROM->efuse_eeprom_data[Offset] = Value;
|
||||
pHalData->efuse_eeprom_data[Offset] = Value;
|
||||
|
||||
} // efuse_ShadowWrite1Byte
|
||||
|
||||
|
|
@ -1086,10 +1299,12 @@ efuse_ShadowWrite2Byte(
|
|||
IN u16 Offset,
|
||||
IN u16 Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
|
||||
pEEPROM->efuse_eeprom_data[Offset] = Value&0x00FF;
|
||||
pEEPROM->efuse_eeprom_data[Offset+1] = Value>>8;
|
||||
pHalData->efuse_eeprom_data[Offset] = Value&0x00FF;
|
||||
pHalData->efuse_eeprom_data[Offset+1] = Value>>8;
|
||||
|
||||
} // efuse_ShadowWrite1Byte
|
||||
|
||||
|
|
@ -1100,12 +1315,12 @@ efuse_ShadowWrite4Byte(
|
|||
IN u16 Offset,
|
||||
IN u32 Value)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
pEEPROM->efuse_eeprom_data[Offset] = (u8)(Value&0x000000FF);
|
||||
pEEPROM->efuse_eeprom_data[Offset+1] = (u8)((Value>>8)&0x0000FF);
|
||||
pEEPROM->efuse_eeprom_data[Offset+2] = (u8)((Value>>16)&0x00FF);
|
||||
pEEPROM->efuse_eeprom_data[Offset+3] = (u8)((Value>>24)&0xFF);
|
||||
pHalData->efuse_eeprom_data[Offset] = (u8)(Value&0x000000FF);
|
||||
pHalData->efuse_eeprom_data[Offset+1] = (u8)((Value>>8)&0x0000FF);
|
||||
pHalData->efuse_eeprom_data[Offset+2] = (u8)((Value>>16)&0x00FF);
|
||||
pHalData->efuse_eeprom_data[Offset+3] = (u8)((Value>>24)&0xFF);
|
||||
|
||||
} // efuse_ShadowWrite1Byte
|
||||
|
||||
|
|
@ -1130,25 +1345,25 @@ void EFUSE_ShadowMapUpdate(
|
|||
IN u8 efuseType,
|
||||
IN BOOLEAN bPseudoTest)
|
||||
{
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(pAdapter);
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pAdapter);
|
||||
u16 mapLen=0;
|
||||
|
||||
EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, bPseudoTest);
|
||||
|
||||
if (pEEPROM->bautoload_fail_flag == _TRUE)
|
||||
if (pHalData->bautoload_fail_flag == _TRUE)
|
||||
{
|
||||
_rtw_memset(pEEPROM->efuse_eeprom_data, 0xFF, mapLen);
|
||||
_rtw_memset(pHalData->efuse_eeprom_data, 0xFF, mapLen);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
if(_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM)) {
|
||||
if(_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pHalData->efuse_eeprom_data)) {
|
||||
#endif
|
||||
|
||||
Efuse_ReadAllMap(pAdapter, efuseType, pEEPROM->efuse_eeprom_data, bPseudoTest);
|
||||
Efuse_ReadAllMap(pAdapter, efuseType, pHalData->efuse_eeprom_data, bPseudoTest);
|
||||
|
||||
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
storeAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pEEPROM);
|
||||
storeAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pHalData->efuse_eeprom_data);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1274,12 +1489,12 @@ Efuse_InitSomeVar(
|
|||
return _TRUE;
|
||||
}
|
||||
|
||||
int storeAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
||||
int storeAdaptorInfoFile(char *path, u8* efuse_data)
|
||||
{
|
||||
int ret =_SUCCESS;
|
||||
|
||||
if(path && eeprom_priv) {
|
||||
ret = rtw_store_to_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE_512);
|
||||
if(path && efuse_data) {
|
||||
ret = rtw_store_to_file(path, efuse_data, EEPROM_MAX_SIZE_512);
|
||||
if(ret == EEPROM_MAX_SIZE)
|
||||
ret = _SUCCESS;
|
||||
else
|
||||
|
|
@ -1291,15 +1506,15 @@ int storeAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
||||
int retriveAdaptorInfoFile(char *path, u8* efuse_data)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
mm_segment_t oldfs;
|
||||
struct file *fp;
|
||||
|
||||
if(path && eeprom_priv) {
|
||||
if(path && efuse_data) {
|
||||
|
||||
ret = rtw_retrive_from_file(path, eeprom_priv->efuse_eeprom_data, EEPROM_MAX_SIZE);
|
||||
ret = rtw_retrieve_from_file(path, efuse_data, EEPROM_MAX_SIZE);
|
||||
|
||||
if(ret == EEPROM_MAX_SIZE)
|
||||
ret = _SUCCESS;
|
||||
|
|
@ -1320,117 +1535,141 @@ int retriveAdaptorInfoFile(char *path, struct eeprom_priv * eeprom_priv)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
#endif //CONFIG_ADAPTOR_INFO_CACHING_FILE
|
||||
#endif //PLATFORM_LINUX
|
||||
#endif /* CONFIG_ADAPTOR_INFO_CACHING_FILE */
|
||||
|
||||
#ifdef CONFIG_EFUSE_CONFIG_FILE
|
||||
|
||||
void Rtw_Hal_ReadMACAddrFromFile(PADAPTER padapter)
|
||||
u32 rtw_read_efuse_from_file(const char *path, u8 *buf)
|
||||
{
|
||||
u32 i;
|
||||
u8 temp[3];
|
||||
u32 ret = _FAIL;
|
||||
|
||||
struct file *fp;
|
||||
mm_segment_t fs;
|
||||
u8 source_addr[18];
|
||||
loff_t pos = 0;
|
||||
u32 curtime = rtw_get_current_time();
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
||||
u8 *head, *end;
|
||||
|
||||
u8 null_mac_addr[ETH_ALEN] = {0, 0, 0,0, 0, 0};
|
||||
u8 multi_mac_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
|
||||
_rtw_memset(source_addr, 0, 18);
|
||||
_rtw_memset(pEEPROM->mac_addr, 0, ETH_ALEN);
|
||||
fp = filp_open(path, O_RDONLY, 0);
|
||||
if (fp == NULL || IS_ERR(fp)) {
|
||||
if (fp != NULL)
|
||||
DBG_871X_LEVEL(_drv_always_, "%s open %s fail, err:%ld\n"
|
||||
, __func__, path, PTR_ERR(fp));
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_always_, "%s open %s fail, fp is NULL\n"
|
||||
, __func__, path);
|
||||
|
||||
fp = filp_open("/data/wifimac.txt", O_RDWR, 0644);
|
||||
if (IS_ERR(fp)) {
|
||||
pEEPROM->bloadmac_fail_flag = _TRUE;
|
||||
DBG_871X("Error, wifi mac address file doesn't exist.\n");
|
||||
} else {
|
||||
fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
DBG_871X("wifi mac address:\n");
|
||||
vfs_read(fp, source_addr, 18, &pos);
|
||||
source_addr[17] = ':';
|
||||
temp[2] = 0; /* add end of string '\0' */
|
||||
|
||||
head = end = source_addr;
|
||||
for (i=0; i<ETH_ALEN; i++) {
|
||||
while (end && (*end != ':') )
|
||||
end++;
|
||||
fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
if (end && (*end == ':') )
|
||||
*end = '\0';
|
||||
|
||||
pEEPROM->mac_addr[i] = simple_strtoul(head, NULL, 16 );
|
||||
|
||||
if (end) {
|
||||
end++;
|
||||
head = end;
|
||||
}
|
||||
DBG_871X("%02x \n", pEEPROM->mac_addr[i]);
|
||||
for (i = 0 ; i < HWSET_MAX_SIZE ; i++) {
|
||||
vfs_read(fp, temp, 2, &pos);
|
||||
if (sscanf(temp, "%hhx", &buf[i]) != 1) {
|
||||
if (0)
|
||||
DBG_871X_LEVEL(_drv_err_, "%s sscanf fail\n", __func__);
|
||||
buf[i] = 0xFF;
|
||||
}
|
||||
if ((i % EFUSE_FILE_COLUMN_NUM) == (EFUSE_FILE_COLUMN_NUM - 1)) {
|
||||
/* Filter the lates space char. */
|
||||
vfs_read(fp, temp, 1, &pos);
|
||||
if (strchr(temp, ' ') == NULL) {
|
||||
pos--;
|
||||
vfs_read(fp, temp, 2, &pos);
|
||||
}
|
||||
} else {
|
||||
pos += 1; /* Filter the space character */
|
||||
}
|
||||
DBG_871X("\n");
|
||||
set_fs(fs);
|
||||
pEEPROM->bloadmac_fail_flag = _FALSE;
|
||||
filp_close(fp, NULL);
|
||||
}
|
||||
|
||||
if ( (_rtw_memcmp(pEEPROM->mac_addr, null_mac_addr, ETH_ALEN)) ||
|
||||
(_rtw_memcmp(pEEPROM->mac_addr, multi_mac_addr, ETH_ALEN)) ) {
|
||||
pEEPROM->mac_addr[0] = 0x00;
|
||||
pEEPROM->mac_addr[1] = 0xe0;
|
||||
pEEPROM->mac_addr[2] = 0x4c;
|
||||
pEEPROM->mac_addr[3] = (u8)(curtime & 0xff) ;
|
||||
pEEPROM->mac_addr[4] = (u8)((curtime>>8) & 0xff) ;
|
||||
pEEPROM->mac_addr[5] = (u8)((curtime>>16) & 0xff) ;
|
||||
}
|
||||
set_fs(fs);
|
||||
|
||||
DBG_871X("Hal_ReadMACAddrFromFile: Permanent Address = %02x-%02x-%02x-%02x-%02x-%02x !!!\n",
|
||||
pEEPROM->mac_addr[0], pEEPROM->mac_addr[1],
|
||||
pEEPROM->mac_addr[2], pEEPROM->mac_addr[3],
|
||||
pEEPROM->mac_addr[4], pEEPROM->mac_addr[5]);
|
||||
DBG_871X_LEVEL(_drv_always_, "efuse file: %s\n", path);
|
||||
#ifdef CONFIG_DEBUG
|
||||
for (i = 0; i < HWSET_MAX_SIZE; i++) {
|
||||
if (i % 16 == 0)
|
||||
DBG_871X_SEL_NL(RTW_DBGDUMP, "0x%03x: ", i);
|
||||
|
||||
DBG_871X_SEL(RTW_DBGDUMP, "%02X%s"
|
||||
, buf[i]
|
||||
, ((i + 1) % 16 == 0) ? "\n" : (((i + 1) % 8 == 0) ? " " : " ")
|
||||
);
|
||||
}
|
||||
DBG_871X_SEL(RTW_DBGDUMP, "\n");
|
||||
#endif
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
u32 Rtw_Hal_readPGDataFromConfigFile(PADAPTER padapter)
|
||||
u32 rtw_read_macaddr_from_file(const char *path, u8 *buf)
|
||||
{
|
||||
u32 i;
|
||||
struct file *fp;
|
||||
mm_segment_t fs;
|
||||
u8 temp[3];
|
||||
loff_t pos = 0;
|
||||
EEPROM_EFUSE_PRIV *pEEPROM = GET_EEPROM_EFUSE_PRIV(padapter);
|
||||
u8 *PROMContent = pEEPROM->efuse_eeprom_data;
|
||||
|
||||
u8 source_addr[18];
|
||||
u8 *head, *end;
|
||||
int i;
|
||||
u32 ret = _FAIL;
|
||||
|
||||
temp[2] = 0; // add end of string '\0'
|
||||
_rtw_memset(source_addr, 0, 18);
|
||||
|
||||
fp = filp_open("/system/etc/wifi/wifi_efuse.map", O_RDWR, 0644);
|
||||
if (IS_ERR(fp)) {
|
||||
pEEPROM->bloadfile_fail_flag = _TRUE;
|
||||
DBG_871X("Error, Efuse configure file doesn't exist.\n");
|
||||
return _FAIL;
|
||||
fp = filp_open(path, O_RDONLY, 0);
|
||||
if (fp == NULL || IS_ERR(fp)) {
|
||||
if (fp != NULL)
|
||||
DBG_871X_LEVEL(_drv_always_, "%s open %s fail, err:%ld\n"
|
||||
, __func__, path, PTR_ERR(fp));
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_always_, "%s open %s fail, fp is NULL\n"
|
||||
, __func__, path);
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
fs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
|
||||
DBG_871X("Efuse configure file:\n");
|
||||
for (i=0; i< EFUSE_MAP_SIZE ; i++) {
|
||||
vfs_read(fp, temp, 2, &pos);
|
||||
PROMContent[i] = simple_strtoul(temp, NULL, 16 );
|
||||
pos += 1; // Filter the space character
|
||||
DBG_871X("%02X \n", PROMContent[i]);
|
||||
vfs_read(fp, source_addr, 18, &pos);
|
||||
source_addr[17] = ':';
|
||||
|
||||
head = end = source_addr;
|
||||
for (i = 0; i < ETH_ALEN; i++) {
|
||||
while (end && (*end != ':'))
|
||||
end++;
|
||||
|
||||
if (end && (*end == ':'))
|
||||
*end = '\0';
|
||||
|
||||
if (sscanf(head, "%hhx", &buf[i]) != 1) {
|
||||
if (0)
|
||||
DBG_871X_LEVEL(_drv_err_, "%s sscanf fail\n", __func__);
|
||||
buf[i] = 0xFF;
|
||||
}
|
||||
|
||||
if (end) {
|
||||
end++;
|
||||
head = end;
|
||||
}
|
||||
}
|
||||
DBG_871X("\n");
|
||||
|
||||
set_fs(fs);
|
||||
|
||||
filp_close(fp, NULL);
|
||||
|
||||
pEEPROM->bloadfile_fail_flag = _FALSE;
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
DBG_871X_LEVEL(_drv_always_, "wifi_mac file: %s\n", path);
|
||||
#ifdef CONFIG_DEBUG
|
||||
DBG_871X(MAC_FMT"\n", MAC_ARG(buf));
|
||||
#endif
|
||||
|
||||
ret = _SUCCESS;
|
||||
|
||||
exit:
|
||||
return ret;
|
||||
}
|
||||
#endif /* CONFIG_EFUSE_CONFIG_FILE */
|
||||
|
||||
#endif /* PLATFORM_LINUX */
|
||||
|
||||
#endif //#CONFIG_EFUSE_CONFIG_FILE
|
||||
|
|
|
|||
1561
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ap.c
Executable file → Normal file
1561
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ap.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
10
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_beamforming.c
Executable file → Normal file
10
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_beamforming.c
Executable file → Normal file
|
|
@ -92,8 +92,8 @@ struct beamforming_entry *beamforming_add_entry(PADAPTER adapter, u8* ra, u16 ai
|
|||
pEntry->sound_bw = bw;
|
||||
if (check_fwstate(pmlmepriv, WIFI_AP_STATE))
|
||||
{
|
||||
u16 BSSID = ((adapter->eeprompriv.mac_addr[5] & 0xf0) >> 4) ^
|
||||
(adapter->eeprompriv.mac_addr[5] & 0xf); // BSSID[44:47] xor BSSID[40:43]
|
||||
u16 BSSID = ((*(adapter_mac_addr(adapter) + 5) & 0xf0) >> 4) ^
|
||||
(*(adapter_mac_addr(adapter) + 5) & 0xf); /* BSSID[44:47] xor BSSID[40:43] */
|
||||
pEntry->p_aid = (aid + BSSID * 32) & 0x1ff; // (dec(A) + dec(B)*32) mod 512
|
||||
}
|
||||
else if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) || check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE))
|
||||
|
|
@ -145,7 +145,7 @@ void beamforming_dym_ndpa_rate(PADAPTER adapter)
|
|||
u16 NDPARate = MGN_6M;
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter);
|
||||
|
||||
if(pHalData->dmpriv.MinUndecoratedPWDBForDM > 30) // link RSSI > 30%
|
||||
if(pHalData->MinUndecoratedPWDBForDM > 30) // link RSSI > 30%
|
||||
NDPARate = MGN_24M;
|
||||
else
|
||||
NDPARate = MGN_6M;
|
||||
|
|
@ -349,7 +349,7 @@ BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, CHANNEL_WIDTH bw, u8 qidx
|
|||
SetFrameSubType(pframe, WIFI_ACTION_NOACK);
|
||||
|
||||
_rtw_memcpy(pwlanhdr->addr1, ra, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, myid(&(Adapter->eeprompriv)), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(Adapter), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);
|
||||
|
||||
if( pmlmeext->cur_wireless_mode == WIRELESS_11B)
|
||||
|
|
@ -429,7 +429,7 @@ BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, CHANNEL_WIDTH b
|
|||
SetFrameSubType(pframe, WIFI_NDPA);
|
||||
|
||||
_rtw_memcpy(pwlanhdr->addr1, ra, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, myid(&(Adapter->eeprompriv)), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(Adapter), ETH_ALEN);
|
||||
|
||||
if (IsSupported5G(pmlmeext->cur_wireless_mode) || IsSupportedHT(pmlmeext->cur_wireless_mode))
|
||||
aSifsTime = 16;
|
||||
|
|
|
|||
5
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_br_ext.c
Executable file → Normal file
5
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_br_ext.c
Executable file → Normal file
|
|
@ -48,8 +48,11 @@
|
|||
#include <linux/ipv6.h>
|
||||
#include <linux/icmpv6.h>
|
||||
#include <net/ndisc.h>
|
||||
#include <net/checksum.h>
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24))
|
||||
#include <net/ip6_checksum.h>
|
||||
#else
|
||||
#include <net/checksum.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
|||
30
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_bt_mp.c
Executable file → Normal file
30
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_bt_mp.c
Executable file → Normal file
|
|
@ -22,13 +22,11 @@
|
|||
#include <drv_types.h>
|
||||
#include <rtw_bt_mp.h>
|
||||
|
||||
#ifdef CONFIG_RTL8723A
|
||||
#include <rtl8723a_hal.h>
|
||||
#elif defined(CONFIG_RTL8723B)
|
||||
#if defined(CONFIG_RTL8723B)
|
||||
#include <rtl8723b_hal.h>
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8723A) || defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8821A)
|
||||
#if defined(CONFIG_RTL8723B) || defined(CONFIG_RTL8821A)
|
||||
void MPh2c_timeout_handle(void *FunctionContext)
|
||||
{
|
||||
PADAPTER pAdapter;
|
||||
|
|
@ -135,9 +133,7 @@ mptbt_SendH2c(
|
|||
pMptCtx->MptH2cRspEvent = _FALSE;
|
||||
pMptCtx->MptBtC2hEvent = _FALSE;
|
||||
|
||||
#if defined(CONFIG_RTL8723A)
|
||||
rtw_hal_fill_h2c_cmd(Adapter, 70, h2cCmdLen, (pu1Byte)pH2c);
|
||||
#elif defined(CONFIG_RTL8723B)
|
||||
#if defined(CONFIG_RTL8723B)
|
||||
rtl8723b_set_FwBtMpOper_cmd(Adapter, pH2c->opCode, pH2c->opCodeVer, pH2c->reqNum, pH2c->buf);
|
||||
#endif
|
||||
pMptCtx->h2cReqNum++;
|
||||
|
|
@ -1089,25 +1085,7 @@ mptbt_BtSetGeneral(
|
|||
calVal = pBtReq->pParamStart[1];
|
||||
break;
|
||||
case BT_GSET_UPDATE_BT_PATCH:
|
||||
if(IS_HARDWARE_TYPE_8723AE(Adapter) && Adapter->bFWReady)
|
||||
{
|
||||
u1Byte i;
|
||||
DBG_8192C ("[MPT], write regs for load patch\n");
|
||||
//BTFwPatch8723A(Adapter);
|
||||
PlatformEFIOWrite1Byte(Adapter, 0xCC, 0x2d);
|
||||
rtw_msleep_os(50);
|
||||
PlatformEFIOWrite4Byte(Adapter, 0x68, 0xa005000c);
|
||||
rtw_msleep_os(50);
|
||||
PlatformEFIOWrite4Byte(Adapter, 0x68, 0xb005000c);
|
||||
rtw_msleep_os(50);
|
||||
PlatformEFIOWrite1Byte(Adapter, 0xCC, 0x29);
|
||||
for(i=0; i<12; i++)
|
||||
rtw_msleep_os(100);
|
||||
//#if (DEV_BUS_TYPE == RT_PCI_INTERFACE)
|
||||
// BTFwPatch8723A(Adapter);
|
||||
//#endif
|
||||
DBG_8192C("[MPT], load BT FW Patch finished!!!\n");
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
{
|
||||
|
|
|
|||
1416
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_btcoex.c
Executable file → Normal file
1416
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_btcoex.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
841
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_cmd.c
Executable file → Normal file
841
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_cmd.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
1947
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_debug.c
Executable file → Normal file
1947
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_debug.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
54
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_eeprom.c
Executable file → Normal file
54
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_eeprom.c
Executable file → Normal file
|
|
@ -48,8 +48,8 @@ void shift_out_bits(_adapter * padapter, u16 data, u16 count)
|
|||
u16 x,mask;
|
||||
_func_enter_;
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
mask = 0x01 << (count - 1);
|
||||
|
|
@ -62,9 +62,9 @@ _func_enter_;
|
|||
x &= ~_EEDI;
|
||||
if(data & mask)
|
||||
x |= _EEDI;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
|
|
@ -72,8 +72,8 @@ _func_enter_;
|
|||
down_clk(padapter, &x);
|
||||
mask = mask >> 1;
|
||||
} while(mask);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x &= ~_EEDI;
|
||||
|
|
@ -86,8 +86,8 @@ u16 shift_in_bits (_adapter * padapter)
|
|||
{
|
||||
u16 x,d=0,i;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
|
@ -99,8 +99,8 @@ _func_enter_;
|
|||
{
|
||||
d = d << 1;
|
||||
up_clk(padapter, &x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
|
@ -157,24 +157,24 @@ void eeprom_clean(_adapter * padapter)
|
|||
{
|
||||
u16 x;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x &= ~(_EECS | _EEDI);
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
up_clk(padapter, &x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
down_clk(padapter, &x);
|
||||
|
|
@ -288,15 +288,15 @@ u16 eeprom_read16(_adapter * padapter, u16 reg) //ReadEEprom
|
|||
#endif
|
||||
_func_enter_;
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
// select EEPROM, reset bits, set _EECS
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
@ -337,15 +337,15 @@ void eeprom_read_sz(_adapter * padapter, u16 reg, u8* data, u32 sz)
|
|||
u16 x, data16;
|
||||
u32 i;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
// select EEPROM, reset bits, set _EECS
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_, _drv_err_, ("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
|
|
|||
450
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ieee80211.c
Executable file → Normal file
450
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ieee80211.c
Executable file → Normal file
|
|
@ -88,7 +88,7 @@ uint rtw_is_cckrates_included(u8 *rate)
|
|||
{
|
||||
if ( (((rate[i]) & 0x7f) == 2) || (((rate[i]) & 0x7f) == 4) ||
|
||||
(((rate[i]) & 0x7f) == 11) || (((rate[i]) & 0x7f) == 22) )
|
||||
return _TRUE;
|
||||
return _TRUE;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
|
@ -104,8 +104,7 @@ uint rtw_is_cckratesonly_included(u8 *rate)
|
|||
{
|
||||
if ( (((rate[i]) & 0x7f) != 2) && (((rate[i]) & 0x7f) != 4) &&
|
||||
(((rate[i]) & 0x7f) != 11) && (((rate[i]) & 0x7f) != 22) )
|
||||
|
||||
return _FALSE;
|
||||
return _FALSE;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
|
@ -496,6 +495,28 @@ _func_exit_;
|
|||
|
||||
}
|
||||
|
||||
bool rtw_regsty_adjust_chbw(struct registry_priv *regsty, u8 req_ch, u8 *req_bw, u8 *req_offset)
|
||||
{
|
||||
u8 regsty_allowed_bw;
|
||||
|
||||
if (req_ch <= 14)
|
||||
regsty_allowed_bw = regsty->bw_mode & 0x0F;
|
||||
else
|
||||
regsty_allowed_bw = regsty->bw_mode >> 4;
|
||||
|
||||
if (regsty_allowed_bw == 2 && *req_bw > CHANNEL_WIDTH_80)
|
||||
*req_bw = CHANNEL_WIDTH_80;
|
||||
else if (regsty_allowed_bw == 1 && *req_bw > CHANNEL_WIDTH_40)
|
||||
*req_bw = CHANNEL_WIDTH_40;
|
||||
else if (regsty_allowed_bw == 0 && *req_bw > CHANNEL_WIDTH_20) {
|
||||
*req_bw = CHANNEL_WIDTH_20;
|
||||
*req_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
} else
|
||||
return _FALSE;
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
unsigned char *rtw_get_wpa_ie(unsigned char *pie, int *wpa_ie_len, int limit)
|
||||
{
|
||||
int len;
|
||||
|
|
@ -1368,7 +1389,7 @@ int rtw_get_mac_addr_intel(unsigned char *buf)
|
|||
|
||||
DBG_871X("%s Enter\n", __FUNCTION__);
|
||||
|
||||
ret = rtw_retrive_from_file(fname, c_mac, MAC_ADDRESS_LEN);
|
||||
ret = rtw_retrieve_from_file(fname, c_mac, MAC_ADDRESS_LEN);
|
||||
if(ret < MAC_ADDRESS_LEN)
|
||||
{
|
||||
return -1;
|
||||
|
|
@ -1386,60 +1407,136 @@ int rtw_get_mac_addr_intel(unsigned char *buf)
|
|||
}
|
||||
#endif //CONFIG_PLATFORM_INTEL_BYT
|
||||
|
||||
extern char* rtw_initmac;
|
||||
#include <linux/rfkill-wlan.h>
|
||||
void rtw_macaddr_cfg(u8 *mac_addr)
|
||||
/*
|
||||
* Description:
|
||||
* rtw_check_invalid_mac_address:
|
||||
* This is only used for checking mac address valid or not.
|
||||
*
|
||||
* Input:
|
||||
* adapter: mac_address pointer.
|
||||
*
|
||||
* Output:
|
||||
* _TRUE: The mac address is invalid.
|
||||
* _FALSE: The mac address is valid.
|
||||
*
|
||||
* Auther: Isaac.Li
|
||||
*/
|
||||
u8 rtw_check_invalid_mac_address(u8 *mac_addr)
|
||||
{
|
||||
u8 null_mac_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
|
||||
u8 multi_mac_addr[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||
u8 res = _FALSE;
|
||||
|
||||
if (_rtw_memcmp(mac_addr, null_mac_addr, ETH_ALEN)) {
|
||||
res = _TRUE;
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
if (_rtw_memcmp(mac_addr, multi_mac_addr, ETH_ALEN)) {
|
||||
res = _TRUE;
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
if (mac_addr[0] & BIT0) {
|
||||
res = _TRUE;
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
if (mac_addr[0] & BIT1) {
|
||||
res = _TRUE;
|
||||
goto func_exit;
|
||||
}
|
||||
|
||||
func_exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
extern char *rtw_initmac;
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0))
|
||||
#include <linux/rfkill-wlan.h>
|
||||
#else
|
||||
extern int rk29sdk_wifi_mac_addr(unsigned char *buf);
|
||||
#endif
|
||||
/**
|
||||
* rtw_macaddr_cfg - Decide the mac address used
|
||||
* @out: buf to store mac address decided
|
||||
* @hw_mac_addr: mac address from efuse/epprom
|
||||
*/
|
||||
void rtw_macaddr_cfg(u8 *out, const u8 *hw_mac_addr)
|
||||
{
|
||||
#define DEFAULT_RANDOM_MACADDR 1
|
||||
u8 mac[ETH_ALEN];
|
||||
if(mac_addr == NULL) return;
|
||||
|
||||
if ( rtw_initmac )
|
||||
{ // Users specify the mac address
|
||||
|
||||
if (out == NULL) {
|
||||
rtw_warn_on(1);
|
||||
return;
|
||||
}
|
||||
|
||||
/* Users specify the mac address */
|
||||
if (rtw_initmac) {
|
||||
int jj,kk;
|
||||
|
||||
for (jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3)
|
||||
mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk + 1]);
|
||||
|
||||
goto err_chk;
|
||||
}
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 1, 0))
|
||||
if (!rockchip_wifi_mac_addr(mac)) {
|
||||
printk("=========> get mac address from flash=[%02x:%02x:%02x:%02x:%02x:%02x]\n", mac[0], mac[1],
|
||||
mac[2], mac[3], mac[4], mac[5]);
|
||||
//_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
goto err_chk;
|
||||
}
|
||||
#else
|
||||
#ifndef CONFIG_ANDROID_4_2
|
||||
{
|
||||
u8 macbuf[30] = {0};
|
||||
if (!rk29sdk_wifi_mac_addr(macbuf)) {
|
||||
int jj,kk;
|
||||
printk("=========> get mac address from flash %s\n", macbuf);
|
||||
for( jj = 0, kk = 0; jj < ETH_ALEN; jj++, kk += 3 )
|
||||
{
|
||||
mac[jj] = key_2char2num(rtw_initmac[kk], rtw_initmac[kk+ 1]);
|
||||
}
|
||||
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
mac[jj] = key_2char2num(macbuf[kk], macbuf[kk+ 1]);
|
||||
goto err_chk;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* platform specified */
|
||||
#ifdef CONFIG_PLATFORM_INTEL_BYT
|
||||
else if (0 == rtw_get_mac_addr_intel(mac))
|
||||
{
|
||||
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
if (rtw_get_mac_addr_intel(mac) == 0)
|
||||
goto err_chk;
|
||||
#endif
|
||||
|
||||
/* Use the mac address stored in the Efuse */
|
||||
if (hw_mac_addr) {
|
||||
_rtw_memcpy(mac, hw_mac_addr, ETH_ALEN);
|
||||
goto err_chk;
|
||||
}
|
||||
#endif //CONFIG_PLATFORM_INTEL_BYT
|
||||
else
|
||||
{
|
||||
printk("Wifi Efuse Mac => %02x:%02x:%02x:%02x:%02x:%02x\n", mac_addr[0], mac_addr[1],
|
||||
mac_addr[2], mac_addr[3], mac_addr[4], mac_addr[5]);
|
||||
if (!rockchip_wifi_mac_addr(mac)) {
|
||||
printk("=========> get mac address from flash=[%02x:%02x:%02x:%02x:%02x:%02x]\n", mac[0], mac[1],
|
||||
mac[2], mac[3], mac[4], mac[5]);
|
||||
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
} else {
|
||||
// Use the mac address stored in the Efuse
|
||||
_rtw_memcpy(mac, mac_addr, ETH_ALEN);
|
||||
}
|
||||
}
|
||||
|
||||
if (((mac[0]==0xff) &&(mac[1]==0xff) && (mac[2]==0xff) &&
|
||||
(mac[3]==0xff) && (mac[4]==0xff) &&(mac[5]==0xff)) ||
|
||||
((mac[0]==0x0) && (mac[1]==0x0) && (mac[2]==0x0) &&
|
||||
(mac[3]==0x0) && (mac[4]==0x0) &&(mac[5]==0x0)))
|
||||
{
|
||||
|
||||
err_chk:
|
||||
if (rtw_check_invalid_mac_address(mac) == _TRUE) {
|
||||
#if DEFAULT_RANDOM_MACADDR
|
||||
DBG_871X_LEVEL(_drv_err_, "invalid mac addr:"MAC_FMT", assign random MAC\n", MAC_ARG(mac));
|
||||
*((u32 *)(&mac[2])) = rtw_random32();
|
||||
mac[0] = 0x00;
|
||||
mac[1] = 0xe0;
|
||||
mac[2] = 0x4c;
|
||||
#else
|
||||
DBG_871X_LEVEL(_drv_err_, "invalid mac addr:"MAC_FMT", assign default one\n", MAC_ARG(mac));
|
||||
mac[0] = 0x00;
|
||||
mac[1] = 0xe0;
|
||||
mac[2] = 0x4c;
|
||||
mac[3] = 0x87;
|
||||
mac[4] = 0x00;
|
||||
mac[5] = 0x00;
|
||||
// use default mac addresss
|
||||
_rtw_memcpy(mac_addr, mac, ETH_ALEN);
|
||||
DBG_871X("MAC Address from efuse error, assign default one !!!\n");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
DBG_871X("rtw_macaddr_cfg MAC Address = "MAC_FMT"\n", MAC_ARG(mac_addr));
|
||||
_rtw_memcpy(out, mac, ETH_ALEN);
|
||||
DBG_871X("%s mac addr:"MAC_FMT"\n", __func__, MAC_ARG(out));
|
||||
}
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
|
|
@ -1523,6 +1620,182 @@ void dump_wps_ie(void *sel, u8 *ie, u32 ie_len)
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_ies_get_chbw - get operation ch, bw, offset from IEs of BSS.
|
||||
* @ies: pointer of the first tlv IE
|
||||
* @ies_len: length of @ies
|
||||
* @ch: pointer of ch, used as output
|
||||
* @bw: pointer of bw, used as output
|
||||
* @offset: pointer of offset, used as output
|
||||
*/
|
||||
void rtw_ies_get_chbw(u8 *ies, int ies_len, u8 *ch, u8 *bw, u8 *offset)
|
||||
{
|
||||
u8 *p;
|
||||
int ie_len;
|
||||
|
||||
*ch = 0;
|
||||
*bw = CHANNEL_WIDTH_20;
|
||||
*offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
|
||||
p = rtw_get_ie(ies, _DSSET_IE_, &ie_len, ies_len);
|
||||
if (p && ie_len > 0)
|
||||
*ch = *(p + 2);
|
||||
|
||||
#ifdef CONFIG_80211N_HT
|
||||
{
|
||||
u8 *ht_cap_ie, *ht_op_ie;
|
||||
int ht_cap_ielen, ht_op_ielen;
|
||||
|
||||
ht_cap_ie = rtw_get_ie(ies, EID_HTCapability, &ht_cap_ielen, ies_len);
|
||||
if (ht_cap_ie && ht_cap_ielen) {
|
||||
if (GET_HT_CAP_ELE_CHL_WIDTH(ht_cap_ie + 2))
|
||||
*bw = CHANNEL_WIDTH_40;
|
||||
}
|
||||
|
||||
ht_op_ie = rtw_get_ie(ies, EID_HTInfo, &ht_op_ielen, ies_len);
|
||||
if (ht_op_ie && ht_op_ielen) {
|
||||
if (*ch == 0) {
|
||||
*ch = GET_HT_OP_ELE_PRI_CHL(ht_op_ie + 2);
|
||||
} else if (*ch != 0 && *ch != GET_HT_OP_ELE_PRI_CHL(ht_op_ie + 2)) {
|
||||
DBG_871X("%s ch inconsistent, DSSS:%u, HT primary:%u\n"
|
||||
, __func__, *ch, GET_HT_OP_ELE_PRI_CHL(ht_op_ie + 2));
|
||||
}
|
||||
|
||||
if (!GET_HT_OP_ELE_STA_CHL_WIDTH(ht_op_ie + 2))
|
||||
*bw = CHANNEL_WIDTH_20;
|
||||
|
||||
if (*bw == CHANNEL_WIDTH_40) {
|
||||
switch (GET_HT_OP_ELE_2ND_CHL_OFFSET(ht_op_ie + 2)) {
|
||||
case SCA:
|
||||
*offset = HAL_PRIME_CHNL_OFFSET_LOWER;
|
||||
break;
|
||||
case SCB:
|
||||
*offset = HAL_PRIME_CHNL_OFFSET_UPPER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
{
|
||||
u8 *vht_op_ie;
|
||||
int vht_op_ielen;
|
||||
|
||||
vht_op_ie = rtw_get_ie(ies, EID_VHTOperation, &vht_op_ielen, ies_len);
|
||||
if (vht_op_ie && vht_op_ielen) {
|
||||
if (GET_VHT_OPERATION_ELE_CHL_WIDTH(vht_op_ie + 2) >= 1)
|
||||
*bw = CHANNEL_WIDTH_80;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void rtw_bss_get_chbw(WLAN_BSSID_EX *bss, u8 *ch, u8 *bw, u8 *offset)
|
||||
{
|
||||
rtw_ies_get_chbw(bss->IEs + sizeof(NDIS_802_11_FIXED_IEs)
|
||||
, bss->IELength - sizeof(NDIS_802_11_FIXED_IEs)
|
||||
, ch, bw, offset);
|
||||
|
||||
if (*ch == 0) {
|
||||
*ch = bss->Configuration.DSConfig;
|
||||
} else if (*ch != bss->Configuration.DSConfig) {
|
||||
DBG_871X("inconsistent ch - ies:%u bss->Configuration.DSConfig:%u\n"
|
||||
, *ch, bss->Configuration.DSConfig);
|
||||
*ch = bss->Configuration.DSConfig;
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_is_chbw_grouped - test if the two ch settings can be grouped together
|
||||
* @ch_a: ch of set a
|
||||
* @bw_a: bw of set a
|
||||
* @offset_a: offset of set a
|
||||
* @ch_b: ch of set b
|
||||
* @bw_b: bw of set b
|
||||
* @offset_b: offset of set b
|
||||
*/
|
||||
bool rtw_is_chbw_grouped(u8 ch_a, u8 bw_a, u8 offset_a
|
||||
, u8 ch_b, u8 bw_b, u8 offset_b)
|
||||
{
|
||||
bool is_grouped = _FALSE;
|
||||
|
||||
if (ch_a != ch_b) {
|
||||
/* ch is different */
|
||||
goto exit;
|
||||
} else if ((bw_a == CHANNEL_WIDTH_40 || bw_a == CHANNEL_WIDTH_80)
|
||||
&& (bw_b == CHANNEL_WIDTH_40 || bw_b == CHANNEL_WIDTH_80)
|
||||
) {
|
||||
if (offset_a != offset_b)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
is_grouped = _TRUE;
|
||||
|
||||
exit:
|
||||
return is_grouped;
|
||||
}
|
||||
|
||||
/**
|
||||
* rtw_sync_chbw - obey g_ch, adjust g_bw, g_offset, bw, offset
|
||||
* @req_ch: pointer of the request ch, may be modified further
|
||||
* @req_bw: pointer of the request bw, may be modified further
|
||||
* @req_offset: pointer of the request offset, may be modified further
|
||||
* @g_ch: pointer of the ongoing group ch
|
||||
* @g_bw: pointer of the ongoing group bw, may be modified further
|
||||
* @g_offset: pointer of the ongoing group offset, may be modified further
|
||||
*/
|
||||
void rtw_sync_chbw(u8 *req_ch, u8 *req_bw, u8 *req_offset
|
||||
, u8 *g_ch, u8 *g_bw, u8 *g_offset)
|
||||
{
|
||||
|
||||
*req_ch = *g_ch;
|
||||
|
||||
if (*req_bw == CHANNEL_WIDTH_80 && *g_ch <= 14) {
|
||||
/*2.4G ch, downgrade to 40Mhz */
|
||||
*req_bw = CHANNEL_WIDTH_40;
|
||||
}
|
||||
|
||||
switch (*req_bw) {
|
||||
case CHANNEL_WIDTH_80:
|
||||
if (*g_bw == CHANNEL_WIDTH_40 || *g_bw == CHANNEL_WIDTH_80)
|
||||
*req_offset = *g_offset;
|
||||
else if (*g_bw == CHANNEL_WIDTH_20)
|
||||
*req_offset = rtw_get_offset_by_ch(*req_ch);
|
||||
|
||||
if (*req_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE) {
|
||||
DBG_871X_LEVEL(_drv_err_, "%s req 80MHz BW without offset, down to 20MHz\n", __func__);
|
||||
rtw_warn_on(1);
|
||||
*req_bw = CHANNEL_WIDTH_20;
|
||||
}
|
||||
break;
|
||||
case CHANNEL_WIDTH_40:
|
||||
if (*g_bw == CHANNEL_WIDTH_40 || *g_bw == CHANNEL_WIDTH_80)
|
||||
*req_offset = *g_offset;
|
||||
else if (*g_bw == CHANNEL_WIDTH_20)
|
||||
*req_offset = rtw_get_offset_by_ch(*req_ch);
|
||||
|
||||
if (*req_offset == HAL_PRIME_CHNL_OFFSET_DONT_CARE) {
|
||||
DBG_871X_LEVEL(_drv_err_, "%s req 40MHz BW without offset, down to 20MHz\n", __func__);
|
||||
rtw_warn_on(1);
|
||||
*req_bw = CHANNEL_WIDTH_20;
|
||||
}
|
||||
break;
|
||||
case CHANNEL_WIDTH_20:
|
||||
*req_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
break;
|
||||
default:
|
||||
DBG_871X_LEVEL(_drv_err_, "%s req unsupported BW:%u\n", __func__, *req_bw);
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
|
||||
if (*req_bw > *g_bw) {
|
||||
*g_bw = *req_bw;
|
||||
*g_offset = *req_offset;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_P2P
|
||||
/**
|
||||
* rtw_get_p2p_merged_len - Get merged ie length from muitiple p2p ies.
|
||||
|
|
@ -1651,47 +1924,48 @@ u8 *rtw_get_p2p_ie_from_scan_queue(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_
|
|||
*/
|
||||
u8 *rtw_get_p2p_ie(u8 *in_ie, int in_len, u8 *p2p_ie, uint *p2p_ielen)
|
||||
{
|
||||
uint cnt = 0;
|
||||
u8 *p2p_ie_ptr;
|
||||
u8 eid, p2p_oui[4]={0x50,0x6F,0x9A,0x09};
|
||||
uint cnt;
|
||||
u8 *p2p_ie_ptr = NULL;
|
||||
u8 eid, p2p_oui[4] = {0x50, 0x6F, 0x9A, 0x09};
|
||||
|
||||
if ( p2p_ielen != NULL )
|
||||
if (p2p_ielen)
|
||||
*p2p_ielen = 0;
|
||||
|
||||
while(cnt<in_len)
|
||||
{
|
||||
eid = in_ie[cnt];
|
||||
if ((in_len < 0) || (cnt > MAX_IE_SZ)) {
|
||||
rtw_dump_stack();
|
||||
return NULL;
|
||||
}
|
||||
if( ( eid == _VENDOR_SPECIFIC_IE_ ) && ( _rtw_memcmp( &in_ie[cnt+2], p2p_oui, 4) == _TRUE ) )
|
||||
{
|
||||
p2p_ie_ptr = in_ie + cnt;
|
||||
|
||||
if ( p2p_ie != NULL )
|
||||
{
|
||||
_rtw_memcpy( p2p_ie, &in_ie[ cnt ], in_ie[ cnt + 1 ] + 2 );
|
||||
}
|
||||
if (!in_ie || in_len < 0) {
|
||||
rtw_warn_on(1);
|
||||
return p2p_ie_ptr;
|
||||
}
|
||||
|
||||
if ( p2p_ielen != NULL )
|
||||
{
|
||||
*p2p_ielen = in_ie[ cnt + 1 ] + 2;
|
||||
}
|
||||
|
||||
return p2p_ie_ptr;
|
||||
if (in_len <= 0)
|
||||
return p2p_ie_ptr;
|
||||
|
||||
cnt = 0;
|
||||
|
||||
while (cnt + 1 + 4 < in_len) {
|
||||
eid = in_ie[cnt];
|
||||
|
||||
if (cnt + 1 + 4 >= MAX_IE_SZ) {
|
||||
rtw_warn_on(1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (eid == WLAN_EID_VENDOR_SPECIFIC && _rtw_memcmp(&in_ie[cnt + 2], p2p_oui, 4) == _TRUE) {
|
||||
p2p_ie_ptr = in_ie + cnt;
|
||||
|
||||
if (p2p_ie)
|
||||
_rtw_memcpy(p2p_ie, &in_ie[cnt], in_ie[cnt + 1] + 2);
|
||||
|
||||
if (p2p_ielen)
|
||||
*p2p_ielen = in_ie[cnt + 1] + 2;
|
||||
|
||||
break;
|
||||
} else {
|
||||
cnt += in_ie[cnt + 1] + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
cnt += in_ie[ cnt + 1 ] +2; //goto next
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return p2p_ie_ptr;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1854,10 +2128,10 @@ void rtw_WLAN_BSSID_EX_remove_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id)
|
|||
if( (p2p_ie=rtw_get_p2p_ie(bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_, NULL, &p2p_ielen_ori)) )
|
||||
{
|
||||
if (0)
|
||||
if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
|
||||
DBG_871X("rtw_get_p2p_attr: GOT P2P_ATTR:%u!!!!!!!!\n", attr_id);
|
||||
dump_ies(RTW_DBGDUMP, bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_);
|
||||
}
|
||||
if(rtw_get_p2p_attr(p2p_ie, p2p_ielen_ori, attr_id, NULL, NULL)) {
|
||||
DBG_871X("rtw_get_p2p_attr: GOT P2P_ATTR:%u!!!!!!!!\n", attr_id);
|
||||
dump_ies(RTW_DBGDUMP, bss_ex->IEs+_FIXED_IE_LENGTH_, bss_ex->IELength-_FIXED_IE_LENGTH_);
|
||||
}
|
||||
|
||||
p2p_ielen=rtw_p2p_attr_remove(p2p_ie, p2p_ielen_ori, attr_id);
|
||||
if(p2p_ielen != p2p_ielen_ori) {
|
||||
|
|
@ -2180,6 +2454,24 @@ void rtw_get_bcn_info(struct wlan_network *pnetwork)
|
|||
}
|
||||
}
|
||||
|
||||
u8 rtw_ht_mcsset_to_nss(u8 *supp_mcs_set)
|
||||
{
|
||||
u8 nss = 1;
|
||||
|
||||
if (supp_mcs_set[3])
|
||||
nss = 4;
|
||||
else if (supp_mcs_set[2])
|
||||
nss = 3;
|
||||
else if (supp_mcs_set[1])
|
||||
nss = 2;
|
||||
else if (supp_mcs_set[0])
|
||||
nss = 1;
|
||||
else
|
||||
DBG_871X("%s,%d, warning! supp_mcs_set is zero\n", __func__, __LINE__);
|
||||
/* DBG_871X("%s HT: %dSS\n", __FUNCTION__, nss); */
|
||||
return nss;
|
||||
}
|
||||
|
||||
//show MCS rate, unit: 100Kbps
|
||||
u16 rtw_mcs_rate(u8 rf_type, u8 bw_40MHz, u8 short_GI, unsigned char * MCS_rate)
|
||||
{
|
||||
|
|
|
|||
205
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_io.c
Executable file → Normal file
205
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_io.c
Executable file → Normal file
|
|
@ -50,6 +50,7 @@ jackson@realtek.com.tw
|
|||
#define _RTW_IO_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
|
|
@ -197,6 +198,111 @@ u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr)
|
|||
_func_exit_;
|
||||
return r_val;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
|
||||
u8 _rtw_sd_iread8(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val = 0x00;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_sd_iread8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
_sd_iread8 = pintfhdl->io_ops._sd_iread8;
|
||||
|
||||
if (_sd_iread8)
|
||||
r_val = _sd_iread8(pintfhdl, addr);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
return r_val;
|
||||
}
|
||||
|
||||
u16 _rtw_sd_iread16(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u16 r_val = 0x00;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u16 (*_sd_iread16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
_sd_iread16 = pintfhdl->io_ops._sd_iread16;
|
||||
|
||||
if (_sd_iread16)
|
||||
r_val = _sd_iread16(pintfhdl, addr);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread16 callback is NULL\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
return r_val;
|
||||
}
|
||||
|
||||
u32 _rtw_sd_iread32(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u32 r_val = 0x00;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 (*_sd_iread32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
_sd_iread32 = pintfhdl->io_ops._sd_iread32;
|
||||
|
||||
if (_sd_iread32)
|
||||
r_val = _sd_iread32(pintfhdl, addr);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iread32 callback is NULL\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
return r_val;
|
||||
}
|
||||
|
||||
int _rtw_sd_iwrite8(_adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_sd_iwrite8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
int ret = -1;
|
||||
|
||||
_sd_iwrite8 = pintfhdl->io_ops._sd_iwrite8;
|
||||
|
||||
if (_sd_iwrite8)
|
||||
ret = _sd_iwrite8(pintfhdl, addr, val);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
int _rtw_sd_iwrite16(_adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_sd_iwrite16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int ret = -1;
|
||||
|
||||
_sd_iwrite16 = pintfhdl->io_ops._sd_iwrite16;
|
||||
|
||||
if (_sd_iwrite16)
|
||||
ret = _sd_iwrite16(pintfhdl, addr, val);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite16 callback is NULL\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_sd_iwrite32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret = -1;
|
||||
|
||||
_sd_iwrite32 = pintfhdl->io_ops._sd_iwrite32;
|
||||
|
||||
if (_sd_iwrite32)
|
||||
ret = _sd_iwrite32(pintfhdl, addr, val);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_err_, FUNC_ADPT_FMT" _sd_iwrite32 callback is NULL\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SDIO_INDIRECT_ACCESS */
|
||||
|
||||
#endif /* CONFIG_SDIO_HCI */
|
||||
|
||||
int _rtw_write8_async(_adapter *adapter, u32 addr, u8 val)
|
||||
|
|
@ -254,10 +360,11 @@ void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
return;
|
||||
if (RTW_CANNOT_RUN(adapter)) {
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_mem:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
|
||||
, rtw_is_drv_stopped(adapter)?"True":"False"
|
||||
, rtw_is_surprise_removed(adapter)?"True":"False"));
|
||||
return;
|
||||
}
|
||||
|
||||
_read_mem = pintfhdl->io_ops._read_mem;
|
||||
|
|
@ -294,9 +401,10 @@ void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
|||
|
||||
_func_enter_;
|
||||
|
||||
if( (adapter->bDriverStopped ==_TRUE) || (adapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%d) OR bSurpriseRemoved(%d)", adapter->bDriverStopped, adapter->bSurpriseRemoved));
|
||||
if (RTW_CANNOT_RUN(adapter)) {
|
||||
RT_TRACE(_module_rtl871x_io_c_, _drv_info_, ("rtw_read_port:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
|
||||
, rtw_is_drv_stopped(adapter)?"True":"False"
|
||||
, rtw_is_surprise_removed(adapter)?"True":"False"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -416,19 +524,19 @@ void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
|
|||
|
||||
#ifdef DBG_IO
|
||||
|
||||
u16 read_sniff_ranges[][2] = {
|
||||
u32 read_sniff_ranges[][2] = {
|
||||
//{0x520, 0x523},
|
||||
};
|
||||
|
||||
u16 write_sniff_ranges[][2] = {
|
||||
u32 write_sniff_ranges[][2] = {
|
||||
//{0x520, 0x523},
|
||||
//{0x4c, 0x4c},
|
||||
};
|
||||
|
||||
int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u16)/2;
|
||||
int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u16)/2;
|
||||
int read_sniff_num = sizeof(read_sniff_ranges)/sizeof(u32)/2;
|
||||
int write_sniff_num = sizeof(write_sniff_ranges)/sizeof(u32)/2;
|
||||
|
||||
bool match_read_sniff_ranges(u16 addr, u16 len)
|
||||
bool match_read_sniff_ranges(u32 addr, u16 len)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i<read_sniff_num; i++) {
|
||||
|
|
@ -439,7 +547,7 @@ bool match_read_sniff_ranges(u16 addr, u16 len)
|
|||
return _FALSE;
|
||||
}
|
||||
|
||||
bool match_write_sniff_ranges(u16 addr, u16 len)
|
||||
bool match_write_sniff_ranges(u32 addr, u16 len)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i<write_sniff_num; i++) {
|
||||
|
|
@ -508,6 +616,77 @@ int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, const cha
|
|||
|
||||
return _rtw_writeN(adapter, addr, length, data);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
u8 dbg_rtw_sd_f0_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u8 val = _rtw_sd_f0_read8(adapter, addr);
|
||||
|
||||
#if 0
|
||||
if (match_read_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d rtw_sd_f0_read8(0x%04x) return 0x%02x\n", caller, line, addr, val);
|
||||
#endif
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_INDIRECT_ACCESS
|
||||
u8 dbg_rtw_sd_iread8(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u8 val = rtw_sd_iread8(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d rtw_sd_iread8(0x%04x) return 0x%02x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
u16 dbg_rtw_sd_iread16(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u16 val = _rtw_sd_iread16(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d rtw_sd_iread16(0x%04x) return 0x%04x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
u32 dbg_rtw_sd_iread32(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u32 val = _rtw_sd_iread32(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d rtw_sd_iread32(0x%04x) return 0x%08x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
int dbg_rtw_sd_iwrite8(_adapter *adapter, u32 addr, u8 val, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite8(0x%04x, 0x%02x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_sd_iwrite8(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_sd_iwrite16(_adapter *adapter, u32 addr, u16 val, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite16(0x%04x, 0x%04x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_sd_iwrite16(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_sd_iwrite32(_adapter *adapter, u32 addr, u32 val, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d rtw_sd_iwrite32(0x%04x, 0x%08x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_sd_iwrite32(adapter, addr, val);
|
||||
}
|
||||
|
||||
#endif /* CONFIG_SDIO_INDIRECT_ACCESS */
|
||||
|
||||
#endif /* CONFIG_SDIO_HCI */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
|
|||
2
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ioctl_query.c
Executable file → Normal file
2
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ioctl_query.c
Executable file → Normal file
|
|
@ -82,7 +82,7 @@ u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIA
|
|||
struct wlan_network *tgt_network;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct security_priv *psecuritypriv=&(padapter->securitypriv);
|
||||
WLAN_BSSID_EX *psecnetwork=(WLAN_BSSID_EX*)&(psecuritypriv->sec_bss);
|
||||
WLAN_BSSID_EX *psecnetwork = (WLAN_BSSID_EX *)&pmlmepriv->cur_network.network;
|
||||
u8 * pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
unsigned char i,*auth_ie,*supp_ie;
|
||||
|
||||
|
|
|
|||
6
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ioctl_rtl.c
Executable file → Normal file
6
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ioctl_rtl.c
Executable file → Normal file
|
|
@ -492,7 +492,6 @@ NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
if(poid_par_priv->type_of_oid != QUERY_OID)
|
||||
{
|
||||
|
|
@ -500,7 +499,7 @@ NDIS_STATUS oid_rt_get_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
return status;
|
||||
}
|
||||
*poid_par_priv->bytes_rw = poid_par_priv->information_buf_len;
|
||||
*(u16 *)poid_par_priv->information_buf = peeprompriv->channel_plan ;
|
||||
*(u16 *)poid_par_priv->information_buf = padapter->mlmepriv.ChannelPlan ;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
@ -508,7 +507,6 @@ NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
{
|
||||
NDIS_STATUS status = NDIS_STATUS_SUCCESS;
|
||||
PADAPTER padapter = (PADAPTER)(poid_par_priv->adapter_context);
|
||||
struct eeprom_priv* peeprompriv = &padapter->eeprompriv;
|
||||
|
||||
if(poid_par_priv->type_of_oid != SET_OID)
|
||||
{
|
||||
|
|
@ -516,7 +514,7 @@ NDIS_STATUS oid_rt_set_channelplan_hdl(struct oid_par_priv* poid_par_priv)
|
|||
return status;
|
||||
}
|
||||
|
||||
peeprompriv->channel_plan = *(u16 *)poid_par_priv->information_buf ;
|
||||
padapter->mlmepriv.ChannelPlan = *(u16 *)poid_par_priv->information_buf ;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
33
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ioctl_set.c
Executable file → Normal file
33
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_ioctl_set.c
Executable file → Normal file
|
|
@ -20,6 +20,7 @@
|
|||
#define _RTW_IOCTL_SET_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
|
||||
extern void indicate_wx_scan_complete_event(_adapter *padapter);
|
||||
|
|
@ -159,9 +160,8 @@ _func_enter_;
|
|||
|
||||
rtw_generate_random_ibss(pibss);
|
||||
|
||||
if(rtw_createbss_cmd(padapter)!=_SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>do_goin: rtw_createbss_cmd status FAIL*** \n "));
|
||||
if (rtw_create_ibss_cmd(padapter, 0) != _SUCCESS) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error=>do_goin: rtw_create_ibss_cmd status FAIL***\n"));
|
||||
ret = _FALSE;
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -415,7 +415,7 @@ _func_enter_;
|
|||
DBG_871X_LEVEL(_drv_always_, "set ssid [%s] fw_state=0x%08x\n",
|
||||
ssid->Ssid, get_fwstate(pmlmepriv));
|
||||
|
||||
if(padapter->hw_init_completed==_FALSE){
|
||||
if (!rtw_is_hw_init_completed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
|
||||
("set_ssid: hw_init_completed==_FALSE=>exit!!!\n"));
|
||||
status = _FAIL;
|
||||
|
|
@ -549,7 +549,7 @@ _func_enter_;
|
|||
goto exit;
|
||||
}
|
||||
|
||||
if(padapter->hw_init_completed==_FALSE){
|
||||
if (!rtw_is_hw_init_completed(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_,
|
||||
("set_ssid: hw_init_completed==_FALSE=>exit!!!\n"));
|
||||
status = _FAIL;
|
||||
|
|
@ -673,7 +673,10 @@ _func_enter_;
|
|||
|
||||
case Ndis802_11AutoUnknown:
|
||||
case Ndis802_11InfrastructureMax:
|
||||
break;
|
||||
break;
|
||||
case Ndis802_11Monitor:
|
||||
set_fwstate(pmlmepriv, WIFI_MONITOR_STATE);
|
||||
break;
|
||||
}
|
||||
|
||||
//SecClearAllKeys(adapter);
|
||||
|
|
@ -732,7 +735,7 @@ _func_enter_;
|
|||
res=_FALSE;
|
||||
goto exit;
|
||||
}
|
||||
if (padapter->hw_init_completed==_FALSE){
|
||||
if (!rtw_is_hw_init_completed(padapter)) {
|
||||
res = _FALSE;
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n===rtw_set_802_11_bssid_list_scan:hw_init_completed==_FALSE===\n"));
|
||||
goto exit;
|
||||
|
|
@ -996,8 +999,8 @@ _func_enter_;
|
|||
}
|
||||
}
|
||||
|
||||
// Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko.
|
||||
if( (encryptionalgo== _WEP40_|| encryptionalgo== _WEP104_) && (key->KeyLength != 5 || key->KeyLength != 13)) {
|
||||
/* Check key length for WEP. For NDTEST, 2005.01.27, by rcnjko. -> modify checking condition*/
|
||||
if (((encryptionalgo == _WEP40_) && (key->KeyLength != 5)) || ((encryptionalgo == _WEP104_) && (key->KeyLength != 13))) {
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("WEP KeyLength:0x%x != 5 or 13\n", key->KeyLength));
|
||||
ret=_FAIL;
|
||||
goto exit;
|
||||
|
|
@ -1252,16 +1255,22 @@ _func_enter_;
|
|||
|
||||
|
||||
//Set key to CAM through H2C command
|
||||
#if 0
|
||||
if(bgrouptkey)//never go to here
|
||||
{
|
||||
res=rtw_setstakey_cmd(padapter, stainfo, _FALSE, _TRUE);
|
||||
res=rtw_setstakey_cmd(padapter, stainfo, GROUP_KEY, _TRUE);
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(group)\n"));
|
||||
}
|
||||
else{
|
||||
res=rtw_setstakey_cmd(padapter, stainfo, _TRUE, _TRUE);
|
||||
res=rtw_setstakey_cmd(padapter, stainfo, UNICAST_KEY, _TRUE);
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n"));
|
||||
}
|
||||
#else
|
||||
|
||||
res = rtw_setstakey_cmd(padapter, stainfo, UNICAST_KEY, _TRUE);
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("\n rtw_set_802_11_add_key:rtw_setstakey_cmd(unicast)\n"));
|
||||
#endif
|
||||
|
||||
if(res ==_FALSE)
|
||||
ret= _FAIL;
|
||||
|
||||
|
|
@ -1469,7 +1478,7 @@ int rtw_set_country(_adapter *adapter, const char *country_code)
|
|||
*
|
||||
* Return _SUCCESS or _FAIL
|
||||
*/
|
||||
int rtw_set_band(_adapter *adapter, enum _BAND band)
|
||||
int rtw_set_band(_adapter *adapter, u8 band)
|
||||
{
|
||||
if (rtw_band_valid(band)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" band:%d\n", FUNC_ADPT_ARG(adapter), band);
|
||||
|
|
|
|||
0
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_iol.c
Executable file → Normal file
0
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_iol.c
Executable file → Normal file
35
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mem.c
Executable file → Normal file
35
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mem.c
Executable file → Normal file
|
|
@ -16,10 +16,28 @@ struct u8 * rtw_get_buf_premem(int index)
|
|||
return rtk_buf_mem[index];
|
||||
}
|
||||
|
||||
struct sk_buff *rtw_alloc_skb_premem(void)
|
||||
u16 rtw_rtkm_get_buff_size(void)
|
||||
{
|
||||
return MAX_RTKM_RECVBUF_SZ;
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_rtkm_get_buff_size);
|
||||
|
||||
u8 rtw_rtkm_get_nr_recv_skb(void)
|
||||
{
|
||||
return MAX_RTKM_NR_PREALLOC_RECV_SKB;
|
||||
}
|
||||
EXPORT_SYMBOL(rtw_rtkm_get_nr_recv_skb);
|
||||
|
||||
struct sk_buff *rtw_alloc_skb_premem(u16 in_size)
|
||||
{
|
||||
struct sk_buff *skb = NULL;
|
||||
|
||||
if (in_size > MAX_RTKM_RECVBUF_SZ) {
|
||||
pr_info("warning %s: driver buffer size(%d) > rtkm buffer size(%d)\n", __func__, in_size, MAX_RTKM_RECVBUF_SZ);
|
||||
WARN_ON(1);
|
||||
return skb;
|
||||
}
|
||||
|
||||
skb = skb_dequeue(&rtk_skb_mem_q);
|
||||
|
||||
printk("%s, rtk_skb_mem_q len : %d\n", __func__, skb_queue_len(&rtk_skb_mem_q));
|
||||
|
|
@ -33,7 +51,7 @@ int rtw_free_skb_premem(struct sk_buff *pskb)
|
|||
if(!pskb)
|
||||
return -1;
|
||||
|
||||
if(skb_queue_len(&rtk_skb_mem_q) >= NR_PREALLOC_RECV_SKB)
|
||||
if (skb_queue_len(&rtk_skb_mem_q) >= MAX_RTKM_NR_PREALLOC_RECV_SKB)
|
||||
return -1;
|
||||
|
||||
skb_queue_tail(&rtk_skb_mem_q, pskb);
|
||||
|
|
@ -47,12 +65,13 @@ EXPORT_SYMBOL(rtw_free_skb_premem);
|
|||
static int __init rtw_mem_init(void)
|
||||
{
|
||||
int i;
|
||||
u32 max_recvbuf_sz = 0;
|
||||
SIZE_PTR tmpaddr=0;
|
||||
SIZE_PTR alignment=0;
|
||||
struct sk_buff *pskb=NULL;
|
||||
|
||||
printk("%s\n", __func__);
|
||||
pr_info("MAX_RTKM_NR_PREALLOC_RECV_SKB: %d\n", MAX_RTKM_NR_PREALLOC_RECV_SKB);
|
||||
pr_info("MAX_RTKM_RECVBUF_SZ: %d\n", MAX_RTKM_RECVBUF_SZ);
|
||||
|
||||
#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX
|
||||
for(i=0; i<NR_RECVBUFF; i++)
|
||||
|
|
@ -63,14 +82,9 @@ static int __init rtw_mem_init(void)
|
|||
|
||||
skb_queue_head_init(&rtk_skb_mem_q);
|
||||
|
||||
if (max_recvbuf_sz == 0)
|
||||
max_recvbuf_sz = MAX_RECVBUF_SZ;
|
||||
|
||||
DBG_871X("%s: max_recvbuf_sz: %d\n", __func__, max_recvbuf_sz);
|
||||
|
||||
for(i=0; i<NR_PREALLOC_RECV_SKB; i++)
|
||||
for(i=0; i<MAX_RTKM_NR_PREALLOC_RECV_SKB; i++)
|
||||
{
|
||||
pskb = __dev_alloc_skb(max_recvbuf_sz + RECVBUFF_ALIGN_SZ, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
|
||||
pskb = __dev_alloc_skb(MAX_RTKM_RECVBUF_SZ + RECVBUFF_ALIGN_SZ, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
|
||||
if(pskb)
|
||||
{
|
||||
tmpaddr = (SIZE_PTR)pskb->data;
|
||||
|
|
@ -106,4 +120,3 @@ static void __exit rtw_mem_exit(void)
|
|||
|
||||
module_init(rtw_mem_init);
|
||||
module_exit(rtw_mem_exit);
|
||||
|
||||
|
|
|
|||
507
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mlme.c
Executable file → Normal file
507
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mlme.c
Executable file → Normal file
|
|
@ -19,8 +19,7 @@
|
|||
******************************************************************************/
|
||||
#define _RTW_MLME_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
#include <hal_data.h>
|
||||
|
||||
extern void indicate_wx_scan_complete_event(_adapter *padapter);
|
||||
extern u8 rtw_do_join(_adapter * padapter);
|
||||
|
|
@ -77,6 +76,9 @@ _func_enter_;
|
|||
//allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf
|
||||
|
||||
rtw_clear_scan_deny(padapter);
|
||||
#ifdef CONFIG_ARP_KEEP_ALIVE
|
||||
pmlmepriv->bGetGateway = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
#define RTW_ROAM_SCAN_RESULT_EXP_MS 5*1000
|
||||
|
|
@ -427,9 +429,11 @@ sint rtw_if_up(_adapter *padapter) {
|
|||
sint res;
|
||||
_func_enter_;
|
||||
|
||||
if( padapter->bDriverStopped || padapter->bSurpriseRemoved ||
|
||||
(check_fwstate(&padapter->mlmepriv, _FW_LINKED)== _FALSE)){
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_if_up:bDriverStopped(%d) OR bSurpriseRemoved(%d)", padapter->bDriverStopped, padapter->bSurpriseRemoved));
|
||||
if (RTW_CANNOT_RUN(padapter) ||
|
||||
(check_fwstate(&padapter->mlmepriv, _FW_LINKED) == _FALSE)) {
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("rtw_if_up:bDriverStopped(%s) OR bSurpriseRemoved(%s)"
|
||||
, rtw_is_drv_stopped(padapter)?"True":"False"
|
||||
, rtw_is_surprise_removed(padapter)?"True":"False"));
|
||||
res=_FALSE;
|
||||
}
|
||||
else
|
||||
|
|
@ -755,6 +759,11 @@ _func_enter_;
|
|||
rssi_final = (src->Rssi+dst->Rssi*4)/5;
|
||||
else
|
||||
rssi_final = rssi_ori;
|
||||
|
||||
if (dst->Configuration.DSConfig !=
|
||||
src -> Configuration.DSConfig)
|
||||
dst->Configuration.DSConfig =
|
||||
src->Configuration.DSConfig;
|
||||
}
|
||||
else {
|
||||
if(sq_smp != 101) { /* from the right channel */
|
||||
|
|
@ -1025,7 +1034,8 @@ _func_enter_;
|
|||
//_enter_critical_bh(&queue->lock, &irqL);
|
||||
|
||||
#if defined(CONFIG_P2P) && defined(CONFIG_P2P_REMOVE_GROUP_INFO)
|
||||
rtw_WLAN_BSSID_EX_remove_p2p_attr(pnetwork, P2P_ATTR_GROUP_INFO);
|
||||
if (adapter->registrypriv.wifi_spec == 0)
|
||||
rtw_WLAN_BSSID_EX_remove_p2p_attr(pnetwork, P2P_ATTR_GROUP_INFO);
|
||||
#endif
|
||||
|
||||
update_current_network(adapter, pnetwork);
|
||||
|
|
@ -1198,22 +1208,27 @@ _func_exit_;
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
_irqL irqL;
|
||||
u8 timer_cancelled;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
|
||||
#ifdef CONFIG_MLME_EXT
|
||||
struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
struct wlan_network *pnetwork_s = NULL;
|
||||
struct wlan_network *pnetwork_t = NULL;
|
||||
WLAN_BSSID_EX *bssid_ex_s = NULL;
|
||||
WLAN_BSSID_EX *bssid_ex_t = NULL;
|
||||
u32 cur_ch = 0, ch = 0;
|
||||
|
||||
#ifdef CONFIG_MLME_EXT
|
||||
mlmeext_surveydone_event_callback(adapter);
|
||||
#endif
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
if(pmlmepriv->wps_probe_req_ie) {
|
||||
if (pmlmepriv->wps_probe_req_ie) {
|
||||
u32 free_len = pmlmepriv->wps_probe_req_ie_len;
|
||||
pmlmepriv->wps_probe_req_ie_len = 0;
|
||||
rtw_mfree(pmlmepriv->wps_probe_req_ie, free_len);
|
||||
|
|
@ -1228,7 +1243,6 @@ _func_enter_;
|
|||
}
|
||||
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
_cancel_timer(&pmlmepriv->scan_to_timer, &timer_cancelled);
|
||||
|
|
@ -1247,12 +1261,12 @@ _func_enter_;
|
|||
{
|
||||
set_fwstate(pmlmepriv, _FW_UNDER_LINKING);
|
||||
|
||||
if(rtw_select_and_join_from_scanned_queue(pmlmepriv)==_SUCCESS)
|
||||
{
|
||||
_set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT );
|
||||
}
|
||||
else
|
||||
{
|
||||
if(rtw_select_and_join_from_scanned_queue(pmlmepriv)==_SUCCESS)
|
||||
{
|
||||
_set_timer(&pmlmepriv->assoc_timer, MAX_JOIN_TIMEOUT);
|
||||
}
|
||||
else
|
||||
{
|
||||
WLAN_BSSID_EX *pdev_network = &(adapter->registrypriv.dev_network);
|
||||
u8 *pibss = adapter->registrypriv.dev_network.MacAddress;
|
||||
|
||||
|
|
@ -1267,12 +1281,11 @@ _func_enter_;
|
|||
rtw_update_registrypriv_dev_network(adapter);
|
||||
rtw_generate_random_ibss(pibss);
|
||||
|
||||
pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
|
||||
|
||||
pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
|
||||
|
||||
if(rtw_createbss_cmd(adapter)!=_SUCCESS)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_err_,("Error=>rtw_createbss_cmd status FAIL\n"));
|
||||
}
|
||||
if (rtw_create_ibss_cmd(adapter, 0) != _SUCCESS)
|
||||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_err_, ("Error=>rtw_create_ibss_cmd status FAIL\n"));
|
||||
|
||||
pmlmepriv->to_join = _FALSE;
|
||||
}
|
||||
|
|
@ -1333,6 +1346,38 @@ _func_enter_;
|
|||
}
|
||||
}
|
||||
}
|
||||
/* check scan queue exist the same bssid but different ch*/
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE) &&
|
||||
check_fwstate(pmlmepriv, _FW_LINKED)){
|
||||
pnetwork_s = &(pmlmepriv->cur_network);
|
||||
bssid_ex_s = &(pmlmeinfo->network);
|
||||
pnetwork_t =
|
||||
rtw_find_same_network(&pmlmepriv->scanned_queue,
|
||||
pnetwork_s);
|
||||
if (pnetwork_t == NULL) {
|
||||
DBG_871X("%s: Warning! pnetwork_t=NULL. fw_state=0x%x\n",
|
||||
__func__, get_fwstate(pmlmepriv));
|
||||
}
|
||||
|
||||
bssid_ex_t = &(pnetwork_t->network);
|
||||
|
||||
if (pnetwork_t != NULL && bssid_ex_s != NULL && bssid_ex_t != NULL) {
|
||||
cur_ch = bssid_ex_s->Configuration.DSConfig;
|
||||
ch = bssid_ex_t->Configuration.DSConfig;
|
||||
if (cur_ch != ch) {
|
||||
DBG_871X("[-]" MAC_FMT "(ch: %d)\n",
|
||||
MAC_ARG(bssid_ex_s->MacAddress),
|
||||
cur_ch);
|
||||
|
||||
DBG_871X("[+]" MAC_FMT "(ch: %d)\n",
|
||||
MAC_ARG(bssid_ex_t->MacAddress),
|
||||
ch);
|
||||
rtw_disassoc_cmd(adapter, 0, _TRUE);
|
||||
rtw_indicate_disconnect(adapter);
|
||||
rtw_free_assoc_resources(adapter, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//DBG_871X("scan complete in %dms\n",rtw_get_passing_time_ms(pmlmepriv->scan_start_time));
|
||||
|
|
@ -1349,9 +1394,6 @@ _func_enter_;
|
|||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
rtw_os_xmit_schedule(adapter->pbuddy_adapter);
|
||||
#endif
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
dc_resume_xmit(adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DRVEXT_MODULE_WSC
|
||||
drvext_surveydone_callback(&adapter->drvextpriv);
|
||||
|
|
@ -1472,16 +1514,14 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("tgt_network->network.MacAddress="MAC_FMT" ssid=%s\n",
|
||||
MAC_ARG(tgt_network->network.MacAddress), tgt_network->network.Ssid.Ssid));
|
||||
|
||||
if(check_fwstate( pmlmepriv, WIFI_STATION_STATE|WIFI_AP_STATE))
|
||||
{
|
||||
if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
|
||||
struct sta_info* psta;
|
||||
|
||||
psta = rtw_get_stainfo(&adapter->stapriv, tgt_network->network.MacAddress);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(ptdlsinfo->link_established == _TRUE)
|
||||
{
|
||||
rtw_tdls_cmd(adapter, myid(&(adapter->eeprompriv)), TDLS_RS_RCR);
|
||||
if (ptdlsinfo->link_established == _TRUE) {
|
||||
rtw_tdls_cmd(adapter, NULL, TDLS_RS_RCR);
|
||||
rtw_reset_tdls_info(adapter);
|
||||
rtw_free_all_stainfo(adapter);
|
||||
//_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL);
|
||||
|
|
@ -1497,8 +1537,7 @@ _func_enter_;
|
|||
|
||||
}
|
||||
|
||||
if(check_fwstate( pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE|WIFI_AP_STATE))
|
||||
{
|
||||
if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE|WIFI_ADHOC_MASTER_STATE)) {
|
||||
struct sta_info* psta;
|
||||
|
||||
rtw_free_all_stainfo(adapter);
|
||||
|
|
@ -1514,7 +1553,7 @@ _func_enter_;
|
|||
if(lock_scanned_queue)
|
||||
_enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL);
|
||||
|
||||
pwlan = rtw_find_network(&pmlmepriv->scanned_queue, tgt_network->network.MacAddress);
|
||||
pwlan = _rtw_find_same_network(&pmlmepriv->scanned_queue, tgt_network);
|
||||
if(pwlan)
|
||||
{
|
||||
pwlan->fixed = _FALSE;
|
||||
|
|
@ -1538,7 +1577,8 @@ _func_enter_;
|
|||
if((check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) && (adapter->stapriv.asoc_sta_count== 1))
|
||||
/*||check_fwstate(pmlmepriv, WIFI_STATION_STATE)*/)
|
||||
{
|
||||
rtw_free_network_nolock(adapter, pwlan);
|
||||
if (pwlan)
|
||||
rtw_free_network_nolock(adapter, pwlan);
|
||||
}
|
||||
|
||||
if(lock_scanned_queue)
|
||||
|
|
@ -1719,36 +1759,86 @@ inline void rtw_indicate_scan_done( _adapter *padapter, bool aborted)
|
|||
#endif // CONFIG_IPS
|
||||
}
|
||||
|
||||
void rtw_scan_abort(_adapter *adapter)
|
||||
static u32 _rtw_wait_scan_done(_adapter *adapter, u8 abort, u32 timeout_ms)
|
||||
{
|
||||
u32 cnt=0;
|
||||
u32 start;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv);
|
||||
u32 pass_ms;
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv);
|
||||
|
||||
start = rtw_get_current_time();
|
||||
pmlmeext->scan_abort = _TRUE;
|
||||
while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
|
||||
&& rtw_get_passing_time_ms(start) <= 200) {
|
||||
|
||||
pmlmeext->scan_abort = abort;
|
||||
|
||||
if (timeout_ms > 0) {
|
||||
while (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)
|
||||
&& rtw_get_passing_time_ms(start) <= timeout_ms) {
|
||||
|
||||
if (adapter->bDriverStopped || adapter->bSurpriseRemoved)
|
||||
break;
|
||||
if (RTW_CANNOT_RUN(adapter))
|
||||
break;
|
||||
|
||||
DBG_871X(FUNC_NDEV_FMT"fw_state=_FW_UNDER_SURVEY!\n", FUNC_NDEV_ARG(adapter->pnetdev));
|
||||
rtw_msleep_os(20);
|
||||
DBG_871X(FUNC_NDEV_FMT"fw_state=_FW_UNDER_SURVEY!\n",
|
||||
FUNC_NDEV_ARG(adapter->pnetdev));
|
||||
|
||||
rtw_msleep_os(20);
|
||||
}
|
||||
}
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) {
|
||||
if (!adapter->bDriverStopped && !adapter->bSurpriseRemoved)
|
||||
DBG_871X(FUNC_NDEV_FMT"waiting for scan_abort time out!\n", FUNC_NDEV_ARG(adapter->pnetdev));
|
||||
#ifdef CONFIG_PLATFORM_MSTAR
|
||||
//_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
set_survey_timer(pmlmeext, 0);
|
||||
_set_timer(&pmlmepriv->scan_to_timer, 50);
|
||||
#endif
|
||||
rtw_indicate_scan_done(adapter, _TRUE);
|
||||
if (_TRUE == abort) {
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY)) {
|
||||
if (!RTW_CANNOT_RUN(adapter))
|
||||
DBG_871X(FUNC_NDEV_FMT"waiting for scan_abort time out!\n", FUNC_NDEV_ARG(adapter->pnetdev));
|
||||
#ifdef CONFIG_PLATFORM_MSTAR
|
||||
/*_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);*/
|
||||
set_survey_timer(pmlmeext, 0);
|
||||
mlme_set_scan_to_timer(pmlmepriv, 50);
|
||||
#endif
|
||||
rtw_indicate_scan_done(adapter, _TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
pmlmeext->scan_abort = _FALSE;
|
||||
pass_ms = rtw_get_passing_time_ms(start);
|
||||
|
||||
return pass_ms;
|
||||
|
||||
}
|
||||
|
||||
void rtw_scan_wait_completed(_adapter *adapter)
|
||||
{
|
||||
u32 scan_to = SCANNING_TIMEOUT;
|
||||
|
||||
#ifdef CONFIG_SCAN_BACKOP
|
||||
if (IsSupported5G(adapter->registrypriv.wireless_mode)
|
||||
&& IsSupported24G(adapter->registrypriv.wireless_mode)) /*dual band*/
|
||||
scan_to = CONC_SCANNING_TIMEOUT_DUAL_BAND;
|
||||
else /*single band*/
|
||||
scan_to = CONC_SCANNING_TIMEOUT_SINGLE_BAND;
|
||||
#endif /* CONFIG_SCAN_BACKOP */
|
||||
|
||||
_rtw_wait_scan_done(adapter, _FALSE, scan_to);
|
||||
}
|
||||
|
||||
u32 rtw_scan_abort_timeout(_adapter *adapter, u32 timeout_ms)
|
||||
{
|
||||
return _rtw_wait_scan_done(adapter, _TRUE, timeout_ms);
|
||||
}
|
||||
|
||||
void rtw_scan_abort_no_wait(_adapter *adapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(adapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(adapter->mlmeextpriv);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
pmlmeext->scan_abort = _TRUE;
|
||||
}
|
||||
|
||||
void rtw_scan_abort(_adapter *adapter)
|
||||
{
|
||||
if (adapter->net_closed == _TRUE)
|
||||
rtw_scan_abort_timeout(adapter, 0);
|
||||
else
|
||||
rtw_scan_abort_timeout(adapter, 200);
|
||||
}
|
||||
|
||||
static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wlan_network *pnetwork)
|
||||
|
|
@ -1844,6 +1934,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl
|
|||
#endif
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
preorder_ctrl->wsize_b = 64;//max_ampdu_sz;//ex. 32(kbytes) -> wsize_b=32
|
||||
preorder_ctrl->ampdu_size = RX_AMPDU_SIZE_INVALID;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1862,6 +1953,7 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl
|
|||
#endif
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
preorder_ctrl->wsize_b = 64;//max_ampdu_sz;//ex. 32(kbytes) -> wsize_b=32
|
||||
preorder_ctrl->ampdu_size = RX_AMPDU_SIZE_INVALID;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2178,10 +2270,6 @@ _func_enter_;
|
|||
rtw_os_xmit_schedule(adapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DUALMAC_CONCURRENT
|
||||
dc_resume_xmit(adapter);
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
|
@ -2387,7 +2475,7 @@ _func_enter_;
|
|||
|
||||
#ifdef CONFIG_RTL8711
|
||||
//submit SetStaKey_cmd to tell fw, fw will allocate an CAM entry for this sta
|
||||
rtw_setstakey_cmd(adapter, psta, _FALSE, _TRUE);
|
||||
rtw_setstakey_cmd(adapter, psta, GROUP_KEY, _TRUE);
|
||||
#endif
|
||||
|
||||
exit:
|
||||
|
|
@ -2396,6 +2484,38 @@ _func_exit_;
|
|||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
void rtw_sta_timeout_event_callback(_adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
_irqL irqL;
|
||||
struct sta_info *psta;
|
||||
struct stadel_event *pstadel = (struct stadel_event *)pbuf;
|
||||
struct sta_priv *pstapriv = &adapter->stapriv;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
psta = rtw_get_stainfo(&adapter->stapriv, pstadel->macaddr);
|
||||
|
||||
if (psta) {
|
||||
u8 updated = _FALSE;
|
||||
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
if (rtw_is_list_empty(&psta->asoc_list) == _FALSE) {
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
pstapriv->asoc_list_cnt--;
|
||||
updated = ap_free_sta(adapter, psta, _TRUE, WLAN_REASON_PREV_AUTH_NOT_VALID, _TRUE);
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL);
|
||||
|
||||
associated_clients_update(adapter, updated, STA_INFO_UPDATE_ALL);
|
||||
}
|
||||
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
|
||||
void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf)
|
||||
{
|
||||
_irqL irqL,irqL2;
|
||||
|
|
@ -2427,7 +2547,7 @@ _func_enter_;
|
|||
//for STA,AP,ADHOC mode, report disconnect stauts to FW
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_H2C_MEDIA_STATUS_RPT, (u8 *)&media_status);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
//if(check_fwstate(pmlmepriv, WIFI_AP_STATE))
|
||||
if((pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
|
||||
{
|
||||
|
|
@ -2435,12 +2555,13 @@ _func_enter_;
|
|||
#ifdef COMPAT_KERNEL_RELEASE
|
||||
|
||||
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) || defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER)
|
||||
rtw_cfg80211_indicate_sta_disassoc(adapter, pstadel->macaddr, *(u16*)pstadel->rsvd);
|
||||
rtw_cfg80211_indicate_sta_disassoc(adapter, pstadel->macaddr, *(u16*)pstadel->rsvd);
|
||||
#endif //(LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)) || defined(CONFIG_CFG80211_FORCE_COMPATIBLE_2_6_37_UNDER)
|
||||
#endif //CONFIG_IOCTL_CFG80211
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
mlmeext_sta_del_event_callback(adapter);
|
||||
|
|
@ -2541,14 +2662,9 @@ _func_enter_;
|
|||
_clr_fwstate_(pmlmepriv, WIFI_ADHOC_STATE);
|
||||
}
|
||||
|
||||
if(rtw_createbss_cmd(adapter)!=_SUCCESS)
|
||||
{
|
||||
if (rtw_create_ibss_cmd(adapter, 0) != _SUCCESS)
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_, _drv_err_, ("***Error=>stadel_event_callback: rtw_create_ibss_cmd status FAIL***\n"));
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_set_c_,_drv_err_,("***Error=>stadel_event_callback: rtw_createbss_cmd status FAIL*** \n "));
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2600,7 +2716,7 @@ void _rtw_join_timeout_handler (_adapter *adapter)
|
|||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
#if 0
|
||||
if (adapter->bDriverStopped == _TRUE){
|
||||
if (rtw_is_drv_stopped(adapter)) {
|
||||
_rtw_up_sema(&pmlmepriv->assoc_terminate);
|
||||
return;
|
||||
}
|
||||
|
|
@ -2611,7 +2727,7 @@ _func_enter_;
|
|||
|
||||
DBG_871X("%s, fw_state=%x\n", __FUNCTION__, get_fwstate(pmlmepriv));
|
||||
|
||||
if(adapter->bDriverStopped ||adapter->bSurpriseRemoved)
|
||||
if (RTW_CANNOT_RUN(adapter))
|
||||
return;
|
||||
|
||||
|
||||
|
|
@ -2676,16 +2792,19 @@ _func_exit_;
|
|||
void rtw_scan_timeout_handler (_adapter *adapter)
|
||||
{
|
||||
_irqL irqL;
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
DBG_871X(FUNC_ADPT_FMT" fw_state=%x\n", FUNC_ADPT_ARG(adapter), get_fwstate(pmlmepriv));
|
||||
|
||||
_enter_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
_clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY);
|
||||
|
||||
|
||||
_exit_critical_bh(&pmlmepriv->lock, &irqL);
|
||||
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
rtw_cfg80211_surveydone_event_callback(adapter);
|
||||
#endif //CONFIG_IOCTL_CFG80211
|
||||
|
||||
rtw_indicate_scan_done(adapter, _TRUE);
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE) && defined(CONFIG_IOCTL_CFG80211)
|
||||
|
|
@ -2740,6 +2859,40 @@ exit:
|
|||
return;
|
||||
}
|
||||
|
||||
void rtw_drv_scan_by_self(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
||||
if (!padapter->registrypriv.wifi_spec) {
|
||||
if (check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING)) == _TRUE) {
|
||||
DBG_871X(FUNC_ADPT_FMT" _FW_UNDER_SURVEY|_FW_UNDER_LINKING\n", FUNC_ADPT_ARG(padapter));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (pmlmepriv->LinkDetectInfo.bBusyTraffic == _TRUE) {
|
||||
DBG_871X(FUNC_ADPT_FMT" exit BusyTraffic\n", FUNC_ADPT_ARG(padapter));
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_buddy_adapter_up(padapter)) {
|
||||
if ((check_buddy_fwstate(padapter, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING)) == _TRUE) ||
|
||||
(padapter->pbuddy_adapter->mlmepriv.LinkDetectInfo.bBusyTraffic == _TRUE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT", but buddy_intf is under scanning or linking or BusyTraffic\n", FUNC_ADPT_ARG(padapter));
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
rtw_set_802_11_bssid_list_scan(padapter, NULL, 0);
|
||||
|
||||
exit:
|
||||
return;
|
||||
}
|
||||
|
||||
static void rtw_auto_scan_handler(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
|
|
@ -2747,49 +2900,14 @@ static void rtw_auto_scan_handler(_adapter *padapter)
|
|||
rtw_mlme_reset_auto_scan_int(padapter);
|
||||
|
||||
if (pmlmepriv->auto_scan_int_ms != 0
|
||||
&& rtw_get_passing_time_ms(pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms) {
|
||||
|
||||
if (!padapter->registrypriv.wifi_spec) {
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE)
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT" _FW_UNDER_SURVEY|_FW_UNDER_LINKING\n", FUNC_ADPT_ARG(padapter));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if(pmlmepriv->LinkDetectInfo.bBusyTraffic == _TRUE)
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT" exit BusyTraffic\n", FUNC_ADPT_ARG(padapter));
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if (rtw_buddy_adapter_up(padapter))
|
||||
{
|
||||
if ((check_buddy_fwstate(padapter, _FW_UNDER_SURVEY|_FW_UNDER_LINKING) == _TRUE) ||
|
||||
(padapter->pbuddy_adapter->mlmepriv.LinkDetectInfo.bBusyTraffic == _TRUE))
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT", but buddy_intf is under scanning or linking or BusyTraffic\n"
|
||||
, FUNC_ADPT_ARG(padapter));
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
rtw_set_802_11_bssid_list_scan(padapter, NULL, 0);
|
||||
}
|
||||
|
||||
exit:
|
||||
return;
|
||||
&& rtw_get_passing_time_ms(pmlmepriv->scan_start_time) > pmlmepriv->auto_scan_int_ms)
|
||||
rtw_drv_scan_by_self(padapter);
|
||||
|
||||
}
|
||||
|
||||
void rtw_dynamic_check_timer_handlder(_adapter *adapter)
|
||||
{
|
||||
#ifdef CONFIG_AP_MODE
|
||||
struct mlme_priv *pmlmepriv = &adapter->mlmepriv;
|
||||
#endif //CONFIG_AP_MODE
|
||||
struct registry_priv *pregistrypriv = &adapter->registrypriv;
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
PADAPTER pbuddy_adapter = adapter->pbuddy_adapter;
|
||||
|
|
@ -2798,10 +2916,10 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter)
|
|||
if(!adapter)
|
||||
return;
|
||||
|
||||
if(adapter->hw_init_completed == _FALSE)
|
||||
if (!rtw_is_hw_init_completed(adapter))
|
||||
return;
|
||||
|
||||
if ((adapter->bDriverStopped == _TRUE)||(adapter->bSurpriseRemoved== _TRUE))
|
||||
if (RTW_CANNOT_RUN(adapter))
|
||||
return;
|
||||
|
||||
|
||||
|
|
@ -2821,11 +2939,13 @@ void rtw_dynamic_check_timer_handlder(_adapter *adapter)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
if(is_primary_adapter(adapter))
|
||||
DBG_871X("IsBtDisabled=%d, IsBtControlLps=%d\n", rtw_btcoex_IsBtDisabled(adapter), rtw_btcoex_IsBtControlLps(adapter));
|
||||
if (is_primary_adapter(adapter)) {
|
||||
if (GET_HAL_DATA(adapter)->EEPROMBluetoothCoexist == 1)
|
||||
DBG_871X("IsBtDisabled=%d, IsBtControlLps=%d\n" , rtw_btcoex_IsBtDisabled(adapter) , rtw_btcoex_IsBtControlLps(adapter));
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LPS_LCLK_WD_TIMER
|
||||
#ifdef CONFIG_LPS_LCLK_WD_TIMER /* to avoid leaving lps 32k frequently*/
|
||||
if ((adapter_to_pwrctl(adapter)->bFwCurrentInPSMode ==_TRUE )
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
&& (rtw_btcoex_IsBtControlLps(adapter) == _FALSE)
|
||||
|
|
@ -2917,7 +3037,7 @@ inline void rtw_clear_scan_deny(_adapter *adapter)
|
|||
struct mlme_priv *mlmepriv = &adapter->mlmepriv;
|
||||
ATOMIC_SET(&mlmepriv->set_scan_deny, 0);
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
|
||||
}
|
||||
|
||||
void rtw_set_scan_deny_timer_hdl(_adapter *adapter)
|
||||
|
|
@ -2933,7 +3053,7 @@ void rtw_set_scan_deny(_adapter *adapter, u32 ms)
|
|||
#endif
|
||||
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter));
|
||||
ATOMIC_SET(&mlmepriv->set_scan_deny, 1);
|
||||
_set_timer(&mlmepriv->set_scan_deny_timer, ms);
|
||||
|
||||
|
|
@ -2942,7 +3062,7 @@ void rtw_set_scan_deny(_adapter *adapter, u32 ms)
|
|||
return;
|
||||
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter->pbuddy_adapter));
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter->pbuddy_adapter));
|
||||
b_mlmepriv = &adapter->pbuddy_adapter->mlmepriv;
|
||||
ATOMIC_SET(&b_mlmepriv->set_scan_deny, 1);
|
||||
_set_timer(&b_mlmepriv->set_scan_deny_timer, ms);
|
||||
|
|
@ -3042,11 +3162,11 @@ _func_enter_;
|
|||
mlme->pscanned = get_next(mlme->pscanned);
|
||||
|
||||
if (0)
|
||||
DBG_871X("%s("MAC_FMT", ch%u) rssi:%d\n"
|
||||
, pnetwork->network.Ssid.Ssid
|
||||
, MAC_ARG(pnetwork->network.MacAddress)
|
||||
, pnetwork->network.Configuration.DSConfig
|
||||
, (int)pnetwork->network.Rssi);
|
||||
DBG_871X("%s("MAC_FMT", ch%u) rssi:%d\n"
|
||||
, pnetwork->network.Ssid.Ssid
|
||||
, MAC_ARG(pnetwork->network.MacAddress)
|
||||
, pnetwork->network.Configuration.DSConfig
|
||||
, (int)pnetwork->network.Rssi);
|
||||
|
||||
rtw_check_roaming_candidate(mlme, &candidate, pnetwork);
|
||||
|
||||
|
|
@ -3120,16 +3240,11 @@ static int rtw_check_join_candidate(struct mlme_priv *mlme
|
|||
}
|
||||
|
||||
if(updated){
|
||||
DBG_871X("[by_bssid:%u][assoc_ssid:%s]"
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
"[to_roam:%u] "
|
||||
#endif
|
||||
DBG_871X("[by_bssid:%u][assoc_ssid:%s][to_roam:%u] "
|
||||
"new candidate: %s("MAC_FMT", ch%u) rssi:%d\n",
|
||||
mlme->assoc_by_bssid,
|
||||
mlme->assoc_ssid.Ssid,
|
||||
#ifdef CONFIG_LAYER2_ROAMING
|
||||
rtw_to_roam(adapter),
|
||||
#endif
|
||||
(*candidate)->network.Ssid.Ssid,
|
||||
MAC_ARG((*candidate)->network.MacAddress),
|
||||
(*candidate)->network.Configuration.DSConfig,
|
||||
|
|
@ -3192,11 +3307,11 @@ _func_enter_;
|
|||
pmlmepriv->pscanned = get_next(pmlmepriv->pscanned);
|
||||
|
||||
if (0)
|
||||
DBG_871X("%s("MAC_FMT", ch%u) rssi:%d\n"
|
||||
, pnetwork->network.Ssid.Ssid
|
||||
, MAC_ARG(pnetwork->network.MacAddress)
|
||||
, pnetwork->network.Configuration.DSConfig
|
||||
, (int)pnetwork->network.Rssi);
|
||||
DBG_871X("%s("MAC_FMT", ch%u) rssi:%d\n"
|
||||
, pnetwork->network.Ssid.Ssid
|
||||
, MAC_ARG(pnetwork->network.MacAddress)
|
||||
, pnetwork->network.Configuration.DSConfig
|
||||
, (int)pnetwork->network.Rssi);
|
||||
|
||||
rtw_check_join_candidate(pmlmepriv, &candidate, pnetwork);
|
||||
|
||||
|
|
@ -3639,9 +3754,8 @@ _func_exit_;
|
|||
void rtw_init_registrypriv_dev_network( _adapter* adapter)
|
||||
{
|
||||
struct registry_priv* pregistrypriv = &adapter->registrypriv;
|
||||
struct eeprom_priv* peepriv = &adapter->eeprompriv;
|
||||
WLAN_BSSID_EX *pdev_network = &pregistrypriv->dev_network;
|
||||
u8 *myhwaddr = myid(peepriv);
|
||||
u8 *myhwaddr = adapter_mac_addr(adapter);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
|
@ -3669,6 +3783,7 @@ void rtw_update_registrypriv_dev_network(_adapter* adapter)
|
|||
struct security_priv* psecuritypriv = &adapter->securitypriv;
|
||||
struct wlan_network *cur_network = &adapter->mlmepriv.cur_network;
|
||||
//struct xmit_priv *pxmitpriv = &adapter->xmitpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &adapter->mlmeextpriv;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
|
@ -3716,9 +3831,15 @@ _func_enter_;
|
|||
pdev_network->Configuration.DSConfig = (pregistrypriv->channel);
|
||||
RT_TRACE(_module_rtl871x_mlme_c_,_drv_info_,("pregistrypriv->channel=%d, pdev_network->Configuration.DSConfig=0x%x\n", pregistrypriv->channel, pdev_network->Configuration.DSConfig));
|
||||
|
||||
if(cur_network->network.InfrastructureMode == Ndis802_11IBSS)
|
||||
if (cur_network->network.InfrastructureMode == Ndis802_11IBSS) {
|
||||
pdev_network->Configuration.ATIMWindow = (0);
|
||||
|
||||
if (pmlmeext->cur_channel != 0)
|
||||
pdev_network->Configuration.DSConfig = pmlmeext->cur_channel;
|
||||
else
|
||||
pdev_network->Configuration.DSConfig = 1;
|
||||
}
|
||||
|
||||
pdev_network->InfrastructureMode = (cur_network->network.InfrastructureMode);
|
||||
|
||||
// 1. Supported rates
|
||||
|
|
@ -3818,7 +3939,7 @@ void rtw_ht_use_default_setting(_adapter *padapter)
|
|||
SET_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_TX);
|
||||
}
|
||||
if (phtpriv->ldpc_cap)
|
||||
DBG_871X("[HT] Support LDPC = 0x%02X\n", phtpriv->ldpc_cap);
|
||||
DBG_871X("[HT] HAL Support LDPC = 0x%02X\n", phtpriv->ldpc_cap);
|
||||
|
||||
// STBC
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_TX_STBC, (u8 *)&bHwSTBCSupport);
|
||||
|
|
@ -3835,7 +3956,7 @@ void rtw_ht_use_default_setting(_adapter *padapter)
|
|||
SET_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_RX);
|
||||
}
|
||||
if (phtpriv->stbc_cap)
|
||||
DBG_871X("[HT] Support STBC = 0x%02X\n", phtpriv->stbc_cap);
|
||||
DBG_871X("[HT] HAL Support STBC = 0x%02X\n", phtpriv->stbc_cap);
|
||||
|
||||
// Beamforming setting
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMER, (u8 *)&bHwSupportBeamformer);
|
||||
|
|
@ -3844,15 +3965,14 @@ void rtw_ht_use_default_setting(_adapter *padapter)
|
|||
if(TEST_FLAG(pregistrypriv->beamform_cap, BIT4) && bHwSupportBeamformer)
|
||||
{
|
||||
SET_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMER_ENABLE);
|
||||
DBG_871X("[HT] Support Beamformer\n");
|
||||
DBG_871X("[HT] HAL Support Beamformer\n");
|
||||
}
|
||||
if(TEST_FLAG(pregistrypriv->beamform_cap, BIT5) && bHwSupportBeamformee)
|
||||
{
|
||||
SET_FLAG(phtpriv->beamform_cap, BEAMFORMING_HT_BEAMFORMEE_ENABLE);
|
||||
DBG_871X("[HT] Support Beamformee\n");
|
||||
DBG_871X("[HT] HAL Support Beamformee\n");
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_build_wmm_ie_ht(_adapter *padapter, u8 *out_ie, uint *pout_len)
|
||||
{
|
||||
unsigned char WMM_IE[] = {0x00, 0x50, 0xf2, 0x02, 0x00, 0x01, 0x00};
|
||||
|
|
@ -3938,19 +4058,28 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
|
|||
ht_capie.cap_info |= IEEE80211_HT_CAP_SGI_40;
|
||||
}
|
||||
|
||||
if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX))
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_TX_STBC;
|
||||
|
||||
/* todo: disable SM power save mode */
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_SM_PS;
|
||||
|
||||
/* RX LDPC */
|
||||
if (TEST_FLAG(phtpriv->ldpc_cap, LDPC_HT_ENABLE_RX)) {
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_LDPC_CODING;
|
||||
DBG_871X("[HT] Declare supporting RX LDPC\n");
|
||||
}
|
||||
|
||||
/* TX STBC */
|
||||
if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_TX)) {
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_TX_STBC;
|
||||
DBG_871X("[HT] Declare supporting TX STBC\n");
|
||||
}
|
||||
|
||||
/* RX STBC */
|
||||
if (TEST_FLAG(phtpriv->stbc_cap, STBC_HT_ENABLE_RX)) {
|
||||
if((pregistrypriv->rx_stbc == 0x3) || /* enable for 2.4/5 GHz */
|
||||
((channel <= 14) && (pregistrypriv->rx_stbc == 0x1)) || /* enable for 2.4GHz */
|
||||
((channel <= 14) && (pregistrypriv->rx_stbc == 0x1)) || /* enable for 2.4GHz */
|
||||
((channel > 14) && (pregistrypriv->rx_stbc == 0x2)) || /* enable for 5GHz */
|
||||
(pregistrypriv->wifi_spec == 1)) {
|
||||
stbc_rx_enable = 1;
|
||||
DBG_871X("declare supporting RX STBC\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -3964,18 +4093,20 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
|
|||
{
|
||||
case RF_1T1R:
|
||||
|
||||
if (stbc_rx_enable)
|
||||
if (stbc_rx_enable) {
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_RX_STBC_1R;//RX STBC One spatial stream
|
||||
DBG_871X("[HT] Declare supporting RX STBC_1R\n");
|
||||
}
|
||||
|
||||
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_1R);
|
||||
break;
|
||||
|
||||
case RF_2T2R:
|
||||
case RF_1T2R:
|
||||
default:
|
||||
|
||||
if (stbc_rx_enable)
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_RX_STBC_2R;//RX STBC two spatial stream
|
||||
if (stbc_rx_enable) {
|
||||
ht_capie.cap_info |= IEEE80211_HT_CAP_RX_STBC_1R;/* RX STBC one spatial stream */
|
||||
DBG_871X("[HT] Declare supporting RX STBC_1R\n");
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DISABLE_MCS13TO15
|
||||
if(((cbw40_enable == 1) && (operation_bw == CHANNEL_WIDTH_40)) && (pregistrypriv->wifi_spec!=1))
|
||||
|
|
@ -3983,9 +4114,14 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui
|
|||
else
|
||||
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R);
|
||||
#else //CONFIG_DISABLE_MCS13TO15
|
||||
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R);
|
||||
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_2R);
|
||||
#endif //CONFIG_DISABLE_MCS13TO15
|
||||
break;
|
||||
case RF_3T3R:
|
||||
set_mcs_rate_by_mask(ht_capie.supp_mcs_set, MCS_RATE_3R);
|
||||
break;
|
||||
default:
|
||||
DBG_871X("[warning] rf_type %d is not expected\n", rf_type);
|
||||
}
|
||||
|
||||
{
|
||||
|
|
@ -4157,7 +4293,7 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
|
|||
(pmlmeinfo->HT_info.infos[0] & BIT(2)))
|
||||
{
|
||||
int i;
|
||||
u8 rf_type;
|
||||
u8 rf_type = RF_1T1R;
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
||||
|
|
@ -4172,9 +4308,8 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
|
|||
case RF_1T2R:
|
||||
set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_1R);
|
||||
break;
|
||||
case RF_2T2R:
|
||||
default:
|
||||
#ifdef CONFIG_DISABLE_MCS13TO15
|
||||
case RF_2T2R:
|
||||
#ifdef CONFIG_DISABLE_MCS13TO15
|
||||
if(pmlmeext->cur_bwmode == CHANNEL_WIDTH_40 && pregistrypriv->wifi_spec != 1 )
|
||||
set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_2R_13TO15_OFF);
|
||||
else
|
||||
|
|
@ -4182,6 +4317,12 @@ void rtw_update_ht_cap(_adapter *padapter, u8 *pie, uint ie_len, u8 channel)
|
|||
#else //CONFIG_DISABLE_MCS13TO15
|
||||
set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_2R);
|
||||
#endif //CONFIG_DISABLE_MCS13TO15
|
||||
break;
|
||||
case RF_3T3R:
|
||||
set_mcs_rate_by_mask(pmlmeinfo->HT_caps.u.HT_cap_element.MCS_rate, MCS_RATE_3R);
|
||||
break;
|
||||
default:
|
||||
DBG_871X("[warning] rf_type %d is not expected\n", rf_type);
|
||||
}
|
||||
|
||||
//switch to the 40M Hz mode accoring to the AP
|
||||
|
|
@ -4278,21 +4419,17 @@ void rtw_issue_addbareq_cmd_tdls(_adapter *padapter, struct xmit_frame *pxmitfra
|
|||
|
||||
priority = pattrib->priority;
|
||||
|
||||
if(pattrib->direct_link == _TRUE)
|
||||
{
|
||||
if (pattrib->direct_link == _TRUE) {
|
||||
ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst);
|
||||
if((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_ESTABLISHED))
|
||||
{
|
||||
if ((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)) {
|
||||
phtpriv = &ptdls_sta->htpriv;
|
||||
|
||||
if((phtpriv->ht_option==_TRUE) && (phtpriv->ampdu_enable==_TRUE))
|
||||
{
|
||||
if ((phtpriv->ht_option == _TRUE) && (phtpriv->ampdu_enable == _TRUE)) {
|
||||
issued = (phtpriv->agg_enable_bitmap>>priority)&0x1;
|
||||
issued |= (phtpriv->candidate_tid_bitmap>>priority)&0x1;
|
||||
|
||||
if(0==issued)
|
||||
{
|
||||
DBG_871X("rtw_issue_addbareq_cmd, p=%d\n", priority);
|
||||
if (0 == issued) {
|
||||
DBG_871X("[%s], p=%d\n", __FUNCTION__, priority);
|
||||
ptdls_sta->htpriv.candidate_tid_bitmap |= BIT((u8)priority);
|
||||
rtw_addbareq_cmd(padapter,(u8)priority, pattrib->dst);
|
||||
}
|
||||
|
|
@ -4365,10 +4502,9 @@ void rtw_append_exented_cap(_adapter *padapter, u8 *out_ie, uint *pout_len)
|
|||
#ifdef CONFIG_80211AC_VHT
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
#endif //CONFIG_80211AC_VHT
|
||||
u8 cap_content[8] = {0};
|
||||
u8 cap_content[8] = { 0 };
|
||||
u8 *pframe;
|
||||
u8 null_content[8] = {0};
|
||||
|
||||
u8 null_content[8] = {0};
|
||||
|
||||
if (phtpriv->bss_coexist) {
|
||||
SET_EXT_CAPABILITY_ELE_BSS_COEXIST(cap_content, 1);
|
||||
|
|
@ -4379,17 +4515,13 @@ void rtw_append_exented_cap(_adapter *padapter, u8 *out_ie, uint *pout_len)
|
|||
SET_EXT_CAPABILITY_ELE_OP_MODE_NOTIF(cap_content, 1);
|
||||
}
|
||||
#endif //CONFIG_80211AC_VHT
|
||||
|
||||
/*
|
||||
* From 802.11 specification,if a STA does not support any of
|
||||
* capabilities defined in the Extended Capabilities element,
|
||||
* then the STA is not required to transmit the
|
||||
* Extended Capabilities element.
|
||||
*/
|
||||
if (_FALSE == _rtw_memcmp(cap_content, null_content, 8)) {
|
||||
pframe = rtw_set_ie(out_ie + *pout_len,
|
||||
EID_EXTCapability, 8, cap_content , pout_len);
|
||||
}
|
||||
From 802.11 specification,if a STA does not support any of capabilities defined
|
||||
in the Extended Capabilities element, then the STA is not required to
|
||||
transmit the Extended Capabilities element.
|
||||
*/
|
||||
if (_FALSE == _rtw_memcmp(cap_content, null_content, 8))
|
||||
pframe = rtw_set_ie(out_ie + *pout_len, EID_EXTCapability, 8, cap_content , pout_len);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -4486,18 +4618,12 @@ sint rtw_buddy_adapter_up(_adapter *padapter)
|
|||
|
||||
|
||||
if(padapter->pbuddy_adapter == NULL)
|
||||
{
|
||||
res = _FALSE;
|
||||
}
|
||||
else if( (padapter->pbuddy_adapter->bDriverStopped) || (padapter->pbuddy_adapter->bSurpriseRemoved) ||
|
||||
(padapter->pbuddy_adapter->bup == _FALSE) || (padapter->pbuddy_adapter->hw_init_completed == _FALSE))
|
||||
{
|
||||
else if (RTW_CANNOT_RUN(padapter) ||
|
||||
(padapter->pbuddy_adapter->bup == _FALSE) || (!rtw_is_hw_init_completed(padapter)))
|
||||
res = _FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = _TRUE;
|
||||
}
|
||||
|
||||
return res;
|
||||
|
||||
|
|
@ -4548,3 +4674,4 @@ const char *get_miracast_mode_str(int mode)
|
|||
|
||||
return miracast_mode_str[mode];
|
||||
}
|
||||
|
||||
|
|
|
|||
5785
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mlme_ext.c
Executable file → Normal file
5785
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mlme_ext.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
635
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mp.c
Executable file → Normal file
635
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mp.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
4
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mp_ioctl.c
Executable file → Normal file
4
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_mp_ioctl.c
Executable file → Normal file
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
#include <drv_types.h>
|
||||
#include <rtw_mp_ioctl.h>
|
||||
#include "../hal/OUTSRC/phydm_precomp.h"
|
||||
#include "../hal/phydm/phydm_precomp.h"
|
||||
|
||||
//**************** oid_rtl_seg_81_85 section start ****************
|
||||
NDIS_STATUS oid_rt_wireless_mode_hdl(struct oid_par_priv *poid_par_priv)
|
||||
|
|
@ -2237,8 +2237,6 @@ NDIS_STATUS oid_rt_pro_rx_packet_type_hdl(struct oid_par_priv *poid_par_priv)
|
|||
RT_TRACE(_module_rtl871x_ioctl_c_,_drv_err_, ("Query Information, OID_RT_PRO_RX_PACKET_TYPE:%d \n",\
|
||||
Adapter->mppriv.rx_with_status));
|
||||
|
||||
//*(u32 *)&Adapter->eeprompriv.mac_addr[0]=rtw_read32(Adapter, 0x10250050);
|
||||
//*(u16 *)&Adapter->eeprompriv.mac_addr[4]=rtw_read16(Adapter, 0x10250054);
|
||||
RT_TRACE(_module_rtl871x_ioctl_c_,_drv_err_,("MAC addr=0x%x:0x%x:0x%x:0x%x:0x%x:0x%x \n",
|
||||
Adapter->eeprompriv.mac_addr[0],Adapter->eeprompriv.mac_addr[1],Adapter->eeprompriv.mac_addr[2],\
|
||||
Adapter->eeprompriv.mac_addr[3],Adapter->eeprompriv.mac_addr[4],Adapter->eeprompriv.mac_addr[5]));
|
||||
|
|
|
|||
236
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_odm.c
Executable file → Normal file
236
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_odm.c
Executable file → Normal file
|
|
@ -40,18 +40,18 @@ const char *odm_comp_str[] = {
|
|||
/* BIT15 */"ODM_COMP_CFO_TRACKING",
|
||||
/* BIT16 */"ODM_COMP_ACS",
|
||||
/* BIT17 */"PHYDM_COMP_ADAPTIVITY",
|
||||
/* BIT18 */NULL,
|
||||
/* BIT19 */NULL,
|
||||
/* BIT18 */"PHYDM_COMP_RA_DBG",
|
||||
/* BIT19 */"PHYDM_COMP_TXBF",
|
||||
/* BIT20 */"ODM_COMP_EDCA_TURBO",
|
||||
/* BIT21 */"ODM_COMP_EARLY_MODE",
|
||||
/* BIT22 */NULL,
|
||||
/* BIT22 */"ODM_FW_DEBUG_TRACE",
|
||||
/* BIT23 */NULL,
|
||||
/* BIT24 */"ODM_COMP_TX_PWR_TRACK",
|
||||
/* BIT25 */"ODM_COMP_RX_GAIN_TRACK",
|
||||
/* BIT26 */"ODM_COMP_CALIBRATION",
|
||||
/* BIT27 */NULL,
|
||||
/* BIT28 */NULL,
|
||||
/* BIT29 */NULL,
|
||||
/* BIT29 */"BEAMFORMING_DEBUG",
|
||||
/* BIT30 */"ODM_COMP_COMMON",
|
||||
/* BIT31 */"ODM_COMP_INIT",
|
||||
};
|
||||
|
|
@ -76,7 +76,7 @@ const char *odm_ability_str[] = {
|
|||
/* BIT14 */"ODM_BB_CFO_TRACKING",
|
||||
/* BIT15 */"ODM_BB_NHM_CNT",
|
||||
/* BIT16 */"ODM_BB_PRIMARY_CCA",
|
||||
/* BIT17 */NULL,
|
||||
/* BIT17 */"ODM_BB_TXBF",
|
||||
/* BIT18 */NULL,
|
||||
/* BIT19 */NULL,
|
||||
/* BIT20 */"ODM_MAC_EDCA_TURBO",
|
||||
|
|
@ -106,21 +106,22 @@ void rtw_odm_dbg_comp_msg(void *sel, _adapter *adapter)
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
int cnt = 0;
|
||||
u64 dbg_comp;
|
||||
u64 dbg_comp = 0;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &dbg_comp);
|
||||
DBG_871X_SEL_NL(sel, "odm.DebugComponents = 0x%016llx \n", dbg_comp);
|
||||
rtw_hal_get_odm_var(adapter, HAL_ODM_DBG_FLAG, &dbg_comp, NULL);
|
||||
|
||||
DBG_871X_SEL_NL(sel, "odm.DebugComponents = 0x%016llx\n", dbg_comp);
|
||||
for (i=0;i<RTW_ODM_COMP_MAX;i++) {
|
||||
if (odm_comp_str[i])
|
||||
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & dbg_comp ? '+' : ' ', i, odm_comp_str[i]);
|
||||
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & dbg_comp ? '+' : ' ', i, odm_comp_str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_dbg_comp_set(_adapter *adapter, u64 comps)
|
||||
{
|
||||
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &comps);
|
||||
rtw_hal_set_odm_var(adapter, HAL_ODM_DBG_FLAG, &comps, _FALSE);
|
||||
}
|
||||
|
||||
void rtw_odm_dbg_level_msg(void *sel, _adapter *adapter)
|
||||
|
|
@ -128,10 +129,10 @@ void rtw_odm_dbg_level_msg(void *sel, _adapter *adapter)
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
int cnt = 0;
|
||||
u32 dbg_level;
|
||||
u32 dbg_level = 0;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &dbg_level);
|
||||
rtw_hal_get_odm_var(adapter, HAL_ODM_DBG_LEVEL, &dbg_level, NULL);
|
||||
DBG_871X_SEL_NL(sel, "odm.DebugLevel = %u\n", dbg_level);
|
||||
for (i=0;i<RTW_ODM_DBG_LEVEL_NUM;i++) {
|
||||
if (odm_dbg_level_str[i])
|
||||
|
|
@ -141,7 +142,7 @@ void rtw_odm_dbg_level_msg(void *sel, _adapter *adapter)
|
|||
|
||||
inline void rtw_odm_dbg_level_set(_adapter *adapter, u32 level)
|
||||
{
|
||||
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &level);
|
||||
rtw_hal_set_odm_var(adapter, HAL_ODM_DBG_LEVEL, &level, _FALSE);
|
||||
}
|
||||
|
||||
void rtw_odm_ability_msg(void *sel, _adapter *adapter)
|
||||
|
|
@ -152,18 +153,18 @@ void rtw_odm_ability_msg(void *sel, _adapter *adapter)
|
|||
u32 ability = 0;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_hwreg(adapter, HW_VAR_DM_FLAG, (u8*)&ability);
|
||||
ability = rtw_phydm_ability_get(adapter);
|
||||
DBG_871X_SEL_NL(sel, "odm.SupportAbility = 0x%08x\n", ability);
|
||||
for (i=0;i<RTW_ODM_ABILITY_MAX;i++) {
|
||||
if (odm_ability_str[i])
|
||||
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & ability ? '+' : ' ', i, odm_ability_str[i]);
|
||||
DBG_871X_SEL_NL(sel, "%cBIT%-2d %s\n",
|
||||
(BIT0 << i) & ability ? '+' : ' ', i, odm_ability_str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_ability_set(_adapter *adapter, u32 ability)
|
||||
{
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_DM_FLAG, (u8*)&ability);
|
||||
rtw_phydm_ability_set(adapter, ability);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_ver_msg(void *sel, _adapter *adapter)
|
||||
|
|
@ -173,7 +174,6 @@ void rtw_odm_adaptivity_ver_msg(void *sel, _adapter *adapter)
|
|||
|
||||
#define RTW_ADAPTIVITY_EN_DISABLE 0
|
||||
#define RTW_ADAPTIVITY_EN_ENABLE 1
|
||||
#define RTW_ADAPTIVITY_EN_AUTO 2
|
||||
|
||||
void rtw_odm_adaptivity_en_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
|
|
@ -188,9 +188,6 @@ void rtw_odm_adaptivity_en_msg(void *sel, _adapter *adapter)
|
|||
DBG_871X_SEL(sel, "DISABLE\n");
|
||||
} else if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_ENABLE) {
|
||||
DBG_871X_SEL(sel, "ENABLE\n");
|
||||
} else if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_AUTO) {
|
||||
DBG_871X_SEL(sel, "AUTO, chplan:0x%02x, Regulation:%u,%u\n"
|
||||
, mlme->ChannelPlan, odm->odm_Regulation2_4G, odm->odm_Regulation5G);
|
||||
} else {
|
||||
DBG_871X_SEL(sel, "INVALID\n");
|
||||
}
|
||||
|
|
@ -214,41 +211,49 @@ void rtw_odm_adaptivity_mode_msg(void *sel, _adapter *adapter)
|
|||
}
|
||||
}
|
||||
|
||||
#define RTW_NHM_EN_DISABLE 0
|
||||
#define RTW_NHM_EN_ENABLE 1
|
||||
#define RTW_ADAPTIVITY_DML_DISABLE 0
|
||||
#define RTW_ADAPTIVITY_DML_ENABLE 1
|
||||
|
||||
void rtw_odm_nhm_en_msg(void *sel, _adapter *adapter)
|
||||
void rtw_odm_adaptivity_dml_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
|
||||
DBG_871X_SEL_NL(sel, "RTW_NHM_EN_");
|
||||
DBG_871X_SEL_NL(sel, "RTW_ADAPTIVITY_DML_");
|
||||
|
||||
if (regsty->nhm_en == RTW_NHM_EN_DISABLE) {
|
||||
if (regsty->adaptivity_dml == RTW_ADAPTIVITY_DML_DISABLE) {
|
||||
DBG_871X_SEL(sel, "DISABLE\n");
|
||||
} else if (regsty->nhm_en == RTW_NHM_EN_ENABLE) {
|
||||
} else if (regsty->adaptivity_dml == RTW_ADAPTIVITY_DML_ENABLE) {
|
||||
DBG_871X_SEL(sel, "ENABLE\n");
|
||||
} else {
|
||||
DBG_871X_SEL(sel, "INVALID\n");
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_dc_backoff_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
|
||||
DBG_871X_SEL_NL(sel, "RTW_ADAPTIVITY_DC_BACKOFF:%u\n", regsty->adaptivity_dc_backoff);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_config_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
rtw_odm_adaptivity_ver_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_en_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_mode_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_dml_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_dc_backoff_msg(sel, adapter);
|
||||
}
|
||||
|
||||
bool rtw_odm_adaptivity_needed(_adapter *adapter)
|
||||
{
|
||||
struct registry_priv *regsty = &adapter->registrypriv;
|
||||
struct mlme_priv *mlme = &adapter->mlmepriv;
|
||||
bool ret = _FALSE;
|
||||
|
||||
if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_ENABLE
|
||||
|| regsty->adaptivity_en == RTW_ADAPTIVITY_EN_AUTO)
|
||||
if (regsty->adaptivity_en == RTW_ADAPTIVITY_EN_ENABLE)
|
||||
ret = _TRUE;
|
||||
|
||||
if (ret == _TRUE) {
|
||||
rtw_odm_adaptivity_ver_msg(RTW_DBGDUMP, adapter);
|
||||
rtw_odm_adaptivity_en_msg(RTW_DBGDUMP, adapter);
|
||||
rtw_odm_adaptivity_mode_msg(RTW_DBGDUMP, adapter);
|
||||
rtw_odm_nhm_en_msg(RTW_DBGDUMP, adapter);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
@ -257,43 +262,35 @@ void rtw_odm_adaptivity_parm_msg(void *sel, _adapter *adapter)
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
|
||||
rtw_odm_adaptivity_ver_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_en_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_mode_msg(sel, adapter);
|
||||
rtw_odm_nhm_en_msg(sel, adapter);
|
||||
rtw_odm_adaptivity_config_msg(sel, adapter);
|
||||
|
||||
DBG_871X_SEL_NL(sel, "%10s %16s %8s %10s %11s %14s\n"
|
||||
, "TH_L2H_ini", "TH_EDCCA_HL_diff", "IGI_Base", "ForceEDCCA", "AdapEn_RSSI", "IGI_LowerBound");
|
||||
DBG_871X_SEL_NL(sel, "0x%-8x %-16d 0x%-6x %-10d %-11u %-14u\n"
|
||||
DBG_871X_SEL_NL(sel, "%10s %16s %16s %22s %12s\n"
|
||||
, "TH_L2H_ini", "TH_EDCCA_HL_diff", "TH_L2H_ini_mode2", "TH_EDCCA_HL_diff_mode2", "EDCCA_enable");
|
||||
DBG_871X_SEL_NL(sel, "0x%-8x %-16d 0x%-14x %-22d %-12d\n"
|
||||
, (u8)odm->TH_L2H_ini
|
||||
, odm->TH_EDCCA_HL_diff
|
||||
, odm->IGI_Base
|
||||
, odm->ForceEDCCA
|
||||
, odm->AdapEn_RSSI
|
||||
, odm->IGI_LowerBound
|
||||
, (u8)odm->TH_L2H_ini_mode2
|
||||
, odm->TH_EDCCA_HL_diff_mode2
|
||||
, odm->EDCCA_enable
|
||||
);
|
||||
|
||||
DBG_871X_SEL_NL(sel, "%8s %9s\n", "EDCCA_ES","Adap_Flag");
|
||||
DBG_871X_SEL_NL(sel, "%-8x %-9x \n"
|
||||
, odm->EDCCA_enable_state
|
||||
DBG_871X_SEL_NL(sel, "%15s %9s\n", "AdapEnableState", "Adap_Flag");
|
||||
DBG_871X_SEL_NL(sel, "%-15x %-9x\n"
|
||||
, odm->Adaptivity_enable
|
||||
, odm->adaptivity_flag
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff,
|
||||
s8 IGI_Base, bool ForceEDCCA, u8 AdapEn_RSSI, u8 IGI_LowerBound)
|
||||
void rtw_odm_adaptivity_parm_set(_adapter *adapter, s8 TH_L2H_ini, s8 TH_EDCCA_HL_diff, s8 TH_L2H_ini_mode2, s8 TH_EDCCA_HL_diff_mode2, u8 EDCCA_enable)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
|
||||
odm->TH_L2H_ini = TH_L2H_ini;
|
||||
odm->TH_EDCCA_HL_diff = TH_EDCCA_HL_diff;
|
||||
odm->IGI_Base = IGI_Base;
|
||||
odm->ForceEDCCA = ForceEDCCA;
|
||||
odm->AdapEn_RSSI = AdapEn_RSSI;
|
||||
odm->IGI_LowerBound = IGI_LowerBound;
|
||||
odm->TH_L2H_ini_mode2 = TH_L2H_ini_mode2;
|
||||
odm->TH_EDCCA_HL_diff_mode2 = TH_EDCCA_HL_diff_mode2;
|
||||
odm->EDCCA_enable = EDCCA_enable;
|
||||
}
|
||||
|
||||
void rtw_odm_get_perpkt_rssi(void *sel, _adapter *adapter)
|
||||
|
|
@ -309,13 +306,12 @@ void rtw_odm_get_perpkt_rssi(void *sel, _adapter *adapter)
|
|||
void rtw_odm_acquirespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
_irqL irqL;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case RT_IQK_SPINLOCK:
|
||||
_enter_critical_bh(&pdmpriv->IQKSpinLock, &irqL);
|
||||
_enter_critical_bh(&pHalData->IQKSpinLock, &irqL);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
@ -324,15 +320,129 @@ void rtw_odm_acquirespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type)
|
|||
void rtw_odm_releasespinlock(_adapter *adapter, RT_SPINLOCK_TYPE type)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(adapter);
|
||||
struct dm_priv *pdmpriv = &pHalData->dmpriv;
|
||||
_irqL irqL;
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case RT_IQK_SPINLOCK:
|
||||
_exit_critical_bh(&pdmpriv->IQKSpinLock, &irqL);
|
||||
_exit_critical_bh(&pHalData->IQKSpinLock, &irqL);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DFS_MASTER
|
||||
VOID rtw_odm_radar_detect_reset(_adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
PDM_ODM_T pDM_Odm = &(hal_data->odmpriv);
|
||||
|
||||
if (pDM_Odm->SupportICType & ODM_RTL8192D) {
|
||||
ODM_SetBBReg(pDM_Odm, 0xc84 , BIT25, 0);
|
||||
ODM_SetBBReg(pDM_Odm, 0xc84 , BIT25, 1);
|
||||
} else if (pDM_Odm->SupportICType & ODM_RTL8821) {
|
||||
ODM_SetBBReg(pDM_Odm, 0x924 , BIT15, 0);
|
||||
ODM_SetBBReg(pDM_Odm, 0x924 , BIT15, 1);
|
||||
} else {
|
||||
/* not supported yet */
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
}
|
||||
|
||||
VOID rtw_odm_radar_detect_disable(_adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
PDM_ODM_T pDM_Odm = &(hal_data->odmpriv);
|
||||
|
||||
if (pDM_Odm->SupportICType & ODM_RTL8192D)
|
||||
ODM_SetBBReg(pDM_Odm, 0xc84 , BIT25, 0);
|
||||
else if (pDM_Odm->SupportICType & ODM_RTL8821)
|
||||
ODM_SetBBReg(pDM_Odm, 0x924 , BIT15, 0);
|
||||
else
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
|
||||
/* called after ch, bw is set, chance to adjust parameter for different ch conditions */
|
||||
VOID rtw_odm_radar_detect_enable(_adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
PDM_ODM_T pDM_Odm = &(hal_data->odmpriv);
|
||||
|
||||
if (pDM_Odm->SupportICType & ODM_RTL8192D) {
|
||||
ODM_SetBBReg(pDM_Odm, 0xc38, BIT23 | BIT22, 2);
|
||||
ODM_SetBBReg(pDM_Odm, 0x814, bMaskDWord, 0x04cc4d10);
|
||||
ODM_SetBBReg(pDM_Odm, 0xc8c, BIT23 | BIT22, 3);
|
||||
ODM_SetBBReg(pDM_Odm, 0xc30, 0xf, 0xa);
|
||||
ODM_SetBBReg(pDM_Odm, 0xcdc, 0xf0000, 4);
|
||||
} else if (pDM_Odm->SupportICType & ODM_RTL8821) {
|
||||
ODM_SetBBReg(pDM_Odm, 0x814, 0x3fffffff, 0x04cc4d10);
|
||||
ODM_SetBBReg(pDM_Odm, 0x834, bMaskByte0, 0x06);
|
||||
ODM_SetBBReg(pDM_Odm, 0x918, bMaskDWord, 0x1c16ecdf);
|
||||
ODM_SetBBReg(pDM_Odm, 0x924, bMaskDWord, 0x0152a400);
|
||||
ODM_SetBBReg(pDM_Odm, 0x91c, bMaskDWord, 0x0fa21a20);
|
||||
ODM_SetBBReg(pDM_Odm, 0x920, bMaskDWord, 0xe0f57204);
|
||||
} else {
|
||||
/* not supported yet */
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
|
||||
rtw_odm_radar_detect_reset(adapter);
|
||||
}
|
||||
|
||||
BOOLEAN rtw_odm_radar_detect(_adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
PDM_ODM_T pDM_Odm = &(hal_data->odmpriv);
|
||||
BOOLEAN enable_DFS = FALSE;
|
||||
BOOLEAN bypass = FALSE;
|
||||
BOOLEAN radar_detected = FALSE;
|
||||
|
||||
static u8Byte last_tx_unicast = 0;
|
||||
static u8Byte last_rx_unicast = 0;
|
||||
static u8Byte throughput = 0;
|
||||
int tp_th = ((*pDM_Odm->pBandWidth == ODM_BW40M) ? 45 : 20); /*refer AP team's testing number*/
|
||||
|
||||
throughput = (*(pDM_Odm->pNumTxBytesUnicast) - last_tx_unicast) + (*(pDM_Odm->pNumRxBytesUnicast) - last_rx_unicast);
|
||||
last_tx_unicast = *(pDM_Odm->pNumTxBytesUnicast);
|
||||
last_rx_unicast = *(pDM_Odm->pNumRxBytesUnicast);
|
||||
|
||||
if (throughput>>18 > tp_th) {
|
||||
if (pDM_Odm->SupportICType & ODM_RTL8192D)
|
||||
ODM_SetBBReg(pDM_Odm, 0xcdc, BIT8|BIT9, 0);
|
||||
bypass = TRUE;
|
||||
} else {
|
||||
if (pDM_Odm->SupportICType & ODM_RTL8192D)
|
||||
ODM_SetBBReg(pDM_Odm, 0xcdc, BIT8|BIT9, 1);
|
||||
}
|
||||
|
||||
if (pDM_Odm->SupportICType & ODM_RTL8192D) {
|
||||
if (ODM_GetBBReg(pDM_Odm , 0xc84, BIT25))
|
||||
enable_DFS = TRUE;
|
||||
} else if (pDM_Odm->SupportICType & ODM_RTL8821) {
|
||||
if (ODM_GetBBReg(pDM_Odm , 0x924, BIT15))
|
||||
enable_DFS = TRUE;
|
||||
}
|
||||
|
||||
if (pDM_Odm->SupportICType & ODM_RTL8192D) {
|
||||
if (ODM_GetBBReg(pDM_Odm , 0xcf8, BIT23))
|
||||
radar_detected = TRUE;
|
||||
} else if (pDM_Odm->SupportICType & ODM_RTL8821) {
|
||||
if (ODM_GetBBReg(pDM_Odm , 0xf98, BIT17))
|
||||
radar_detected = TRUE;
|
||||
}
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_COMMON, ODM_DBG_LOUD
|
||||
, ("Radar detect: enable_DFS:%d, radar_detected:%d, bypass:%d\n"
|
||||
, enable_DFS, radar_detected, bypass));
|
||||
if (0)
|
||||
DBG_871X("Radar detect: enable_DFS:%d, radar_detected:%d, bypass:%d(throughput:%llu, tp_th:%d)\n"
|
||||
, enable_DFS, radar_detected, bypass, throughput, tp_th);
|
||||
|
||||
if (enable_DFS && radar_detected)
|
||||
rtw_odm_radar_detect_reset(adapter);
|
||||
|
||||
exit:
|
||||
return (enable_DFS && radar_detected && !bypass);
|
||||
}
|
||||
#endif /* CONFIG_DFS_MASTER */
|
||||
|
||||
|
|
|
|||
88
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_p2p.c
Executable file → Normal file
88
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_p2p.c
Executable file → Normal file
|
|
@ -325,8 +325,8 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8* raddr,
|
|||
*(fctrl) = 0;
|
||||
|
||||
_rtw_memcpy(pwlanhdr->addr1, raddr, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
|
||||
SetSeqNum(pwlanhdr, pmlmeext->mgnt_seq);
|
||||
pmlmeext->mgnt_seq++;
|
||||
|
|
@ -953,7 +953,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel
|
|||
|
||||
// Value:
|
||||
// Alternative MAC Address
|
||||
_rtw_memcpy( wfdie + wfdielen, &padapter->pbuddy_adapter->eeprompriv.mac_addr[ 0 ], ETH_ALEN );
|
||||
_rtw_memcpy(wfdie + wfdielen, adapter_mac_addr(padapter->pbuddy_adapter), ETH_ALEN);
|
||||
// This mac address is used to make the WFD session when TDLS is enable.
|
||||
|
||||
wfdielen += ETH_ALEN;
|
||||
|
|
@ -2791,13 +2791,6 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
return( result );
|
||||
}
|
||||
|
||||
if ( pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO )
|
||||
{
|
||||
result = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_INFOR_NOREADY);
|
||||
return( result );
|
||||
}
|
||||
|
||||
ies = pframe + _PUBLIC_ACTION_IE_OFFSET_;
|
||||
ies_len = len - _PUBLIC_ACTION_IE_OFFSET_;
|
||||
|
||||
|
|
@ -2821,6 +2814,7 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
u8 ch_list_inclusioned[100] = { 0x00 };
|
||||
u8 ch_num_inclusioned = 0;
|
||||
u16 cap_attr;
|
||||
u8 listen_ch_attr[5] = { 0x00 };
|
||||
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_GONEGO_ING);
|
||||
|
||||
|
|
@ -2877,7 +2871,11 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
}
|
||||
}
|
||||
|
||||
if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_LISTEN_CH, (u8 *)listen_ch_attr, (uint *) &attr_contentlen) && attr_contentlen == 5)
|
||||
pwdinfo->nego_req_info.peer_ch = listen_ch_attr[4];
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT" listen channel :%u\n", FUNC_ADPT_ARG(padapter), pwdinfo->nego_req_info.peer_ch);
|
||||
|
||||
attr_contentlen = 0;
|
||||
if ( rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_INTENTED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen ) )
|
||||
{
|
||||
|
|
@ -2948,7 +2946,13 @@ u8 process_p2p_group_negotation_req( struct wifidirect_info *pwdinfo, u8 *pframe
|
|||
//Get the next P2P IE
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
}
|
||||
|
||||
|
||||
if (pwdinfo->ui_got_wps_info == P2P_NO_WPSINFO) {
|
||||
result = P2P_STATUS_FAIL_INFO_UNAVAILABLE;
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_TX_INFOR_NOREADY);
|
||||
return result;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WFD
|
||||
// Added by Albert 20110823
|
||||
// Try to get the TCP port information when receiving the negotiation request.
|
||||
|
|
@ -3422,7 +3426,7 @@ void pre_tx_invitereq_handler( _adapter* padapter )
|
|||
_func_enter_;
|
||||
|
||||
set_channel_bwmode(padapter, pwdinfo->invitereq_info.peer_ch, HAL_PRIME_CHNL_OFFSET_DONT_CARE, CHANNEL_WIDTH_20);
|
||||
padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
issue_probereq_p2p(padapter, NULL);
|
||||
_set_timer( &pwdinfo->pre_tx_scan_timer, P2P_TX_PRESCAN_TIMEOUT );
|
||||
|
||||
|
|
@ -3482,7 +3486,7 @@ _func_enter_;
|
|||
DBG_871X("%s, switch ch back to buddy's cur_channel=%d\n", __func__, pbuddy_mlmeext->cur_channel);
|
||||
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
|
||||
|
||||
if (check_buddy_fwstate(padapter, WIFI_FW_STATION_STATE))
|
||||
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
|
||||
}
|
||||
|
|
@ -3505,7 +3509,7 @@ _func_enter_;
|
|||
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_LISTEN);
|
||||
if(!check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) &&
|
||||
!(pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
|
||||
((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE))
|
||||
{
|
||||
val8 = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
|
|
@ -3529,10 +3533,10 @@ _func_enter_;
|
|||
if ( pbuddy_mlmeext->cur_channel != pwdinfo->listen_channel )
|
||||
{
|
||||
set_channel_bwmode(padapter, pbuddy_mlmeext->cur_channel, pbuddy_mlmeext->cur_ch_offset, pbuddy_mlmeext->cur_bwmode);
|
||||
if(!check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) &&!(pmlmeinfo->state&0x03) == WIFI_FW_AP_STATE)
|
||||
if (!check_buddy_mlmeinfo_state(padapter, WIFI_FW_AP_STATE) && ((pmlmeinfo->state&0x03) != WIFI_FW_AP_STATE))
|
||||
{
|
||||
val8 = 0;
|
||||
padapter->HalFunc.SetHwRegHandler(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_SITESURVEY, (u8 *)(&val8));
|
||||
}
|
||||
rtw_p2p_set_state(pwdinfo, P2P_STATE_IDLE);
|
||||
issue_nulldata(pbuddy_adapter, NULL, 0, 3, 500);
|
||||
|
|
@ -3597,24 +3601,24 @@ _func_enter_;
|
|||
|
||||
if (rtw_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) {
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
DBG_871X(FUNC_ADPT_FMT" back to linked/linking union - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
}
|
||||
else if (adapter_wdev_data(padapter)->p2p_enabled && pwdinfo->listen_channel) {
|
||||
ch = pwdinfo->listen_channel;
|
||||
bw = CHANNEL_WIDTH_20;
|
||||
offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" back to listen ch - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
DBG_871X(FUNC_ADPT_FMT" back to listen ch - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
}
|
||||
else {
|
||||
ch = pcfg80211_wdinfo->restore_channel;
|
||||
bw = CHANNEL_WIDTH_20;
|
||||
offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" back to restore ch - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
DBG_871X(FUNC_ADPT_FMT" back to restore ch - ch:%u, bw:%u, offset:%u\n",
|
||||
FUNC_ADPT_ARG(padapter), ch, bw, offset);
|
||||
}
|
||||
|
||||
set_channel_bwmode(padapter, ch, offset, bw);
|
||||
|
|
@ -4504,6 +4508,46 @@ _func_enter_;
|
|||
_func_exit_;
|
||||
}
|
||||
|
||||
int process_p2p_cross_connect_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
|
||||
{
|
||||
int ret = _TRUE;
|
||||
u8 * ies;
|
||||
u32 ies_len;
|
||||
u8 * p2p_ie;
|
||||
u32 p2p_ielen = 0;
|
||||
u8 p2p_attr[MAX_P2P_IE_LEN] = { 0x00 };// NoA length should be n*(13) + 2
|
||||
u32 attr_contentlen = 0;
|
||||
|
||||
struct wifidirect_info *pwdinfo = &( padapter->wdinfo );
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(IELength <= _BEACON_IE_OFFSET_)
|
||||
return ret;
|
||||
|
||||
ies = IEs + _BEACON_IE_OFFSET_;
|
||||
ies_len = IELength - _BEACON_IE_OFFSET_;
|
||||
|
||||
p2p_ie = rtw_get_p2p_ie( ies, ies_len, NULL, &p2p_ielen);
|
||||
|
||||
while(p2p_ie)
|
||||
{
|
||||
// Get P2P Manageability IE.
|
||||
if(rtw_get_p2p_attr_content( p2p_ie, p2p_ielen, P2P_ATTR_MANAGEABILITY, p2p_attr, &attr_contentlen))
|
||||
{
|
||||
if ((p2p_attr[0]&(BIT(0)|BIT(1))) == 0x01) {
|
||||
ret = _FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
//Get the next P2P IE
|
||||
p2p_ie = rtw_get_p2p_ie(p2p_ie+p2p_ielen, ies_len -(p2p_ie -ies + p2p_ielen), NULL, &p2p_ielen);
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_P2P_PS
|
||||
void process_p2p_ps_ie(PADAPTER padapter, u8 *IEs, u32 IELength)
|
||||
{
|
||||
|
|
|
|||
301
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_pwrctrl.c
Executable file → Normal file
301
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_pwrctrl.c
Executable file → Normal file
|
|
@ -38,10 +38,11 @@ int rtw_fw_ps_state(PADAPTER padapter)
|
|||
|
||||
_enter_pwrlock(&pwrpriv->check_32k_lock);
|
||||
|
||||
if ((padapter->bSurpriseRemoved == _TRUE))
|
||||
{
|
||||
DBG_871X("%s: bSurpriseRemoved=%d , hw_init_completed=%d, bDriverStopped=%d \n", __FUNCTION__, padapter->bSurpriseRemoved,
|
||||
padapter->hw_init_completed,padapter->bDriverStopped);
|
||||
if (RTW_CANNOT_RUN(padapter)) {
|
||||
DBG_871X("%s: bSurpriseRemoved=%s , hw_init_completed=%d, bDriverStopped=%s\n", __func__
|
||||
, rtw_is_surprise_removed(padapter)?"True":"False"
|
||||
, rtw_get_hw_init_completed(padapter)
|
||||
, rtw_is_drv_stopped(padapter)?"True":"False");
|
||||
goto exit_fw_ps_state;
|
||||
}
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SET_REQ_FW_PS, (u8 *)&dont_care);
|
||||
|
|
@ -354,7 +355,6 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
{
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
pwrpriv->brfoffbyhw = _TRUE;
|
||||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
rtw_hw_suspend(padapter );
|
||||
}
|
||||
else
|
||||
|
|
@ -396,12 +396,10 @@ void rtw_ps_processor(_adapter*padapter)
|
|||
DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x)\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend);
|
||||
} else {
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
DBG_871X("<==%s .pwrpriv->bInternalAutoSuspend)(%x) call autosuspend_enter\n",__FUNCTION__,pwrpriv->bInternalAutoSuspend);
|
||||
autosuspend_enter(padapter);
|
||||
}
|
||||
#else
|
||||
padapter->bCardDisableWOHSM = _TRUE;
|
||||
autosuspend_enter(padapter);
|
||||
#endif //if defined (CONFIG_BT_COEXIST)&& defined (CONFIG_AUTOSUSPEND)
|
||||
}
|
||||
|
|
@ -532,9 +530,7 @@ _func_enter_;
|
|||
{
|
||||
if ( (pwrpriv->rpwm == pslv)
|
||||
#ifdef CONFIG_LPS_LCLK
|
||||
#ifndef CONFIG_RTL8723A
|
||||
|| ((pwrpriv->rpwm >= PS_STATE_S2)&&(pslv >= PS_STATE_S2))
|
||||
#endif
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
|
@ -544,20 +540,21 @@ _func_enter_;
|
|||
}
|
||||
}
|
||||
|
||||
if ((padapter->bSurpriseRemoved == _TRUE) ||
|
||||
(padapter->hw_init_completed == _FALSE))
|
||||
if (rtw_is_surprise_removed(padapter) ||
|
||||
(!rtw_is_hw_init_completed(padapter)))
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_,
|
||||
("%s: SurpriseRemoved(%d) hw_init_completed(%d)\n",
|
||||
__FUNCTION__, padapter->bSurpriseRemoved, padapter->hw_init_completed));
|
||||
("%s: SurpriseRemoved(%s) hw_init_completed(%s)\n"
|
||||
, __func__
|
||||
, rtw_is_surprise_removed(padapter)?"True":"False"
|
||||
, rtw_is_hw_init_completed(padapter)?"True":"False"));
|
||||
|
||||
pwrpriv->cpwm = PS_STATE_S4;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (padapter->bDriverStopped == _TRUE)
|
||||
{
|
||||
if (rtw_is_drv_stopped(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_, _drv_err_,
|
||||
("%s: change power state(0x%02X) when DriverStopped\n", __FUNCTION__, pslv));
|
||||
|
||||
|
|
@ -610,14 +607,11 @@ _func_enter_;
|
|||
do {
|
||||
rtw_msleep_os(1);
|
||||
poll_cnt++;
|
||||
cpwm_now = 0;
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CPWM, &cpwm_now);
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80)
|
||||
{
|
||||
#ifdef CONFIG_RTL8723A
|
||||
pwrpriv->cpwm = PS_STATE(cpwm_now);
|
||||
#else // !CONFIG_RTL8723A
|
||||
pwrpriv->cpwm = PS_STATE_S4;
|
||||
#endif // !CONFIG_RTL8723A
|
||||
pwrpriv->cpwm_tog = cpwm_now & PS_TOGGLE;
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
DBG_871X("%s: polling cpwm OK! poll_cnt=%d, cpwm_orig=%02x, cpwm_now=%02x , 0x100=0x%x\n"
|
||||
|
|
@ -722,15 +716,14 @@ u8 PS_RDY_CHECK(_adapter * padapter)
|
|||
return _TRUE;
|
||||
}
|
||||
|
||||
#if defined(CONFIG_FWLPS_IN_IPS) && defined(CONFIG_PNO_SUPPORT)
|
||||
#if defined(CONFIG_FWLPS_IN_IPS)
|
||||
void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
||||
{
|
||||
struct hal_ops *pHalFunc = &padapter->HalFunc;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
int cnt=0;
|
||||
u32 start_time;
|
||||
u8 val8 = 0;
|
||||
u8 cpwm_orig, cpwm_now;
|
||||
u8 cpwm_orig = 0, cpwm_now = 0;
|
||||
u8 parm[H2C_INACTIVE_PS_LEN]={0};
|
||||
|
||||
if (padapter->netif_up == _FALSE) {
|
||||
|
|
@ -738,23 +731,25 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
|||
return;
|
||||
}
|
||||
|
||||
if (pHalFunc->fill_h2c_cmd == NULL) {
|
||||
DBG_871X("%s: Please hook fill_h2c_cmd first!\n", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
//u8 cmd_param; //BIT0:enable, BIT1:NoConnect32k
|
||||
if (enable) {
|
||||
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
rtw_btcoex_IpsNotify(padapter, pwrpriv->ips_mode_req);
|
||||
#endif
|
||||
//Enter IPS
|
||||
DBG_871X("%s: issue H2C to FW when entering IPS\n", __func__);
|
||||
|
||||
#ifdef CONFIG_PNO_SUPPORT
|
||||
parm[0] = 0x03;
|
||||
parm[1] = 0x01;
|
||||
parm[2] = 0x01;
|
||||
pHalFunc->fill_h2c_cmd(padapter, //H2C_FWLPS_IN_IPS_,
|
||||
parm[1] = pwrpriv->pnlo_info->fast_scan_iterations;
|
||||
parm[2] = pwrpriv->pnlo_info->slow_scan_period;
|
||||
#else
|
||||
parm[0] = 0x03;
|
||||
parm[1] = 0x0;
|
||||
parm[2] = 0x0;
|
||||
#endif//CONFIG_PNO_SUPPORT
|
||||
|
||||
rtw_hal_fill_h2c_cmd(padapter, //H2C_FWLPS_IN_IPS_,
|
||||
H2C_INACTIVE_PS_,
|
||||
H2C_INACTIVE_PS_LEN, parm);
|
||||
//poll 0x1cc to make sure H2C command already finished by FW; MAC_0x1cc=0 means H2C done by FW.
|
||||
|
|
@ -777,33 +772,18 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
|||
DBG_871X("%s: write rpwm=%02x\n", __FUNCTION__, val8);
|
||||
adapter_to_pwrctl(padapter)->tog = (val8 + 0x80) & 0x80;
|
||||
cnt = val8 = 0;
|
||||
do {
|
||||
val8 = rtw_read8(padapter, REG_CR);
|
||||
cnt++;
|
||||
DBG_871X("%s polling 0x100=0x%x, cnt=%d \n",
|
||||
__func__, val8, cnt);
|
||||
DBG_871X("%s 0x08:%02x, 0x03:%02x\n",
|
||||
__func__,
|
||||
rtw_read8(padapter, 0x08),
|
||||
rtw_read8(padapter, 0x03));
|
||||
rtw_mdelay_os(10);
|
||||
} while(cnt<20 && (val8!=0xEA));
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
if(val8 != 0xEA) {
|
||||
DBG_871X("MAC_1B8=0x%08x\n",
|
||||
rtw_read32(padapter, 0x1b8));
|
||||
DBG_871X("MAC_1C0=%08x, MAC_1C4=%08x, MAC_1C8=%08x, MAC_1CC=%08x\n",
|
||||
rtw_read32(padapter, 0x1c0),
|
||||
rtw_read32(padapter, 0x1c4),
|
||||
rtw_read32(padapter, 0x1c8),
|
||||
rtw_read32(padapter, 0x1cc));
|
||||
#endif //DBG_CHECK_FW_PS_STATE
|
||||
} else {
|
||||
DBG_871X("MAC_1C0=%08x, MAC_1C4=%08x, MAC_1C8=%08x, MAC_1CC=%08x\n",
|
||||
rtw_read32(padapter, 0x1c0),
|
||||
rtw_read32(padapter, 0x1c4),
|
||||
rtw_read32(padapter, 0x1c8),
|
||||
rtw_read32(padapter, 0x1cc));
|
||||
if (parm[1] == 0 || parm[2] == 0) {
|
||||
do {
|
||||
val8 = rtw_read8(padapter, REG_CR);
|
||||
cnt++;
|
||||
DBG_871X("%s polling 0x100=0x%x, cnt=%d \n",
|
||||
__func__, val8, cnt);
|
||||
DBG_871X("%s 0x08:%02x, 0x03:%02x\n",
|
||||
__func__,
|
||||
rtw_read8(padapter, 0x08),
|
||||
rtw_read8(padapter, 0x03));
|
||||
rtw_mdelay_os(10);
|
||||
} while(cnt<20 && (val8!=0xEA));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
@ -831,10 +811,6 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
|||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_CPWM, &cpwm_now);
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80) {
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
DBG_871X("%s: polling cpwm ok when leaving IPS in FWLPS state, cpwm_orig=%02x, cpwm_now=%02x, 0x100=0x%x \n"
|
||||
, __FUNCTION__, cpwm_orig, cpwm_now, rtw_read8(padapter, REG_CR));
|
||||
#endif //DBG_CHECK_FW_PS_STATE
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -848,7 +824,7 @@ void rtw_set_fw_in_ips_mode(PADAPTER padapter, u8 enable)
|
|||
parm[0] = 0x0;
|
||||
parm[1] = 0x0;
|
||||
parm[2] = 0x0;
|
||||
pHalFunc->fill_h2c_cmd(padapter, H2C_INACTIVE_PS_,
|
||||
rtw_hal_fill_h2c_cmd(padapter, H2C_INACTIVE_PS_,
|
||||
H2C_INACTIVE_PS_LEN, parm);
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
rtw_btcoex_IpsNotify(padapter, IPS_NONE);
|
||||
|
|
@ -879,6 +855,9 @@ _func_enter_;
|
|||
("%s: PowerMode=%d Smart_PS=%d\n",
|
||||
__FUNCTION__, ps_mode, smart_ps));
|
||||
|
||||
if (pwrpriv->disable_smart_ps == _TRUE)
|
||||
smart_ps = 0;
|
||||
|
||||
if(ps_mode > PM_Card_Disable) {
|
||||
RT_TRACE(_module_rtl871x_pwrctrl_c_,_drv_err_,("ps_mode:%d error\n", ps_mode));
|
||||
return;
|
||||
|
|
@ -924,6 +903,10 @@ _func_enter_;
|
|||
DBG_871X(FUNC_ADPT_FMT" Leave 802.11 power save - %s\n",
|
||||
FUNC_ADPT_ARG(padapter), msg);
|
||||
|
||||
if (pwrpriv->lps_leave_cnts < UINT_MAX)
|
||||
pwrpriv->lps_leave_cnts++;
|
||||
else
|
||||
pwrpriv->lps_leave_cnts = 0;
|
||||
#ifdef CONFIG_TDLS
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
|
|
@ -999,6 +982,10 @@ _func_enter_;
|
|||
DBG_871X(FUNC_ADPT_FMT" Enter 802.11 power save - %s\n",
|
||||
FUNC_ADPT_ARG(padapter), msg);
|
||||
|
||||
if (pwrpriv->lps_enter_cnts < UINT_MAX)
|
||||
pwrpriv->lps_enter_cnts++;
|
||||
else
|
||||
pwrpriv->lps_enter_cnts = 0;
|
||||
#ifdef CONFIG_TDLS
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
|
|
@ -1052,19 +1039,6 @@ _func_enter_;
|
|||
if (val8 & BIT(4))
|
||||
pslv = PS_STATE_S2;
|
||||
|
||||
#ifdef CONFIG_RTL8723A
|
||||
val8 = rtw_btcoex_RpwmVal(padapter);
|
||||
switch (val8)
|
||||
{
|
||||
case 0x4:
|
||||
pslv = PS_STATE_S3;
|
||||
break;
|
||||
|
||||
case 0xC:
|
||||
pslv = PS_STATE_S4;
|
||||
break;
|
||||
}
|
||||
#endif // CONFIG_RTL8723A
|
||||
}
|
||||
#endif // CONFIG_BT_COEXIST
|
||||
|
||||
|
|
@ -1099,8 +1073,7 @@ s32 LPS_RF_ON_check(PADAPTER padapter, u32 delay_ms)
|
|||
if (_TRUE == bAwake)
|
||||
break;
|
||||
|
||||
if (_TRUE == padapter->bSurpriseRemoved)
|
||||
{
|
||||
if (rtw_is_surprise_removed(padapter)) {
|
||||
err = -2;
|
||||
DBG_871X("%s: device surprise removed!!\n", __FUNCTION__);
|
||||
break;
|
||||
|
|
@ -1252,10 +1225,8 @@ _func_enter_;
|
|||
|
||||
DBG_871X("%s.....\n",__FUNCTION__);
|
||||
|
||||
if (_TRUE == Adapter->bSurpriseRemoved)
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=%d Skip!\n",
|
||||
FUNC_ADPT_ARG(Adapter), Adapter->bSurpriseRemoved);
|
||||
if (rtw_is_surprise_removed(Adapter)) {
|
||||
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=_TRUE Skip!\n", FUNC_ADPT_ARG(Adapter));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1291,11 +1262,7 @@ _func_enter_;
|
|||
rtw_hal_get_hwreg(Adapter, HW_VAR_CPWM, &cpwm_now);
|
||||
if ((cpwm_orig ^ cpwm_now) & 0x80)
|
||||
{
|
||||
#ifdef CONFIG_RTL8723A
|
||||
pwrpriv->cpwm = PS_STATE(cpwm_now);
|
||||
#else // !CONFIG_RTL8723A
|
||||
pwrpriv->cpwm = PS_STATE_S4;
|
||||
#endif // !CONFIG_RTL8723A
|
||||
pwrpriv->cpwm_tog = cpwm_now & PS_TOGGLE;
|
||||
#ifdef DBG_CHECK_FW_PS_STATE
|
||||
DBG_871X("%s: polling cpwm OK! cpwm_orig=%02x, cpwm_now=%02x, 0x100=0x%x \n"
|
||||
|
|
@ -1389,10 +1356,8 @@ _func_enter_;
|
|||
return;
|
||||
}
|
||||
|
||||
if (_TRUE == Adapter->bSurpriseRemoved)
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=%d Skip!\n",
|
||||
FUNC_ADPT_ARG(Adapter), Adapter->bSurpriseRemoved);
|
||||
if (rtw_is_surprise_removed(Adapter)) {
|
||||
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=_TRUE Skip!\n", FUNC_ADPT_ARG(Adapter));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -1471,10 +1436,10 @@ _func_enter_;
|
|||
{
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
if ((padapter->bSurpriseRemoved == _TRUE)
|
||||
|| (padapter->hw_init_completed == _FALSE)
|
||||
if (rtw_is_surprise_removed(padapter)
|
||||
|| (!rtw_is_hw_init_completed(padapter))
|
||||
#ifdef CONFIG_USB_HCI
|
||||
|| (padapter->bDriverStopped== _TRUE)
|
||||
|| rtw_is_drv_stopped(padapter)
|
||||
#endif
|
||||
|| (pwrpriv->pwr_mode == PS_MODE_ACTIVE)
|
||||
)
|
||||
|
|
@ -1559,7 +1524,7 @@ static void cpwm_event_callback(struct work_struct *work)
|
|||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(work, struct pwrctrl_priv, cpwm_event);
|
||||
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
|
||||
_adapter *adapter = dvobj->if1;
|
||||
_adapter *adapter = dvobj->padapters[IFACE_ID0];
|
||||
struct reportpwrstate_parm report;
|
||||
|
||||
//DBG_871X("%s\n",__FUNCTION__);
|
||||
|
|
@ -1578,7 +1543,7 @@ static void rpwmtimeout_workitem_callback(struct work_struct *work)
|
|||
|
||||
pwrpriv = container_of(work, struct pwrctrl_priv, rpwmtimeoutwi);
|
||||
dvobj = pwrctl_to_dvobj(pwrpriv);
|
||||
padapter = dvobj->if1;
|
||||
padapter = dvobj->padapters[IFACE_ID0];
|
||||
// DBG_871X("+%s: rpwm=0x%02X cpwm=0x%02X\n", __func__, pwrpriv->rpwm, pwrpriv->cpwm);
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
|
@ -1680,24 +1645,6 @@ _func_enter_;
|
|||
pwrctrl = adapter_to_pwrctl(padapter);
|
||||
pslv = PS_STATE_S2;
|
||||
|
||||
#if defined(CONFIG_RTL8723A) && defined(CONFIG_BT_COEXIST)
|
||||
if (rtw_btcoex_IsBtControlLps(padapter) == _TRUE)
|
||||
{
|
||||
u8 btcoex_rpwm;
|
||||
btcoex_rpwm = rtw_btcoex_RpwmVal(padapter);
|
||||
switch (btcoex_rpwm)
|
||||
{
|
||||
case 0x4:
|
||||
pslv = PS_STATE_S3;
|
||||
break;
|
||||
|
||||
case 0xC:
|
||||
pslv = PS_STATE_S4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_RTL8723A & CONFIG_BT_COEXIST
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
register_task_alive(pwrctrl, task);
|
||||
|
|
@ -1762,19 +1709,6 @@ _func_enter_;
|
|||
if (val8 & BIT(4))
|
||||
pslv = PS_STATE_S2;
|
||||
|
||||
#ifdef CONFIG_RTL8723A
|
||||
val8 = rtw_btcoex_RpwmVal(padapter);
|
||||
switch (val8)
|
||||
{
|
||||
case 0x4:
|
||||
pslv = PS_STATE_S3;
|
||||
break;
|
||||
|
||||
case 0xC:
|
||||
pslv = PS_STATE_S4;
|
||||
break;
|
||||
}
|
||||
#endif // CONFIG_RTL8723A
|
||||
}
|
||||
#endif // CONFIG_BT_COEXIST
|
||||
|
||||
|
|
@ -1826,24 +1760,6 @@ _func_enter_;
|
|||
pwrctrl = adapter_to_pwrctl(padapter);
|
||||
pslv = PS_STATE_S2;
|
||||
|
||||
#if defined(CONFIG_RTL8723A) && defined(CONFIG_BT_COEXIST)
|
||||
if (rtw_btcoex_IsBtControlLps(padapter) == _TRUE)
|
||||
{
|
||||
u8 btcoex_rpwm;
|
||||
btcoex_rpwm = rtw_btcoex_RpwmVal(padapter);
|
||||
switch (btcoex_rpwm)
|
||||
{
|
||||
case 0x4:
|
||||
pslv = PS_STATE_S3;
|
||||
break;
|
||||
|
||||
case 0xC:
|
||||
pslv = PS_STATE_S4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_RTL8723A & CONFIG_BT_COEXIST
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
register_task_alive(pwrctrl, XMIT_ALIVE);
|
||||
|
|
@ -1903,24 +1819,6 @@ _func_enter_;
|
|||
pwrctrl = adapter_to_pwrctl(padapter);
|
||||
pslv = PS_STATE_S2;
|
||||
|
||||
#if defined(CONFIG_RTL8723A) && defined(CONFIG_BT_COEXIST)
|
||||
if (rtw_btcoex_IsBtControlLps(padapter) == _TRUE)
|
||||
{
|
||||
u8 btcoex_rpwm;
|
||||
btcoex_rpwm = rtw_btcoex_RpwmVal(padapter);
|
||||
switch (btcoex_rpwm)
|
||||
{
|
||||
case 0x4:
|
||||
pslv = PS_STATE_S3;
|
||||
break;
|
||||
|
||||
case 0xC:
|
||||
pslv = PS_STATE_S4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_RTL8723A & CONFIG_BT_COEXIST
|
||||
|
||||
_enter_pwrlock(&pwrctrl->lock);
|
||||
|
||||
register_task_alive(pwrctrl, CMD_ALIVE);
|
||||
|
|
@ -2044,19 +1942,6 @@ _func_enter_;
|
|||
if (val8 & BIT(4))
|
||||
pslv = PS_STATE_S2;
|
||||
|
||||
#ifdef CONFIG_RTL8723A
|
||||
val8 = rtw_btcoex_RpwmVal(padapter);
|
||||
switch (val8)
|
||||
{
|
||||
case 0x4:
|
||||
pslv = PS_STATE_S3;
|
||||
break;
|
||||
|
||||
case 0xC:
|
||||
pslv = PS_STATE_S4;
|
||||
break;
|
||||
}
|
||||
#endif // CONFIG_RTL8723A
|
||||
}
|
||||
#endif // CONFIG_BT_COEXIST
|
||||
|
||||
|
|
@ -2124,19 +2009,6 @@ _func_enter_;
|
|||
if (val8 & BIT(4))
|
||||
pslv = PS_STATE_S2;
|
||||
|
||||
#ifdef CONFIG_RTL8723A
|
||||
val8 = rtw_btcoex_RpwmVal(padapter);
|
||||
switch (val8)
|
||||
{
|
||||
case 0x4:
|
||||
pslv = PS_STATE_S3;
|
||||
break;
|
||||
|
||||
case 0xC:
|
||||
pslv = PS_STATE_S4;
|
||||
break;
|
||||
}
|
||||
#endif // CONFIG_RTL8723A
|
||||
}
|
||||
#endif // CONFIG_BT_COEXIST
|
||||
|
||||
|
|
@ -2228,6 +2100,8 @@ static void resume_workitem_callback(struct work_struct *work);
|
|||
void rtw_init_pwrctrl_priv(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrctrlpriv = adapter_to_pwrctl(padapter);
|
||||
int i = 0;
|
||||
u8 val8 = 0;
|
||||
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER)
|
||||
|
|
@ -2245,6 +2119,8 @@ _func_enter_;
|
|||
pwrctrlpriv->rf_pwrstate = rf_on;
|
||||
pwrctrlpriv->ips_enter_cnts=0;
|
||||
pwrctrlpriv->ips_leave_cnts=0;
|
||||
pwrctrlpriv->lps_enter_cnts=0;
|
||||
pwrctrlpriv->lps_leave_cnts=0;
|
||||
pwrctrlpriv->bips_processing = _FALSE;
|
||||
|
||||
pwrctrlpriv->ips_mode = padapter->registrypriv.ips_mode;
|
||||
|
|
@ -2277,6 +2153,7 @@ _func_enter_;
|
|||
|
||||
pwrctrlpriv->pwr_mode = PS_MODE_ACTIVE;
|
||||
pwrctrlpriv->smart_ps = padapter->registrypriv.smart_ps;
|
||||
pwrctrlpriv->disable_smart_ps = _FALSE;
|
||||
pwrctrlpriv->bcn_ant_mode = 0;
|
||||
pwrctrlpriv->dtim = 0;
|
||||
|
||||
|
|
@ -2299,6 +2176,7 @@ _func_enter_;
|
|||
pwrctrlpriv->wowlan_mode = _FALSE;
|
||||
pwrctrlpriv->wowlan_ap_mode = _FALSE;
|
||||
pwrctrlpriv->wowlan_p2p_mode = _FALSE;
|
||||
pwrctrlpriv->wowlan_in_resume = _FALSE;
|
||||
|
||||
#ifdef CONFIG_RESUME_IN_WORKQUEUE
|
||||
_init_workitem(&pwrctrlpriv->resume_work, resume_workitem_callback, NULL);
|
||||
|
|
@ -2310,16 +2188,33 @@ _func_enter_;
|
|||
rtw_register_early_suspend(pwrctrlpriv);
|
||||
#endif //CONFIG_HAS_EARLYSUSPEND || CONFIG_ANDROID_POWER
|
||||
|
||||
#ifdef CONFIG_GPIO_WAKEUP
|
||||
/*default low active*/
|
||||
pwrctrlpriv->is_high_active = HIGH_ACTIVE;
|
||||
val8 = (pwrctrlpriv->is_high_active == 0) ? 1 : 0;
|
||||
rtw_hal_set_output_gpio(padapter, WAKEUP_GPIO_IDX, val8);
|
||||
DBG_871X("%s: set GPIO_%d %d as default.\n",
|
||||
__func__, WAKEUP_GPIO_IDX, val8);
|
||||
#endif /* CONFIG_GPIO_WAKEUP */
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
pwrctrlpriv->wowlan_from_cmd = _FALSE;
|
||||
#endif
|
||||
pwrctrlpriv->wowlan_pattern_idx = 0;
|
||||
for (i = 0 ; i < MAX_WKFM_NUM; i++) {
|
||||
_rtw_memset(pwrctrlpriv->patterns[i].content, '\0',
|
||||
sizeof(pwrctrlpriv->patterns[i].content));
|
||||
_rtw_memset(pwrctrlpriv->patterns[i].mask, '\0',
|
||||
sizeof(pwrctrlpriv->patterns[i].mask));
|
||||
pwrctrlpriv->patterns[i].len = 0;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_PNO_SUPPORT
|
||||
pwrctrlpriv->pno_inited = _FALSE;
|
||||
pwrctrlpriv->pnlo_info = NULL;
|
||||
pwrctrlpriv->pscan_info = NULL;
|
||||
pwrctrlpriv->pno_ssid_list = NULL;
|
||||
pwrctrlpriv->pno_in_resume = _TRUE;
|
||||
#endif
|
||||
#endif /* CONFIG_PNO_SUPPORT */
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
_func_exit_;
|
||||
|
||||
|
|
@ -2347,6 +2242,7 @@ _func_enter_;
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
#ifdef CONFIG_PNO_SUPPORT
|
||||
if (pwrctrlpriv->pnlo_info != NULL)
|
||||
printk("****** pnlo_info memory leak********\n");
|
||||
|
|
@ -2357,6 +2253,7 @@ _func_enter_;
|
|||
if (pwrctrlpriv->pno_ssid_list != NULL)
|
||||
printk("****** pno_ssid_list memory leak********\n");
|
||||
#endif
|
||||
#endif /* CONFIG_WOWLAN */
|
||||
|
||||
#if defined(CONFIG_HAS_EARLYSUSPEND) || defined(CONFIG_ANDROID_POWER)
|
||||
rtw_unregister_early_suspend(pwrctrlpriv);
|
||||
|
|
@ -2375,7 +2272,7 @@ static void resume_workitem_callback(struct work_struct *work)
|
|||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(work, struct pwrctrl_priv, resume_work);
|
||||
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
|
||||
_adapter *adapter = dvobj->if1;
|
||||
_adapter *adapter = dvobj->padapters[IFACE_ID0];
|
||||
|
||||
DBG_871X("%s\n",__FUNCTION__);
|
||||
|
||||
|
|
@ -2430,7 +2327,7 @@ static void rtw_late_resume(struct early_suspend *h)
|
|||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
|
||||
_adapter *adapter = dvobj->if1;
|
||||
_adapter *adapter = dvobj->padapters[IFACE_ID0];
|
||||
|
||||
DBG_871X("%s\n",__FUNCTION__);
|
||||
|
||||
|
|
@ -2483,7 +2380,7 @@ static void rtw_late_resume(android_early_suspend_t *h)
|
|||
{
|
||||
struct pwrctrl_priv *pwrpriv = container_of(h, struct pwrctrl_priv, early_suspend);
|
||||
struct dvobj_priv *dvobj = pwrctl_to_dvobj(pwrpriv);
|
||||
_adapter *adapter = dvobj->if1;
|
||||
_adapter *adapter = dvobj->padapters[IFACE_ID0];
|
||||
|
||||
DBG_871X("%s\n",__FUNCTION__);
|
||||
if(pwrpriv->do_late_resume) {
|
||||
|
|
@ -2672,15 +2569,15 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller)
|
|||
}
|
||||
|
||||
//TODO: the following checking need to be merged...
|
||||
if(padapter->bDriverStopped
|
||||
if (rtw_is_drv_stopped(padapter)
|
||||
|| !padapter->bup
|
||||
|| !padapter->hw_init_completed
|
||||
){
|
||||
DBG_8192C("%s: bDriverStopped=%d, bup=%d, hw_init_completed=%u\n"
|
||||
|| !rtw_is_hw_init_completed(padapter)
|
||||
) {
|
||||
DBG_8192C("%s: bDriverStopped=%s, bup=%d, hw_init_completed=%u\n"
|
||||
, caller
|
||||
, padapter->bDriverStopped
|
||||
, padapter->bup
|
||||
, padapter->hw_init_completed);
|
||||
, rtw_is_drv_stopped(padapter)?"True":"False"
|
||||
, padapter->bup
|
||||
, rtw_get_hw_init_completed(padapter));
|
||||
ret= _FALSE;
|
||||
goto exit;
|
||||
}
|
||||
|
|
@ -2733,7 +2630,7 @@ int rtw_pm_set_ips(_adapter *padapter, u8 mode)
|
|||
else if(mode ==IPS_NONE){
|
||||
rtw_ips_mode_req(pwrctrlpriv, mode);
|
||||
DBG_871X("%s %s\n", __FUNCTION__, "IPS_NONE");
|
||||
if((padapter->bSurpriseRemoved ==0)&&(_FAIL == rtw_pwr_wakeup(padapter)) )
|
||||
if (!rtw_is_surprise_removed(padapter) && (_FAIL == rtw_pwr_wakeup(padapter)))
|
||||
return -EFAULT;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
1151
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_recv.c
Executable file → Normal file
1151
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_recv.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
251
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_rf.c
Executable file → Normal file
251
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_rf.c
Executable file → Normal file
|
|
@ -20,72 +20,205 @@
|
|||
#define _RTW_RF_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
|
||||
struct ch_freq {
|
||||
u32 channel;
|
||||
u32 frequency;
|
||||
};
|
||||
|
||||
struct ch_freq ch_freq_map[] = {
|
||||
{1, 2412},{2, 2417},{3, 2422},{4, 2427},{5, 2432},
|
||||
{6, 2437},{7, 2442},{8, 2447},{9, 2452},{10, 2457},
|
||||
{11, 2462},{12, 2467},{13, 2472},{14, 2484},
|
||||
/* UNII */
|
||||
{36, 5180},{40, 5200},{44, 5220},{48, 5240},{52, 5260},
|
||||
{56, 5280},{60, 5300},{64, 5320},{149, 5745},{153, 5765},
|
||||
{157, 5785},{161, 5805},{165, 5825},{167, 5835},{169, 5845},
|
||||
{171, 5855},{173, 5865},
|
||||
/* HiperLAN2 */
|
||||
{100, 5500},{104, 5520},{108, 5540},{112, 5560},{116, 5580},
|
||||
{120, 5600},{124, 5620},{128, 5640},{132, 5660},{136, 5680},
|
||||
{140, 5700},
|
||||
/* Japan MMAC */
|
||||
{34, 5170},{38, 5190},{42, 5210},{46, 5230},
|
||||
/* Japan */
|
||||
{184, 4920},{188, 4940},{192, 4960},{196, 4980},
|
||||
{208, 5040},/* Japan, means J08 */
|
||||
{212, 5060},/* Japan, means J12 */
|
||||
{216, 5080},/* Japan, means J16 */
|
||||
};
|
||||
|
||||
int ch_freq_map_num = (sizeof(ch_freq_map) / sizeof(struct ch_freq));
|
||||
|
||||
u32 rtw_ch2freq(u32 channel)
|
||||
int rtw_ch2freq(int chan)
|
||||
{
|
||||
u8 i;
|
||||
u32 freq = 0;
|
||||
/* see 802.11 17.3.8.3.2 and Annex J
|
||||
* there are overlapping channel numbers in 5GHz and 2GHz bands */
|
||||
|
||||
for (i = 0; i < ch_freq_map_num; i++)
|
||||
{
|
||||
if (channel == ch_freq_map[i].channel)
|
||||
{
|
||||
freq = ch_freq_map[i].frequency;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* RTK: don't consider the overlapping channel numbers: 5G channel <= 14,
|
||||
* because we don't support it. simply judge from channel number
|
||||
*/
|
||||
|
||||
if (chan >= 1 && chan <= 14) {
|
||||
if (chan == 14)
|
||||
return 2484;
|
||||
else if (chan < 14)
|
||||
return 2407 + chan * 5;
|
||||
} else if (chan >= 36 && chan <= 177) {
|
||||
return 5000 + chan * 5;
|
||||
}
|
||||
if (i == ch_freq_map_num)
|
||||
freq = 2412;
|
||||
|
||||
return freq;
|
||||
return 0; /* not supported */
|
||||
}
|
||||
|
||||
u32 rtw_freq2ch(u32 freq)
|
||||
int rtw_freq2ch(int freq)
|
||||
{
|
||||
u8 i;
|
||||
u32 ch = 0;
|
||||
|
||||
for (i = 0; i < ch_freq_map_num; i++)
|
||||
{
|
||||
if (freq == ch_freq_map[i].frequency)
|
||||
{
|
||||
ch = ch_freq_map[i].channel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == ch_freq_map_num)
|
||||
ch = 1;
|
||||
|
||||
return ch;
|
||||
/* see 802.11 17.3.8.3.2 and Annex J */
|
||||
if (freq == 2484)
|
||||
return 14;
|
||||
else if (freq < 2484)
|
||||
return (freq - 2407) / 5;
|
||||
else if (freq >= 4910 && freq <= 4980)
|
||||
return (freq - 4000) / 5;
|
||||
else if (freq <= 45000) /* DMG band lower limit */
|
||||
return (freq - 5000) / 5;
|
||||
else if (freq >= 58320 && freq <= 64800)
|
||||
return (freq - 56160) / 2160;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool rtw_chbw_to_freq_range(u8 ch, u8 bw, u8 offset, u32 *hi, u32 *lo)
|
||||
{
|
||||
u8 c_ch;
|
||||
u32 freq;
|
||||
u32 hi_ret = 0, lo_ret = 0;
|
||||
int i;
|
||||
bool valid = _FALSE;
|
||||
|
||||
if (hi)
|
||||
*hi = 0;
|
||||
if (lo)
|
||||
*lo = 0;
|
||||
|
||||
c_ch = rtw_get_center_ch(ch, bw, offset);
|
||||
freq = rtw_ch2freq(c_ch);
|
||||
|
||||
if (!freq) {
|
||||
rtw_warn_on(1);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (bw == CHANNEL_WIDTH_80) {
|
||||
hi_ret = freq + 40;
|
||||
lo_ret = freq - 40;
|
||||
} else if (bw == CHANNEL_WIDTH_40) {
|
||||
hi_ret = freq + 20;
|
||||
lo_ret = freq - 20;
|
||||
} else if (bw == CHANNEL_WIDTH_20) {
|
||||
hi_ret = freq + 10;
|
||||
lo_ret = freq - 10;
|
||||
} else {
|
||||
rtw_warn_on(1);
|
||||
}
|
||||
|
||||
if (hi)
|
||||
*hi = hi_ret;
|
||||
if (lo)
|
||||
*lo = lo_ret;
|
||||
|
||||
valid = _TRUE;
|
||||
|
||||
exit:
|
||||
return valid;
|
||||
}
|
||||
|
||||
int rtw_ch_to_bb_gain_sel(int ch)
|
||||
{
|
||||
int sel = -1;
|
||||
|
||||
if (ch >= 1 && ch <= 14)
|
||||
sel = BB_GAIN_2G;
|
||||
#ifdef CONFIG_IEEE80211_BAND_5GHZ
|
||||
else if (ch >= 36 && ch < 50)
|
||||
sel = BB_GAIN_5GLB1;
|
||||
else if (ch >= 50 && ch <= 64)
|
||||
sel = BB_GAIN_5GLB2;
|
||||
else if (ch >= 100 && ch <= 118)
|
||||
sel = BB_GAIN_5GMB1;
|
||||
else if (ch >= 120 && ch <= 140)
|
||||
sel = BB_GAIN_5GMB2;
|
||||
else if (ch >= 149 && ch <= 165)
|
||||
sel = BB_GAIN_5GHB;
|
||||
#endif
|
||||
|
||||
return sel;
|
||||
}
|
||||
|
||||
s8 rtw_rf_get_kfree_tx_gain_offset(_adapter *padapter, u8 path, u8 ch)
|
||||
{
|
||||
s8 kfree_offset = 0;
|
||||
|
||||
#ifdef CONFIG_RF_GAIN_OFFSET
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(padapter);
|
||||
struct kfree_data_t *kfree_data = GET_KFREE_DATA(padapter);
|
||||
s8 bb_gain_sel = rtw_ch_to_bb_gain_sel(ch);
|
||||
|
||||
if (bb_gain_sel < BB_GAIN_2G || bb_gain_sel >= BB_GAIN_NUM) {
|
||||
rtw_warn_on(1);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (kfree_data->flag & KFREE_FLAG_ON) {
|
||||
kfree_offset = kfree_data->bb_gain[bb_gain_sel][path];
|
||||
if (1)
|
||||
DBG_871X("%s path:%u, ch:%u, bb_gain_sel:%d, kfree_offset:%d\n"
|
||||
, __func__, path, ch, bb_gain_sel, kfree_offset);
|
||||
}
|
||||
exit:
|
||||
#endif /* CONFIG_RF_GAIN_OFFSET */
|
||||
|
||||
return kfree_offset;
|
||||
}
|
||||
|
||||
void rtw_rf_set_tx_gain_offset(_adapter *adapter, u8 path, s8 offset)
|
||||
{
|
||||
u8 write_value;
|
||||
|
||||
switch (rtw_get_chip_type(adapter)) {
|
||||
#ifdef CONFIG_RTL8188F
|
||||
case RTL8188F:
|
||||
write_value = RF_TX_GAIN_OFFSET_8188F(offset);
|
||||
rtw_hal_write_rfreg(adapter, path, 0x55, 0x0fc000, write_value);
|
||||
break;
|
||||
#endif /* CONFIG_RTL8188F */
|
||||
#ifdef CONFIG_RTL8821A
|
||||
case RTL8821:
|
||||
write_value = RF_TX_GAIN_OFFSET_8821A(offset);
|
||||
rtw_hal_write_rfreg(adapter, path, 0x55, 0x0f8000, write_value);
|
||||
break;
|
||||
#endif /* CONFIG_RTL8821A */
|
||||
default:
|
||||
rtw_warn_on(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_rf_apply_tx_gain_offset(_adapter *adapter, u8 ch)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
s8 kfree_offset = 0;
|
||||
s8 tx_pwr_track_offset = 0; /* TODO: 8814A should consider tx pwr track when setting tx gain offset */
|
||||
s8 total_offset;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < hal_data->NumTotalRFPath; i++) {
|
||||
kfree_offset = rtw_rf_get_kfree_tx_gain_offset(adapter, i, ch);
|
||||
total_offset = kfree_offset + tx_pwr_track_offset;
|
||||
rtw_rf_set_tx_gain_offset(adapter, i, total_offset);
|
||||
}
|
||||
}
|
||||
|
||||
bool rtw_is_dfs_range(u32 hi, u32 lo)
|
||||
{
|
||||
return rtw_is_range_overlap(hi, lo, 5720 + 10, 5260 - 10)?_TRUE:_FALSE;
|
||||
}
|
||||
|
||||
bool rtw_is_dfs_ch(u8 ch, u8 bw, u8 offset)
|
||||
{
|
||||
u32 hi, lo;
|
||||
|
||||
if (rtw_chbw_to_freq_range(ch, bw, offset, &hi, &lo) == _FALSE)
|
||||
return _FALSE;
|
||||
|
||||
return rtw_is_dfs_range(hi, lo)?_TRUE:_FALSE;
|
||||
}
|
||||
|
||||
bool rtw_is_long_cac_range(u32 hi, u32 lo)
|
||||
{
|
||||
return rtw_is_range_overlap(hi, lo, 5660 + 10, 5600 - 10)?_TRUE:_FALSE;
|
||||
}
|
||||
|
||||
bool rtw_is_long_cac_ch(u8 ch, u8 bw, u8 offset)
|
||||
{
|
||||
u32 hi, lo;
|
||||
|
||||
if (rtw_chbw_to_freq_range(ch, bw, offset, &hi, &lo) == _FALSE)
|
||||
return _FALSE;
|
||||
|
||||
return rtw_is_long_cac_range(hi, lo)?_TRUE:_FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
142
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_security.c
Executable file → Normal file
142
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_security.c
Executable file → Normal file
|
|
@ -1733,8 +1733,9 @@ _func_enter_;
|
|||
prwskey=pattrib->dot118021x_UncstKey.skey;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS //swencryption
|
||||
#ifdef CONFIG_TDLS
|
||||
{
|
||||
/* Swencryption */
|
||||
struct sta_info *ptdls_sta;
|
||||
ptdls_sta=rtw_get_stainfo(&padapter->stapriv ,&pattrib->dst[0] );
|
||||
if((ptdls_sta != NULL) && (ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) )
|
||||
|
|
@ -2213,8 +2214,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *precvframe)
|
|||
_rtw_memcpy(&temp_ipn, p+4, 6);
|
||||
temp_ipn = le64_to_cpu(temp_ipn);
|
||||
//BIP packet number should bigger than previous BIP packet
|
||||
if(temp_ipn <= pmlmeext->mgnt_80211w_IPN_rx)
|
||||
{
|
||||
if (temp_ipn < pmlmeext->mgnt_80211w_IPN_rx) {
|
||||
DBG_871X("replay BIP packet\n");
|
||||
goto BIP_exit;
|
||||
}
|
||||
|
|
@ -3029,12 +3029,12 @@ void wpa_tdls_generate_tpk(_adapter *padapter, PVOID sta)
|
|||
* added by the KDF anyway..
|
||||
*/
|
||||
|
||||
if (os_memcmp(myid(&(padapter->eeprompriv)), psta->hwaddr, ETH_ALEN) < 0) {
|
||||
_rtw_memcpy(data, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
if (os_memcmp(adapter_mac_addr(padapter), psta->hwaddr, ETH_ALEN) < 0) {
|
||||
_rtw_memcpy(data, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
_rtw_memcpy(data + ETH_ALEN, psta->hwaddr, ETH_ALEN);
|
||||
} else {
|
||||
_rtw_memcpy(data, psta->hwaddr, ETH_ALEN);
|
||||
_rtw_memcpy(data + ETH_ALEN, myid(&(padapter->eeprompriv)), ETH_ALEN);
|
||||
_rtw_memcpy(data + ETH_ALEN, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
}
|
||||
_rtw_memcpy(data + 2 * ETH_ALEN, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
|
||||
|
|
@ -3101,6 +3101,55 @@ int wpa_tdls_ftie_mic(u8 *kck, u8 trans_seq,
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* wpa_tdls_teardown_ftie_mic - Calculate TDLS TEARDOWN FTIE MIC
|
||||
* @kck: TPK-KCK
|
||||
* @lnkid: Pointer to the beginning of Link Identifier IE
|
||||
* @reason: Reason code of TDLS Teardown
|
||||
* @dialog_token: Dialog token that was used in the MIC calculation for TPK Handshake Message 3
|
||||
* @trans_seq: Transaction Sequence number (1 octet) which shall be set to the value 4
|
||||
* @ftie: Pointer to the beginning of FT IE
|
||||
* @mic: Pointer for writing MIC
|
||||
*
|
||||
* Calculate MIC for TDLS TEARDOWN frame according to Section 10.22.5 in IEEE 802.11 - 2012.
|
||||
*/
|
||||
int wpa_tdls_teardown_ftie_mic(u8 *kck, u8 *lnkid, u16 reason,
|
||||
u8 dialog_token, u8 trans_seq, u8 *ftie, u8 *mic)
|
||||
{
|
||||
u8 *buf, *pos;
|
||||
struct wpa_tdls_ftie *_ftie;
|
||||
int ret;
|
||||
int len = 2 + lnkid[1] + 2 + 1 + 1 + 2 + ftie[1];
|
||||
|
||||
buf = rtw_zmalloc(len);
|
||||
if (!buf) {
|
||||
DBG_871X("TDLS: No memory for MIC calculation\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pos = buf;
|
||||
/* 1) Link Identifier IE */
|
||||
_rtw_memcpy(pos, lnkid, 2 + lnkid[1]);
|
||||
pos += 2 + lnkid[1];
|
||||
/* 2) Reason Code */
|
||||
_rtw_memcpy(pos, (u8 *)&reason, 2);
|
||||
pos += 2;
|
||||
/* 3) Dialog Token */
|
||||
*pos++ = dialog_token;
|
||||
/* 4) Transaction Sequence number */
|
||||
*pos++ = trans_seq;
|
||||
/* 5) FTIE, with the MIC field of the FTIE set to 0 */
|
||||
_rtw_memcpy(pos, ftie, 2 + ftie[1]);
|
||||
_ftie = (struct wpa_tdls_ftie *) pos;
|
||||
_rtw_memset(_ftie->mic, 0, TDLS_MIC_LEN);
|
||||
pos += 2 + ftie[1];
|
||||
|
||||
ret = omac1_aes_128(kck, buf, pos - buf, mic);
|
||||
rtw_mfree(buf, len);
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
int tdls_verify_mic(u8 *kck, u8 trans_seq,
|
||||
u8 *lnkid, u8 *rsnie, u8 *timeoutie, u8 *ftie)
|
||||
{
|
||||
|
|
@ -3112,14 +3161,14 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq,
|
|||
|
||||
if (lnkid == NULL || rsnie == NULL ||
|
||||
timeoutie == NULL || ftie == NULL){
|
||||
return 0;
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
len = 2 * ETH_ALEN + 1 + 2 + 18 + 2 + *(rsnie+1) + 2 + *(timeoutie+1) + 2 + *(ftie+1);
|
||||
|
||||
buf = rtw_zmalloc(len);
|
||||
if (buf == NULL)
|
||||
return 0;
|
||||
return _FAIL;
|
||||
|
||||
pos = buf;
|
||||
/* 1) TDLS initiator STA MAC address */
|
||||
|
|
@ -3149,17 +3198,17 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq,
|
|||
ret = omac1_aes_128(kck, buf, pos - buf, mic);
|
||||
rtw_mfree(buf, len);
|
||||
if (ret)
|
||||
return 0;
|
||||
return _FAIL;
|
||||
rx_ftie = ftie+4;
|
||||
|
||||
if (os_memcmp(mic, rx_ftie, 16) == 0) {
|
||||
//Valid MIC
|
||||
return 1;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
//Invalid MIC
|
||||
DBG_871X( "[%s] Invalid MIC\n", __FUNCTION__);
|
||||
return 0;
|
||||
return _FAIL;
|
||||
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
|
|
@ -3173,8 +3222,10 @@ _func_enter_;
|
|||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler ^^^\n"));
|
||||
|
||||
/*
|
||||
if(padapter->bDriverStopped ||padapter->bSurpriseRemoved){
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler (padapter->bDriverStopped %d)(padapter->bSurpriseRemoved %d)^^^\n",padapter->bDriverStopped,padapter->bSurpriseRemoved));
|
||||
if (RTW_CANNOT_RUN(padapter)) {
|
||||
RT_TRACE(_module_rtl871x_security_c_,_drv_err_,("^^^rtw_use_tkipkey_handler (padapter->bDriverStopped %s)(padapter->bSurpriseRemoved %s)^^^\n"
|
||||
, rtw_is_drv_stopped(padapter)?"True":"False"
|
||||
, rtw_is_surprise_removed(padapter)?"True":"False"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
@ -3228,3 +3279,68 @@ u8 rtw_handle_tkip_countermeasure(_adapter* adapter, const char *caller)
|
|||
return status;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_WOWLAN
|
||||
u16 rtw_cal_crc16(u8 data, u16 crc)
|
||||
{
|
||||
u8 shift_in, data_bit;
|
||||
u8 crc_bit4, crc_bit11, crc_bit15;
|
||||
u16 crc_result;
|
||||
int index;
|
||||
|
||||
for (index = 0; index < 8; index++) {
|
||||
crc_bit15 = ((crc & BIT15) ? 1 : 0);
|
||||
data_bit = (data & (BIT0 << index) ? 1 : 0);
|
||||
shift_in = crc_bit15 ^ data_bit;
|
||||
/*printf("crc_bit15=%d, DataBit=%d, shift_in=%d\n",
|
||||
* crc_bit15, data_bit, shift_in);*/
|
||||
|
||||
crc_result = crc << 1;
|
||||
|
||||
if (shift_in == 0)
|
||||
crc_result &= (~BIT0);
|
||||
else
|
||||
crc_result |= BIT0;
|
||||
/*printf("CRC =%x\n",CRC_Result);*/
|
||||
|
||||
crc_bit11 = ((crc & BIT11) ? 1 : 0) ^ shift_in;
|
||||
|
||||
if (crc_bit11 == 0)
|
||||
crc_result &= (~BIT12);
|
||||
else
|
||||
crc_result |= BIT12;
|
||||
|
||||
/*printf("bit12 CRC =%x\n",CRC_Result);*/
|
||||
|
||||
crc_bit4 = ((crc & BIT4) ? 1 : 0) ^ shift_in;
|
||||
|
||||
if (crc_bit4 == 0)
|
||||
crc_result &= (~BIT5);
|
||||
else
|
||||
crc_result |= BIT5;
|
||||
|
||||
/* printf("bit5 CRC =%x\n",CRC_Result); */
|
||||
/* repeat using the last result*/
|
||||
crc = crc_result;
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
|
||||
/*
|
||||
* function name :rtw_calc_crc
|
||||
*
|
||||
* input: char* pattern , pattern size
|
||||
*
|
||||
*/
|
||||
u16 rtw_calc_crc(u8 *pdata, int length)
|
||||
{
|
||||
u16 crc = 0xffff;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < length; i++)
|
||||
crc = rtw_cal_crc16(pdata[i], crc);
|
||||
/* get 1' complement */
|
||||
crc = ~crc;
|
||||
|
||||
return crc;
|
||||
}
|
||||
#endif /*CONFIG_WOWLAN*/
|
||||
|
|
|
|||
8
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_sreset.c
Executable file → Normal file
8
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_sreset.c
Executable file → Normal file
|
|
@ -162,7 +162,7 @@ void sreset_restore_security_station(_adapter *padapter)
|
|||
else
|
||||
{
|
||||
//pairwise key
|
||||
rtw_setstakey_cmd(padapter, psta, _TRUE,_FALSE);
|
||||
rtw_setstakey_cmd(padapter, psta, UNICAST_KEY,_FALSE);
|
||||
//group key
|
||||
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE);
|
||||
}
|
||||
|
|
@ -219,7 +219,7 @@ void sreset_restore_network_station(_adapter *padapter)
|
|||
set_channel_bwmode(padapter, pmlmeext->cur_channel, pmlmeext->cur_ch_offset, pmlmeext->cur_bwmode);
|
||||
|
||||
//disable dynamic functions, such as high power, DIG
|
||||
//Switch_DM_Func(padapter, DYNAMIC_FUNC_DISABLE, _FALSE);
|
||||
/*rtw_phydm_func_disable_all(padapter);*/
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
|
||||
|
||||
|
|
@ -232,7 +232,7 @@ void sreset_restore_network_station(_adapter *padapter)
|
|||
|
||||
mlmeext_joinbss_event_callback(padapter, 1);
|
||||
//restore Sequence No.
|
||||
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RESTORE_HW_SEQ, 0);
|
||||
|
||||
sreset_restore_security_station(padapter);
|
||||
}
|
||||
|
|
@ -247,9 +247,11 @@ void sreset_restore_network_status(_adapter *padapter)
|
|||
if (check_fwstate(mlmepriv, WIFI_STATION_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_STATION_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
sreset_restore_network_station(padapter);
|
||||
#ifdef CONFIG_AP_MODE
|
||||
} else if (check_fwstate(mlmepriv, WIFI_AP_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_AP_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
rtw_ap_restore_network(padapter);
|
||||
#endif /*CONFIG_AP_MODE*/
|
||||
} else if (check_fwstate(mlmepriv, WIFI_ADHOC_STATE)) {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - WIFI_ADHOC_STATE\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
} else {
|
||||
|
|
|
|||
11
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_sta_mgt.c
Executable file → Normal file
11
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_sta_mgt.c
Executable file → Normal file
|
|
@ -71,6 +71,7 @@ _func_enter_;
|
|||
psta->no_ht_gf_set = 0;
|
||||
psta->no_ht_set = 0;
|
||||
psta->ht_20mhz_set = 0;
|
||||
psta->ht_40mhz_intolerant = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
|
|
@ -390,7 +391,9 @@ _func_enter_;
|
|||
pstapriv->asoc_sta_count , hwaddr[0], hwaddr[1], hwaddr[2],hwaddr[3],hwaddr[4],hwaddr[5]));
|
||||
|
||||
init_addba_retry_timer(pstapriv->padapter, psta);
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
init_dot11w_expire_timer(pstapriv->padapter, psta);
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
#ifdef CONFIG_TDLS
|
||||
rtw_init_tdls_timer(pstapriv->padapter, psta);
|
||||
#endif //CONFIG_TDLS
|
||||
|
|
@ -412,6 +415,7 @@ _func_enter_;
|
|||
preorder_ctrl->wend_b= 0xffff;
|
||||
//preorder_ctrl->wsize_b = (NR_RECVBUFF-2);
|
||||
preorder_ctrl->wsize_b = 64;//64;
|
||||
preorder_ctrl->ampdu_size = RX_AMPDU_SIZE_INVALID;
|
||||
|
||||
_rtw_init_queue(&preorder_ctrl->pending_recvframe_queue);
|
||||
|
||||
|
|
@ -536,10 +540,13 @@ _func_enter_;
|
|||
// re-init sta_info; 20061114 // will be init in alloc_stainfo
|
||||
//_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
//_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
||||
#ifdef CONFIG_IEEE80211W
|
||||
_cancel_timer_ex(&psta->dot11w_expire_timer);
|
||||
#endif /* CONFIG_IEEE80211W */
|
||||
_cancel_timer_ex(&psta->addba_retry_timer);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
psta->tdls_sta_state = TDLS_STATE_NONE;
|
||||
rtw_free_tdls_timer(psta);
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
|
|
|
|||
2897
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_tdls.c
Executable file → Normal file
2897
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_tdls.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
82
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_vht.c
Executable file → Normal file
82
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_vht.c
Executable file → Normal file
|
|
@ -64,7 +64,7 @@ u8 rtw_get_vht_highest_rate(u8 *pvht_mcs_map)
|
|||
}
|
||||
}
|
||||
|
||||
//DBG_871X("HighestVHTMCSRate is %x\n", vht_mcs_rate);
|
||||
/* DBG_871X("HighestVHTMCSRate is %x\n", vht_mcs_rate); */
|
||||
return vht_mcs_rate;
|
||||
}
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ u8 rtw_vht_mcsmap_to_nss(u8 *pvht_mcs_map)
|
|||
}
|
||||
}
|
||||
|
||||
//DBG_871X("%s : %dSS\n", __FUNCTION__, nss);
|
||||
/* DBG_871X("%s : %dSS\n", __FUNCTION__, nss); */
|
||||
return nss;
|
||||
}
|
||||
|
||||
|
|
@ -119,9 +119,9 @@ void rtw_vht_nss_to_mcsmap(u8 nss, u8 *target_mcs_map, u8 *cur_mcs_map)
|
|||
|
||||
u16 rtw_vht_mcs_to_data_rate(u8 bw, u8 short_GI, u8 vht_mcs_rate)
|
||||
{
|
||||
if(vht_mcs_rate > MGN_VHT2SS_MCS9)
|
||||
vht_mcs_rate = MGN_VHT2SS_MCS9;
|
||||
|
||||
if(vht_mcs_rate > MGN_VHT3SS_MCS9)
|
||||
vht_mcs_rate = MGN_VHT3SS_MCS9;
|
||||
/* DBG_871X("bw=%d, short_GI=%d, ((vht_mcs_rate - MGN_VHT1SS_MCS0)&0x3f)=%d\n", bw, short_GI, ((vht_mcs_rate - MGN_VHT1SS_MCS0)&0x3f)); */
|
||||
return VHT_MCS_DATA_RATE[bw][short_GI][((vht_mcs_rate - MGN_VHT1SS_MCS0)&0x3f)];
|
||||
}
|
||||
|
||||
|
|
@ -189,10 +189,12 @@ void rtw_vht_use_default_setting(_adapter *padapter)
|
|||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
||||
if (rf_type == RF_1T1R)
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfe; // Only support 1SS MCS 0~9;
|
||||
if (rf_type == RF_3T3R)
|
||||
pvhtpriv->vht_mcs_map[0] = 0xea; /* support 1SS MCS 0~9 2SS MCS 0~9 3SS MCS 0~9 */
|
||||
else if(rf_type == RF_2T2R)
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfa; /* support 1SS MCS 0~9 2SS MCS 0~9 */
|
||||
else
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfa; //support 1SS MCS 0~9 2SS MCS 0~9
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfe; /* Only support 1SS MCS 0~9; */
|
||||
pvhtpriv->vht_mcs_map[1] = 0xff;
|
||||
|
||||
if(pregistrypriv->vht_rate_sel == 1)
|
||||
|
|
@ -235,19 +237,21 @@ void rtw_vht_use_default_setting(_adapter *padapter)
|
|||
pvhtpriv->vht_highest_rate = rtw_get_vht_highest_rate(pvhtpriv->vht_mcs_map);
|
||||
}
|
||||
|
||||
u32 rtw_vht_rate_to_bitmap(u8 *pVHTRate)
|
||||
u64 rtw_vht_rate_to_bitmap(u8 *pVHTRate)
|
||||
{
|
||||
|
||||
u8 i,j , tmpRate;
|
||||
u32 RateBitmap = 0;
|
||||
u64 RateBitmap = 0;
|
||||
u8 Bits_3ss = 6;
|
||||
|
||||
for(i = j= 0; i < 4; i+=2, j+=10)
|
||||
for(i = j= 0; i < Bits_3ss; i+=2, j+=10)
|
||||
{
|
||||
/* every two bits means single sptial stream */
|
||||
tmpRate = (pVHTRate[0] >> i) & 3;
|
||||
|
||||
switch(tmpRate){
|
||||
case 2:
|
||||
RateBitmap = RateBitmap | (0x03ff << j);
|
||||
RateBitmap = RateBitmap | (0x03ff << j);
|
||||
break;
|
||||
case 1:
|
||||
RateBitmap = RateBitmap | (0x01ff << j);
|
||||
|
|
@ -261,7 +265,7 @@ u32 rtw_vht_rate_to_bitmap(u8 *pVHTRate)
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DBG_871X("RateBitmap=%016llx , pVHTRate[0]=%02x, pVHTRate[1]=%02x\n", RateBitmap, pVHTRate[0], pVHTRate[1]);
|
||||
return RateBitmap;
|
||||
}
|
||||
|
||||
|
|
@ -425,6 +429,8 @@ void VHT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
|||
vht_mcs[0] |= 0xfc;
|
||||
else if (rf_type == RF_2T2R)
|
||||
vht_mcs[0] |= 0xf0;
|
||||
else if (rf_type == RF_3T3R)
|
||||
vht_mcs[0] |= 0xc0;
|
||||
|
||||
_rtw_memcpy(pvhtpriv->vht_mcs_map, vht_mcs, 2);
|
||||
|
||||
|
|
@ -486,10 +492,12 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel)
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
//struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
u8 ChnlWidth, center_freq, bw_mode;
|
||||
u8 ChnlWidth, center_freq, bw_mode, rf_type = 0;
|
||||
u32 len = 0;
|
||||
u8 operation[5];
|
||||
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
|
||||
_rtw_memset(operation, 0, 5);
|
||||
|
||||
bw_mode = pregistrypriv->bw_mode >> 4;
|
||||
|
|
@ -510,8 +518,35 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel)
|
|||
//center frequency
|
||||
SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ1(operation, center_freq);//Todo: need to set correct center channel
|
||||
SET_VHT_OPERATION_ELE_CHL_CENTER_FREQ2(operation,0);
|
||||
operation[3] = 0xff;
|
||||
|
||||
if (padapter->registrypriv.rf_config != RF_MAX_TYPE)
|
||||
rf_type = padapter->registrypriv.rf_config;
|
||||
|
||||
switch (rf_type) {
|
||||
case RF_1T1R:
|
||||
operation[3] = 0xfe;
|
||||
operation[4] = 0xff;
|
||||
break;
|
||||
case RF_1T2R:
|
||||
case RF_2T2R:
|
||||
case RF_2T2R_GREEN:
|
||||
operation[3] = 0xfa;
|
||||
operation[4] = 0xff;
|
||||
break;
|
||||
case RF_2T3R:
|
||||
case RF_2T4R:
|
||||
case RF_3T3R:
|
||||
case RF_3T4R:
|
||||
operation[3] = 0xea;
|
||||
operation[4] = 0xff;
|
||||
break;
|
||||
case RF_4T4R:
|
||||
operation[3] = 0xaa;
|
||||
operation[4] = 0xff;
|
||||
break;
|
||||
default:
|
||||
DBG_871X("%s, %d, unknown rf type\n", __func__, __LINE__);
|
||||
}
|
||||
|
||||
rtw_set_ie(pbuf, EID_VHTOperation, 5, operation, &len);
|
||||
|
||||
|
|
@ -530,10 +565,12 @@ u32 rtw_build_vht_op_mode_notify_ie(_adapter *padapter, u8 *pbuf, u8 bw)
|
|||
chnl_width = bw;
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
if(rf_type == RF_1T1R)
|
||||
rx_nss = 1;
|
||||
else
|
||||
if(rf_type == RF_3T3R)
|
||||
rx_nss = 3;
|
||||
else if(rf_type == RF_2T2R)
|
||||
rx_nss = 2;
|
||||
else
|
||||
rx_nss = 1;
|
||||
|
||||
SET_VHT_OPERATING_MODE_FIELD_CHNL_WIDTH(&opmode, chnl_width);
|
||||
SET_VHT_OPERATING_MODE_FIELD_RX_NSS(&opmode, (rx_nss-1));
|
||||
|
|
@ -558,7 +595,10 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
|||
|
||||
pcap = pvhtpriv->vht_cap;
|
||||
_rtw_memset(pcap, 0, 32);
|
||||
|
||||
|
||||
/* B0 B1 Maximum MPDU Length */
|
||||
SET_VHT_CAPABILITY_ELE_MAX_MPDU_LENGTH(pcap, 2);
|
||||
|
||||
// B2 B3 Supported Channel Width Set
|
||||
SET_VHT_CAPABILITY_ELE_CHL_WIDTH(pcap, 0); //indicate we don't support neither 160M nor 80+80M bandwidth.
|
||||
|
||||
|
|
@ -585,7 +625,7 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
|||
{
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
if ((rf_type == RF_2T2R) || (rf_type == RF_1T2R)) {
|
||||
SET_VHT_CAPABILITY_ELE_RX_STBC(pcap, 2);
|
||||
SET_VHT_CAPABILITY_ELE_RX_STBC(pcap, 1);
|
||||
}
|
||||
else if (rf_type == RF_1T1R) {
|
||||
SET_VHT_CAPABILITY_ELE_RX_STBC(pcap, 1);
|
||||
|
|
|
|||
0
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_wapi.c
Executable file → Normal file
0
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_wapi.c
Executable file → Normal file
0
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_wapi_sms4.c
Executable file → Normal file
0
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_wapi_sms4.c
Executable file → Normal file
1015
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_wlan_util.c
Executable file → Normal file
1015
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_wlan_util.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
263
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_xmit.c
Executable file → Normal file
263
drivers/net/wireless/rockchip_wlan/rtl8189es/core/rtw_xmit.c
Executable file → Normal file
|
|
@ -77,7 +77,8 @@ _func_enter_;
|
|||
_rtw_spinlock_init(&pxmitpriv->lock);
|
||||
_rtw_spinlock_init(&pxmitpriv->lock_sctx);
|
||||
_rtw_init_sema(&pxmitpriv->xmit_sema, 0);
|
||||
_rtw_init_sema(&pxmitpriv->terminate_xmitthread_sema, 0);
|
||||
/*_rtw_init_sema(&pxmitpriv->terminate_xmitthread_sema, 0);*/
|
||||
_rtw_init_completion(&pxmitpriv->xmitthread_comp);
|
||||
|
||||
/*
|
||||
Please insert all the queue initializaiton using _rtw_init_queue below
|
||||
|
|
@ -339,7 +340,7 @@ void rtw_mfree_xmit_priv_lock (struct xmit_priv *pxmitpriv)
|
|||
{
|
||||
_rtw_spinlock_free(&pxmitpriv->lock);
|
||||
_rtw_free_sema(&pxmitpriv->xmit_sema);
|
||||
_rtw_free_sema(&pxmitpriv->terminate_xmitthread_sema);
|
||||
/* _rtw_free_sema(&pxmitpriv->terminate_xmitthread_sema); */
|
||||
|
||||
_rtw_spinlock_free(&pxmitpriv->be_pending.lock);
|
||||
_rtw_spinlock_free(&pxmitpriv->bk_pending.lock);
|
||||
|
|
@ -658,6 +659,19 @@ static void update_attrib_phy_info(_adapter *padapter, struct pkt_attrib *pattri
|
|||
// pattrib->ampdu_en = _TRUE;
|
||||
//}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if (pattrib->direct_link==_TRUE) {
|
||||
psta = pattrib->ptdls_sta;
|
||||
|
||||
pattrib->raid = psta->raid;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
pattrib->bwmode = psta->bw_mode;
|
||||
pattrib->ht_en = psta->htpriv.ht_option;
|
||||
pattrib->ch_offset = psta->htpriv.ch_offset;
|
||||
pattrib->sgi= query_ra_short_GI(psta);
|
||||
#endif /* CONFIG_80211N_HT */
|
||||
}
|
||||
#endif /* CONFIG_TDLS */
|
||||
|
||||
pattrib->retry_ctrl = _FALSE;
|
||||
|
||||
|
|
@ -727,6 +741,13 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib
|
|||
pattrib->encrypt=_NO_PRIVACY_;
|
||||
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if (pattrib->direct_link == _TRUE) {
|
||||
if (pattrib->encrypt > 0)
|
||||
pattrib->encrypt = _AES_;
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (pattrib->encrypt)
|
||||
{
|
||||
|
|
@ -810,25 +831,16 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib
|
|||
pattrib->bswenc = _TRUE;//force using sw enc.
|
||||
}
|
||||
#endif
|
||||
#ifdef DYNAMIC_CAMID_ALLOC
|
||||
if (pattrib->encrypt && bmcast && _rtw_camctl_chk_flags(padapter, SEC_STATUS_STA_PK_GK_CONFLICT_DIS_BMC_SEARCH))
|
||||
pattrib->bswenc = _TRUE;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
if(pattrib->encrypt == _SMS4_)
|
||||
pattrib->bswenc = _FALSE;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if(pattrib->direct_link == _TRUE)
|
||||
{
|
||||
pattrib->mac_id = pattrib->ptdls_sta->mac_id;
|
||||
if(pattrib->encrypt>0)
|
||||
{
|
||||
pattrib->encrypt= _AES_;
|
||||
pattrib->iv_len=8;
|
||||
pattrib->icv_len=8;
|
||||
pattrib->bswenc = _FALSE;
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
exit:
|
||||
|
||||
return res;
|
||||
|
|
@ -896,20 +908,37 @@ static void set_qos(struct pkt_file *ppktfile, struct pkt_attrib *pattrib)
|
|||
}
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
void rtw_check_tdls_established(_adapter *padapter, struct pkt_attrib *pattrib)
|
||||
u8 rtw_check_tdls_established(_adapter *padapter, struct pkt_attrib *pattrib)
|
||||
{
|
||||
pattrib->ptdls_sta = NULL;
|
||||
|
||||
pattrib->direct_link = _FALSE;
|
||||
if((padapter->tdlsinfo.link_established == _TRUE)){
|
||||
if (padapter->tdlsinfo.link_established == _TRUE) {
|
||||
pattrib->ptdls_sta = rtw_get_stainfo(&padapter->stapriv, pattrib->dst);
|
||||
#if 1
|
||||
if((pattrib->ptdls_sta!=NULL)&&
|
||||
(pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE)&&
|
||||
(pattrib->ether_type!=0x0806)){
|
||||
pattrib->direct_link = _TRUE;
|
||||
//DBG_871X("send ptk to "MAC_FMT" using direct link\n", MAC_ARG(pattrib->dst));
|
||||
}
|
||||
#else
|
||||
if (pattrib->ptdls_sta != NULL &&
|
||||
pattrib->ptdls_sta->tdls_sta_state & TDLS_LINKED_STATE) {
|
||||
pattrib->direct_link = _TRUE;
|
||||
#if 0
|
||||
DBG_871X("send ptk to "MAC_FMT" using direct link\n", MAC_ARG(pattrib->dst));
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ARP frame may be helped by AP*/
|
||||
if (pattrib->ether_type != 0x0806) {
|
||||
pattrib->direct_link = _FALSE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return pattrib->direct_link;
|
||||
}
|
||||
|
||||
s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib)
|
||||
|
|
@ -933,7 +962,7 @@ s32 update_tdls_attrib(_adapter *padapter, struct pkt_attrib *pattrib)
|
|||
pattrib->psta = psta;
|
||||
pattrib->ack_policy = 0;
|
||||
// get ether_hdr_len
|
||||
pattrib->pkt_hdrlen = ETH_HLEN;//(pattrib->ether_type == 0x8100) ? (14 + 4 ): 14; //vlan tag
|
||||
pattrib->pkt_hdrlen = ETH_HLEN;
|
||||
|
||||
// [TDLS] TODO: setup req/rsp should be AC_BK
|
||||
if (pqospriv->qos_option && psta->qos_option) {
|
||||
|
|
@ -1007,12 +1036,17 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
|
|||
if ((check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) == _TRUE) ||
|
||||
(check_fwstate(pmlmepriv, WIFI_ADHOC_MASTER_STATE) == _TRUE)) {
|
||||
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
|
||||
_rtw_memcpy(pattrib->ta, myid(&padapter->eeprompriv), ETH_ALEN);
|
||||
_rtw_memcpy(pattrib->ta, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_adhoc);
|
||||
}
|
||||
else if (check_fwstate(pmlmepriv, WIFI_STATION_STATE)) {
|
||||
#ifdef CONFIG_TDLS
|
||||
if (rtw_check_tdls_established(padapter, pattrib) == _TRUE)
|
||||
_rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); /* For TDLS direct link Tx, set ra to be same to dst */
|
||||
else
|
||||
#endif
|
||||
_rtw_memcpy(pattrib->ra, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
_rtw_memcpy(pattrib->ta, myid(&padapter->eeprompriv), ETH_ALEN);
|
||||
_rtw_memcpy(pattrib->ta, adapter_mac_addr(padapter), ETH_ALEN);
|
||||
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_sta);
|
||||
}
|
||||
else if (check_fwstate(pmlmepriv, WIFI_AP_STATE)) {
|
||||
|
|
@ -1023,10 +1057,6 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
|
|||
else
|
||||
DBG_COUNTER(padapter->tx_logs.core_tx_upd_attrib_unknown);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
rtw_check_tdls_established(padapter, pattrib);
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
pattrib->pktlen = pktfile.pkt_len;
|
||||
|
||||
if (ETH_P_IP == pattrib->ether_type)
|
||||
|
|
@ -1181,13 +1211,18 @@ static s32 update_attrib(_adapter *padapter, _pkt *pkt, struct pkt_attrib *pattr
|
|||
}
|
||||
else
|
||||
{
|
||||
if(pqospriv->qos_option)
|
||||
#ifdef CONFIG_TDLS
|
||||
if (pattrib->direct_link == _TRUE) {
|
||||
if (pattrib->qos_en)
|
||||
set_qos(&pktfile, pattrib);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
set_qos(&pktfile, pattrib);
|
||||
if (pqospriv->qos_option) {
|
||||
set_qos(&pktfile, pattrib);
|
||||
|
||||
if(pmlmepriv->acm_mask != 0)
|
||||
{
|
||||
pattrib->priority = qos_acm(pmlmepriv->acm_mask, pattrib->priority);
|
||||
if (pmlmepriv->acm_mask != 0)
|
||||
pattrib->priority = qos_acm(pmlmepriv->acm_mask, pattrib->priority);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1404,11 +1439,6 @@ s32 rtw_make_wlanhdr (_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib)
|
|||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
|
||||
u8 qos_option = _FALSE;
|
||||
#ifdef CONFIG_TDLS
|
||||
struct tdls_info *ptdlsinfo = &padapter->tdlsinfo;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
sint res = _SUCCESS;
|
||||
u16 *fctrl = &pwlanhdr->frame_ctl;
|
||||
|
||||
|
|
@ -1452,6 +1482,9 @@ _func_enter_;
|
|||
_rtw_memcpy(pwlanhdr->addr1, pattrib->dst, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->src, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
|
||||
if (pattrib->qos_en)
|
||||
qos_option = _TRUE;
|
||||
}
|
||||
else
|
||||
#endif //CONFIG_TDLS
|
||||
|
|
@ -1463,11 +1496,10 @@ _func_enter_;
|
|||
_rtw_memcpy(pwlanhdr->addr1, get_bssid(pmlmepriv), ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr2, pattrib->ta, ETH_ALEN);
|
||||
_rtw_memcpy(pwlanhdr->addr3, pattrib->dst, ETH_ALEN);
|
||||
|
||||
if (pqospriv->qos_option)
|
||||
qos_option = _TRUE;
|
||||
}
|
||||
|
||||
if (pqospriv->qos_option)
|
||||
qos_option = _TRUE;
|
||||
|
||||
}
|
||||
else if ((check_fwstate(pmlmepriv, WIFI_AP_STATE) == _TRUE) ) {
|
||||
//to_ds = 0, fr_ds = 1;
|
||||
|
|
@ -1539,25 +1571,6 @@ _func_enter_;
|
|||
|
||||
if(psta)
|
||||
{
|
||||
#ifdef CONFIG_TDLS
|
||||
if(pattrib->direct_link==_TRUE)
|
||||
{
|
||||
psta = pattrib->ptdls_sta;
|
||||
|
||||
//qos_en, ht_en, init rate, ,bw, ch_offset, sgi
|
||||
//pattrib->qos_en = ptdls_sta->qos_option;
|
||||
|
||||
pattrib->raid = psta->raid;
|
||||
#ifdef CONFIG_80211N_HT
|
||||
pattrib->bwmode = psta->bw_mode;
|
||||
pattrib->ht_en = psta->htpriv.ht_option;
|
||||
pattrib->ch_offset = psta->htpriv.ch_offset;
|
||||
pattrib->sgi= query_ra_short_GI(psta);
|
||||
#endif //CONFIG_80211N_HT
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
|
||||
psta->sta_xmitpriv.txseq_tid[pattrib->priority]++;
|
||||
psta->sta_xmitpriv.txseq_tid[pattrib->priority] &= 0xFFF;
|
||||
pattrib->seqnum = psta->sta_xmitpriv.txseq_tid[pattrib->priority];
|
||||
|
|
@ -1709,16 +1722,18 @@ int rtw_build_tdls_ies(_adapter * padapter, struct xmit_frame * pxmitframe, u8 *
|
|||
rtw_build_tdls_dis_req_ies(padapter, pxmitframe, pframe, ptxmgmt);
|
||||
break;
|
||||
case TDLS_PEER_TRAFFIC_INDICATION:
|
||||
rtw_build_tdls_peer_traffic_indication_ies(padapter, pxmitframe, pframe);
|
||||
rtw_build_tdls_peer_traffic_indication_ies(padapter, pxmitframe, pframe, ptxmgmt);
|
||||
break;
|
||||
#ifdef CONFIG_TDLS_CH_SW
|
||||
case TDLS_CHANNEL_SWITCH_REQUEST:
|
||||
rtw_build_tdls_ch_switch_req_ies(padapter, pxmitframe, pframe);
|
||||
rtw_build_tdls_ch_switch_req_ies(padapter, pxmitframe, pframe, ptxmgmt);
|
||||
break;
|
||||
case TDLS_CHANNEL_SWITCH_RESPONSE:
|
||||
rtw_build_tdls_ch_switch_rsp_ies(padapter, pxmitframe, pframe);
|
||||
rtw_build_tdls_ch_switch_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt);
|
||||
break;
|
||||
#endif
|
||||
case TDLS_PEER_TRAFFIC_RESPONSE:
|
||||
rtw_build_tdls_peer_traffic_rsp_ies(padapter, pxmitframe, pframe);
|
||||
rtw_build_tdls_peer_traffic_rsp_ies(padapter, pxmitframe, pframe, ptxmgmt);
|
||||
break;
|
||||
#ifdef CONFIG_WFD
|
||||
case TUNNELED_PROBE_REQ:
|
||||
|
|
@ -1760,7 +1775,7 @@ _func_enter_;
|
|||
case TDLS_SETUP_RESPONSE:
|
||||
case TDLS_SETUP_CONFIRM:
|
||||
case TDLS_PEER_TRAFFIC_INDICATION:
|
||||
case TDLS_PEER_PSM_REQUEST: //directly to peer STA or via AP
|
||||
case TDLS_PEER_PSM_REQUEST:
|
||||
case TUNNELED_PROBE_REQ:
|
||||
case TUNNELED_PROBE_RSP:
|
||||
case TDLS_DISCOVERY_REQUEST:
|
||||
|
|
@ -1876,11 +1891,15 @@ _func_enter_;
|
|||
}
|
||||
}
|
||||
|
||||
if(psta==NULL)
|
||||
return _FAIL;
|
||||
if (psta==NULL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (pxmitframe->buf_addr == NULL)
|
||||
return _FAIL;
|
||||
if (pxmitframe->buf_addr == NULL) {
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pbuf_start = pxmitframe->buf_addr;
|
||||
mem_start = pbuf_start + TXDESC_OFFSET;
|
||||
|
|
@ -1944,6 +1963,7 @@ _func_enter_;
|
|||
|
||||
if (xmitframe_addmic(padapter, pxmitframe) == _FAIL)
|
||||
{
|
||||
res = _FAIL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
|
|
@ -2238,9 +2258,6 @@ _func_enter_;
|
|||
|
||||
_enter_critical_bh(&padapter->security_key_mutex, &irqL);
|
||||
|
||||
//only support station mode
|
||||
if(!check_fwstate(pmlmepriv, WIFI_STATION_STATE) || !check_fwstate(pmlmepriv, _FW_LINKED))
|
||||
goto xmitframe_coalesce_success;
|
||||
|
||||
//IGTK key is not install, it may not support 802.11w
|
||||
if(padapter->securitypriv.binstallBIPkey != _TRUE)
|
||||
|
|
@ -2337,9 +2354,8 @@ _func_enter_;
|
|||
goto xmitframe_coalesce_fail;
|
||||
}
|
||||
|
||||
if(!(psta->state & _FW_LINKED) || pxmitframe->buf_addr==NULL)
|
||||
{
|
||||
DBG_871X("%s, not _FW_LINKED or addr null\n", __func__);
|
||||
if (pxmitframe->buf_addr == NULL) {
|
||||
DBG_871X("%s, pxmitframe->buf_addr\n", __func__);
|
||||
goto xmitframe_coalesce_fail;
|
||||
}
|
||||
|
||||
|
|
@ -2362,6 +2378,13 @@ _func_enter_;
|
|||
}*/
|
||||
if(pattrib->encrypt>0)
|
||||
_rtw_memcpy(pattrib->dot118021x_UncstKey.skey, psta->dot118021x_UncstKey.skey, 16);
|
||||
|
||||
/* To use wrong key */
|
||||
if (pattrib->key_type == IEEE80211W_WRONG_KEY) {
|
||||
DBG_871X("use wrong key\n");
|
||||
pattrib->dot118021x_UncstKey.skey[0] = 0xff;
|
||||
}
|
||||
|
||||
//bakeup original management packet
|
||||
_rtw_memcpy(tmp_buf, pframe, pattrib->pktlen);
|
||||
//move to data portion
|
||||
|
|
@ -2626,6 +2649,9 @@ struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv,
|
|||
pcmdframe->pxmitbuf = pxmitbuf;
|
||||
|
||||
pcmdframe->buf_addr = pxmitbuf->pbuf;
|
||||
|
||||
/* initial memory to zero */
|
||||
_rtw_memset(pcmdframe->buf_addr, 0, MAX_CMDBUF_SZ);
|
||||
|
||||
pxmitbuf->priv_data = pcmdframe;
|
||||
|
||||
|
|
@ -3096,7 +3122,7 @@ static struct xmit_frame *dequeue_one_xmitframe(struct xmit_priv *pxmitpriv, str
|
|||
{
|
||||
pxmitframe = LIST_CONTAINOR(xmitframe_plist, struct xmit_frame, list);
|
||||
|
||||
xmitframe_plist = get_next(xmitframe_plist);
|
||||
/* xmitframe_plist = get_next(xmitframe_plist); */
|
||||
|
||||
/*#ifdef RTK_DMP_PLATFORM
|
||||
#ifdef CONFIG_USB_TX_AGGREGATION
|
||||
|
|
@ -3900,13 +3926,11 @@ sint xmitframe_enqueue_for_tdls_sleeping_sta(_adapter *padapter, struct xmit_fra
|
|||
break;
|
||||
}
|
||||
|
||||
/* Transmit TDLS PTI via AP */
|
||||
if(ptdls_sta->sleepq_len==1)
|
||||
{
|
||||
//transmit TDLS PTI via AP
|
||||
rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_SD_PTI);
|
||||
}
|
||||
ret = _TRUE;
|
||||
rtw_tdls_cmd(padapter, ptdls_sta->hwaddr, TDLS_ISSUE_PTI);
|
||||
|
||||
ret = _TRUE;
|
||||
}
|
||||
|
||||
_exit_critical_bh(&ptdls_sta->sleep_q.lock, &irqL);
|
||||
|
|
@ -3927,9 +3951,11 @@ inline bool xmitframe_hiq_filter(struct xmit_frame *xmitframe)
|
|||
_adapter *adapter = xmitframe->padapter;
|
||||
struct registry_priv *registry = &adapter->registrypriv;
|
||||
|
||||
if (adapter->interface_type != RTW_PCIE) {
|
||||
if (rtw_get_intf_type(adapter) != RTW_PCIE) {
|
||||
|
||||
if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_SPECIAL) {
|
||||
if (adapter->registrypriv.wifi_spec == 1) {
|
||||
allow = _TRUE;
|
||||
} else if (registry->hiq_filter == RTW_HIQ_FILTER_ALLOW_SPECIAL) {
|
||||
|
||||
struct pkt_attrib *attrib = &xmitframe->attrib;
|
||||
|
||||
|
|
@ -3941,8 +3967,8 @@ if (adapter->interface_type != RTW_PCIE) {
|
|||
|| attrib->dhcp_pkt
|
||||
) {
|
||||
if (0)
|
||||
DBG_871X(FUNC_ADPT_FMT" ether_type:0x%04x%s\n", FUNC_ADPT_ARG(xmitframe->padapter)
|
||||
, attrib->ether_type, attrib->dhcp_pkt?" DHCP":"");
|
||||
DBG_871X(FUNC_ADPT_FMT" ether_type:0x%04x%s\n", FUNC_ADPT_ARG(xmitframe->padapter)
|
||||
, attrib->ether_type, attrib->dhcp_pkt?" DHCP":"");
|
||||
allow = _TRUE;
|
||||
}
|
||||
}
|
||||
|
|
@ -4052,14 +4078,21 @@ sint xmitframe_enqueue_for_sleeping_sta(_adapter *padapter, struct xmit_frame *p
|
|||
pstapriv->sta_dz_bitmap |= BIT(0);
|
||||
|
||||
//DBG_871X("enqueue, sq_len=%d, tim=%x\n", psta->sleepq_len, pstapriv->tim_bitmap);
|
||||
|
||||
if (update_tim == _TRUE) {
|
||||
if (is_broadcast_mac_addr(pattrib->ra))
|
||||
_update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer BC");
|
||||
else
|
||||
_update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer MC");
|
||||
if (padapter->registrypriv.wifi_spec == 1) {
|
||||
/*
|
||||
*if (update_tim == _TRUE)
|
||||
* rtw_chk_hi_queue_cmd(padapter);
|
||||
*/
|
||||
} else {
|
||||
chk_bmc_sleepq_cmd(padapter);
|
||||
|
||||
if (update_tim == _TRUE) {
|
||||
if (is_broadcast_mac_addr(pattrib->ra))
|
||||
_update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer BC");
|
||||
else
|
||||
_update_beacon(padapter, _TIM_IE_, NULL, _TRUE, "buffer MC");
|
||||
} else {
|
||||
chk_bmc_sleepq_cmd(padapter);
|
||||
}
|
||||
}
|
||||
|
||||
//_exit_critical_bh(&psta->sleep_q.lock, &irqL);
|
||||
|
|
@ -4236,10 +4269,7 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta)
|
|||
rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
if( !(psta->tdls_sta_state & TDLS_LINKED_STATE) )
|
||||
{
|
||||
if( psta_bmc != NULL )
|
||||
{
|
||||
if (!(psta->tdls_sta_state & TDLS_LINKED_STATE) && (psta_bmc != NULL)) {
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
|
||||
|
|
@ -4251,7 +4281,6 @@ void stop_sta_xmit(_adapter *padapter, struct sta_info *psta)
|
|||
|
||||
#ifdef CONFIG_TDLS
|
||||
}
|
||||
}
|
||||
#endif //CONFIG_TDLS
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
|
|
@ -4539,7 +4568,7 @@ exit:
|
|||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* defined(CONFIG_AP_MODE) || defined(CONFIG_TDLS) */
|
||||
|
||||
#ifdef CONFIG_XMIT_THREAD_MODE
|
||||
void enqueue_pending_xmitbuf(
|
||||
|
|
@ -4699,18 +4728,54 @@ thread_return rtw_xmit_thread(thread_context context)
|
|||
padapter = (PADAPTER)context;
|
||||
|
||||
thread_enter("RTW_XMIT_THREAD");
|
||||
padapter->xmitpriv.stop_req = 0;
|
||||
|
||||
do {
|
||||
err = rtw_hal_xmit_thread_handler(padapter);
|
||||
flush_signals_thread();
|
||||
} while (_SUCCESS == err);
|
||||
|
||||
_rtw_up_sema(&padapter->xmitpriv.terminate_xmitthread_sema);
|
||||
DBG_871X("%s: exit...\n", __func__);
|
||||
|
||||
thread_exit();
|
||||
/*_rtw_up_sema(&padapter->xmitpriv.terminate_xmitthread_sema);*/
|
||||
thread_exit(&padapter->xmitpriv.xmitthread_comp);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool rtw_xmit_ac_blocked(_adapter *adapter)
|
||||
{
|
||||
struct dvobj_priv *dvobj = adapter_to_dvobj(adapter);
|
||||
_adapter *iface;
|
||||
struct mlme_ext_priv *mlmeext;
|
||||
struct mlme_ext_info *mlmeextinfo;
|
||||
bool blocked = _FALSE;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < dvobj->iface_nums; i++) {
|
||||
iface = dvobj->padapters[i];
|
||||
mlmeext = &iface->mlmeextpriv;
|
||||
|
||||
/* check scan state */
|
||||
if (mlmeext_scan_state(mlmeext) != SCAN_DISABLE
|
||||
&& mlmeext_scan_state(mlmeext) != SCAN_BACK_OP
|
||||
) {
|
||||
blocked = _TRUE;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (mlmeext_scan_state(mlmeext) == SCAN_BACK_OP
|
||||
&& !mlmeext_chk_scan_backop_flags(mlmeext, SS_BACKOP_TX_RESUME)
|
||||
) {
|
||||
blocked = _TRUE;
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
return blocked;
|
||||
}
|
||||
|
||||
void rtw_sctx_init(struct submit_ctx *sctx, int timeout_ms)
|
||||
{
|
||||
sctx->timeout_ms = timeout_ms;
|
||||
|
|
@ -4807,11 +4872,11 @@ int rtw_ack_tx_polling(struct xmit_priv *pxmitpriv, u32 timeout_ms)
|
|||
if (pack_tx_ops->status != RTW_SCTX_SUBMITTED)
|
||||
break;
|
||||
|
||||
if (adapter->bDriverStopped) {
|
||||
if (rtw_is_drv_stopped(adapter)) {
|
||||
pack_tx_ops->status = RTW_SCTX_DONE_DRV_STOP;
|
||||
break;
|
||||
}
|
||||
if (adapter->bSurpriseRemoved) {
|
||||
if (rtw_is_surprise_removed(adapter)) {
|
||||
pack_tx_ops->status = RTW_SCTX_DONE_DEV_REMOVE;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
2
drivers/net/wireless/rockchip_wlan/rtl8189es/hal/HalPwrSeqCmd.c
Executable file → Normal file
2
drivers/net/wireless/rockchip_wlan/rtl8189es/hal/HalPwrSeqCmd.c
Executable file → Normal file
|
|
@ -147,7 +147,7 @@ u8 HalPwrSeqCmdParsing(
|
|||
rtw_udelay_os(10);
|
||||
|
||||
if (pollingCount++ > maxPollingCnt) {
|
||||
DBG_871X_LEVEL(_drv_always_, "HalPwrSeqCmdParsing: Fail to polling Offset[%#x]=%02x\n", offset, value);
|
||||
DBG_871X_LEVEL(_drv_err_, "HalPwrSeqCmdParsing: Fail to polling Offset[%#x]=%02x\n", offset, value);
|
||||
return _FALSE;
|
||||
}
|
||||
} while (!bPollingBit);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,530 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include "Mp_Precomp.h"
|
||||
#include "phydm_precomp.h"
|
||||
|
||||
|
||||
#define CALCULATE_SWINGTALBE_OFFSET(_offset, _direction, _size, _deltaThermal) \
|
||||
do {\
|
||||
for(_offset = 0; _offset < _size; _offset++)\
|
||||
{\
|
||||
if(_deltaThermal < thermalThreshold[_direction][_offset])\
|
||||
{\
|
||||
if(_offset != 0)\
|
||||
_offset--;\
|
||||
break;\
|
||||
}\
|
||||
} \
|
||||
if(_offset >= _size)\
|
||||
_offset = _size-1;\
|
||||
} while(0)
|
||||
|
||||
|
||||
void ConfigureTxpowerTrack(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PTXPWRTRACK_CFG pConfig
|
||||
)
|
||||
{
|
||||
#if RTL8192E_SUPPORT
|
||||
if(pDM_Odm->SupportICType==ODM_RTL8192E)
|
||||
ConfigureTxpowerTrack_8192E(pConfig);
|
||||
#endif
|
||||
#if RTL8821A_SUPPORT
|
||||
if(pDM_Odm->SupportICType==ODM_RTL8821)
|
||||
ConfigureTxpowerTrack_8821A(pConfig);
|
||||
#endif
|
||||
#if RTL8812A_SUPPORT
|
||||
if(pDM_Odm->SupportICType==ODM_RTL8812)
|
||||
ConfigureTxpowerTrack_8812A(pConfig);
|
||||
#endif
|
||||
#if RTL8188E_SUPPORT
|
||||
if(pDM_Odm->SupportICType==ODM_RTL8188E)
|
||||
ConfigureTxpowerTrack_8188E(pConfig);
|
||||
#endif
|
||||
|
||||
#if RTL8723B_SUPPORT
|
||||
if(pDM_Odm->SupportICType==ODM_RTL8723B)
|
||||
ConfigureTxpowerTrack_8723B(pConfig);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
// <20121113, Kordan> This function should be called when TxAGC changed.
|
||||
// Otherwise the previous compensation is gone, because we record the
|
||||
// delta of temperature between two TxPowerTracking watch dogs.
|
||||
//
|
||||
// NOTE: If Tx BB swing or Tx scaling is varified during run-time, still
|
||||
// need to call this function.
|
||||
//======================================================================
|
||||
VOID
|
||||
ODM_ClearTxPowerTrackingState(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(pDM_Odm->Adapter);
|
||||
u1Byte p = 0;
|
||||
|
||||
pDM_Odm->BbSwingIdxCckBase = pDM_Odm->DefaultCckIndex;
|
||||
pDM_Odm->BbSwingIdxCck = pDM_Odm->DefaultCckIndex;
|
||||
pDM_Odm->RFCalibrateInfo.CCK_index = 0;
|
||||
|
||||
for (p = ODM_RF_PATH_A; p < MAX_RF_PATH; ++p)
|
||||
{
|
||||
pDM_Odm->BbSwingIdxOfdmBase[p] = pDM_Odm->DefaultOfdmIndex;
|
||||
pDM_Odm->BbSwingIdxOfdm[p] = pDM_Odm->DefaultOfdmIndex;
|
||||
pDM_Odm->RFCalibrateInfo.OFDM_index[p] = pDM_Odm->DefaultOfdmIndex;
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0;
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] = 0;
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p] = 0;
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0;
|
||||
|
||||
pDM_Odm->Absolute_OFDMSwingIdx[p] = 0; // Initial Mix mode power tracking
|
||||
pDM_Odm->Remnant_OFDMSwingIdx[p] = 0;
|
||||
}
|
||||
|
||||
pDM_Odm->Modify_TxAGC_Flag_PathA= FALSE; //Initial at Modify Tx Scaling Mode
|
||||
pDM_Odm->Modify_TxAGC_Flag_PathB= FALSE; //Initial at Modify Tx Scaling Mode
|
||||
pDM_Odm->Remnant_CCKSwingIdx= 0;
|
||||
pDM_Odm->RFCalibrateInfo.ThermalValue = pHalData->EEPROMThermalMeter;
|
||||
pDM_Odm->RFCalibrateInfo.ThermalValue_IQK = pHalData->EEPROMThermalMeter;
|
||||
pDM_Odm->RFCalibrateInfo.ThermalValue_LCK = pHalData->EEPROMThermalMeter;
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_TXPowerTrackingCallback_ThermalMeter(
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
#else
|
||||
IN PADAPTER Adapter
|
||||
#endif
|
||||
)
|
||||
{
|
||||
|
||||
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc;
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
PDM_ODM_T pDM_Odm = &pHalData->odmpriv;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
u1Byte ThermalValue = 0, delta, delta_LCK, delta_IQK, p = 0, i = 0;
|
||||
u1Byte ThermalValue_AVG_count = 0;
|
||||
u4Byte ThermalValue_AVG = 0;
|
||||
|
||||
u1Byte OFDM_min_index = 0; // OFDM BB Swing should be less than +3.0dB, which is required by Arthur
|
||||
u1Byte Indexforchannel = 0; // GetRightChnlPlaceforIQK(pHalData->CurrentChannel)
|
||||
|
||||
TXPWRTRACK_CFG c;
|
||||
|
||||
|
||||
//4 1. The following TWO tables decide the final index of OFDM/CCK swing table.
|
||||
pu1Byte deltaSwingTableIdx_TUP_A;
|
||||
pu1Byte deltaSwingTableIdx_TDOWN_A;
|
||||
pu1Byte deltaSwingTableIdx_TUP_B;
|
||||
pu1Byte deltaSwingTableIdx_TDOWN_B;
|
||||
|
||||
//4 2. Initilization ( 7 steps in total )
|
||||
|
||||
ConfigureTxpowerTrack(pDM_Odm, &c);
|
||||
|
||||
(*c.GetDeltaSwingTable)(pDM_Odm, (pu1Byte*)&deltaSwingTableIdx_TUP_A, (pu1Byte*)&deltaSwingTableIdx_TDOWN_A,
|
||||
(pu1Byte*)&deltaSwingTableIdx_TUP_B, (pu1Byte*)&deltaSwingTableIdx_TDOWN_B);
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.TXPowerTrackingCallbackCnt++; //cosa add for debug
|
||||
pDM_Odm->RFCalibrateInfo.bTXPowerTrackingInit = TRUE;
|
||||
|
||||
#if (MP_DRIVER == 1)
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl = pHalData->TxPowerTrackControl; // <Kordan> We should keep updating the control variable according to HalData.
|
||||
#endif
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
if (pDM_Odm->mp_mode == TRUE)
|
||||
#endif
|
||||
// <Kordan> RFCalibrateInfo.RegA24 will be initialized when ODM HW configuring, but MP configures with para files.
|
||||
pDM_Odm->RFCalibrateInfo.RegA24 = 0x090e1317;
|
||||
#endif
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("===>ODM_TXPowerTrackingCallback_ThermalMeter, \
|
||||
\n pDM_Odm->BbSwingIdxCckBase: %d, pDM_Odm->BbSwingIdxOfdmBase[A]: %d, pDM_Odm->DefaultOfdmIndex: %d\n",
|
||||
pDM_Odm->BbSwingIdxCckBase, pDM_Odm->BbSwingIdxOfdmBase[ODM_RF_PATH_A], pDM_Odm->DefaultOfdmIndex));
|
||||
|
||||
ThermalValue = (u1Byte)ODM_GetRFReg(pDM_Odm, ODM_RF_PATH_A, c.ThermalRegAddr, 0xfc00); //0x42: RF Reg[15:10] 88E
|
||||
if( ! pDM_Odm->RFCalibrateInfo.TxPowerTrackControl || pHalData->EEPROMThermalMeter == 0 ||
|
||||
pHalData->EEPROMThermalMeter == 0xFF)
|
||||
return;
|
||||
|
||||
|
||||
//4 3. Initialize ThermalValues of RFCalibrateInfo
|
||||
|
||||
if(pDM_Odm->RFCalibrateInfo.bReloadtxpowerindex)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("reload ofdm index for band switch\n"));
|
||||
}
|
||||
|
||||
//4 4. Calculate average thermal meter
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index] = ThermalValue;
|
||||
pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index++;
|
||||
if(pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index == c.AverageThermalNum) //Average times = c.AverageThermalNum
|
||||
pDM_Odm->RFCalibrateInfo.ThermalValue_AVG_index = 0;
|
||||
|
||||
for(i = 0; i < c.AverageThermalNum; i++)
|
||||
{
|
||||
if(pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[i])
|
||||
{
|
||||
ThermalValue_AVG += pDM_Odm->RFCalibrateInfo.ThermalValue_AVG[i];
|
||||
ThermalValue_AVG_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if(ThermalValue_AVG_count) //Calculate Average ThermalValue after average enough times
|
||||
{
|
||||
ThermalValue = (u1Byte)(ThermalValue_AVG / ThermalValue_AVG_count);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("AVG Thermal Meter = 0x%X, EFUSE Thermal Base = 0x%X\n", ThermalValue, pHalData->EEPROMThermalMeter));
|
||||
}
|
||||
|
||||
//4 5. Calculate delta, delta_LCK, delta_IQK.
|
||||
|
||||
//"delta" here is used to determine whether thermal value changes or not.
|
||||
delta = (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue)?(ThermalValue - pDM_Odm->RFCalibrateInfo.ThermalValue):(pDM_Odm->RFCalibrateInfo.ThermalValue - ThermalValue);
|
||||
delta_LCK = (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue_LCK)?(ThermalValue - pDM_Odm->RFCalibrateInfo.ThermalValue_LCK):(pDM_Odm->RFCalibrateInfo.ThermalValue_LCK - ThermalValue);
|
||||
delta_IQK = (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue_IQK)?(ThermalValue - pDM_Odm->RFCalibrateInfo.ThermalValue_IQK):(pDM_Odm->RFCalibrateInfo.ThermalValue_IQK - ThermalValue);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("(delta, delta_LCK, delta_IQK) = (%d, %d, %d)\n", delta, delta_LCK, delta_IQK));
|
||||
|
||||
//4 6. If necessary, do LCK.
|
||||
|
||||
if ((delta_LCK >= c.Threshold_IQK)) // Delta temperature is equal to or larger than 20 centigrade.
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD, ("delta_LCK(%d) >= Threshold_IQK(%d)\n", delta_LCK, c.Threshold_IQK));
|
||||
pDM_Odm->RFCalibrateInfo.ThermalValue_LCK = ThermalValue;
|
||||
if(c.PHY_LCCalibrate)
|
||||
(*c.PHY_LCCalibrate)(pDM_Odm);
|
||||
}
|
||||
|
||||
//3 7. If necessary, move the index of swing table to adjust Tx power.
|
||||
|
||||
if (delta > 0 && pDM_Odm->RFCalibrateInfo.TxPowerTrackControl)
|
||||
{
|
||||
//"delta" here is used to record the absolute value of differrence.
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
delta = ThermalValue > pHalData->EEPROMThermalMeter?(ThermalValue - pHalData->EEPROMThermalMeter):(pHalData->EEPROMThermalMeter - ThermalValue);
|
||||
#else
|
||||
delta = (ThermalValue > pDM_Odm->priv->pmib->dot11RFEntry.ther)?(ThermalValue - pDM_Odm->priv->pmib->dot11RFEntry.ther):(pDM_Odm->priv->pmib->dot11RFEntry.ther - ThermalValue);
|
||||
#endif
|
||||
if (delta >= TXPWR_TRACK_TABLE_SIZE)
|
||||
delta = TXPWR_TRACK_TABLE_SIZE - 1;
|
||||
|
||||
//4 7.1 The Final Power Index = BaseIndex + PowerIndexOffset
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
if(ThermalValue > pHalData->EEPROMThermalMeter) {
|
||||
#else
|
||||
if(ThermalValue > pDM_Odm->priv->pmib->dot11RFEntry.ther) {
|
||||
#endif
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("deltaSwingTableIdx_TUP_A[%d] = %d\n", delta, deltaSwingTableIdx_TUP_A[delta]));
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_A] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A];
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A] = deltaSwingTableIdx_TUP_A[delta];
|
||||
|
||||
pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = deltaSwingTableIdx_TUP_A[delta]; // Record delta swing for mix mode power tracking
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A]));
|
||||
|
||||
if(c.RfPathCount > 1)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("deltaSwingTableIdx_TUP_B[%d] = %d\n", delta, deltaSwingTableIdx_TUP_B[delta]));
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_B] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B];
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B] = deltaSwingTableIdx_TUP_B[delta];
|
||||
|
||||
pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = deltaSwingTableIdx_TUP_B[delta]; // Record delta swing for mix mode power tracking
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Temp is higher and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B]));
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("deltaSwingTableIdx_TDOWN_A[%d] = %d\n", delta, deltaSwingTableIdx_TDOWN_A[delta]));
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_A] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A];
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_A] = -1 * deltaSwingTableIdx_TDOWN_A[delta];
|
||||
|
||||
pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = -1 * deltaSwingTableIdx_TDOWN_A[delta]; // Record delta swing for mix mode power tracking
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A] = %d\n", pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_A]));
|
||||
|
||||
if(c.RfPathCount > 1)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("deltaSwingTableIdx_TDOWN_B[%d] = %d\n", delta, deltaSwingTableIdx_TDOWN_B[delta]));
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[ODM_RF_PATH_B] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B];
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[ODM_RF_PATH_B] = -1 * deltaSwingTableIdx_TDOWN_B[delta];
|
||||
|
||||
pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = -1 * deltaSwingTableIdx_TDOWN_B[delta]; // Record delta swing for mix mode power tracking
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("******Temp is lower and pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B] = %d\n", pDM_Odm->Absolute_OFDMSwingIdx[ODM_RF_PATH_B]));
|
||||
}
|
||||
}
|
||||
|
||||
for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("\n\n================================ [Path-%c] Calculating PowerIndexOffset ================================\n", (p == ODM_RF_PATH_A ? 'A' : 'B')));
|
||||
|
||||
if (pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] == pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p]) // If Thermal value changes but lookup table value still the same
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0;
|
||||
else
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p] - pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p]; // Power Index Diff between 2 times Power Tracking
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("[Path-%c] PowerIndexOffset(%d) = DeltaPowerIndex(%d) - DeltaPowerIndexLast(%d)\n",
|
||||
(p == ODM_RF_PATH_A ? 'A' : 'B'), pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p], pDM_Odm->RFCalibrateInfo.DeltaPowerIndex[p],
|
||||
pDM_Odm->RFCalibrateInfo.DeltaPowerIndexLast[p]));
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.OFDM_index[p] = pDM_Odm->BbSwingIdxOfdmBase[p] + pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p];
|
||||
pDM_Odm->RFCalibrateInfo.CCK_index = pDM_Odm->BbSwingIdxCckBase + pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p];
|
||||
|
||||
pDM_Odm->BbSwingIdxCck = pDM_Odm->RFCalibrateInfo.CCK_index;
|
||||
pDM_Odm->BbSwingIdxOfdm[p] = pDM_Odm->RFCalibrateInfo.OFDM_index[p];
|
||||
|
||||
// *************Print BB Swing Base and Index Offset*************
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("The 'CCK' final index(%d) = BaseIndex(%d) + PowerIndexOffset(%d)\n",
|
||||
pDM_Odm->BbSwingIdxCck, pDM_Odm->BbSwingIdxCckBase, pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p]));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("The 'OFDM' final index(%d) = BaseIndex[%c](%d) + PowerIndexOffset(%d)\n",
|
||||
pDM_Odm->BbSwingIdxOfdm[p], (p == ODM_RF_PATH_A ? 'A' : 'B'), pDM_Odm->BbSwingIdxOfdmBase[p], pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p]));
|
||||
|
||||
//4 7.1 Handle boundary conditions of index.
|
||||
|
||||
|
||||
if(pDM_Odm->RFCalibrateInfo.OFDM_index[p] > c.SwingTableSize_OFDM-1)
|
||||
{
|
||||
pDM_Odm->RFCalibrateInfo.OFDM_index[p] = c.SwingTableSize_OFDM-1;
|
||||
}
|
||||
else if (pDM_Odm->RFCalibrateInfo.OFDM_index[p] < OFDM_min_index)
|
||||
{
|
||||
pDM_Odm->RFCalibrateInfo.OFDM_index[p] = OFDM_min_index;
|
||||
}
|
||||
}
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("\n\n========================================================================================================\n"));
|
||||
if(pDM_Odm->RFCalibrateInfo.CCK_index > c.SwingTableSize_CCK-1)
|
||||
pDM_Odm->RFCalibrateInfo.CCK_index = c.SwingTableSize_CCK-1;
|
||||
//else if (pDM_Odm->RFCalibrateInfo.CCK_index < 0)
|
||||
//pDM_Odm->RFCalibrateInfo.CCK_index = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("The thermal meter is unchanged or TxPowerTracking OFF(%d): ThermalValue: %d , pDM_Odm->RFCalibrateInfo.ThermalValue: %d\n",
|
||||
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl, ThermalValue, pDM_Odm->RFCalibrateInfo.ThermalValue));
|
||||
|
||||
for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++)
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[p] = 0;
|
||||
}
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("TxPowerTracking: [CCK] Swing Current Index: %d, Swing Base Index: %d\n",
|
||||
pDM_Odm->RFCalibrateInfo.CCK_index, pDM_Odm->BbSwingIdxCckBase)); //Print Swing base & current
|
||||
for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("TxPowerTracking: [OFDM] Swing Current Index: %d, Swing Base Index[%c]: %d\n",
|
||||
pDM_Odm->RFCalibrateInfo.OFDM_index[p], (p == ODM_RF_PATH_A ? 'A' : 'B'), pDM_Odm->BbSwingIdxOfdmBase[p]));
|
||||
}
|
||||
|
||||
if ((pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_A] != 0 ||
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_B] != 0 ) &&
|
||||
pDM_Odm->RFCalibrateInfo.TxPowerTrackControl)
|
||||
{
|
||||
//4 7.2 Configure the Swing Table to adjust Tx Power.
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.bTxPowerChanged = TRUE; // Always TRUE after Tx Power is adjusted by power tracking.
|
||||
//
|
||||
// 2012/04/23 MH According to Luke's suggestion, we can not write BB digital
|
||||
// to increase TX power. Otherwise, EVM will be bad.
|
||||
//
|
||||
// 2012/04/25 MH Add for tx power tracking to set tx power in tx agc for 88E.
|
||||
if (ThermalValue > pDM_Odm->RFCalibrateInfo.ThermalValue)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("Temperature Increasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n",
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_A], delta, ThermalValue, pHalData->EEPROMThermalMeter, pDM_Odm->RFCalibrateInfo.ThermalValue));
|
||||
|
||||
if(c.RfPathCount > 1)
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("Temperature Increasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n",
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_B], delta, ThermalValue, pHalData->EEPROMThermalMeter, pDM_Odm->RFCalibrateInfo.ThermalValue));
|
||||
|
||||
}
|
||||
else if (ThermalValue < pDM_Odm->RFCalibrateInfo.ThermalValue)// Low temperature
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("Temperature Decreasing(A): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n",
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_A], delta, ThermalValue, pHalData->EEPROMThermalMeter, pDM_Odm->RFCalibrateInfo.ThermalValue));
|
||||
|
||||
if(c.RfPathCount > 1)
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("Temperature Decreasing(B): delta_pi: %d , delta_t: %d, Now_t: %d, EFUSE_t: %d, Last_t: %d\n",
|
||||
pDM_Odm->RFCalibrateInfo.PowerIndexOffset[ODM_RF_PATH_B], delta, ThermalValue, pHalData->EEPROMThermalMeter, pDM_Odm->RFCalibrateInfo.ThermalValue));
|
||||
|
||||
}
|
||||
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
if (ThermalValue > pHalData->EEPROMThermalMeter)
|
||||
#else
|
||||
if (ThermalValue > pDM_Odm->priv->pmib->dot11RFEntry.ther)
|
||||
#endif
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("Temperature(%d) higher than PG value(%d)\n", ThermalValue, pHalData->EEPROMThermalMeter));
|
||||
|
||||
if (pDM_Odm->SupportICType == ODM_RTL8188E || pDM_Odm->SupportICType == ODM_RTL8192E ||
|
||||
pDM_Odm->SupportICType == ODM_RTL8821 || pDM_Odm->SupportICType == ODM_RTL8812 || pDM_Odm->SupportICType == ODM_RTL8723B)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("**********Enter POWER Tracking MIX_MODE**********\n"));
|
||||
for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++)
|
||||
(*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, MIX_MODE, p, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("**********Enter POWER Tracking BBSWING_MODE**********\n"));
|
||||
for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++)
|
||||
(*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, BBSWING, p, Indexforchannel);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("Temperature(%d) lower than PG value(%d)\n", ThermalValue, pHalData->EEPROMThermalMeter));
|
||||
|
||||
if (pDM_Odm->SupportICType == ODM_RTL8188E || pDM_Odm->SupportICType == ODM_RTL8192E ||
|
||||
pDM_Odm->SupportICType == ODM_RTL8821 || pDM_Odm->SupportICType == ODM_RTL8812 || pDM_Odm->SupportICType == ODM_RTL8723B)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("**********Enter POWER Tracking MIX_MODE**********\n"));
|
||||
for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++)
|
||||
(*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, MIX_MODE, p, Indexforchannel);
|
||||
}
|
||||
else
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("**********Enter POWER Tracking BBSWING_MODE**********\n"));
|
||||
for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++)
|
||||
(*c.ODM_TxPwrTrackSetPwr)(pDM_Odm, BBSWING, p, Indexforchannel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pDM_Odm->BbSwingIdxCckBase = pDM_Odm->BbSwingIdxCck; // Record last time Power Tracking result as base.
|
||||
for (p = ODM_RF_PATH_A; p < c.RfPathCount; p++)
|
||||
pDM_Odm->BbSwingIdxOfdmBase[p] = pDM_Odm->BbSwingIdxOfdm[p];
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,
|
||||
("pDM_Odm->RFCalibrateInfo.ThermalValue = %d ThermalValue= %d\n", pDM_Odm->RFCalibrateInfo.ThermalValue, ThermalValue));
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.ThermalValue = ThermalValue; //Record last Power Tracking Thermal Value
|
||||
|
||||
}
|
||||
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
#if (RTL8723B_SUPPORT == 0)
|
||||
// Delta temperature is equal to or larger than 20 centigrade (When threshold is 8).
|
||||
if ((delta_IQK >= c.Threshold_IQK)) {
|
||||
if ( ! pDM_Odm->RFCalibrateInfo.bIQKInProgress)
|
||||
(*c.DoIQK)(pDM_Odm, delta_IQK, ThermalValue, 8);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_TX_PWR_TRACK, ODM_DBG_LOUD,("<===ODM_TXPowerTrackingCallback_ThermalMeter\n"));
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.TXPowercount = 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//3============================================================
|
||||
//3 IQ Calibration
|
||||
//3============================================================
|
||||
|
||||
VOID
|
||||
ODM_ResetIQKResult(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
u1Byte i;
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN || DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
|
||||
if (!IS_HARDWARE_TYPE_8192D(Adapter))
|
||||
return;
|
||||
#endif
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_CALIBRATION, ODM_DBG_LOUD,("PHY_ResetIQKResult:: settings regs %d default regs %d\n", (u4Byte)(sizeof(pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting)/sizeof(IQK_MATRIX_REGS_SETTING)), IQK_Matrix_Settings_NUM));
|
||||
//0xe94, 0xe9c, 0xea4, 0xeac, 0xeb4, 0xebc, 0xec4, 0xecc
|
||||
|
||||
for(i = 0; i < IQK_Matrix_Settings_NUM; i++)
|
||||
{
|
||||
{
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][0] =
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][2] =
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][4] =
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][6] = 0x100;
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][1] =
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][3] =
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][5] =
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].Value[0][7] = 0x0;
|
||||
|
||||
pDM_Odm->RFCalibrateInfo.IQKMatrixRegSetting[i].bIQKDone = FALSE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#if !(DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
u1Byte ODM_GetRightChnlPlaceforIQK(u1Byte chnl)
|
||||
{
|
||||
u1Byte channel_all[ODM_TARGET_CHNL_NUM_2G_5G] =
|
||||
{1,2,3,4,5,6,7,8,9,10,11,12,13,14,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,138,140,149,151,153,155,157,159,161,163,165};
|
||||
u1Byte place = chnl;
|
||||
|
||||
|
||||
if(chnl > 14)
|
||||
{
|
||||
for(place = 14; place<sizeof(channel_all); place++)
|
||||
{
|
||||
if(channel_all[place] == chnl)
|
||||
{
|
||||
return place-13;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -1,880 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
//============================================================
|
||||
// include files
|
||||
//============================================================
|
||||
#include "Mp_Precomp.h"
|
||||
#include "phydm_precomp.h"
|
||||
|
||||
|
||||
VOID
|
||||
Phydm_CheckAdaptivity(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
if(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY)
|
||||
{
|
||||
if(pDM_Odm->bAdaOn == TRUE)
|
||||
{
|
||||
if(pDM_Odm->DynamicLinkAdaptivity == TRUE)
|
||||
{
|
||||
if(pDM_Odm->bLinked && pDM_Odm->bCheck == FALSE)
|
||||
{
|
||||
Phydm_NHMCounterStatistics(pDM_Odm);
|
||||
Phydm_CheckEnvironment(pDM_Odm);
|
||||
}
|
||||
else if(!pDM_Odm->bLinked)
|
||||
{
|
||||
pDM_Odm->bCheck = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA);
|
||||
pDM_Odm->adaptivity_flag = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA);
|
||||
pDM_Odm->adaptivity_flag = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_NHMCounterStatisticsInit(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
|
||||
if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
{
|
||||
//PHY parameters initialize for ac series
|
||||
ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11AC+2, 0xC350); //0x990[31:16]=0xC350 Time duration for NHM unit: us, 0xc350=200ms
|
||||
ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC+2, 0xffff); //0x994[31:16]=0xffff th_9, th_10
|
||||
//ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH3_TO_TH0_11AC, 0xffffff5c); //0x998=0xffffff5c th_3, th_2, th_1, th_0
|
||||
ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH3_TO_TH0_11AC, 0xffffff50); //0x998=0xffffff52 th_3, th_2, th_1, th_0
|
||||
ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH7_TO_TH4_11AC, 0xffffffff); //0x99c=0xffffffff th_7, th_6, th_5, th_4
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH8_11AC, bMaskByte0, 0xff); //0x9a0[7:0]=0xff th_8
|
||||
//ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT8|BIT9|BIT10, 0x7); //0x994[9:8]=3 enable CCX
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT8|BIT9|BIT10, 0x1); //0x994[10:8]=1 ignoreCCA ignore PHYTXON enable CCX
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_9E8_11AC, BIT0, 0x1); //0x9e8[7]=1 max power among all RX ants
|
||||
|
||||
}
|
||||
else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
{
|
||||
//PHY parameters initialize for n series
|
||||
ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11N+2, 0xC350); //0x894[31:16]=0x0xC350 Time duration for NHM unit: us, 0xc350=200ms
|
||||
//ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11N+2, 0x4e20); //0x894[31:16]=0x4e20 Time duration for NHM unit: 4us, 0x4e20=80ms
|
||||
ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N+2, 0xffff); //0x890[31:16]=0xffff th_9, th_10
|
||||
//ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH3_TO_TH0_11N, 0xffffff5c); //0x898=0xffffff5c th_3, th_2, th_1, th_0
|
||||
ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH3_TO_TH0_11N, 0xffffff50); //0x898=0xffffff52 th_3, th_2, th_1, th_0
|
||||
ODM_Write4Byte(pDM_Odm, ODM_REG_NHM_TH7_TO_TH4_11N, 0xffffffff); //0x89c=0xffffffff th_7, th_6, th_5, th_4
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_FPGA0_IQK_11N, bMaskByte0, 0xff); //0xe28[7:0]=0xff th_8
|
||||
//ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT10|BIT9|BIT8, 0x7); //0x890[9:8]=3 enable CCX
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT10|BIT9|BIT8, 0x1); //0x890[10:8]=1 ignoreCCA ignore PHYTXON enable CCX
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_OFDM_FA_RSTC_11N, BIT7, 0x1); //0xc0c[7]=1 max power among all RX ants
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_NHMCounterStatistics(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
|
||||
if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT))
|
||||
return;
|
||||
|
||||
// Get NHM report
|
||||
Phydm_GetNHMCounterStatistics(pDM_Odm);
|
||||
|
||||
// Reset NHM counter
|
||||
Phydm_NHMCounterStatisticsReset(pDM_Odm);
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_GetNHMCounterStatistics(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
u4Byte value32 = 0;
|
||||
|
||||
if (pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
value32 = ODM_GetBBReg(pDM_Odm, ODM_REG_NHM_CNT_11AC, bMaskDWord);
|
||||
else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
value32 = ODM_GetBBReg(pDM_Odm, ODM_REG_NHM_CNT_11N, bMaskDWord);
|
||||
|
||||
pDM_Odm->NHM_cnt_0 = (u1Byte)(value32 & bMaskByte0);
|
||||
pDM_Odm->NHM_cnt_1 = (u1Byte)((value32 & bMaskByte1)>>8);
|
||||
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_NHMCounterStatisticsReset(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
|
||||
if (pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT1, 0);
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT1, 1);
|
||||
}
|
||||
else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT1, 0);
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_NHMBBInit(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
|
||||
pDM_Odm->adaptivity_flag = FALSE;
|
||||
pDM_Odm->tolerance_cnt = 3;
|
||||
pDM_Odm->NHMLastTxOkcnt = 0;
|
||||
pDM_Odm->NHMLastRxOkcnt = 0;
|
||||
pDM_Odm->NHMCurTxOkcnt = 0;
|
||||
pDM_Odm->NHMCurRxOkcnt = 0;
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_SetEDCCAThreshold(
|
||||
IN PVOID pDM_VOID,
|
||||
IN s1Byte H2L,
|
||||
IN s1Byte L2H
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
|
||||
if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm,rOFDM0_ECCAThreshold, bMaskByte0, (u1Byte)L2H);
|
||||
ODM_SetBBReg(pDM_Odm,rOFDM0_ECCAThreshold, bMaskByte2, (u1Byte)H2L);
|
||||
}
|
||||
else if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, rFPGA0_XB_LSSIReadBack, bMaskByte0, (u1Byte)L2H);
|
||||
ODM_SetBBReg(pDM_Odm, rFPGA0_XB_LSSIReadBack, bMaskByte1, (u1Byte)H2L);
|
||||
}
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_SetTRxMux(
|
||||
IN PVOID pDM_VOID,
|
||||
IN PhyDM_Trx_MUX_Type txMode,
|
||||
IN PhyDM_Trx_MUX_Type rxMode
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
|
||||
if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_RPT_FORMAT_11N, BIT3|BIT2|BIT1, txMode); // set TXmod to standby mode to remove outside noise affect
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_RPT_FORMAT_11N, BIT22|BIT21|BIT20, rxMode); // set RXmod to standby mode to remove outside noise affect
|
||||
if(pDM_Odm->RFType > ODM_1T1R)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_RPT_FORMAT_11N_B, BIT3|BIT2|BIT1, txMode); // set TXmod to standby mode to remove outside noise affect
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_CCK_RPT_FORMAT_11N_B, BIT22|BIT21|BIT20, rxMode); // set RXmod to standby mode to remove outside noise affect
|
||||
}
|
||||
}
|
||||
else if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC, BIT11|BIT10|BIT9|BIT8, txMode); // set TXmod to standby mode to remove outside noise affect
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC, BIT7|BIT6|BIT5|BIT4, rxMode); // set RXmod to standby mode to remove outside noise affect
|
||||
if(pDM_Odm->RFType > ODM_1T1R)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC_B, BIT11|BIT10|BIT9|BIT8, txMode); // set TXmod to standby mode to remove outside noise affect
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_TRMUX_11AC_B, BIT7|BIT6|BIT5|BIT4, rxMode); // set RXmod to standby mode to remove outside noise affect
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_MACEDCCAState(
|
||||
IN PVOID pDM_VOID,
|
||||
IN PhyDM_MACEDCCA_Type State
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
if(State == PhyDM_IGNORE_EDCCA)
|
||||
{
|
||||
ODM_SetMACReg(pDM_Odm, REG_TX_PTCL_CTRL, BIT15, 1); //ignore EDCCA reg520[15]=1
|
||||
ODM_SetMACReg(pDM_Odm, REG_RD_CTRL, BIT11, 0); //reg524[11]=0
|
||||
}
|
||||
else // don't set MAC ignore EDCCA signal
|
||||
{
|
||||
ODM_SetMACReg(pDM_Odm, REG_TX_PTCL_CTRL, BIT15, 0); //don't ignore EDCCA reg520[15]=0
|
||||
ODM_SetMACReg(pDM_Odm, REG_RD_CTRL, BIT11, 1); //reg524[11]=1
|
||||
}
|
||||
|
||||
pDM_Odm->EDCCA_enable_state = State;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("EDCCA enable State = %d \n", State));
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN
|
||||
Phydm_CalNHMcnt(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
u2Byte Base = 0;
|
||||
|
||||
Base = pDM_Odm->NHM_cnt_0 + pDM_Odm->NHM_cnt_1;
|
||||
|
||||
if(Base != 0)
|
||||
{
|
||||
pDM_Odm->NHM_cnt_0 = ((pDM_Odm->NHM_cnt_0) << 8) / Base;
|
||||
pDM_Odm->NHM_cnt_1 = ((pDM_Odm->NHM_cnt_1) << 8) / Base;
|
||||
}
|
||||
if((pDM_Odm->NHM_cnt_0 - pDM_Odm->NHM_cnt_1) >= 100)
|
||||
return TRUE; // clean environment
|
||||
else
|
||||
return FALSE; //noisy environment
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
Phydm_CheckEnvironment(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
BOOLEAN isCleanEnvironment = FALSE;
|
||||
u1Byte i, clean = 0;
|
||||
|
||||
if(pDM_Odm->bFirstLink == TRUE)
|
||||
{
|
||||
pDM_Odm->adaptivity_flag = TRUE;
|
||||
pDM_Odm->bFirstLink = FALSE;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pDM_Odm->NHMWait < 3) // Start enter NHM after 4 NHMWait
|
||||
{
|
||||
pDM_Odm->NHMWait ++;
|
||||
Phydm_NHMCounterStatistics(pDM_Odm);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
Phydm_NHMCounterStatistics(pDM_Odm);
|
||||
isCleanEnvironment = Phydm_CalNHMcnt(pDM_Odm);
|
||||
if(isCleanEnvironment == TRUE)
|
||||
{
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA);
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_backup; //mode 1
|
||||
pDM_Odm->TH_EDCCA_HL_diff= pDM_Odm->TH_EDCCA_HL_diff_backup;
|
||||
#endif
|
||||
pDM_Odm->adaptivity_flag = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA);
|
||||
#else
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA);
|
||||
pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_mode2; // for AP mode 2
|
||||
pDM_Odm->TH_EDCCA_HL_diff= pDM_Odm->TH_EDCCA_HL_diff_mode2;
|
||||
#endif
|
||||
pDM_Odm->adaptivity_flag = FALSE;
|
||||
}
|
||||
|
||||
pDM_Odm->bFirstLink = TRUE;
|
||||
pDM_Odm->bCheck = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
Phydm_NHMBB(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
BOOLEAN bCleanEnvironment;
|
||||
|
||||
bCleanEnvironment = Phydm_CalNHMcnt(pDM_Odm);
|
||||
|
||||
pDM_Odm->NHMCurTxOkcnt = *(pDM_Odm->pNumTxBytesUnicast) - pDM_Odm->NHMLastTxOkcnt;
|
||||
pDM_Odm->NHMCurRxOkcnt = *(pDM_Odm->pNumRxBytesUnicast) - pDM_Odm->NHMLastRxOkcnt;
|
||||
pDM_Odm->NHMLastTxOkcnt = *(pDM_Odm->pNumTxBytesUnicast);
|
||||
pDM_Odm->NHMLastRxOkcnt = *(pDM_Odm->pNumRxBytesUnicast);
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("cnt_0=%d, cnt_1=%d, bCleanEnvironment = %d, NHMCurTxOkcnt = %llu, NHMCurRxOkcnt = %llu\n",
|
||||
pDM_Odm->NHM_cnt_0, pDM_Odm->NHM_cnt_1, bCleanEnvironment, pDM_Odm->NHMCurTxOkcnt, pDM_Odm->NHMCurRxOkcnt));
|
||||
|
||||
if(pDM_Odm->NHMWait < 4) // Start enter NHM after 4 NHMWait
|
||||
{
|
||||
pDM_Odm->NHMWait ++;
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA);
|
||||
}
|
||||
else if ( ((pDM_Odm->NHMCurTxOkcnt>>10) > 2) && ((pDM_Odm->NHMCurTxOkcnt) + 1 > (u8Byte)(pDM_Odm->NHMCurRxOkcnt<<2) + 1)) //Tx > 4*Rx and Tx > 2Mb possible for adaptivity test
|
||||
{
|
||||
if(bCleanEnvironment == TRUE || pDM_Odm->adaptivity_flag == TRUE)
|
||||
{
|
||||
//Enable EDCCA since it is possible running Adaptivity testing
|
||||
pDM_Odm->adaptivity_flag = TRUE;
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA);
|
||||
pDM_Odm->tolerance_cnt = 0;
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_backup;
|
||||
pDM_Odm->TH_EDCCA_HL_diff = pDM_Odm->TH_EDCCA_HL_diff_backup ;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
if(pDM_Odm->tolerance_cnt < 3)
|
||||
pDM_Odm->tolerance_cnt ++;
|
||||
else
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_mode2;
|
||||
pDM_Odm->TH_EDCCA_HL_diff = pDM_Odm->TH_EDCCA_HL_diff_mode2 ;
|
||||
#else
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA);
|
||||
#endif
|
||||
pDM_Odm->adaptivity_flag = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
else // TX<RX
|
||||
{
|
||||
if(pDM_Odm->adaptivity_flag == TRUE && bCleanEnvironment == FALSE)
|
||||
{
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA);
|
||||
pDM_Odm->tolerance_cnt = 0;
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_backup;
|
||||
pDM_Odm->TH_EDCCA_HL_diff = pDM_Odm->TH_EDCCA_HL_diff_backup ;
|
||||
#endif
|
||||
}
|
||||
#if(DM_ODM_SUPPORT_TYPE & ODM_AP) // for repeater mode add by YuChen 2014.06.23
|
||||
#ifdef UNIVERSAL_REPEATER
|
||||
else if((bCleanEnvironment == TRUE) && (pDM_Odm->VXD_bLinked) && ((pDM_Odm->NHMCurTxOkcnt>>10) > 1)) // clean environment and VXD linked and Tx TP>1Mb
|
||||
{
|
||||
pDM_Odm->adaptivity_flag = TRUE;
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_DONT_IGNORE_EDCCA);
|
||||
pDM_Odm->tolerance_cnt = 0;
|
||||
pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_backup;
|
||||
pDM_Odm->TH_EDCCA_HL_diff = pDM_Odm->TH_EDCCA_HL_diff_backup ;
|
||||
}
|
||||
#endif
|
||||
#endif // for repeater mode add by YuChen 2014.06.23
|
||||
else
|
||||
{
|
||||
if(pDM_Odm->tolerance_cnt < 3)
|
||||
pDM_Odm->tolerance_cnt ++;
|
||||
else
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_mode2;
|
||||
pDM_Odm->TH_EDCCA_HL_diff = pDM_Odm->TH_EDCCA_HL_diff_mode2 ;
|
||||
#else
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA);
|
||||
#endif
|
||||
pDM_Odm->adaptivity_flag = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("adaptivity_flag = %d\n ", pDM_Odm->adaptivity_flag));
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_SearchPwdBLowerBound(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
u4Byte value32 =0;
|
||||
u1Byte cnt, IGI_Pause = 0x7f, IGI_Resume = 0x20, IGI = 0x50; //IGI = 0x50 for cal EDCCA lower bound
|
||||
u1Byte txEdcca1 = 0, txEdcca0 = 0;
|
||||
BOOLEAN bAdjust=TRUE;
|
||||
s1Byte TH_L2H_dmc, TH_H2L_dmc, IGI_target = 0x32;
|
||||
s1Byte Diff;
|
||||
|
||||
Phydm_SetTRxMux(pDM_Odm, PhyDM_STANDBY_MODE, PhyDM_STANDBY_MODE);
|
||||
ODM_Write_DIG(pDM_Odm, IGI_Pause);
|
||||
|
||||
Diff = IGI_target -(s1Byte)IGI;
|
||||
TH_L2H_dmc = pDM_Odm->TH_L2H_ini + Diff;
|
||||
if(TH_L2H_dmc > 10)
|
||||
TH_L2H_dmc = 10;
|
||||
TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff;
|
||||
|
||||
Phydm_SetEDCCAThreshold(pDM_Odm, TH_H2L_dmc, TH_L2H_dmc);
|
||||
ODM_delay_ms(5);
|
||||
|
||||
while(bAdjust)
|
||||
{
|
||||
for(cnt=0; cnt<20; cnt ++)
|
||||
{
|
||||
if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
value32 = ODM_GetBBReg(pDM_Odm,ODM_REG_RPT_11N, bMaskDWord);
|
||||
else if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
value32 = ODM_GetBBReg(pDM_Odm,ODM_REG_RPT_11AC, bMaskDWord);
|
||||
|
||||
if (value32 & BIT30 && (pDM_Odm->SupportICType & (ODM_RTL8723A|ODM_RTL8723B|ODM_RTL8188E)))
|
||||
txEdcca1 = txEdcca1 + 1;
|
||||
else if(value32 & BIT29)
|
||||
txEdcca1 = txEdcca1 + 1;
|
||||
else
|
||||
txEdcca0 = txEdcca0 + 1;
|
||||
}
|
||||
|
||||
if(txEdcca1 > 9 )
|
||||
{
|
||||
IGI = IGI -1;
|
||||
TH_L2H_dmc = TH_L2H_dmc + 1;
|
||||
if(TH_L2H_dmc > 10)
|
||||
TH_L2H_dmc = 10;
|
||||
TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff;
|
||||
|
||||
Phydm_SetEDCCAThreshold(pDM_Odm, TH_H2L_dmc, TH_L2H_dmc);
|
||||
|
||||
txEdcca1 = 0;
|
||||
txEdcca0 = 0;
|
||||
|
||||
if(TH_L2H_dmc == 10)
|
||||
{
|
||||
bAdjust = FALSE;
|
||||
pDM_Odm->H2L_lb = TH_H2L_dmc;
|
||||
pDM_Odm->L2H_lb = TH_L2H_dmc;
|
||||
pDM_Odm->Adaptivity_IGI_upper = IGI;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bAdjust = FALSE;
|
||||
pDM_Odm->H2L_lb = TH_H2L_dmc;
|
||||
pDM_Odm->L2H_lb = TH_L2H_dmc;
|
||||
pDM_Odm->Adaptivity_IGI_upper = IGI;
|
||||
}
|
||||
}
|
||||
|
||||
Phydm_SetTRxMux(pDM_Odm, PhyDM_TX_MODE, PhyDM_RX_MODE);
|
||||
ODM_Write_DIG(pDM_Odm, IGI_Resume);
|
||||
Phydm_SetEDCCAThreshold(pDM_Odm, 0x7f, 0x7f); // resume to no link state
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_AdaptivityInit(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
#if(DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
PADAPTER pAdapter = pDM_Odm->Adapter;
|
||||
PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo);
|
||||
pDM_Odm->Carrier_Sense_enable = (BOOLEAN)pMgntInfo->RegEnableCarrierSense;
|
||||
pDM_Odm->NHM_enable = (BOOLEAN)pMgntInfo->RegNHMEnable;
|
||||
pDM_Odm->DynamicLinkAdaptivity = (BOOLEAN)pMgntInfo->RegDmLinkAdaptivity;
|
||||
#elif(DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
pDM_Odm->Carrier_Sense_enable = (pDM_Odm->Adapter->registrypriv.adaptivity_mode!=0)?TRUE:FALSE;
|
||||
pDM_Odm->NHM_enable = (BOOLEAN)pDM_Odm->Adapter->registrypriv.nhm_en;
|
||||
pDM_Odm->DynamicLinkAdaptivity = FALSE; // Jeff please add this
|
||||
#endif
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN))
|
||||
|
||||
if(pDM_Odm->Carrier_Sense_enable == FALSE)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
if( pMgntInfo->RegL2HForAdaptivity != 0 )
|
||||
pDM_Odm->TH_L2H_ini = pMgntInfo->RegL2HForAdaptivity;
|
||||
else
|
||||
#endif
|
||||
pDM_Odm->TH_L2H_ini = 0xf5; // -7
|
||||
}
|
||||
else
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
if( pMgntInfo->RegL2HForAdaptivity != 0 )
|
||||
pDM_Odm->TH_L2H_ini = pMgntInfo->RegL2HForAdaptivity;
|
||||
else
|
||||
#endif
|
||||
pDM_Odm->TH_L2H_ini = 0xa;
|
||||
}
|
||||
|
||||
pDM_Odm->AdapEn_RSSI = 20;
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
if( pMgntInfo->RegHLDiffForAdaptivity != 0 )
|
||||
pDM_Odm->TH_EDCCA_HL_diff = pMgntInfo->RegHLDiffForAdaptivity;
|
||||
else
|
||||
#endif
|
||||
pDM_Odm->TH_EDCCA_HL_diff = 7;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("TH_L2H_ini = 0x%x, TH_EDCCA_HL_diff = 0x%x\n", pDM_Odm->TH_L2H_ini, pDM_Odm->TH_EDCCA_HL_diff));
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
|
||||
if(pDM_Odm->Carrier_Sense_enable){
|
||||
pDM_Odm->TH_L2H_ini = 10;
|
||||
pDM_Odm->TH_EDCCA_HL_diff = 7;
|
||||
pDM_Odm->AdapEn_RSSI = 30;
|
||||
}
|
||||
else
|
||||
{
|
||||
pDM_Odm->TH_L2H_ini = pDM_Odm->TH_L2H_ini_backup; //set by mib
|
||||
pDM_Odm->TH_EDCCA_HL_diff = 7;
|
||||
pDM_Odm->AdapEn_RSSI = 20;
|
||||
}
|
||||
|
||||
pDM_Odm->TH_L2H_ini_mode2 = 20;
|
||||
pDM_Odm->TH_EDCCA_HL_diff_mode2 = 8;
|
||||
//pDM_Odm->TH_L2H_ini_backup = pDM_Odm->TH_L2H_ini;
|
||||
pDM_Odm->TH_EDCCA_HL_diff_backup = pDM_Odm->TH_EDCCA_HL_diff ;
|
||||
if(priv->pshare->rf_ft_var.adaptivity_enable == 2)
|
||||
pDM_Odm->DynamicLinkAdaptivity = TRUE;
|
||||
else
|
||||
pDM_Odm->DynamicLinkAdaptivity = FALSE;
|
||||
// pDM_Odm->NHM_enable = FALSE;
|
||||
#endif
|
||||
|
||||
pDM_Odm->IGI_Base = 0x32;
|
||||
pDM_Odm->IGI_target = 0x1c;
|
||||
pDM_Odm->ForceEDCCA = 0;
|
||||
pDM_Odm->H2L_lb= 0;
|
||||
pDM_Odm->L2H_lb= 0;
|
||||
pDM_Odm->Adaptivity_IGI_upper = 0;
|
||||
pDM_Odm->NHMWait = 0;
|
||||
Phydm_NHMBBInit(pDM_Odm);
|
||||
pDM_Odm->bCheck = FALSE;
|
||||
pDM_Odm->bFirstLink = TRUE;
|
||||
pDM_Odm->bAdaOn = TRUE;
|
||||
|
||||
ODM_SetBBReg(pDM_Odm, REG_RD_CTRL, BIT11, 1); // stop counting if EDCCA is asserted
|
||||
|
||||
//Search pwdB lower bound
|
||||
{
|
||||
if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
ODM_SetBBReg(pDM_Odm,ODM_REG_DBG_RPT_11N, bMaskDWord, 0x208);
|
||||
else if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
ODM_SetBBReg(pDM_Odm,ODM_REG_DBG_RPT_11AC, bMaskDWord, 0x209);
|
||||
Phydm_SearchPwdBLowerBound(pDM_Odm);
|
||||
}
|
||||
Phydm_MACEDCCAState(pDM_Odm, PhyDM_IGNORE_EDCCA);
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN
|
||||
Phydm_Adaptivity(
|
||||
IN PVOID pDM_VOID,
|
||||
IN u1Byte IGI
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
s1Byte TH_L2H_dmc, TH_H2L_dmc, L2H_nolink_Band4 = 0x7f, H2L_nolink_Band4 = 0x7f;
|
||||
s1Byte Diff, IGI_target;
|
||||
BOOLEAN EDCCA_State = FALSE;
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
PADAPTER pAdapter = pDM_Odm->Adapter;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
BOOLEAN bFwCurrentInPSMode=FALSE;
|
||||
PMGNT_INFO pMgntInfo = &(pAdapter->MgntInfo);
|
||||
|
||||
pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_FW_PSMODE_STATUS, (pu1Byte)(&bFwCurrentInPSMode));
|
||||
|
||||
// Disable EDCCA mode while under LPS mode, added by Roger, 2012.09.14.
|
||||
if(bFwCurrentInPSMode)
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
if(!(pDM_Odm->SupportAbility & ODM_BB_ADAPTIVITY))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("Go to odm_DynamicEDCCA() \n"));
|
||||
// Add by Neil Chen to enable edcca to MP Platform
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
// Adjust EDCCA.
|
||||
if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
Phydm_DynamicEDCCA(pDM_Odm);
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
if(pMgntInfo->RegEnableAdaptivity== 2)
|
||||
#else
|
||||
if (pDM_Odm->Adapter->registrypriv.adaptivity_en == 2)
|
||||
#endif
|
||||
{
|
||||
if(pDM_Odm->Carrier_Sense_enable == FALSE) // check domain Code for Adaptivity or CarrierSense
|
||||
{
|
||||
if ((*pDM_Odm->pBandType == ODM_BAND_5G) &&
|
||||
!(pDM_Odm->odm_Regulation5G == REGULATION_ETSI || pDM_Odm->odm_Regulation5G == REGULATION_WW))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("Adaptivity skip 5G domain code : %d \n", pDM_Odm->odm_Regulation5G));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else if((*pDM_Odm->pBandType == ODM_BAND_2_4G) &&
|
||||
!(pDM_Odm->odm_Regulation2_4G == REGULATION_ETSI || pDM_Odm->odm_Regulation2_4G == REGULATION_WW))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("Adaptivity skip 2.4G domain code : %d \n", pDM_Odm->odm_Regulation2_4G));
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
else if ((*pDM_Odm->pBandType != ODM_BAND_2_4G) && (*pDM_Odm->pBandType != ODM_BAND_5G))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("Adaptivity neither 2G nor 5G band, return\n"));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((*pDM_Odm->pBandType == ODM_BAND_5G) &&
|
||||
!(pDM_Odm->odm_Regulation5G == REGULATION_ETSI || pDM_Odm->odm_Regulation5G == REGULATION_WW))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("CarrierSense skip 5G domain code : %d\n", pDM_Odm->odm_Regulation5G));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
else if((*pDM_Odm->pBandType == ODM_BAND_2_4G) &&
|
||||
!(pDM_Odm->odm_Regulation2_4G == REGULATION_ETSI || pDM_Odm->odm_Regulation2_4G == REGULATION_WW))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("CarrierSense skip 2.4G domain code : %d\n", pDM_Odm->odm_Regulation2_4G));
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
else if ((*pDM_Odm->pBandType != ODM_BAND_2_4G) && (*pDM_Odm->pBandType != ODM_BAND_5G))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("CarrierSense neither 2G nor 5G band, return\n"));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("odm_Adaptivity() =====> \n"));
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("ForceEDCCA=%d, IGI_Base=0x%x, TH_L2H_ini = %d, TH_EDCCA_HL_diff = %d, AdapEn_RSSI = %d\n",
|
||||
pDM_Odm->ForceEDCCA, pDM_Odm->IGI_Base, pDM_Odm->TH_L2H_ini, pDM_Odm->TH_EDCCA_HL_diff, pDM_Odm->AdapEn_RSSI));
|
||||
|
||||
if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
ODM_SetBBReg(pDM_Odm, 0x800, BIT10, 0); //ADC_mask enable
|
||||
|
||||
if(*pDM_Odm->pBandWidth == ODM_BW20M) //CHANNEL_WIDTH_20
|
||||
IGI_target = pDM_Odm->IGI_Base;
|
||||
else if(*pDM_Odm->pBandWidth == ODM_BW40M)
|
||||
IGI_target = pDM_Odm->IGI_Base + 2;
|
||||
else if(*pDM_Odm->pBandWidth == ODM_BW80M)
|
||||
IGI_target = pDM_Odm->IGI_Base + 2;
|
||||
else
|
||||
IGI_target = pDM_Odm->IGI_Base;
|
||||
pDM_Odm->IGI_target = (u1Byte) IGI_target;
|
||||
|
||||
if(*pDM_Odm->pChannel >= 149) // Band4 -> for AP : mode2, for sd4 and sd7 : turnoff adaptivity
|
||||
{
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
if(pDM_Odm->bLinked)
|
||||
{
|
||||
Diff = IGI_target -(s1Byte)IGI;
|
||||
L2H_nolink_Band4 = pDM_Odm->TH_L2H_ini_mode2 + Diff;
|
||||
if(L2H_nolink_Band4 > 10)
|
||||
L2H_nolink_Band4 = 10;
|
||||
H2L_nolink_Band4 = L2H_nolink_Band4 - pDM_Odm->TH_EDCCA_HL_diff_mode2;
|
||||
}
|
||||
#endif
|
||||
Phydm_SetEDCCAThreshold(pDM_Odm, H2L_nolink_Band4, L2H_nolink_Band4);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(!pDM_Odm->ForceEDCCA)
|
||||
{
|
||||
if(pDM_Odm->RSSI_Min > pDM_Odm->AdapEn_RSSI)
|
||||
EDCCA_State = 1;
|
||||
else if(pDM_Odm->RSSI_Min < (pDM_Odm->AdapEn_RSSI - 5))
|
||||
EDCCA_State = 0;
|
||||
}
|
||||
else
|
||||
EDCCA_State = 1;
|
||||
|
||||
if(pDM_Odm->Carrier_Sense_enable == FALSE && pDM_Odm->NHM_enable == TRUE)
|
||||
Phydm_NHMBB(pDM_Odm);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("BandWidth=%s, IGI_target=0x%x, EDCCA_State=%d, EDCCA_enable_state = %d\n",
|
||||
(*pDM_Odm->pBandWidth==ODM_BW80M)?"80M":((*pDM_Odm->pBandWidth==ODM_BW40M)?"40M":"20M"), IGI_target, EDCCA_State, pDM_Odm->EDCCA_enable_state));
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("RSSI_min = %d, AdapIGIUpper= 0x %x\n", pDM_Odm->RSSI_Min, pDM_Odm->Adaptivity_IGI_upper));
|
||||
|
||||
|
||||
if(EDCCA_State == 1)
|
||||
{
|
||||
Diff = IGI_target -(s1Byte)IGI;
|
||||
TH_L2H_dmc = pDM_Odm->TH_L2H_ini + Diff;
|
||||
if(TH_L2H_dmc > 10)
|
||||
TH_L2H_dmc = 10;
|
||||
|
||||
TH_H2L_dmc = TH_L2H_dmc - pDM_Odm->TH_EDCCA_HL_diff;
|
||||
|
||||
//replace lower bound to prevent EDCCA always equal 1
|
||||
if(TH_H2L_dmc < pDM_Odm->H2L_lb)
|
||||
TH_H2L_dmc = pDM_Odm->H2L_lb;
|
||||
if(TH_L2H_dmc < pDM_Odm->L2H_lb)
|
||||
TH_L2H_dmc = pDM_Odm->L2H_lb;
|
||||
}
|
||||
else
|
||||
{
|
||||
TH_L2H_dmc = 0x7f;
|
||||
TH_H2L_dmc = 0x7f;
|
||||
}
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("IGI=0x%x, TH_L2H_dmc = %d, TH_H2L_dmc = %d, adaptivity_flg = %d, bAdaOn = %d, DynamicLinkAdaptivity = %d, NHM_enable = %d\n",
|
||||
IGI, TH_L2H_dmc, TH_H2L_dmc, pDM_Odm->adaptivity_flag, pDM_Odm->bAdaOn, pDM_Odm->DynamicLinkAdaptivity, pDM_Odm->NHM_enable));
|
||||
|
||||
Phydm_SetEDCCAThreshold(pDM_Odm, TH_H2L_dmc, TH_L2H_dmc);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
VOID
|
||||
Phydm_EnableEDCCA(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
|
||||
// This should be moved out of OUTSRC
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
PADAPTER pAdapter = pDM_Odm->Adapter;
|
||||
// Enable EDCCA. The value is suggested by SD3 Wilson.
|
||||
|
||||
//
|
||||
// Revised for ASUS 11b/g performance issues, suggested by BB Neil, 2012.04.13.
|
||||
//
|
||||
if((pDM_Odm->SupportICType == ODM_RTL8723A)&&(IS_WIRELESS_MODE_G(pAdapter)))
|
||||
{
|
||||
//PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold, 0x00);
|
||||
ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold,0x00);
|
||||
ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold+2,0xFD);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold, 0x03);
|
||||
ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold,0x03);
|
||||
ODM_Write1Byte(pDM_Odm,rOFDM0_ECCAThreshold+2,0x00);
|
||||
}
|
||||
|
||||
//PlatformEFIOWrite1Byte(Adapter, rOFDM0_ECCAThreshold+2, 0x00);
|
||||
}
|
||||
|
||||
VOID
|
||||
Phydm_DisableEDCCA(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
// Disable EDCCA..
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
ODM_Write1Byte(pDM_Odm, rOFDM0_ECCAThreshold, 0x7f);
|
||||
ODM_Write1Byte(pDM_Odm, rOFDM0_ECCAThreshold+2, 0x7f);
|
||||
}
|
||||
|
||||
//
|
||||
// Description: According to initial gain value to determine to enable or disable EDCCA.
|
||||
//
|
||||
// Suggested by SD3 Wilson. Added by tynli. 2011.11.25.
|
||||
//
|
||||
VOID
|
||||
Phydm_DynamicEDCCA(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
PADAPTER pAdapter = pDM_Odm->Adapter;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
u1Byte RegC50, RegC58;
|
||||
BOOLEAN bEDCCAenable = FALSE;
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN))
|
||||
BOOLEAN bFwCurrentInPSMode=FALSE;
|
||||
|
||||
pAdapter->HalFunc.GetHwRegHandler(pAdapter, HW_VAR_FW_PSMODE_STATUS, (pu1Byte)(&bFwCurrentInPSMode));
|
||||
|
||||
// Disable EDCCA mode while under LPS mode, added by Roger, 2012.09.14.
|
||||
if(bFwCurrentInPSMode)
|
||||
return;
|
||||
#endif
|
||||
//
|
||||
// 2013/11/14 Ken According to BB team Jame's suggestion, we need to disable soft AP mode EDCCA.
|
||||
// 2014/01/08 MH For Miracst AP mode test. We need to disable EDCCA. Otherwise, we may stop
|
||||
// to send beacon in noisy environment or platform.
|
||||
//
|
||||
if(ACTING_AS_AP(pAdapter) || ACTING_AS_AP(GetFirstAPAdapter(pAdapter)))
|
||||
//if(ACTING_AS_AP(pAdapter))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,PHYDM_COMP_ADAPTIVITY, ODM_DBG_LOUD, ("At least One Port as AP disable EDCCA\n"));
|
||||
Phydm_DisableEDCCA(pDM_Odm);
|
||||
if(pHalData->bPreEdccaEnable)
|
||||
Phydm_DisableEDCCA(pDM_Odm);
|
||||
pHalData->bPreEdccaEnable = FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
RegC50 = (u1Byte)ODM_GetBBReg(pDM_Odm, rOFDM0_XAAGCCore1, bMaskByte0);
|
||||
RegC58 = (u1Byte)ODM_GetBBReg(pDM_Odm, rOFDM0_XBAGCCore1, bMaskByte0);
|
||||
|
||||
|
||||
if((RegC50 > 0x28 && RegC58 > 0x28) ||
|
||||
((pDM_Odm->SupportICType == ODM_RTL8723A && IS_WIRELESS_MODE_G(pAdapter) && RegC50>0x26)) ||
|
||||
(pDM_Odm->SupportICType == ODM_RTL8188E && RegC50 > 0x28))
|
||||
{
|
||||
if(!pHalData->bPreEdccaEnable)
|
||||
{
|
||||
Phydm_EnableEDCCA(pDM_Odm);
|
||||
pHalData->bPreEdccaEnable = TRUE;
|
||||
}
|
||||
|
||||
}
|
||||
else if((RegC50 < 0x25 && RegC58 < 0x25) || (pDM_Odm->SupportICType == ODM_RTL8188E && RegC50 < 0x25))
|
||||
{
|
||||
if(pHalData->bPreEdccaEnable)
|
||||
{
|
||||
Phydm_DisableEDCCA(pDM_Odm);
|
||||
pHalData->bPreEdccaEnable = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,213 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
//============================================================
|
||||
// include files
|
||||
//============================================================
|
||||
#include "Mp_Precomp.h"
|
||||
#include "phydm_precomp.h"
|
||||
|
||||
|
||||
u1Byte
|
||||
ODM_GetAutoChannelSelectResult(
|
||||
IN PVOID pDM_VOID,
|
||||
IN u1Byte Band
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
PACS pACS = &pDM_Odm->DM_ACS;
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
if(Band == ODM_BAND_2_4G)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("[ACS] ODM_GetAutoChannelSelectResult(): CleanChannel_2G(%d)\n", pACS->CleanChannel_2G));
|
||||
return (u1Byte)pACS->CleanChannel_2G;
|
||||
}
|
||||
else
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("[ACS] ODM_GetAutoChannelSelectResult(): CleanChannel_5G(%d)\n", pACS->CleanChannel_5G));
|
||||
return (u1Byte)pACS->CleanChannel_5G;
|
||||
}
|
||||
#else
|
||||
return (u1Byte)pACS->CleanChannel_2G;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
VOID
|
||||
odm_AutoChannelSelectSetting(
|
||||
IN PVOID pDM_VOID,
|
||||
IN BOOLEAN IsEnable
|
||||
)
|
||||
{
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
u2Byte period = 0x2710;// 40ms in default
|
||||
u2Byte NHMType = 0x7;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectSetting()=========> \n"));
|
||||
|
||||
if(IsEnable)
|
||||
{//20 ms
|
||||
period = 0x1388;
|
||||
NHMType = 0x1;
|
||||
}
|
||||
|
||||
if(pDM_Odm->SupportICType & ODM_IC_11AC_SERIES)
|
||||
{
|
||||
//PHY parameters initialize for ac series
|
||||
ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11AC+2, period); //0x990[31:16]=0x2710 Time duration for NHM unit: 4us, 0x2710=40ms
|
||||
//ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11AC, BIT8|BIT9|BIT10, NHMType); //0x994[9:8]=3 enable CCX
|
||||
}
|
||||
else if (pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
{
|
||||
//PHY parameters initialize for n series
|
||||
ODM_Write2Byte(pDM_Odm, ODM_REG_NHM_TIMER_11N+2, period); //0x894[31:16]=0x2710 Time duration for NHM unit: 4us, 0x2710=40ms
|
||||
//ODM_SetBBReg(pDM_Odm, ODM_REG_NHM_TH9_TH10_11N, BIT10|BIT9|BIT8, NHMType); //0x890[9:8]=3 enable CCX
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
odm_AutoChannelSelectInit(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
PACS pACS = &pDM_Odm->DM_ACS;
|
||||
u1Byte i;
|
||||
|
||||
if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT))
|
||||
return;
|
||||
|
||||
if(pACS->bForceACSResult)
|
||||
return;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectInit()=========> \n"));
|
||||
|
||||
pACS->CleanChannel_2G = 1;
|
||||
pACS->CleanChannel_5G = 36;
|
||||
|
||||
for (i = 0; i < ODM_MAX_CHANNEL_2G; ++i)
|
||||
{
|
||||
pACS->Channel_Info_2G[0][i] = 0;
|
||||
pACS->Channel_Info_2G[1][i] = 0;
|
||||
}
|
||||
|
||||
if(pDM_Odm->SupportICType & (ODM_IC_11AC_SERIES|ODM_RTL8192D))
|
||||
{
|
||||
for (i = 0; i < ODM_MAX_CHANNEL_5G; ++i)
|
||||
{
|
||||
pACS->Channel_Info_5G[0][i] = 0;
|
||||
pACS->Channel_Info_5G[1][i] = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
odm_AutoChannelSelectReset(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
PACS pACS = &pDM_Odm->DM_ACS;
|
||||
|
||||
if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT))
|
||||
return;
|
||||
|
||||
if(pACS->bForceACSResult)
|
||||
return;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelectReset()=========> \n"));
|
||||
|
||||
odm_AutoChannelSelectSetting(pDM_Odm,TRUE);// for 20ms measurement
|
||||
Phydm_NHMCounterStatisticsReset(pDM_Odm);
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
odm_AutoChannelSelect(
|
||||
IN PVOID pDM_VOID,
|
||||
IN u1Byte Channel
|
||||
)
|
||||
{
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
PACS pACS = &pDM_Odm->DM_ACS;
|
||||
u1Byte ChannelIDX = 0, SearchIDX = 0;
|
||||
u2Byte MaxScore=0;
|
||||
|
||||
if(!(pDM_Odm->SupportAbility & ODM_BB_NHM_CNT))
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Return: SupportAbility ODM_BB_NHM_CNT is disabled\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if(pACS->bForceACSResult)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DIG, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Force 2G clean channel = %d, 5G clean channel = %d\n",
|
||||
pACS->CleanChannel_2G, pACS->CleanChannel_5G));
|
||||
return;
|
||||
}
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Channel = %d=========> \n", Channel));
|
||||
|
||||
Phydm_GetNHMCounterStatistics(pDM_Odm);
|
||||
odm_AutoChannelSelectSetting(pDM_Odm,FALSE);
|
||||
|
||||
if(Channel >=1 && Channel <=14)
|
||||
{
|
||||
ChannelIDX = Channel - 1;
|
||||
pACS->Channel_Info_2G[1][ChannelIDX]++;
|
||||
|
||||
if(pACS->Channel_Info_2G[1][ChannelIDX] >= 2)
|
||||
pACS->Channel_Info_2G[0][ChannelIDX] = (pACS->Channel_Info_2G[0][ChannelIDX] >> 1) +
|
||||
(pACS->Channel_Info_2G[0][ChannelIDX] >> 2) + (pDM_Odm->NHM_cnt_0>>2);
|
||||
else
|
||||
pACS->Channel_Info_2G[0][ChannelIDX] = pDM_Odm->NHM_cnt_0;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): NHM_cnt_0 = %d \n", pDM_Odm->NHM_cnt_0));
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("odm_AutoChannelSelect(): Channel_Info[0][%d] = %d, Channel_Info[1][%d] = %d\n", ChannelIDX, pACS->Channel_Info_2G[0][ChannelIDX], ChannelIDX, pACS->Channel_Info_2G[1][ChannelIDX]));
|
||||
|
||||
for(SearchIDX = 0; SearchIDX < ODM_MAX_CHANNEL_2G; SearchIDX++)
|
||||
{
|
||||
if(pACS->Channel_Info_2G[1][SearchIDX] != 0)
|
||||
{
|
||||
if(pACS->Channel_Info_2G[0][SearchIDX] >= MaxScore)
|
||||
{
|
||||
MaxScore = pACS->Channel_Info_2G[0][SearchIDX];
|
||||
pACS->CleanChannel_2G = SearchIDX+1;
|
||||
}
|
||||
}
|
||||
}
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ACS, ODM_DBG_LOUD, ("(1)odm_AutoChannelSelect(): 2G: CleanChannel_2G = %d, MaxScore = %d \n",
|
||||
pACS->CleanChannel_2G, MaxScore));
|
||||
|
||||
}
|
||||
else if(Channel >= 36)
|
||||
{
|
||||
// Need to do
|
||||
pACS->CleanChannel_5G = Channel;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,217 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __PHYDMANTDIV_H__
|
||||
#define __PHYDMANTDIV_H__
|
||||
|
||||
#define ANTDIV_VERSION "1.0"
|
||||
|
||||
#define ANT1_2G 0 // = ANT2_5G
|
||||
#define ANT2_2G 1 // = ANT1_5G
|
||||
|
||||
//Antenna Diversty Control Type
|
||||
#define ODM_AUTO_ANT 0
|
||||
#define ODM_FIX_MAIN_ANT 1
|
||||
#define ODM_FIX_AUX_ANT 2
|
||||
|
||||
#define TX_BY_REG 0
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE != ODM_AP)
|
||||
#define ODM_RTL8881A 0 //Just for windows driver to jointly use ODM-driver
|
||||
#endif
|
||||
|
||||
#define ODM_ANTDIV_SUPPORT (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812)
|
||||
#define ODM_N_ANTDIV_SUPPORT (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B)
|
||||
#define ODM_AC_ANTDIV_SUPPORT (ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812)
|
||||
#define ODM_SMART_ANT_SUPPORT (ODM_RTL8188E|ODM_RTL8192E)
|
||||
|
||||
#define ODM_OLD_IC_ANTDIV_SUPPORT (ODM_RTL8723A|ODM_RTL8192C|ODM_RTL8192D)
|
||||
|
||||
#define ODM_ANTDIV_2G_SUPPORT_IC (ODM_RTL8188E|ODM_RTL8192E|ODM_RTL8723B|ODM_RTL8881A)
|
||||
#define ODM_ANTDIV_5G_SUPPORT_IC (ODM_RTL8821|ODM_RTL8881A|ODM_RTL8812)
|
||||
#define ODM_ANTDIV_2G BIT0
|
||||
#define ODM_ANTDIV_5G BIT1
|
||||
|
||||
#define ANTDIV_ON 1
|
||||
#define ANTDIV_OFF 0
|
||||
|
||||
#define INIT_ANTDIV_TIMMER 0
|
||||
#define CANCEL_ANTDIV_TIMMER 1
|
||||
#define RELEASE_ANTDIV_TIMMER 2
|
||||
|
||||
VOID
|
||||
ODM_StopAntennaSwitchDm(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
VOID
|
||||
ODM_SetAntConfig(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte antSetting // 0=A, 1=B, 2=C, ....
|
||||
);
|
||||
|
||||
|
||||
|
||||
#define SwAntDivRestAfterLink ODM_SwAntDivRestAfterLink
|
||||
VOID ODM_SwAntDivRestAfterLink( IN PDM_ODM_T pDM_Odm);
|
||||
|
||||
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
|
||||
|
||||
VOID
|
||||
ODM_UpdateRxIdleAnt(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte Ant
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_AntselStatistics(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte antsel_tr_mux,
|
||||
IN u4Byte MacId,
|
||||
IN u4Byte RxPWDBAll
|
||||
);
|
||||
|
||||
#if (RTL8723B_SUPPORT == 1)||(RTL8821A_SUPPORT == 1)
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
VOID
|
||||
ODM_SW_AntDiv_Callback(
|
||||
IN PRT_TIMER pTimer
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_SW_AntDiv_WorkitemCallback(
|
||||
IN PVOID pContext
|
||||
);
|
||||
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
|
||||
VOID
|
||||
ODM_SW_AntDiv_Callback(void *FunctionContext);
|
||||
|
||||
#endif
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
VOID
|
||||
odm_S0S1_SwAntDivByCtrlFrame(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte Step
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_AntselStatisticsOfCtrlFrame(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte antsel_tr_mux,
|
||||
IN u4Byte RxPWDBAll
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_S0S1_SwAntDivByCtrlFrame_ProcessRSSI(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PODM_PHY_INFO_T pPhyInfo,
|
||||
IN PODM_PACKET_INFO_T pPktinfo
|
||||
);
|
||||
|
||||
#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
#endif
|
||||
|
||||
#if(RTL8188E_SUPPORT == 1 || RTL8192E_SUPPORT == 1)
|
||||
#if ( !(DM_ODM_SUPPORT_TYPE == ODM_CE))
|
||||
VOID
|
||||
odm_FastAntTraining(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_FastAntTrainingCallback(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_FastAntTrainingWorkItemCallback(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
VOID
|
||||
ODM_AntDivInit(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_AntDivReset(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_AntDiv(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_Process_RSSIForAntDiv(
|
||||
IN OUT PDM_ODM_T pDM_Odm,
|
||||
IN PODM_PHY_INFO_T pPhyInfo,
|
||||
IN PODM_PACKET_INFO_T pPktinfo
|
||||
);
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
VOID
|
||||
ODM_SetTxAntByTxInfo(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN pu1Byte pDesc,
|
||||
IN u1Byte macId
|
||||
);
|
||||
|
||||
#else// (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
VOID
|
||||
ODM_SetTxAntByTxInfo(
|
||||
//IN PDM_ODM_T pDM_Odm,
|
||||
struct rtl8192cd_priv *priv,
|
||||
struct tx_desc *pdesc,
|
||||
struct tx_insn *txcfg,
|
||||
unsigned short aid
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
VOID
|
||||
ODM_AntDiv_Config(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
ODM_UpdateRxIdleAnt_8723B(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte Ant,
|
||||
IN u4Byte DefaultAnt,
|
||||
IN u4Byte OptionalAnt
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_AntDivTimers(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte state
|
||||
);
|
||||
|
||||
#endif //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
|
||||
#endif //#ifndef __ODMANTDIV_H__
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,237 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
#ifndef __HALHWOUTSRC_H__
|
||||
#define __HALHWOUTSRC_H__
|
||||
|
||||
|
||||
/*--------------------------Define -------------------------------------------*/
|
||||
//#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
#define AGC_DIFF_CONFIG_MP(ic, band) (ODM_ReadAndConfig_MP_##ic##_AGC_TAB_DIFF(pDM_Odm, Array_MP_##ic##_AGC_TAB_DIFF_##band, \
|
||||
sizeof(Array_MP_##ic##_AGC_TAB_DIFF_##band)/sizeof(u4Byte)))
|
||||
#define AGC_DIFF_CONFIG_TC(ic, band) (ODM_ReadAndConfig_TC_##ic##_AGC_TAB_DIFF(pDM_Odm, Array_TC_##ic##_AGC_TAB_DIFF_##band, \
|
||||
sizeof(Array_TC_##ic##_AGC_TAB_DIFF_##band)/sizeof(u4Byte)))
|
||||
|
||||
#define AGC_DIFF_CONFIG(ic, band) do {\
|
||||
if (pDM_Odm->bIsMPChip)\
|
||||
AGC_DIFF_CONFIG_MP(ic,band);\
|
||||
else\
|
||||
AGC_DIFF_CONFIG_TC(ic,band);\
|
||||
} while(0)
|
||||
|
||||
|
||||
//============================================================
|
||||
// structure and define
|
||||
//============================================================
|
||||
|
||||
typedef struct _Phy_Rx_AGC_Info
|
||||
{
|
||||
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
|
||||
u1Byte gain:7,trsw:1;
|
||||
#else
|
||||
u1Byte trsw:1,gain:7;
|
||||
#endif
|
||||
} PHY_RX_AGC_INFO_T,*pPHY_RX_AGC_INFO_T;
|
||||
|
||||
typedef struct _Phy_Status_Rpt_8192cd
|
||||
{
|
||||
PHY_RX_AGC_INFO_T path_agc[2];
|
||||
u1Byte ch_corr[2];
|
||||
u1Byte cck_sig_qual_ofdm_pwdb_all;
|
||||
u1Byte cck_agc_rpt_ofdm_cfosho_a;
|
||||
u1Byte cck_rpt_b_ofdm_cfosho_b;
|
||||
u1Byte rsvd_1;//ch_corr_msb;
|
||||
u1Byte noise_power_db_msb;
|
||||
s1Byte path_cfotail[2];
|
||||
u1Byte pcts_mask[2];
|
||||
s1Byte stream_rxevm[2];
|
||||
u1Byte path_rxsnr[2];
|
||||
u1Byte noise_power_db_lsb;
|
||||
u1Byte rsvd_2[3];
|
||||
u1Byte stream_csi[2];
|
||||
u1Byte stream_target_csi[2];
|
||||
s1Byte sig_evm;
|
||||
u1Byte rsvd_3;
|
||||
|
||||
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
|
||||
u1Byte antsel_rx_keep_2:1; //ex_intf_flg:1;
|
||||
u1Byte sgi_en:1;
|
||||
u1Byte rxsc:2;
|
||||
u1Byte idle_long:1;
|
||||
u1Byte r_ant_train_en:1;
|
||||
u1Byte ant_sel_b:1;
|
||||
u1Byte ant_sel:1;
|
||||
#else // _BIG_ENDIAN_
|
||||
u1Byte ant_sel:1;
|
||||
u1Byte ant_sel_b:1;
|
||||
u1Byte r_ant_train_en:1;
|
||||
u1Byte idle_long:1;
|
||||
u1Byte rxsc:2;
|
||||
u1Byte sgi_en:1;
|
||||
u1Byte antsel_rx_keep_2:1; //ex_intf_flg:1;
|
||||
#endif
|
||||
} PHY_STATUS_RPT_8192CD_T,*PPHY_STATUS_RPT_8192CD_T;
|
||||
|
||||
|
||||
typedef struct _Phy_Status_Rpt_8812
|
||||
{
|
||||
#if 0
|
||||
PHY_RX_AGC_INFO_T path_agc[2];
|
||||
u1Byte ch_num[2];
|
||||
u1Byte cck_sig_qual_ofdm_pwdb_all;
|
||||
u1Byte cck_agc_rpt_ofdm_cfosho_a;
|
||||
u1Byte cck_bb_pwr_ofdm_cfosho_b;
|
||||
u1Byte cck_rx_path; //CCK_RX_PATH [3:0] (with regA07[3:0] definition)
|
||||
u1Byte rsvd_1;
|
||||
u1Byte path_cfotail[2];
|
||||
u1Byte pcts_mask[2];
|
||||
s1Byte stream_rxevm[2];
|
||||
u1Byte path_rxsnr[2];
|
||||
u1Byte rsvd_2[2];
|
||||
u1Byte stream_snr[2];
|
||||
u1Byte stream_csi[2];
|
||||
u1Byte rsvd_3[2];
|
||||
s1Byte sig_evm;
|
||||
u1Byte rsvd_4;
|
||||
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
|
||||
u1Byte antidx_anta:3;
|
||||
u1Byte antidx_antb:3;
|
||||
u1Byte rsvd_5:2;
|
||||
#else // _BIG_ENDIAN_
|
||||
u1Byte rsvd_5:2;
|
||||
u1Byte antidx_antb:3;
|
||||
u1Byte antidx_anta:3;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//2012.05.24 LukeLee: This structure should take big/little endian in consideration later.....
|
||||
|
||||
//DWORD 0
|
||||
u1Byte gain_trsw[2];
|
||||
#if (ODM_ENDIAN_TYPE == ODM_ENDIAN_LITTLE)
|
||||
u2Byte chl_num:10;
|
||||
u2Byte sub_chnl:4;
|
||||
u2Byte r_RFMOD:2;
|
||||
#else // _BIG_ENDIAN_
|
||||
u2Byte r_RFMOD:2;
|
||||
u2Byte sub_chnl:4;
|
||||
u2Byte chl_num:10;
|
||||
#endif
|
||||
|
||||
//DWORD 1
|
||||
u1Byte pwdb_all;
|
||||
u1Byte cfosho[4]; // DW 1 byte 1 DW 2 byte 0
|
||||
|
||||
//DWORD 2
|
||||
s1Byte cfotail[4]; // DW 2 byte 1 DW 3 byte 0
|
||||
|
||||
//DWORD 3
|
||||
s1Byte rxevm[2]; // DW 3 byte 1 DW 3 byte 2
|
||||
s1Byte rxsnr[2]; // DW 3 byte 3 DW 4 byte 0
|
||||
|
||||
//DWORD 4
|
||||
u1Byte PCTS_MSK_RPT[2];
|
||||
u1Byte pdsnr[2]; // DW 4 byte 3 DW 5 Byte 0
|
||||
|
||||
//DWORD 5
|
||||
u1Byte csi_current[2];
|
||||
u1Byte rx_gain_c;
|
||||
|
||||
//DWORD 6
|
||||
u1Byte rx_gain_d;
|
||||
s1Byte sigevm;
|
||||
u1Byte resvd_0;
|
||||
u1Byte antidx_anta:3;
|
||||
u1Byte antidx_antb:3;
|
||||
u1Byte resvd_1:2;
|
||||
} PHY_STATUS_RPT_8812_T,*PPHY_STATUS_RPT_8812_T;
|
||||
|
||||
|
||||
VOID
|
||||
odm_Init_RSSIForDM(
|
||||
IN OUT PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_PhyStatusQuery(
|
||||
IN OUT PDM_ODM_T pDM_Odm,
|
||||
OUT PODM_PHY_INFO_T pPhyInfo,
|
||||
IN pu1Byte pPhyStatus,
|
||||
IN PODM_PACKET_INFO_T pPktinfo
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_MacStatusQuery(
|
||||
IN OUT PDM_ODM_T pDM_Odm,
|
||||
IN pu1Byte pMacStatus,
|
||||
IN u1Byte MacID,
|
||||
IN BOOLEAN bPacketMatchBSSID,
|
||||
IN BOOLEAN bPacketToSelf,
|
||||
IN BOOLEAN bPacketBeacon
|
||||
);
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE|ODM_AP))
|
||||
|
||||
HAL_STATUS
|
||||
ODM_ConfigRFWithTxPwrTrackHeaderFile(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
HAL_STATUS
|
||||
ODM_ConfigRFWithHeaderFile(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_Config_Type ConfigType,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath
|
||||
);
|
||||
|
||||
HAL_STATUS
|
||||
ODM_ConfigBBWithHeaderFile(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_BB_Config_Type ConfigType
|
||||
);
|
||||
|
||||
HAL_STATUS
|
||||
ODM_ConfigMACWithHeaderFile(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
HAL_STATUS
|
||||
ODM_ConfigFWWithHeaderFile(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_FW_Config_Type ConfigType,
|
||||
OUT u1Byte *pFirmware,
|
||||
OUT u4Byte *pSize
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_GetHWImgVersion(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
s4Byte
|
||||
odm_SignalScaleMapping(
|
||||
IN OUT PDM_ODM_T pDM_Odm,
|
||||
IN s4Byte CurrSig
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,167 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __PHYDMRAINFO_H__
|
||||
#define __PHYDMRAINFO_H__
|
||||
|
||||
#define RAINFO_VERSION "1.0"
|
||||
|
||||
#define AP_InitRateAdaptiveState ODM_RateAdaptiveStateApInit
|
||||
|
||||
#define DM_RATR_STA_INIT 0
|
||||
#define DM_RATR_STA_HIGH 1
|
||||
#define DM_RATR_STA_MIDDLE 2
|
||||
#define DM_RATR_STA_LOW 3
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
#define DM_RATR_STA_ULTRA_LOW 4
|
||||
#endif
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
typedef struct _Rate_Adaptive_Table_{
|
||||
u1Byte firstconnect;
|
||||
#if(DM_ODM_SUPPORT_TYPE==ODM_WIN)
|
||||
BOOLEAN PT_collision_pre;
|
||||
#endif
|
||||
}RA_T, *pRA_T;
|
||||
#endif
|
||||
|
||||
typedef struct _ODM_RATE_ADAPTIVE
|
||||
{
|
||||
u1Byte Type; // DM_Type_ByFW/DM_Type_ByDriver
|
||||
u1Byte HighRSSIThresh; // if RSSI > HighRSSIThresh => RATRState is DM_RATR_STA_HIGH
|
||||
u1Byte LowRSSIThresh; // if RSSI <= LowRSSIThresh => RATRState is DM_RATR_STA_LOW
|
||||
u1Byte RATRState; // Current RSSI level, DM_RATR_STA_HIGH/DM_RATR_STA_MIDDLE/DM_RATR_STA_LOW
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
u1Byte LdpcThres; // if RSSI > LdpcThres => switch from LPDC to BCC
|
||||
BOOLEAN bLowerRtsRate;
|
||||
#endif
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
u1Byte RtsThres;
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
BOOLEAN bUseLdpc;
|
||||
#else
|
||||
u1Byte UltraLowRSSIThresh;
|
||||
u4Byte LastRATR; // RATR Register Content
|
||||
#endif
|
||||
|
||||
} ODM_RATE_ADAPTIVE, *PODM_RATE_ADAPTIVE;
|
||||
|
||||
VOID
|
||||
odm_RSSIMonitorInit(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_RSSIMonitorCheck(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE==ODM_WIN)
|
||||
VOID
|
||||
odm_RSSIDumpToRegister(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
#endif
|
||||
|
||||
VOID
|
||||
odm_RSSIMonitorCheckMP(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_RSSIMonitorCheckCE(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_RSSIMonitorCheckAP(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
odm_RateAdaptiveMaskInit(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_RefreshRateAdaptiveMask(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_RefreshRateAdaptiveMaskMP(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_RefreshRateAdaptiveMaskCE(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_RefreshRateAdaptiveMaskAPADSL(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
ODM_RAStateCheck(
|
||||
IN PVOID pDM_VOID,
|
||||
IN s4Byte RSSI,
|
||||
IN BOOLEAN bForceUpdate,
|
||||
OUT pu1Byte pRATRState
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_RefreshBasicRateMask(
|
||||
IN PVOID pDM_VOID
|
||||
);
|
||||
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
VOID
|
||||
ODM_DynamicARFBSelect(
|
||||
IN PVOID pDM_VOID,
|
||||
IN u1Byte rate,
|
||||
IN BOOLEAN Collision_State
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_RateAdaptiveStateApInit(
|
||||
IN PVOID PADAPTER_VOID,
|
||||
IN PRT_WLAN_STA pEntry
|
||||
);
|
||||
#endif
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
u4Byte
|
||||
ODM_Get_Rate_Bitmap(
|
||||
IN PVOID pDM_VOID,
|
||||
IN u4Byte macid,
|
||||
IN u4Byte ra_mask,
|
||||
IN u1Byte rssi_level
|
||||
);
|
||||
#endif
|
||||
|
||||
#endif //#ifndef __ODMRAINFO_H__
|
||||
|
||||
|
||||
|
|
@ -1,873 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
//============================================================
|
||||
// include files
|
||||
//============================================================
|
||||
|
||||
#include "Mp_Precomp.h"
|
||||
#include "phydm_precomp.h"
|
||||
|
||||
|
||||
VOID
|
||||
PHYDM_InitDebugSetting(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
pDM_Odm->DebugLevel = ODM_DBG_TRACE;
|
||||
|
||||
pDM_Odm->DebugComponents =
|
||||
\
|
||||
#if DBG
|
||||
//BB Functions
|
||||
// ODM_COMP_DIG |
|
||||
// ODM_COMP_RA_MASK |
|
||||
// ODM_COMP_DYNAMIC_TXPWR |
|
||||
// ODM_COMP_FA_CNT |
|
||||
// ODM_COMP_RSSI_MONITOR |
|
||||
// ODM_COMP_CCK_PD |
|
||||
// ODM_COMP_ANT_DIV |
|
||||
// ODM_COMP_PWR_SAVE |
|
||||
// ODM_COMP_PWR_TRAIN |
|
||||
// ODM_COMP_RATE_ADAPTIVE |
|
||||
// ODM_COMP_PATH_DIV |
|
||||
// ODM_COMP_DYNAMIC_PRICCA |
|
||||
// ODM_COMP_RXHP |
|
||||
// ODM_COMP_MP |
|
||||
// ODM_COMP_CFO_TRACKING |
|
||||
// ODM_COMP_ACS |
|
||||
// PHYDM_COMP_ADAPTIVITY |
|
||||
|
||||
//MAC Functions
|
||||
// ODM_COMP_EDCA_TURBO |
|
||||
// ODM_COMP_EARLY_MODE |
|
||||
//RF Functions
|
||||
// ODM_COMP_TX_PWR_TRACK |
|
||||
// ODM_COMP_RX_GAIN_TRACK |
|
||||
// ODM_COMP_CALIBRATION |
|
||||
//Common
|
||||
// ODM_COMP_COMMON |
|
||||
// ODM_COMP_INIT |
|
||||
// ODM_COMP_PSD |
|
||||
#endif
|
||||
0;
|
||||
}
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
|
||||
static u1Byte BbDbgBuf[BB_TMP_BUF_SIZE];
|
||||
VOID
|
||||
phydm_BB_Debug_Info(IN PDM_ODM_T pDM_Odm)
|
||||
{
|
||||
|
||||
u1Byte RX_HT_BW, RX_VHT_BW, RXSC, RX_HT, RX_BW;
|
||||
static u1Byte vRX_BW ;
|
||||
u4Byte value32, value32_1, value32_2, value32_3;
|
||||
s4Byte SFO_A, SFO_B, SFO_C, SFO_D;
|
||||
s4Byte LFO_A, LFO_B, LFO_C, LFO_D;
|
||||
static u1Byte MCSS,Tail,Parity,rsv,vrsv,idx,smooth,htsound,agg,stbc,vstbc,fec,fecext,sgi,sgiext,htltf,vgid,vNsts,vtxops,vrsv2,vbrsv,bf,vbcrc;
|
||||
static u2Byte HLength,htcrc8,Length;
|
||||
static u2Byte vpaid;
|
||||
static u2Byte vLength,vhtcrc8,vMCSS,vTail,vbTail;
|
||||
static u1Byte HMCSS,HRX_BW;
|
||||
|
||||
|
||||
u1Byte pwDB;
|
||||
s1Byte RXEVM_0, RXEVM_1, RXEVM_2 ;
|
||||
u1Byte RF_gain_pathA, RF_gain_pathB, RF_gain_pathC, RF_gain_pathD;
|
||||
u1Byte RX_SNR_pathA, RX_SNR_pathB, RX_SNR_pathC, RX_SNR_pathD;
|
||||
s4Byte sig_power;
|
||||
const char *RXHT_table[] = {"legacy", "HT", "VHT"};
|
||||
const char *BW_table[] = {"20M", "40M", "80M"};
|
||||
const char *RXSC_table[] = {"duplicate/full bw", "usc20-1", "lsc20-1", "usc20-2", "lsc20-2", "usc40", "lsc40"};
|
||||
|
||||
const char *L_rate[]={"6M","9M","12M","18M","24M","36M","48M","54M"};
|
||||
|
||||
|
||||
/*
|
||||
const double evm_comp_20M = 0.579919469776867; //10*log10(64.0/56.0)
|
||||
const double evm_comp_40M = 0.503051183113957; //10*log10(128.0/114.0)
|
||||
const double evm_comp_80M = 0.244245993314183; //10*log10(256.0/242.0)
|
||||
const double evm_comp_160M = 0.244245993314183; //10*log10(512.0/484.0)
|
||||
*/
|
||||
|
||||
if(pDM_Odm->SupportICType & ODM_IC_11N_SERIES)
|
||||
return;
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s \n", "BB Report Info");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
//BW & Mode Detection
|
||||
///////////////////////////////////////////////////////
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xf80 ,bMaskDWord);
|
||||
value32_2 =value32;
|
||||
RX_HT_BW = (u1Byte)(value32&0x1) ;
|
||||
RX_VHT_BW = (u1Byte)((value32>>1)&0x3);
|
||||
RXSC = (u1Byte)(value32&0x78);
|
||||
value32_1= (value32&0x180)>>7;
|
||||
RX_HT = (u1Byte)(value32_1);
|
||||
/*
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "F80", value32_2);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "RX_HT_BW", RX_HT_BW);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "RX_VHT_BW", RX_VHT_BW);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "RX_SC", RXSC);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "RX_HT", RX_HT);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
*/
|
||||
|
||||
//rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n RX_HT:%s ", RXHT_table[RX_HT]);
|
||||
//DCMD_Printf(BbDbgBuf);
|
||||
RX_BW = 0;
|
||||
|
||||
if(RX_HT == 2)
|
||||
{
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n Mode: VHT Mode");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
if(RX_VHT_BW==0)
|
||||
{
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=20M");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
}
|
||||
else if(RX_VHT_BW==1)
|
||||
{
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=40M");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
}
|
||||
else
|
||||
{
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=80M");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
}
|
||||
RX_BW = RX_VHT_BW;
|
||||
}
|
||||
else if(RX_HT == 1)
|
||||
{
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n Mode: HT Mode");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
if(RX_HT_BW==0)
|
||||
{
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=20M");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
}
|
||||
else if(RX_HT_BW==1)
|
||||
{
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW=40M");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
}
|
||||
RX_BW = RX_HT_BW;
|
||||
}
|
||||
else
|
||||
{
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n Mode: Legeacy Mode");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
}
|
||||
|
||||
if(RX_HT !=0)
|
||||
{
|
||||
if(RXSC==0)
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n duplicate/full bw");
|
||||
else if(RXSC==1)
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n usc20-1");
|
||||
else if(RXSC==2)
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n lsc20-1");
|
||||
else if(RXSC==3)
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n usc20-2");
|
||||
else if(RXSC==4)
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n lsc20-2");
|
||||
else if(RXSC==9)
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n usc40");
|
||||
else if(RXSC==10)
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n lsc40");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
}
|
||||
/*
|
||||
if(RX_HT == 2){
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW:%s", BW_table[RX_VHT_BW]);
|
||||
RX_BW = RX_VHT_BW;
|
||||
}
|
||||
else if(RX_HT == 1){
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " BW:%s", BW_table[RX_HT_BW]);
|
||||
RX_BW = RX_HT_BW;
|
||||
}
|
||||
else
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "");
|
||||
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, " RXSC:%s", RXSC_table[RXSC]);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
*/
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
// rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "dB Conversion: 10log(65)", ODM_PWdB_Conversion(65,10,0));
|
||||
// DCMD_Printf(BbDbgBuf);
|
||||
|
||||
// RX signal power and AGC related info
|
||||
///////////////////////////////////////////////////////
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xF90 ,bMaskDWord);
|
||||
pwDB = (u1Byte) ((value32 & bMaskByte1) >> 8);
|
||||
pwDB=pwDB>>1;
|
||||
sig_power = -110+pwDB;
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "OFDM RX Signal Power(dB)", sig_power);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xd14 ,bMaskDWord);
|
||||
RX_SNR_pathA = (u1Byte)(value32&0xFF)>>1;
|
||||
RF_gain_pathA = (s1Byte) ((value32 & bMaskByte1) >> 8);
|
||||
RF_gain_pathA *=2;
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xd54 ,bMaskDWord);
|
||||
RX_SNR_pathB = (u1Byte)(value32&0xFF)>>1;
|
||||
RF_gain_pathB = (s1Byte) ((value32 & bMaskByte1) >> 8);
|
||||
RF_gain_pathB *=2;
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xd94 ,bMaskDWord);
|
||||
RX_SNR_pathC = (u1Byte)(value32&0xFF)>>1;
|
||||
RF_gain_pathC = (s1Byte) ((value32 & bMaskByte1) >> 8);
|
||||
RF_gain_pathC *=2;
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xdd4 ,bMaskDWord);
|
||||
RX_SNR_pathD = (u1Byte)(value32&0xFF)>>1;
|
||||
RF_gain_pathD = (s1Byte) ((value32 & bMaskByte1) >> 8);
|
||||
RF_gain_pathD *=2;
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "OFDM RX RF Gain(A/B/C/D)", RF_gain_pathA, RF_gain_pathA, RF_gain_pathC, RF_gain_pathD);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
// RX Counter related info
|
||||
///////////////////////////////////////////////////////
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xF08 ,bMaskDWord);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "OFDM CCA Counter", ((value32&0xFFFF0000)>>16));
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xFD0 ,bMaskDWord);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "OFDM SBD Fail Counter", value32&0xFFFF);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xFC4 ,bMaskDWord);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d", "VHT SIGA/SIGB CRC8 Fail Counter", value32&0xFFFF, ((value32&0xFFFF0000)>>16));
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xFCC ,bMaskDWord);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "CCK CCA Counter", value32&0xFFFF);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xFBC ,bMaskDWord);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d", "LSIG (\"Parity Fail\"/\"Rate Illegal\") Counter", value32&0xFFFF, ((value32&0xFFFF0000)>>16));
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32_1 = ODM_GetBBReg(pDM_Odm, 0xFC8 ,bMaskDWord);
|
||||
value32_2 = ODM_GetBBReg(pDM_Odm, 0xFC0 ,bMaskDWord);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d", "HT/VHT MCS NOT SUPPORT counter", ((value32_2&0xFFFF0000)>>16), value32_1&0xFFFF);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
// PostFFT related info
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xF8c ,bMaskDWord);
|
||||
RXEVM_0 = (s1Byte) ((value32 & bMaskByte2) >> 16);
|
||||
RXEVM_0 /=2;
|
||||
if(RXEVM_0 < -63)
|
||||
RXEVM_0=0;
|
||||
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
RXEVM_1 = (s1Byte) ((value32 & bMaskByte3) >> 24);
|
||||
RXEVM_1 /=2;
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xF88 ,bMaskDWord);
|
||||
RXEVM_2 = (s1Byte) ((value32 & bMaskByte2) >> 16);
|
||||
RXEVM_2 /=2;
|
||||
|
||||
if(RXEVM_1 < -63)
|
||||
RXEVM_1=0;
|
||||
if(RXEVM_2 < -63)
|
||||
RXEVM_2=0;
|
||||
|
||||
/*
|
||||
if(RX_BW == 0){
|
||||
RXEVM_0 -= evm_comp_20M;
|
||||
RXEVM_1 -= evm_comp_20M;
|
||||
RXEVM_2 -= evm_comp_20M;
|
||||
}
|
||||
else if(RX_BW == 1){
|
||||
RXEVM_0 -= evm_comp_40M;
|
||||
RXEVM_1 -= evm_comp_40M;
|
||||
RXEVM_2 -= evm_comp_40M;
|
||||
}
|
||||
else if (RX_BW == 2){
|
||||
RXEVM_0 -= evm_comp_80M;
|
||||
RXEVM_1 -= evm_comp_80M;
|
||||
RXEVM_2 -= evm_comp_80M;
|
||||
}
|
||||
*/
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d", "RXEVM (1ss/2ss/3ss)", RXEVM_0, RXEVM_1, RXEVM_2);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
// value32 = ODM_GetBBReg(pDM_Odm, 0xD14 ,bMaskDWord);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d / %d / %d", "RXSNR(A/B/C/D, dB)", RX_SNR_pathA, RX_SNR_pathB, RX_SNR_pathC, RX_SNR_pathD);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
// rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d", "B_RXSNR", (value32&0xFF00)>>9);
|
||||
// DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xF8C ,bMaskDWord);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d", "CSI_1st /CSI_2nd", value32&0xFFFF, ((value32&0xFFFF0000)>>16));
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
///////////////////////////////////////////////////////
|
||||
|
||||
//BW & Mode Detection
|
||||
|
||||
//Reset Page F Counter
|
||||
ODM_SetBBReg(pDM_Odm, 0xB58 ,BIT0, 1);
|
||||
ODM_SetBBReg(pDM_Odm, 0xB58 ,BIT0, 0);
|
||||
|
||||
//CFO Report Info
|
||||
//Short CFO
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xd0c ,bMaskDWord);
|
||||
value32_1 = ODM_GetBBReg(pDM_Odm, 0xd4c ,bMaskDWord);
|
||||
value32_2 = ODM_GetBBReg(pDM_Odm, 0xd8c ,bMaskDWord);
|
||||
value32_3 = ODM_GetBBReg(pDM_Odm, 0xdcc ,bMaskDWord);
|
||||
|
||||
SFO_A=(s4Byte)(value32&bMask12Bits);
|
||||
SFO_B=(s4Byte)(value32_1&bMask12Bits);
|
||||
SFO_C=(s4Byte)(value32_2&bMask12Bits);
|
||||
SFO_D=(s4Byte)(value32_3&bMask12Bits);
|
||||
|
||||
LFO_A=(s4Byte)(value32>>16);
|
||||
LFO_B=(s4Byte)(value32_1>>16);
|
||||
LFO_C=(s4Byte)(value32_2>>16);
|
||||
LFO_D=(s4Byte)(value32_3>>16);
|
||||
|
||||
//SFO 2's to dec
|
||||
if(SFO_A >2047)
|
||||
{
|
||||
SFO_A=SFO_A-4096;
|
||||
}
|
||||
SFO_A=(SFO_A*312500)/2048;
|
||||
|
||||
if(SFO_B >2047)
|
||||
{
|
||||
SFO_B=SFO_B-4096;
|
||||
}
|
||||
SFO_B=(SFO_B*312500)/2048;
|
||||
if(SFO_C >2047)
|
||||
{
|
||||
SFO_C=SFO_C-4096;
|
||||
}
|
||||
SFO_C=(SFO_C*312500)/2048;
|
||||
if(SFO_D >2047)
|
||||
{
|
||||
SFO_D=SFO_D-4096;
|
||||
}
|
||||
SFO_D=(SFO_D*312500)/2048;
|
||||
|
||||
//LFO 2's to dec
|
||||
|
||||
if(LFO_A >4095)
|
||||
{
|
||||
LFO_A=LFO_A-8192;
|
||||
}
|
||||
|
||||
if(LFO_B >4095)
|
||||
{
|
||||
LFO_B=LFO_B-8192;
|
||||
}
|
||||
|
||||
if(LFO_C>4095)
|
||||
{
|
||||
LFO_C=LFO_C-8192;
|
||||
}
|
||||
|
||||
if(LFO_D >4095)
|
||||
{
|
||||
LFO_D=LFO_D-8192;
|
||||
}
|
||||
LFO_A=LFO_A*312500/4096;
|
||||
LFO_B=LFO_B*312500/4096;
|
||||
LFO_C=LFO_C*312500/4096;
|
||||
LFO_D=LFO_D*312500/4096;
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "CFO Report Info");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " Short CFO(Hz) <A/B/C/D>", SFO_A,SFO_B,SFO_C,SFO_D);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " Long CFO(Hz) <A/B/C/D>", LFO_A,LFO_B,LFO_C,LFO_D);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
//SCFO
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xd10 ,bMaskDWord);
|
||||
value32_1 = ODM_GetBBReg(pDM_Odm, 0xd50 ,bMaskDWord);
|
||||
value32_2 = ODM_GetBBReg(pDM_Odm, 0xd90 ,bMaskDWord);
|
||||
value32_3 = ODM_GetBBReg(pDM_Odm, 0xdd0 ,bMaskDWord);
|
||||
|
||||
SFO_A=(s4Byte)(value32&0x7ff);
|
||||
SFO_B=(s4Byte)(value32_1&0x7ff);
|
||||
SFO_C=(s4Byte)(value32_2&0x7ff);
|
||||
SFO_D=(s4Byte)(value32_3&0x7ff);
|
||||
|
||||
if(SFO_A >1023)
|
||||
{
|
||||
SFO_A=SFO_A-2048;
|
||||
}
|
||||
|
||||
if(SFO_B >2047)
|
||||
{
|
||||
SFO_B=SFO_B-4096;
|
||||
}
|
||||
|
||||
if(SFO_C >2047)
|
||||
{
|
||||
SFO_C=SFO_C-4096;
|
||||
}
|
||||
|
||||
if(SFO_D >2047)
|
||||
{
|
||||
SFO_D=SFO_D-4096;
|
||||
}
|
||||
|
||||
SFO_A=SFO_A*312500/1024;
|
||||
SFO_B=SFO_B*312500/1024;
|
||||
SFO_C=SFO_C*312500/1024;
|
||||
SFO_D=SFO_D*312500/1024;
|
||||
|
||||
LFO_A=(s4Byte)(value32>>16);
|
||||
LFO_B=(s4Byte)(value32_1>>16);
|
||||
LFO_C=(s4Byte)(value32_2>>16);
|
||||
LFO_D=(s4Byte)(value32_3>>16);
|
||||
|
||||
if(LFO_A >4095)
|
||||
{
|
||||
LFO_A=LFO_A-8192;
|
||||
}
|
||||
|
||||
if(LFO_B >4095)
|
||||
{
|
||||
LFO_B=LFO_B-8192;
|
||||
}
|
||||
|
||||
if(LFO_C>4095)
|
||||
{
|
||||
LFO_C=LFO_C-8192;
|
||||
}
|
||||
|
||||
if(LFO_D >4095)
|
||||
{
|
||||
LFO_D=LFO_D-8192;
|
||||
}
|
||||
LFO_A=LFO_A*312500/4096;
|
||||
LFO_B=LFO_B*312500/4096;
|
||||
LFO_C=LFO_C*312500/4096;
|
||||
LFO_D=LFO_D*312500/4096;
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " Value SCFO(Hz) <A/B/C/D>", SFO_A,SFO_B,SFO_C,SFO_D);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " ACQ CFO(Hz) <A/B/C/D>", LFO_A,LFO_B,LFO_C,LFO_D);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xd14 ,bMaskDWord);
|
||||
value32_1 = ODM_GetBBReg(pDM_Odm, 0xd54 ,bMaskDWord);
|
||||
value32_2 = ODM_GetBBReg(pDM_Odm, 0xd94 ,bMaskDWord);
|
||||
value32_3 = ODM_GetBBReg(pDM_Odm, 0xdd4 ,bMaskDWord);
|
||||
|
||||
LFO_A=(s4Byte)(value32>>16);
|
||||
LFO_B=(s4Byte)(value32_1>>16);
|
||||
LFO_C=(s4Byte)(value32_2>>16);
|
||||
LFO_D=(s4Byte)(value32_3>>16);
|
||||
|
||||
if(LFO_A >4095)
|
||||
{
|
||||
LFO_A=LFO_A-8192;
|
||||
}
|
||||
|
||||
if(LFO_B >4095)
|
||||
{
|
||||
LFO_B=LFO_B-8192;
|
||||
}
|
||||
|
||||
if(LFO_C>4095)
|
||||
{
|
||||
LFO_C=LFO_C-8192;
|
||||
}
|
||||
|
||||
if(LFO_D >4095)
|
||||
{
|
||||
LFO_D=LFO_D-8192;
|
||||
}
|
||||
LFO_A=LFO_A*312500/4096;
|
||||
LFO_B=LFO_B*312500/4096;
|
||||
LFO_C=LFO_C*312500/4096;
|
||||
LFO_D=LFO_D*312500/4096;
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %d / %d/ %d/ %d", " End CFO(Hz) <A/B/C/D>", LFO_A,LFO_B,LFO_C,LFO_D);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xf20 ,bMaskDWord); //L SIG
|
||||
|
||||
Tail=(u1Byte)((value32&0xfc0000)>>16);
|
||||
Parity = (u1Byte)((value32&0x20000)>>16);
|
||||
Length =(u2Byte)((value32&0x1ffe00)>>8);
|
||||
rsv = (u1Byte)(value32&0x10);
|
||||
MCSS=(u1Byte)(value32&0x0f);
|
||||
|
||||
switch(MCSS)
|
||||
{
|
||||
case 0x0b:
|
||||
idx=0;
|
||||
break;
|
||||
case 0x0f:
|
||||
idx=1;
|
||||
break;
|
||||
case 0x0a:
|
||||
idx=2;
|
||||
break;
|
||||
case 0x0e:
|
||||
idx=3;
|
||||
break;
|
||||
case 0x09:
|
||||
idx=4;
|
||||
break;
|
||||
case 0x08:
|
||||
idx=5;
|
||||
break;
|
||||
case 0x0c:
|
||||
idx=6;
|
||||
break;
|
||||
default:
|
||||
idx=6;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "L-SIG");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n Rate:%s", L_rate[idx]);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x/ %x /%x", " Rsv/Length/Parity",rsv,RX_BW,Length);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "HT-SIG1");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xf2c ,bMaskDWord); //HT SIG
|
||||
if(RX_HT == 1)
|
||||
{
|
||||
|
||||
HMCSS=(u1Byte)(value32&0x7F);
|
||||
HRX_BW = (u1Byte)(value32&0x80);
|
||||
HLength =(u2Byte)((value32>>8)&0xffff);
|
||||
}
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x", " MCS/BW/Length",HMCSS,HRX_BW,HLength);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "HT-SIG2");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xf30 ,bMaskDWord); //HT SIG
|
||||
|
||||
if(RX_HT == 1)
|
||||
{
|
||||
smooth = (u1Byte)(value32&0x01);
|
||||
htsound = (u1Byte)(value32&0x02);
|
||||
rsv=(u1Byte)(value32&0x04);
|
||||
agg =(u1Byte)(value32&0x08);
|
||||
stbc =(u1Byte)(value32&0x30);
|
||||
fec=(u1Byte)(value32&0x40);
|
||||
sgi=(u1Byte)(value32&0x80);
|
||||
htltf=(u1Byte)((value32&0x300)>>8);
|
||||
htcrc8=(u2Byte)((value32&0x3fc00)>>8);
|
||||
Tail=(u1Byte)((value32&0xfc0000)>>16);
|
||||
|
||||
|
||||
}
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x/ %x/ %x", " Smooth/NoSound/Rsv/Aggregate/STBC/LDPC",smooth,htsound,rsv,agg,stbc,fec);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x", " SGI/E-HT-LTFs/CRC/Tail",sgi,htltf,htcrc8,Tail);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "VHT-SIG-A1");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xf2c ,bMaskDWord); //VHT SIG A1
|
||||
if(RX_HT == 2)
|
||||
{
|
||||
//value32 = ODM_GetBBReg(pDM_Odm, 0xf2c ,bMaskDWord); //VHT SIG A1
|
||||
vRX_BW=(u1Byte)(value32&0x03);
|
||||
vrsv=(u1Byte)(value32&0x04);
|
||||
vstbc =(u1Byte)(value32&0x08);
|
||||
vgid = (u1Byte)((value32&0x3f0)>>4);
|
||||
vNsts = (u1Byte)(((value32&0x1c00)>>8)+1);
|
||||
vpaid = (u2Byte)(value32&0x3fe);
|
||||
vtxops =(u1Byte)((value32&0x400000)>>20);
|
||||
vrsv2 = (u1Byte)((value32&0x800000)>>20);
|
||||
}
|
||||
|
||||
//rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x", "F2C", value32);
|
||||
//DCMD_Printf(BbDbgBuf);
|
||||
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x/ %x/ %x /%x /%x", " BW/Rsv1/STBC/GID/Nsts/PAID/TXOPPS/Rsv2",vRX_BW,vrsv,vstbc,vgid,vNsts,vpaid,vtxops,vrsv2);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "VHT-SIG-A2");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xf30 ,bMaskDWord); //VHT SIG
|
||||
|
||||
|
||||
if(RX_HT == 2)
|
||||
{
|
||||
//value32 = ODM_GetBBReg(pDM_Odm, 0xf30 ,bMaskDWord); //VHT SIG
|
||||
|
||||
//sgi=(u1Byte)(value32&0x01);
|
||||
sgiext =(u1Byte)(value32&0x03);
|
||||
//fec = (u1Byte)(value32&0x04);
|
||||
fecext = (u1Byte)(value32&0x0C);
|
||||
|
||||
vMCSS =(u1Byte)(value32&0xf0);
|
||||
bf = (u1Byte)((value32&0x100)>>8);
|
||||
vrsv =(u1Byte)((value32&0x200)>>8);
|
||||
vhtcrc8=(u2Byte)((value32&0x3fc00)>>8);
|
||||
vTail=(u1Byte)((value32&0xfc0000)>>16);
|
||||
}
|
||||
//rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x", "F30", value32);
|
||||
//DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x/ %x/ %x/ %x", " SGI/FEC/MCS/BF/Rsv/CRC/Tail",sgiext,fecext,vMCSS,bf,vrsv,vhtcrc8,vTail);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "VHT-SIG-B");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
value32 = ODM_GetBBReg(pDM_Odm, 0xf34 ,bMaskDWord); //VHT SIG
|
||||
{
|
||||
vLength=(u2Byte)(value32&0x1fffff);
|
||||
vbrsv = (u1Byte)((value32&0x600000)>>20);
|
||||
vbTail =(u2Byte)((value32&0x1f800000)>>20);
|
||||
vbcrc = (u1Byte)((value32&0x80000000)>>28);
|
||||
|
||||
}
|
||||
//rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x", "F34", value32);
|
||||
//DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %x / %x/ %x/ %x/", " Length/Rsv/Tail/CRC",vLength,vbrsv,vbTail,vbcrc);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID phydm_BasicProfile(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
char* Cut = NULL;
|
||||
char* ICType = NULL;
|
||||
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n%-35s", "% Basic Profile %");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
if(pDM_Odm->SupportICType == ODM_RTL8192C)
|
||||
ICType = "RTL8192C";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8192D)
|
||||
ICType = "RTL8192D";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8723A)
|
||||
ICType = "RTL8723A";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8188E)
|
||||
ICType = "RTL8188E";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8812)
|
||||
ICType = "RTL8812A";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8821)
|
||||
ICType = "RTL8821A";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8192E)
|
||||
ICType = "RTL8192E";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8723B)
|
||||
ICType = "RTL8723B";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8814A)
|
||||
ICType = "RTL8814A";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8881A)
|
||||
ICType = "RTL8881A";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8821B)
|
||||
ICType = "RTL8821B";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8822B)
|
||||
ICType = "RTL8822B";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8703B)
|
||||
ICType = "RTL8703B";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8195A)
|
||||
ICType = "RTL8195A";
|
||||
else if(pDM_Odm->SupportICType == ODM_RTL8188F)
|
||||
ICType = "RTL8188F";
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s (MP Chip: %s)","IC Type", ICType, pDM_Odm->bIsMPChip?"Yes":"No");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
if(pDM_Odm->CutVersion==ODM_CUT_A)
|
||||
Cut = "A";
|
||||
else if(pDM_Odm->CutVersion==ODM_CUT_B)
|
||||
Cut = "B";
|
||||
else if(pDM_Odm->CutVersion==ODM_CUT_C)
|
||||
Cut = "C";
|
||||
else if(pDM_Odm->CutVersion==ODM_CUT_D)
|
||||
Cut = "D";
|
||||
else if(pDM_Odm->CutVersion==ODM_CUT_E)
|
||||
Cut = "E";
|
||||
else if(pDM_Odm->CutVersion==ODM_CUT_F)
|
||||
Cut = "F";
|
||||
else if(pDM_Odm->CutVersion==ODM_CUT_I)
|
||||
Cut = "I";
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Cut Version", Cut);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %d","PHY Parameter Version", ODM_GetHWImgVersion(pDM_Odm));
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %d (Subversion: %d)","FW Version", Adapter->MgntInfo.FirmwareVersion, Adapter->MgntInfo.FirmwareSubVersion);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
//1 PHY DM Version List
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n%-35s","% PHYDM Version %");
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Adaptivity", ADAPTIVITY_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","DIG", DIG_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Dynamic BB PowerSaving", DYNAMIC_BBPWRSAV_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","CFO Tracking", CFO_TRACKING_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Antenna Diversity", ANTDIV_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Power Tracking", POWRTRACKING_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Dynamic TxPower", DYNAMIC_TXPWR_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","RA Info", RAINFO_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Antenna Detection", ANTDECT_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Auto Channel Selection", ACS_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","EDCA Turbo", EDCATURBO_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","Path Diversity", PATHDIV_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
rsprintf(BbDbgBuf, BT_TMP_BUF_SIZE, "\r\n %-35s: %s","RxHP", RXHP_VERSION);
|
||||
DCMD_Printf(BbDbgBuf);
|
||||
|
||||
}
|
||||
#endif
|
||||
VOID
|
||||
phydm_BasicDbgMessage
|
||||
(
|
||||
IN PVOID pDM_VOID
|
||||
)
|
||||
{
|
||||
#if( DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
|
||||
PDM_ODM_T pDM_Odm = (PDM_ODM_T)pDM_VOID;
|
||||
PFALSE_ALARM_STATISTICS FalseAlmCnt = (PFALSE_ALARM_STATISTICS)PhyDM_Get_Structure( pDM_Odm , PHYDM_FALSEALMCNT);
|
||||
pDIG_T pDM_DigTable = &pDM_Odm->DM_DigTable;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("odm_BasicDbgMsg==>\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("bLinked = %d, RSSI_Min = %d, CurrentIGI = 0x%x \n",
|
||||
pDM_Odm->bLinked, pDM_Odm->RSSI_Min, pDM_DigTable->CurIGValue) );
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("Cnt_Cck_fail = %d, Cnt_Ofdm_fail = %d, Total False Alarm = %d\n",
|
||||
FalseAlmCnt->Cnt_Cck_fail, FalseAlmCnt->Cnt_Ofdm_fail, FalseAlmCnt->Cnt_all));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("RxRate = 0x%x, RSSI_A = %d, RSSI_B = %d\n",
|
||||
pDM_Odm->RxRate, pDM_Odm->RSSI_A, pDM_Odm->RSSI_B));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_COMMON, ODM_DBG_LOUD, ("RSSI_C = %d, RSSI_D = %d\n", pDM_Odm->RSSI_C, pDM_Odm->RSSI_D));
|
||||
#endif
|
||||
}
|
||||
|
||||
#if( DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
struct _PHYDM_COMMAND {
|
||||
char name[16];
|
||||
u1Byte id;
|
||||
};
|
||||
|
||||
enum PHYDM_CMD_ID {
|
||||
PHYDM_ANTDIV,
|
||||
};
|
||||
|
||||
struct _PHYDM_COMMAND phy_dm_ary[] = {
|
||||
{"antdiv", PHYDM_ANTDIV},
|
||||
};
|
||||
|
||||
s4Byte
|
||||
PhyDM_Cmd(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN char *input,
|
||||
IN u4Byte in_len,
|
||||
IN u1Byte flag,
|
||||
OUT char *output,
|
||||
IN u4Byte out_len
|
||||
)
|
||||
{
|
||||
u4Byte used = 0;
|
||||
|
||||
if (flag == 0) {
|
||||
if (out_len > used)
|
||||
used += snprintf(output+used, out_len-used, "GET, nothing to print\n");
|
||||
} else {
|
||||
char *token;
|
||||
u1Byte id = 0;
|
||||
int var = 0;
|
||||
|
||||
token = strsep(&input, ", ");
|
||||
if (token) {
|
||||
int n, i;
|
||||
n = sizeof(phy_dm_ary)/sizeof(struct _PHYDM_COMMAND);
|
||||
for (i = 0; i < n; i++) {
|
||||
if (strcmp(phy_dm_ary[i].name, token) == 0) {
|
||||
id = phy_dm_ary[i].id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == n) {
|
||||
if (out_len > used)
|
||||
used += snprintf(output+used, out_len-used, "SET, command not found!\n");
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
switch (id) {
|
||||
case PHYDM_ANTDIV:
|
||||
token = strsep(&input, ", ");
|
||||
sscanf(token, "%d", &var);
|
||||
if (out_len > used)
|
||||
used += snprintf(output+used, out_len-used, "SET, old antdiv_select=%d\n", pDM_Odm->antdiv_select);
|
||||
pDM_Odm->antdiv_select = var;
|
||||
if (out_len > used)
|
||||
used += snprintf(output+used, out_len-used, "SET, new antdiv_select=%d\n", pDM_Odm->antdiv_select);
|
||||
break;
|
||||
|
||||
default:
|
||||
if (out_len > used)
|
||||
used += snprintf(output+used, out_len-used, "SET, unknown command!\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
exit:
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
@ -1,296 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __ODM_PRECOMP_H__
|
||||
#define __ODM_PRECOMP_H__
|
||||
|
||||
#include "phydm_types.h"
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
#include "Precomp.h" // We need to include mp_precomp.h due to batch file setting.
|
||||
|
||||
#else
|
||||
|
||||
#define TEST_FALG___ 1
|
||||
|
||||
#endif
|
||||
|
||||
//2 Config Flags and Structs - defined by each ODM Type
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
#include "../8192cd_cfg.h"
|
||||
#include "../odm_inc.h"
|
||||
|
||||
#include "../8192cd.h"
|
||||
#include "../8192cd_util.h"
|
||||
#ifdef _BIG_ENDIAN_
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
|
||||
#else
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
#ifdef AP_BUILD_WORKAROUND
|
||||
#include "../8192cd_headers.h"
|
||||
#include "../8192cd_debug.h"
|
||||
#endif
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
|
||||
// Flags
|
||||
#include "../8192cd_cfg.h" // OUTSRC needs ADSL config flags.
|
||||
#include "../odm_inc.h" // OUTSRC needs some extra flags.
|
||||
// Data Structure
|
||||
#include "../common_types.h" // OUTSRC and rtl8192cd both needs basic type such as UINT8 and BIT0.
|
||||
#include "../8192cd.h" // OUTSRC needs basic ADSL struct definition.
|
||||
#include "../8192cd_util.h" // OUTSRC needs basic I/O function.
|
||||
#ifdef _BIG_ENDIAN_
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
|
||||
#else
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
#ifdef ADSL_AP_BUILD_WORKAROUND
|
||||
// NESTED_INC: Functions defined outside should not be included!! Marked by Annie, 2011-10-14.
|
||||
#include "../8192cd_headers.h"
|
||||
#include "../8192cd_debug.h"
|
||||
#endif
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE ==ODM_CE)
|
||||
//#include <drv_conf.h>
|
||||
//#include <basic_types.h>
|
||||
//#include <osdep_service.h>
|
||||
//#include <drv_types.h>
|
||||
//#include <rtw_byteorder.h>
|
||||
//#include <hal_intf.h>
|
||||
#define BEAMFORMING_SUPPORT 0
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
#include "Mp_Precomp.h"
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
||||
#endif
|
||||
|
||||
|
||||
//2 Hardware Parameter Files
|
||||
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
#if (RTL8192C_SUPPORT==1)
|
||||
#include "rtl8192c/Hal8192CEFWImg_AP.h"
|
||||
#include "rtl8192c/Hal8192CEPHYImg_AP.h"
|
||||
#include "rtl8192c/Hal8192CEMACImg_AP.h"
|
||||
#endif
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
|
||||
#include "rtl8192c/Hal8192CEFWImg_ADSL.h"
|
||||
#include "rtl8192c/Hal8192CEPHYImg_ADSL.h"
|
||||
#include "rtl8192c/Hal8192CEMACImg_ADSL.h"
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
#if(RTL8192CE_SUPPORT ==1)
|
||||
#include "rtl8192c/Hal8192CEFWImg_CE.h"
|
||||
#include "rtl8192c/Hal8192CEPHYImg_CE.h"
|
||||
#include "rtl8192c/Hal8192CEMACImg_CE.h"
|
||||
#endif
|
||||
|
||||
#if(RTL8192CU_SUPPORT ==1)
|
||||
#include "rtl8192c/Hal8192CUFWImg_CE.h"
|
||||
#include "rtl8192c/Hal8192CUPHYImg_CE.h"
|
||||
#include "rtl8192c/Hal8192CUMACImg_CE.h"
|
||||
#endif
|
||||
|
||||
#if(RTL8192DE_SUPPORT ==1)
|
||||
#include "rtl8192d/Hal8192DEFWImg_CE.h"
|
||||
#include "rtl8192d/Hal8192DEPHYImg_CE.h"
|
||||
#include "rtl8192d/Hal8192DEMACImg_CE.h"
|
||||
#endif
|
||||
|
||||
#if(RTL8192DU_SUPPORT ==1)
|
||||
#include "rtl8192d/Hal8192DUFWImg_CE.h"
|
||||
#include "rtl8192d/Hal8192DUPHYImg_CE.h"
|
||||
#include "rtl8192d/Hal8192DUMACImg_CE.h"
|
||||
#endif
|
||||
|
||||
#if(RTL8723AS_SUPPORT==1)
|
||||
#include "rtl8723a/Hal8723SHWImg_CE.h"
|
||||
#endif
|
||||
|
||||
#if(RTL8723AU_SUPPORT==1)
|
||||
#include "rtl8723a/Hal8723UHWImg_CE.h"
|
||||
#endif
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
//2 OutSrc Header Files
|
||||
#include "phydm.h"
|
||||
#include "phydm_HWConfig.h"
|
||||
#include "phydm_debug.h"
|
||||
#include "phydm_RegDefine11AC.h"
|
||||
#include "phydm_RegDefine11N.h"
|
||||
#include "phydm_AntDiv.h"
|
||||
#include "phydm_interface.h"
|
||||
#include "phydm_reg.h"
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
#if (RTL8192C_SUPPORT==1)
|
||||
#include "rtl8192c/HalDMOutSrc8192C_AP.h"
|
||||
#endif
|
||||
#if (RTL8188E_SUPPORT==1)
|
||||
#include "rtl8188e/Hal8188ERateAdaptive.h"//for RA,Power training
|
||||
#endif
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
|
||||
#include "rtl8192c/HalDMOutSrc8192C_ADSL.h"
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
//#include "hal_com.h"
|
||||
#include "HalPhyRf.h"
|
||||
#if (RTL8192C_SUPPORT==1)
|
||||
#ifdef CONFIG_INTEL_PROXIM
|
||||
#include "../proxim/intel_proxim.h"
|
||||
#endif
|
||||
#include "rtl8192c/HalDMOutSrc8192C_CE.h"
|
||||
#include <rtl8192c_hal.h>
|
||||
#endif
|
||||
|
||||
#if (RTL8192D_SUPPORT==1)
|
||||
#include "rtl8192d/HalDMOutSrc8192D_CE.h"
|
||||
#include "rtl8192d_hal.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8723A_SUPPORT==1)
|
||||
#include "rtl8192c/HalDMOutSrc8192C_CE.h" //for IQK,LCK,Power-tracking
|
||||
#include "rtl8723a_hal.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8188E_SUPPORT==1)
|
||||
#include "rtl8188e/HalPhyRf_8188e.h"//for IQK,LCK,Power-tracking
|
||||
#include "rtl8188e/Hal8188ERateAdaptive.h"//for RA,Power training
|
||||
#include "rtl8188e_hal.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8192E_SUPPORT==1)
|
||||
#include "rtl8192e/HalPhyRf_8192e.h"//for IQK,LCK,Power-tracking
|
||||
#include "rtl8192e_hal.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8812A_SUPPORT==1)
|
||||
#include "rtl8812a/HalPhyRf_8812A.h"//for IQK,LCK,Power-tracking
|
||||
#include "rtl8812a_hal.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8821A_SUPPORT==1)
|
||||
#include "rtl8821a/HalPhyRf_8821A.h"//for IQK,LCK,Power-tracking
|
||||
#include "rtl8812a/HalPhyRf_8812A.h"//for IQK,LCK,Power-tracking
|
||||
#include "rtl8812a_hal.h"
|
||||
#include "rtl8821a/PhyDM_IQK_8821A.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8723B_SUPPORT==1)
|
||||
#include "rtl8723b/HalPhyRf_8723B.h"//for IQK,LCK,Power-tracking
|
||||
#include "rtl8723b_hal.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if (RTL8192C_SUPPORT==1)
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
#include "rtl8192c/Hal8192CHWImg_MAC.h"
|
||||
#include "rtl8192c/Hal8192CHWImg_RF.h"
|
||||
#include "rtl8192c/Hal8192CHWImg_BB.h"
|
||||
#include "rtl8192c/Hal8192CHWImg_FW.h"
|
||||
#endif
|
||||
#include "rtl8192c/phydm_RTL8192C.h"
|
||||
#endif
|
||||
#if (RTL8192D_SUPPORT==1)
|
||||
#include "rtl8192d/phydm_RTL8192D.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8723A_SUPPORT==1)
|
||||
#include "rtl8723a/HalHWImg8723A_MAC.h"
|
||||
#include "rtl8723a/HalHWImg8723A_RF.h"
|
||||
#include "rtl8723a/HalHWImg8723A_BB.h"
|
||||
#include "rtl8723a/HalHWImg8723A_FW.h"
|
||||
#include "rtl8723a/phydm_RegConfig8723A.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8188E_SUPPORT==1)
|
||||
#include "rtl8188e/HalHWImg8188E_MAC.h"
|
||||
#include "rtl8188e/HalHWImg8188E_RF.h"
|
||||
#include "rtl8188e/HalHWImg8188E_BB.h"
|
||||
#include "rtl8188e/HalHWImg8188E_FW.h"
|
||||
#include "rtl8188e/Hal8188EReg.h"
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
#include "rtl8188e/HalPhyRf_8188e.h"
|
||||
#endif
|
||||
|
||||
#if (TESTCHIP_SUPPORT == 1)
|
||||
#include "rtl8188e/HalHWImg8188E_TestChip_MAC.h"
|
||||
#include "rtl8188e/HalHWImg8188E_TestChip_RF.h"
|
||||
#include "rtl8188e/HalHWImg8188E_TestChip_BB.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "rtl8188e/phydm_RegConfig8188E.h"
|
||||
#include "rtl8188e/phydm_RTL8188E.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8192E_SUPPORT==1)
|
||||
#include "rtl8192e/HalHWImg8192E_MAC.h"
|
||||
#include "rtl8192e/HalHWImg8192E_RF.h"
|
||||
#include "rtl8192e/HalHWImg8192E_BB.h"
|
||||
#include "rtl8192e/HalHWImg8192E_FW.h"
|
||||
#include "rtl8192e/Hal8192EReg.h"
|
||||
#include "rtl8192e/phydm_RegConfig8192E.h"
|
||||
#include "rtl8192e/phydm_RTL8192E.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8723B_SUPPORT==1)
|
||||
#include "rtl8723b/HalHWImg8723B_MAC.h"
|
||||
#include "rtl8723b/HalHWImg8723B_RF.h"
|
||||
#include "rtl8723b/HalHWImg8723B_BB.h"
|
||||
#include "rtl8723b/HalHWImg8723B_FW.h"
|
||||
#include "rtl8723b/HalHWImg8723B_MP.h"
|
||||
#include "rtl8723b/Hal8723BReg.h"
|
||||
#include "rtl8723b/phydm_RTL8723B.h"
|
||||
#include "rtl8723b/phydm_RegConfig8723B.h"
|
||||
#endif
|
||||
|
||||
#if (RTL8812A_SUPPORT==1)
|
||||
#include "rtl8812a/HalHWImg8812A_MAC.h"
|
||||
#include "rtl8812a/HalHWImg8812A_RF.h"
|
||||
#include "rtl8812a/HalHWImg8812A_BB.h"
|
||||
#include "rtl8812a/HalHWImg8812A_FW.h"
|
||||
#include "rtl8812a/phydm_RegConfig8812A.h"
|
||||
#include "rtl8812a/phydm_RTL8812A.h"
|
||||
#endif
|
||||
|
||||
|
||||
#if (RTL8821A_SUPPORT==1)
|
||||
#include "rtl8821a/HalHWImg8821A_MAC.h"
|
||||
#include "rtl8821a/HalHWImg8821A_RF.h"
|
||||
#include "rtl8821a/HalHWImg8821A_BB.h"
|
||||
#include "rtl8821a/HalHWImg8821A_FW.h"
|
||||
#include "rtl8821a/phydm_RegConfig8821A.h"
|
||||
#include "rtl8821a/phydm_RTL8821A.h"
|
||||
#endif
|
||||
|
||||
#endif // __ODM_PRECOMP_H__
|
||||
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,287 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include "Mp_Precomp.h"
|
||||
#include "../phydm_precomp.h"
|
||||
|
||||
#if (RTL8188E_SUPPORT == 1)
|
||||
static BOOLEAN
|
||||
CheckPositive(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN const u4Byte Condition1,
|
||||
IN const u4Byte Condition2
|
||||
)
|
||||
{
|
||||
u1Byte _BoardType = ((pDM_Odm->BoardType & BIT4) >> 4) << 0 | // _GLNA
|
||||
((pDM_Odm->BoardType & BIT3) >> 3) << 1 | // _GPA
|
||||
((pDM_Odm->BoardType & BIT7) >> 7) << 2 | // _ALNA
|
||||
((pDM_Odm->BoardType & BIT6) >> 6) << 3 | // _APA
|
||||
((pDM_Odm->BoardType & BIT2) >> 2) << 4; // _BT
|
||||
|
||||
u4Byte cond1 = Condition1, cond2 = Condition2;
|
||||
u4Byte driver1 = pDM_Odm->CutVersion << 24 |
|
||||
pDM_Odm->SupportPlatform << 16 |
|
||||
pDM_Odm->PackageType << 12 |
|
||||
pDM_Odm->SupportInterface << 8 |
|
||||
_BoardType;
|
||||
|
||||
u4Byte driver2 = pDM_Odm->TypeGLNA << 0 |
|
||||
pDM_Odm->TypeGPA << 8 |
|
||||
pDM_Odm->TypeALNA << 16 |
|
||||
pDM_Odm->TypeAPA << 24;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE,
|
||||
("===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", cond1, cond2));
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE,
|
||||
("===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", driver1, driver2));
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE,
|
||||
(" (Platform, Interface) = (0x%X, 0x%X)\n", pDM_Odm->SupportPlatform, pDM_Odm->SupportInterface));
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE,
|
||||
(" (Board, Package) = (0x%X, 0x%X)\n", pDM_Odm->BoardType, pDM_Odm->PackageType));
|
||||
|
||||
|
||||
//============== Value Defined Check ===============//
|
||||
//QFN Type [15:12] and Cut Version [27:24] need to do value check
|
||||
|
||||
if(((cond1 & 0x0000F000) != 0) &&((cond1 & 0x0000F000) != (driver1 & 0x0000F000)))
|
||||
return FALSE;
|
||||
if(((cond1 & 0x0F000000) != 0) &&((cond1 & 0x0F000000) != (driver1 & 0x0F000000)))
|
||||
return FALSE;
|
||||
|
||||
//=============== Bit Defined Check ================//
|
||||
// We don't care [31:28] and [23:20]
|
||||
//
|
||||
cond1 &= 0x000F0FFF;
|
||||
driver1 &= 0x000F0FFF;
|
||||
|
||||
if ((cond1 & driver1) == cond1)
|
||||
{
|
||||
u4Byte bitMask = 0;
|
||||
if ((cond1 & 0x0F) == 0) // BoardType is DONTCARE
|
||||
return TRUE;
|
||||
|
||||
if ((cond1 & BIT0) != 0) //GLNA
|
||||
bitMask |= 0x000000FF;
|
||||
if ((cond1 & BIT1) != 0) //GPA
|
||||
bitMask |= 0x0000FF00;
|
||||
if ((cond1 & BIT2) != 0) //ALNA
|
||||
bitMask |= 0x00FF0000;
|
||||
if ((cond1 & BIT3) != 0) //APA
|
||||
bitMask |= 0xFF000000;
|
||||
|
||||
if ((cond2 & bitMask) == (driver2 & bitMask)) // BoardType of each RF path is matched
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
static BOOLEAN
|
||||
CheckNegative(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN const u4Byte Condition1,
|
||||
IN const u4Byte Condition2
|
||||
)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* MAC_REG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_MP_8188E_MAC_REG[] = {
|
||||
0x026, 0x00000041,
|
||||
0x027, 0x00000035,
|
||||
0x80000003,0x00000000,0x40000000,0x00000000,
|
||||
0x040, 0x0000000C,
|
||||
0x90000001,0x00000000,0x40000000,0x00000000,
|
||||
0x040, 0x0000000C,
|
||||
0xA0000000,0x00000000,
|
||||
0x040, 0x00000000,
|
||||
0xB0000000,0x00000000,
|
||||
0x428, 0x0000000A,
|
||||
0x429, 0x00000010,
|
||||
0x430, 0x00000000,
|
||||
0x431, 0x00000001,
|
||||
0x432, 0x00000002,
|
||||
0x433, 0x00000004,
|
||||
0x434, 0x00000005,
|
||||
0x435, 0x00000006,
|
||||
0x436, 0x00000007,
|
||||
0x437, 0x00000008,
|
||||
0x438, 0x00000000,
|
||||
0x439, 0x00000000,
|
||||
0x43A, 0x00000001,
|
||||
0x43B, 0x00000002,
|
||||
0x43C, 0x00000004,
|
||||
0x43D, 0x00000005,
|
||||
0x43E, 0x00000006,
|
||||
0x43F, 0x00000007,
|
||||
0x440, 0x0000005D,
|
||||
0x441, 0x00000001,
|
||||
0x442, 0x00000000,
|
||||
0x444, 0x00000015,
|
||||
0x445, 0x000000F0,
|
||||
0x446, 0x0000000F,
|
||||
0x447, 0x00000000,
|
||||
0x458, 0x00000041,
|
||||
0x459, 0x000000A8,
|
||||
0x45A, 0x00000072,
|
||||
0x45B, 0x000000B9,
|
||||
0x460, 0x00000066,
|
||||
0x461, 0x00000066,
|
||||
0x480, 0x00000008,
|
||||
0x4C8, 0x000000FF,
|
||||
0x4C9, 0x00000008,
|
||||
0x4CC, 0x000000FF,
|
||||
0x4CD, 0x000000FF,
|
||||
0x4CE, 0x00000001,
|
||||
0x4D3, 0x00000001,
|
||||
0x500, 0x00000026,
|
||||
0x501, 0x000000A2,
|
||||
0x502, 0x0000002F,
|
||||
0x503, 0x00000000,
|
||||
0x504, 0x00000028,
|
||||
0x505, 0x000000A3,
|
||||
0x506, 0x0000005E,
|
||||
0x507, 0x00000000,
|
||||
0x508, 0x0000002B,
|
||||
0x509, 0x000000A4,
|
||||
0x50A, 0x0000005E,
|
||||
0x50B, 0x00000000,
|
||||
0x50C, 0x0000004F,
|
||||
0x50D, 0x000000A4,
|
||||
0x50E, 0x00000000,
|
||||
0x50F, 0x00000000,
|
||||
0x512, 0x0000001C,
|
||||
0x514, 0x0000000A,
|
||||
0x516, 0x0000000A,
|
||||
0x525, 0x0000004F,
|
||||
0x550, 0x00000010,
|
||||
0x551, 0x00000010,
|
||||
0x559, 0x00000002,
|
||||
0x55D, 0x000000FF,
|
||||
0x605, 0x00000030,
|
||||
0x608, 0x0000000E,
|
||||
0x609, 0x0000002A,
|
||||
0x620, 0x000000FF,
|
||||
0x621, 0x000000FF,
|
||||
0x622, 0x000000FF,
|
||||
0x623, 0x000000FF,
|
||||
0x624, 0x000000FF,
|
||||
0x625, 0x000000FF,
|
||||
0x626, 0x000000FF,
|
||||
0x627, 0x000000FF,
|
||||
0x652, 0x00000020,
|
||||
0x63C, 0x0000000A,
|
||||
0x63D, 0x0000000A,
|
||||
0x63E, 0x0000000E,
|
||||
0x63F, 0x0000000E,
|
||||
0x640, 0x00000040,
|
||||
0x66E, 0x00000005,
|
||||
0x700, 0x00000021,
|
||||
0x701, 0x00000043,
|
||||
0x702, 0x00000065,
|
||||
0x703, 0x00000087,
|
||||
0x708, 0x00000021,
|
||||
0x709, 0x00000043,
|
||||
0x70A, 0x00000065,
|
||||
0x70B, 0x00000087,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8188E_MAC_REG(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
u4Byte i = 0;
|
||||
u1Byte cCond;
|
||||
BOOLEAN bMatched = TRUE, bSkipped = FALSE;
|
||||
//ask by Luke.Lee
|
||||
u4Byte ArrayLen = sizeof(Array_MP_8188E_MAC_REG)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_MP_8188E_MAC_REG;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ReadAndConfig_MP_8188E_MAC_REG\n"));
|
||||
|
||||
while(( i+1) < ArrayLen)
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
if(v1 & (BIT31|BIT30)) //positive & negative condition
|
||||
{
|
||||
if(v1 & BIT31) // positive condition
|
||||
{
|
||||
cCond = (u1Byte)((v1 & (BIT29|BIT28)) >> 28);
|
||||
if(cCond == COND_ENDIF) //end
|
||||
{
|
||||
bMatched = TRUE;
|
||||
bSkipped = FALSE;
|
||||
}
|
||||
else if(cCond == COND_ELSE) //else
|
||||
{
|
||||
bMatched = bSkipped?FALSE:TRUE;
|
||||
}
|
||||
else //if , else if
|
||||
{
|
||||
if(bSkipped)
|
||||
bMatched = FALSE;
|
||||
else
|
||||
{
|
||||
if(CheckPositive(pDM_Odm, v1, v2))
|
||||
{
|
||||
bMatched = TRUE;
|
||||
bSkipped = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
bMatched = FALSE;
|
||||
bSkipped = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(v1 & BIT30){ //negative condition
|
||||
//do nothing
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(bMatched)
|
||||
odm_ConfigMAC_8188E(pDM_Odm, v1, (u1Byte)v2);
|
||||
}
|
||||
i = i + 2;
|
||||
}
|
||||
}
|
||||
|
||||
u4Byte
|
||||
ODM_GetVersion_MP_8188E_MAC_REG(void)
|
||||
{
|
||||
return 53;
|
||||
}
|
||||
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,78 +0,0 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#if (RTL8188E_SUPPORT == 1)
|
||||
#ifndef __INC_MP_RF_HW_IMG_8188E_H
|
||||
#define __INC_MP_RF_HW_IMG_8188E_H
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* RadioA.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8188E_RadioA( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
u4Byte ODM_GetVersion_MP_8188E_RadioA(void);
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_AP.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8188E_TxPowerTrack_AP( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
u4Byte ODM_GetVersion_MP_8188E_TxPowerTrack_AP(void);
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_PCIE.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8188E_TxPowerTrack_PCIE( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
u4Byte ODM_GetVersion_MP_8188E_TxPowerTrack_PCIE(void);
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_USB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8188E_TxPowerTrack_USB( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
u4Byte ODM_GetVersion_MP_8188E_TxPowerTrack_USB(void);
|
||||
|
||||
/******************************************************************************
|
||||
* TXPWR_LMT.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8188E_TXPWR_LMT( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
u4Byte ODM_GetVersion_MP_8188E_TXPWR_LMT(void);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
||||
|
|
@ -11,6 +11,11 @@
|
|||
// include files
|
||||
//============================================================
|
||||
#include "Mp_Precomp.h"
|
||||
|
||||
#if WPP_SOFTWARE_TRACE
|
||||
#include "HalBtc8188c2Ant.tmh"
|
||||
#endif
|
||||
|
||||
#if(BT_30_SUPPORT == 1)
|
||||
//============================================================
|
||||
// Global variables, these are static variables
|
||||
|
|
@ -45,12 +50,10 @@ halbtc8188c2ant_WifiRssiState(
|
|||
if(wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8188C_2ANT))
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_HIGH;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_LOW;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -58,12 +61,10 @@ halbtc8188c2ant_WifiRssiState(
|
|||
if(wifiRssi < rssiThresh)
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_LOW;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_HIGH;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -71,7 +72,7 @@ halbtc8188c2ant_WifiRssiState(
|
|||
{
|
||||
if(rssiThresh > rssiThresh1)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI thresh error!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], wifi RSSI thresh error!!\n"));
|
||||
return pCoexSta->preWifiRssiState[index];
|
||||
}
|
||||
|
||||
|
|
@ -81,12 +82,10 @@ halbtc8188c2ant_WifiRssiState(
|
|||
if(wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8188C_2ANT))
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_MEDIUM;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_LOW;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n"));
|
||||
}
|
||||
}
|
||||
else if( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_MEDIUM) ||
|
||||
|
|
@ -95,17 +94,14 @@ halbtc8188c2ant_WifiRssiState(
|
|||
if(wifiRssi >= (rssiThresh1+BTC_RSSI_COEX_THRESH_TOL_8188C_2ANT))
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_HIGH;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n"));
|
||||
}
|
||||
else if(wifiRssi < rssiThresh)
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_LOW;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_MEDIUM;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Medium\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -113,12 +109,10 @@ halbtc8188c2ant_WifiRssiState(
|
|||
if(wifiRssi < rssiThresh1)
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_MEDIUM;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_HIGH;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -139,7 +133,7 @@ halbtc8188c2ant_ActionAlgorithm(
|
|||
|
||||
if(!pStackInfo->bBtLinkExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], No profile exists!!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], No profile exists!!!\n"));
|
||||
return algorithm;
|
||||
}
|
||||
|
||||
|
|
@ -154,7 +148,7 @@ halbtc8188c2ant_ActionAlgorithm(
|
|||
|
||||
if(pStackInfo->bScoExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO algorithm\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO algorithm\n"));
|
||||
algorithm = BT_8188C_2ANT_COEX_ALGO_SCO;
|
||||
}
|
||||
else
|
||||
|
|
@ -163,17 +157,17 @@ halbtc8188c2ant_ActionAlgorithm(
|
|||
{
|
||||
if(pStackInfo->bHidExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID only\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID only\n"));
|
||||
algorithm = BT_8188C_2ANT_COEX_ALGO_HID;
|
||||
}
|
||||
else if(pStackInfo->bA2dpExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP only\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], A2DP only\n"));
|
||||
algorithm = BT_8188C_2ANT_COEX_ALGO_A2DP;
|
||||
}
|
||||
else if(pStackInfo->bPanExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN only\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], PAN only\n"));
|
||||
algorithm = BT_8188C_2ANT_COEX_ALGO_PAN;
|
||||
}
|
||||
}
|
||||
|
|
@ -182,19 +176,19 @@ halbtc8188c2ant_ActionAlgorithm(
|
|||
if( pStackInfo->bHidExist &&
|
||||
pStackInfo->bA2dpExist )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + A2DP\n"));
|
||||
algorithm = BT_8188C_2ANT_COEX_ALGO_HID_A2DP;
|
||||
}
|
||||
else if( pStackInfo->bHidExist &&
|
||||
pStackInfo->bPanExist )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + PAN\n"));
|
||||
algorithm = BT_8188C_2ANT_COEX_ALGO_HID_PAN;
|
||||
}
|
||||
else if( pStackInfo->bPanExist &&
|
||||
pStackInfo->bA2dpExist )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN + A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], PAN + A2DP\n"));
|
||||
algorithm = BT_8188C_2ANT_COEX_ALGO_PAN_A2DP;
|
||||
}
|
||||
}
|
||||
|
|
@ -225,7 +219,7 @@ halbtc8188c2ant_SetFwBalance(
|
|||
H2C_Parameter[0] = 0;
|
||||
}
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Balance=[%s:%dms:%dms], write 0xc=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Balance=[%s:%dms:%dms], write 0xc=0x%x\n",
|
||||
bBalanceOn?"ON":"OFF", ms0, ms1,
|
||||
H2C_Parameter[0]<<16|H2C_Parameter[1]<<8|H2C_Parameter[2]));
|
||||
|
||||
|
|
@ -241,15 +235,12 @@ halbtc8188c2ant_Balance(
|
|||
IN u1Byte ms1
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn Balance %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn Balance %s\n",
|
||||
(bForceExec? "force to":""), (bBalanceOn? "ON":"OFF")));
|
||||
pCoexDm->bCurBalanceOn = bBalanceOn;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreBalanceOn = %d, bCurBalanceOn = %d!!\n",
|
||||
pCoexDm->bPreBalanceOn, pCoexDm->bCurBalanceOn));
|
||||
|
||||
if(pCoexDm->bPreBalanceOn == pCoexDm->bCurBalanceOn)
|
||||
return;
|
||||
}
|
||||
|
|
@ -271,7 +262,7 @@ halbtc8188c2ant_SetFwDiminishWifi(
|
|||
|
||||
if((pBtCoexist->stackInfo.minBtRssi <= -5) && (fwDacSwingLvl == 0x20))
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], DiminishWiFi 0x20 original, but set 0x18 for Low RSSI!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], DiminishWiFi 0x20 original, but set 0x18 for Low RSSI!\n"));
|
||||
fwDacSwingLvl = 0x18;
|
||||
}
|
||||
|
||||
|
|
@ -291,7 +282,7 @@ halbtc8188c2ant_SetFwDiminishWifi(
|
|||
H2C_Parameter[2] |= 0x08; //BIT3
|
||||
}
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], bDacOn=%s, bInterruptOn=%s, bNavOn=%s, write 0xe=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], bDacOn=%s, bInterruptOn=%s, bNavOn=%s, write 0xe=0x%x\n",
|
||||
(bDacOn?"ON":"OFF"), (bInterruptOn?"ON":"OFF"), (bNavOn?"ON":"OFF"),
|
||||
(H2C_Parameter[0]<<16|H2C_Parameter[1]<<8|H2C_Parameter[2])));
|
||||
pBtCoexist->fBtcFillH2c(pBtCoexist, 0xe, 3, H2C_Parameter);
|
||||
|
|
@ -307,7 +298,7 @@ halbtc8188c2ant_DiminishWifi(
|
|||
IN BOOLEAN bNavOn
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s set Diminish Wifi, bDacOn=%s, bInterruptOn=%s, fwDacSwingLvl=%d, bNavOn=%s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s set Diminish Wifi, bDacOn=%s, bInterruptOn=%s, fwDacSwingLvl=%d, bNavOn=%s\n",
|
||||
(bForceExec? "force to":""), (bDacOn? "ON":"OFF"), (bInterruptOn? "ON":"OFF"), fwDacSwingLvl, (bNavOn? "ON":"OFF")));
|
||||
|
||||
pCoexDm->bCurDacOn = bDacOn;
|
||||
|
|
@ -317,16 +308,6 @@ halbtc8188c2ant_DiminishWifi(
|
|||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreDacOn=%d, bCurDacOn=%d!!\n",
|
||||
pCoexDm->bPreDacOn, pCoexDm->bCurDacOn));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreInterruptOn=%d, bCurInterruptOn=%d!!\n",
|
||||
pCoexDm->bPreInterruptOn, pCoexDm->bCurInterruptOn));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], preFwDacSwingLvl=%d, curFwDacSwingLvl=%d!!\n",
|
||||
pCoexDm->preFwDacSwingLvl, pCoexDm->curFwDacSwingLvl));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreNavOn=%d, bCurNavOn=%d!!\n",
|
||||
pCoexDm->bPreNavOn, pCoexDm->bCurNavOn));
|
||||
|
||||
|
||||
if( (pCoexDm->bPreDacOn==pCoexDm->bCurDacOn) &&
|
||||
(pCoexDm->bPreInterruptOn==pCoexDm->bCurInterruptOn) &&
|
||||
(pCoexDm->preFwDacSwingLvl==pCoexDm->curFwDacSwingLvl) &&
|
||||
|
|
@ -350,7 +331,7 @@ halbtc8188c2ant_SetSwRfRxLpfCorner(
|
|||
if(bRxRfShrinkOn)
|
||||
{
|
||||
//Shrink RF Rx LPF corner
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Shrink RF Rx LPF corner!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Shrink RF Rx LPF corner!!\n"));
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xf0, 0xf);
|
||||
}
|
||||
else
|
||||
|
|
@ -359,7 +340,7 @@ halbtc8188c2ant_SetSwRfRxLpfCorner(
|
|||
// After initialized, we can use pCoexDm->btRf0x1eBackup
|
||||
if(pBtCoexist->bInitilized)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Resume RF Rx LPF corner!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Resume RF Rx LPF corner!!\n"));
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xf0, pCoexDm->btRf0x1eBackup);
|
||||
}
|
||||
}
|
||||
|
|
@ -372,15 +353,12 @@ halbtc8188c2ant_RfShrink(
|
|||
IN BOOLEAN bRxRfShrinkOn
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn Rx RF Shrink = %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn Rx RF Shrink = %s\n",
|
||||
(bForceExec? "force to":""), ((bRxRfShrinkOn)? "ON":"OFF")));
|
||||
pCoexDm->bCurRfRxLpfShrink = bRxRfShrinkOn;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreRfRxLpfShrink=%d, bCurRfRxLpfShrink=%d\n",
|
||||
pCoexDm->bPreRfRxLpfShrink, pCoexDm->bCurRfRxLpfShrink));
|
||||
|
||||
if(pCoexDm->bPreRfRxLpfShrink == pCoexDm->bCurRfRxLpfShrink)
|
||||
return;
|
||||
}
|
||||
|
|
@ -400,12 +378,12 @@ halbtc8188c2ant_SetSwPenaltyTxRateAdaptive(
|
|||
tmpU1 = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x4fd);
|
||||
if(bLowPenaltyRa)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Tx rate adaptive, set low penalty!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Tx rate adaptive, set low penalty!!\n"));
|
||||
tmpU1 &= ~BIT2;
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Tx rate adaptive, set normal!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Tx rate adaptive, set normal!!\n"));
|
||||
tmpU1 |= BIT2;
|
||||
}
|
||||
pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x4fd, tmpU1);
|
||||
|
|
@ -418,15 +396,12 @@ halbtc8188c2ant_LowPenaltyRa(
|
|||
IN BOOLEAN bLowPenaltyRa
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn LowPenaltyRA = %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn LowPenaltyRA = %s\n",
|
||||
(bForceExec? "force to":""), ((bLowPenaltyRa)? "ON":"OFF")));
|
||||
pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreLowPenaltyRa=%d, bCurLowPenaltyRa=%d\n",
|
||||
pCoexDm->bPreLowPenaltyRa, pCoexDm->bCurLowPenaltyRa));
|
||||
|
||||
if(pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa)
|
||||
return;
|
||||
}
|
||||
|
|
@ -470,17 +445,13 @@ halbtc8188c2ant_DacSwing(
|
|||
IN u4Byte dacSwingLvl
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn DacSwing=%s, dacSwingLvl=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn DacSwing=%s, dacSwingLvl=0x%x\n",
|
||||
(bForceExec? "force to":""), ((bDacSwingOn)? "ON":"OFF"), dacSwingLvl));
|
||||
pCoexDm->bCurDacSwingOn = bDacSwingOn;
|
||||
pCoexDm->curDacSwingLvl = dacSwingLvl;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreDacSwingOn=%d, preDacSwingLvl=0x%x, bCurDacSwingOn=%d, curDacSwingLvl=0x%x\n",
|
||||
pCoexDm->bPreDacSwingOn, pCoexDm->preDacSwingLvl,
|
||||
pCoexDm->bCurDacSwingOn, pCoexDm->curDacSwingLvl));
|
||||
|
||||
if( (pCoexDm->bPreDacSwingOn == pCoexDm->bCurDacSwingOn) &&
|
||||
(pCoexDm->preDacSwingLvl == pCoexDm->curDacSwingLvl) )
|
||||
return;
|
||||
|
|
@ -500,12 +471,12 @@ halbtc8188c2ant_SetAdcBackOff(
|
|||
{
|
||||
if(bAdcBackOff)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB BackOff Level On!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BB BackOff Level On!\n"));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc04,0x3a07611);
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB BackOff Level Off!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BB BackOff Level Off!\n"));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc04,0x3a05611);
|
||||
}
|
||||
}
|
||||
|
|
@ -517,15 +488,12 @@ halbtc8188c2ant_AdcBackOff(
|
|||
IN BOOLEAN bAdcBackOff
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn AdcBackOff = %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn AdcBackOff = %s\n",
|
||||
(bForceExec? "force to":""), ((bAdcBackOff)? "ON":"OFF")));
|
||||
pCoexDm->bCurAdcBackOff = bAdcBackOff;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreAdcBackOff=%d, bCurAdcBackOff=%d\n",
|
||||
pCoexDm->bPreAdcBackOff, pCoexDm->bCurAdcBackOff));
|
||||
|
||||
if(pCoexDm->bPreAdcBackOff == pCoexDm->bCurAdcBackOff)
|
||||
return;
|
||||
}
|
||||
|
|
@ -544,7 +512,7 @@ halbtc8188c2ant_SetAgcTable(
|
|||
|
||||
if(bAgcTableEn)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table On!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Agc Table On!\n"));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78,0x4e1c0001);
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78,0x4d1d0001);
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78,0x4c1e0001);
|
||||
|
|
@ -559,7 +527,7 @@ halbtc8188c2ant_SetAgcTable(
|
|||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table Off!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Agc Table Off!\n"));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78,0x641c0001);
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78,0x631d0001);
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc78,0x621e0001);
|
||||
|
|
@ -585,15 +553,12 @@ halbtc8188c2ant_AgcTable(
|
|||
IN BOOLEAN bAgcTableEn
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s %s Agc Table\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s %s Agc Table\n",
|
||||
(bForceExec? "force to":""), ((bAgcTableEn)? "Enable":"Disable")));
|
||||
pCoexDm->bCurAgcTableEn = bAgcTableEn;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreAgcTableEn=%d, bCurAgcTableEn=%d\n",
|
||||
pCoexDm->bPreAgcTableEn, pCoexDm->bCurAgcTableEn));
|
||||
|
||||
if(pCoexDm->bPreAgcTableEn == pCoexDm->bCurAgcTableEn)
|
||||
return;
|
||||
}
|
||||
|
|
@ -610,13 +575,13 @@ halbtc8188c2ant_SetCoexTable(
|
|||
IN u4Byte val0x6cc
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c4=0x%x\n", val0x6c4));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], set coex table, set 0x6c4=0x%x\n", val0x6c4));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4);
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8);
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6cc, val0x6cc);
|
||||
}
|
||||
|
||||
|
|
@ -629,19 +594,14 @@ halbtc8188c2ant_CoexTable(
|
|||
IN u4Byte val0x6cc
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s write Coex Table 0x6c4=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s write Coex Table 0x6c4=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n",
|
||||
(bForceExec? "force to":""), val0x6c4, val0x6c8, val0x6cc));
|
||||
pCoexDm->curVal0x6c4 = val0x6c4;
|
||||
pCoexDm->curVal0x6c8 = val0x6c8;
|
||||
pCoexDm->curVal0x6cc = val0x6cc;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], preVal0x6c4=0x%x, preVal0x6c8=0x%x, preVal0x6cc=0x%x !!\n",
|
||||
pCoexDm->preVal0x6c4, pCoexDm->preVal0x6c8, pCoexDm->preVal0x6cc));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], curVal0x6c4=0x%x, curVal0x6c8=0x%x, curVal0x6cc=0x%x !!\n",
|
||||
pCoexDm->curVal0x6c4, pCoexDm->curVal0x6c8, pCoexDm->curVal0x6cc));
|
||||
|
||||
{
|
||||
if( (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) &&
|
||||
(pCoexDm->preVal0x6c8 == pCoexDm->curVal0x6c8) &&
|
||||
(pCoexDm->preVal0x6cc == pCoexDm->curVal0x6cc) )
|
||||
|
|
@ -691,7 +651,7 @@ halbtc8188c2ant_MonitorBtState(
|
|||
BOOLEAN bRejApAggPkt=FALSE;
|
||||
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], FirmwareVersion = 0x%x(%d)\n", fwVer, fwVer));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], FirmwareVersion = 0x%x(%d)\n", fwVer, fwVer));
|
||||
if(fwVer < 62)
|
||||
{
|
||||
regBTActive = 0x488;
|
||||
|
|
@ -710,15 +670,15 @@ halbtc8188c2ant_MonitorBtState(
|
|||
btBusyThresh = 60;
|
||||
|
||||
BT_Active = pBtCoexist->fBtcRead4Byte(pBtCoexist, regBTActive);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT_Active(0x%x)=0x%x\n", regBTActive, BT_Active));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT_Active(0x%x)=0x%x\n", regBTActive, BT_Active));
|
||||
BT_Active = BT_Active & 0x00ffffff;
|
||||
|
||||
BT_State = pBtCoexist->fBtcRead4Byte(pBtCoexist, regBTState);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT_State(0x%x)=0x%x\n", regBTState, BT_State));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT_State(0x%x)=0x%x\n", regBTState, BT_State));
|
||||
BT_State = BT_State & 0x00ffffff;
|
||||
|
||||
BT_Polling = pBtCoexist->fBtcRead4Byte(pBtCoexist, regBTPolling);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT_Polling(0x%x)=0x%x\n", regBTPolling, BT_Polling));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT_Polling(0x%x)=0x%x\n", regBTPolling, BT_Polling));
|
||||
|
||||
if(BT_Active==0xffffffff && BT_State==0xffffffff && BT_Polling==0xffffffff )
|
||||
return;
|
||||
|
|
@ -733,8 +693,8 @@ halbtc8188c2ant_MonitorBtState(
|
|||
Ratio_Act = BT_Active*1000/BT_Polling;
|
||||
Ratio_STA = BT_State*1000/BT_Polling;
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], Ratio_Act=%d\n", Ratio_Act));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], Ratio_STA=%d\n", Ratio_STA));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Ratio_Act=%d\n", Ratio_Act));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Ratio_STA=%d\n", Ratio_STA));
|
||||
|
||||
if(BTC_CHIP_CSR_BC8 == pBtCoexist->boardInfo.btChipType)
|
||||
{
|
||||
|
|
@ -1738,7 +1698,7 @@ EXhalbtc8188c2ant_InitHwConfig(
|
|||
{
|
||||
u1Byte u1Tmp=0;
|
||||
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 2Ant Init HW Config!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 2Ant Init HW Config!!\n"));
|
||||
|
||||
// backup rf 0x1e value
|
||||
pCoexDm->btRf0x1eBackup =
|
||||
|
|
@ -1759,7 +1719,7 @@ EXhalbtc8188c2ant_InitCoexDm(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Coex Mechanism Init!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Coex Mechanism Init!!\n"));
|
||||
|
||||
halbtc8188c2ant_InitCoexDm(pBtCoexist);
|
||||
}
|
||||
|
|
@ -1791,7 +1751,7 @@ EXhalbtc8188c2ant_DisplayCoexInfo(
|
|||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s = %s / %d", "BT stack/ hci ext ver", \
|
||||
((pStackInfo->bProfileNotified)? "Yes":"No"), pStackInfo->hciVersion);
|
||||
CL_PRINTF(cliBuf);
|
||||
|
||||
|
||||
// wifi status
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============");
|
||||
CL_PRINTF(cliBuf);
|
||||
|
|
@ -1857,12 +1817,12 @@ EXhalbtc8188c2ant_IpsNotify(
|
|||
{
|
||||
if(BTC_IPS_ENTER == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], IPS ENTER notify\n"));
|
||||
halbtc8188c2ant_CoexAllOff(pBtCoexist);
|
||||
}
|
||||
else if(BTC_IPS_LEAVE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], IPS LEAVE notify\n"));
|
||||
//halbtc8188c2ant_InitCoexDm(pBtCoexist);
|
||||
}
|
||||
}
|
||||
|
|
@ -1875,12 +1835,12 @@ EXhalbtc8188c2ant_LpsNotify(
|
|||
{
|
||||
if(BTC_LPS_ENABLE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], LPS ENABLE notify\n"));
|
||||
halbtc8188c2ant_CoexAllOff(pBtCoexist);
|
||||
}
|
||||
else if(BTC_LPS_DISABLE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], LPS DISABLE notify\n"));
|
||||
halbtc8188c2ant_InitCoexDm(pBtCoexist);
|
||||
}
|
||||
}
|
||||
|
|
@ -1893,11 +1853,11 @@ EXhalbtc8188c2ant_ScanNotify(
|
|||
{
|
||||
if(BTC_SCAN_START == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCAN START notify\n"));
|
||||
}
|
||||
else if(BTC_SCAN_FINISH == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCAN FINISH notify\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1909,11 +1869,11 @@ EXhalbtc8188c2ant_ConnectNotify(
|
|||
{
|
||||
if(BTC_ASSOCIATE_START == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CONNECT START notify\n"));
|
||||
}
|
||||
else if(BTC_ASSOCIATE_FINISH == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CONNECT FINISH notify\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1925,11 +1885,11 @@ EXhalbtc8188c2ant_MediaStatusNotify(
|
|||
{
|
||||
if(BTC_MEDIA_CONNECT == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], MEDIA connect notify\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], MEDIA disconnect notify\n"));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1942,7 +1902,7 @@ EXhalbtc8188c2ant_SpecialPacketNotify(
|
|||
{
|
||||
if(type == BTC_PACKET_DHCP)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], DHCP Packet notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], DHCP Packet notify\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1960,7 +1920,7 @@ EXhalbtc8188c2ant_HaltNotify(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Halt notify\n"));
|
||||
|
||||
EXhalbtc8188c2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT);
|
||||
}
|
||||
|
|
@ -1972,7 +1932,7 @@ EXhalbtc8188c2ant_Periodical(
|
|||
{
|
||||
u1Byte algorithm;
|
||||
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], 2Ant Periodical!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 2Ant Periodical!!\n"));
|
||||
|
||||
// NOTE:
|
||||
// sw mechanism must be done after fw mechanism
|
||||
|
|
@ -1989,31 +1949,31 @@ EXhalbtc8188c2ant_Periodical(
|
|||
switch(pCoexDm->curAlgorithm)
|
||||
{
|
||||
case BT_8188C_2ANT_COEX_ALGO_SCO:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = SCO\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = SCO\n"));
|
||||
halbtc8188c2ant_ActionSco(pBtCoexist);
|
||||
break;
|
||||
case BT_8188C_2ANT_COEX_ALGO_HID:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = HID\n"));
|
||||
halbtc8188c2ant_ActionHid(pBtCoexist);
|
||||
break;
|
||||
case BT_8188C_2ANT_COEX_ALGO_A2DP:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = A2DP\n"));
|
||||
halbtc8188c2ant_ActionA2dp(pBtCoexist);
|
||||
break;
|
||||
case BT_8188C_2ANT_COEX_ALGO_PAN:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN\n"));
|
||||
halbtc8188c2ant_ActionPan(pBtCoexist);
|
||||
break;
|
||||
case BT_8188C_2ANT_COEX_ALGO_HID_A2DP:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP\n"));
|
||||
halbtc8188c2ant_ActionHidA2dp(pBtCoexist);
|
||||
break;
|
||||
case BT_8188C_2ANT_COEX_ALGO_HID_PAN:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN+HID\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN+HID\n"));
|
||||
halbtc8188c2ant_ActionHidPan(pBtCoexist);
|
||||
break;
|
||||
case BT_8188C_2ANT_COEX_ALGO_PAN_A2DP:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP\n"));
|
||||
halbtc8188c2ant_ActionPanA2dp(pBtCoexist);
|
||||
break;
|
||||
default:
|
||||
|
|
@ -11,6 +11,11 @@
|
|||
// include files
|
||||
//============================================================
|
||||
#include "Mp_Precomp.h"
|
||||
|
||||
#if WPP_SOFTWARE_TRACE
|
||||
#include "HalBtc8192d2Ant.tmh"
|
||||
#endif
|
||||
|
||||
#if(BT_30_SUPPORT == 1)
|
||||
//============================================================
|
||||
// Global variables, these are static variables
|
||||
|
|
@ -45,12 +50,10 @@ halbtc8192d2ant_WifiRssiState(
|
|||
if(wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8192D_2ANT))
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_HIGH;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_LOW;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -58,12 +61,10 @@ halbtc8192d2ant_WifiRssiState(
|
|||
if(wifiRssi < rssiThresh)
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_LOW;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_HIGH;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -71,7 +72,7 @@ halbtc8192d2ant_WifiRssiState(
|
|||
{
|
||||
if(rssiThresh > rssiThresh1)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI thresh error!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], wifi RSSI thresh error!!\n"));
|
||||
return pCoexSta->preWifiRssiState[index];
|
||||
}
|
||||
|
||||
|
|
@ -81,12 +82,10 @@ halbtc8192d2ant_WifiRssiState(
|
|||
if(wifiRssi >= (rssiThresh+BTC_RSSI_COEX_THRESH_TOL_8192D_2ANT))
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_MEDIUM;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_LOW;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Low\n"));
|
||||
}
|
||||
}
|
||||
else if( (pCoexSta->preWifiRssiState[index] == BTC_RSSI_STATE_MEDIUM) ||
|
||||
|
|
@ -95,17 +94,14 @@ halbtc8192d2ant_WifiRssiState(
|
|||
if(wifiRssi >= (rssiThresh1+BTC_RSSI_COEX_THRESH_TOL_8192D_2ANT))
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_HIGH;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to High\n"));
|
||||
}
|
||||
else if(wifiRssi < rssiThresh)
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_LOW;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Low\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_MEDIUM;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at Medium\n"));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -113,12 +109,10 @@ halbtc8192d2ant_WifiRssiState(
|
|||
if(wifiRssi < rssiThresh1)
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_MEDIUM;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state switch to Medium\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
wifiRssiState = BTC_RSSI_STATE_STAY_HIGH;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_WIFI_RSSI_STATE, ("[BTCoex], wifi RSSI state stay at High\n"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -142,7 +136,7 @@ halbtc8192d2ant_ActionAlgorithm(
|
|||
|
||||
if(!pStackInfo->bBtLinkExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], No profile exists!!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], No profile exists!!!\n"));
|
||||
return algorithm;
|
||||
}
|
||||
|
||||
|
|
@ -157,7 +151,7 @@ halbtc8192d2ant_ActionAlgorithm(
|
|||
|
||||
if(pStackInfo->bScoExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], SCO algorithm\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCO algorithm\n"));
|
||||
algorithm = BT_8192D_2ANT_COEX_ALGO_SCO;
|
||||
}
|
||||
else
|
||||
|
|
@ -166,17 +160,17 @@ halbtc8192d2ant_ActionAlgorithm(
|
|||
{
|
||||
if(pStackInfo->bHidExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID only\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID only\n"));
|
||||
algorithm = BT_8192D_2ANT_COEX_ALGO_HID;
|
||||
}
|
||||
else if(pStackInfo->bA2dpExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], A2DP only\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], A2DP only\n"));
|
||||
algorithm = BT_8192D_2ANT_COEX_ALGO_A2DP;
|
||||
}
|
||||
else if(pStackInfo->bPanExist)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN only\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], PAN only\n"));
|
||||
algorithm = BT_8192D_2ANT_COEX_ALGO_PAN;
|
||||
}
|
||||
}
|
||||
|
|
@ -185,19 +179,19 @@ halbtc8192d2ant_ActionAlgorithm(
|
|||
if( pStackInfo->bHidExist &&
|
||||
pStackInfo->bA2dpExist )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + A2DP\n"));
|
||||
algorithm = BT_8192D_2ANT_COEX_ALGO_HID_A2DP;
|
||||
}
|
||||
else if( pStackInfo->bHidExist &&
|
||||
pStackInfo->bPanExist )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], HID + PAN\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], HID + PAN\n"));
|
||||
algorithm = BT_8192D_2ANT_COEX_ALGO_HID_PAN;
|
||||
}
|
||||
else if( pStackInfo->bPanExist &&
|
||||
pStackInfo->bA2dpExist )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PAN + A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], PAN + A2DP\n"));
|
||||
algorithm = BT_8192D_2ANT_COEX_ALGO_PAN_A2DP;
|
||||
}
|
||||
}
|
||||
|
|
@ -228,7 +222,7 @@ halbtc8192d2ant_SetFwBalance(
|
|||
H2C_Parameter[0] = 0;
|
||||
}
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Balance=[%s:%dms:%dms], write 0xc=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Balance=[%s:%dms:%dms], write 0xc=0x%x\n",
|
||||
bBalanceOn?"ON":"OFF", ms0, ms1,
|
||||
H2C_Parameter[0]<<16|H2C_Parameter[1]<<8|H2C_Parameter[2]));
|
||||
|
||||
|
|
@ -244,15 +238,12 @@ halbtc8192d2ant_Balance(
|
|||
IN u1Byte ms1
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn Balance %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn Balance %s\n",
|
||||
(bForceExec? "force to":""), (bBalanceOn? "ON":"OFF")));
|
||||
pCoexDm->bCurBalanceOn = bBalanceOn;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreBalanceOn = %d, bCurBalanceOn = %d!!\n",
|
||||
pCoexDm->bPreBalanceOn, pCoexDm->bCurBalanceOn));
|
||||
|
||||
if(pCoexDm->bPreBalanceOn == pCoexDm->bCurBalanceOn)
|
||||
return;
|
||||
}
|
||||
|
|
@ -274,7 +265,7 @@ halbtc8192d2ant_SetFwDiminishWifi(
|
|||
|
||||
if((pBtCoexist->stackInfo.minBtRssi <= -5) && (fwDacSwingLvl == 0x20))
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], DiminishWiFi 0x20 original, but set 0x18 for Low RSSI!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], DiminishWiFi 0x20 original, but set 0x18 for Low RSSI!\n"));
|
||||
fwDacSwingLvl = 0x18;
|
||||
}
|
||||
|
||||
|
|
@ -294,7 +285,7 @@ halbtc8192d2ant_SetFwDiminishWifi(
|
|||
H2C_Parameter[2] |= 0x08; //BIT3
|
||||
}
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], bDacOn=%s, bInterruptOn=%s, bNavOn=%s, write 0x12=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], bDacOn=%s, bInterruptOn=%s, bNavOn=%s, write 0x12=0x%x\n",
|
||||
(bDacOn?"ON":"OFF"), (bInterruptOn?"ON":"OFF"), (bNavOn?"ON":"OFF"),
|
||||
(H2C_Parameter[0]<<16|H2C_Parameter[1]<<8|H2C_Parameter[2])));
|
||||
pBtCoexist->fBtcFillH2c(pBtCoexist, 0x12, 3, H2C_Parameter);
|
||||
|
|
@ -311,7 +302,7 @@ halbtc8192d2ant_DiminishWifi(
|
|||
IN BOOLEAN bNavOn
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s set Diminish Wifi, bDacOn=%s, bInterruptOn=%s, fwDacSwingLvl=%d, bNavOn=%s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s set Diminish Wifi, bDacOn=%s, bInterruptOn=%s, fwDacSwingLvl=%d, bNavOn=%s\n",
|
||||
(bForceExec? "force to":""), (bDacOn? "ON":"OFF"), (bInterruptOn? "ON":"OFF"), fwDacSwingLvl, (bNavOn? "ON":"OFF")));
|
||||
|
||||
pCoexDm->bCurDacOn = bDacOn;
|
||||
|
|
@ -321,16 +312,6 @@ halbtc8192d2ant_DiminishWifi(
|
|||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreDacOn=%d, bCurDacOn=%d!!\n",
|
||||
pCoexDm->bPreDacOn, pCoexDm->bCurDacOn));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreInterruptOn=%d, bCurInterruptOn=%d!!\n",
|
||||
pCoexDm->bPreInterruptOn, pCoexDm->bCurInterruptOn));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], preFwDacSwingLvl=%d, curFwDacSwingLvl=%d!!\n",
|
||||
pCoexDm->preFwDacSwingLvl, pCoexDm->curFwDacSwingLvl));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreNavOn=%d, bCurNavOn=%d!!\n",
|
||||
pCoexDm->bPreNavOn, pCoexDm->bCurNavOn));
|
||||
|
||||
|
||||
if( (pCoexDm->bPreDacOn==pCoexDm->bCurDacOn) &&
|
||||
(pCoexDm->bPreInterruptOn==pCoexDm->bCurInterruptOn) &&
|
||||
(pCoexDm->preFwDacSwingLvl==pCoexDm->curFwDacSwingLvl) &&
|
||||
|
|
@ -354,7 +335,7 @@ halbtc8192d2ant_SetSwRfRxLpfCorner(
|
|||
if(bRxRfShrinkOn)
|
||||
{
|
||||
//Shrink RF Rx LPF corner
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Shrink RF Rx LPF corner!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Shrink RF Rx LPF corner!!\n"));
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, 0xf2ff7);
|
||||
}
|
||||
else
|
||||
|
|
@ -363,7 +344,7 @@ halbtc8192d2ant_SetSwRfRxLpfCorner(
|
|||
// After initialized, we can use pCoexDm->btRf0x1eBackup
|
||||
if(pBtCoexist->bInitilized)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Resume RF Rx LPF corner!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Resume RF Rx LPF corner!!\n"));
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, pCoexDm->btRf0x1eBackup);
|
||||
}
|
||||
}
|
||||
|
|
@ -377,15 +358,12 @@ halbtc8192d2ant_RfShrink(
|
|||
IN BOOLEAN bRxRfShrinkOn
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn Rx RF Shrink = %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn Rx RF Shrink = %s\n",
|
||||
(bForceExec? "force to":""), ((bRxRfShrinkOn)? "ON":"OFF")));
|
||||
pCoexDm->bCurRfRxLpfShrink = bRxRfShrinkOn;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreRfRxLpfShrink=%d, bCurRfRxLpfShrink=%d\n",
|
||||
pCoexDm->bPreRfRxLpfShrink, pCoexDm->bCurRfRxLpfShrink));
|
||||
|
||||
if(pCoexDm->bPreRfRxLpfShrink == pCoexDm->bCurRfRxLpfShrink)
|
||||
return;
|
||||
}
|
||||
|
|
@ -405,12 +383,12 @@ halbtc8192d2ant_SetSwPenaltyTxRateAdaptive(
|
|||
tmpU1 = pBtCoexist->fBtcRead1Byte(pBtCoexist, 0x4fd);
|
||||
if(bLowPenaltyRa)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Tx rate adaptive, set low penalty!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Tx rate adaptive, set low penalty!!\n"));
|
||||
tmpU1 &= ~BIT2;
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Tx rate adaptive, set normal!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Tx rate adaptive, set normal!!\n"));
|
||||
tmpU1 |= BIT2;
|
||||
}
|
||||
pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x4fd, tmpU1);
|
||||
|
|
@ -423,15 +401,12 @@ halbtc8192d2ant_LowPenaltyRa(
|
|||
IN BOOLEAN bLowPenaltyRa
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn LowPenaltyRA = %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn LowPenaltyRA = %s\n",
|
||||
(bForceExec? "force to":""), ((bLowPenaltyRa)? "ON":"OFF")));
|
||||
pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreLowPenaltyRa=%d, bCurLowPenaltyRa=%d\n",
|
||||
pCoexDm->bPreLowPenaltyRa, pCoexDm->bCurLowPenaltyRa));
|
||||
|
||||
if(pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa)
|
||||
return;
|
||||
}
|
||||
|
|
@ -475,17 +450,13 @@ halbtc8192d2ant_DacSwing(
|
|||
IN u4Byte dacSwingLvl
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn DacSwing=%s, dacSwingLvl=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn DacSwing=%s, dacSwingLvl=0x%x\n",
|
||||
(bForceExec? "force to":""), ((bDacSwingOn)? "ON":"OFF"), dacSwingLvl));
|
||||
pCoexDm->bCurDacSwingOn = bDacSwingOn;
|
||||
pCoexDm->curDacSwingLvl = dacSwingLvl;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreDacSwingOn=%d, preDacSwingLvl=0x%x, bCurDacSwingOn=%d, curDacSwingLvl=0x%x\n",
|
||||
pCoexDm->bPreDacSwingOn, pCoexDm->preDacSwingLvl,
|
||||
pCoexDm->bCurDacSwingOn, pCoexDm->curDacSwingLvl));
|
||||
|
||||
if( (pCoexDm->bPreDacSwingOn == pCoexDm->bCurDacSwingOn) &&
|
||||
(pCoexDm->preDacSwingLvl == pCoexDm->curDacSwingLvl) )
|
||||
return;
|
||||
|
|
@ -505,12 +476,12 @@ halbtc8192d2ant_SetAdcBackOff(
|
|||
{
|
||||
if(bAdcBackOff)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB BackOff Level On!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BB BackOff Level On!\n"));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc04,0x3a07611);
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], BB BackOff Level Off!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BB BackOff Level Off!\n"));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0xc04,0x3a05611);
|
||||
}
|
||||
}
|
||||
|
|
@ -522,15 +493,12 @@ halbtc8192d2ant_AdcBackOff(
|
|||
IN BOOLEAN bAdcBackOff
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn AdcBackOff = %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn AdcBackOff = %s\n",
|
||||
(bForceExec? "force to":""), ((bAdcBackOff)? "ON":"OFF")));
|
||||
pCoexDm->bCurAdcBackOff = bAdcBackOff;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreAdcBackOff=%d, bCurAdcBackOff=%d\n",
|
||||
pCoexDm->bPreAdcBackOff, pCoexDm->bCurAdcBackOff));
|
||||
|
||||
if(pCoexDm->bPreAdcBackOff == pCoexDm->bCurAdcBackOff)
|
||||
return;
|
||||
}
|
||||
|
|
@ -549,7 +517,7 @@ halbtc8192d2ant_SetAgcTable(
|
|||
|
||||
if(bAgcTableEn)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table On!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Agc Table On!\n"));
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1a, 0xfffff, 0xa99);
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x12, 0xfffff, 0xd4000);
|
||||
|
||||
|
|
@ -602,7 +570,7 @@ halbtc8192d2ant_SetAgcTable(
|
|||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Agc Table Off!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Agc Table Off!\n"));
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1a, 0xfffff, 0x30a99);
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x12, 0xfffff, 0xdc000);
|
||||
|
||||
|
|
@ -665,15 +633,12 @@ halbtc8192d2ant_AgcTable(
|
|||
IN BOOLEAN bAgcTableEn
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s %s Agc Table\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s %s Agc Table\n",
|
||||
(bForceExec? "force to":""), ((bAgcTableEn)? "Enable":"Disable")));
|
||||
pCoexDm->bCurAgcTableEn = bAgcTableEn;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreAgcTableEn=%d, bCurAgcTableEn=%d\n",
|
||||
pCoexDm->bPreAgcTableEn, pCoexDm->bCurAgcTableEn));
|
||||
|
||||
if(pCoexDm->bPreAgcTableEn == pCoexDm->bCurAgcTableEn)
|
||||
return;
|
||||
}
|
||||
|
|
@ -690,13 +655,13 @@ halbtc8192d2ant_SetCoexTable(
|
|||
IN u4Byte val0x6cc
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c4=0x%x\n", val0x6c4));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], set coex table, set 0x6c4=0x%x\n", val0x6c4));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c4, val0x6c4);
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8);
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6cc, val0x6cc);
|
||||
}
|
||||
|
||||
|
|
@ -709,19 +674,14 @@ halbtc8192d2ant_CoexTable(
|
|||
IN u4Byte val0x6cc
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s write Coex Table 0x6c4=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s write Coex Table 0x6c4=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n",
|
||||
(bForceExec? "force to":""), val0x6c4, val0x6c8, val0x6cc));
|
||||
pCoexDm->curVal0x6c4 = val0x6c4;
|
||||
pCoexDm->curVal0x6c8 = val0x6c8;
|
||||
pCoexDm->curVal0x6cc = val0x6cc;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], preVal0x6c4=0x%x, preVal0x6c8=0x%x, preVal0x6cc=0x%x !!\n",
|
||||
pCoexDm->preVal0x6c4, pCoexDm->preVal0x6c8, pCoexDm->preVal0x6cc));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], curVal0x6c4=0x%x, curVal0x6c8=0x%x, curVal0x6cc=0x%x !!\n",
|
||||
pCoexDm->curVal0x6c4, pCoexDm->curVal0x6c8, pCoexDm->curVal0x6cc));
|
||||
|
||||
{
|
||||
if( (pCoexDm->preVal0x6c4 == pCoexDm->curVal0x6c4) &&
|
||||
(pCoexDm->preVal0x6c8 == pCoexDm->curVal0x6c8) &&
|
||||
(pCoexDm->preVal0x6cc == pCoexDm->curVal0x6cc) )
|
||||
|
|
@ -772,23 +732,23 @@ halbtc8192d2ant_MonitorBtEnableDisable(
|
|||
btDisableCnt = 0;
|
||||
bBtDisabled = FALSE;
|
||||
pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_DISABLE, &bBtDisabled);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is enabled !!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is enabled !!\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
btDisableCnt++;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], bt all counters=0, %d times!!\n",
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], bt all counters=0, %d times!!\n",
|
||||
btDisableCnt));
|
||||
if(btDisableCnt >= 2)
|
||||
{
|
||||
bBtDisabled = TRUE;
|
||||
pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_DISABLE, &bBtDisabled);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is disabled !!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is disabled !!\n"));
|
||||
}
|
||||
}
|
||||
if(bPreBtDisabled != bBtDisabled)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is from %s to %s!!\n",
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is from %s to %s!!\n",
|
||||
(bPreBtDisabled ? "disabled":"enabled"),
|
||||
(bBtDisabled ? "disabled":"enabled")));
|
||||
|
||||
|
|
@ -815,7 +775,7 @@ halbtc8192d2ant_MonitorBtState(
|
|||
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_FW_VER, &fwVer);
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], FirmwareVersion = 0x%x(%d)\n", fwVer, fwVer));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], FirmwareVersion = 0x%x(%d)\n", fwVer, fwVer));
|
||||
|
||||
regBTActive = 0x444;
|
||||
regBTState = 0x448;
|
||||
|
|
@ -824,15 +784,15 @@ halbtc8192d2ant_MonitorBtState(
|
|||
btBusyThresh = 40;
|
||||
|
||||
BT_Active = pBtCoexist->fBtcRead4Byte(pBtCoexist, regBTActive);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT_Active(0x%x)=0x%x\n", regBTActive, BT_Active));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT_Active(0x%x)=0x%x\n", regBTActive, BT_Active));
|
||||
BT_Active = BT_Active & 0x00ffffff;
|
||||
|
||||
BT_State = pBtCoexist->fBtcRead4Byte(pBtCoexist, regBTState);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT_State(0x%x)=0x%x\n", regBTState, BT_State));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT_State(0x%x)=0x%x\n", regBTState, BT_State));
|
||||
BT_State = BT_State & 0x00ffffff;
|
||||
|
||||
BT_Polling = pBtCoexist->fBtcRead4Byte(pBtCoexist, regBTPolling);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT_Polling(0x%x)=0x%x\n", regBTPolling, BT_Polling));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT_Polling(0x%x)=0x%x\n", regBTPolling, BT_Polling));
|
||||
|
||||
if(BT_Active==0xffffffff && BT_State==0xffffffff && BT_Polling==0xffffffff )
|
||||
return;
|
||||
|
|
@ -849,8 +809,8 @@ halbtc8192d2ant_MonitorBtState(
|
|||
Ratio_Act = BT_Active*1000/BT_Polling;
|
||||
Ratio_STA = BT_State*1000/BT_Polling;
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], Ratio_Act=%d\n", Ratio_Act));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], Ratio_STA=%d\n", Ratio_STA));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Ratio_Act=%d\n", Ratio_Act));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Ratio_STA=%d\n", Ratio_STA));
|
||||
|
||||
if(BTC_CHIP_CSR_BC8 == pBtCoexist->boardInfo.btChipType)
|
||||
{
|
||||
|
|
@ -1695,13 +1655,13 @@ halbtc8192d2ant_IsBtCoexistEnter(
|
|||
|
||||
if(BTC_SMSP != macPhyMode)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Only support single mac single phy!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Only support single mac single phy!!\n"));
|
||||
bRet = FALSE;
|
||||
}
|
||||
|
||||
if(bWifiUnder5G)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is under 5G or A band\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], wifi is under 5G or A band\n"));
|
||||
halbtc8192d2ant_CoexAllOff(pBtCoexist);
|
||||
bRet = FALSE;
|
||||
}
|
||||
|
|
@ -1727,7 +1687,7 @@ EXhalbtc8192d2ant_InitHwConfig(
|
|||
{
|
||||
u1Byte u1Tmp=0;
|
||||
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 2Ant Init HW Config!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 2Ant Init HW Config!!\n"));
|
||||
|
||||
// backup rf 0x1e value
|
||||
pCoexDm->btRf0x1eBackup =
|
||||
|
|
@ -1765,7 +1725,7 @@ EXhalbtc8192d2ant_InitCoexDm(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Coex Mechanism Init!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Coex Mechanism Init!!\n"));
|
||||
|
||||
halbtc8192d2ant_InitCoexDm(pBtCoexist);
|
||||
}
|
||||
|
|
@ -1863,12 +1823,12 @@ EXhalbtc8192d2ant_IpsNotify(
|
|||
{
|
||||
if(BTC_IPS_ENTER == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], IPS ENTER notify\n"));
|
||||
halbtc8192d2ant_CoexAllOff(pBtCoexist);
|
||||
}
|
||||
else if(BTC_IPS_LEAVE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], IPS LEAVE notify\n"));
|
||||
//halbtc8192d2ant_InitCoexDm(pBtCoexist);
|
||||
}
|
||||
}
|
||||
|
|
@ -1881,12 +1841,12 @@ EXhalbtc8192d2ant_LpsNotify(
|
|||
{
|
||||
if(BTC_LPS_ENABLE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], LPS ENABLE notify\n"));
|
||||
halbtc8192d2ant_CoexAllOff(pBtCoexist);
|
||||
}
|
||||
else if(BTC_LPS_DISABLE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], LPS DISABLE notify\n"));
|
||||
halbtc8192d2ant_InitCoexDm(pBtCoexist);
|
||||
}
|
||||
}
|
||||
|
|
@ -1899,11 +1859,11 @@ EXhalbtc8192d2ant_ScanNotify(
|
|||
{
|
||||
if(BTC_SCAN_START == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCAN START notify\n"));
|
||||
}
|
||||
else if(BTC_SCAN_FINISH == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCAN FINISH notify\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1915,11 +1875,11 @@ EXhalbtc8192d2ant_ConnectNotify(
|
|||
{
|
||||
if(BTC_ASSOCIATE_START == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CONNECT START notify\n"));
|
||||
}
|
||||
else if(BTC_ASSOCIATE_FINISH == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CONNECT FINISH notify\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1931,11 +1891,11 @@ EXhalbtc8192d2ant_MediaStatusNotify(
|
|||
{
|
||||
if(BTC_MEDIA_CONNECT == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], MEDIA connect notify\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], MEDIA disconnect notify\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1947,7 +1907,7 @@ EXhalbtc8192d2ant_SpecialPacketNotify(
|
|||
{
|
||||
if(type == BTC_PACKET_DHCP)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], DHCP Packet notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], DHCP Packet notify\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1965,7 +1925,7 @@ EXhalbtc8192d2ant_HaltNotify(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Halt notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Halt notify\n"));
|
||||
|
||||
EXhalbtc8192d2ant_MediaStatusNotify(pBtCoexist, BTC_MEDIA_DISCONNECT);
|
||||
}
|
||||
|
|
@ -1977,7 +1937,7 @@ EXhalbtc8192d2ant_Periodical(
|
|||
{
|
||||
u1Byte algorithm;
|
||||
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], 2Ant Periodical!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 2Ant Periodical!!\n"));
|
||||
|
||||
// NOTE:
|
||||
// sw mechanism must be done after fw mechanism
|
||||
|
|
@ -1995,31 +1955,31 @@ EXhalbtc8192d2ant_Periodical(
|
|||
switch(pCoexDm->curAlgorithm)
|
||||
{
|
||||
case BT_8192D_2ANT_COEX_ALGO_SCO:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = SCO\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = SCO\n"));
|
||||
halbtc8192d2ant_ActionSco(pBtCoexist);
|
||||
break;
|
||||
case BT_8192D_2ANT_COEX_ALGO_HID:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = HID\n"));
|
||||
halbtc8192d2ant_ActionHid(pBtCoexist);
|
||||
break;
|
||||
case BT_8192D_2ANT_COEX_ALGO_A2DP:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = A2DP\n"));
|
||||
halbtc8192d2ant_ActionA2dp(pBtCoexist);
|
||||
break;
|
||||
case BT_8192D_2ANT_COEX_ALGO_PAN:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN\n"));
|
||||
halbtc8192d2ant_ActionPan(pBtCoexist);
|
||||
break;
|
||||
case BT_8192D_2ANT_COEX_ALGO_HID_A2DP:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = HID+A2DP\n"));
|
||||
halbtc8192d2ant_ActionHidA2dp(pBtCoexist);
|
||||
break;
|
||||
case BT_8192D_2ANT_COEX_ALGO_HID_PAN:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN+HID\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN+HID\n"));
|
||||
halbtc8192d2ant_ActionHidPan(pBtCoexist);
|
||||
break;
|
||||
case BT_8192D_2ANT_COEX_ALGO_PAN_A2DP:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Action 2-Ant, algorithm = PAN+A2DP\n"));
|
||||
halbtc8192d2ant_ActionPanA2dp(pBtCoexist);
|
||||
break;
|
||||
default:
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,7 +1,7 @@
|
|||
//===========================================
|
||||
// The following is for 8192E_1ANT BT Co-exist definition
|
||||
// The following is for 8192E 1ANT BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8192E_1ANT 0
|
||||
#define BT_AUTO_REPORT_ONLY_8192E_1ANT 1
|
||||
|
||||
#define BT_INFO_8192E_1ANT_B_FTP BIT7
|
||||
#define BT_INFO_8192E_1ANT_B_A2DP BIT6
|
||||
|
|
@ -17,6 +17,8 @@
|
|||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8192E_1ANT 2
|
||||
|
||||
#define BT_8192E_1ANT_WIFI_NOISY_THRESH 30 //max: 255
|
||||
|
||||
typedef enum _BT_INFO_SRC_8192E_1ANT{
|
||||
BT_INFO_SRC_8192E_1ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8192E_1ANT_BT_RSP = 0x1,
|
||||
|
|
@ -61,10 +63,6 @@ typedef enum _BT_8192E_1ANT_COEX_ALGO{
|
|||
|
||||
typedef struct _COEX_DM_8192E_1ANT{
|
||||
// fw mechanism
|
||||
u1Byte preBtDecPwrLvl;
|
||||
u1Byte curBtDecPwrLvl;
|
||||
u1Byte preFwDacSwingLvl;
|
||||
u1Byte curFwDacSwingLvl;
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
BOOLEAN bPreIgnoreWlanAct;
|
||||
u1Byte prePsTdma;
|
||||
|
|
@ -84,10 +82,6 @@ typedef struct _COEX_DM_8192E_1ANT{
|
|||
// sw mechanism
|
||||
BOOLEAN bPreLowPenaltyRa;
|
||||
BOOLEAN bCurLowPenaltyRa;
|
||||
BOOLEAN bPreDacSwingOn;
|
||||
u4Byte preDacSwingLvl;
|
||||
BOOLEAN bCurDacSwingOn;
|
||||
u4Byte curDacSwingLvl;
|
||||
u4Byte preVal0x6c0;
|
||||
u4Byte curVal0x6c0;
|
||||
u4Byte preVal0x6c4;
|
||||
|
|
@ -96,6 +90,12 @@ typedef struct _COEX_DM_8192E_1ANT{
|
|||
u4Byte curVal0x6c8;
|
||||
u1Byte preVal0x6cc;
|
||||
u1Byte curVal0x6cc;
|
||||
BOOLEAN bLimitedDig;
|
||||
|
||||
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
|
||||
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
|
||||
u2Byte backupRetryLimit;
|
||||
u1Byte backupAmpduMaxTime;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
|
|
@ -103,11 +103,15 @@ typedef struct _COEX_DM_8192E_1ANT{
|
|||
u1Byte btStatus;
|
||||
u1Byte wifiChnlInfo[3];
|
||||
|
||||
u1Byte preSsType;
|
||||
u1Byte curSsType;
|
||||
|
||||
u4Byte preRaMask;
|
||||
u4Byte curRaMask;
|
||||
u1Byte preArfrType;
|
||||
u1Byte curArfrType;
|
||||
u1Byte preRetryLimitType;
|
||||
u1Byte curRetryLimitType;
|
||||
u1Byte preAmpduTimeType;
|
||||
u1Byte curAmpduTimeType;
|
||||
u4Byte nArpCnt;
|
||||
|
||||
u1Byte errorCondition;
|
||||
} COEX_DM_8192E_1ANT, *PCOEX_DM_8192E_1ANT;
|
||||
|
|
@ -121,19 +125,41 @@ typedef struct _COEX_STA_8192E_1ANT{
|
|||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
u4Byte specialPktPeriodCnt;
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
s1Byte btRssi;
|
||||
BOOLEAN bBtTxRxMask;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8192E_1ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8192E_1ANT_MAX];
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
BOOLEAN bC2hBtPage; //Add for win8.1 page out issue
|
||||
BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
u4Byte popEventCnt;
|
||||
u1Byte nScanAPNum;
|
||||
|
||||
u4Byte nCRCOK_CCK;
|
||||
u4Byte nCRCOK_11g;
|
||||
u4Byte nCRCOK_11n;
|
||||
u4Byte nCRCOK_11nAgg;
|
||||
|
||||
u4Byte nCRCErr_CCK;
|
||||
u4Byte nCRCErr_11g;
|
||||
u4Byte nCRCErr_11n;
|
||||
u4Byte nCRCErr_11nAgg;
|
||||
|
||||
BOOLEAN bCCKLock;
|
||||
BOOLEAN bPreCCKLock;
|
||||
u1Byte nCoexTableType;
|
||||
|
||||
BOOLEAN bForceLpsOn;
|
||||
}COEX_STA_8192E_1ANT, *PCOEX_STA_8192E_1ANT;
|
||||
|
||||
//===========================================
|
||||
|
|
@ -144,6 +170,10 @@ EXhalbtc8192e1ant_PowerOnSetting(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_PreLoadFirmware(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
|
|
@ -189,6 +219,11 @@ EXhalbtc8192e1ant_BtInfoNotify(
|
|||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_RfStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
|
@ -198,6 +233,10 @@ EXhalbtc8192e1ant_PnpNotify(
|
|||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_CoexDmReset(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
|
@ -212,3 +251,4 @@ EXhalbtc8192e1ant_DbgControl(
|
|||
IN u1Byte opLen,
|
||||
IN pu1Byte pData
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -12,7 +12,11 @@
|
|||
#define BT_INFO_8192E_2ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8192E_2ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BT_INFO_8192E_2ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
|
||||
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8192E_2ANT 2
|
||||
#define NOISY_AP_NUM_THRESH 5
|
||||
|
||||
typedef enum _BT_INFO_SRC_8192E_2ANT{
|
||||
BT_INFO_SRC_8192E_2ANT_WIFI_FW = 0x0,
|
||||
|
|
@ -61,10 +65,15 @@ typedef struct _COEX_DM_8192E_2ANT{
|
|||
u1Byte psTdmaDuAdjType;
|
||||
BOOLEAN bResetTdmaAdjust;
|
||||
BOOLEAN bAutoTdmaAdjust;
|
||||
BOOLEAN bAutoTdmaAdjustLowRssi;
|
||||
BOOLEAN bPrePsTdmaOn;
|
||||
BOOLEAN bCurPsTdmaOn;
|
||||
BOOLEAN bPreBtAutoReport;
|
||||
BOOLEAN bCurBtAutoReport;
|
||||
u1Byte preLps;
|
||||
u1Byte curLps;
|
||||
u1Byte preRpwm;
|
||||
u1Byte curRpwm;
|
||||
|
||||
// sw mechanism
|
||||
BOOLEAN bPreRfRxLpfShrink;
|
||||
|
|
@ -137,6 +146,22 @@ typedef struct _COEX_STA_8192E_2ANT{
|
|||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
u1Byte nScanAPNum;
|
||||
|
||||
u4Byte nCRCOK_CCK;
|
||||
u4Byte nCRCOK_11g;
|
||||
u4Byte nCRCOK_11n;
|
||||
u4Byte nCRCOK_11nAgg;
|
||||
|
||||
u4Byte nCRCErr_CCK;
|
||||
u4Byte nCRCErr_11g;
|
||||
u4Byte nCRCErr_11n;
|
||||
u4Byte nCRCErr_11nAgg;
|
||||
|
||||
u1Byte nCoexTableType;
|
||||
BOOLEAN bForceLpsOn;
|
||||
|
||||
u1Byte disVerInfoCnt;
|
||||
}COEX_STA_8192E_2ANT, *PCOEX_STA_8192E_2ANT;
|
||||
|
||||
//===========================================
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,334 @@
|
|||
//===========================================
|
||||
// The following is for 8703B 1ANT BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8703B_1ANT 1
|
||||
|
||||
#define BT_INFO_8703B_1ANT_B_FTP BIT7
|
||||
#define BT_INFO_8703B_1ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8703B_1ANT_B_HID BIT5
|
||||
#define BT_INFO_8703B_1ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8703B_1ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8703B_1ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8703B_1ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8703B_1ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BT_INFO_8703B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
|
||||
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8703B_1ANT 2
|
||||
|
||||
#define BT_8703B_1ANT_WIFI_NOISY_THRESH 30 //max: 255
|
||||
|
||||
//for Antenna detection
|
||||
#define BT_8703B_1ANT_ANTDET_PSDTHRES_BACKGROUND 50
|
||||
#define BT_8703B_1ANT_ANTDET_PSDTHRES_2ANT_BADISOLATION 70
|
||||
#define BT_8703B_1ANT_ANTDET_PSDTHRES_2ANT_GOODISOLATION 55
|
||||
#define BT_8703B_1ANT_ANTDET_PSDTHRES_1ANT 35
|
||||
#define BT_8703B_1ANT_ANTDET_RETRY_INTERVAL 10 //retry timer if ant det is fail, unit: second
|
||||
#define BT_8703B_1ANT_ANTDET_ENABLE 0
|
||||
#define BT_8703B_1ANT_ANTDET_COEXMECHANISMSWITCH_ENABLE 0
|
||||
|
||||
typedef enum _BT_INFO_SRC_8703B_1ANT{
|
||||
BT_INFO_SRC_8703B_1ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8703B_1ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8703B_1ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8703B_1ANT_MAX
|
||||
}BT_INFO_SRC_8703B_1ANT,*PBT_INFO_SRC_8703B_1ANT;
|
||||
|
||||
typedef enum _BT_8703B_1ANT_BT_STATUS{
|
||||
BT_8703B_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8703B_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8703B_1ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8703B_1ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8703B_1ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8703B_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8703B_1ANT_BT_STATUS_MAX
|
||||
}BT_8703B_1ANT_BT_STATUS,*PBT_8703B_1ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8703B_1ANT_WIFI_STATUS{
|
||||
BT_8703B_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8703B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
|
||||
BT_8703B_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
|
||||
BT_8703B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
|
||||
BT_8703B_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
|
||||
BT_8703B_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
|
||||
BT_8703B_1ANT_WIFI_STATUS_MAX
|
||||
}BT_8703B_1ANT_WIFI_STATUS,*PBT_8703B_1ANT_WIFI_STATUS;
|
||||
|
||||
typedef enum _BT_8703B_1ANT_COEX_ALGO{
|
||||
BT_8703B_1ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8703B_1ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8703B_1ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8703B_1ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8703B_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
|
||||
BT_8703B_1ANT_COEX_ALGO_PANEDR = 0x5,
|
||||
BT_8703B_1ANT_COEX_ALGO_PANHS = 0x6,
|
||||
BT_8703B_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
|
||||
BT_8703B_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
|
||||
BT_8703B_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
|
||||
BT_8703B_1ANT_COEX_ALGO_HID_A2DP = 0xa,
|
||||
BT_8703B_1ANT_COEX_ALGO_MAX = 0xb,
|
||||
}BT_8703B_1ANT_COEX_ALGO,*PBT_8703B_1ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8703B_1ANT{
|
||||
// hw setting
|
||||
u1Byte preAntPosType;
|
||||
u1Byte curAntPosType;
|
||||
// fw mechanism
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
BOOLEAN bPreIgnoreWlanAct;
|
||||
u1Byte prePsTdma;
|
||||
u1Byte curPsTdma;
|
||||
u1Byte psTdmaPara[5];
|
||||
u1Byte psTdmaDuAdjType;
|
||||
BOOLEAN bAutoTdmaAdjust;
|
||||
BOOLEAN bPrePsTdmaOn;
|
||||
BOOLEAN bCurPsTdmaOn;
|
||||
BOOLEAN bPreBtAutoReport;
|
||||
BOOLEAN bCurBtAutoReport;
|
||||
u1Byte preLps;
|
||||
u1Byte curLps;
|
||||
u1Byte preRpwm;
|
||||
u1Byte curRpwm;
|
||||
|
||||
// sw mechanism
|
||||
BOOLEAN bPreLowPenaltyRa;
|
||||
BOOLEAN bCurLowPenaltyRa;
|
||||
u4Byte preVal0x6c0;
|
||||
u4Byte curVal0x6c0;
|
||||
u4Byte preVal0x6c4;
|
||||
u4Byte curVal0x6c4;
|
||||
u4Byte preVal0x6c8;
|
||||
u4Byte curVal0x6c8;
|
||||
u1Byte preVal0x6cc;
|
||||
u1Byte curVal0x6cc;
|
||||
BOOLEAN bLimitedDig;
|
||||
|
||||
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
|
||||
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
|
||||
u2Byte backupRetryLimit;
|
||||
u1Byte backupAmpduMaxTime;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
u1Byte curAlgorithm;
|
||||
u1Byte btStatus;
|
||||
u1Byte wifiChnlInfo[3];
|
||||
|
||||
u4Byte preRaMask;
|
||||
u4Byte curRaMask;
|
||||
u1Byte preArfrType;
|
||||
u1Byte curArfrType;
|
||||
u1Byte preRetryLimitType;
|
||||
u1Byte curRetryLimitType;
|
||||
u1Byte preAmpduTimeType;
|
||||
u1Byte curAmpduTimeType;
|
||||
u4Byte nArpCnt;
|
||||
|
||||
u1Byte errorCondition;
|
||||
} COEX_DM_8703B_1ANT, *PCOEX_DM_8703B_1ANT;
|
||||
|
||||
typedef struct _COEX_STA_8703B_1ANT{
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bHidExist;
|
||||
BOOLEAN bPanExist;
|
||||
BOOLEAN bBtHiPriLinkExist;
|
||||
u1Byte nNumOfProfile;
|
||||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
u4Byte specialPktPeriodCnt;
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
s1Byte btRssi;
|
||||
BOOLEAN bBtTxRxMask;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8703B_1ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8703B_1ANT_MAX];
|
||||
BOOLEAN bBtWhckTest;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
BOOLEAN bC2hBtPage; //Add for win8.1 page out issue
|
||||
BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
u4Byte popEventCnt;
|
||||
u1Byte nScanAPNum;
|
||||
|
||||
u4Byte nCRCOK_CCK;
|
||||
u4Byte nCRCOK_11g;
|
||||
u4Byte nCRCOK_11n;
|
||||
u4Byte nCRCOK_11nAgg;
|
||||
|
||||
u4Byte nCRCErr_CCK;
|
||||
u4Byte nCRCErr_11g;
|
||||
u4Byte nCRCErr_11n;
|
||||
u4Byte nCRCErr_11nAgg;
|
||||
|
||||
BOOLEAN bCCKLock;
|
||||
BOOLEAN bPreCCKLock;
|
||||
BOOLEAN bCCKEverLock;
|
||||
u1Byte nCoexTableType;
|
||||
|
||||
BOOLEAN bForceLpsOn;
|
||||
u4Byte wrongProfileNotification;
|
||||
}COEX_STA_8703B_1ANT, *PCOEX_STA_8703B_1ANT;
|
||||
|
||||
#define BT_8703B_1ANT_ANTDET_PSD_POINTS 256 //MAX:1024
|
||||
#define BT_8703B_1ANT_ANTDET_PSD_AVGNUM 1 //MAX:3
|
||||
#define BT_8703B_1ANT_ANTDET_BUF_LEN 16
|
||||
|
||||
typedef struct _PSDSCAN_STA_8703B_1ANT{
|
||||
|
||||
u4Byte nAntDet_BTLEChannel; //BT LE Channel ex:2412
|
||||
u4Byte nAntDet_BTTxTime;
|
||||
u4Byte nAntDet_PrePSDScanPeakVal;
|
||||
BOOLEAN nAntDet_IsAntDetAvailable;
|
||||
u4Byte nAntDet_PSDScanPeakVal;
|
||||
BOOLEAN nAntDet_IsBTReplyAvailable;
|
||||
u4Byte nAntDet_PSDScanPeakFreq;
|
||||
|
||||
u1Byte nAntDet_Result;
|
||||
u1Byte nAntDet_PeakVal[BT_8703B_1ANT_ANTDET_BUF_LEN];
|
||||
u1Byte nAntDet_PeakFreq[BT_8703B_1ANT_ANTDET_BUF_LEN];
|
||||
u4Byte bAntDet_TryCount;
|
||||
u4Byte bAntDet_FailCount;
|
||||
u4Byte nAntDet_IntevalCount;
|
||||
u4Byte nAntDet_ThresOffset;
|
||||
|
||||
u4Byte nRealCentFreq;
|
||||
s4Byte nRealOffset;
|
||||
u4Byte nRealSpan;
|
||||
|
||||
u4Byte nPSDBandWidth; //unit: Hz
|
||||
u4Byte nPSDPoint; //128/256/512/1024
|
||||
u4Byte nPSDReport[1024]; //unit:dB (20logx), 0~255
|
||||
u4Byte nPSDReport_MaxHold[1024]; //unit:dB (20logx), 0~255
|
||||
u4Byte nPSDStartPoint;
|
||||
u4Byte nPSDStopPoint;
|
||||
u4Byte nPSDMaxValuePoint;
|
||||
u4Byte nPSDMaxValue;
|
||||
u4Byte nPSDStartBase;
|
||||
u4Byte nPSDAvgNum; // 1/8/16/32
|
||||
u4Byte nPSDGenCount;
|
||||
BOOLEAN bIsPSDRunning;
|
||||
BOOLEAN bIsPSDShowMaxOnly;
|
||||
} PSDSCAN_STA_8703B_1ANT, *PPSDSCAN_STA_8703B_1ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8703b1ant_PowerOnSetting(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_PreLoadFirmware(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_RfStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_CoexDmReset(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_AntennaDetection(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u4Byte centFreq,
|
||||
IN u4Byte offset,
|
||||
IN u4Byte span,
|
||||
IN u4Byte seconds
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_AntennaIsolation(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u4Byte centFreq,
|
||||
IN u4Byte offset,
|
||||
IN u4Byte span,
|
||||
IN u4Byte seconds
|
||||
);
|
||||
|
||||
VOID
|
||||
EXhalbtc8703b1ant_PSDScan(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u4Byte centFreq,
|
||||
IN u4Byte offset,
|
||||
IN u4Byte span,
|
||||
IN u4Byte seconds
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b1ant_DisplayAntDetection(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,228 @@
|
|||
//===========================================
|
||||
// The following is for 8703B 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8703B_2ANT 1
|
||||
|
||||
|
||||
#define BT_INFO_8703B_2ANT_B_FTP BIT7
|
||||
#define BT_INFO_8703B_2ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8703B_2ANT_B_HID BIT5
|
||||
#define BT_INFO_8703B_2ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8703B_2ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8703B_2ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8703B_2ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8703B_2ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8703B_2ANT 2
|
||||
|
||||
|
||||
#define BT_8703B_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
|
||||
#define BT_8703B_2ANT_BT_RSSI_COEXSWITCH_THRES 46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
|
||||
|
||||
typedef enum _BT_INFO_SRC_8703B_2ANT{
|
||||
BT_INFO_SRC_8703B_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8703B_2ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8703B_2ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8703B_2ANT_MAX
|
||||
}BT_INFO_SRC_8703B_2ANT,*PBT_INFO_SRC_8703B_2ANT;
|
||||
|
||||
typedef enum _BT_8703B_2ANT_BT_STATUS{
|
||||
BT_8703B_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8703B_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8703B_2ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8703B_2ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8703B_2ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8703B_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8703B_2ANT_BT_STATUS_MAX
|
||||
}BT_8703B_2ANT_BT_STATUS,*PBT_8703B_2ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8703B_2ANT_COEX_ALGO{
|
||||
BT_8703B_2ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8703B_2ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8703B_2ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8703B_2ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8703B_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
|
||||
BT_8703B_2ANT_COEX_ALGO_PANEDR = 0x5,
|
||||
BT_8703B_2ANT_COEX_ALGO_PANHS = 0x6,
|
||||
BT_8703B_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
|
||||
BT_8703B_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
|
||||
BT_8703B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
|
||||
BT_8703B_2ANT_COEX_ALGO_HID_A2DP = 0xa,
|
||||
BT_8703B_2ANT_COEX_ALGO_MAX = 0xb,
|
||||
}BT_8703B_2ANT_COEX_ALGO,*PBT_8703B_2ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8703B_2ANT{
|
||||
// fw mechanism
|
||||
u1Byte preBtDecPwrLvl;
|
||||
u1Byte curBtDecPwrLvl;
|
||||
u1Byte preFwDacSwingLvl;
|
||||
u1Byte curFwDacSwingLvl;
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
BOOLEAN bPreIgnoreWlanAct;
|
||||
u1Byte prePsTdma;
|
||||
u1Byte curPsTdma;
|
||||
u1Byte psTdmaPara[5];
|
||||
u1Byte psTdmaDuAdjType;
|
||||
BOOLEAN bResetTdmaAdjust;
|
||||
BOOLEAN bAutoTdmaAdjust;
|
||||
BOOLEAN bPrePsTdmaOn;
|
||||
BOOLEAN bCurPsTdmaOn;
|
||||
BOOLEAN bPreBtAutoReport;
|
||||
BOOLEAN bCurBtAutoReport;
|
||||
|
||||
// sw mechanism
|
||||
BOOLEAN bPreRfRxLpfShrink;
|
||||
BOOLEAN bCurRfRxLpfShrink;
|
||||
u4Byte btRf0x1eBackup;
|
||||
BOOLEAN bPreLowPenaltyRa;
|
||||
BOOLEAN bCurLowPenaltyRa;
|
||||
BOOLEAN bPreDacSwingOn;
|
||||
u4Byte preDacSwingLvl;
|
||||
BOOLEAN bCurDacSwingOn;
|
||||
u4Byte curDacSwingLvl;
|
||||
BOOLEAN bPreAdcBackOff;
|
||||
BOOLEAN bCurAdcBackOff;
|
||||
BOOLEAN bPreAgcTableEn;
|
||||
BOOLEAN bCurAgcTableEn;
|
||||
u4Byte preVal0x6c0;
|
||||
u4Byte curVal0x6c0;
|
||||
u4Byte preVal0x6c4;
|
||||
u4Byte curVal0x6c4;
|
||||
u4Byte preVal0x6c8;
|
||||
u4Byte curVal0x6c8;
|
||||
u1Byte preVal0x6cc;
|
||||
u1Byte curVal0x6cc;
|
||||
BOOLEAN bLimitedDig;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
u1Byte curAlgorithm;
|
||||
u1Byte btStatus;
|
||||
u1Byte wifiChnlInfo[3];
|
||||
|
||||
BOOLEAN bNeedRecover0x948;
|
||||
u4Byte backup0x948;
|
||||
|
||||
u1Byte preLps;
|
||||
u1Byte curLps;
|
||||
u1Byte preRpwm;
|
||||
u1Byte curRpwm;
|
||||
|
||||
BOOLEAN bIsSwitchTo1dot5Ant;
|
||||
} COEX_DM_8703B_2ANT, *PCOEX_DM_8703B_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8703B_2ANT{
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bHidExist;
|
||||
BOOLEAN bPanExist;
|
||||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
BOOLEAN bBtTxRxMask;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8703B_2ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8703B_2ANT_MAX];
|
||||
BOOLEAN bBtWhckTest;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
|
||||
u4Byte nCRCOK_CCK;
|
||||
u4Byte nCRCOK_11g;
|
||||
u4Byte nCRCOK_11n;
|
||||
u4Byte nCRCOK_11nAgg;
|
||||
|
||||
u4Byte nCRCErr_CCK;
|
||||
u4Byte nCRCErr_11g;
|
||||
u4Byte nCRCErr_11n;
|
||||
u4Byte nCRCErr_11nAgg;
|
||||
|
||||
u1Byte nCoexTableType;
|
||||
BOOLEAN bForceLpsOn;
|
||||
|
||||
u1Byte disVerInfoCnt;
|
||||
}COEX_STA_8703B_2ANT, *PCOEX_STA_8703B_2ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8703b2ant_PowerOnSetting(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_PreLoadFirmware(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8703b2ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
||||
|
|
@ -13,6 +13,11 @@
|
|||
// include files
|
||||
//============================================================
|
||||
#include "Mp_Precomp.h"
|
||||
|
||||
#if WPP_SOFTWARE_TRACE
|
||||
#include "HalBtc8723a1Ant.tmh"
|
||||
#endif
|
||||
|
||||
#if(BT_30_SUPPORT == 1)
|
||||
//============================================================
|
||||
// Global variables, these are static variables
|
||||
|
|
@ -52,7 +57,7 @@ halbtc8723a1ant_Reg0x550Bit3(
|
|||
u1tmp &= ~BIT3;
|
||||
}
|
||||
pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x550, u1tmp);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], set 0x550[3]=%d\n", (bSet? 1:0)));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], set 0x550[3]=%d\n", (bSet? 1:0)));
|
||||
}
|
||||
|
||||
VOID
|
||||
|
|
@ -66,7 +71,7 @@ halbtc8723a1ant_NotifyFwScan(
|
|||
if(BTC_SCAN_START == scanType)
|
||||
H2C_Parameter[0] = 0x1;
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Notify FW for wifi scan, write 0x3b=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Notify FW for wifi scan, write 0x3b=0x%x\n",
|
||||
H2C_Parameter[0]));
|
||||
|
||||
pBtCoexist->fBtcFillH2c(pBtCoexist, 0x3b, 1, H2C_Parameter);
|
||||
|
|
@ -83,7 +88,7 @@ halbtc8723a1ant_QueryBtInfo(
|
|||
|
||||
H2C_Parameter[0] |= BIT0; // trigger
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], Query Bt Info, FW write 0x38=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], Query Bt Info, FW write 0x38=0x%x\n",
|
||||
H2C_Parameter[0]));
|
||||
|
||||
pBtCoexist->fBtcFillH2c(pBtCoexist, 0x38, 1, H2C_Parameter);
|
||||
|
|
@ -98,7 +103,7 @@ halbtc8723a1ant_SetSwRfRxLpfCorner(
|
|||
if(bRxRfShrinkOn)
|
||||
{
|
||||
//Shrink RF Rx LPF corner
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Shrink RF Rx LPF corner!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Shrink RF Rx LPF corner!!\n"));
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, 0xf0ff7);
|
||||
}
|
||||
else
|
||||
|
|
@ -107,7 +112,7 @@ halbtc8723a1ant_SetSwRfRxLpfCorner(
|
|||
// After initialized, we can use pCoexDm->btRf0x1eBackup
|
||||
if(pBtCoexist->bInitilized)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Resume RF Rx LPF corner!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Resume RF Rx LPF corner!!\n"));
|
||||
pBtCoexist->fBtcSetRfReg(pBtCoexist, BTC_RF_A, 0x1e, 0xfffff, pCoexDm->btRf0x1eBackup);
|
||||
}
|
||||
}
|
||||
|
|
@ -120,15 +125,12 @@ halbtc8723a1ant_RfShrink(
|
|||
IN BOOLEAN bRxRfShrinkOn
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn Rx RF Shrink = %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn Rx RF Shrink = %s\n",
|
||||
(bForceExec? "force to":""), ((bRxRfShrinkOn)? "ON":"OFF")));
|
||||
pCoexDm->bCurRfRxLpfShrink = bRxRfShrinkOn;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreRfRxLpfShrink=%d, bCurRfRxLpfShrink=%d\n",
|
||||
pCoexDm->bPreRfRxLpfShrink, pCoexDm->bCurRfRxLpfShrink));
|
||||
|
||||
if(pCoexDm->bPreRfRxLpfShrink == pCoexDm->bCurRfRxLpfShrink)
|
||||
return;
|
||||
}
|
||||
|
|
@ -149,12 +151,12 @@ halbtc8723a1ant_SetSwPenaltyTxRateAdaptive(
|
|||
tmpU1 |= BIT0;
|
||||
if(bLowPenaltyRa)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Tx rate adaptive, set low penalty!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Tx rate adaptive, set low penalty!!\n"));
|
||||
tmpU1 &= ~BIT2;
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], Tx rate adaptive, set normal!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Tx rate adaptive, set normal!!\n"));
|
||||
tmpU1 |= BIT2;
|
||||
}
|
||||
|
||||
|
|
@ -169,15 +171,12 @@ halbtc8723a1ant_LowPenaltyRa(
|
|||
)
|
||||
{
|
||||
return;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s turn LowPenaltyRA = %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn LowPenaltyRA = %s\n",
|
||||
(bForceExec? "force to":""), ((bLowPenaltyRa)? "ON":"OFF")));
|
||||
pCoexDm->bCurLowPenaltyRa = bLowPenaltyRa;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], bPreLowPenaltyRa=%d, bCurLowPenaltyRa=%d\n",
|
||||
pCoexDm->bPreLowPenaltyRa, pCoexDm->bCurLowPenaltyRa));
|
||||
|
||||
if(pCoexDm->bPreLowPenaltyRa == pCoexDm->bCurLowPenaltyRa)
|
||||
return;
|
||||
}
|
||||
|
|
@ -194,13 +193,13 @@ halbtc8723a1ant_SetCoexTable(
|
|||
IN u1Byte val0x6cc
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c0=0x%x\n", val0x6c0));
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set coex table, set 0x6c0=0x%x\n", val0x6c0));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c0, val0x6c0);
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8));
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set coex table, set 0x6c8=0x%x\n", val0x6c8));
|
||||
pBtCoexist->fBtcWrite4Byte(pBtCoexist, 0x6c8, val0x6c8);
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_EXEC, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc));
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set coex table, set 0x6cc=0x%x\n", val0x6cc));
|
||||
pBtCoexist->fBtcWrite1Byte(pBtCoexist, 0x6cc, val0x6cc);
|
||||
}
|
||||
|
||||
|
|
@ -213,19 +212,14 @@ halbtc8723a1ant_CoexTable(
|
|||
IN u1Byte val0x6cc
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW, ("[BTCoex], %s write Coex Table 0x6c0=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s write Coex Table 0x6c0=0x%x, 0x6c8=0x%x, 0x6cc=0x%x\n",
|
||||
(bForceExec? "force to":""), val0x6c0, val0x6c8, val0x6cc));
|
||||
pCoexDm->curVal0x6c0 = val0x6c0;
|
||||
pCoexDm->curVal0x6c8 = val0x6c8;
|
||||
pCoexDm->curVal0x6cc = val0x6cc;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], preVal0x6c0=0x%x, preVal0x6c8=0x%x, preVal0x6cc=0x%x !!\n",
|
||||
pCoexDm->preVal0x6c0, pCoexDm->preVal0x6c8, pCoexDm->preVal0x6cc));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_SW_DETAIL, ("[BTCoex], curVal0x6c0=0x%x, curVal0x6c8=0x%x, curVal0x6cc=0x%x !!\n",
|
||||
pCoexDm->curVal0x6c0, pCoexDm->curVal0x6c8, pCoexDm->curVal0x6cc));
|
||||
|
||||
{
|
||||
if( (pCoexDm->preVal0x6c0 == pCoexDm->curVal0x6c0) &&
|
||||
(pCoexDm->preVal0x6c8 == pCoexDm->curVal0x6c8) &&
|
||||
(pCoexDm->preVal0x6cc == pCoexDm->curVal0x6cc) )
|
||||
|
|
@ -251,7 +245,7 @@ halbtc8723a1ant_SetFwIgnoreWlanAct(
|
|||
H2C_Parameter[0] |= BIT0; // function enable
|
||||
}
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x25=0x%x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], set FW for BT Ignore Wlan_Act, FW write 0x25=0x%x\n",
|
||||
H2C_Parameter[0]));
|
||||
|
||||
pBtCoexist->fBtcFillH2c(pBtCoexist, 0x25, 1, H2C_Parameter);
|
||||
|
|
@ -264,15 +258,12 @@ halbtc8723a1ant_IgnoreWlanAct(
|
|||
IN BOOLEAN bEnable
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn Ignore WlanAct %s\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn Ignore WlanAct %s\n",
|
||||
(bForceExec? "force to":""), (bEnable? "ON":"OFF")));
|
||||
pCoexDm->bCurIgnoreWlanAct = bEnable;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPreIgnoreWlanAct = %d, bCurIgnoreWlanAct = %d!!\n",
|
||||
pCoexDm->bPreIgnoreWlanAct, pCoexDm->bCurIgnoreWlanAct));
|
||||
|
||||
if(pCoexDm->bPreIgnoreWlanAct == pCoexDm->bCurIgnoreWlanAct)
|
||||
return;
|
||||
}
|
||||
|
|
@ -306,7 +297,7 @@ halbtc8723a1ant_SetFwPstdma(
|
|||
{
|
||||
if(type != 5 && type != 12)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], FW for 1Ant AP mode\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], FW for 1Ant AP mode\n"));
|
||||
realByte1 &= ~BIT4;
|
||||
realByte1 |= BIT5;
|
||||
|
||||
|
|
@ -327,7 +318,7 @@ halbtc8723a1ant_SetFwPstdma(
|
|||
pCoexDm->psTdmaPara[3] = byte4;
|
||||
pCoexDm->psTdmaPara[4] = realByte5;
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_EXEC, ("[BTCoex], FW write 0x3a(5bytes)=0x%x%08x\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], FW write 0x3a(5bytes)=0x%x%08x\n",
|
||||
H2C_Parameter[0],
|
||||
H2C_Parameter[1]<<24|H2C_Parameter[2]<<16|H2C_Parameter[3]<<8|H2C_Parameter[4]));
|
||||
|
||||
|
|
@ -342,18 +333,13 @@ halbtc8723a1ant_PsTdma(
|
|||
IN u1Byte type
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW, ("[BTCoex], %s turn %s PS TDMA, type=%d\n",
|
||||
RT_TRACE(COMP_COEX, DBG_TRACE, ("[BTCoex], %s turn %s PS TDMA, type=%d\n",
|
||||
(bForceExec? "force to":""), (bTurnOn? "ON":"OFF"), type));
|
||||
pCoexDm->bCurPsTdmaOn = bTurnOn;
|
||||
pCoexDm->curPsTdma = type;
|
||||
|
||||
if(!bForceExec)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], bPrePsTdmaOn = %d, bCurPsTdmaOn = %d!!\n",
|
||||
pCoexDm->bPrePsTdmaOn, pCoexDm->bCurPsTdmaOn));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE_FW_DETAIL, ("[BTCoex], prePsTdma = %d, curPsTdma = %d!!\n",
|
||||
pCoexDm->prePsTdma, pCoexDm->curPsTdma));
|
||||
|
||||
if( (pCoexDm->bPrePsTdmaOn == pCoexDm->bCurPsTdmaOn) &&
|
||||
(pCoexDm->prePsTdma == pCoexDm->curPsTdma) )
|
||||
return;
|
||||
|
|
@ -515,9 +501,9 @@ halbtc8723a1ant_MonitorBtCtr(
|
|||
pCoexSta->lowPriorityTx = regLPTx;
|
||||
pCoexSta->lowPriorityRx = regLPRx;
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], High Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n",
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], High Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n",
|
||||
regHPTxRx, regHPTx, regHPTx, regHPRx, regHPRx));
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], Low Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n",
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Low Priority Tx/Rx (reg 0x%x)=0x%x(%d)/0x%x(%d)\n",
|
||||
regLPTxRx, regLPTx, regLPTx, regLPRx, regLPRx));
|
||||
|
||||
// reset counter
|
||||
|
|
@ -554,23 +540,23 @@ halbtc8723a1ant_MonitorBtEnableDisable(
|
|||
btDisableCnt = 0;
|
||||
bBtDisabled = FALSE;
|
||||
pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_DISABLE, &bBtDisabled);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is enabled !!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is enabled !!\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
btDisableCnt++;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], bt all counters=0, %d times!!\n",
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], bt all counters=0, %d times!!\n",
|
||||
btDisableCnt));
|
||||
if(btDisableCnt >= 2)
|
||||
{
|
||||
bBtDisabled = TRUE;
|
||||
pBtCoexist->fBtcSet(pBtCoexist, BTC_SET_BL_BT_DISABLE, &bBtDisabled);
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is disabled !!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is disabled !!\n"));
|
||||
}
|
||||
}
|
||||
if(bPreBtDisabled != bBtDisabled)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_BT_MONITOR, ("[BTCoex], BT is from %s to %s!!\n",
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT is from %s to %s!!\n",
|
||||
(bPreBtDisabled ? "disabled":"enabled"),
|
||||
(bBtDisabled ? "disabled":"enabled")));
|
||||
bPreBtDisabled = bBtDisabled;
|
||||
|
|
@ -600,7 +586,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_U4_WIFI_BW, &wifiBw);
|
||||
btState = pCoexDm->btStatus;
|
||||
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], TdmaDurationAdjust()\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], TdmaDurationAdjust()\n"));
|
||||
if(pCoexDm->psTdmaGlobalCnt != pCoexDm->psTdmaMonitorCnt)
|
||||
{
|
||||
pCoexDm->psTdmaMonitorCnt = 0;
|
||||
|
|
@ -608,7 +594,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
}
|
||||
if(pCoexDm->psTdmaMonitorCnt == 0)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], first run BT A2DP + WiFi busy state!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], first run BT A2DP + WiFi busy state!!\n"));
|
||||
if(btState == BT_STATE_8723A_1ANT_ACL_ONLY_BUSY)
|
||||
{
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 1);
|
||||
|
|
@ -631,7 +617,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
{
|
||||
//accquire the BT TRx retry count from BT_Info byte2
|
||||
retryCount = pCoexSta->btRetryCnt;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], retryCount = %d\n", retryCount));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], retryCount = %d\n", retryCount));
|
||||
result = 0;
|
||||
WaitCount++;
|
||||
|
||||
|
|
@ -650,7 +636,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
up = 0;
|
||||
dn = 0;
|
||||
result = 1;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Increase wifi duration!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Increase wifi duration!!\n"));
|
||||
}
|
||||
}
|
||||
else if (retryCount <= 3) // <=3 retry in the last 2-second duration
|
||||
|
|
@ -676,7 +662,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
dn = 0;
|
||||
WaitCount = 0;
|
||||
result = -1;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Decrease wifi duration for retryCounter<3!!\n"));
|
||||
}
|
||||
}
|
||||
else //retry count > 3, ¥un1¦¸ retry count > 3, «h½Õ¯¶WiFi duration
|
||||
|
|
@ -694,17 +680,17 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
dn = 0;
|
||||
WaitCount = 0;
|
||||
result = -1;
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Decrease wifi duration for retryCounter>3!!\n"));
|
||||
}
|
||||
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], BT TxRx counter H+L <= 1200\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], BT TxRx counter H+L <= 1200\n"));
|
||||
if(btState != BT_STATE_8723A_1ANT_ACL_ONLY_BUSY)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], NOT ACL only busy!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], NOT ACL only busy!\n"));
|
||||
if(BTC_WIFI_BW_HT40 != wifiBw)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], 20MHz\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 20MHz\n"));
|
||||
if(result == -1)
|
||||
{
|
||||
if(pCoexDm->curPsTdma == 22)
|
||||
|
|
@ -748,14 +734,14 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
(pCoexDm->psTdmaDuAdjType != 24) &&
|
||||
(pCoexDm->psTdmaDuAdjType != 25) )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], duration case out of handle!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], duration case out of handle!!\n"));
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 23);
|
||||
pCoexDm->psTdmaDuAdjType = 23;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], 40MHz\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 40MHz\n"));
|
||||
if(result == -1)
|
||||
{
|
||||
if(pCoexDm->curPsTdma == 23)
|
||||
|
|
@ -799,7 +785,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
(pCoexDm->psTdmaDuAdjType != 25) &&
|
||||
(pCoexDm->psTdmaDuAdjType != 27) )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], duration case out of handle!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], duration case out of handle!!\n"));
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 24);
|
||||
pCoexDm->psTdmaDuAdjType = 24;
|
||||
}
|
||||
|
|
@ -807,7 +793,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], ACL only busy\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], ACL only busy\n"));
|
||||
if (result == -1)
|
||||
{
|
||||
if(pCoexDm->curPsTdma == 1)
|
||||
|
|
@ -852,7 +838,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
(pCoexDm->psTdmaDuAdjType != 9) &&
|
||||
(pCoexDm->psTdmaDuAdjType != 11) )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], duration case out of handle!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], duration case out of handle!!\n"));
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 2);
|
||||
pCoexDm->psTdmaDuAdjType = 2;
|
||||
}
|
||||
|
|
@ -864,7 +850,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
// then we have to adjust it back to the previous record one.
|
||||
if(pCoexDm->curPsTdma != pCoexDm->psTdmaDuAdjType)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], PsTdma type dismatch!!!, curPsTdma=%d, recordPsTdma=%d\n",
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], PsTdma type dismatch!!!, curPsTdma=%d, recordPsTdma=%d\n",
|
||||
pCoexDm->curPsTdma, pCoexDm->psTdmaDuAdjType));
|
||||
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan);
|
||||
|
|
@ -877,7 +863,7 @@ halbtc8723a1ant_TdmaDurationAdjust(
|
|||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], roaming/link/scan is under progress, will adjust next time!!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], roaming/link/scan is under progress, will adjust next time!!!\n"));
|
||||
}
|
||||
}
|
||||
pCoexDm->psTdmaMonitorCnt++;
|
||||
|
|
@ -899,14 +885,14 @@ halbtc8723a1ant_CoexForWifiConnect(
|
|||
|
||||
if(bWifiConnected)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi connected!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], wifi connected!!\n"));
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_BUSY, &bWifiBusy);
|
||||
|
||||
if( !bWifiBusy &&
|
||||
((BT_STATE_8723A_1ANT_NO_CONNECTION == btState) ||
|
||||
(BT_STATE_8723A_1ANT_CONNECT_IDLE == btState)) )
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], [Wifi is idle] or [Bt is non connected idle or Bt is connected idle]!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], [Wifi is idle] or [Bt is non connected idle or Bt is connected idle]!!\n"));
|
||||
|
||||
if(BT_STATE_8723A_1ANT_NO_CONNECTION == btState)
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 9);
|
||||
|
|
@ -965,14 +951,14 @@ halbtc8723a1ant_CoexForWifiConnect(
|
|||
}
|
||||
break;
|
||||
default:
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], error!!!, undefined case in halbtc8723a1ant_CoexForWifiConnect()!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], error!!!, undefined case in halbtc8723a1ant_CoexForWifiConnect()!!\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_ALGORITHM, ALGO_TRACE, ("[BTCoex], wifi is disconnected!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], wifi is disconnected!!\n"));
|
||||
}
|
||||
|
||||
pCoexDm->psTdmaGlobalCnt++;
|
||||
|
|
@ -1021,7 +1007,7 @@ EXhalbtc8723a1ant_InitHwConfig(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], 1Ant Init HW Config!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 1Ant Init HW Config!!\n"));
|
||||
|
||||
// backup rf 0x1e value
|
||||
pCoexDm->btRf0x1eBackup =
|
||||
|
|
@ -1053,7 +1039,7 @@ EXhalbtc8723a1ant_InitCoexDm(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_INIT, ("[BTCoex], Coex Mechanism Init!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Coex Mechanism Init!!\n"));
|
||||
|
||||
halbtc8723a1ant_InitCoexDm(pBtCoexist);
|
||||
}
|
||||
|
|
@ -1090,7 +1076,7 @@ EXhalbtc8723a1ant_DisplayCoexInfo(
|
|||
pCoexDm->wifiChnlInfo[0], pCoexDm->wifiChnlInfo[1],
|
||||
pCoexDm->wifiChnlInfo[2]);
|
||||
CL_PRINTF(cliBuf);
|
||||
|
||||
|
||||
// wifi status
|
||||
CL_SPRINTF(cliBuf, BT_TMP_BUF_SIZE, "\r\n %-35s", "============[Wifi Status]============");
|
||||
CL_PRINTF(cliBuf);
|
||||
|
|
@ -1236,12 +1222,12 @@ EXhalbtc8723a1ant_IpsNotify(
|
|||
{
|
||||
if(BTC_IPS_ENTER == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS ENTER notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], IPS ENTER notify\n"));
|
||||
halbtc8723a1ant_CoexAllOff(pBtCoexist);
|
||||
}
|
||||
else if(BTC_IPS_LEAVE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], IPS LEAVE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], IPS LEAVE notify\n"));
|
||||
//halbtc8723a1ant_InitCoexDm(pBtCoexist);
|
||||
}
|
||||
}
|
||||
|
|
@ -1254,11 +1240,11 @@ EXhalbtc8723a1ant_LpsNotify(
|
|||
{
|
||||
if(BTC_LPS_ENABLE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS ENABLE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], LPS ENABLE notify\n"));
|
||||
}
|
||||
else if(BTC_LPS_DISABLE == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], LPS DISABLE notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], LPS DISABLE notify\n"));
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 8);
|
||||
}
|
||||
}
|
||||
|
|
@ -1282,7 +1268,7 @@ EXhalbtc8723a1ant_ScanNotify(
|
|||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
|
||||
if(BTC_SCAN_START == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN START notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCAN START notify\n"));
|
||||
if(!bWifiConnected) // non-connected scan
|
||||
{
|
||||
//set 0x550[3]=1 before PsTdma
|
||||
|
|
@ -1293,7 +1279,7 @@ EXhalbtc8723a1ant_ScanNotify(
|
|||
}
|
||||
else if(BTC_SCAN_FINISH == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], SCAN FINISH notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], SCAN FINISH notify\n"));
|
||||
if(!bWifiConnected) // non-connected scan
|
||||
{
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 0);
|
||||
|
|
@ -1322,14 +1308,14 @@ EXhalbtc8723a1ant_ConnectNotify(
|
|||
{
|
||||
if(BTC_ASSOCIATE_START == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT START notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CONNECT START notify\n"));
|
||||
//set 0x550[3]=1 before PsTdma
|
||||
halbtc8723a1ant_Reg0x550Bit3(pBtCoexist, TRUE);
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, TRUE, 8); // extend wifi slot
|
||||
}
|
||||
else if(BTC_ASSOCIATE_FINISH == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], CONNECT FINISH notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], CONNECT FINISH notify\n"));
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_CONNECTED, &bWifiConnected);
|
||||
if(!bWifiConnected) // non-connected scan
|
||||
{
|
||||
|
|
@ -1351,11 +1337,11 @@ EXhalbtc8723a1ant_MediaStatusNotify(
|
|||
{
|
||||
if(BTC_MEDIA_CONNECT == type)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA connect notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], MEDIA connect notify\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], MEDIA disconnect notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], MEDIA disconnect notify\n"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1367,7 +1353,7 @@ EXhalbtc8723a1ant_SpecialPacketNotify(
|
|||
{
|
||||
if(type == BTC_PACKET_DHCP)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], DHCP Packet notify\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], DHCP Packet notify\n"));
|
||||
if(pBtCoexist->btInfo.bBtDisabled)
|
||||
{
|
||||
halbtc8723a1ant_PsTdma(pBtCoexist, NORMAL_EXEC, FALSE, 9);
|
||||
|
|
@ -1395,7 +1381,7 @@ EXhalbtc8723a1ant_BtInfoNotify(
|
|||
rspSource = BT_INFO_SRC_8723A_1ANT_BT_RSP;
|
||||
pCoexSta->btInfoC2hCnt[rspSource]++;
|
||||
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], Bt info[%d], length=%d, hex data=[", rspSource, length));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], Bt info[%d], length=%d, hex data=[", rspSource, length));
|
||||
for(i=0; i<length; i++)
|
||||
{
|
||||
pCoexSta->btInfoC2h[rspSource][i] = tmpBuf[i];
|
||||
|
|
@ -1403,11 +1389,11 @@ EXhalbtc8723a1ant_BtInfoNotify(
|
|||
btInfo = tmpBuf[i];
|
||||
if(i == length-1)
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x]\n", tmpBuf[i]));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("0x%02x]\n", tmpBuf[i]));
|
||||
}
|
||||
else
|
||||
{
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("0x%02x, ", tmpBuf[i]));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("0x%02x, ", tmpBuf[i]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1508,7 +1494,7 @@ EXhalbtc8723a1ant_Periodical(
|
|||
{
|
||||
BOOLEAN bScan=FALSE, bLink=FALSE, bRoam=FALSE, bWifiConnected=FALSE;
|
||||
|
||||
BTC_PRINT(BTC_MSG_INTERFACE, INTF_NOTIFY, ("[BTCoex], 1Ant Periodical!!\n"));
|
||||
RT_TRACE(COMP_COEX, DBG_LOUD, ("[BTCoex], 1Ant Periodical!!\n"));
|
||||
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_SCAN, &bScan);
|
||||
pBtCoexist->fBtcGet(pBtCoexist, BTC_GET_BL_WIFI_LINK, &bLink);
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -17,7 +17,16 @@
|
|||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2
|
||||
|
||||
#define BT_8723B_1ANT_WIFI_NOISY_THRESH 30 //max: 255
|
||||
#define BT_8723B_1ANT_WIFI_NOISY_THRESH 50 //30 //max: 255
|
||||
|
||||
//for Antenna detection
|
||||
#define BT_8723B_1ANT_ANTDET_PSDTHRES_BACKGROUND 50
|
||||
#define BT_8723B_1ANT_ANTDET_PSDTHRES_2ANT_BADISOLATION 70
|
||||
#define BT_8723B_1ANT_ANTDET_PSDTHRES_2ANT_GOODISOLATION 55
|
||||
#define BT_8723B_1ANT_ANTDET_PSDTHRES_1ANT 35
|
||||
#define BT_8723B_1ANT_ANTDET_RETRY_INTERVAL 10 //retry timer if ant det is fail, unit: second
|
||||
#define BT_8723B_1ANT_ANTDET_ENABLE 0
|
||||
#define BT_8723B_1ANT_ANTDET_COEXMECHANISMSWITCH_ENABLE 0
|
||||
|
||||
typedef enum _BT_INFO_SRC_8723B_1ANT{
|
||||
BT_INFO_SRC_8723B_1ANT_WIFI_FW = 0x0,
|
||||
|
|
@ -126,6 +135,7 @@ typedef struct _COEX_STA_8723B_1ANT{
|
|||
BOOLEAN bHidExist;
|
||||
BOOLEAN bPanExist;
|
||||
BOOLEAN bBtHiPriLinkExist;
|
||||
u1Byte nNumOfProfile;
|
||||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
|
|
@ -143,7 +153,7 @@ typedef struct _COEX_STA_8723B_1ANT{
|
|||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_1ANT_MAX];
|
||||
BOOLEAN bBtWhckTest;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
BOOLEAN bC2hBtPage; //Add for win8.1 page out issue
|
||||
BOOLEAN bC2hBtRemoteNameReq;
|
||||
BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
|
|
@ -162,11 +172,57 @@ typedef struct _COEX_STA_8723B_1ANT{
|
|||
|
||||
BOOLEAN bCCKLock;
|
||||
BOOLEAN bPreCCKLock;
|
||||
BOOLEAN bCCKEverLock;
|
||||
u1Byte nCoexTableType;
|
||||
|
||||
BOOLEAN bForceLpsOn;
|
||||
u4Byte wrongProfileNotification;
|
||||
|
||||
u1Byte nA2DPBitPool;
|
||||
u1Byte nCutVersion;
|
||||
}COEX_STA_8723B_1ANT, *PCOEX_STA_8723B_1ANT;
|
||||
|
||||
#define BT_8723B_1ANT_ANTDET_PSD_POINTS 256 //MAX:1024
|
||||
#define BT_8723B_1ANT_ANTDET_PSD_AVGNUM 1 //MAX:3
|
||||
#define BT_8723B_1ANT_ANTDET_BUF_LEN 16
|
||||
|
||||
typedef struct _PSDSCAN_STA_8723B_1ANT{
|
||||
|
||||
u4Byte nAntDet_BTLEChannel; //BT LE Channel ex:2412
|
||||
u4Byte nAntDet_BTTxTime;
|
||||
u4Byte nAntDet_PrePSDScanPeakVal;
|
||||
BOOLEAN nAntDet_IsAntDetAvailable;
|
||||
u4Byte nAntDet_PSDScanPeakVal;
|
||||
BOOLEAN nAntDet_IsBTReplyAvailable;
|
||||
u4Byte nAntDet_PSDScanPeakFreq;
|
||||
|
||||
u1Byte nAntDet_Result;
|
||||
u1Byte nAntDet_PeakVal[BT_8723B_1ANT_ANTDET_BUF_LEN];
|
||||
u1Byte nAntDet_PeakFreq[BT_8723B_1ANT_ANTDET_BUF_LEN];
|
||||
u4Byte bAntDet_TryCount;
|
||||
u4Byte bAntDet_FailCount;
|
||||
u4Byte nAntDet_IntevalCount;
|
||||
u4Byte nAntDet_ThresOffset;
|
||||
|
||||
u4Byte nRealCentFreq;
|
||||
s4Byte nRealOffset;
|
||||
u4Byte nRealSpan;
|
||||
|
||||
u4Byte nPSDBandWidth; //unit: Hz
|
||||
u4Byte nPSDPoint; //128/256/512/1024
|
||||
u4Byte nPSDReport[1024]; //unit:dB (20logx), 0~255
|
||||
u4Byte nPSDReport_MaxHold[1024]; //unit:dB (20logx), 0~255
|
||||
u4Byte nPSDStartPoint;
|
||||
u4Byte nPSDStopPoint;
|
||||
u4Byte nPSDMaxValuePoint;
|
||||
u4Byte nPSDMaxValue;
|
||||
u4Byte nPSDStartBase;
|
||||
u4Byte nPSDAvgNum; // 1/8/16/32
|
||||
u4Byte nPSDGenCount;
|
||||
BOOLEAN bIsPSDRunning;
|
||||
BOOLEAN bIsPSDShowMaxOnly;
|
||||
} PSDSCAN_STA_8723B_1ANT, *PPSDSCAN_STA_8723B_1ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
|
|
@ -249,4 +305,33 @@ VOID
|
|||
EXhalbtc8723b1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_AntennaDetection(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u4Byte centFreq,
|
||||
IN u4Byte offset,
|
||||
IN u4Byte span,
|
||||
IN u4Byte seconds
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_AntennaIsolation(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u4Byte centFreq,
|
||||
IN u4Byte offset,
|
||||
IN u4Byte span,
|
||||
IN u4Byte seconds
|
||||
);
|
||||
|
||||
VOID
|
||||
EXhalbtc8723b1ant_PSDScan(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u4Byte centFreq,
|
||||
IN u4Byte offset,
|
||||
IN u4Byte span,
|
||||
IN u4Byte seconds
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_DisplayAntDetection(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -107,6 +107,8 @@ typedef struct _COEX_DM_8723B_2ANT{
|
|||
u1Byte curLps;
|
||||
u1Byte preRpwm;
|
||||
u1Byte curRpwm;
|
||||
|
||||
BOOLEAN bIsSwitchTo1dot5Ant;
|
||||
} COEX_DM_8723B_2ANT, *PCOEX_DM_8723B_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8723B_2ANT{
|
||||
|
|
@ -131,8 +133,11 @@ typedef struct _COEX_STA_8723B_2ANT{
|
|||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_2ANT_MAX];
|
||||
BOOLEAN bBtWhckTest;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
BOOLEAN bC2hBtRemoteNameReq;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
u4Byte popEventCnt;
|
||||
u1Byte nScanAPNum;
|
||||
|
||||
u4Byte nCRCOK_CCK;
|
||||
u4Byte nCRCOK_11g;
|
||||
|
|
@ -148,6 +153,9 @@ typedef struct _COEX_STA_8723B_2ANT{
|
|||
BOOLEAN bForceLpsOn;
|
||||
|
||||
u1Byte disVerInfoCnt;
|
||||
|
||||
u1Byte nA2DPBitPool;
|
||||
u1Byte nCutVersion;
|
||||
}COEX_STA_8723B_2ANT, *PCOEX_STA_8723B_2ANT;
|
||||
|
||||
//===========================================
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,8 @@
|
|||
//===========================================
|
||||
// The following is for 8812A_1ANT BT Co-exist definition
|
||||
// The following is for 8812A 1ANT BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8812A_1ANT 1
|
||||
|
||||
#define BT_INFO_8812A_1ANT_B_FTP BIT7
|
||||
#define BT_INFO_8812A_1ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8812A_1ANT_B_HID BIT5
|
||||
|
|
@ -15,8 +17,7 @@
|
|||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8812A_1ANT 2
|
||||
|
||||
#define BTC_8812A_1ANT_SWITCH_TO_WIFI 0
|
||||
#define BTC_8812A_1ANT_SWITCH_TO_BT 1
|
||||
#define BT_8812A_1ANT_WIFI_NOISY_THRESH 30 //max: 255
|
||||
|
||||
typedef enum _BT_INFO_SRC_8812A_1ANT{
|
||||
BT_INFO_SRC_8812A_1ANT_WIFI_FW = 0x0,
|
||||
|
|
@ -61,6 +62,9 @@ typedef enum _BT_8812A_1ANT_COEX_ALGO{
|
|||
}BT_8812A_1ANT_COEX_ALGO,*PBT_8812A_1ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8812A_1ANT{
|
||||
// hw setting
|
||||
u1Byte preAntPosType;
|
||||
u1Byte curAntPosType;
|
||||
// fw mechanism
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
BOOLEAN bPreIgnoreWlanAct;
|
||||
|
|
@ -68,7 +72,7 @@ typedef struct _COEX_DM_8812A_1ANT{
|
|||
u1Byte curPsTdma;
|
||||
u1Byte psTdmaPara[5];
|
||||
u1Byte psTdmaDuAdjType;
|
||||
BOOLEAN bResetTdmaAdjust;
|
||||
BOOLEAN bAutoTdmaAdjust;
|
||||
BOOLEAN bPrePsTdmaOn;
|
||||
BOOLEAN bCurPsTdmaOn;
|
||||
BOOLEAN bPreBtAutoReport;
|
||||
|
|
@ -81,7 +85,6 @@ typedef struct _COEX_DM_8812A_1ANT{
|
|||
// sw mechanism
|
||||
BOOLEAN bPreLowPenaltyRa;
|
||||
BOOLEAN bCurLowPenaltyRa;
|
||||
BOOLEAN bPreDacSwingOn;
|
||||
u4Byte preVal0x6c0;
|
||||
u4Byte curVal0x6c0;
|
||||
u4Byte preVal0x6c4;
|
||||
|
|
@ -90,6 +93,12 @@ typedef struct _COEX_DM_8812A_1ANT{
|
|||
u4Byte curVal0x6c8;
|
||||
u1Byte preVal0x6cc;
|
||||
u1Byte curVal0x6cc;
|
||||
BOOLEAN bLimitedDig;
|
||||
|
||||
u4Byte backupArfrCnt1; // Auto Rate Fallback Retry cnt
|
||||
u4Byte backupArfrCnt2; // Auto Rate Fallback Retry cnt
|
||||
u2Byte backupRetryLimit;
|
||||
u1Byte backupAmpduMaxTime;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
|
|
@ -99,6 +108,13 @@ typedef struct _COEX_DM_8812A_1ANT{
|
|||
|
||||
u4Byte preRaMask;
|
||||
u4Byte curRaMask;
|
||||
u1Byte preArfrType;
|
||||
u1Byte curArfrType;
|
||||
u1Byte preRetryLimitType;
|
||||
u1Byte curRetryLimitType;
|
||||
u1Byte preAmpduTimeType;
|
||||
u1Byte curAmpduTimeType;
|
||||
u4Byte nArpCnt;
|
||||
|
||||
u1Byte errorCondition;
|
||||
} COEX_DM_8812A_1ANT, *PCOEX_DM_8812A_1ANT;
|
||||
|
|
@ -112,11 +128,13 @@ typedef struct _COEX_STA_8812A_1ANT{
|
|||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
u4Byte specialPktPeriodCnt;
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
s1Byte btRssi;
|
||||
BOOLEAN bBtTxRxMask;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
|
|
@ -124,8 +142,28 @@ typedef struct _COEX_STA_8812A_1ANT{
|
|||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8812A_1ANT_MAX];
|
||||
u4Byte btInfoQueryCnt;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
BOOLEAN bC2hBtPage; //Add for win8.1 page out issue
|
||||
BOOLEAN bWiFiIsHighPriTask; //Add for win8.1 page out issue
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
u4Byte popEventCnt;
|
||||
u1Byte nScanAPNum;
|
||||
|
||||
u4Byte nCRCOK_CCK;
|
||||
u4Byte nCRCOK_11g;
|
||||
u4Byte nCRCOK_11n;
|
||||
u4Byte nCRCOK_11nAgg;
|
||||
|
||||
u4Byte nCRCErr_CCK;
|
||||
u4Byte nCRCErr_11g;
|
||||
u4Byte nCRCErr_11n;
|
||||
u4Byte nCRCErr_11nAgg;
|
||||
|
||||
BOOLEAN bCCKLock;
|
||||
BOOLEAN bPreCCKLock;
|
||||
u1Byte nCoexTableType;
|
||||
|
||||
BOOLEAN bForceLpsOn;
|
||||
}COEX_STA_8812A_1ANT, *PCOEX_STA_8812A_1ANT;
|
||||
|
||||
//===========================================
|
||||
|
|
@ -136,6 +174,10 @@ EXhalbtc8812a1ant_PowerOnSetting(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_PreLoadFirmware(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
|
|
@ -181,6 +223,11 @@ EXhalbtc8812a1ant_BtInfoNotify(
|
|||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_RfStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
|
@ -190,17 +237,22 @@ EXhalbtc8812a1ant_PnpNotify(
|
|||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_Periodical(
|
||||
EXhalbtc8812a1ant_CoexDmReset(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
EXhalbtc8812a1ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_DbgControl(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte opCode,
|
||||
IN u1Byte opLen,
|
||||
IN pu1Byte pData
|
||||
IN pu1Byte pData
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -16,6 +16,8 @@
|
|||
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8812A_2ANT 2
|
||||
#define NOISY_AP_NUM_THRESH_8812A 50
|
||||
|
||||
|
||||
typedef enum _BT_INFO_SRC_8812A_2ANT{
|
||||
BT_INFO_SRC_8812A_2ANT_WIFI_FW = 0x0,
|
||||
|
|
@ -73,6 +75,9 @@ typedef struct _COEX_DM_8812A_2ANT{
|
|||
u1Byte curLps;
|
||||
u1Byte preRpwm;
|
||||
u1Byte curRpwm;
|
||||
BOOLEAN bPreEnablePTA;
|
||||
BOOLEAN bCurEnablePTA;
|
||||
|
||||
|
||||
// sw mechanism
|
||||
BOOLEAN bPreRfRxLpfShrink;
|
||||
|
|
@ -125,6 +130,7 @@ typedef struct _COEX_STA_8812A_2ANT{
|
|||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bHidExist;
|
||||
BOOLEAN bPanExist;
|
||||
BOOLEAN bAclBusy;
|
||||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
|
|
@ -134,14 +140,34 @@ typedef struct _COEX_STA_8812A_2ANT{
|
|||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preBtDisabled;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8812A_2ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8812A_2ANT_MAX];
|
||||
u4Byte prebtInfoC2hCnt_BT_RSP;
|
||||
u4Byte prebtInfoC2hCnt_BT_SEND;
|
||||
u4Byte btInfoQueryCnt;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
u1Byte nScanAPNum;
|
||||
|
||||
u4Byte nCRCOK_CCK;
|
||||
u4Byte nCRCOK_11g;
|
||||
u4Byte nCRCOK_11n;
|
||||
u4Byte nCRCOK_11nAgg;
|
||||
|
||||
u4Byte nCRCErr_CCK;
|
||||
u4Byte nCRCErr_11g;
|
||||
u4Byte nCRCErr_11n;
|
||||
u4Byte nCRCErr_11nAgg;
|
||||
|
||||
u1Byte nCoexTableType;
|
||||
BOOLEAN bForceLpsOn;
|
||||
|
||||
u1Byte disVerInfoCnt;
|
||||
|
||||
}COEX_STA_8812A_2ANT, *PCOEX_STA_8812A_2ANT;
|
||||
|
||||
//===========================================
|
||||
|
|
@ -215,4 +241,9 @@ EXhalbtc8812a2ant_DbgControl(
|
|||
IN u1Byte opLen,
|
||||
IN pu1Byte pData
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_BTOffOnNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte BTstatus
|
||||
);
|
||||
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,6 +1,9 @@
|
|||
//===========================================
|
||||
// The following is for 8821A 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8821A_2ANT 1
|
||||
|
||||
|
||||
#define BT_INFO_8821A_2ANT_B_FTP BIT7
|
||||
#define BT_INFO_8821A_2ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8821A_2ANT_B_HID BIT5
|
||||
|
|
@ -12,6 +15,10 @@
|
|||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT 2
|
||||
|
||||
|
||||
#define BT_8821A_2ANT_WIFI_RSSI_COEXSWITCH_THRES 42 //WiFi RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
|
||||
#define BT_8821A_2ANT_BT_RSSI_COEXSWITCH_THRES 46 //BT RSSI Threshold for 2-Ant TDMA/1-Ant PS-TDMA translation
|
||||
|
||||
typedef enum _BT_INFO_SRC_8821A_2ANT{
|
||||
BT_INFO_SRC_8821A_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8821A_2ANT_BT_RSP = 0x1,
|
||||
|
|
@ -20,9 +27,12 @@ typedef enum _BT_INFO_SRC_8821A_2ANT{
|
|||
}BT_INFO_SRC_8821A_2ANT,*PBT_INFO_SRC_8821A_2ANT;
|
||||
|
||||
typedef enum _BT_8821A_2ANT_BT_STATUS{
|
||||
BT_8821A_2ANT_BT_STATUS_IDLE = 0x0,
|
||||
BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8821A_2ANT_BT_STATUS_NON_IDLE = 0x2,
|
||||
BT_8821A_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8821A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8821A_2ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8821A_2ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8821A_2ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8821A_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8821A_2ANT_BT_STATUS_MAX
|
||||
}BT_8821A_2ANT_BT_STATUS,*PBT_8821A_2ANT_BT_STATUS;
|
||||
|
||||
|
|
@ -43,8 +53,8 @@ typedef enum _BT_8821A_2ANT_COEX_ALGO{
|
|||
|
||||
typedef struct _COEX_DM_8821A_2ANT{
|
||||
// fw mechanism
|
||||
BOOLEAN bPreDecBtPwr;
|
||||
BOOLEAN bCurDecBtPwr;
|
||||
u1Byte preBtDecPwrLvl;
|
||||
u1Byte curBtDecPwrLvl;
|
||||
u1Byte preFwDacSwingLvl;
|
||||
u1Byte curFwDacSwingLvl;
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
|
|
@ -54,6 +64,7 @@ typedef struct _COEX_DM_8821A_2ANT{
|
|||
u1Byte psTdmaPara[5];
|
||||
u1Byte psTdmaDuAdjType;
|
||||
BOOLEAN bResetTdmaAdjust;
|
||||
BOOLEAN bAutoTdmaAdjust;
|
||||
BOOLEAN bPrePsTdmaOn;
|
||||
BOOLEAN bCurPsTdmaOn;
|
||||
BOOLEAN bPreBtAutoReport;
|
||||
|
|
@ -88,9 +99,17 @@ typedef struct _COEX_DM_8821A_2ANT{
|
|||
u1Byte curAlgorithm;
|
||||
u1Byte btStatus;
|
||||
u1Byte wifiChnlInfo[3];
|
||||
|
||||
BOOLEAN bNeedRecover0x948;
|
||||
u4Byte backup0x948;
|
||||
|
||||
u1Byte preLps;
|
||||
u1Byte curLps;
|
||||
u1Byte preRpwm;
|
||||
u1Byte curRpwm;
|
||||
} COEX_DM_8821A_2ANT, *PCOEX_DM_8821A_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8821A_2ANT{
|
||||
typedef struct _COEX_STA_8821A_2ANT{
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bA2dpExist;
|
||||
|
|
@ -104,14 +123,31 @@ typedef struct _COEX_STA_8821A_2ANT{
|
|||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
BOOLEAN bBtTxRxMask;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8821A_2ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_2ANT_MAX];
|
||||
BOOLEAN bBtWhckTest;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
|
||||
u4Byte nCRCOK_CCK;
|
||||
u4Byte nCRCOK_11g;
|
||||
u4Byte nCRCOK_11n;
|
||||
u4Byte nCRCOK_11nAgg;
|
||||
|
||||
u4Byte nCRCErr_CCK;
|
||||
u4Byte nCRCErr_11g;
|
||||
u4Byte nCRCErr_11n;
|
||||
u4Byte nCRCErr_11nAgg;
|
||||
|
||||
u1Byte nCoexTableType;
|
||||
BOOLEAN bForceLpsOn;
|
||||
|
||||
u1Byte disVerInfoCnt;
|
||||
}COEX_STA_8821A_2ANT, *PCOEX_STA_8821A_2ANT;
|
||||
|
||||
//===========================================
|
||||
|
|
@ -122,6 +158,10 @@ EXhalbtc8821a2ant_PowerOnSetting(
|
|||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_PreLoadFirmware(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -72,29 +72,6 @@ typedef enum _BTC_CHIP_TYPE{
|
|||
BTC_CHIP_MAX
|
||||
} BTC_CHIP_TYPE, *PBTC_CHIP_TYPE;
|
||||
|
||||
typedef enum _BTC_MSG_TYPE{
|
||||
BTC_MSG_INTERFACE = 0x0,
|
||||
BTC_MSG_ALGORITHM = 0x1,
|
||||
BTC_MSG_MAX
|
||||
}BTC_MSG_TYPE;
|
||||
extern u4Byte GLBtcDbgType[];
|
||||
|
||||
// following is for BTC_MSG_INTERFACE
|
||||
#define INTF_INIT BIT0
|
||||
#define INTF_NOTIFY BIT2
|
||||
|
||||
// following is for BTC_ALGORITHM
|
||||
#define ALGO_BT_RSSI_STATE BIT0
|
||||
#define ALGO_WIFI_RSSI_STATE BIT1
|
||||
#define ALGO_BT_MONITOR BIT2
|
||||
#define ALGO_TRACE BIT3
|
||||
#define ALGO_TRACE_FW BIT4
|
||||
#define ALGO_TRACE_FW_DETAIL BIT5
|
||||
#define ALGO_TRACE_FW_EXEC BIT6
|
||||
#define ALGO_TRACE_SW BIT7
|
||||
#define ALGO_TRACE_SW_DETAIL BIT8
|
||||
#define ALGO_TRACE_SW_EXEC BIT9
|
||||
|
||||
// following is for wifi link status
|
||||
#define WIFI_STA_CONNECTED BIT0
|
||||
#define WIFI_AP_CONNECTED BIT1
|
||||
|
|
@ -106,70 +83,18 @@ extern u4Byte GLBtcDbgType[];
|
|||
#define CL_SPRINTF rsprintf
|
||||
#define CL_PRINTF DCMD_Printf
|
||||
|
||||
// The following is for dbgview print
|
||||
#if DBG
|
||||
#define BTC_PRINT(dbgtype, dbgflag, printstr)\
|
||||
{\
|
||||
if (GLBtcDbgType[dbgtype] & dbgflag)\
|
||||
{\
|
||||
DbgPrint printstr;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define BTC_PRINT_F(dbgtype, dbgflag, printstr)\
|
||||
{\
|
||||
if (GLBtcDbgType[dbgtype] & dbgflag)\
|
||||
{\
|
||||
DbgPrint("%s(): ", __FUNCTION__);\
|
||||
DbgPrint printstr;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)\
|
||||
{\
|
||||
if (GLBtcDbgType[dbgtype] & dbgflag)\
|
||||
{\
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint printstr; \
|
||||
DbgPrint(" "); \
|
||||
for( __i=0; __i<6; __i++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
}\
|
||||
}
|
||||
|
||||
#define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\
|
||||
{\
|
||||
if (GLBtcDbgType[dbgtype] & dbgflag)\
|
||||
{\
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_HexData; \
|
||||
DbgPrint(_TitleString); \
|
||||
for( __i=0; __i<(int)_HexDataLen; __i++ ) \
|
||||
{ \
|
||||
DbgPrint("%02X%s", ptr[__i], (((__i + 1) % 4) == 0)?" ":" ");\
|
||||
if (((__i + 1) % 16) == 0) DbgPrint("\n");\
|
||||
} \
|
||||
DbgPrint("\n"); \
|
||||
}\
|
||||
}
|
||||
|
||||
#else
|
||||
#define BTC_PRINT(dbgtype, dbgflag, printstr)
|
||||
#define BTC_PRINT_F(dbgtype, dbgflag, printstr)
|
||||
#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr)
|
||||
#define BTC_PRINT_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)
|
||||
#endif
|
||||
|
||||
typedef struct _BTC_BOARD_INFO{
|
||||
// The following is some board information
|
||||
u1Byte btChipType;
|
||||
u1Byte pgAntNum; // pg ant number
|
||||
u1Byte btdmAntNum; // ant number for btdm
|
||||
u1Byte btdmAntNumByAntDet; // ant number for btdm after antenna detection
|
||||
u1Byte btdmAntPos; //Bryant Add to indicate Antenna Position for (pgAntNum = 2) && (btdmAntNum =1) (DPDT+1Ant case)
|
||||
u1Byte singleAntPath; // current used for 8723b only, 1=>s0, 0=>s1
|
||||
//BOOLEAN bBtExist;
|
||||
u1Byte bTfbgaPackage; //for Antenna detect threshold
|
||||
u1Byte btdmAntDetFinish;
|
||||
u1Byte antType;
|
||||
} BTC_BOARD_INFO, *PBTC_BOARD_INFO;
|
||||
|
||||
typedef enum _BTC_DBG_OPCODE{
|
||||
|
|
@ -230,6 +155,29 @@ typedef enum _BTC_WIFI_PNP{
|
|||
BTC_WIFI_PNP_MAX
|
||||
}BTC_WIFI_PNP,*PBTC_WIFI_PNP;
|
||||
|
||||
typedef enum _BTC_IOT_PEER
|
||||
{
|
||||
BTC_IOT_PEER_UNKNOWN = 0,
|
||||
BTC_IOT_PEER_REALTEK = 1,
|
||||
BTC_IOT_PEER_REALTEK_92SE = 2,
|
||||
BTC_IOT_PEER_BROADCOM = 3,
|
||||
BTC_IOT_PEER_RALINK = 4,
|
||||
BTC_IOT_PEER_ATHEROS = 5,
|
||||
BTC_IOT_PEER_CISCO = 6,
|
||||
BTC_IOT_PEER_MERU = 7,
|
||||
BTC_IOT_PEER_MARVELL = 8,
|
||||
BTC_IOT_PEER_REALTEK_SOFTAP = 9,// peer is RealTek SOFT_AP, by Bohn, 2009.12.17
|
||||
BTC_IOT_PEER_SELF_SOFTAP = 10, // Self is SoftAP
|
||||
BTC_IOT_PEER_AIRGO = 11,
|
||||
BTC_IOT_PEER_INTEL = 12,
|
||||
BTC_IOT_PEER_RTK_APCLIENT = 13,
|
||||
BTC_IOT_PEER_REALTEK_81XX = 14,
|
||||
BTC_IOT_PEER_REALTEK_WOW = 15,
|
||||
BTC_IOT_PEER_REALTEK_JAGUAR_BCUTAP = 16,
|
||||
BTC_IOT_PEER_REALTEK_JAGUAR_CCUTAP = 17,
|
||||
BTC_IOT_PEER_MAX,
|
||||
}BTC_IOT_PEER, *PBTC_IOT_PEER;
|
||||
|
||||
//for 8723b-d cut large current issue
|
||||
typedef enum _BT_WIFI_COEX_STATE{
|
||||
BTC_WIFI_STAT_INIT,
|
||||
|
|
@ -245,6 +193,8 @@ typedef enum _BT_ANT_TYPE{
|
|||
BTC_ANT_TYPE_0,
|
||||
BTC_ANT_TYPE_1,
|
||||
BTC_ANT_TYPE_2,
|
||||
BTC_ANT_TYPE_3,
|
||||
BTC_ANT_TYPE_4,
|
||||
BTC_ANT_TYPE_MAX
|
||||
}BT_ANT_TYPE,*PBT_ANT_TYPE;
|
||||
|
||||
|
|
@ -265,6 +215,7 @@ typedef enum _BTC_GET_TYPE{
|
|||
BTC_GET_BL_WIFI_UNDER_B_MODE,
|
||||
BTC_GET_BL_EXT_SWITCH,
|
||||
BTC_GET_BL_WIFI_IS_IN_MP_MODE,
|
||||
BTC_GET_BL_IS_ASUS_8723B,
|
||||
|
||||
// type s4Byte
|
||||
BTC_GET_S4_WIFI_RSSI,
|
||||
|
|
@ -284,6 +235,7 @@ typedef enum _BTC_GET_TYPE{
|
|||
BTC_GET_U1_MAC_PHY_MODE,
|
||||
BTC_GET_U1_AP_NUM,
|
||||
BTC_GET_U1_ANT_TYPE,
|
||||
BTC_GET_U1_IOT_PEER,
|
||||
|
||||
//===== for 1Ant ======
|
||||
BTC_GET_U1_LPS_MODE,
|
||||
|
|
@ -385,6 +337,12 @@ typedef enum _BTC_ANTENNA_POS{
|
|||
BTC_ANTENNA_AT_AUX_PORT = 0x2,
|
||||
}BTC_ANTENNA_POS,*PBTC_ANTENNA_POS;
|
||||
|
||||
//Bryant Add
|
||||
typedef enum _BTC_BT_OFFON{
|
||||
BTC_BT_OFF = 0x0,
|
||||
BTC_BT_ON = 0x1,
|
||||
}BTC_BTOFFON,*PBTC_BT_OFFON;
|
||||
|
||||
typedef u1Byte
|
||||
(*BFP_BTC_R1)(
|
||||
IN PVOID pBtcContext,
|
||||
|
|
@ -487,6 +445,12 @@ typedef VOID
|
|||
IN u4Byte offset,
|
||||
IN u4Byte value
|
||||
);
|
||||
typedef BOOLEAN
|
||||
(*BFP_BTC_SET_BT_ANT_DETECTION)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u1Byte txTime,
|
||||
IN u1Byte btChnl
|
||||
);
|
||||
typedef u4Byte
|
||||
(*BFP_BTC_GET_BT_REG)(
|
||||
IN PVOID pBtcContext,
|
||||
|
|
@ -623,6 +587,8 @@ typedef struct _BTC_COEXIST{
|
|||
|
||||
BFP_BTC_GET_BT_REG fBtcGetBtReg;
|
||||
BFP_BTC_SET_BT_REG fBtcSetBtReg;
|
||||
|
||||
BFP_BTC_SET_BT_ANT_DETECTION fBtcSetBtAntDetection;
|
||||
} BTC_COEXIST, *PBTC_COEXIST;
|
||||
|
||||
extern BTC_COEXIST GLBtCoexist;
|
||||
|
|
@ -719,6 +685,14 @@ EXhalbtcoutsrc_DbgControl(
|
|||
IN pu1Byte pData
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_AntennaDetection(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u4Byte centFreq,
|
||||
IN u4Byte offset,
|
||||
IN u4Byte span,
|
||||
IN u4Byte seconds
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_StackUpdateProfileInfo(
|
||||
VOID
|
||||
);
|
||||
|
|
@ -758,5 +732,9 @@ VOID
|
|||
EXhalbtcoutsrc_DisplayBtCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_DisplayAntDetection(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
||||
#endif
|
||||
|
|
@ -39,6 +39,36 @@
|
|||
#undef bEnable
|
||||
#endif
|
||||
|
||||
#define WPP_SOFTWARE_TRACE 0
|
||||
|
||||
typedef enum _BTC_MSG_COMP_TYPE{
|
||||
COMP_COEX = 0,
|
||||
COMP_MAX
|
||||
}BTC_MSG_COMP_TYPE;
|
||||
extern u4Byte GLBtcDbgType[];
|
||||
|
||||
#define DBG_OFF 0
|
||||
#define DBG_SEC 1
|
||||
#define DBG_SERIOUS 2
|
||||
#define DBG_WARNING 3
|
||||
#define DBG_LOUD 4
|
||||
#define DBG_TRACE 5
|
||||
|
||||
#if DBG
|
||||
#ifdef RT_TRACE
|
||||
#undef RT_TRACE
|
||||
#define RT_TRACE(dbgtype, dbgflag, printstr)\
|
||||
do {\
|
||||
if (GLBtcDbgType[dbgtype] & BIT(dbgflag))\
|
||||
{\
|
||||
DbgPrint printstr;\
|
||||
}\
|
||||
} while (0)
|
||||
#endif
|
||||
#else
|
||||
#define RT_TRACE(dbgtype, dbgflag, printstr)
|
||||
#endif
|
||||
|
||||
#include "HalBtcOutSrc.h"
|
||||
#include "HalBtc8188c2Ant.h"
|
||||
#include "HalBtc8192d2Ant.h"
|
||||
|
|
@ -53,5 +83,7 @@
|
|||
#include "HalBtc8821a1Ant.h"
|
||||
#include "HalBtc8821a2Ant.h"
|
||||
#include "HalBtc8821aCsr2Ant.h"
|
||||
#include "HalBtc8703b1Ant.h"
|
||||
#include "HalBtc8703b2Ant.h"
|
||||
|
||||
#endif // __MP_PRECOMP_H__
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
|
||||
#if DEV_BUS_TYPE == RT_USB_INTERFACE
|
||||
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
#include "rtl8188e/HalEfuseMask8188E_USB.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8812A)
|
||||
#include "rtl8812a/HalEfuseMask8812A_USB.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8821A)
|
||||
#include "rtl8812a/HalEfuseMask8821A_USB.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8192E)
|
||||
#include "rtl8192e/HalEfuseMask8192E_USB.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8723B)
|
||||
#include "rtl8723b/HalEfuseMask8723B_USB.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8814A)
|
||||
#include "rtl8814a/HalEfuseMask8814A_USB.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8703B)
|
||||
#include "rtl8703b/HalEfuseMask8703B_USB.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8188F)
|
||||
#include "rtl8188f/HalEfuseMask8188F_USB.h"
|
||||
#endif
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_PCI_INTERFACE
|
||||
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
#include "rtl8188e/HalEfuseMask8188E_PCIE.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8812A)
|
||||
#include "rtl8812a/HalEfuseMask8812A_PCIE.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8821A)
|
||||
#include "rtl8812a/HalEfuseMask8821A_PCIE.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8192E)
|
||||
#include "rtl8192e/HalEfuseMask8192E_PCIE.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8723B)
|
||||
#include "rtl8723b/HalEfuseMask8723B_PCIE.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8814A)
|
||||
#include "rtl8814a/HalEfuseMask8814A_PCIE.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8703B)
|
||||
#include "rtl8703b/HalEfuseMask8703B_PCIE.h"
|
||||
#endif
|
||||
|
||||
#elif DEV_BUS_TYPE == RT_SDIO_INTERFACE
|
||||
|
||||
#if defined(CONFIG_RTL8188E)
|
||||
#include "rtl8188e/HalEfuseMask8188E_SDIO.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8703B)
|
||||
#include "rtl8703b/HalEfuseMask8703B_SDIO.h"
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_RTL8188F)
|
||||
#include "rtl8188f/HalEfuseMask8188F_SDIO.h"
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
//#include "Mp_Precomp.h"
|
||||
//#include "../odm_precomp.h"
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
#include "HalEfuseMask8188E_PCIE.h"
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MPCIE.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u1Byte Array_MP_8188E_MPCIE[] = {
|
||||
0xFF,
|
||||
0xF3,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0F,
|
||||
0xF1,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0x70,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
};
|
||||
|
||||
u2Byte
|
||||
EFUSE_GetArrayLen_MP_8188E_MPCIE(VOID)
|
||||
{
|
||||
return sizeof(Array_MP_8188E_MPCIE)/sizeof(u1Byte);
|
||||
}
|
||||
|
||||
VOID
|
||||
EFUSE_GetMaskArray_MP_8188E_MPCIE(
|
||||
IN OUT pu1Byte Array
|
||||
)
|
||||
{
|
||||
u2Byte len = EFUSE_GetArrayLen_MP_8188E_MPCIE(), i = 0;
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
Array[i] = Array_MP_8188E_MPCIE[i];
|
||||
}
|
||||
BOOLEAN
|
||||
EFUSE_IsAddressMasked_MP_8188E_MPCIE(
|
||||
IN u2Byte Offset
|
||||
)
|
||||
{
|
||||
int r = Offset/16;
|
||||
int c = (Offset%16) / 2;
|
||||
int result = 0;
|
||||
|
||||
if (c < 4) // Upper double word
|
||||
result = (Array_MP_8188E_MPCIE[r] & (0x10 << c));
|
||||
else
|
||||
result = (Array_MP_8188E_MPCIE[r] & (0x01 << (c-4)));
|
||||
|
||||
return (result > 0) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MPCIE.TXT
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
u2Byte
|
||||
EFUSE_GetArrayLen_MP_8188E_MPCIE(VOID);
|
||||
|
||||
VOID
|
||||
EFUSE_GetMaskArray_MP_8188E_MPCIE(
|
||||
IN OUT pu1Byte Array
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
EFUSE_IsAddressMasked_MP_8188E_MPCIE( // TC: Test Chip, MP: MP Chip
|
||||
IN u2Byte Offset
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
//#include "Mp_Precomp.h"
|
||||
//#include "../odm_precomp.h"
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
#include "HalEfuseMask8188E_SDIO.h"
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MSDIO.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u1Byte Array_MP_8188E_MSDIO[] = {
|
||||
0xFF,
|
||||
0xF3,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0F,
|
||||
0xF1,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
};
|
||||
|
||||
u2Byte
|
||||
EFUSE_GetArrayLen_MP_8188E_MSDIO(VOID)
|
||||
{
|
||||
return sizeof(Array_MP_8188E_MSDIO)/sizeof(u1Byte);
|
||||
}
|
||||
|
||||
VOID
|
||||
EFUSE_GetMaskArray_MP_8188E_MSDIO(
|
||||
IN OUT pu1Byte Array
|
||||
)
|
||||
{
|
||||
u2Byte len = EFUSE_GetArrayLen_MP_8188E_MSDIO(), i = 0;
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
Array[i] = Array_MP_8188E_MSDIO[i];
|
||||
}
|
||||
BOOLEAN
|
||||
EFUSE_IsAddressMasked_MP_8188E_MSDIO(
|
||||
IN u2Byte Offset
|
||||
)
|
||||
{
|
||||
int r = Offset/16;
|
||||
int c = (Offset%16) / 2;
|
||||
int result = 0;
|
||||
|
||||
if (c < 4) // Upper double word
|
||||
result = (Array_MP_8188E_MSDIO[r] & (0x10 << c));
|
||||
else
|
||||
result = (Array_MP_8188E_MSDIO[r] & (0x01 << (c-4)));
|
||||
|
||||
return (result > 0) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MSDIO.TXT
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
u2Byte
|
||||
EFUSE_GetArrayLen_MP_8188E_MSDIO(VOID);
|
||||
|
||||
VOID
|
||||
EFUSE_GetMaskArray_MP_8188E_MSDIO(
|
||||
IN OUT pu1Byte Array
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
EFUSE_IsAddressMasked_MP_8188E_MSDIO( // TC: Test Chip, MP: MP Chip
|
||||
IN u2Byte Offset
|
||||
);
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
//#include "Mp_Precomp.h"
|
||||
//#include "../odm_precomp.h"
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
#include "HalEfuseMask8188E_USB.h"
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MUSB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u1Byte Array_MP_8188E_MUSB[] = {
|
||||
0xFF,
|
||||
0xF3,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0F,
|
||||
0xF1,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0xFF,
|
||||
0x00,
|
||||
0x00,
|
||||
0xEF,
|
||||
0xF7,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
|
||||
};
|
||||
|
||||
u2Byte
|
||||
EFUSE_GetArrayLen_MP_8188E_MUSB(VOID)
|
||||
{
|
||||
return sizeof(Array_MP_8188E_MUSB)/sizeof(u1Byte);
|
||||
}
|
||||
|
||||
VOID
|
||||
EFUSE_GetMaskArray_MP_8188E_MUSB(
|
||||
IN OUT pu1Byte Array
|
||||
)
|
||||
{
|
||||
u2Byte len = EFUSE_GetArrayLen_MP_8188E_MUSB(), i = 0;
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
Array[i] = Array_MP_8188E_MUSB[i];
|
||||
}
|
||||
BOOLEAN
|
||||
EFUSE_IsAddressMasked_MP_8188E_MUSB(
|
||||
IN u2Byte Offset
|
||||
)
|
||||
{
|
||||
int r = Offset/16;
|
||||
int c = (Offset%16) / 2;
|
||||
int result = 0;
|
||||
|
||||
if (c < 4) // Upper double word
|
||||
result = (Array_MP_8188E_MUSB[r] & (0x10 << c));
|
||||
else
|
||||
result = (Array_MP_8188E_MUSB[r] & (0x01 << (c-4)));
|
||||
|
||||
return (result > 0) ? 0 : 1;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program; if not, write to the Free Software Foundation, Inc.,
|
||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MUSB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
u2Byte
|
||||
EFUSE_GetArrayLen_MP_8188E_MUSB(VOID);
|
||||
|
||||
VOID
|
||||
EFUSE_GetMaskArray_MP_8188E_MUSB(
|
||||
IN OUT pu1Byte Array
|
||||
);
|
||||
|
||||
BOOLEAN
|
||||
EFUSE_IsAddressMasked_MP_8188E_MUSB( // TC: Test Chip, MP: MP Chip
|
||||
IN u2Byte Offset
|
||||
);
|
||||
|
||||
|
||||
|
||||
792
drivers/net/wireless/rockchip_wlan/rtl8189es/hal/hal_btcoex.c
Executable file → Normal file
792
drivers/net/wireless/rockchip_wlan/rtl8189es/hal/hal_btcoex.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
3909
drivers/net/wireless/rockchip_wlan/rtl8189es/hal/hal_com.c
Executable file → Normal file
3909
drivers/net/wireless/rockchip_wlan/rtl8189es/hal/hal_com.c
Executable file → Normal file
File diff suppressed because it is too large
Load diff
118
drivers/net/wireless/rockchip_wlan/rtl8189es/hal/hal_com_phycfg.c
Executable file → Normal file
118
drivers/net/wireless/rockchip_wlan/rtl8189es/hal/hal_com_phycfg.c
Executable file → Normal file
|
|
@ -920,7 +920,7 @@ PHY_InitTxPowerByRate(
|
|||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
u8 band = 0, rfPath = 0, TxNum = 0, rate = 0, i = 0, j = 0;
|
||||
|
||||
if ( IS_HARDWARE_TYPE_8188E( pAdapter ) || IS_HARDWARE_TYPE_8723A( pAdapter ) )
|
||||
if ( IS_HARDWARE_TYPE_8188E( pAdapter ) )
|
||||
{
|
||||
for ( i = 0; i < MAX_PG_GROUP; ++i )
|
||||
for ( j = 0; j < 16; ++j )
|
||||
|
|
@ -1509,13 +1509,13 @@ PHY_GetTxPowerTrackingOffset(
|
|||
|
||||
if ((Rate == MGN_1M) ||(Rate == MGN_2M)||(Rate == MGN_5_5M)||(Rate == MGN_11M))
|
||||
{
|
||||
offset = pDM_Odm->Remnant_CCKSwingIdx;
|
||||
//DBG_871X("+Remnant_CCKSwingIdx = 0x%x\n", RFPath, Rate, pDM_Odm->Remnant_CCKSwingIdx);
|
||||
offset = pDM_Odm->RFCalibrateInfo.Remnant_CCKSwingIdx;
|
||||
/*DBG_871X("+Remnant_CCKSwingIdx = 0x%x\n", RFPath, Rate, pRFCalibrateInfo->Remnant_CCKSwingIdx);*/
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = pDM_Odm->Remnant_OFDMSwingIdx[RFPath];
|
||||
//DBG_871X("+Remanant_OFDMSwingIdx[RFPath %u][Rate 0x%x] = 0x%x\n", RFPath, Rate, pDM_Odm->Remnant_OFDMSwingIdx[RFPath]);
|
||||
offset = pDM_Odm->RFCalibrateInfo.Remnant_OFDMSwingIdx[RFPath];
|
||||
/*DBG_871X("+Remanant_OFDMSwingIdx[RFPath %u][Rate 0x%x] = 0x%x\n", RFPath, Rate, pRFCalibrateInfo->Remnant_OFDMSwingIdx[RFPath]); */
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1721,17 +1721,17 @@ PHY_SetTxPowerLevelByPath(
|
|||
PHY_SetTxPowerIndexByRateSection( Adapter, path, channel, OFDM );
|
||||
PHY_SetTxPowerIndexByRateSection( Adapter, path, channel, HT_MCS0_MCS7 );
|
||||
|
||||
if ( IS_HARDWARE_TYPE_JAGUAR( Adapter ) || IS_HARDWARE_TYPE_8813A( Adapter ) )
|
||||
PHY_SetTxPowerIndexByRateSection( Adapter, path, channel, VHT_1SSMCS0_1SSMCS9 );
|
||||
if (IS_HARDWARE_TYPE_JAGUAR(Adapter) || IS_HARDWARE_TYPE_8814A(Adapter))
|
||||
PHY_SetTxPowerIndexByRateSection(Adapter, path, channel, VHT_1SSMCS0_1SSMCS9);
|
||||
|
||||
if ( pHalData->NumTotalRFPath >= 2 )
|
||||
if (pHalData->NumTotalRFPath >= 2)
|
||||
{
|
||||
PHY_SetTxPowerIndexByRateSection( Adapter, path, channel, HT_MCS8_MCS15 );
|
||||
|
||||
if ( IS_HARDWARE_TYPE_JAGUAR( Adapter ) || IS_HARDWARE_TYPE_8813A( Adapter ) )
|
||||
PHY_SetTxPowerIndexByRateSection( Adapter, path, channel, VHT_2SSMCS0_2SSMCS9 );
|
||||
if (IS_HARDWARE_TYPE_JAGUAR(Adapter) || IS_HARDWARE_TYPE_8814A(Adapter))
|
||||
PHY_SetTxPowerIndexByRateSection(Adapter, path, channel, VHT_2SSMCS0_2SSMCS9);
|
||||
|
||||
if ( IS_HARDWARE_TYPE_8813A( Adapter ) )
|
||||
if (IS_HARDWARE_TYPE_8814A(Adapter))
|
||||
{
|
||||
PHY_SetTxPowerIndexByRateSection( Adapter, path, channel, HT_MCS16_MCS23 );
|
||||
PHY_SetTxPowerIndexByRateSection( Adapter, path, channel, VHT_3SSMCS0_3SSMCS9 );
|
||||
|
|
@ -1967,6 +1967,8 @@ PHY_GetTxPowerLimit(
|
|||
|
||||
if ( Band == BAND_ON_2_4G ) {
|
||||
s8 limits[10] = {0}; u8 i = 0;
|
||||
if (bandwidth >= MAX_2_4G_BANDWITH_NUM)
|
||||
bandwidth = MAX_2_4G_BANDWITH_NUM - 1;
|
||||
for (i = 0; i < MAX_REGULATION_NUM; ++i)
|
||||
limits[i] = pHalData->TxPwrLimit_2_4G[i][bandwidth][rateSection][channel][RfPath];
|
||||
|
||||
|
|
@ -2145,7 +2147,7 @@ PHY_ConvertTxPowerLimitToPowerIndex(
|
|||
}
|
||||
}
|
||||
|
||||
if ( IS_HARDWARE_TYPE_JAGUAR( Adapter ) || IS_HARDWARE_TYPE_8813A( Adapter ) )
|
||||
if (IS_HARDWARE_TYPE_JAGUAR(Adapter) || IS_HARDWARE_TYPE_8814A(Adapter))
|
||||
{
|
||||
for ( regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation )
|
||||
{
|
||||
|
|
@ -2229,7 +2231,7 @@ PHY_InitTxPowerLimit(
|
|||
|
||||
VOID
|
||||
PHY_SetTxPowerLimit(
|
||||
IN PADAPTER Adapter,
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u8 *Regulation,
|
||||
IN u8 *Band,
|
||||
IN u8 *Bandwidth,
|
||||
|
|
@ -2239,6 +2241,7 @@ PHY_SetTxPowerLimit(
|
|||
IN u8 *PowerLimit
|
||||
)
|
||||
{
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA( Adapter );
|
||||
u8 regulation=0, bandwidth=0, rateSection=0,
|
||||
channel;
|
||||
|
|
@ -2299,6 +2302,9 @@ PHY_SetTxPowerLimit(
|
|||
if ( channelIndex == -1 )
|
||||
return;
|
||||
|
||||
if (bandwidth >= MAX_2_4G_BANDWITH_NUM)
|
||||
bandwidth = MAX_2_4G_BANDWITH_NUM - 1;
|
||||
|
||||
prevPowerLimit = pHalData->TxPwrLimit_2_4G[regulation][bandwidth][rateSection][channelIndex][ODM_RF_PATH_A];
|
||||
|
||||
if ( powerLimit < prevPowerLimit )
|
||||
|
|
@ -2340,19 +2346,23 @@ PHY_GetTxPowerIndex(
|
|||
{
|
||||
u8 txPower = 0x3E;
|
||||
|
||||
if (IS_HARDWARE_TYPE_8813A(pAdapter)) {
|
||||
//#if (RTL8814A_SUPPORT==1)
|
||||
// txPower = PHY_GetTxPowerIndex_8813A( pAdapter, PowerIndex, RFPath, Rate );
|
||||
//#endif
|
||||
}
|
||||
else if (IS_HARDWARE_TYPE_JAGUAR(pAdapter)) {
|
||||
#if ((RTL8812A_SUPPORT==1) || (RTL8821A_SUPPORT == 1))
|
||||
if (IS_HARDWARE_TYPE_8814A(pAdapter)) {
|
||||
#if (RTL8814A_SUPPORT == 1)
|
||||
txPower = PHY_GetTxPowerIndex_8814A(pAdapter, RFPath, Rate, BandWidth, Channel);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_JAGUAR(pAdapter)) {
|
||||
#if ((RTL8812A_SUPPORT == 1) || (RTL8821A_SUPPORT == 1))
|
||||
txPower = PHY_GetTxPowerIndex_8812A(pAdapter, RFPath, Rate, BandWidth, Channel);
|
||||
#endif
|
||||
}
|
||||
else if (IS_HARDWARE_TYPE_8723B(pAdapter)) {
|
||||
#if (RTL8723B_SUPPORT==1)
|
||||
#if (RTL8723B_SUPPORT == 1)
|
||||
txPower = PHY_GetTxPowerIndex_8723B(pAdapter, RFPath, Rate, BandWidth, Channel);
|
||||
#endif
|
||||
}
|
||||
else if (IS_HARDWARE_TYPE_8703B(pAdapter)) {
|
||||
#if (RTL8703B_SUPPORT == 1)
|
||||
txPower = PHY_GetTxPowerIndex_8703B(pAdapter, RFPath, Rate, BandWidth, Channel);
|
||||
#endif
|
||||
}
|
||||
else if (IS_HARDWARE_TYPE_8192E(pAdapter)) {
|
||||
|
|
@ -2363,6 +2373,10 @@ PHY_GetTxPowerIndex(
|
|||
else if (IS_HARDWARE_TYPE_8188E(pAdapter)) {
|
||||
#if (RTL8188E_SUPPORT==1)
|
||||
txPower = PHY_GetTxPowerIndex_8188E(pAdapter, RFPath, Rate, BandWidth, Channel);
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8188F(pAdapter)) {
|
||||
#if (RTL8188F_SUPPORT == 1)
|
||||
txPower = PHY_GetTxPowerIndex_8188F(pAdapter, RFPath, Rate, BandWidth, Channel);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -2377,10 +2391,10 @@ PHY_SetTxPowerIndex(
|
|||
IN u8 Rate
|
||||
)
|
||||
{
|
||||
if (IS_HARDWARE_TYPE_8813A(pAdapter)) {
|
||||
//#if (RTL8814A_SUPPORT==1)
|
||||
// PHY_SetTxPowerIndex_8813A( pAdapter, PowerIndex, RFPath, Rate );
|
||||
//#endif
|
||||
if (IS_HARDWARE_TYPE_8814A(pAdapter)) {
|
||||
#if (RTL8814A_SUPPORT == 1)
|
||||
PHY_SetTxPowerIndex_8814A(pAdapter, PowerIndex, RFPath, Rate);
|
||||
#endif
|
||||
}
|
||||
else if (IS_HARDWARE_TYPE_JAGUAR(pAdapter)) {
|
||||
#if ((RTL8812A_SUPPORT==1) || (RTL8821A_SUPPORT == 1))
|
||||
|
|
@ -2390,6 +2404,11 @@ PHY_SetTxPowerIndex(
|
|||
else if (IS_HARDWARE_TYPE_8723B(pAdapter)) {
|
||||
#if (RTL8723B_SUPPORT==1)
|
||||
PHY_SetTxPowerIndex_8723B( pAdapter, PowerIndex, RFPath, Rate );
|
||||
#endif
|
||||
}
|
||||
else if (IS_HARDWARE_TYPE_8703B(pAdapter)) {
|
||||
#if (RTL8703B_SUPPORT==1)
|
||||
PHY_SetTxPowerIndex_8703B( pAdapter, PowerIndex, RFPath, Rate );
|
||||
#endif
|
||||
}
|
||||
else if (IS_HARDWARE_TYPE_8192E(pAdapter)) {
|
||||
|
|
@ -2400,6 +2419,10 @@ PHY_SetTxPowerIndex(
|
|||
else if (IS_HARDWARE_TYPE_8188E(pAdapter)) {
|
||||
#if (RTL8188E_SUPPORT==1)
|
||||
PHY_SetTxPowerIndex_8188E( pAdapter, PowerIndex, RFPath, Rate );
|
||||
#endif
|
||||
} else if (IS_HARDWARE_TYPE_8188F(pAdapter)) {
|
||||
#if (RTL8188F_SUPPORT == 1)
|
||||
PHY_SetTxPowerIndex_8188F(pAdapter, PowerIndex, RFPath, Rate);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
@ -2597,11 +2620,11 @@ phy_ConfigMACWithParaFile(
|
|||
|
||||
if ((pHalData->mac_reg_len == 0) && (pHalData->mac_reg == NULL))
|
||||
{
|
||||
rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
rtw_merge_string(rtw_phy_para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
|
||||
if (rtw_is_file_readable(file_path) == _TRUE)
|
||||
if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE)
|
||||
{
|
||||
rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0)
|
||||
{
|
||||
rtStatus = _SUCCESS;
|
||||
|
|
@ -2696,11 +2719,11 @@ phy_ConfigBBWithParaFile(
|
|||
|
||||
if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL))
|
||||
{
|
||||
rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
rtw_merge_string(rtw_phy_para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
|
||||
if (rtw_is_file_readable(file_path) == _TRUE)
|
||||
if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE)
|
||||
{
|
||||
rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0)
|
||||
{
|
||||
rtStatus = _SUCCESS;
|
||||
|
|
@ -3149,11 +3172,11 @@ phy_ConfigBBWithPgParaFile(
|
|||
|
||||
if ((pHalData->bb_phy_reg_pg_len == 0) && (pHalData->bb_phy_reg_pg == NULL))
|
||||
{
|
||||
rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
rtw_merge_string(rtw_phy_para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
|
||||
if (rtw_is_file_readable(file_path) == _TRUE)
|
||||
if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE)
|
||||
{
|
||||
rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0)
|
||||
{
|
||||
rtStatus = _SUCCESS;
|
||||
|
|
@ -3212,11 +3235,11 @@ phy_ConfigBBWithMpParaFile(
|
|||
|
||||
if ((pHalData->bb_phy_reg_mp_len == 0) && (pHalData->bb_phy_reg_mp == NULL))
|
||||
{
|
||||
rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
rtw_merge_string(rtw_phy_para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
|
||||
if (rtw_is_file_readable(file_path) == _TRUE)
|
||||
if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE)
|
||||
{
|
||||
rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0)
|
||||
{
|
||||
rtStatus = _SUCCESS;
|
||||
|
|
@ -3348,11 +3371,11 @@ PHY_ConfigRFWithParaFile(
|
|||
|
||||
if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL))
|
||||
{
|
||||
rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
rtw_merge_string(rtw_phy_para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
|
||||
if (rtw_is_file_readable(file_path) == _TRUE)
|
||||
if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE)
|
||||
{
|
||||
rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0)
|
||||
{
|
||||
rtStatus = _SUCCESS;
|
||||
|
|
@ -3626,11 +3649,11 @@ PHY_ConfigRFWithTxPwrTrackParaFile(
|
|||
|
||||
if ((pHalData->rf_tx_pwr_track_len == 0) && (pHalData->rf_tx_pwr_track == NULL))
|
||||
{
|
||||
rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
rtw_merge_string(rtw_phy_para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
|
||||
if (rtw_is_file_readable(file_path) == _TRUE)
|
||||
if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE)
|
||||
{
|
||||
rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0)
|
||||
{
|
||||
rtStatus = _SUCCESS;
|
||||
|
|
@ -3728,6 +3751,7 @@ phy_ParsePowerLimitTableFile(
|
|||
)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
PDM_ODM_T pDM_Odm = &(pHalData->odmpriv);
|
||||
u32 i = 0, forCnt = 0;
|
||||
u8 loadingStage = 0, limitValue = 0, fraction = 0;
|
||||
char *szLine, *ptmp;
|
||||
|
|
@ -3962,7 +3986,7 @@ phy_ParsePowerLimitTableFile(
|
|||
//DBG_871X("ch%s => %s\n", channel, powerLimit);
|
||||
|
||||
// store the power limit value
|
||||
PHY_SetTxPowerLimit( Adapter, (u8 *)regulation[forCnt], (u8 *)band,
|
||||
PHY_SetTxPowerLimit(pDM_Odm, (u8 *)regulation[forCnt], (u8 *)band,
|
||||
(u8 *)bandwidth, (u8 *)rateSection, (u8 *)rfPath, (u8 *)channel, (u8 *)powerLimit );
|
||||
|
||||
}
|
||||
|
|
@ -3995,11 +4019,11 @@ PHY_ConfigRFWithPowerLimitTableParaFile(
|
|||
|
||||
if ((pHalData->rf_tx_pwr_lmt_len == 0) && (pHalData->rf_tx_pwr_lmt == NULL))
|
||||
{
|
||||
rtw_merge_string(file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
rtw_merge_string(rtw_phy_para_file_path, PATH_LENGTH_MAX, rtw_phy_file_path, pFileName);
|
||||
|
||||
if (rtw_is_file_readable(file_path) == _TRUE)
|
||||
if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE)
|
||||
{
|
||||
rlen = rtw_retrive_from_file(file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
rlen = rtw_retrieve_from_file(rtw_phy_para_file_path, pHalData->para_file_buf, MAX_PARA_FILE_BUF_LEN);
|
||||
if (rlen > 0)
|
||||
{
|
||||
rtStatus = _SUCCESS;
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue