The official RTL8192EU linux driver from D-Link Australia
Version information: 20140812_rtl8192EU_linux_v4.3.1.1_11320 2014-08-12 version 4.3.1.1_11320 Source: ftp://files.dlink.com.au/products/DWA-131/REV_E/Drivers/DWA-131_Linux_driver_v4.3.1.1.zip This version does not currently work on newer kernels, but it does contain USB ID 2001:3319, which a lot of other repos in GitHub does not.
This commit is contained in:
commit
1387cf623d
|
@ -0,0 +1,6 @@
|
|||
config RTL8192EU
|
||||
tristate "Realtek 8192E USB WiFi"
|
||||
depends on USB
|
||||
---help---
|
||||
Help message of RTL8192EU
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
rmmod 8192cu
|
||||
rmmod 8192ce
|
||||
rmmod 8192du
|
||||
rmmod 8192de
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,338 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2013 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#ifdef CONFIG_BT_COEXIST
|
||||
|
||||
#include <rtw_btcoex.h>
|
||||
#include <hal_btcoex.h>
|
||||
|
||||
|
||||
void rtw_btcoex_Initialize(PADAPTER padapter)
|
||||
{
|
||||
hal_btcoex_Initialize(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_HAL_Initialize(PADAPTER padapter, u8 bWifiOnly)
|
||||
{
|
||||
hal_btcoex_InitHwConfig(padapter, bWifiOnly);
|
||||
}
|
||||
|
||||
void rtw_btcoex_IpsNotify(PADAPTER padapter, u8 type)
|
||||
{
|
||||
hal_btcoex_IpsNotify(padapter, type);
|
||||
}
|
||||
|
||||
void rtw_btcoex_LpsNotify(PADAPTER padapter, u8 type)
|
||||
{
|
||||
hal_btcoex_LpsNotify(padapter, type);
|
||||
}
|
||||
|
||||
void rtw_btcoex_ScanNotify(PADAPTER padapter, u8 type)
|
||||
{
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ((_FALSE == type) && (padapter->pbuddy_adapter))
|
||||
{
|
||||
PADAPTER pbuddy = padapter->pbuddy_adapter;
|
||||
if (check_fwstate(&pbuddy->mlmepriv, WIFI_SITE_MONITOR) == _TRUE)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
hal_btcoex_ScanNotify(padapter, type);
|
||||
}
|
||||
|
||||
void rtw_btcoex_ConnectNotify(PADAPTER padapter, u8 action)
|
||||
{
|
||||
#ifdef DBG_CONFIG_ERROR_RESET
|
||||
if (_TRUE == rtw_hal_sreset_inprogress(padapter))
|
||||
{
|
||||
DBG_8192C(FUNC_ADPT_FMT ": [BTCoex] under reset, skip notify!\n",
|
||||
FUNC_ADPT_ARG(padapter));
|
||||
return;
|
||||
}
|
||||
#endif // DBG_CONFIG_ERROR_RESET
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ((_FALSE == action) && (padapter->pbuddy_adapter))
|
||||
{
|
||||
PADAPTER pbuddy = padapter->pbuddy_adapter;
|
||||
if (check_fwstate(&pbuddy->mlmepriv, WIFI_UNDER_LINKING) == _TRUE)
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
hal_btcoex_ConnectNotify(padapter, action);
|
||||
}
|
||||
|
||||
void rtw_btcoex_MediaStatusNotify(PADAPTER padapter, u8 mediaStatus)
|
||||
{
|
||||
#ifdef DBG_CONFIG_ERROR_RESET
|
||||
if (_TRUE == rtw_hal_sreset_inprogress(padapter))
|
||||
{
|
||||
DBG_8192C(FUNC_ADPT_FMT ": [BTCoex] under reset, skip notify!\n",
|
||||
FUNC_ADPT_ARG(padapter));
|
||||
return;
|
||||
}
|
||||
#endif // DBG_CONFIG_ERROR_RESET
|
||||
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
if ((RT_MEDIA_DISCONNECT == mediaStatus) && (padapter->pbuddy_adapter))
|
||||
{
|
||||
PADAPTER pbuddy = padapter->pbuddy_adapter;
|
||||
if (check_fwstate(&pbuddy->mlmepriv, WIFI_ASOC_STATE) == _TRUE)
|
||||
return;
|
||||
}
|
||||
#endif // CONFIG_CONCURRENT_MODE
|
||||
|
||||
if ((RT_MEDIA_CONNECT == mediaStatus)
|
||||
&& (check_fwstate(&padapter->mlmepriv, WIFI_AP_STATE) == _TRUE))
|
||||
{
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DL_RSVD_PAGE, NULL);
|
||||
}
|
||||
|
||||
hal_btcoex_MediaStatusNotify(padapter, mediaStatus);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SpecialPacketNotify(PADAPTER padapter, u8 pktType)
|
||||
{
|
||||
hal_btcoex_SpecialPacketNotify(padapter, pktType);
|
||||
}
|
||||
|
||||
void rtw_btcoex_IQKNotify(PADAPTER padapter, u8 state)
|
||||
{
|
||||
hal_btcoex_IQKNotify(padapter, state);
|
||||
}
|
||||
|
||||
void rtw_btcoex_BtInfoNotify(PADAPTER padapter, u8 length, u8 *tmpBuf)
|
||||
{
|
||||
hal_btcoex_BtInfoNotify(padapter, length, tmpBuf);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SuspendNotify(PADAPTER padapter, u8 state)
|
||||
{
|
||||
hal_btcoex_SuspendNotify(padapter, state);
|
||||
}
|
||||
|
||||
void rtw_btcoex_HaltNotify(PADAPTER padapter)
|
||||
{
|
||||
if (_FALSE == padapter->bup)
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT ": bup=%d Skip!\n",
|
||||
FUNC_ADPT_ARG(padapter), padapter->bup);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (_TRUE == padapter->bSurpriseRemoved)
|
||||
{
|
||||
DBG_871X(FUNC_ADPT_FMT ": bSurpriseRemoved=%d Skip!\n",
|
||||
FUNC_ADPT_ARG(padapter), padapter->bSurpriseRemoved);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
hal_btcoex_HaltNotify(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SwitchBtTRxMask(PADAPTER padapter)
|
||||
{
|
||||
hal_btcoex_SwitchBtTRxMask(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_Switch(PADAPTER padapter, u8 enable)
|
||||
{
|
||||
hal_btcoex_SetBTCoexist(padapter, enable);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_IsBtDisabled(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_IsBtDisabled(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_Handler(PADAPTER padapter)
|
||||
{
|
||||
#if defined(CONFIG_CONCURRENT_MODE)
|
||||
if (padapter->adapter_type != PRIMARY_ADAPTER)
|
||||
return;
|
||||
#endif
|
||||
|
||||
hal_btcoex_Hanlder(padapter);
|
||||
}
|
||||
|
||||
s32 rtw_btcoex_IsBTCoexCtrlAMPDUSize(PADAPTER padapter)
|
||||
{
|
||||
s32 coexctrl;
|
||||
|
||||
coexctrl = hal_btcoex_IsBTCoexCtrlAMPDUSize(padapter);
|
||||
|
||||
return coexctrl;
|
||||
}
|
||||
|
||||
u32 rtw_btcoex_GetAMPDUSize(PADAPTER padapter)
|
||||
{
|
||||
u32 size;
|
||||
|
||||
size = hal_btcoex_GetAMPDUSize(padapter);
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetManualControl(PADAPTER padapter, u8 manual)
|
||||
{
|
||||
if (_TRUE == manual)
|
||||
{
|
||||
hal_btcoex_SetManualControl(padapter, _TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
hal_btcoex_SetManualControl(padapter, _FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_1Ant(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_1Ant(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_IsBtControlLps(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_IsBtControlLps(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_IsLpsOn(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_IsLpsOn(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_RpwmVal(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_RpwmVal(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_LpsVal(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_LpsVal(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetBTCoexist(PADAPTER padapter, u8 bBtExist)
|
||||
{
|
||||
hal_btcoex_SetBTCoexist(padapter, bBtExist);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetChipType(PADAPTER padapter, u8 chipType)
|
||||
{
|
||||
hal_btcoex_SetChipType(padapter, chipType);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetPGAntNum(PADAPTER padapter, u8 antNum, u8 antInverse)
|
||||
{
|
||||
hal_btcoex_SetPgAntNum(padapter, antNum, antInverse);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_GetPGAntNum(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_GetPgAntNum(padapter);
|
||||
}
|
||||
|
||||
u32 rtw_btcoex_GetRaMask(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_GetRaMask(padapter);
|
||||
}
|
||||
|
||||
void rtw_btcoex_RecordPwrMode(PADAPTER padapter, u8 *pCmdBuf, u8 cmdLen)
|
||||
{
|
||||
hal_btcoex_RecordPwrMode(padapter, pCmdBuf, cmdLen);
|
||||
}
|
||||
|
||||
void rtw_btcoex_DisplayBtCoexInfo(PADAPTER padapter, u8 *pbuf, u32 bufsize)
|
||||
{
|
||||
hal_btcoex_DisplayBtCoexInfo(padapter, pbuf, bufsize);
|
||||
}
|
||||
|
||||
void rtw_btcoex_SetDBG(PADAPTER padapter, u32 *pDbgModule)
|
||||
{
|
||||
hal_btcoex_SetDBG(padapter, pDbgModule);
|
||||
}
|
||||
|
||||
u32 rtw_btcoex_GetDBG(PADAPTER padapter, u8 *pStrBuf, u32 bufSize)
|
||||
{
|
||||
return hal_btcoex_GetDBG(padapter, pStrBuf, bufSize);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_IncreaseScanDeviceNum(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_IncreaseScanDeviceNum(padapter);
|
||||
}
|
||||
|
||||
u8 rtw_btcoex_IsBtLinkExist(PADAPTER padapter)
|
||||
{
|
||||
return hal_btcoex_IsBtLinkExist(padapter);
|
||||
}
|
||||
|
||||
// ==================================================
|
||||
// Below Functions are called by BT-Coex
|
||||
// ==================================================
|
||||
void rtw_btcoex_RejectApAggregatedPacket(PADAPTER padapter, u8 enable)
|
||||
{
|
||||
struct mlme_ext_info *pmlmeinfo;
|
||||
struct sta_info *psta;
|
||||
|
||||
pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
psta = rtw_get_stainfo(&padapter->stapriv, get_bssid(&padapter->mlmepriv));
|
||||
|
||||
if (_TRUE == enable)
|
||||
{
|
||||
pmlmeinfo->bAcceptAddbaReq = _FALSE;
|
||||
send_delba(padapter, 0, psta->hwaddr);
|
||||
}
|
||||
else
|
||||
{
|
||||
pmlmeinfo->bAcceptAddbaReq = _TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void rtw_btcoex_LPS_Enter(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
u8 lpsVal;
|
||||
|
||||
|
||||
pwrpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
pwrpriv->bpower_saving = _TRUE;
|
||||
lpsVal = rtw_btcoex_LpsVal(padapter);
|
||||
rtw_set_ps_mode(padapter, PS_MODE_MIN, 0, lpsVal, "BTCOEX");
|
||||
}
|
||||
|
||||
void rtw_btcoex_LPS_Leave(PADAPTER padapter)
|
||||
{
|
||||
struct pwrctrl_priv *pwrpriv;
|
||||
|
||||
|
||||
pwrpriv = adapter_to_pwrctl(padapter);
|
||||
|
||||
if (pwrpriv->pwr_mode != PS_MODE_ACTIVE)
|
||||
{
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "BTCOEX");
|
||||
LPS_RF_ON_check(padapter, 100);
|
||||
pwrpriv->bpower_saving = _FALSE;
|
||||
}
|
||||
}
|
||||
#endif // CONFIG_BT_COEXIST
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,423 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_EEPROM_C_
|
||||
|
||||
#include <drv_conf.h>
|
||||
#include <osdep_service.h>
|
||||
#include <drv_types.h>
|
||||
|
||||
void up_clk(_adapter* padapter, u16 *x)
|
||||
{
|
||||
_func_enter_;
|
||||
*x = *x | _EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void down_clk(_adapter * padapter, u16 *x )
|
||||
{
|
||||
_func_enter_;
|
||||
*x = *x & ~_EESK;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)*x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
mask = 0x01 << (count - 1);
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDO | _EEDI);
|
||||
|
||||
do
|
||||
{
|
||||
x &= ~_EEDI;
|
||||
if(data & mask)
|
||||
x |= _EEDI;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
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);
|
||||
up_clk(padapter, &x);
|
||||
down_clk(padapter, &x);
|
||||
mask = mask >> 1;
|
||||
} while(mask);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x &= ~_EEDI;
|
||||
rtw_write8(padapter, EE_9346CR, (u8)x);
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~( _EEDO | _EEDI);
|
||||
d = 0;
|
||||
|
||||
for(i=0; i<16; i++)
|
||||
{
|
||||
d = d << 1;
|
||||
up_clk(padapter, &x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI);
|
||||
if(x & _EEDO)
|
||||
d |= 1;
|
||||
|
||||
down_clk(padapter, &x);
|
||||
}
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
void standby(_adapter * padapter )
|
||||
{
|
||||
u8 x;
|
||||
_func_enter_;
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EECS | _EESK);
|
||||
rtw_write8(padapter, EE_9346CR,x);
|
||||
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
x |= _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
u16 wait_eeprom_cmd_done(_adapter* padapter)
|
||||
{
|
||||
u8 x;
|
||||
u16 i,res=_FALSE;
|
||||
_func_enter_;
|
||||
standby(padapter );
|
||||
for (i=0; i<200; i++)
|
||||
{
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
if (x & _EEDO){
|
||||
res=_TRUE;
|
||||
goto exit;
|
||||
}
|
||||
rtw_udelay_os(CLOCK_RATE);
|
||||
}
|
||||
exit:
|
||||
_func_exit_;
|
||||
return res;
|
||||
}
|
||||
|
||||
void eeprom_clean(_adapter * padapter)
|
||||
{
|
||||
u16 x;
|
||||
_func_enter_;
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
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"));
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
up_clk(padapter, &x);
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
RT_TRACE(_module_rtl871x_eeprom_c_,_drv_err_,("padapter->bSurpriseRemoved==_TRUE"));
|
||||
goto out;
|
||||
}
|
||||
down_clk(padapter, &x);
|
||||
out:
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
void eeprom_write16(_adapter * padapter, u16 reg, u16 data)
|
||||
{
|
||||
u8 x;
|
||||
#ifdef CONFIG_RTL8712
|
||||
u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
|
||||
tmp8_ori=rtw_read8(padapter, 0x102502f1);
|
||||
tmp8_new=tmp8_ori & 0xf7;
|
||||
if(tmp8_ori != tmp8_new){
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_new);
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
|
||||
}
|
||||
tmp8_clk_ori=rtw_read8(padapter,0x10250003);
|
||||
tmp8_clk_new=tmp8_clk_ori|0x20;
|
||||
if(tmp8_clk_new!=tmp8_clk_ori){
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_new);
|
||||
}
|
||||
#endif
|
||||
_func_enter_;
|
||||
|
||||
x = rtw_read8(padapter, EE_9346CR);
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, x);
|
||||
|
||||
shift_out_bits(padapter, EEPROM_EWEN_OPCODE, 5);
|
||||
|
||||
if(padapter->EepromAddressSize==8) //CF+ and SDIO
|
||||
shift_out_bits(padapter, 0, 6);
|
||||
else //USB
|
||||
shift_out_bits(padapter, 0, 4);
|
||||
|
||||
standby( padapter);
|
||||
|
||||
// Commented out by rcnjko, 2004.0
|
||||
// // Erase this particular word. Write the erase opcode and register
|
||||
// // number in that order. The opcode is 3bits in length; reg is 6 bits long.
|
||||
// shift_out_bits(Adapter, EEPROM_ERASE_OPCODE, 3);
|
||||
// shift_out_bits(Adapter, reg, Adapter->EepromAddressSize);
|
||||
//
|
||||
// if (wait_eeprom_cmd_done(Adapter ) == FALSE)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
|
||||
|
||||
standby(padapter );
|
||||
|
||||
// write the new word to the EEPROM
|
||||
|
||||
// send the write opcode the EEPORM
|
||||
shift_out_bits(padapter, EEPROM_WRITE_OPCODE, 3);
|
||||
|
||||
// select which word in the EEPROM that we are writing to.
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
// write the data to the selected EEPROM word.
|
||||
shift_out_bits(padapter, data, 16);
|
||||
|
||||
if (wait_eeprom_cmd_done(padapter ) == _FALSE)
|
||||
{
|
||||
|
||||
goto exit;
|
||||
}
|
||||
|
||||
standby(padapter );
|
||||
|
||||
shift_out_bits(padapter, EEPROM_EWDS_OPCODE, 5);
|
||||
shift_out_bits(padapter, reg, 4);
|
||||
|
||||
eeprom_clean(padapter );
|
||||
exit:
|
||||
#ifdef CONFIG_RTL8712
|
||||
if(tmp8_clk_new!=tmp8_clk_ori)
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
|
||||
if(tmp8_new!=tmp8_ori)
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_ori);
|
||||
|
||||
#endif
|
||||
_func_exit_;
|
||||
return;
|
||||
}
|
||||
|
||||
u16 eeprom_read16(_adapter * padapter, u16 reg) //ReadEEprom
|
||||
{
|
||||
|
||||
u16 x;
|
||||
u16 data=0;
|
||||
#ifdef CONFIG_RTL8712
|
||||
u8 tmp8_ori,tmp8_new,tmp8_clk_ori,tmp8_clk_new;
|
||||
tmp8_ori= rtw_read8(padapter, 0x102502f1);
|
||||
tmp8_new = tmp8_ori & 0xf7;
|
||||
if(tmp8_ori != tmp8_new){
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_new);
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x102502f1=====\n"));
|
||||
}
|
||||
tmp8_clk_ori=rtw_read8(padapter,0x10250003);
|
||||
tmp8_clk_new=tmp8_clk_ori|0x20;
|
||||
if(tmp8_clk_new!=tmp8_clk_ori){
|
||||
RT_TRACE(_module_rtl871x_mp_ioctl_c_,_drv_err_,("====write 0x10250003=====\n"));
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_new);
|
||||
}
|
||||
#endif
|
||||
_func_enter_;
|
||||
|
||||
if(padapter->bSurpriseRemoved==_TRUE){
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, (unsigned char)x);
|
||||
|
||||
// write the read opcode and register number in that order
|
||||
// The opcode is 3bits in length, reg is 6 bits long
|
||||
shift_out_bits(padapter, EEPROM_READ_OPCODE, 3);
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
// Now read the data (16 bits) in from the selected EEPROM word
|
||||
data = shift_in_bits(padapter);
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
#ifdef CONFIG_RTL8712
|
||||
if(tmp8_clk_new!=tmp8_clk_ori)
|
||||
rtw_write8(padapter, 0x10250003, tmp8_clk_ori);
|
||||
if(tmp8_new!=tmp8_ori)
|
||||
rtw_write8(padapter, 0x102502f1, tmp8_ori);
|
||||
|
||||
#endif
|
||||
_func_exit_;
|
||||
return data;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//From even offset
|
||||
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"));
|
||||
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"));
|
||||
goto out;
|
||||
}
|
||||
|
||||
x &= ~(_EEDI | _EEDO | _EESK | _EEM0);
|
||||
x |= _EEM1 | _EECS;
|
||||
rtw_write8(padapter, EE_9346CR, (unsigned char)x);
|
||||
|
||||
// write the read opcode and register number in that order
|
||||
// The opcode is 3bits in length, reg is 6 bits long
|
||||
shift_out_bits(padapter, EEPROM_READ_OPCODE, 3);
|
||||
shift_out_bits(padapter, reg, padapter->EepromAddressSize);
|
||||
|
||||
|
||||
for(i=0; i<sz; i+=2)
|
||||
{
|
||||
data16 = shift_in_bits(padapter);
|
||||
data[i] = data16 & 0xff;
|
||||
data[i+1] = data16 >>8;
|
||||
}
|
||||
|
||||
eeprom_clean(padapter);
|
||||
out:
|
||||
_func_exit_;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//addr_off : address offset of the entry in eeprom (not the tuple number of eeprom (reg); that is addr_off !=reg)
|
||||
u8 eeprom_read(_adapter * padapter, u32 addr_off, u8 sz, u8* rbuf)
|
||||
{
|
||||
u8 quotient, remainder, addr_2align_odd;
|
||||
u16 reg, stmp , i=0, idx = 0;
|
||||
_func_enter_;
|
||||
reg = (u16)(addr_off >> 1);
|
||||
addr_2align_odd = (u8)(addr_off & 0x1);
|
||||
|
||||
if(addr_2align_odd) //read that start at high part: e.g 1,3,5,7,9,...
|
||||
{
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff); //return hogh-part of the short
|
||||
reg++; sz--;
|
||||
}
|
||||
|
||||
quotient = sz >> 1;
|
||||
remainder = sz & 0x1;
|
||||
|
||||
for( i=0 ; i < quotient; i++)
|
||||
{
|
||||
stmp = eeprom_read16(padapter, reg+i);
|
||||
rbuf[idx++] = (u8) (stmp&0xff);
|
||||
rbuf[idx++] = (u8) ((stmp>>8)&0xff);
|
||||
}
|
||||
|
||||
reg = reg+i;
|
||||
if(remainder){ //end of read at lower part of short : 0,2,4,6,...
|
||||
stmp = eeprom_read16(padapter, reg);
|
||||
rbuf[idx] = (u8)(stmp & 0xff);
|
||||
}
|
||||
_func_exit_;
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
VOID read_eeprom_content(_adapter * padapter)
|
||||
{
|
||||
|
||||
_func_enter_;
|
||||
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,513 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
/*
|
||||
|
||||
The purpose of rtw_io.c
|
||||
|
||||
a. provides the API
|
||||
|
||||
b. provides the protocol engine
|
||||
|
||||
c. provides the software interface between caller and the hardware interface
|
||||
|
||||
|
||||
Compiler Flag Option:
|
||||
|
||||
1. CONFIG_SDIO_HCI:
|
||||
a. USE_SYNC_IRP: Only sync operations are provided.
|
||||
b. USE_ASYNC_IRP:Both sync/async operations are provided.
|
||||
|
||||
2. CONFIG_USB_HCI:
|
||||
a. USE_ASYNC_IRP: Both sync/async operations are provided.
|
||||
|
||||
3. CONFIG_CFIO_HCI:
|
||||
b. USE_SYNC_IRP: Only sync operations are provided.
|
||||
|
||||
|
||||
Only sync read/rtw_write_mem operations are provided.
|
||||
|
||||
jackson@realtek.com.tw
|
||||
|
||||
*/
|
||||
|
||||
#define _RTW_IO_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
#define rtw_le16_to_cpu(val) val
|
||||
#define rtw_le32_to_cpu(val) val
|
||||
#define rtw_cpu_to_le16(val) val
|
||||
#define rtw_cpu_to_le32(val) val
|
||||
#else
|
||||
#define rtw_le16_to_cpu(val) le16_to_cpu(val)
|
||||
#define rtw_le32_to_cpu(val) le32_to_cpu(val)
|
||||
#define rtw_cpu_to_le16(val) cpu_to_le16(val)
|
||||
#define rtw_cpu_to_le32(val) cpu_to_le32(val)
|
||||
#endif
|
||||
|
||||
|
||||
u8 _rtw_read8(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read8 = pintfhdl->io_ops._read8;
|
||||
|
||||
r_val = _read8(pintfhdl, addr);
|
||||
_func_exit_;
|
||||
return r_val;
|
||||
}
|
||||
|
||||
u16 _rtw_read16(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u16 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u16 (*_read16)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read16 = pintfhdl->io_ops._read16;
|
||||
|
||||
r_val = _read16(pintfhdl, addr);
|
||||
_func_exit_;
|
||||
return rtw_le16_to_cpu(r_val);
|
||||
}
|
||||
|
||||
u32 _rtw_read32(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u32 r_val;
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 (*_read32)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
_func_enter_;
|
||||
_read32 = pintfhdl->io_ops._read32;
|
||||
|
||||
r_val = _read32(pintfhdl, addr);
|
||||
_func_exit_;
|
||||
return rtw_le32_to_cpu(r_val);
|
||||
|
||||
}
|
||||
|
||||
int _rtw_write8(_adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write8 = pintfhdl->io_ops._write8;
|
||||
|
||||
ret = _write8(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write16(_adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write16 = pintfhdl->io_ops._write16;
|
||||
|
||||
val = rtw_cpu_to_le16(val);
|
||||
ret = _write16(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write32(_adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write32 = pintfhdl->io_ops._write32;
|
||||
|
||||
val = rtw_cpu_to_le32(val);
|
||||
ret = _write32(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
int _rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *pdata)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = (struct intf_hdl*)(&(pio_priv->intf));
|
||||
int (*_writeN)(struct intf_hdl *pintfhdl, u32 addr,u32 length, u8 *pdata);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_writeN = pintfhdl->io_ops._writeN;
|
||||
|
||||
ret = _writeN(pintfhdl, addr,length,pdata);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
u8 _rtw_sd_f0_read8(_adapter *adapter, u32 addr)
|
||||
{
|
||||
u8 r_val = 0x00;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u8 (*_sd_f0_read8)(struct intf_hdl *pintfhdl, u32 addr);
|
||||
|
||||
_func_enter_;
|
||||
_sd_f0_read8 = pintfhdl->io_ops._sd_f0_read8;
|
||||
|
||||
if (_sd_f0_read8)
|
||||
r_val = _sd_f0_read8(pintfhdl, addr);
|
||||
else
|
||||
DBG_871X_LEVEL(_drv_warning_, FUNC_ADPT_FMT" _sd_f0_read8 callback is NULL\n", FUNC_ADPT_ARG(adapter));
|
||||
|
||||
_func_exit_;
|
||||
return r_val;
|
||||
}
|
||||
#endif /* CONFIG_SDIO_HCI */
|
||||
|
||||
int _rtw_write8_async(_adapter *adapter, u32 addr, u8 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write8_async)(struct intf_hdl *pintfhdl, u32 addr, u8 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write8_async = pintfhdl->io_ops._write8_async;
|
||||
|
||||
ret = _write8_async(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write16_async(_adapter *adapter, u32 addr, u16 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write16_async)(struct intf_hdl *pintfhdl, u32 addr, u16 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write16_async = pintfhdl->io_ops._write16_async;
|
||||
val = rtw_cpu_to_le16(val);
|
||||
ret = _write16_async(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
int _rtw_write32_async(_adapter *adapter, u32 addr, u32 val)
|
||||
{
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
int (*_write32_async)(struct intf_hdl *pintfhdl, u32 addr, u32 val);
|
||||
int ret;
|
||||
_func_enter_;
|
||||
_write32_async = pintfhdl->io_ops._write32_async;
|
||||
val = rtw_cpu_to_le32(val);
|
||||
ret = _write32_async(pintfhdl, addr, val);
|
||||
_func_exit_;
|
||||
|
||||
return RTW_STATUS_CODE(ret);
|
||||
}
|
||||
|
||||
void _rtw_read_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_read_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_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;
|
||||
}
|
||||
|
||||
_read_mem = pintfhdl->io_ops._read_mem;
|
||||
|
||||
_read_mem(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void _rtw_write_mem(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
void (*_write_mem)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_write_mem = pintfhdl->io_ops._write_mem;
|
||||
|
||||
_write_mem(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void _rtw_read_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_read_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_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));
|
||||
return;
|
||||
}
|
||||
|
||||
_read_port = pintfhdl->io_ops._read_port;
|
||||
|
||||
_read_port(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void _rtw_read_port_cancel(_adapter *adapter)
|
||||
{
|
||||
void (*_read_port_cancel)(struct intf_hdl *pintfhdl);
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_read_port_cancel = pintfhdl->io_ops._read_port_cancel;
|
||||
|
||||
RTW_DISABLE_FUNC(adapter, DF_RX_BIT);
|
||||
|
||||
if(_read_port_cancel)
|
||||
_read_port_cancel(pintfhdl);
|
||||
}
|
||||
|
||||
u32 _rtw_write_port(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem)
|
||||
{
|
||||
u32 (*_write_port)(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *pmem);
|
||||
//struct io_queue *pio_queue = (struct io_queue *)adapter->pio_queue;
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
u32 ret = _SUCCESS;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_write_port = pintfhdl->io_ops._write_port;
|
||||
|
||||
ret = _write_port(pintfhdl, addr, cnt, pmem);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
u32 _rtw_write_port_and_wait(_adapter *adapter, u32 addr, u32 cnt, u8 *pmem, int timeout_ms)
|
||||
{
|
||||
int ret = _SUCCESS;
|
||||
struct xmit_buf *pxmitbuf = (struct xmit_buf *)pmem;
|
||||
struct submit_ctx sctx;
|
||||
|
||||
rtw_sctx_init(&sctx, timeout_ms);
|
||||
pxmitbuf->sctx = &sctx;
|
||||
|
||||
ret = _rtw_write_port(adapter, addr, cnt, pmem);
|
||||
|
||||
if (ret == _SUCCESS)
|
||||
ret = rtw_sctx_wait(&sctx, __func__);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void _rtw_write_port_cancel(_adapter *adapter)
|
||||
{
|
||||
void (*_write_port_cancel)(struct intf_hdl *pintfhdl);
|
||||
struct io_priv *pio_priv = &adapter->iopriv;
|
||||
struct intf_hdl *pintfhdl = &(pio_priv->intf);
|
||||
|
||||
_write_port_cancel = pintfhdl->io_ops._write_port_cancel;
|
||||
|
||||
RTW_DISABLE_FUNC(adapter, DF_TX_BIT);
|
||||
|
||||
if(_write_port_cancel)
|
||||
_write_port_cancel(pintfhdl);
|
||||
}
|
||||
int rtw_init_io_priv(_adapter *padapter, void (*set_intf_ops)(_adapter *padapter,struct _io_ops *pops))
|
||||
{
|
||||
struct io_priv *piopriv = &padapter->iopriv;
|
||||
struct intf_hdl *pintf = &piopriv->intf;
|
||||
|
||||
if (set_intf_ops == NULL)
|
||||
return _FAIL;
|
||||
|
||||
piopriv->padapter = padapter;
|
||||
pintf->padapter = padapter;
|
||||
pintf->pintf_dev = adapter_to_dvobj(padapter);
|
||||
|
||||
set_intf_ops(padapter,&pintf->io_ops);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Increase and check if the continual_io_error of this @param dvobjprive is larger than MAX_CONTINUAL_IO_ERR
|
||||
* @return _TRUE:
|
||||
* @return _FALSE:
|
||||
*/
|
||||
int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
int ret = _FALSE;
|
||||
int value;
|
||||
if( (value=ATOMIC_INC_RETURN(&dvobj->continual_io_error)) > MAX_CONTINUAL_IO_ERR) {
|
||||
DBG_871X("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR);
|
||||
ret = _TRUE;
|
||||
} else {
|
||||
//DBG_871X("[dvobj:%p] continual_io_error:%d\n", dvobj, value);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the continual_io_error of this @param dvobjprive to 0
|
||||
*/
|
||||
void rtw_reset_continual_io_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
ATOMIC_SET(&dvobj->continual_io_error, 0);
|
||||
}
|
||||
|
||||
#ifdef DBG_IO
|
||||
|
||||
u16 read_sniff_ranges[][2] = {
|
||||
//{0x520, 0x523},
|
||||
};
|
||||
|
||||
u16 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;
|
||||
|
||||
bool match_read_sniff_ranges(u16 addr, u16 len)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i<read_sniff_num; i++) {
|
||||
if (addr + len > read_sniff_ranges[i][0] && addr <= read_sniff_ranges[i][1])
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
bool match_write_sniff_ranges(u16 addr, u16 len)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i<write_sniff_num; i++) {
|
||||
if (addr + len > write_sniff_ranges[i][0] && addr <= write_sniff_ranges[i][1])
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
u8 dbg_rtw_read8(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u8 val = _rtw_read8(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read8(0x%04x) return 0x%02x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
u16 dbg_rtw_read16(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u16 val = _rtw_read16(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read16(0x%04x) return 0x%04x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
u32 dbg_rtw_read32(_adapter *adapter, u32 addr, const char *caller, const int line)
|
||||
{
|
||||
u32 val = _rtw_read32(adapter, addr);
|
||||
|
||||
if (match_read_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d rtw_read32(0x%04x) return 0x%08x\n", caller, line, addr, val);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
int dbg_rtw_write8(_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_write8(0x%04x, 0x%02x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_write8(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_write16(_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_write16(0x%04x, 0x%04x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_write16(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_write32(_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_write32(0x%04x, 0x%08x)\n", caller, line, addr, val);
|
||||
|
||||
return _rtw_write32(adapter, addr, val);
|
||||
}
|
||||
int dbg_rtw_writeN(_adapter *adapter, u32 addr ,u32 length , u8 *data, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, length))
|
||||
DBG_871X("DBG_IO %s:%d rtw_writeN(0x%04x, %u)\n", caller, line, addr, length);
|
||||
|
||||
return _rtw_writeN(adapter, addr, length, data);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_IOCTL_QUERY_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
|
||||
#ifdef PLATFORM_WINDOWS
|
||||
//
|
||||
// Added for WPA2-PSK, by Annie, 2005-09-20.
|
||||
//
|
||||
u8
|
||||
query_802_11_capability(
|
||||
_adapter* Adapter,
|
||||
u8* pucBuf,
|
||||
u32 * pulOutLen
|
||||
)
|
||||
{
|
||||
static NDIS_802_11_AUTHENTICATION_ENCRYPTION szAuthEnc[] =
|
||||
{
|
||||
{Ndis802_11AuthModeOpen, Ndis802_11EncryptionDisabled},
|
||||
{Ndis802_11AuthModeOpen, Ndis802_11Encryption1Enabled},
|
||||
{Ndis802_11AuthModeShared, Ndis802_11EncryptionDisabled},
|
||||
{Ndis802_11AuthModeShared, Ndis802_11Encryption1Enabled},
|
||||
{Ndis802_11AuthModeWPA, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPAPSK, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPANone, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPANone, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPA2, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA2, Ndis802_11Encryption3Enabled},
|
||||
{Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption2Enabled},
|
||||
{Ndis802_11AuthModeWPA2PSK, Ndis802_11Encryption3Enabled}
|
||||
};
|
||||
static ULONG ulNumOfPairSupported = sizeof(szAuthEnc)/sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
|
||||
NDIS_802_11_CAPABILITY * pCap = (NDIS_802_11_CAPABILITY *)pucBuf;
|
||||
u8* pucAuthEncryptionSupported = (u8*) pCap->AuthenticationEncryptionSupported;
|
||||
|
||||
|
||||
pCap->Length = sizeof(NDIS_802_11_CAPABILITY);
|
||||
if(ulNumOfPairSupported > 1 )
|
||||
pCap->Length += (ulNumOfPairSupported-1) * sizeof(NDIS_802_11_AUTHENTICATION_ENCRYPTION);
|
||||
|
||||
pCap->Version = 2;
|
||||
pCap->NoOfPMKIDs = NUM_PMKID_CACHE;
|
||||
pCap->NoOfAuthEncryptPairsSupported = ulNumOfPairSupported;
|
||||
|
||||
if( sizeof (szAuthEnc) <= 240 ) // 240 = 256 - 4*4 // SecurityInfo.szCapability: only 256 bytes in size.
|
||||
{
|
||||
_rtw_memcpy( pucAuthEncryptionSupported, (u8*)szAuthEnc, sizeof (szAuthEnc) );
|
||||
*pulOutLen = pCap->Length;
|
||||
return _TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
*pulOutLen = 0;
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("_query_802_11_capability(): szAuthEnc size is too large.\n"));
|
||||
return _FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
u8 query_802_11_association_information( _adapter *padapter,PNDIS_802_11_ASSOCIATION_INFORMATION pAssocInfo)
|
||||
{
|
||||
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);
|
||||
u8 * pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
unsigned char i,*auth_ie,*supp_ie;
|
||||
|
||||
//NdisZeroMemory(pAssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
|
||||
_rtw_memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION));
|
||||
//pAssocInfo->Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
|
||||
//------------------------------------------------------
|
||||
// Association Request related information
|
||||
//------------------------------------------------------
|
||||
// Req_1. AvailableRequestFixedIEs
|
||||
if(psecnetwork!=NULL){
|
||||
|
||||
pAssocInfo->AvailableRequestFixedIEs |= NDIS_802_11_AI_REQFI_CAPABILITIES|NDIS_802_11_AI_REQFI_CURRENTAPADDRESS;
|
||||
pAssocInfo->RequestFixedIEs.Capabilities = (unsigned short)* & psecnetwork->IEs[10];
|
||||
_rtw_memcpy(pAssocInfo->RequestFixedIEs.CurrentAPAddress,
|
||||
& psecnetwork->MacAddress, 6);
|
||||
|
||||
pAssocInfo->OffsetRequestIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION);
|
||||
|
||||
if(check_fwstate( pmlmepriv, _FW_UNDER_LINKING|_FW_LINKED)==_TRUE)
|
||||
{
|
||||
|
||||
if(psecuritypriv->ndisauthtype>=Ndis802_11AuthModeWPA2)
|
||||
pDest[0] =48; //RSN Information Element
|
||||
else
|
||||
pDest[0] =221; //WPA(SSN) Information Element
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n Adapter->ndisauthtype==Ndis802_11AuthModeWPA)?0xdd:0x30 [%d]",pDest[0]));
|
||||
supp_ie=&psecuritypriv->supplicant_ie[0];
|
||||
for(i=0;i<supp_ie[0];i++)
|
||||
{
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,supp_ie[i]));
|
||||
}
|
||||
|
||||
i=13; //0~11 is fixed information element
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("i= %d tgt_network->network.IELength=%d\n\n", i,(int)psecnetwork->IELength));
|
||||
while((i<supp_ie[0]) && (i<256)){
|
||||
if((unsigned char)supp_ie[i]==pDest[0]){
|
||||
_rtw_memcpy((u8 *)(pDest),
|
||||
&supp_ie[i],
|
||||
supp_ie[1+i]+2);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
i=i+supp_ie[i+1]+2;
|
||||
if(supp_ie[1+i]==0)
|
||||
i=i+1;
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("iteration i=%d IEs [%d] = 0x%x \n\n", i,i,supp_ie[i+1]));
|
||||
|
||||
}
|
||||
|
||||
|
||||
pAssocInfo->RequestIELength += (2 + supp_ie[1+i]);// (2 + psecnetwork->IEs[1+i]+4);
|
||||
|
||||
}
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n psecnetwork != NULL,fwstate==_FW_UNDER_LINKING \n"));
|
||||
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------
|
||||
// Association Response related information
|
||||
//------------------------------------------------------
|
||||
|
||||
if(check_fwstate( pmlmepriv, _FW_LINKED)==_TRUE)
|
||||
{
|
||||
tgt_network =&(pmlmepriv->cur_network);
|
||||
if(tgt_network!=NULL){
|
||||
pAssocInfo->AvailableResponseFixedIEs =
|
||||
NDIS_802_11_AI_RESFI_CAPABILITIES
|
||||
|NDIS_802_11_AI_RESFI_ASSOCIATIONID
|
||||
;
|
||||
|
||||
pAssocInfo->ResponseFixedIEs.Capabilities =(unsigned short)* & tgt_network->network.IEs[10];
|
||||
pAssocInfo->ResponseFixedIEs.StatusCode = 0;
|
||||
pAssocInfo->ResponseFixedIEs.AssociationId =(unsigned short) tgt_network->aid;
|
||||
|
||||
pDest = (u8 *)pAssocInfo + sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)+pAssocInfo->RequestIELength;
|
||||
auth_ie=&psecuritypriv->authenticator_ie[0];
|
||||
|
||||
for(i=0;i<auth_ie[0];i++)
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("IEs [%d] = 0x%x \n\n", i,auth_ie[i]));
|
||||
|
||||
i=auth_ie[0]-12;
|
||||
if(i>0){
|
||||
_rtw_memcpy((u8 *)&pDest[0],&auth_ie[1],i);
|
||||
pAssocInfo->ResponseIELength =i;
|
||||
}
|
||||
|
||||
|
||||
pAssocInfo->OffsetResponseIEs = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION) + pAssocInfo->RequestIELength;
|
||||
|
||||
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n tgt_network != NULL,fwstate==_FW_LINKED \n"));
|
||||
}
|
||||
}
|
||||
RT_TRACE(_module_rtl871x_ioctl_query_c_,_drv_info_,("\n exit query_802_11_association_information \n"));
|
||||
_func_exit_;
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,390 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 <drv_types.h>
|
||||
|
||||
#ifdef CONFIG_IOL
|
||||
struct xmit_frame *rtw_IOL_accquire_xmit_frame(ADAPTER *adapter)
|
||||
{
|
||||
struct xmit_frame *xmit_frame;
|
||||
struct xmit_buf *xmitbuf;
|
||||
struct pkt_attrib *pattrib;
|
||||
struct xmit_priv *pxmitpriv = &(adapter->xmitpriv);
|
||||
|
||||
#if 1
|
||||
if ((xmit_frame = rtw_alloc_xmitframe(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s rtw_alloc_xmitframe return null\n", __FUNCTION__);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if ((xmitbuf = rtw_alloc_xmitbuf(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s rtw_alloc_xmitbuf return null\n", __FUNCTION__);
|
||||
rtw_free_xmitframe(pxmitpriv, xmit_frame);
|
||||
xmit_frame=NULL;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
xmit_frame->frame_tag = MGNT_FRAMETAG;
|
||||
xmit_frame->pxmitbuf = xmitbuf;
|
||||
xmit_frame->buf_addr = xmitbuf->pbuf;
|
||||
xmitbuf->priv_data = xmit_frame;
|
||||
|
||||
pattrib = &xmit_frame->attrib;
|
||||
update_mgntframe_attrib(adapter, pattrib);
|
||||
pattrib->qsel = 0x10;//Beacon
|
||||
pattrib->subtype = WIFI_BEACON;
|
||||
pattrib->pktlen = pattrib->last_txcmdsz = 0;
|
||||
|
||||
#else
|
||||
if ((xmit_frame = alloc_mgtxmitframe(pxmitpriv)) == NULL)
|
||||
{
|
||||
DBG_871X("%s alloc_mgtxmitframe return null\n", __FUNCTION__);
|
||||
}
|
||||
else {
|
||||
pattrib = &xmit_frame->attrib;
|
||||
update_mgntframe_attrib(adapter, pattrib);
|
||||
pattrib->qsel = 0x10;
|
||||
pattrib->pktlen = pattrib->last_txcmdsz = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
exit:
|
||||
return xmit_frame;
|
||||
}
|
||||
|
||||
|
||||
int rtw_IOL_append_cmds(struct xmit_frame *xmit_frame, u8 *IOL_cmds, u32 cmd_len)
|
||||
{
|
||||
struct pkt_attrib *pattrib = &xmit_frame->attrib;
|
||||
u16 buf_offset;
|
||||
u32 ori_len;
|
||||
|
||||
buf_offset = TXDESC_OFFSET;
|
||||
ori_len = buf_offset+pattrib->pktlen;
|
||||
|
||||
//check if the io_buf can accommodate new cmds
|
||||
if(ori_len + cmd_len + 8 > MAX_XMITBUF_SZ) {
|
||||
DBG_871X("%s %u is large than MAX_XMITBUF_SZ:%u, can't accommodate new cmds\n", __FUNCTION__
|
||||
, ori_len + cmd_len + 8, MAX_XMITBUF_SZ);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
_rtw_memcpy(xmit_frame->buf_addr + buf_offset + pattrib->pktlen, IOL_cmds, cmd_len);
|
||||
pattrib->pktlen += cmd_len;
|
||||
pattrib->last_txcmdsz += cmd_len;
|
||||
|
||||
//DBG_871X("%s ori:%u + cmd_len:%u = %u\n", __FUNCTION__, ori_len, cmd_len, buf_offset+pattrib->pktlen);
|
||||
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
bool rtw_IOL_applied(ADAPTER *adapter)
|
||||
{
|
||||
if(1 == adapter->registrypriv.fw_iol)
|
||||
return _TRUE;
|
||||
|
||||
#ifdef CONFIG_USB_HCI
|
||||
if((2 == adapter->registrypriv.fw_iol) && (IS_FULL_SPEED_USB(adapter)))
|
||||
return _TRUE;
|
||||
#endif
|
||||
|
||||
return _FALSE;
|
||||
}
|
||||
|
||||
int rtw_IOL_exec_cmds_sync(ADAPTER *adapter, struct xmit_frame *xmit_frame, u32 max_wating_ms, u32 bndy_cnt)
|
||||
{
|
||||
return rtw_hal_iol_cmd(adapter, xmit_frame, max_wating_ms,bndy_cnt);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_IOL_NEW_GENERATION
|
||||
int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
|
||||
{
|
||||
return _SUCCESS;
|
||||
}
|
||||
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, u8 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WB_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, u16 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WW_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FUNCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, u32 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_WD_REG,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = cpu_to_le16(addr);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0xFFFFFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_871X("%s addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WRF_cmd(struct xmit_frame *xmit_frame, u8 rf_path, u16 addr, u32 value, u32 mask)
|
||||
{
|
||||
struct ioreg_cfg cmd = {8,IOREG_CMD_W_RF,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, addr);
|
||||
//RTW_PUT_LE32((u8*)&cmd.value, (u32)value);
|
||||
cmd.address = (rf_path<<8) |((addr) &0xFF);
|
||||
cmd.data = cpu_to_le32(value);
|
||||
|
||||
if(mask!=0x000FFFFF)
|
||||
{
|
||||
cmd.length = 12;
|
||||
//RTW_PUT_LE32((u8*)&cmd.mask, (u32)mask);
|
||||
cmd.mask = cpu_to_le32(mask);
|
||||
}
|
||||
|
||||
//DBG_871X("%s rf_path:0x%02x addr:0x%04x,value:0x%08x,mask:0x%08x\n", __FU2NCTION__,rf_path, addr,value,mask);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, cmd.length);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0};
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, us);
|
||||
cmd.address = cpu_to_le16(us);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, us);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
}
|
||||
|
||||
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_DELAY_US,0x0, 0x0,0x0};
|
||||
|
||||
//RTW_PUT_LE16((u8*)&cmd.address, ms);
|
||||
cmd.address = cpu_to_le16(ms);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, ms);
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
}
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
struct ioreg_cfg cmd = {4,IOREG_CMD_END,0xFFFF, 0xFF,0x0};
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 4);
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_IOL_cmd_boundary_handle(struct xmit_frame *pxmit_frame)
|
||||
{
|
||||
u8 is_cmd_bndy = _FALSE;
|
||||
if(((pxmit_frame->attrib.pktlen+32)%256) + 8 >= 256){
|
||||
rtw_IOL_append_END_cmd(pxmit_frame);
|
||||
pxmit_frame->attrib.pktlen = ((((pxmit_frame->attrib.pktlen+32)/256)+1)*256 );
|
||||
|
||||
//printk("==> %s, pktlen(%d)\n",__FUNCTION__,pxmit_frame->attrib.pktlen);
|
||||
pxmit_frame->attrib.last_txcmdsz = pxmit_frame->attrib.pktlen;
|
||||
is_cmd_bndy = _TRUE;
|
||||
}
|
||||
return is_cmd_bndy;
|
||||
}
|
||||
|
||||
void rtw_IOL_cmd_buf_dump(ADAPTER *Adapter,int buf_len,u8 *pbuf)
|
||||
{
|
||||
int i;
|
||||
int j=1;
|
||||
|
||||
printk("###### %s ######\n",__FUNCTION__);
|
||||
for(i=0;i< buf_len;i++){
|
||||
printk("%02x-",*(pbuf+i));
|
||||
|
||||
if(j%32 ==0) printk("\n");j++;
|
||||
}
|
||||
printk("\n");
|
||||
printk("============= ioreg_cmd len = %d =============== \n",buf_len);
|
||||
}
|
||||
|
||||
|
||||
#else //CONFIG_IOL_NEW_GENERATION
|
||||
int rtw_IOL_append_LLT_cmd(struct xmit_frame *xmit_frame, u8 page_boundary)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_LLT, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)page_boundary);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WB_REG, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WW_REG, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int _rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_WD_REG, 0x0, 0x0};
|
||||
u8* pos = (u8 *)&cmd;
|
||||
|
||||
RTW_PUT_BE16((u8*)&cmd.address, (u16)addr);
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)value);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
#ifdef DBG_IO
|
||||
int dbg_rtw_IOL_append_WB_cmd(struct xmit_frame *xmit_frame, u16 addr, u8 value, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 1))
|
||||
DBG_871X("DBG_IO %s:%d IOL_WB(0x%04x, 0x%02x)\n", caller, line, addr, value);
|
||||
|
||||
return _rtw_IOL_append_WB_cmd(xmit_frame, addr, value);
|
||||
}
|
||||
|
||||
int dbg_rtw_IOL_append_WW_cmd(struct xmit_frame *xmit_frame, u16 addr, u16 value, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 2))
|
||||
DBG_871X("DBG_IO %s:%d IOL_WW(0x%04x, 0x%04x)\n", caller, line, addr, value);
|
||||
|
||||
return _rtw_IOL_append_WW_cmd(xmit_frame, addr, value);
|
||||
}
|
||||
|
||||
int dbg_rtw_IOL_append_WD_cmd(struct xmit_frame *xmit_frame, u16 addr, u32 value, const char *caller, const int line)
|
||||
{
|
||||
if (match_write_sniff_ranges(addr, 4))
|
||||
DBG_871X("DBG_IO %s:%d IOL_WD(0x%04x, 0x%08x)\n", caller, line, addr, value);
|
||||
|
||||
return _rtw_IOL_append_WD_cmd(xmit_frame, addr, value);
|
||||
}
|
||||
#endif
|
||||
|
||||
int rtw_IOL_append_DELAY_US_cmd(struct xmit_frame *xmit_frame, u16 us)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_DELAY_US, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)us);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, us);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int rtw_IOL_append_DELAY_MS_cmd(struct xmit_frame *xmit_frame, u16 ms)
|
||||
{
|
||||
IOL_CMD cmd = {0x0, IOL_CMD_DELAY_MS, 0x0, 0x0};
|
||||
|
||||
RTW_PUT_BE32((u8*)&cmd.value, (u32)ms);
|
||||
|
||||
//DBG_871X("%s %u\n", __FUNCTION__, ms);
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&cmd, 8);
|
||||
}
|
||||
|
||||
int rtw_IOL_append_END_cmd(struct xmit_frame *xmit_frame)
|
||||
{
|
||||
IOL_CMD end_cmd = {0x0, IOL_CMD_END, 0x0, 0x0};
|
||||
|
||||
|
||||
return rtw_IOL_append_cmds(xmit_frame, (u8*)&end_cmd, 8);
|
||||
|
||||
}
|
||||
|
||||
int rtw_IOL_exec_cmd_array_sync(PADAPTER adapter, u8 *IOL_cmds, u32 cmd_num, u32 max_wating_ms)
|
||||
{
|
||||
struct xmit_frame *xmit_frame;
|
||||
|
||||
if((xmit_frame=rtw_IOL_accquire_xmit_frame(adapter)) == NULL)
|
||||
return _FAIL;
|
||||
|
||||
if(rtw_IOL_append_cmds(xmit_frame, IOL_cmds, cmd_num<<3) == _FAIL)
|
||||
return _FAIL;
|
||||
|
||||
return rtw_IOL_exec_cmds_sync(adapter, xmit_frame, max_wating_ms,0);
|
||||
}
|
||||
|
||||
int rtw_IOL_exec_empty_cmds_sync(ADAPTER *adapter, u32 max_wating_ms)
|
||||
{
|
||||
IOL_CMD end_cmd = {0x0, IOL_CMD_END, 0x0, 0x0};
|
||||
return rtw_IOL_exec_cmd_array_sync(adapter, (u8*)&end_cmd, 1, max_wating_ms);
|
||||
}
|
||||
#endif //CONFIG_IOL_NEW_GENERATION
|
||||
|
||||
|
||||
|
||||
|
||||
#endif //CONFIG_IOL
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,207 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2013 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 <rtw_odm.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
const char *odm_comp_str[] = {
|
||||
/* BIT0 */"ODM_COMP_DIG",
|
||||
/* BIT1 */"ODM_COMP_RA_MASK",
|
||||
/* BIT2 */"ODM_COMP_DYNAMIC_TXPWR",
|
||||
/* BIT3 */"ODM_COMP_FA_CNT",
|
||||
/* BIT4 */"ODM_COMP_RSSI_MONITOR",
|
||||
/* BIT5 */"ODM_COMP_CCK_PD",
|
||||
/* BIT6 */"ODM_COMP_ANT_DIV",
|
||||
/* BIT7 */"ODM_COMP_PWR_SAVE",
|
||||
/* BIT8 */"ODM_COMP_PWR_TRAIN",
|
||||
/* BIT9 */"ODM_COMP_RATE_ADAPTIVE",
|
||||
/* BIT10 */"ODM_COMP_PATH_DIV",
|
||||
/* BIT11 */"ODM_COMP_PSD",
|
||||
/* BIT12 */"ODM_COMP_DYNAMIC_PRICCA",
|
||||
/* BIT13 */"ODM_COMP_RXHP",
|
||||
/* BIT14 */"ODM_COMP_MP",
|
||||
/* BIT15 */"ODM_COMP_DYNAMIC_ATC",
|
||||
/* BIT16 */"ODM_COMP_EDCA_TURBO",
|
||||
/* BIT17 */"ODM_COMP_EARLY_MODE",
|
||||
/* BIT18 */NULL,
|
||||
/* BIT19 */NULL,
|
||||
/* BIT20 */NULL,
|
||||
/* BIT21 */NULL,
|
||||
/* BIT22 */NULL,
|
||||
/* BIT23 */NULL,
|
||||
/* BIT24 */"ODM_COMP_TX_PWR_TRACK",
|
||||
/* BIT25 */"ODM_COMP_RX_GAIN_TRACK",
|
||||
/* BIT26 */"ODM_COMP_CALIBRATION",
|
||||
/* BIT27 */NULL,
|
||||
/* BIT28 */NULL,
|
||||
/* BIT29 */NULL,
|
||||
/* BIT30 */"ODM_COMP_COMMON",
|
||||
/* BIT31 */"ODM_COMP_INIT",
|
||||
};
|
||||
|
||||
#define RTW_ODM_COMP_MAX 32
|
||||
|
||||
const char *odm_ability_str[] = {
|
||||
/* BIT0 */"ODM_BB_DIG",
|
||||
/* BIT1 */"ODM_BB_RA_MASK",
|
||||
/* BIT2 */"ODM_BB_DYNAMIC_TXPWR",
|
||||
/* BIT3 */"ODM_BB_FA_CNT",
|
||||
/* BIT4 */"ODM_BB_RSSI_MONITOR",
|
||||
/* BIT5 */"ODM_BB_CCK_PD",
|
||||
/* BIT6 */"ODM_BB_ANT_DIV",
|
||||
/* BIT7 */"ODM_BB_PWR_SAVE",
|
||||
/* BIT8 */"ODM_BB_PWR_TRAIN",
|
||||
/* BIT9 */"ODM_BB_RATE_ADAPTIVE",
|
||||
/* BIT10 */"ODM_BB_PATH_DIV",
|
||||
/* BIT11 */"ODM_BB_PSD",
|
||||
/* BIT12 */"ODM_BB_RXHP",
|
||||
/* BIT13 */"ODM_BB_ADAPTIVITY",
|
||||
/* BIT14 */"ODM_BB_DYNAMIC_ATC",
|
||||
/* BIT15 */NULL,
|
||||
/* BIT16 */"ODM_MAC_EDCA_TURBO",
|
||||
/* BIT17 */"ODM_MAC_EARLY_MODE",
|
||||
/* BIT18 */NULL,
|
||||
/* BIT19 */NULL,
|
||||
/* BIT20 */NULL,
|
||||
/* BIT21 */NULL,
|
||||
/* BIT22 */NULL,
|
||||
/* BIT23 */NULL,
|
||||
/* BIT24 */"ODM_RF_TX_PWR_TRACK",
|
||||
/* BIT25 */"ODM_RF_RX_GAIN_TRACK",
|
||||
/* BIT26 */"ODM_RF_CALIBRATION",
|
||||
};
|
||||
|
||||
#define RTW_ODM_ABILITY_MAX 27
|
||||
|
||||
const char *odm_dbg_level_str[] = {
|
||||
NULL,
|
||||
"ODM_DBG_OFF",
|
||||
"ODM_DBG_SERIOUS",
|
||||
"ODM_DBG_WARNING",
|
||||
"ODM_DBG_LOUD",
|
||||
"ODM_DBG_TRACE",
|
||||
};
|
||||
|
||||
#define RTW_ODM_DBG_LEVEL_NUM 6
|
||||
|
||||
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;
|
||||
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);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_dbg_comp_set(_adapter *adapter, u64 comps)
|
||||
{
|
||||
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_FLAG, &comps);
|
||||
}
|
||||
|
||||
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;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &dbg_level);
|
||||
DBG_871X_SEL_NL(sel, "odm.DebugDebugLevel = %u\n", dbg_level);
|
||||
for (i=0;i<RTW_ODM_DBG_LEVEL_NUM;i++) {
|
||||
if (odm_dbg_level_str[i])
|
||||
DBG_871X_SEL_NL(sel, "%u %s\n", i, odm_dbg_level_str[i]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_dbg_level_set(_adapter *adapter, u32 level)
|
||||
{
|
||||
rtw_hal_set_def_var(adapter, HW_DEF_ODM_DBG_LEVEL, &level);
|
||||
}
|
||||
|
||||
void rtw_odm_ability_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
int cnt = 0;
|
||||
u32 ability = 0;
|
||||
int i;
|
||||
|
||||
rtw_hal_get_hwreg(adapter, HW_VAR_DM_FLAG, (u8*)&ability);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
|
||||
inline void rtw_odm_ability_set(_adapter *adapter, u32 ability)
|
||||
{
|
||||
rtw_hal_set_hwreg(adapter, HW_VAR_DM_FLAG, (u8*)&ability);
|
||||
}
|
||||
|
||||
void rtw_odm_adaptivity_parm_msg(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &pHalData->odmpriv;
|
||||
|
||||
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"
|
||||
, (u8)odm->TH_L2H_ini
|
||||
, odm->TH_EDCCA_HL_diff
|
||||
, odm->IGI_Base
|
||||
, odm->ForceEDCCA
|
||||
, odm->AdapEn_RSSI
|
||||
, odm->IGI_LowerBound
|
||||
);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
void rtw_odm_get_perpkt_rssi(void *sel, _adapter *adapter)
|
||||
{
|
||||
HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter);
|
||||
DM_ODM_T *odm = &(hal_data->odmpriv);
|
||||
|
||||
DBG_871X_SEL_NL(sel,"RxRate = %s, RSSI_A = %d(%%), RSSI_B = %d(%%)\n",
|
||||
HDATA_RATE(odm->RxRate), odm->RSSI_A, odm->RSSI_B);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,91 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_RF_C_
|
||||
|
||||
#include <drv_types.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)
|
||||
{
|
||||
u8 i;
|
||||
u32 freq = 0;
|
||||
|
||||
for (i = 0; i < ch_freq_map_num; i++)
|
||||
{
|
||||
if (channel == ch_freq_map[i].channel)
|
||||
{
|
||||
freq = ch_freq_map[i].frequency;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == ch_freq_map_num)
|
||||
freq = 2412;
|
||||
|
||||
return freq;
|
||||
}
|
||||
|
||||
u32 rtw_freq2ch(u32 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;
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,367 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2007 - 2012 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 <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
#include <rtw_sreset.h>
|
||||
|
||||
void sreset_init_value(_adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
_rtw_mutex_init(&psrtpriv->silentreset_mutex);
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
void sreset_reset_value(_adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
psrtpriv->last_tx_time =0;
|
||||
psrtpriv->last_tx_complete_time =0;
|
||||
#endif
|
||||
}
|
||||
|
||||
u8 sreset_get_wifi_status(_adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
|
||||
u8 status = WIFI_STATUS_SUCCESS;
|
||||
u32 val32 = 0;
|
||||
_irqL irqL;
|
||||
if(psrtpriv->silent_reset_inprogress == _TRUE)
|
||||
{
|
||||
return status;
|
||||
}
|
||||
val32 =rtw_read32(padapter,REG_TXDMA_STATUS);
|
||||
if(val32==0xeaeaeaea){
|
||||
psrtpriv->Wifi_Error_Status = WIFI_IF_NOT_EXIST;
|
||||
}
|
||||
else if(val32!=0){
|
||||
DBG_8192C("txdmastatu(%x)\n",val32);
|
||||
psrtpriv->Wifi_Error_Status = WIFI_MAC_TXDMA_ERROR;
|
||||
}
|
||||
|
||||
if(WIFI_STATUS_SUCCESS !=psrtpriv->Wifi_Error_Status)
|
||||
{
|
||||
DBG_8192C("==>%s error_status(0x%x) \n",__FUNCTION__,psrtpriv->Wifi_Error_Status);
|
||||
status = (psrtpriv->Wifi_Error_Status &( ~(USB_READ_PORT_FAIL|USB_WRITE_PORT_FAIL)));
|
||||
}
|
||||
DBG_8192C("==> %s wifi_status(0x%x)\n",__FUNCTION__,status);
|
||||
|
||||
//status restore
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
return status;
|
||||
#else
|
||||
return WIFI_STATUS_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_wifi_error_status(_adapter *padapter, u32 status)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.Wifi_Error_Status = status;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_set_trigger_point(_adapter *padapter, s32 tgp)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_DETECT)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
pHalData->srestpriv.dbg_trigger_point = tgp;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool sreset_inprogress(_adapter *padapter)
|
||||
{
|
||||
#if defined(DBG_CONFIG_ERROR_RESET)
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
return pHalData->srestpriv.silent_reset_inprogress;
|
||||
#else
|
||||
return _FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void sreset_restore_security_station(_adapter *padapter)
|
||||
{
|
||||
u8 EntryId = 0;
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct sta_priv * pstapriv = &padapter->stapriv;
|
||||
struct sta_info *psta;
|
||||
struct security_priv* psecuritypriv=&(padapter->securitypriv);
|
||||
struct mlme_ext_info *pmlmeinfo = &padapter->mlmeextpriv.mlmext_info;
|
||||
|
||||
{
|
||||
u8 val8;
|
||||
|
||||
if (pmlmeinfo->auth_algo == dot11AuthAlgrthm_8021X) {
|
||||
val8 = 0xcc;
|
||||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
} else if (padapter->wapiInfo.bWapiEnable && pmlmeinfo->auth_algo == dot11AuthAlgrthm_WAPI) {
|
||||
//Disable TxUseDefaultKey, RxUseDefaultKey, RxBroadcastUseDefaultKey.
|
||||
val8 = 0x4c;
|
||||
#endif
|
||||
} else {
|
||||
val8 = 0xcf;
|
||||
}
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_SEC_CFG, (u8 *)(&val8));
|
||||
}
|
||||
|
||||
#if 0
|
||||
if ( ( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP40_ ) ||
|
||||
( padapter->securitypriv.dot11PrivacyAlgrthm == _WEP104_ ))
|
||||
{
|
||||
|
||||
for(EntryId=0; EntryId<4; EntryId++)
|
||||
{
|
||||
if(EntryId == psecuritypriv->dot11PrivacyKeyIndex)
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 1,_FALSE);
|
||||
else
|
||||
rtw_set_key(padapter,&padapter->securitypriv, EntryId, 0,_FALSE);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if((padapter->securitypriv.dot11PrivacyAlgrthm == _TKIP_) ||
|
||||
(padapter->securitypriv.dot11PrivacyAlgrthm == _AES_))
|
||||
{
|
||||
psta = rtw_get_stainfo(pstapriv, get_bssid(mlmepriv));
|
||||
if (psta == NULL) {
|
||||
//DEBUG_ERR( ("Set wpa_set_encryption: Obtain Sta_info fail \n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
//pairwise key
|
||||
rtw_setstakey_cmd(padapter, (unsigned char *)psta, _TRUE,_FALSE);
|
||||
//group key
|
||||
rtw_set_key(padapter,&padapter->securitypriv,padapter->securitypriv.dot118021XGrpKeyid, 0,_FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_restore_network_station(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
#if 0
|
||||
{
|
||||
//=======================================================
|
||||
// reset related register of Beacon control
|
||||
|
||||
//set MSR to nolink
|
||||
Set_MSR(padapter, _HW_STATE_NOLINK_);
|
||||
// reject all data frame
|
||||
rtw_write16(padapter, REG_RXFLTMAP2,0x00);
|
||||
//reset TSF
|
||||
rtw_write8(padapter, REG_DUAL_TSF_RST, (BIT(0)|BIT(1)));
|
||||
|
||||
// disable update TSF
|
||||
SetBcnCtrlReg(padapter, BIT(4), 0);
|
||||
|
||||
//=======================================================
|
||||
}
|
||||
#endif
|
||||
|
||||
rtw_setopmode_cmd(padapter, Ndis802_11Infrastructure,_FALSE);
|
||||
|
||||
{
|
||||
u8 threshold;
|
||||
#ifdef CONFIG_USB_HCI
|
||||
// TH=1 => means that invalidate usb rx aggregation
|
||||
// TH=0 => means that validate usb rx aggregation, use init value.
|
||||
if(mlmepriv->htpriv.ht_option) {
|
||||
if(padapter->registrypriv.wifi_spec==1)
|
||||
threshold = 1;
|
||||
else
|
||||
threshold = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
} else {
|
||||
threshold = 1;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_RXDMA_AGG_PG_TH, (u8 *)(&threshold));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_DO_IQK, NULL);
|
||||
|
||||
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_hal_set_hwreg(padapter, HW_VAR_BSSID, pmlmeinfo->network.MacAddress);
|
||||
|
||||
{
|
||||
u8 join_type = 0;
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_JOIN, (u8 *)(&join_type));
|
||||
}
|
||||
|
||||
Set_MSR(padapter, (pmlmeinfo->state & 0x3));
|
||||
|
||||
mlmeext_joinbss_event_callback(padapter, 1);
|
||||
//restore Sequence No.
|
||||
rtw_write8(padapter,0x4dc,padapter->xmitpriv.nqos_ssn);
|
||||
|
||||
sreset_restore_security_station(padapter);
|
||||
}
|
||||
|
||||
|
||||
void sreset_restore_network_status(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *mlmepriv = &padapter->mlmepriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
|
||||
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);
|
||||
} 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);
|
||||
} 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 {
|
||||
DBG_871X(FUNC_ADPT_FMT" fwstate:0x%08x - ???\n", FUNC_ADPT_ARG(padapter), get_fwstate(mlmepriv));
|
||||
}
|
||||
}
|
||||
|
||||
void sreset_stop_adapter(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (!rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_stop_queue(padapter->pnetdev);
|
||||
|
||||
rtw_cancel_all_timer(padapter);
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI)
|
||||
tasklet_kill(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_SURVEY))
|
||||
rtw_scan_abort(padapter);
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_UNDER_LINKING))
|
||||
{
|
||||
rtw_set_to_roam(padapter, 0);
|
||||
_rtw_join_timeout_handler(padapter);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void sreset_start_adapter(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
|
||||
if (padapter == NULL)
|
||||
return;
|
||||
|
||||
DBG_871X(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(padapter));
|
||||
|
||||
if (check_fwstate(pmlmepriv, _FW_LINKED)) {
|
||||
sreset_restore_network_status(padapter);
|
||||
}
|
||||
|
||||
/* TODO: OS and HCI independent */
|
||||
#if defined(PLATFORM_LINUX) && defined(CONFIG_USB_HCI)
|
||||
tasklet_hi_schedule(&pxmitpriv->xmit_tasklet);
|
||||
#endif
|
||||
|
||||
_set_timer(&padapter->mlmepriv.dynamic_chk_timer, 2000);
|
||||
|
||||
if (rtw_netif_queue_stopped(padapter->pnetdev))
|
||||
rtw_netif_wake_queue(padapter->pnetdev);
|
||||
|
||||
}
|
||||
|
||||
void sreset_reset(_adapter *padapter)
|
||||
{
|
||||
#ifdef DBG_CONFIG_ERROR_RESET
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter);
|
||||
struct sreset_priv *psrtpriv = &pHalData->srestpriv;
|
||||
struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter);
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct xmit_priv *pxmitpriv = &padapter->xmitpriv;
|
||||
_irqL irqL;
|
||||
u32 start = rtw_get_current_time();
|
||||
struct dvobj_priv *psdpriv = padapter->dvobj;
|
||||
struct debug_priv *pdbgpriv = &psdpriv->drv_dbg;
|
||||
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
psrtpriv->Wifi_Error_Status = WIFI_STATUS_SUCCESS;
|
||||
|
||||
|
||||
#ifdef CONFIG_POWER_SAVING
|
||||
rtw_set_ps_mode(padapter, PS_MODE_ACTIVE, 0, 0, "SRESET");
|
||||
#endif
|
||||
|
||||
_enter_pwrlock(&pwrpriv->lock);
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _TRUE;
|
||||
pwrpriv->change_rfpwrstate = rf_off;
|
||||
|
||||
sreset_stop_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_stop_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IPS
|
||||
_ips_enter(padapter);
|
||||
_ips_leave(padapter);
|
||||
#endif
|
||||
|
||||
sreset_start_adapter(padapter);
|
||||
#ifdef CONFIG_CONCURRENT_MODE
|
||||
sreset_start_adapter(padapter->pbuddy_adapter);
|
||||
#endif
|
||||
|
||||
psrtpriv->silent_reset_inprogress = _FALSE;
|
||||
|
||||
_exit_pwrlock(&pwrpriv->lock);
|
||||
|
||||
DBG_871X("%s done in %d ms\n", __FUNCTION__, rtw_get_passing_time_ms(start));
|
||||
pdbgpriv->dbg_sreset_cnt++;
|
||||
#endif
|
||||
}
|
||||
|
|
@ -0,0 +1,848 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_STA_MGT_C_
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
#if defined (PLATFORM_LINUX) && defined (PLATFORM_WINDOWS)
|
||||
|
||||
#error "Shall be Linux or Windows, but not both!\n"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void _rtw_init_stainfo(struct sta_info *psta);
|
||||
void _rtw_init_stainfo(struct sta_info *psta)
|
||||
{
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_rtw_memset((u8 *)psta, 0, sizeof (struct sta_info));
|
||||
|
||||
_rtw_spinlock_init(&psta->lock);
|
||||
_rtw_init_listhead(&psta->list);
|
||||
_rtw_init_listhead(&psta->hash_list);
|
||||
//_rtw_init_listhead(&psta->asoc_list);
|
||||
//_rtw_init_listhead(&psta->sleep_list);
|
||||
//_rtw_init_listhead(&psta->wakeup_list);
|
||||
|
||||
_rtw_init_queue(&psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
_rtw_init_sta_xmit_priv(&psta->sta_xmitpriv);
|
||||
_rtw_init_sta_recv_priv(&psta->sta_recvpriv);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
_rtw_init_listhead(&psta->asoc_list);
|
||||
|
||||
_rtw_init_listhead(&psta->auth_list);
|
||||
|
||||
psta->expire_to = 0;
|
||||
|
||||
psta->flags = 0;
|
||||
|
||||
psta->capability = 0;
|
||||
|
||||
psta->bpairwise_key_installed = _FALSE;
|
||||
|
||||
|
||||
#ifdef CONFIG_NATIVEAP_MLME
|
||||
psta->nonerp_set = 0;
|
||||
psta->no_short_slot_time_set = 0;
|
||||
psta->no_short_preamble_set = 0;
|
||||
psta->no_ht_gf_set = 0;
|
||||
psta->no_ht_set = 0;
|
||||
psta->ht_20mhz_set = 0;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
psta->keep_alive_trycnt = 0;
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
u32 _rtw_init_sta_priv(struct sta_priv *pstapriv)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
s32 i;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pstapriv->pallocated_stainfo_buf = rtw_zvmalloc (sizeof(struct sta_info) * NUM_STA+ 4);
|
||||
|
||||
if(!pstapriv->pallocated_stainfo_buf)
|
||||
return _FAIL;
|
||||
|
||||
pstapriv->pstainfo_buf = pstapriv->pallocated_stainfo_buf + 4 -
|
||||
((SIZE_PTR)(pstapriv->pallocated_stainfo_buf ) & 3);
|
||||
|
||||
_rtw_init_queue(&pstapriv->free_sta_queue);
|
||||
|
||||
_rtw_spinlock_init(&pstapriv->sta_hash_lock);
|
||||
|
||||
//_rtw_init_queue(&pstapriv->asoc_q);
|
||||
pstapriv->asoc_sta_count = 0;
|
||||
_rtw_init_queue(&pstapriv->sleep_q);
|
||||
_rtw_init_queue(&pstapriv->wakeup_q);
|
||||
|
||||
psta = (struct sta_info *)(pstapriv->pstainfo_buf);
|
||||
|
||||
|
||||
for(i = 0; i < NUM_STA; i++)
|
||||
{
|
||||
_rtw_init_stainfo(psta);
|
||||
|
||||
_rtw_init_listhead(&(pstapriv->sta_hash[i]));
|
||||
|
||||
rtw_list_insert_tail(&psta->list, get_list_head(&pstapriv->free_sta_queue));
|
||||
|
||||
psta++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
pstapriv->sta_dz_bitmap = 0;
|
||||
pstapriv->tim_bitmap = 0;
|
||||
|
||||
_rtw_init_listhead(&pstapriv->asoc_list);
|
||||
_rtw_init_listhead(&pstapriv->auth_list);
|
||||
_rtw_spinlock_init(&pstapriv->asoc_list_lock);
|
||||
_rtw_spinlock_init(&pstapriv->auth_list_lock);
|
||||
pstapriv->asoc_list_cnt = 0;
|
||||
pstapriv->auth_list_cnt = 0;
|
||||
|
||||
pstapriv->auth_to = 3; // 3*2 = 6 sec
|
||||
pstapriv->assoc_to = 3;
|
||||
//pstapriv->expire_to = 900;// 900*2 = 1800 sec = 30 min, expire after no any traffic.
|
||||
//pstapriv->expire_to = 30;// 30*2 = 60 sec = 1 min, expire after no any traffic.
|
||||
#ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK
|
||||
pstapriv->expire_to = 3; // 3*2 = 6 sec
|
||||
#else
|
||||
pstapriv->expire_to = 60;// 60*2 = 120 sec = 2 min, expire after no any traffic.
|
||||
#endif
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
_rtw_memset( pstapriv->atmel_rc_pattern, 0, ETH_ALEN);
|
||||
#endif
|
||||
pstapriv->max_num_sta = NUM_STA;
|
||||
|
||||
#endif
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
inline int rtw_stainfo_offset(struct sta_priv *stapriv, struct sta_info *sta)
|
||||
{
|
||||
int offset = (((u8 *)sta) - stapriv->pstainfo_buf)/sizeof(struct sta_info);
|
||||
|
||||
if (!stainfo_offset_valid(offset))
|
||||
DBG_871X("%s invalid offset(%d), out of range!!!", __func__, offset);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int offset)
|
||||
{
|
||||
if (!stainfo_offset_valid(offset))
|
||||
DBG_871X("%s invalid offset(%d), out of range!!!", __func__, offset);
|
||||
|
||||
return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info));
|
||||
}
|
||||
|
||||
void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv);
|
||||
void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
_rtw_spinlock_free(&psta_xmitpriv->lock);
|
||||
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->be_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->bk_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->vi_q.sta_pending.lock));
|
||||
_rtw_spinlock_free(&(psta_xmitpriv->vo_q.sta_pending.lock));
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
_rtw_spinlock_free(&psta_recvpriv->lock);
|
||||
|
||||
_rtw_spinlock_free(&(psta_recvpriv->defrag_q.lock));
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void rtw_mfree_stainfo(struct sta_info *psta);
|
||||
void rtw_mfree_stainfo(struct sta_info *psta)
|
||||
{
|
||||
_func_enter_;
|
||||
|
||||
if(&psta->lock != NULL)
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
|
||||
_rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
|
||||
|
||||
_func_exit_;
|
||||
}
|
||||
|
||||
|
||||
// this function is used to free the memory of lock || sema for all stainfos
|
||||
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv );
|
||||
void rtw_mfree_all_stainfo(struct sta_priv *pstapriv )
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
phead = get_list_head(&pstapriv->free_sta_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,list);
|
||||
plist = get_next(plist);
|
||||
|
||||
rtw_mfree_stainfo(psta);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv);
|
||||
void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv)
|
||||
{
|
||||
#ifdef CONFIG_AP_MODE
|
||||
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
|
||||
#endif
|
||||
|
||||
rtw_mfree_all_stainfo(pstapriv); //be done before free sta_hash_lock
|
||||
|
||||
_rtw_spinlock_free(&pstapriv->free_sta_queue.lock);
|
||||
|
||||
_rtw_spinlock_free(&pstapriv->sta_hash_lock);
|
||||
_rtw_spinlock_free(&pstapriv->wakeup_q.lock);
|
||||
_rtw_spinlock_free(&pstapriv->sleep_q.lock);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
_rtw_spinlock_free(&pstapriv->asoc_list_lock);
|
||||
_rtw_spinlock_free(&pstapriv->auth_list_lock);
|
||||
_rtw_spinlock_free(&pacl_list->acl_node_q.lock);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
u32 _rtw_free_sta_priv(struct sta_priv *pstapriv)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
struct sta_info *psta = NULL;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int index;
|
||||
|
||||
_func_enter_;
|
||||
if(pstapriv){
|
||||
|
||||
/* delete all reordering_ctrl_timer */
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
for(index = 0; index < NUM_STA; index++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
int i;
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
plist = get_next(plist);
|
||||
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
/*===============================*/
|
||||
|
||||
rtw_mfree_sta_priv_lock(pstapriv);
|
||||
|
||||
if(pstapriv->pallocated_stainfo_buf) {
|
||||
rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info)*NUM_STA+4);
|
||||
}
|
||||
}
|
||||
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
//struct sta_info *rtw_alloc_stainfo(_queue *pfree_sta_queue, unsigned char *hwaddr)
|
||||
struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
_irqL irqL, irqL2;
|
||||
uint tmp_aid;
|
||||
s32 index;
|
||||
_list *phash_list;
|
||||
struct sta_info *psta;
|
||||
_queue *pfree_sta_queue;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
int i = 0;
|
||||
u16 wRxSeqInitialValue = 0xffff;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
pfree_sta_queue = &pstapriv->free_sta_queue;
|
||||
|
||||
//_enter_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
if (_rtw_queue_empty(pfree_sta_queue) == _TRUE)
|
||||
{
|
||||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
psta = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
psta = LIST_CONTAINOR(get_next(&pfree_sta_queue->queue), struct sta_info, list);
|
||||
|
||||
rtw_list_delete(&(psta->list));
|
||||
|
||||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL);
|
||||
|
||||
tmp_aid = psta->aid;
|
||||
|
||||
_rtw_init_stainfo(psta);
|
||||
|
||||
psta->padapter = pstapriv->padapter;
|
||||
|
||||
_rtw_memcpy(psta->hwaddr, hwaddr, ETH_ALEN);
|
||||
|
||||
index = wifi_mac_hash(hwaddr);
|
||||
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("rtw_alloc_stainfo: index = %x", index));
|
||||
|
||||
if(index >= NUM_STA){
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("ERROR=> rtw_alloc_stainfo: index >= NUM_STA"));
|
||||
psta= NULL;
|
||||
goto exit;
|
||||
}
|
||||
phash_list = &(pstapriv->sta_hash[index]);
|
||||
|
||||
//_enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
rtw_list_insert_tail(&psta->hash_list, phash_list);
|
||||
|
||||
pstapriv->asoc_sta_count ++ ;
|
||||
|
||||
//_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
// Commented by Albert 2009/08/13
|
||||
// For the SMC router, the sequence number of first packet of WPS handshake will be 0.
|
||||
// In this case, this packet will be dropped by recv_decache function if we use the 0x00 as the default value for tid_rxseq variable.
|
||||
// So, we initialize the tid_rxseq variable as the 0xffff.
|
||||
|
||||
for( i = 0; i < 16; i++ )
|
||||
{
|
||||
_rtw_memcpy( &psta->sta_recvpriv.rxcache.tid_rxseq[ i ], &wRxSeqInitialValue, 2 );
|
||||
}
|
||||
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_info_,("alloc number_%d stainfo with hwaddr = %x %x %x %x %x %x \n",
|
||||
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_TDLS
|
||||
rtw_init_tdls_timer(pstapriv->padapter, psta);
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
//for A-MPDU Rx reordering buffer control
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
preorder_ctrl->padapter = pstapriv->padapter;
|
||||
|
||||
preorder_ctrl->enable = _FALSE;
|
||||
|
||||
preorder_ctrl->indicate_seq = 0xffff;
|
||||
#ifdef DBG_RX_SEQ
|
||||
DBG_871X("DBG_RX_SEQ %s:%d IndicateSeq: %d\n", __FUNCTION__, __LINE__,
|
||||
preorder_ctrl->indicate_seq);
|
||||
#endif
|
||||
preorder_ctrl->wend_b= 0xffff;
|
||||
//preorder_ctrl->wsize_b = (NR_RECVBUFF-2);
|
||||
preorder_ctrl->wsize_b = 64;//64;
|
||||
|
||||
_rtw_init_queue(&preorder_ctrl->pending_recvframe_queue);
|
||||
|
||||
rtw_init_recv_timer(preorder_ctrl);
|
||||
}
|
||||
|
||||
|
||||
//init for DM
|
||||
psta->rssi_stat.UndecoratedSmoothedPWDB = (-1);
|
||||
psta->rssi_stat.UndecoratedSmoothedCCK = (-1);
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
psta->flag_atmel_rc = 0;
|
||||
#endif
|
||||
/* init for the sequence number of received management frame */
|
||||
psta->RxMgmtFrameSeqNum = 0xffff;
|
||||
|
||||
//alloc mac id for non-bc/mc station,
|
||||
rtw_alloc_macid(pstapriv->padapter, psta);
|
||||
|
||||
}
|
||||
|
||||
exit:
|
||||
|
||||
_exit_critical_bh(&(pstapriv->sta_hash_lock), &irqL2);
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return psta;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
// using pstapriv->sta_hash_lock to protect
|
||||
u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta)
|
||||
{
|
||||
int i;
|
||||
_irqL irqL0;
|
||||
_queue *pfree_sta_queue;
|
||||
struct recv_reorder_ctrl *preorder_ctrl;
|
||||
struct sta_xmit_priv *pstaxmitpriv;
|
||||
struct xmit_priv *pxmitpriv= &padapter->xmitpriv;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct hw_xmit *phwxmit;
|
||||
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if (psta == NULL)
|
||||
goto exit;
|
||||
|
||||
|
||||
_enter_critical_bh(&psta->lock, &irqL0);
|
||||
psta->state &= ~_FW_LINKED;
|
||||
_exit_critical_bh(&psta->lock, &irqL0);
|
||||
|
||||
pfree_sta_queue = &pstapriv->free_sta_queue;
|
||||
|
||||
|
||||
pstaxmitpriv = &psta->sta_xmitpriv;
|
||||
|
||||
//rtw_list_delete(&psta->sleep_list);
|
||||
|
||||
//rtw_list_delete(&psta->wakeup_list);
|
||||
|
||||
_enter_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
rtw_free_xmitframe_queue(pxmitpriv, &psta->sleep_q);
|
||||
psta->sleepq_len = 0;
|
||||
|
||||
//vo
|
||||
//_enter_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vo_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->vo_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits;
|
||||
phwxmit->accnt -= pstaxmitpriv->vo_q.qcnt;
|
||||
pstaxmitpriv->vo_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->vo_pending.lock), &irqL0);
|
||||
|
||||
//vi
|
||||
//_enter_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->vi_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->vi_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits+1;
|
||||
phwxmit->accnt -= pstaxmitpriv->vi_q.qcnt;
|
||||
pstaxmitpriv->vi_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->vi_pending.lock), &irqL0);
|
||||
|
||||
//be
|
||||
//_enter_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->be_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->be_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits+2;
|
||||
phwxmit->accnt -= pstaxmitpriv->be_q.qcnt;
|
||||
pstaxmitpriv->be_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->be_pending.lock), &irqL0);
|
||||
|
||||
//bk
|
||||
//_enter_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
rtw_free_xmitframe_queue( pxmitpriv, &pstaxmitpriv->bk_q.sta_pending);
|
||||
rtw_list_delete(&(pstaxmitpriv->bk_q.tx_pending));
|
||||
phwxmit = pxmitpriv->hwxmits+3;
|
||||
phwxmit->accnt -= pstaxmitpriv->bk_q.qcnt;
|
||||
pstaxmitpriv->bk_q.qcnt = 0;
|
||||
//_exit_critical_bh(&(pxmitpriv->bk_pending.lock), &irqL0);
|
||||
|
||||
_exit_critical_bh(&pxmitpriv->lock, &irqL0);
|
||||
|
||||
rtw_list_delete(&psta->hash_list);
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("\n free number_%d stainfo with hwaddr = 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x \n",pstapriv->asoc_sta_count , psta->hwaddr[0], psta->hwaddr[1], psta->hwaddr[2],psta->hwaddr[3],psta->hwaddr[4],psta->hwaddr[5]));
|
||||
pstapriv->asoc_sta_count --;
|
||||
|
||||
|
||||
// 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);
|
||||
|
||||
_cancel_timer_ex(&psta->addba_retry_timer);
|
||||
|
||||
#ifdef CONFIG_TDLS
|
||||
rtw_free_tdls_timer(psta);
|
||||
#endif //CONFIG_TDLS
|
||||
|
||||
//for A-MPDU Rx reordering buffer control, cancel reordering_ctrl_timer
|
||||
for(i=0; i < 16 ; i++)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *phead, *plist;
|
||||
union recv_frame *prframe;
|
||||
_queue *ppending_recvframe_queue;
|
||||
_queue *pfree_recv_queue = &padapter->recvpriv.free_recv_queue;
|
||||
|
||||
preorder_ctrl = &psta->recvreorder_ctrl[i];
|
||||
|
||||
_cancel_timer_ex(&preorder_ctrl->reordering_ctrl_timer);
|
||||
|
||||
|
||||
ppending_recvframe_queue = &preorder_ctrl->pending_recvframe_queue;
|
||||
|
||||
_enter_critical_bh(&ppending_recvframe_queue->lock, &irqL);
|
||||
|
||||
phead = get_list_head(ppending_recvframe_queue);
|
||||
plist = get_next(phead);
|
||||
|
||||
while(!rtw_is_list_empty(phead))
|
||||
{
|
||||
prframe = LIST_CONTAINOR(plist, union recv_frame, u);
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
rtw_list_delete(&(prframe->u.hdr.list));
|
||||
|
||||
rtw_free_recvframe(prframe, pfree_recv_queue);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&ppending_recvframe_queue->lock, &irqL);
|
||||
|
||||
}
|
||||
|
||||
if (!(psta->state & WIFI_AP_STATE))
|
||||
rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, _FALSE);
|
||||
|
||||
|
||||
//release mac id for non-bc/mc station,
|
||||
rtw_release_macid(pstapriv->padapter, psta);
|
||||
|
||||
#ifdef CONFIG_AP_MODE
|
||||
|
||||
/*
|
||||
_enter_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
rtw_list_delete(&psta->asoc_list);
|
||||
_exit_critical_bh(&pstapriv->asoc_list_lock, &irqL0);
|
||||
*/
|
||||
_enter_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
if (!rtw_is_list_empty(&psta->auth_list)) {
|
||||
rtw_list_delete(&psta->auth_list);
|
||||
pstapriv->auth_list_cnt--;
|
||||
}
|
||||
_exit_critical_bh(&pstapriv->auth_list_lock, &irqL0);
|
||||
|
||||
psta->expire_to = 0;
|
||||
#ifdef CONFIG_ATMEL_RC_PATCH
|
||||
psta->flag_atmel_rc = 0;
|
||||
#endif
|
||||
psta->sleepq_ac_len = 0;
|
||||
psta->qos_info = 0;
|
||||
|
||||
psta->max_sp_len = 0;
|
||||
psta->uapsd_bk = 0;
|
||||
psta->uapsd_be = 0;
|
||||
psta->uapsd_vi = 0;
|
||||
psta->uapsd_vo = 0;
|
||||
|
||||
psta->has_legacy_ac = 0;
|
||||
|
||||
#ifdef CONFIG_NATIVEAP_MLME
|
||||
|
||||
pstapriv->sta_dz_bitmap &=~BIT(psta->aid);
|
||||
pstapriv->tim_bitmap &=~BIT(psta->aid);
|
||||
|
||||
//rtw_indicate_sta_disassoc_event(padapter, psta);
|
||||
|
||||
if ((psta->aid >0)&&(pstapriv->sta_aid[psta->aid - 1] == psta))
|
||||
{
|
||||
pstapriv->sta_aid[psta->aid - 1] = NULL;
|
||||
psta->aid = 0;
|
||||
}
|
||||
|
||||
#endif // CONFIG_NATIVEAP_MLME
|
||||
|
||||
#ifdef CONFIG_TX_MCAST2UNI
|
||||
psta->under_exist_checking = 0;
|
||||
#endif // CONFIG_TX_MCAST2UNI
|
||||
|
||||
#endif // CONFIG_AP_MODE
|
||||
|
||||
_rtw_spinlock_free(&psta->lock);
|
||||
|
||||
//_enter_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
rtw_list_insert_tail(&psta->list, get_list_head(pfree_sta_queue));
|
||||
//_exit_critical_bh(&(pfree_sta_queue->lock), &irqL0);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
// free all stainfo which in sta_hash[all]
|
||||
void rtw_free_all_stainfo(_adapter *padapter)
|
||||
{
|
||||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
s32 index;
|
||||
struct sta_info *psta = NULL;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct sta_info* pbcmc_stainfo =rtw_get_bcmc_stainfo( padapter);
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(pstapriv->asoc_sta_count==1)
|
||||
goto exit;
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
for(index=0; index< NUM_STA; index++)
|
||||
{
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info ,hash_list);
|
||||
|
||||
plist = get_next(plist);
|
||||
|
||||
if(pbcmc_stainfo!=psta)
|
||||
rtw_free_stainfo(padapter , psta);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
exit:
|
||||
|
||||
_func_exit_;
|
||||
|
||||
}
|
||||
|
||||
/* any station allocated can be searched by hash list */
|
||||
struct sta_info *rtw_get_stainfo(struct sta_priv *pstapriv, u8 *hwaddr)
|
||||
{
|
||||
|
||||
_irqL irqL;
|
||||
|
||||
_list *plist, *phead;
|
||||
|
||||
struct sta_info *psta = NULL;
|
||||
|
||||
u32 index;
|
||||
|
||||
u8 *addr;
|
||||
|
||||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
|
||||
_func_enter_;
|
||||
|
||||
if(hwaddr==NULL)
|
||||
return NULL;
|
||||
|
||||
if(IS_MCAST(hwaddr))
|
||||
{
|
||||
addr = bc_addr;
|
||||
}
|
||||
else
|
||||
{
|
||||
addr = hwaddr;
|
||||
}
|
||||
|
||||
index = wifi_mac_hash(addr);
|
||||
|
||||
_enter_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
|
||||
phead = &(pstapriv->sta_hash[index]);
|
||||
plist = get_next(phead);
|
||||
|
||||
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
|
||||
psta = LIST_CONTAINOR(plist, struct sta_info, hash_list);
|
||||
|
||||
if ((_rtw_memcmp(psta->hwaddr, addr, ETH_ALEN))== _TRUE)
|
||||
{ // if found the matched address
|
||||
break;
|
||||
}
|
||||
psta=NULL;
|
||||
plist = get_next(plist);
|
||||
}
|
||||
|
||||
_exit_critical_bh(&pstapriv->sta_hash_lock, &irqL);
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
}
|
||||
|
||||
u32 rtw_init_bcmc_stainfo(_adapter* padapter)
|
||||
{
|
||||
|
||||
struct sta_info *psta;
|
||||
struct tx_servq *ptxservq;
|
||||
u32 res=_SUCCESS;
|
||||
NDIS_802_11_MAC_ADDRESS bcast_addr= {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
//_queue *pstapending = &padapter->xmitpriv.bm_pending;
|
||||
|
||||
_func_enter_;
|
||||
|
||||
psta = rtw_alloc_stainfo(pstapriv, bcast_addr);
|
||||
|
||||
if(psta==NULL){
|
||||
res=_FAIL;
|
||||
RT_TRACE(_module_rtl871x_sta_mgt_c_,_drv_err_,("rtw_alloc_stainfo fail"));
|
||||
goto exit;
|
||||
}
|
||||
|
||||
// default broadcast & multicast use macid 1
|
||||
psta->mac_id = 1;
|
||||
|
||||
ptxservq= &(psta->sta_xmitpriv.be_q);
|
||||
|
||||
/*
|
||||
_enter_critical(&pstapending->lock, &irqL0);
|
||||
|
||||
if (rtw_is_list_empty(&ptxservq->tx_pending))
|
||||
rtw_list_insert_tail(&ptxservq->tx_pending, get_list_head(pstapending));
|
||||
|
||||
_exit_critical(&pstapending->lock, &irqL0);
|
||||
*/
|
||||
|
||||
exit:
|
||||
_func_exit_;
|
||||
return _SUCCESS;
|
||||
|
||||
}
|
||||
|
||||
|
||||
struct sta_info* rtw_get_bcmc_stainfo(_adapter* padapter)
|
||||
{
|
||||
struct sta_info *psta;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
u8 bc_addr[ETH_ALEN] = {0xff,0xff,0xff,0xff,0xff,0xff};
|
||||
_func_enter_;
|
||||
psta = rtw_get_stainfo(pstapriv, bc_addr);
|
||||
_func_exit_;
|
||||
return psta;
|
||||
|
||||
}
|
||||
|
||||
u8 rtw_access_ctrl(_adapter *padapter, u8 *mac_addr)
|
||||
{
|
||||
u8 res = _TRUE;
|
||||
#ifdef CONFIG_AP_MODE
|
||||
_irqL irqL;
|
||||
_list *plist, *phead;
|
||||
struct rtw_wlan_acl_node *paclnode;
|
||||
u8 match = _FALSE;
|
||||
struct sta_priv *pstapriv = &padapter->stapriv;
|
||||
struct wlan_acl_pool *pacl_list = &pstapriv->acl_list;
|
||||
_queue *pacl_node_q =&pacl_list->acl_node_q;
|
||||
|
||||
_enter_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
phead = get_list_head(pacl_node_q);
|
||||
plist = get_next(phead);
|
||||
while ((rtw_end_of_queue_search(phead, plist)) == _FALSE)
|
||||
{
|
||||
paclnode = LIST_CONTAINOR(plist, struct rtw_wlan_acl_node, list);
|
||||
plist = get_next(plist);
|
||||
|
||||
if(_rtw_memcmp(paclnode->addr, mac_addr, ETH_ALEN))
|
||||
{
|
||||
if(paclnode->valid == _TRUE)
|
||||
{
|
||||
match = _TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
_exit_critical_bh(&(pacl_node_q->lock), &irqL);
|
||||
|
||||
|
||||
if(pacl_list->mode == 1)//accept unless in deny list
|
||||
{
|
||||
res = (match == _TRUE) ? _FALSE:_TRUE;
|
||||
}
|
||||
else if(pacl_list->mode == 2)//deny unless in accept list
|
||||
{
|
||||
res = (match == _TRUE) ? _TRUE:_FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
res = _TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
return res;
|
||||
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,733 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
#define _RTW_VHT_C
|
||||
|
||||
#include <drv_types.h>
|
||||
|
||||
#ifdef CONFIG_80211AC_VHT
|
||||
// 20/40/80, ShortGI, MCS Rate
|
||||
const u16 VHT_MCS_DATA_RATE[3][2][30] =
|
||||
{ { {13, 26, 39, 52, 78, 104, 117, 130, 156, 156,
|
||||
26, 52, 78, 104, 156, 208, 234, 260, 312, 312,
|
||||
39, 78, 117, 156, 234, 312, 351, 390, 468, 520}, // Long GI, 20MHz
|
||||
{14, 29, 43, 58, 87, 116, 130, 144, 173, 173,
|
||||
29, 58, 87, 116, 173, 231, 260, 289, 347, 347,
|
||||
43, 87, 130, 173, 260, 347,390, 433, 520, 578} }, // Short GI, 20MHz
|
||||
{ {27, 54, 81, 108, 162, 216, 243, 270, 324, 360,
|
||||
54, 108, 162, 216, 324, 432, 486, 540, 648, 720,
|
||||
81, 162, 243, 324, 486, 648, 729, 810, 972, 1080}, // Long GI, 40MHz
|
||||
{30, 60, 90, 120, 180, 240, 270, 300,360, 400,
|
||||
60, 120, 180, 240, 360, 480, 540, 600, 720, 800,
|
||||
90, 180, 270, 360, 540, 720, 810, 900, 1080, 1200}}, // Short GI, 40MHz
|
||||
{ {59, 117, 176, 234, 351, 468, 527, 585, 702, 780,
|
||||
117, 234, 351, 468, 702, 936, 1053, 1170, 1404, 1560,
|
||||
176, 351, 527, 702, 1053, 1404, 1580, 1755, 2106, 2106}, // Long GI, 80MHz
|
||||
{65, 130, 195, 260, 390, 520, 585, 650, 780, 867,
|
||||
130, 260, 390, 520, 780, 1040, 1170, 1300, 1560,1734,
|
||||
195, 390, 585, 780, 1170, 1560, 1755, 1950, 2340, 2340} } // Short GI, 80MHz
|
||||
};
|
||||
|
||||
u8 rtw_get_vht_highest_rate(u8 *pvht_mcs_map)
|
||||
{
|
||||
u8 i, j;
|
||||
u8 bit_map;
|
||||
u8 vht_mcs_rate = 0;
|
||||
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
if(pvht_mcs_map[i] != 0xff)
|
||||
{
|
||||
for(j = 0; j < 8; j += 2)
|
||||
{
|
||||
bit_map = (pvht_mcs_map[i] >> j) & 3;
|
||||
|
||||
if(bit_map != 3)
|
||||
vht_mcs_rate = MGN_VHT1SS_MCS7 + 10*j/2 + i*40 + bit_map; //VHT rate indications begin from 0x90
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//DBG_871X("HighestVHTMCSRate is %x\n", vht_mcs_rate);
|
||||
return vht_mcs_rate;
|
||||
}
|
||||
|
||||
u8 rtw_vht_mcsmap_to_nss(u8 *pvht_mcs_map)
|
||||
{
|
||||
u8 i, j;
|
||||
u8 bit_map;
|
||||
u8 nss = 0;
|
||||
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
if(pvht_mcs_map[i] != 0xff)
|
||||
{
|
||||
for(j = 0; j < 8; j += 2)
|
||||
{
|
||||
bit_map = (pvht_mcs_map[i] >> j) & 3;
|
||||
|
||||
if(bit_map != 3)
|
||||
nss++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//DBG_871X("%s : %dSS\n", __FUNCTION__, nss);
|
||||
return nss;
|
||||
}
|
||||
|
||||
void rtw_vht_nss_to_mcsmap(u8 nss, u8 *target_mcs_map, u8 *cur_mcs_map)
|
||||
{
|
||||
u8 i, j;
|
||||
u8 cur_rate, target_rate;
|
||||
|
||||
for(i = 0; i < 2; i++)
|
||||
{
|
||||
target_mcs_map[i] = 0;
|
||||
for(j = 0; j < 8; j+=2)
|
||||
{
|
||||
cur_rate = (cur_mcs_map[i] >> j) & 3;
|
||||
if(cur_rate == 3) //0x3 indicates not supported that num of SS
|
||||
target_rate = 3;
|
||||
else if(nss <= ((j/2)+i*4))
|
||||
target_rate = 3;
|
||||
else
|
||||
target_rate = cur_rate;
|
||||
|
||||
target_mcs_map[i] |= (target_rate << j);
|
||||
}
|
||||
}
|
||||
|
||||
//DBG_871X("%s : %dSS\n", __FUNCTION__, nss);
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
return VHT_MCS_DATA_RATE[bw][short_GI][((vht_mcs_rate - MGN_VHT1SS_MCS0)&0x3f)];
|
||||
}
|
||||
|
||||
void rtw_vht_use_default_setting(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
BOOLEAN bHwLDPCSupport = _FALSE, bHwSTBCSupport = _FALSE;
|
||||
BOOLEAN bHwSupportBeamformer = _FALSE, bHwSupportBeamformee = _FALSE;
|
||||
u8 rf_type = 0;
|
||||
|
||||
pvhtpriv->sgi_80m = TEST_FLAG(pregistrypriv->short_gi, BIT2) ? _TRUE : _FALSE;
|
||||
|
||||
// LDPC support
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_RX_LDPC, (u8 *)&bHwLDPCSupport);
|
||||
CLEAR_FLAGS(pvhtpriv->ldpc_cap);
|
||||
if(bHwLDPCSupport)
|
||||
{
|
||||
if(TEST_FLAG(pregistrypriv->ldpc_cap, BIT0))
|
||||
SET_FLAG(pvhtpriv->ldpc_cap, LDPC_VHT_ENABLE_RX);
|
||||
}
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_TX_LDPC, (u8 *)&bHwLDPCSupport);
|
||||
if(bHwLDPCSupport)
|
||||
{
|
||||
if(TEST_FLAG(pregistrypriv->ldpc_cap, BIT1))
|
||||
SET_FLAG(pvhtpriv->ldpc_cap, LDPC_VHT_ENABLE_TX);
|
||||
}
|
||||
if (pvhtpriv->ldpc_cap)
|
||||
DBG_871X("[VHT] Support LDPC = 0x%02X\n", pvhtpriv->ldpc_cap);
|
||||
|
||||
// STBC
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_TX_STBC, (u8 *)&bHwSTBCSupport);
|
||||
CLEAR_FLAGS(pvhtpriv->stbc_cap);
|
||||
if(bHwSTBCSupport)
|
||||
{
|
||||
if(TEST_FLAG(pregistrypriv->stbc_cap, BIT1))
|
||||
SET_FLAG(pvhtpriv->stbc_cap, STBC_VHT_ENABLE_TX);
|
||||
}
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_RX_STBC, (u8 *)&bHwSTBCSupport);
|
||||
if(bHwSTBCSupport)
|
||||
{
|
||||
if(TEST_FLAG(pregistrypriv->stbc_cap, BIT0))
|
||||
SET_FLAG(pvhtpriv->stbc_cap, STBC_VHT_ENABLE_RX);
|
||||
}
|
||||
if (pvhtpriv->stbc_cap)
|
||||
DBG_871X("[VHT] Support STBC = 0x%02X\n", pvhtpriv->stbc_cap);
|
||||
|
||||
// Beamforming setting
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMER, (u8 *)&bHwSupportBeamformer);
|
||||
rtw_hal_get_def_var(padapter, HAL_DEF_EXPLICIT_BEAMFORMEE, (u8 *)&bHwSupportBeamformee);
|
||||
CLEAR_FLAGS(pvhtpriv->beamform_cap);
|
||||
if(TEST_FLAG(pregistrypriv->beamform_cap, BIT0) && bHwSupportBeamformer)
|
||||
{
|
||||
SET_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
|
||||
DBG_871X("[VHT] Support Beamformer\n");
|
||||
}
|
||||
if(TEST_FLAG(pregistrypriv->beamform_cap, BIT1) && bHwSupportBeamformee)
|
||||
{
|
||||
SET_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE);
|
||||
DBG_871X("[VHT] Support Beamformee\n");
|
||||
}
|
||||
|
||||
pvhtpriv->ampdu_len = pregistrypriv->ampdu_factor;
|
||||
|
||||
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;
|
||||
else
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfa; //support 1SS MCS 0~9 2SS MCS 0~9
|
||||
pvhtpriv->vht_mcs_map[1] = 0xff;
|
||||
|
||||
if(pregistrypriv->vht_rate_sel == 1)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfc; // support 1SS MCS 0~7
|
||||
}
|
||||
else if(pregistrypriv->vht_rate_sel == 2)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfd; // Support 1SS MCS 0~8
|
||||
}
|
||||
else if(pregistrypriv->vht_rate_sel == 3)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfe; // Support 1SS MCS 0~9
|
||||
}
|
||||
else if(pregistrypriv->vht_rate_sel == 4)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xf0; // support 1SS MCS 0~7 2SS MCS 0~7
|
||||
}
|
||||
else if(pregistrypriv->vht_rate_sel == 5)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xf5; // support 1SS MCS 0~8 2SS MCS 0~8
|
||||
}
|
||||
else if(pregistrypriv->vht_rate_sel == 6)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xfa; // support 1SS MCS 0~9 2SS MCS 0~9
|
||||
}
|
||||
else if(pregistrypriv->vht_rate_sel == 7)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xf8; // support 1SS MCS 0-7 2SS MCS 0~9
|
||||
}
|
||||
else if(pregistrypriv->vht_rate_sel == 8)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xf9; // support 1SS MCS 0-8 2SS MCS 0~9
|
||||
}
|
||||
else if(pregistrypriv->vht_rate_sel == 9)
|
||||
{
|
||||
pvhtpriv->vht_mcs_map[0] = 0xf4; // support 1SS MCS 0-7 2SS MCS 0~8
|
||||
}
|
||||
|
||||
pvhtpriv->vht_highest_rate = rtw_get_vht_highest_rate(pvhtpriv->vht_mcs_map);
|
||||
}
|
||||
|
||||
u32 rtw_vht_rate_to_bitmap(u8 *pVHTRate)
|
||||
{
|
||||
|
||||
u8 i,j , tmpRate;
|
||||
u32 RateBitmap = 0;
|
||||
|
||||
for(i = j= 0; i < 4; i+=2, j+=10)
|
||||
{
|
||||
tmpRate = (pVHTRate[0] >> i) & 3;
|
||||
|
||||
switch(tmpRate){
|
||||
case 2:
|
||||
RateBitmap = RateBitmap | (0x03ff << j);
|
||||
break;
|
||||
case 1:
|
||||
RateBitmap = RateBitmap | (0x01ff << j);
|
||||
break;
|
||||
|
||||
case 0:
|
||||
RateBitmap = RateBitmap | (0x00ff << j);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return RateBitmap;
|
||||
}
|
||||
|
||||
void update_sta_vht_info_apmode(_adapter *padapter, PVOID sta)
|
||||
{
|
||||
struct sta_info *psta = (struct sta_info *)sta;
|
||||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct vht_priv *pvhtpriv_ap = &pmlmepriv->vhtpriv;
|
||||
struct vht_priv *pvhtpriv_sta = &psta->vhtpriv;
|
||||
struct ht_priv *phtpriv_sta = &psta->htpriv;
|
||||
u8 cur_ldpc_cap=0, cur_stbc_cap=0, cur_beamform_cap=0, bw_mode = 0;
|
||||
u8 *pcap_mcs;
|
||||
|
||||
if (pvhtpriv_sta->vht_option == _FALSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
bw_mode = GET_VHT_OPERATING_MODE_FIELD_CHNL_WIDTH(&pvhtpriv_sta->vht_op_mode_notify);
|
||||
if (bw_mode > psta->bw_mode)
|
||||
psta->bw_mode = bw_mode;
|
||||
|
||||
// B4 Rx LDPC
|
||||
if (TEST_FLAG(pvhtpriv_ap->ldpc_cap, LDPC_VHT_ENABLE_TX) &&
|
||||
GET_VHT_CAPABILITY_ELE_RX_LDPC(pvhtpriv_sta->vht_cap))
|
||||
{
|
||||
SET_FLAG(cur_ldpc_cap, (LDPC_VHT_ENABLE_TX | LDPC_VHT_CAP_TX));
|
||||
DBG_871X("Current STA(%d) VHT LDPC = %02X\n", psta->aid, cur_ldpc_cap);
|
||||
}
|
||||
pvhtpriv_sta->ldpc_cap = cur_ldpc_cap;
|
||||
|
||||
if (psta->bw_mode > pmlmeext->cur_bwmode)
|
||||
psta->bw_mode = pmlmeext->cur_bwmode;
|
||||
|
||||
if (psta->bw_mode == CHANNEL_WIDTH_80) {
|
||||
// B5 Short GI for 80 MHz
|
||||
pvhtpriv_sta->sgi_80m = (GET_VHT_CAPABILITY_ELE_SHORT_GI80M(pvhtpriv_sta->vht_cap) & pvhtpriv_ap->sgi_80m) ? _TRUE : _FALSE;
|
||||
//DBG_871X("Current STA ShortGI80MHz = %d\n", pvhtpriv_sta->sgi_80m);
|
||||
} else if (psta->bw_mode >= CHANNEL_WIDTH_160) {
|
||||
// B5 Short GI for 80 MHz
|
||||
pvhtpriv_sta->sgi_80m = (GET_VHT_CAPABILITY_ELE_SHORT_GI160M(pvhtpriv_sta->vht_cap) & pvhtpriv_ap->sgi_80m) ? _TRUE : _FALSE;
|
||||
//DBG_871X("Current STA ShortGI160MHz = %d\n", pvhtpriv_sta->sgi_80m);
|
||||
}
|
||||
|
||||
// B8 B9 B10 Rx STBC
|
||||
if (TEST_FLAG(pvhtpriv_ap->stbc_cap, STBC_VHT_ENABLE_TX) &&
|
||||
GET_VHT_CAPABILITY_ELE_RX_STBC(pvhtpriv_sta->vht_cap))
|
||||
{
|
||||
SET_FLAG(cur_stbc_cap, (STBC_VHT_ENABLE_TX | STBC_VHT_CAP_TX));
|
||||
DBG_871X("Current STA(%d) VHT STBC = %02X\n", psta->aid, cur_stbc_cap);
|
||||
}
|
||||
pvhtpriv_sta->stbc_cap = cur_stbc_cap;
|
||||
|
||||
// B11 SU Beamformer Capable, the target supports Beamformer and we are Beamformee
|
||||
if (TEST_FLAG(pvhtpriv_ap->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE) &&
|
||||
GET_VHT_CAPABILITY_ELE_SU_BFEE(pvhtpriv_sta->vht_cap))
|
||||
{
|
||||
SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE);
|
||||
}
|
||||
|
||||
// B12 SU Beamformee Capable, the target supports Beamformee and we are Beamformer
|
||||
if (TEST_FLAG(pvhtpriv_ap->beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE) &&
|
||||
GET_VHT_CAPABILITY_ELE_SU_BFER(pvhtpriv_sta->vht_cap))
|
||||
{
|
||||
SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
|
||||
}
|
||||
pvhtpriv_sta->beamform_cap = cur_beamform_cap;
|
||||
if (cur_beamform_cap) {
|
||||
DBG_871X("Current STA(%d) VHT Beamforming Setting = %02X\n", psta->aid, cur_beamform_cap);
|
||||
}
|
||||
|
||||
// B23 B24 B25 Maximum A-MPDU Length Exponent
|
||||
pvhtpriv_sta->ampdu_len = GET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(pvhtpriv_sta->vht_cap);
|
||||
|
||||
pcap_mcs = GET_VHT_CAPABILITY_ELE_RX_MCS(pvhtpriv_sta->vht_cap);
|
||||
_rtw_memcpy(pvhtpriv_sta->vht_mcs_map, pcap_mcs, 2);
|
||||
|
||||
pvhtpriv_sta->vht_highest_rate = rtw_get_vht_highest_rate(pvhtpriv_sta->vht_mcs_map);
|
||||
|
||||
}
|
||||
|
||||
void update_hw_vht_param(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
u8 ht_AMPDU_len;
|
||||
|
||||
ht_AMPDU_len = pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x03;
|
||||
|
||||
if(pvhtpriv->ampdu_len > ht_AMPDU_len)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&pvhtpriv->ampdu_len));
|
||||
}
|
||||
|
||||
void VHT_caps_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
u8 cur_ldpc_cap=0, cur_stbc_cap=0, cur_beamform_cap=0, rf_type = RF_1T1R;
|
||||
u8 *pcap_mcs;
|
||||
u8 vht_mcs[2];
|
||||
|
||||
if(pIE==NULL) return;
|
||||
|
||||
if(pvhtpriv->vht_option == _FALSE) return;
|
||||
|
||||
pmlmeinfo->VHT_enable = 1;
|
||||
|
||||
// B4 Rx LDPC
|
||||
if (TEST_FLAG(pvhtpriv->ldpc_cap, LDPC_VHT_ENABLE_TX) &&
|
||||
GET_VHT_CAPABILITY_ELE_RX_LDPC(pIE->data))
|
||||
{
|
||||
SET_FLAG(cur_ldpc_cap, (LDPC_VHT_ENABLE_TX | LDPC_VHT_CAP_TX));
|
||||
DBG_871X("Current VHT LDPC Setting = %02X\n", cur_ldpc_cap);
|
||||
}
|
||||
pvhtpriv->ldpc_cap = cur_ldpc_cap;
|
||||
|
||||
// B5 Short GI for 80 MHz
|
||||
pvhtpriv->sgi_80m = (GET_VHT_CAPABILITY_ELE_SHORT_GI80M(pIE->data) & pvhtpriv->sgi_80m) ? _TRUE : _FALSE;
|
||||
//DBG_871X("Current ShortGI80MHz = %d\n", pvhtpriv->sgi_80m);
|
||||
|
||||
// B8 B9 B10 Rx STBC
|
||||
if (TEST_FLAG(pvhtpriv->stbc_cap, STBC_VHT_ENABLE_TX) &&
|
||||
GET_VHT_CAPABILITY_ELE_RX_STBC(pIE->data))
|
||||
{
|
||||
SET_FLAG(cur_stbc_cap, (STBC_VHT_ENABLE_TX | STBC_VHT_CAP_TX));
|
||||
DBG_871X("Current VHT STBC Setting = %02X\n", cur_stbc_cap);
|
||||
}
|
||||
pvhtpriv->stbc_cap = cur_stbc_cap;
|
||||
|
||||
// B11 SU Beamformer Capable, the target supports Beamformer and we are Beamformee
|
||||
if (TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE) &&
|
||||
GET_VHT_CAPABILITY_ELE_SU_BFEE(pIE->data))
|
||||
{
|
||||
SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE);
|
||||
}
|
||||
|
||||
// B12 SU Beamformee Capable, the target supports Beamformee and we are Beamformer
|
||||
if (TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE) &&
|
||||
GET_VHT_CAPABILITY_ELE_SU_BFER(pIE->data))
|
||||
{
|
||||
SET_FLAG(cur_beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE);
|
||||
}
|
||||
pvhtpriv->beamform_cap = cur_beamform_cap;
|
||||
if (cur_beamform_cap) {
|
||||
DBG_871X("Current VHT Beamforming Setting = %02X\n", cur_beamform_cap);
|
||||
}
|
||||
|
||||
// B23 B24 B25 Maximum A-MPDU Length Exponent
|
||||
pvhtpriv->ampdu_len = GET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(pIE->data);
|
||||
|
||||
pcap_mcs = GET_VHT_CAPABILITY_ELE_RX_MCS(pIE->data);
|
||||
_rtw_memcpy(vht_mcs, pcap_mcs, 2);
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
if ((rf_type == RF_1T1R) || (rf_type == RF_1T2R))
|
||||
vht_mcs[0] |= 0xfc;
|
||||
else if (rf_type == RF_2T2R)
|
||||
vht_mcs[0] |= 0xf0;
|
||||
|
||||
_rtw_memcpy(pvhtpriv->vht_mcs_map, vht_mcs, 2);
|
||||
|
||||
pvhtpriv->vht_highest_rate = rtw_get_vht_highest_rate(pvhtpriv->vht_mcs_map);
|
||||
}
|
||||
|
||||
void VHT_operation_handler(_adapter *padapter, PNDIS_802_11_VARIABLE_IEs pIE)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
|
||||
if(pIE==NULL) return;
|
||||
|
||||
if(pvhtpriv->vht_option == _FALSE) return;
|
||||
}
|
||||
|
||||
void rtw_process_vht_op_mode_notify(_adapter *padapter, u8 *pframe, PVOID sta)
|
||||
{
|
||||
struct sta_info *psta = (struct sta_info *)sta;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
u8 target_bw;
|
||||
u8 target_rxss, current_rxss;
|
||||
u8 update_ra = _FALSE;
|
||||
u8 vht_mcs_map[2] = {};
|
||||
|
||||
if(pvhtpriv->vht_option == _FALSE)
|
||||
return;
|
||||
|
||||
target_bw = GET_VHT_OPERATING_MODE_FIELD_CHNL_WIDTH(pframe);
|
||||
target_rxss = (GET_VHT_OPERATING_MODE_FIELD_RX_NSS(pframe)+1);
|
||||
|
||||
if (target_bw != psta->bw_mode) {
|
||||
if (target_bw <= (padapter->registrypriv.bw_mode >> 4)) {
|
||||
update_ra = _TRUE;
|
||||
psta->bw_mode = target_bw;
|
||||
}
|
||||
}
|
||||
|
||||
current_rxss = rtw_vht_mcsmap_to_nss(psta->vhtpriv.vht_mcs_map);
|
||||
if (target_rxss != current_rxss) {
|
||||
update_ra = _TRUE;
|
||||
|
||||
rtw_vht_nss_to_mcsmap(target_rxss, vht_mcs_map, psta->vhtpriv.vht_mcs_map);
|
||||
_rtw_memcpy(psta->vhtpriv.vht_mcs_map, vht_mcs_map, 2);
|
||||
|
||||
rtw_hal_update_sta_rate_mask(padapter, psta);
|
||||
}
|
||||
|
||||
if (update_ra) {
|
||||
rtw_dm_ra_mask_wk_cmd(padapter, (u8 *)psta);
|
||||
}
|
||||
}
|
||||
|
||||
u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel)
|
||||
{
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
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;
|
||||
u32 len = 0;
|
||||
u8 operation[5];
|
||||
|
||||
_rtw_memset(operation, 0, 5);
|
||||
|
||||
bw_mode = pregistrypriv->bw_mode >> 4;
|
||||
|
||||
if (bw_mode >= CHANNEL_WIDTH_80)
|
||||
{
|
||||
center_freq = rtw_get_center_ch(channel, bw_mode, HAL_PRIME_CHNL_OFFSET_LOWER);
|
||||
ChnlWidth = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
center_freq = 0;
|
||||
ChnlWidth = 0;
|
||||
}
|
||||
|
||||
|
||||
SET_VHT_OPERATION_ELE_CHL_WIDTH(operation, ChnlWidth);
|
||||
//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;
|
||||
operation[4] = 0xff;
|
||||
|
||||
rtw_set_ie(pbuf, EID_VHTOperation, 5, operation, &len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
u32 rtw_build_vht_op_mode_notify_ie(_adapter *padapter, u8 *pbuf, u8 bw)
|
||||
{
|
||||
//struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
u32 len = 0;
|
||||
u8 opmode = 0, rf_type = 0;
|
||||
u8 chnl_width, rx_nss;
|
||||
|
||||
chnl_width = bw;
|
||||
|
||||
rtw_hal_get_hwreg(padapter, HW_VAR_RF_TYPE, (u8 *)(&rf_type));
|
||||
if(rf_type == RF_1T1R)
|
||||
rx_nss = 1;
|
||||
else
|
||||
rx_nss = 2;
|
||||
|
||||
SET_VHT_OPERATING_MODE_FIELD_CHNL_WIDTH(&opmode, chnl_width);
|
||||
SET_VHT_OPERATING_MODE_FIELD_RX_NSS(&opmode, (rx_nss-1));
|
||||
SET_VHT_OPERATING_MODE_FIELD_RX_NSS_TYPE(&opmode, 0); //Todo
|
||||
|
||||
pvhtpriv->vht_op_mode_notify = opmode;
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, EID_OpModeNotification, 1, &opmode, &len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf)
|
||||
{
|
||||
u8 bw, rf_type;
|
||||
u16 HighestRate;
|
||||
u8 *pcap, *pcap_mcs;
|
||||
u32 len = 0;
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
|
||||
pcap = pvhtpriv->vht_cap;
|
||||
_rtw_memset(pcap, 0, 32);
|
||||
|
||||
// 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.
|
||||
|
||||
// B4 Rx LDPC
|
||||
if(TEST_FLAG(pvhtpriv->ldpc_cap, LDPC_VHT_ENABLE_RX))
|
||||
{
|
||||
SET_VHT_CAPABILITY_ELE_RX_LDPC(pcap, 1);
|
||||
}
|
||||
|
||||
// B5 ShortGI for 80MHz
|
||||
SET_VHT_CAPABILITY_ELE_SHORT_GI80M(pcap, pvhtpriv->sgi_80m? 1 : 0); // We can receive Short GI of 80M
|
||||
|
||||
// B6 ShortGI for 160MHz
|
||||
//SET_VHT_CAPABILITY_ELE_SHORT_GI160M(pcap, pvhtpriv->sgi_80m? 1 : 0);
|
||||
|
||||
// B7 Tx STBC
|
||||
if(TEST_FLAG(pvhtpriv->stbc_cap, STBC_VHT_ENABLE_TX))
|
||||
{
|
||||
SET_VHT_CAPABILITY_ELE_TX_STBC(pcap, 1);
|
||||
}
|
||||
|
||||
// B8 B9 B10 Rx STBC
|
||||
if(TEST_FLAG(pvhtpriv->stbc_cap, STBC_VHT_ENABLE_RX))
|
||||
{
|
||||
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);
|
||||
}
|
||||
else if (rf_type == RF_1T1R) {
|
||||
SET_VHT_CAPABILITY_ELE_RX_STBC(pcap, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// B11 SU Beamformer Capable
|
||||
if(TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMER_ENABLE))
|
||||
{
|
||||
SET_VHT_CAPABILITY_ELE_SU_BFER(pcap, 1);
|
||||
// B16 17 18 Number of Sounding Dimensions
|
||||
SET_VHT_CAPABILITY_ELE_SOUNDING_DIMENSIONS(pcap, 1);
|
||||
}
|
||||
|
||||
// B12 SU Beamformee Capable
|
||||
if(TEST_FLAG(pvhtpriv->beamform_cap, BEAMFORMING_VHT_BEAMFORMEE_ENABLE))
|
||||
{
|
||||
SET_VHT_CAPABILITY_ELE_SU_BFEE(pcap, 1);
|
||||
// B13 14 15 Compressed Steering Number of Beamformer Antennas Supported
|
||||
SET_VHT_CAPABILITY_ELE_BFER_ANT_SUPP(pcap, 1);
|
||||
}
|
||||
|
||||
// B19 MU Beamformer Capable
|
||||
SET_VHT_CAPABILITY_ELE_MU_BFER(pcap, 0); //HW don't support mu bfee/bfer
|
||||
// B20 MU Beamformee Capable
|
||||
SET_VHT_CAPABILITY_ELE_MU_BFEE(pcap, 0);
|
||||
// B21 VHT TXOP PS
|
||||
SET_VHT_CAPABILITY_ELE_TXOP_PS(pcap, 0);
|
||||
// B22 +HTC-VHT Capable
|
||||
SET_VHT_CAPABILITY_ELE_HTC_VHT(pcap, 1);
|
||||
// B23 24 25 Maximum A-MPDU Length Exponent
|
||||
if (pregistrypriv->ampdu_factor != 0xFE)
|
||||
{
|
||||
SET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(pcap, pregistrypriv->ampdu_factor);
|
||||
}
|
||||
else
|
||||
{
|
||||
SET_VHT_CAPABILITY_ELE_MAX_RXAMPDU_FACTOR(pcap, 7);
|
||||
}
|
||||
// B26 27 VHT Link Adaptation Capable
|
||||
SET_VHT_CAPABILITY_ELE_LINK_ADAPTION(pcap, 0);
|
||||
|
||||
pcap_mcs = GET_VHT_CAPABILITY_ELE_RX_MCS(pcap);
|
||||
_rtw_memcpy(pcap_mcs, pvhtpriv->vht_mcs_map, 2);
|
||||
|
||||
pcap_mcs = GET_VHT_CAPABILITY_ELE_TX_MCS(pcap);
|
||||
_rtw_memcpy(pcap_mcs, pvhtpriv->vht_mcs_map, 2);
|
||||
|
||||
bw = (pregistrypriv->bw_mode >> 4);
|
||||
HighestRate = VHT_MCS_DATA_RATE[bw][pvhtpriv->sgi_80m][((pvhtpriv->vht_highest_rate - MGN_VHT1SS_MCS0)&0x3f)];
|
||||
HighestRate = (HighestRate+1) >> 1;
|
||||
|
||||
SET_VHT_CAPABILITY_ELE_MCS_RX_HIGHEST_RATE(pcap, HighestRate); //indicate we support highest rx rate is 600Mbps.
|
||||
SET_VHT_CAPABILITY_ELE_MCS_TX_HIGHEST_RATE(pcap, HighestRate); //indicate we support highest tx rate is 600Mbps.
|
||||
|
||||
pbuf = rtw_set_ie(pbuf, EID_VHTCapability, 12, pcap, &len);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
u32 rtw_restructure_vht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, uint in_len, uint *pout_len)
|
||||
{
|
||||
u32 ielen=0, out_len=0;
|
||||
u8 cap_len=0, notify_len=0, notify_bw=0, operation_bw=0, supported_chnl_width=0;
|
||||
u8 *p, *pframe;
|
||||
struct registry_priv *pregistrypriv = &padapter->registrypriv;
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
|
||||
rtw_vht_use_default_setting(padapter);
|
||||
|
||||
p = rtw_get_ie(in_ie+12, EID_VHTCapability, &ielen, in_len-12);
|
||||
if (p && ielen>0) {
|
||||
supported_chnl_width = GET_VHT_CAPABILITY_ELE_CHL_WIDTH(p+2);
|
||||
|
||||
// VHT Capabilities element
|
||||
cap_len = rtw_build_vht_cap_ie(padapter, out_ie+*pout_len);
|
||||
*pout_len += cap_len;
|
||||
|
||||
// Get HT BW
|
||||
p = rtw_get_ie(in_ie+12, _HT_EXTRA_INFO_IE_, &ielen, in_len-12);
|
||||
if (p && ielen>0) {
|
||||
struct HT_info_element *pht_info = (struct HT_info_element *)(p+2);
|
||||
if (pht_info->infos[0] & BIT(2))
|
||||
operation_bw = CHANNEL_WIDTH_40;
|
||||
else
|
||||
operation_bw = CHANNEL_WIDTH_20;
|
||||
}
|
||||
|
||||
// VHT Operation element
|
||||
p = rtw_get_ie(in_ie+12, EID_VHTOperation, &ielen, in_len-12);
|
||||
if (p && ielen>0) {
|
||||
out_len = *pout_len;
|
||||
if (GET_VHT_OPERATION_ELE_CHL_WIDTH(p+2) >= 1) {
|
||||
if (supported_chnl_width == 2)
|
||||
operation_bw = CHANNEL_WIDTH_80_80;
|
||||
else if (supported_chnl_width == 1)
|
||||
operation_bw = CHANNEL_WIDTH_160;
|
||||
else
|
||||
operation_bw = CHANNEL_WIDTH_80;
|
||||
}
|
||||
pframe = rtw_set_ie(out_ie+out_len, EID_VHTOperation, ielen, p+2 , pout_len);
|
||||
}
|
||||
|
||||
notify_bw = pregistrypriv->bw_mode >> 4;
|
||||
|
||||
if (notify_bw > operation_bw)
|
||||
notify_bw = operation_bw;
|
||||
|
||||
// Operating Mode Notification element
|
||||
notify_len = rtw_build_vht_op_mode_notify_ie(padapter, out_ie+*pout_len, notify_bw);
|
||||
*pout_len += notify_len;
|
||||
|
||||
pvhtpriv->vht_option = _TRUE;
|
||||
}
|
||||
|
||||
return (pvhtpriv->vht_option);
|
||||
|
||||
}
|
||||
|
||||
void VHTOnAssocRsp(_adapter *padapter)
|
||||
{
|
||||
struct mlme_priv *pmlmepriv = &padapter->mlmepriv;
|
||||
struct vht_priv *pvhtpriv = &pmlmepriv->vhtpriv;
|
||||
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
|
||||
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
|
||||
u8 ht_AMPDU_len;
|
||||
|
||||
DBG_871X("%s\n", __FUNCTION__);
|
||||
|
||||
if (!pmlmeinfo->HT_enable)
|
||||
return;
|
||||
|
||||
if (!pmlmeinfo->VHT_enable)
|
||||
return;
|
||||
|
||||
ht_AMPDU_len = pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x03;
|
||||
|
||||
if(pvhtpriv->ampdu_len > ht_AMPDU_len)
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_FACTOR, (u8 *)(&pvhtpriv->ampdu_len));
|
||||
|
||||
rtw_hal_set_hwreg(padapter, HW_VAR_AMPDU_MAX_TIME, (u8 *)(&pvhtpriv->vht_highest_rate));
|
||||
}
|
||||
|
||||
#endif //CONFIG_80211AC_VHT
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,923 @@
|
|||
#ifdef CONFIG_WAPI_SUPPORT
|
||||
|
||||
#include <linux/unistd.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <drv_types.h>
|
||||
#include <rtw_wapi.h>
|
||||
|
||||
|
||||
#ifdef CONFIG_WAPI_SW_SMS4
|
||||
|
||||
#define WAPI_LITTLE_ENDIAN
|
||||
//#define BIG_ENDIAN
|
||||
#define ENCRYPT 0
|
||||
#define DECRYPT 1
|
||||
|
||||
|
||||
/**********************************************************
|
||||
**********************************************************/
|
||||
const u8 Sbox[256] = {
|
||||
0xd6,0x90,0xe9,0xfe,0xcc,0xe1,0x3d,0xb7,0x16,0xb6,0x14,0xc2,0x28,0xfb,0x2c,0x05,
|
||||
0x2b,0x67,0x9a,0x76,0x2a,0xbe,0x04,0xc3,0xaa,0x44,0x13,0x26,0x49,0x86,0x06,0x99,
|
||||
0x9c,0x42,0x50,0xf4,0x91,0xef,0x98,0x7a,0x33,0x54,0x0b,0x43,0xed,0xcf,0xac,0x62,
|
||||
0xe4,0xb3,0x1c,0xa9,0xc9,0x08,0xe8,0x95,0x80,0xdf,0x94,0xfa,0x75,0x8f,0x3f,0xa6,
|
||||
0x47,0x07,0xa7,0xfc,0xf3,0x73,0x17,0xba,0x83,0x59,0x3c,0x19,0xe6,0x85,0x4f,0xa8,
|
||||
0x68,0x6b,0x81,0xb2,0x71,0x64,0xda,0x8b,0xf8,0xeb,0x0f,0x4b,0x70,0x56,0x9d,0x35,
|
||||
0x1e,0x24,0x0e,0x5e,0x63,0x58,0xd1,0xa2,0x25,0x22,0x7c,0x3b,0x01,0x21,0x78,0x87,
|
||||
0xd4,0x00,0x46,0x57,0x9f,0xd3,0x27,0x52,0x4c,0x36,0x02,0xe7,0xa0,0xc4,0xc8,0x9e,
|
||||
0xea,0xbf,0x8a,0xd2,0x40,0xc7,0x38,0xb5,0xa3,0xf7,0xf2,0xce,0xf9,0x61,0x15,0xa1,
|
||||
0xe0,0xae,0x5d,0xa4,0x9b,0x34,0x1a,0x55,0xad,0x93,0x32,0x30,0xf5,0x8c,0xb1,0xe3,
|
||||
0x1d,0xf6,0xe2,0x2e,0x82,0x66,0xca,0x60,0xc0,0x29,0x23,0xab,0x0d,0x53,0x4e,0x6f,
|
||||
0xd5,0xdb,0x37,0x45,0xde,0xfd,0x8e,0x2f,0x03,0xff,0x6a,0x72,0x6d,0x6c,0x5b,0x51,
|
||||
0x8d,0x1b,0xaf,0x92,0xbb,0xdd,0xbc,0x7f,0x11,0xd9,0x5c,0x41,0x1f,0x10,0x5a,0xd8,
|
||||
0x0a,0xc1,0x31,0x88,0xa5,0xcd,0x7b,0xbd,0x2d,0x74,0xd0,0x12,0xb8,0xe5,0xb4,0xb0,
|
||||
0x89,0x69,0x97,0x4a,0x0c,0x96,0x77,0x7e,0x65,0xb9,0xf1,0x09,0xc5,0x6e,0xc6,0x84,
|
||||
0x18,0xf0,0x7d,0xec,0x3a,0xdc,0x4d,0x20,0x79,0xee,0x5f,0x3e,0xd7,0xcb,0x39,0x48
|
||||
};
|
||||
|
||||
const u32 CK[32] = {
|
||||
0x00070e15, 0x1c232a31, 0x383f464d, 0x545b6269,
|
||||
0x70777e85, 0x8c939aa1, 0xa8afb6bd, 0xc4cbd2d9,
|
||||
0xe0e7eef5, 0xfc030a11, 0x181f262d, 0x343b4249,
|
||||
0x50575e65, 0x6c737a81, 0x888f969d, 0xa4abb2b9,
|
||||
0xc0c7ced5, 0xdce3eaf1, 0xf8ff060d, 0x141b2229,
|
||||
0x30373e45, 0x4c535a61, 0x686f767d, 0x848b9299,
|
||||
0xa0a7aeb5, 0xbcc3cad1, 0xd8dfe6ed, 0xf4fb0209,
|
||||
0x10171e25, 0x2c333a41, 0x484f565d, 0x646b7279 };
|
||||
|
||||
#define Rotl(_x, _y) (((_x) << (_y)) | ((_x) >> (32 - (_y))))
|
||||
|
||||
#define ByteSub(_A) (Sbox[(_A) >> 24 & 0xFF] << 24 | \
|
||||
Sbox[(_A) >> 16 & 0xFF] << 16 | \
|
||||
Sbox[(_A) >> 8 & 0xFF] << 8 | \
|
||||
Sbox[(_A) & 0xFF])
|
||||
|
||||
#define L1(_B) ((_B) ^ Rotl(_B, 2) ^ Rotl(_B, 10) ^ Rotl(_B, 18) ^ Rotl(_B, 24))
|
||||
#define L2(_B) ((_B) ^ Rotl(_B, 13) ^ Rotl(_B, 23))
|
||||
|
||||
static void
|
||||
xor_block(void *dst, void *src1, void *src2)
|
||||
/* 128-bit xor: *dst = *src1 xor *src2. Pointers must be 32-bit aligned */
|
||||
{
|
||||
((u32 *)dst)[0] = ((u32 *)src1)[0] ^ ((u32 *)src2)[0];
|
||||
((u32 *)dst)[1] = ((u32 *)src1)[1] ^ ((u32 *)src2)[1];
|
||||
((u32 *)dst)[2] = ((u32 *)src1)[2] ^ ((u32 *)src2)[2];
|
||||
((u32 *)dst)[3] = ((u32 *)src1)[3] ^ ((u32 *)src2)[3];
|
||||
}
|
||||
|
||||
|
||||
void SMS4Crypt(u8 *Input, u8 *Output, u32 *rk)
|
||||
{
|
||||
u32 r, mid, x0, x1, x2, x3, *p;
|
||||
p = (u32 *)Input;
|
||||
x0 = p[0];
|
||||
x1 = p[1];
|
||||
x2 = p[2];
|
||||
x3 = p[3];
|
||||
#ifdef WAPI_LITTLE_ENDIAN
|
||||
x0 = Rotl(x0, 16); x0 = ((x0 & 0x00FF00FF) << 8) | ((x0 & 0xFF00FF00) >> 8);
|
||||
x1 = Rotl(x1, 16); x1 = ((x1 & 0x00FF00FF) << 8) | ((x1 & 0xFF00FF00) >> 8);
|
||||
x2 = Rotl(x2, 16); x2 = ((x2 & 0x00FF00FF) << 8) | ((x2 & 0xFF00FF00) >> 8);
|
||||
x3 = Rotl(x3, 16); x3 = ((x3 & 0x00FF00FF) << 8) | ((x3 & 0xFF00FF00) >> 8);
|
||||
#endif
|
||||
for (r = 0; r < 32; r += 4)
|
||||
{
|
||||
mid = x1 ^ x2 ^ x3 ^ rk[r + 0];
|
||||
mid = ByteSub(mid);
|
||||
x0 ^= L1(mid);
|
||||
mid = x2 ^ x3 ^ x0 ^ rk[r + 1];
|
||||
mid = ByteSub(mid);
|
||||
x1 ^= L1(mid);
|
||||
mid = x3 ^ x0 ^ x1 ^ rk[r + 2];
|
||||
mid = ByteSub(mid);
|
||||
x2 ^= L1(mid);
|
||||
mid = x0 ^ x1 ^ x2 ^ rk[r + 3];
|
||||
mid = ByteSub(mid);
|
||||
x3 ^= L1(mid);
|
||||
}
|
||||
#ifdef WAPI_LITTLE_ENDIAN
|
||||
x0 = Rotl(x0, 16); x0 = ((x0 & 0x00FF00FF) << 8) | ((x0 & 0xFF00FF00) >> 8);
|
||||
x1 = Rotl(x1, 16); x1 = ((x1 & 0x00FF00FF) << 8) | ((x1 & 0xFF00FF00) >> 8);
|
||||
x2 = Rotl(x2, 16); x2 = ((x2 & 0x00FF00FF) << 8) | ((x2 & 0xFF00FF00) >> 8);
|
||||
x3 = Rotl(x3, 16); x3 = ((x3 & 0x00FF00FF) << 8) | ((x3 & 0xFF00FF00) >> 8);
|
||||
#endif
|
||||
p = (u32 *)Output;
|
||||
p[0] = x3;
|
||||
p[1] = x2;
|
||||
p[2] = x1;
|
||||
p[3] = x0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void SMS4KeyExt(u8 *Key, u32 *rk, u32 CryptFlag)
|
||||
{
|
||||
u32 r, mid, x0, x1, x2, x3, *p;
|
||||
|
||||
p = (u32 *)Key;
|
||||
x0 = p[0];
|
||||
x1 = p[1];
|
||||
x2 = p[2];
|
||||
x3 = p[3];
|
||||
#ifdef WAPI_LITTLE_ENDIAN
|
||||
x0 = Rotl(x0, 16); x0 = ((x0 & 0xFF00FF) << 8) | ((x0 & 0xFF00FF00) >> 8);
|
||||
x1 = Rotl(x1, 16); x1 = ((x1 & 0xFF00FF) << 8) | ((x1 & 0xFF00FF00) >> 8);
|
||||
x2 = Rotl(x2, 16); x2 = ((x2 & 0xFF00FF) << 8) | ((x2 & 0xFF00FF00) >> 8);
|
||||
x3 = Rotl(x3, 16); x3 = ((x3 & 0xFF00FF) << 8) | ((x3 & 0xFF00FF00) >> 8);
|
||||
#endif
|
||||
|
||||
x0 ^= 0xa3b1bac6;
|
||||
x1 ^= 0x56aa3350;
|
||||
x2 ^= 0x677d9197;
|
||||
x3 ^= 0xb27022dc;
|
||||
for (r = 0; r < 32; r += 4)
|
||||
{
|
||||
mid = x1 ^ x2 ^ x3 ^ CK[r + 0];
|
||||
mid = ByteSub(mid);
|
||||
rk[r + 0] = x0 ^= L2(mid);
|
||||
mid = x2 ^ x3 ^ x0 ^ CK[r + 1];
|
||||
mid = ByteSub(mid);
|
||||
rk[r + 1] = x1 ^= L2(mid);
|
||||
mid = x3 ^ x0 ^ x1 ^ CK[r + 2];
|
||||
mid = ByteSub(mid);
|
||||
rk[r + 2] = x2 ^= L2(mid);
|
||||
mid = x0 ^ x1 ^ x2 ^ CK[r + 3];
|
||||
mid = ByteSub(mid);
|
||||
rk[r + 3] = x3 ^= L2(mid);
|
||||
}
|
||||
if (CryptFlag == DECRYPT)
|
||||
{
|
||||
for (r = 0; r < 16; r++)
|
||||
mid = rk[r], rk[r] = rk[31 - r], rk[31 - r] = mid;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void WapiSMS4Cryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
|
||||
u8 *Output, u16 *OutputLength, u32 CryptFlag)
|
||||
{
|
||||
u32 blockNum,i,j, rk[32];
|
||||
u16 remainder;
|
||||
u8 blockIn[16],blockOut[16], tempIV[16], k;
|
||||
|
||||
*OutputLength = 0;
|
||||
remainder = InputLength & 0x0F;
|
||||
blockNum = InputLength >> 4;
|
||||
if(remainder !=0)
|
||||
blockNum++;
|
||||
else
|
||||
remainder = 16;
|
||||
|
||||
for(k=0;k<16;k++)
|
||||
tempIV[k] = IV[15-k];
|
||||
|
||||
memcpy(blockIn, tempIV, 16);
|
||||
|
||||
SMS4KeyExt((u8 *)Key, rk,CryptFlag);
|
||||
|
||||
for(i=0; i<blockNum-1; i++)
|
||||
{
|
||||
SMS4Crypt((u8 *)blockIn, blockOut, rk);
|
||||
xor_block(&Output[i*16], &Input[i*16], blockOut);
|
||||
memcpy(blockIn,blockOut,16);
|
||||
}
|
||||
|
||||
*OutputLength = i*16;
|
||||
|
||||
SMS4Crypt((u8 *)blockIn, blockOut, rk);
|
||||
|
||||
for(j=0; j<remainder; j++)
|
||||
{
|
||||
Output[i*16+j] = Input[i*16+j] ^ blockOut[j];
|
||||
}
|
||||
*OutputLength += remainder;
|
||||
|
||||
}
|
||||
|
||||
void WapiSMS4Encryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
|
||||
u8 *Output, u16 *OutputLength)
|
||||
{
|
||||
|
||||
WapiSMS4Cryption(Key, IV, Input, InputLength, Output, OutputLength, ENCRYPT);
|
||||
}
|
||||
|
||||
void WapiSMS4Decryption(u8 *Key, u8 *IV, u8 *Input, u16 InputLength,
|
||||
u8 *Output, u16 *OutputLength)
|
||||
{
|
||||
// OFB mode: is also ENCRYPT flag
|
||||
WapiSMS4Cryption(Key, IV, Input, InputLength, Output, OutputLength, ENCRYPT);
|
||||
}
|
||||
|
||||
void WapiSMS4CalculateMic(u8 *Key, u8 *IV, u8 *Input1, u8 Input1Length,
|
||||
u8 *Input2, u16 Input2Length, u8 *Output, u8 *OutputLength)
|
||||
{
|
||||
u32 blockNum, i, remainder, rk[32];
|
||||
u8 BlockIn[16], BlockOut[16], TempBlock[16], tempIV[16], k;
|
||||
|
||||
*OutputLength = 0;
|
||||
remainder = Input1Length & 0x0F;
|
||||
blockNum = Input1Length >> 4;
|
||||
|
||||
for(k=0;k<16;k++)
|
||||
tempIV[k] = IV[15-k];
|
||||
|
||||
memcpy(BlockIn, tempIV, 16);
|
||||
|
||||
SMS4KeyExt((u8 *)Key, rk, ENCRYPT);
|
||||
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
|
||||
for(i=0; i<blockNum; i++){
|
||||
xor_block(BlockIn, (Input1+i*16), BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
if(remainder !=0){
|
||||
memset(TempBlock, 0, 16);
|
||||
memcpy(TempBlock, (Input1+blockNum*16), remainder);
|
||||
|
||||
xor_block(BlockIn, TempBlock, BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
remainder = Input2Length & 0x0F;
|
||||
blockNum = Input2Length >> 4;
|
||||
|
||||
for(i=0; i<blockNum; i++){
|
||||
xor_block(BlockIn, (Input2+i*16), BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
if(remainder !=0){
|
||||
memset(TempBlock, 0, 16);
|
||||
memcpy(TempBlock, (Input2+blockNum*16), remainder);
|
||||
|
||||
xor_block(BlockIn, TempBlock, BlockOut);
|
||||
SMS4Crypt((u8 *)BlockIn, BlockOut, rk);
|
||||
}
|
||||
|
||||
memcpy(Output, BlockOut, 16);
|
||||
*OutputLength = 16;
|
||||
}
|
||||
|
||||
void SecCalculateMicSMS4(
|
||||
u8 KeyIdx,
|
||||
u8 *MicKey,
|
||||
u8 *pHeader,
|
||||
u8 *pData,
|
||||
u16 DataLen,
|
||||
u8 *MicBuffer
|
||||
)
|
||||
{
|
||||
#if 0
|
||||
struct ieee80211_hdr_3addr_qos *header;
|
||||
u8 TempBuf[34], TempLen = 32, MicLen, QosOffset, *IV;
|
||||
u16 *pTemp, fc;
|
||||
|
||||
WAPI_TRACE(WAPI_TX|WAPI_RX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
header = (struct ieee80211_hdr_3addr_qos *)pHeader;
|
||||
memset(TempBuf, 0, 34);
|
||||
memcpy(TempBuf, pHeader, 2); //FrameCtrl
|
||||
pTemp = (u16*)TempBuf;
|
||||
*pTemp &= 0xc78f; //bit4,5,6,11,12,13
|
||||
|
||||
memcpy((TempBuf+2), (pHeader+4), 12); //Addr1, Addr2
|
||||
memcpy((TempBuf+14), (pHeader+22), 2); // SeqCtrl
|
||||
pTemp = (u16*)(TempBuf + 14);
|
||||
*pTemp &= 0x000f;
|
||||
|
||||
memcpy((TempBuf+16), (pHeader+16), 6); //Addr3
|
||||
|
||||
fc = le16_to_cpu(header->frame_ctl);
|
||||
|
||||
|
||||
|
||||
if (GetFrDs((u16*)&fc) && GetToDs((u16 *)&fc))
|
||||
{
|
||||
memcpy((TempBuf+22), (pHeader+24), 6);
|
||||
QosOffset = 30;
|
||||
}else{
|
||||
memset((TempBuf+22), 0, 6);
|
||||
QosOffset = 24;
|
||||
}
|
||||
|
||||
if((fc & 0x0088) == 0x0088){
|
||||
memcpy((TempBuf+28), (pHeader+QosOffset), 2);
|
||||
TempLen += 2;
|
||||
//IV = pHeader + QosOffset + 2 + SNAP_SIZE + sizeof(u16) + 2;
|
||||
IV = pHeader + QosOffset + 2 + 2;
|
||||
}else{
|
||||
IV = pHeader + QosOffset + 2;
|
||||
//IV = pHeader + QosOffset + SNAP_SIZE + sizeof(u16) + 2;
|
||||
}
|
||||
|
||||
TempBuf[TempLen-1] = (u8)(DataLen & 0xff);
|
||||
TempBuf[TempLen-2] = (u8)((DataLen & 0xff00)>>8);
|
||||
TempBuf[TempLen-4] = KeyIdx;
|
||||
|
||||
WAPI_DATA(WAPI_TX, "CalculateMic - KEY", MicKey, 16);
|
||||
WAPI_DATA(WAPI_TX, "CalculateMic - IV", IV, 16);
|
||||
WAPI_DATA(WAPI_TX, "CalculateMic - TempBuf", TempBuf, TempLen);
|
||||
WAPI_DATA(WAPI_TX, "CalculateMic - pData", pData, DataLen);
|
||||
|
||||
WapiSMS4CalculateMic(MicKey, IV, TempBuf, TempLen,
|
||||
pData, DataLen, MicBuffer, &MicLen);
|
||||
|
||||
if (MicLen != 16)
|
||||
WAPI_TRACE(WAPI_ERR,"%s: MIC Length Error!!\n",__FUNCTION__);
|
||||
|
||||
WAPI_TRACE(WAPI_TX|WAPI_RX, "<=========%s\n", __FUNCTION__);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* AddCount: 1 or 2.
|
||||
* If overflow, return 1,
|
||||
* else return 0.
|
||||
*/
|
||||
u8 WapiIncreasePN(u8 *PN, u8 AddCount)
|
||||
{
|
||||
u8 i;
|
||||
|
||||
if (NULL == PN)
|
||||
return 1;
|
||||
//YJ,test,091102
|
||||
/*
|
||||
if(AddCount == 2){
|
||||
DBG_8192C("############################%s(): PN[0]=0x%x\n", __FUNCTION__, PN[0]);
|
||||
if(PN[0] == 0x48){
|
||||
PN[0] += AddCount;
|
||||
return 1;
|
||||
}else{
|
||||
PN[0] += AddCount;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
//YJ,test,091102,end
|
||||
|
||||
for (i=0; i<16; i++)
|
||||
{
|
||||
if (PN[i] + AddCount <= 0xff)
|
||||
{
|
||||
PN[i] += AddCount;
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
PN[i] += AddCount;
|
||||
AddCount = 1;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void WapiGetLastRxUnicastPNForQoSData(
|
||||
u8 UserPriority,
|
||||
PRT_WAPI_STA_INFO pWapiStaInfo,
|
||||
u8 *PNOut
|
||||
)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__);
|
||||
switch(UserPriority)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
memcpy(PNOut,pWapiStaInfo->lastRxUnicastPNBEQueue,16);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
memcpy(PNOut,pWapiStaInfo->lastRxUnicastPNBKQueue,16);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
memcpy(PNOut,pWapiStaInfo->lastRxUnicastPNVIQueue,16);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
memcpy(PNOut,pWapiStaInfo->lastRxUnicastPNVOQueue,16);
|
||||
break;
|
||||
default:
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Unknown TID \n", __FUNCTION__);
|
||||
break;
|
||||
}
|
||||
WAPI_TRACE(WAPI_RX, "<=========== %s\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
|
||||
void WapiSetLastRxUnicastPNForQoSData(
|
||||
u8 UserPriority,
|
||||
u8 *PNIn,
|
||||
PRT_WAPI_STA_INFO pWapiStaInfo
|
||||
)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "===========> %s\n", __FUNCTION__);
|
||||
switch(UserPriority)
|
||||
{
|
||||
case 0:
|
||||
case 3:
|
||||
memcpy(pWapiStaInfo->lastRxUnicastPNBEQueue,PNIn,16);
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
memcpy(pWapiStaInfo->lastRxUnicastPNBKQueue,PNIn,16);
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
memcpy(pWapiStaInfo->lastRxUnicastPNVIQueue,PNIn,16);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
memcpy(pWapiStaInfo->lastRxUnicastPNVOQueue,PNIn,16);
|
||||
break;
|
||||
default:
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Unknown TID \n", __FUNCTION__);
|
||||
break;
|
||||
}
|
||||
WAPI_TRACE(WAPI_RX, "<=========== %s\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
FALSE not RX-Reorder
|
||||
TRUE do RX Reorder
|
||||
add to support WAPI to N-mode
|
||||
*****************************************************************************/
|
||||
u8 WapiCheckPnInSwDecrypt(
|
||||
_adapter *padapter,
|
||||
struct sk_buff *pskb
|
||||
)
|
||||
{
|
||||
u8 ret = false;
|
||||
|
||||
#if 0
|
||||
struct ieee80211_hdr_3addr_qos *header;
|
||||
u16 fc;
|
||||
u8 *pDaddr, *pTaddr, *pRaddr;
|
||||
|
||||
header = (struct ieee80211_hdr_3addr_qos *)pskb->data;
|
||||
pTaddr = header->addr2;
|
||||
pRaddr = header->addr1;
|
||||
fc = le16_to_cpu(header->frame_ctl);
|
||||
|
||||
if(GetToDs(&fc))
|
||||
pDaddr = header->addr3;
|
||||
else
|
||||
pDaddr = header->addr1;
|
||||
|
||||
if ((_rtw_memcmp(pRaddr, padapter->pnetdev->dev_addr, ETH_ALEN) == 0)
|
||||
&& ! (pDaddr)
|
||||
&& (GetFrameType(&fc) == WIFI_QOS_DATA_TYPE))
|
||||
//&& ieee->pHTInfo->bCurrentHTSupport &&
|
||||
//ieee->pHTInfo->bCurRxReorderEnable)
|
||||
ret = false;
|
||||
else
|
||||
ret = true;
|
||||
#endif
|
||||
WAPI_TRACE(WAPI_RX, "%s: return %d\n", __FUNCTION__, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int SecSMS4HeaderFillIV(_adapter *padapter, u8 *pxmitframe)
|
||||
{
|
||||
struct pkt_attrib *pattrib = &((struct xmit_frame*)pxmitframe)->attrib;
|
||||
u8 * frame = ((struct xmit_frame *)pxmitframe)->buf_addr + TXDESC_OFFSET;
|
||||
u8 *pSecHeader = NULL, *pos = NULL, *pRA = NULL;
|
||||
u8 bPNOverflow = false, bFindMatchPeer = false, hdr_len = 0;
|
||||
PWLAN_HEADER_WAPI_EXTENSION pWapiExt = NULL;
|
||||
PRT_WAPI_T pWapiInfo = &padapter->wapiInfo;
|
||||
PRT_WAPI_STA_INFO pWapiSta = NULL;
|
||||
int ret = 0;
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
return ret;
|
||||
#if 0
|
||||
hdr_len = sMacHdrLng;
|
||||
if (GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE)
|
||||
{
|
||||
hdr_len += 2;
|
||||
}
|
||||
//hdr_len += SNAP_SIZE + sizeof(u16);
|
||||
|
||||
pos = skb_push(pskb, padapter->wapiInfo.extra_prefix_len);
|
||||
memmove(pos, pos+padapter->wapiInfo.extra_prefix_len, hdr_len);
|
||||
|
||||
pSecHeader = pskb->data + hdr_len;
|
||||
pWapiExt = (PWLAN_HEADER_WAPI_EXTENSION)pSecHeader;
|
||||
pRA = pskb->data + 4;
|
||||
|
||||
WAPI_DATA(WAPI_TX, "FillIV - Before Fill IV", pskb->data, pskb->len);
|
||||
|
||||
//Address 1 is always receiver's address
|
||||
if( IS_MCAST(pRA) ){
|
||||
if(!pWapiInfo->wapiTxMsk.bTxEnable){
|
||||
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
|
||||
return -2;
|
||||
}
|
||||
if(pWapiInfo->wapiTxMsk.keyId <= 1){
|
||||
pWapiExt->KeyIdx = pWapiInfo->wapiTxMsk.keyId;
|
||||
pWapiExt->Reserved = 0;
|
||||
bPNOverflow = WapiIncreasePN(pWapiInfo->lastTxMulticastPN, 1);
|
||||
memcpy(pWapiExt->PN, pWapiInfo->lastTxMulticastPN, 16);
|
||||
if (bPNOverflow){
|
||||
// Update MSK Notification.
|
||||
WAPI_TRACE(WAPI_ERR,"===============>%s():multicast PN overflow\n",__FUNCTION__);
|
||||
rtw_wapi_app_event_handler(padapter,NULL,0,pRA, false, false, true, 0, false);
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: Invalid Wapi Multicast KeyIdx!!\n",__FUNCTION__);
|
||||
ret = -3;
|
||||
}
|
||||
}
|
||||
else{
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if(!memcmp(pWapiSta->PeerMacAddr,pRA,6)){
|
||||
bFindMatchPeer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (bFindMatchPeer){
|
||||
if((!pWapiSta->wapiUskUpdate.bTxEnable) && (!pWapiSta->wapiUsk.bTxEnable)){
|
||||
WAPI_TRACE(WAPI_ERR,"%s: bTxEnable = 0!!\n",__FUNCTION__);
|
||||
return -4;
|
||||
}
|
||||
if (pWapiSta->wapiUsk.keyId <= 1){
|
||||
if(pWapiSta->wapiUskUpdate.bTxEnable)
|
||||
pWapiExt->KeyIdx = pWapiSta->wapiUskUpdate.keyId;
|
||||
else
|
||||
pWapiExt->KeyIdx = pWapiSta->wapiUsk.keyId;
|
||||
|
||||
pWapiExt->Reserved = 0;
|
||||
bPNOverflow = WapiIncreasePN(pWapiSta->lastTxUnicastPN, 2);
|
||||
memcpy(pWapiExt->PN, pWapiSta->lastTxUnicastPN, 16);
|
||||
if (bPNOverflow){
|
||||
// Update USK Notification.
|
||||
WAPI_TRACE(WAPI_ERR,"===============>%s():unicast PN overflow\n",__FUNCTION__);
|
||||
rtw_wapi_app_event_handler(padapter,NULL,0,pWapiSta->PeerMacAddr, false, true, false, 0, false);
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: Invalid Wapi Unicast KeyIdx!!\n",__FUNCTION__);
|
||||
ret = -5;
|
||||
}
|
||||
}
|
||||
else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: Can not find Peer Sta "MAC_FMT"!!\n",__FUNCTION__, MAC_ARG(pRA));
|
||||
ret = -6;
|
||||
}
|
||||
}
|
||||
|
||||
WAPI_DATA(WAPI_TX, "FillIV - After Fill IV", pskb->data, pskb->len);
|
||||
WAPI_TRACE(WAPI_TX, "<=========%s\n", __FUNCTION__);
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
// WAPI SW Enc: must have done Coalesce!
|
||||
void SecSWSMS4Encryption(
|
||||
_adapter *padapter,
|
||||
u8 * pxmitframe
|
||||
)
|
||||
{
|
||||
PRT_WAPI_T pWapiInfo = &padapter->wapiInfo;
|
||||
PRT_WAPI_STA_INFO pWapiSta = NULL;
|
||||
u8 *pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + TXDESC_SIZE;
|
||||
struct pkt_attrib *pattrib = &((struct xmit_frame*)pxmitframe)->attrib;
|
||||
|
||||
u8 *SecPtr = NULL, *pRA, *pMicKey = NULL, *pDataKey = NULL, *pIV = NULL;
|
||||
u8 IVOffset, DataOffset, bFindMatchPeer = false, KeyIdx = 0, MicBuffer[16];
|
||||
u16 OutputLength;
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
WAPI_TRACE(WAPI_TX,"hdrlen: %d \n",pattrib->hdrlen);
|
||||
|
||||
return;
|
||||
|
||||
DataOffset = pattrib->hdrlen + pattrib->iv_len;
|
||||
|
||||
pRA = pframe + 4;
|
||||
|
||||
|
||||
if( IS_MCAST(pRA) ){
|
||||
KeyIdx = pWapiInfo->wapiTxMsk.keyId;
|
||||
pIV = pWapiInfo->lastTxMulticastPN;
|
||||
pMicKey = pWapiInfo->wapiTxMsk.micKey;
|
||||
pDataKey = pWapiInfo->wapiTxMsk.dataKey;
|
||||
}else{
|
||||
if (!list_empty(&(pWapiInfo->wapiSTAUsedList))){
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if (0 == memcmp(pWapiSta->PeerMacAddr, pRA, 6)){
|
||||
bFindMatchPeer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (bFindMatchPeer){
|
||||
if (pWapiSta->wapiUskUpdate.bTxEnable){
|
||||
KeyIdx = pWapiSta->wapiUskUpdate.keyId;
|
||||
WAPI_TRACE(WAPI_TX, "%s(): Use update USK!! KeyIdx=%d\n", __FUNCTION__, KeyIdx);
|
||||
pIV = pWapiSta->lastTxUnicastPN;
|
||||
pMicKey = pWapiSta->wapiUskUpdate.micKey;
|
||||
pDataKey = pWapiSta->wapiUskUpdate.dataKey;
|
||||
}else{
|
||||
KeyIdx = pWapiSta->wapiUsk.keyId;
|
||||
WAPI_TRACE(WAPI_TX, "%s(): Use USK!! KeyIdx=%d\n", __FUNCTION__, KeyIdx);
|
||||
pIV = pWapiSta->lastTxUnicastPN;
|
||||
pMicKey = pWapiSta->wapiUsk.micKey;
|
||||
pDataKey = pWapiSta->wapiUsk.dataKey;
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: Can not find Peer Sta!!\n",__FUNCTION__);
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR,"%s: wapiSTAUsedList is empty!!\n",__FUNCTION__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
SecPtr = pframe;
|
||||
SecCalculateMicSMS4(KeyIdx, pMicKey, SecPtr, (SecPtr+DataOffset), pattrib->pktlen, MicBuffer);
|
||||
|
||||
WAPI_DATA(WAPI_TX, "Encryption - MIC", MicBuffer, padapter->wapiInfo.extra_postfix_len);
|
||||
|
||||
memcpy(pframe+pattrib->hdrlen+pattrib->iv_len+pattrib->pktlen-pattrib->icv_len,
|
||||
(u8 *)MicBuffer,
|
||||
padapter->wapiInfo.extra_postfix_len
|
||||
);
|
||||
|
||||
|
||||
WapiSMS4Encryption(pDataKey, pIV, (SecPtr+DataOffset),pattrib->pktlen+pattrib->icv_len, (SecPtr+DataOffset), &OutputLength);
|
||||
|
||||
WAPI_DATA(WAPI_TX, "Encryption - After SMS4 encryption",pframe,pattrib->hdrlen+pattrib->iv_len+pattrib->pktlen);
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "<=========%s\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
u8 SecSWSMS4Decryption(
|
||||
_adapter *padapter,
|
||||
u8 *precv_frame,
|
||||
struct recv_priv *precv_priv
|
||||
)
|
||||
{
|
||||
PRT_WAPI_T pWapiInfo = &padapter->wapiInfo;
|
||||
struct recv_frame_hdr *precv_hdr;
|
||||
PRT_WAPI_STA_INFO pWapiSta = NULL;
|
||||
u8 IVOffset, DataOffset, bFindMatchPeer = false, bUseUpdatedKey = false;
|
||||
u8 KeyIdx, MicBuffer[16], lastRxPNforQoS[16];
|
||||
u8 *pRA, *pTA, *pMicKey, *pDataKey, *pLastRxPN, *pRecvPN, *pSecData, *pRecvMic, *pos;
|
||||
u8 TID = 0;
|
||||
u16 OutputLength, DataLen;
|
||||
u8 bQosData;
|
||||
struct sk_buff * pskb;
|
||||
|
||||
WAPI_TRACE(WAPI_RX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
return 0;
|
||||
|
||||
precv_hdr = &((union recv_frame*)precv_frame)->u.hdr;
|
||||
pskb = (struct sk_buff *)(precv_hdr->rx_data);
|
||||
precv_hdr->bWapiCheckPNInDecrypt = WapiCheckPnInSwDecrypt(padapter, pskb);
|
||||
WAPI_TRACE(WAPI_RX, "=========>%s: check PN %d\n", __FUNCTION__,precv_hdr->bWapiCheckPNInDecrypt);
|
||||
WAPI_DATA(WAPI_RX, "Decryption - Before decryption", pskb->data, pskb->len);
|
||||
|
||||
IVOffset = sMacHdrLng;
|
||||
bQosData = GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE;
|
||||
if (bQosData){
|
||||
IVOffset += 2;
|
||||
}
|
||||
|
||||
//if(GetHTC())
|
||||
// IVOffset += 4;
|
||||
|
||||
//IVOffset += SNAP_SIZE + sizeof(u16);
|
||||
|
||||
DataOffset = IVOffset + padapter->wapiInfo.extra_prefix_len;
|
||||
|
||||
pRA = pskb->data + 4;
|
||||
pTA = pskb->data + 10;
|
||||
KeyIdx = *(pskb->data + IVOffset);
|
||||
pRecvPN = pskb->data + IVOffset + 2;
|
||||
pSecData = pskb->data + DataOffset;
|
||||
DataLen = pskb->len - DataOffset;
|
||||
pRecvMic = pskb->data + pskb->len - padapter->wapiInfo.extra_postfix_len;
|
||||
TID = GetTid(pskb->data);
|
||||
|
||||
if (!list_empty(&(pWapiInfo->wapiSTAUsedList))){
|
||||
list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) {
|
||||
if (0 == memcmp(pWapiSta->PeerMacAddr, pTA, 6)){
|
||||
bFindMatchPeer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!bFindMatchPeer){
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Can not find Peer Sta "MAC_FMT" for Key Info!!!\n", __FUNCTION__, MAC_ARG(pTA));
|
||||
return false;
|
||||
}
|
||||
|
||||
if( IS_MCAST(pRA) ){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Multicast decryption !!!\n", __FUNCTION__);
|
||||
if (pWapiSta->wapiMsk.keyId == KeyIdx && pWapiSta->wapiMsk.bSet){
|
||||
pLastRxPN = pWapiSta->lastRxMulticastPN;
|
||||
if (!WapiComparePN(pRecvPN, pLastRxPN)){
|
||||
WAPI_TRACE(WAPI_ERR, "%s: MSK PN is not larger than last, Dropped!!!\n", __FUNCTION__);
|
||||
WAPI_DATA(WAPI_ERR, "pRecvPN:", pRecvPN, 16);
|
||||
WAPI_DATA(WAPI_ERR, "pLastRxPN:", pLastRxPN, 16);
|
||||
return false;
|
||||
}
|
||||
|
||||
memcpy(pLastRxPN, pRecvPN, 16);
|
||||
pMicKey = pWapiSta->wapiMsk.micKey;
|
||||
pDataKey = pWapiSta->wapiMsk.dataKey;
|
||||
}else if (pWapiSta->wapiMskUpdate.keyId == KeyIdx && pWapiSta->wapiMskUpdate.bSet){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Use Updated MSK for Decryption !!!\n", __FUNCTION__);
|
||||
bUseUpdatedKey = true;
|
||||
memcpy(pWapiSta->lastRxMulticastPN, pRecvPN, 16);
|
||||
pMicKey = pWapiSta->wapiMskUpdate.micKey;
|
||||
pDataKey = pWapiSta->wapiMskUpdate.dataKey;
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Can not find MSK with matched KeyIdx(%d), Dropped !!!\n", __FUNCTION__,KeyIdx);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else{
|
||||
WAPI_TRACE(WAPI_RX, "%s: Unicast decryption !!!\n", __FUNCTION__);
|
||||
if (pWapiSta->wapiUsk.keyId == KeyIdx && pWapiSta->wapiUsk.bSet){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Use USK for Decryption!!!\n", __FUNCTION__);
|
||||
if(precv_hdr->bWapiCheckPNInDecrypt){
|
||||
if(GetFrameType(pskb->data) == WIFI_QOS_DATA_TYPE){
|
||||
WapiGetLastRxUnicastPNForQoSData(TID, pWapiSta, lastRxPNforQoS);
|
||||
pLastRxPN = lastRxPNforQoS;
|
||||
}else{
|
||||
pLastRxPN = pWapiSta->lastRxUnicastPN;
|
||||
}
|
||||
if (!WapiComparePN(pRecvPN, pLastRxPN)){
|
||||
return false;
|
||||
}
|
||||
if(bQosData){
|
||||
WapiSetLastRxUnicastPNForQoSData(TID, pRecvPN, pWapiSta);
|
||||
}else{
|
||||
memcpy(pWapiSta->lastRxUnicastPN, pRecvPN, 16);
|
||||
}
|
||||
}else{
|
||||
memcpy(precv_hdr->WapiTempPN,pRecvPN,16);
|
||||
}
|
||||
|
||||
if (check_fwstate(&padapter->mlmepriv, WIFI_STATION_STATE))
|
||||
{
|
||||
if ((pRecvPN[0] & 0x1) == 0){
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Rx USK PN is not odd when Infra STA mode, Dropped !!!\n", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
pMicKey = pWapiSta->wapiUsk.micKey;
|
||||
pDataKey = pWapiSta->wapiUsk.dataKey;
|
||||
}
|
||||
else if (pWapiSta->wapiUskUpdate.keyId == KeyIdx && pWapiSta->wapiUskUpdate.bSet ){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Use Updated USK for Decryption!!!\n", __FUNCTION__);
|
||||
if(pWapiSta->bAuthenticatorInUpdata)
|
||||
bUseUpdatedKey = true;
|
||||
else
|
||||
bUseUpdatedKey = false;
|
||||
|
||||
if(bQosData){
|
||||
WapiSetLastRxUnicastPNForQoSData(TID, pRecvPN, pWapiSta);
|
||||
}else{
|
||||
memcpy(pWapiSta->lastRxUnicastPN, pRecvPN, 16);
|
||||
}
|
||||
pMicKey = pWapiSta->wapiUskUpdate.micKey;
|
||||
pDataKey = pWapiSta->wapiUskUpdate.dataKey;
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR, "%s: No valid USK!!!KeyIdx=%d pWapiSta->wapiUsk.keyId=%d pWapiSta->wapiUskUpdate.keyId=%d\n", __FUNCTION__, KeyIdx, pWapiSta->wapiUsk.keyId, pWapiSta->wapiUskUpdate.keyId);
|
||||
//dump_buf(pskb->data,pskb->len);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
WAPI_DATA(WAPI_RX, "Decryption - DataKey", pDataKey, 16);
|
||||
WAPI_DATA(WAPI_RX, "Decryption - IV", pRecvPN, 16);
|
||||
WapiSMS4Decryption(pDataKey, pRecvPN, pSecData, DataLen, pSecData, &OutputLength);
|
||||
|
||||
if (OutputLength != DataLen)
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Output Length Error!!!!\n", __FUNCTION__);
|
||||
|
||||
WAPI_DATA(WAPI_RX, "Decryption - After decryption", pskb->data, pskb->len);
|
||||
|
||||
DataLen -= padapter->wapiInfo.extra_postfix_len;
|
||||
|
||||
SecCalculateMicSMS4(KeyIdx, pMicKey, pskb->data, pSecData, DataLen, MicBuffer);
|
||||
|
||||
WAPI_DATA(WAPI_RX, "Decryption - MIC received", pRecvMic, SMS4_MIC_LEN);
|
||||
WAPI_DATA(WAPI_RX, "Decryption - MIC calculated", MicBuffer, SMS4_MIC_LEN);
|
||||
|
||||
if (0 == memcmp(MicBuffer, pRecvMic, padapter->wapiInfo.extra_postfix_len)){
|
||||
WAPI_TRACE(WAPI_RX, "%s: Check MIC OK!!\n", __FUNCTION__);
|
||||
if (bUseUpdatedKey){
|
||||
// delete the old key
|
||||
if ( IS_MCAST(pRA) ){
|
||||
WAPI_TRACE(WAPI_API, "%s(): AE use new update MSK!!\n", __FUNCTION__);
|
||||
pWapiSta->wapiMsk.keyId = pWapiSta->wapiMskUpdate.keyId;
|
||||
memcpy(pWapiSta->wapiMsk.dataKey, pWapiSta->wapiMskUpdate.dataKey, 16);
|
||||
memcpy(pWapiSta->wapiMsk.micKey, pWapiSta->wapiMskUpdate.micKey, 16);
|
||||
pWapiSta->wapiMskUpdate.bTxEnable = pWapiSta->wapiMskUpdate.bSet = false;
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_API, "%s(): AE use new update USK!!\n", __FUNCTION__);
|
||||
pWapiSta->wapiUsk.keyId = pWapiSta->wapiUskUpdate.keyId;
|
||||
memcpy(pWapiSta->wapiUsk.dataKey, pWapiSta->wapiUskUpdate.dataKey, 16);
|
||||
memcpy(pWapiSta->wapiUsk.micKey, pWapiSta->wapiUskUpdate.micKey, 16);
|
||||
pWapiSta->wapiUskUpdate.bTxEnable = pWapiSta->wapiUskUpdate.bSet = false;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
WAPI_TRACE(WAPI_ERR, "%s: Check MIC Error, Dropped !!!!\n", __FUNCTION__);
|
||||
return false;
|
||||
}
|
||||
|
||||
pos = pskb->data;
|
||||
memmove(pos+padapter->wapiInfo.extra_prefix_len, pos, IVOffset);
|
||||
skb_pull(pskb, padapter->wapiInfo.extra_prefix_len);
|
||||
|
||||
WAPI_TRACE(WAPI_RX, "<=========%s\n", __FUNCTION__);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
u32 rtw_sms4_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
{
|
||||
|
||||
u8 *pframe;
|
||||
u32 res = _SUCCESS;
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
if ((!padapter->WapiSupport) || (!padapter->wapiInfo.bWapiEnable))
|
||||
{
|
||||
WAPI_TRACE(WAPI_TX, "<========== %s, WAPI not supported or enabled!\n", __FUNCTION__);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
if(((struct xmit_frame*)pxmitframe)->buf_addr==NULL)
|
||||
return _FAIL;
|
||||
|
||||
pframe = ((struct xmit_frame*)pxmitframe)->buf_addr + TXDESC_OFFSET;
|
||||
|
||||
SecSWSMS4Encryption(padapter, pxmitframe);
|
||||
|
||||
WAPI_TRACE(WAPI_TX, "<=========%s\n", __FUNCTION__);
|
||||
return res;
|
||||
}
|
||||
|
||||
u32 rtw_sms4_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
{
|
||||
u8 *pframe;
|
||||
u32 res = _SUCCESS;
|
||||
|
||||
WAPI_TRACE(WAPI_RX, "=========>%s\n", __FUNCTION__);
|
||||
|
||||
if ((!padapter->WapiSupport) || (!padapter->wapiInfo.bWapiEnable))
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "<========== %s, WAPI not supported or enabled!\n", __FUNCTION__);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
|
||||
//drop packet when hw decrypt fail
|
||||
//return tempraily
|
||||
return _FAIL;
|
||||
|
||||
//pframe=(unsigned char *)((union recv_frame*)precvframe)->u.hdr.rx_data;
|
||||
|
||||
if (false == SecSWSMS4Decryption(padapter, precvframe, &padapter->recvpriv))
|
||||
{
|
||||
WAPI_TRACE(WAPI_ERR, "%s():SMS4 decrypt frame error\n",__FUNCTION__);
|
||||
return _FAIL;
|
||||
}
|
||||
|
||||
WAPI_TRACE(WAPI_RX, "<=========%s\n", __FUNCTION__);
|
||||
return res;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
u32 rtw_sms4_encrypt(_adapter *padapter, u8 *pxmitframe)
|
||||
{
|
||||
WAPI_TRACE(WAPI_TX, "=========>Dummy %s\n", __FUNCTION__);
|
||||
WAPI_TRACE(WAPI_TX, "<=========Dummy %s\n", __FUNCTION__);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
u32 rtw_sms4_decrypt(_adapter *padapter, u8 *precvframe)
|
||||
{
|
||||
WAPI_TRACE(WAPI_RX, "=========>Dummy %s\n", __FUNCTION__);
|
||||
WAPI_TRACE(WAPI_RX, "<=========Dummy %s\n", __FUNCTION__);
|
||||
return _SUCCESS;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,183 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
/*++
|
||||
Copyright (c) Realtek Semiconductor Corp. All rights reserved.
|
||||
|
||||
Module Name:
|
||||
HalPwrSeqCmd.c
|
||||
|
||||
Abstract:
|
||||
Implement HW Power sequence configuration CMD handling routine for Realtek devices.
|
||||
|
||||
Major Change History:
|
||||
When Who What
|
||||
---------- --------------- -------------------------------
|
||||
2011-10-26 Lucas Modify to be compatible with SD4-CE driver.
|
||||
2011-07-07 Roger Create.
|
||||
|
||||
--*/
|
||||
#include <HalPwrSeqCmd.h>
|
||||
|
||||
|
||||
//
|
||||
// Description:
|
||||
// This routine deal with the Power Configuration CMDs parsing for RTL8723/RTL8188E Series IC.
|
||||
//
|
||||
// Assumption:
|
||||
// We should follow specific format which was released from HW SD.
|
||||
//
|
||||
// 2011.07.07, added by Roger.
|
||||
//
|
||||
u8 HalPwrSeqCmdParsing(
|
||||
PADAPTER padapter,
|
||||
u8 CutVersion,
|
||||
u8 FabVersion,
|
||||
u8 InterfaceType,
|
||||
WLAN_PWR_CFG PwrSeqCmd[])
|
||||
{
|
||||
WLAN_PWR_CFG PwrCfgCmd = {0};
|
||||
u8 bPollingBit = _FALSE;
|
||||
u32 AryIdx = 0;
|
||||
u8 value = 0;
|
||||
u32 offset = 0;
|
||||
u32 pollingCount = 0; // polling autoload done.
|
||||
u32 maxPollingCnt = 5000;
|
||||
|
||||
do {
|
||||
PwrCfgCmd = PwrSeqCmd[AryIdx];
|
||||
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_,
|
||||
("HalPwrSeqCmdParsing: offset(%#x) cut_msk(%#x) fab_msk(%#x) interface_msk(%#x) base(%#x) cmd(%#x) msk(%#x) value(%#x)\n",
|
||||
GET_PWR_CFG_OFFSET(PwrCfgCmd),
|
||||
GET_PWR_CFG_CUT_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_FAB_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_INTF_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_BASE(PwrCfgCmd),
|
||||
GET_PWR_CFG_CMD(PwrCfgCmd),
|
||||
GET_PWR_CFG_MASK(PwrCfgCmd),
|
||||
GET_PWR_CFG_VALUE(PwrCfgCmd)));
|
||||
|
||||
//2 Only Handle the command whose FAB, CUT, and Interface are matched
|
||||
if ((GET_PWR_CFG_FAB_MASK(PwrCfgCmd) & FabVersion) &&
|
||||
(GET_PWR_CFG_CUT_MASK(PwrCfgCmd) & CutVersion) &&
|
||||
(GET_PWR_CFG_INTF_MASK(PwrCfgCmd) & InterfaceType))
|
||||
{
|
||||
switch (GET_PWR_CFG_CMD(PwrCfgCmd))
|
||||
{
|
||||
case PWR_CMD_READ:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_READ\n"));
|
||||
break;
|
||||
|
||||
case PWR_CMD_WRITE:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_WRITE\n"));
|
||||
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
|
||||
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
//
|
||||
// <Roger_Notes> We should deal with interface specific address mapping for some interfaces, e.g., SDIO interface
|
||||
// 2011.07.07.
|
||||
//
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
{
|
||||
// Read Back SDIO Local value
|
||||
value = SdioLocalCmd52Read1Byte(padapter, offset);
|
||||
|
||||
value &= ~(GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
value |= (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
|
||||
// Write Back SDIO Local value
|
||||
SdioLocalCmd52Write1Byte(padapter, offset, value);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
offset = SPI_LOCAL_OFFSET | offset;
|
||||
#endif
|
||||
// Read the value from system register
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value=value&(~(GET_PWR_CFG_MASK(PwrCfgCmd)));
|
||||
value=value|(GET_PWR_CFG_VALUE(PwrCfgCmd)&GET_PWR_CFG_MASK(PwrCfgCmd));
|
||||
|
||||
// Write the value back to sytem register
|
||||
rtw_write8(padapter, offset, value);
|
||||
}
|
||||
break;
|
||||
|
||||
case PWR_CMD_POLLING:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_POLLING\n"));
|
||||
|
||||
bPollingBit = _FALSE;
|
||||
offset = GET_PWR_CFG_OFFSET(PwrCfgCmd);
|
||||
#ifdef CONFIG_GSPI_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
offset = SPI_LOCAL_OFFSET | offset;
|
||||
#endif
|
||||
do {
|
||||
#ifdef CONFIG_SDIO_HCI
|
||||
if (GET_PWR_CFG_BASE(PwrCfgCmd) == PWR_BASEADDR_SDIO)
|
||||
value = SdioLocalCmd52Read1Byte(padapter, offset);
|
||||
else
|
||||
#endif
|
||||
value = rtw_read8(padapter, offset);
|
||||
|
||||
value=value&GET_PWR_CFG_MASK(PwrCfgCmd);
|
||||
if (value == (GET_PWR_CFG_VALUE(PwrCfgCmd) & GET_PWR_CFG_MASK(PwrCfgCmd)))
|
||||
bPollingBit = _TRUE;
|
||||
else
|
||||
rtw_udelay_os(10);
|
||||
|
||||
if (pollingCount++ > maxPollingCnt) {
|
||||
DBG_871X("Fail to polling Offset[%#x]=%02x\n", offset, value);
|
||||
return _FALSE;
|
||||
}
|
||||
} while (!bPollingBit);
|
||||
|
||||
break;
|
||||
|
||||
case PWR_CMD_DELAY:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_DELAY\n"));
|
||||
if (GET_PWR_CFG_VALUE(PwrCfgCmd) == PWRSEQ_DELAY_US)
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd));
|
||||
else
|
||||
rtw_udelay_os(GET_PWR_CFG_OFFSET(PwrCfgCmd)*1000);
|
||||
break;
|
||||
|
||||
case PWR_CMD_END:
|
||||
// When this command is parsed, end the process
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_info_, ("HalPwrSeqCmdParsing: PWR_CMD_END\n"));
|
||||
return _TRUE;
|
||||
break;
|
||||
|
||||
default:
|
||||
RT_TRACE(_module_hal_init_c_ , _drv_err_, ("HalPwrSeqCmdParsing: Unknown CMD!!\n"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
AryIdx++;//Add Array Index
|
||||
}while(1);
|
||||
|
||||
return _TRUE;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,145 @@
|
|||
//===========================================
|
||||
// The following is for 8188C 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8188C_2ANT 6
|
||||
|
||||
typedef enum _BT_INFO_SRC_8188C_2ANT{
|
||||
BT_INFO_SRC_8188C_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8188C_2ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8188C_2ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8188C_2ANT_MAX
|
||||
}BT_INFO_SRC_8188C_2ANT,*PBT_INFO_SRC_8188C_2ANT;
|
||||
|
||||
typedef enum _BT_8188C_2ANT_BT_STATUS{
|
||||
BT_8188C_2ANT_BT_STATUS_IDLE = 0x0,
|
||||
BT_8188C_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8188C_2ANT_BT_STATUS_NON_IDLE = 0x2,
|
||||
BT_8188C_2ANT_BT_STATUS_MAX
|
||||
}BT_8188C_2ANT_BT_STATUS,*PBT_8188C_2ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8188C_2ANT_COEX_ALGO{
|
||||
BT_8188C_2ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8188C_2ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8188C_2ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8188C_2ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8188C_2ANT_COEX_ALGO_PAN = 0x4,
|
||||
BT_8188C_2ANT_COEX_ALGO_HID_A2DP = 0x5,
|
||||
BT_8188C_2ANT_COEX_ALGO_HID_PAN = 0x6,
|
||||
BT_8188C_2ANT_COEX_ALGO_PAN_A2DP = 0x7,
|
||||
BT_8188C_2ANT_COEX_ALGO_MAX
|
||||
}BT_8188C_2ANT_COEX_ALGO,*PBT_8188C_2ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8188C_2ANT{
|
||||
// fw mechanism
|
||||
BOOLEAN bPreBalanceOn;
|
||||
BOOLEAN bCurBalanceOn;
|
||||
|
||||
// diminishWifi
|
||||
BOOLEAN bPreDacOn;
|
||||
BOOLEAN bCurDacOn;
|
||||
BOOLEAN bPreInterruptOn;
|
||||
BOOLEAN bCurInterruptOn;
|
||||
u1Byte preFwDacSwingLvl;
|
||||
u1Byte curFwDacSwingLvl;
|
||||
BOOLEAN bPreNavOn;
|
||||
BOOLEAN bCurNavOn;
|
||||
|
||||
// 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;
|
||||
u4Byte preVal0x6cc;
|
||||
u4Byte curVal0x6cc;
|
||||
//BOOLEAN bLimitedDig;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
u1Byte curAlgorithm;
|
||||
//u1Byte btStatus;
|
||||
//u1Byte wifiChnlInfo[3];
|
||||
} COEX_DM_8188C_2ANT, *PCOEX_DM_8188C_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8188C_2ANT{
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bBtBusy;
|
||||
BOOLEAN bBtUplink;
|
||||
BOOLEAN bBtDownLink;
|
||||
BOOLEAN bA2dpBusy;
|
||||
}COEX_STA_8188C_2ANT, *PCOEX_STA_8188C_2ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8188c2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8188c2ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,166 @@
|
|||
//===========================================
|
||||
// The following is for 8192D 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8192D_2ANT 6
|
||||
|
||||
typedef enum _BT_INFO_SRC_8192D_2ANT{
|
||||
BT_INFO_SRC_8192D_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8192D_2ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8192D_2ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8192D_2ANT_MAX
|
||||
}BT_INFO_SRC_8192D_2ANT,*PBT_INFO_SRC_8192D_2ANT;
|
||||
|
||||
typedef enum _BT_8192D_2ANT_BT_STATUS{
|
||||
BT_8192D_2ANT_BT_STATUS_IDLE = 0x0,
|
||||
BT_8192D_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8192D_2ANT_BT_STATUS_NON_IDLE = 0x2,
|
||||
BT_8192D_2ANT_BT_STATUS_MAX
|
||||
}BT_8192D_2ANT_BT_STATUS,*PBT_8192D_2ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8192D_2ANT_COEX_ALGO{
|
||||
BT_8192D_2ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8192D_2ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8192D_2ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8192D_2ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8192D_2ANT_COEX_ALGO_PAN = 0x4,
|
||||
BT_8192D_2ANT_COEX_ALGO_HID_A2DP = 0x5,
|
||||
BT_8192D_2ANT_COEX_ALGO_HID_PAN = 0x6,
|
||||
BT_8192D_2ANT_COEX_ALGO_PAN_A2DP = 0x7,
|
||||
BT_8192D_2ANT_COEX_ALGO_MAX
|
||||
}BT_8192D_2ANT_COEX_ALGO,*PBT_8192D_2ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8192D_2ANT{
|
||||
// fw mechanism
|
||||
BOOLEAN bPreBalanceOn;
|
||||
BOOLEAN bCurBalanceOn;
|
||||
|
||||
// diminishWifi
|
||||
BOOLEAN bPreDacOn;
|
||||
BOOLEAN bCurDacOn;
|
||||
BOOLEAN bPreInterruptOn;
|
||||
BOOLEAN bCurInterruptOn;
|
||||
u1Byte preFwDacSwingLvl;
|
||||
u1Byte curFwDacSwingLvl;
|
||||
BOOLEAN bPreNavOn;
|
||||
BOOLEAN bCurNavOn;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//BOOLEAN bPreDecBtPwr;
|
||||
//BOOLEAN bCurDecBtPwr;
|
||||
|
||||
//u1Byte preFwDacSwingLvl;
|
||||
//u1Byte curFwDacSwingLvl;
|
||||
//BOOLEAN bCurIgnoreWlanAct;
|
||||
//BOOLEAN bPreIgnoreWlanAct;
|
||||
//u1Byte prePsTdma;
|
||||
//u1Byte curPsTdma;
|
||||
//u1Byte psTdmaPara[5];
|
||||
//u1Byte psTdmaDuAdjType;
|
||||
//BOOLEAN bResetTdmaAdjust;
|
||||
//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;
|
||||
u4Byte preVal0x6cc;
|
||||
u4Byte curVal0x6cc;
|
||||
//BOOLEAN bLimitedDig;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
u1Byte curAlgorithm;
|
||||
//u1Byte btStatus;
|
||||
//u1Byte wifiChnlInfo[3];
|
||||
} COEX_DM_8192D_2ANT, *PCOEX_DM_8192D_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8192D_2ANT{
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bBtBusy;
|
||||
BOOLEAN bBtUplink;
|
||||
BOOLEAN bBtDownLink;
|
||||
BOOLEAN bA2dpBusy;
|
||||
}COEX_STA_8192D_2ANT, *PCOEX_STA_8192D_2ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8192d2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192d2ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,210 @@
|
|||
//===========================================
|
||||
// The following is for 8192E_1ANT BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8192E_1ANT 0
|
||||
|
||||
#define BT_INFO_8192E_1ANT_B_FTP BIT7
|
||||
#define BT_INFO_8192E_1ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8192E_1ANT_B_HID BIT5
|
||||
#define BT_INFO_8192E_1ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8192E_1ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8192E_1ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8192E_1ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8192E_1ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BT_INFO_8192E_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
|
||||
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8192E_1ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8192E_1ANT{
|
||||
BT_INFO_SRC_8192E_1ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8192E_1ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8192E_1ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8192E_1ANT_MAX
|
||||
}BT_INFO_SRC_8192E_1ANT,*PBT_INFO_SRC_8192E_1ANT;
|
||||
|
||||
typedef enum _BT_8192E_1ANT_BT_STATUS{
|
||||
BT_8192E_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8192E_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8192E_1ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8192E_1ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8192E_1ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8192E_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8192E_1ANT_BT_STATUS_MAX
|
||||
}BT_8192E_1ANT_BT_STATUS,*PBT_8192E_1ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8192E_1ANT_WIFI_STATUS{
|
||||
BT_8192E_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8192E_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
|
||||
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
|
||||
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
|
||||
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
|
||||
BT_8192E_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
|
||||
BT_8192E_1ANT_WIFI_STATUS_MAX
|
||||
}BT_8192E_1ANT_WIFI_STATUS,*PBT_8192E_1ANT_WIFI_STATUS;
|
||||
|
||||
typedef enum _BT_8192E_1ANT_COEX_ALGO{
|
||||
BT_8192E_1ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8192E_1ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8192E_1ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8192E_1ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8192E_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
|
||||
BT_8192E_1ANT_COEX_ALGO_PANEDR = 0x5,
|
||||
BT_8192E_1ANT_COEX_ALGO_PANHS = 0x6,
|
||||
BT_8192E_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
|
||||
BT_8192E_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
|
||||
BT_8192E_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
|
||||
BT_8192E_1ANT_COEX_ALGO_HID_A2DP = 0xa,
|
||||
BT_8192E_1ANT_COEX_ALGO_MAX = 0xb,
|
||||
}BT_8192E_1ANT_COEX_ALGO,*PBT_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;
|
||||
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;
|
||||
BOOLEAN bPreDacSwingOn;
|
||||
u4Byte preDacSwingLvl;
|
||||
BOOLEAN bCurDacSwingOn;
|
||||
u4Byte curDacSwingLvl;
|
||||
u4Byte preVal0x6c0;
|
||||
u4Byte curVal0x6c0;
|
||||
u4Byte preVal0x6c4;
|
||||
u4Byte curVal0x6c4;
|
||||
u4Byte preVal0x6c8;
|
||||
u4Byte curVal0x6c8;
|
||||
u1Byte preVal0x6cc;
|
||||
u1Byte curVal0x6cc;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
u1Byte curAlgorithm;
|
||||
u1Byte btStatus;
|
||||
u1Byte wifiChnlInfo[3];
|
||||
|
||||
u1Byte preSsType;
|
||||
u1Byte curSsType;
|
||||
|
||||
u4Byte preRaMask;
|
||||
u4Byte curRaMask;
|
||||
|
||||
u1Byte errorCondition;
|
||||
} COEX_DM_8192E_1ANT, *PCOEX_DM_8192E_1ANT;
|
||||
|
||||
typedef struct _COEX_STA_8192E_1ANT{
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bHidExist;
|
||||
BOOLEAN bPanExist;
|
||||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
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;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
}COEX_STA_8192E_1ANT, *PCOEX_STA_8192E_1ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8192e1ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e1ant_DbgControl(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte opCode,
|
||||
IN u1Byte opLen,
|
||||
IN pu1Byte pData
|
||||
);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,202 @@
|
|||
//===========================================
|
||||
// The following is for 8192E 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8192E_2ANT 0
|
||||
|
||||
#define BT_INFO_8192E_2ANT_B_FTP BIT7
|
||||
#define BT_INFO_8192E_2ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8192E_2ANT_B_HID BIT5
|
||||
#define BT_INFO_8192E_2ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8192E_2ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8192E_2ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8192E_2ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8192E_2ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8192E_2ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8192E_2ANT{
|
||||
BT_INFO_SRC_8192E_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8192E_2ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8192E_2ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8192E_2ANT_MAX
|
||||
}BT_INFO_SRC_8192E_2ANT,*PBT_INFO_SRC_8192E_2ANT;
|
||||
|
||||
typedef enum _BT_8192E_2ANT_BT_STATUS{
|
||||
BT_8192E_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8192E_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8192E_2ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8192E_2ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8192E_2ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8192E_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8192E_2ANT_BT_STATUS_MAX
|
||||
}BT_8192E_2ANT_BT_STATUS,*PBT_8192E_2ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8192E_2ANT_COEX_ALGO{
|
||||
BT_8192E_2ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8192E_2ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8192E_2ANT_COEX_ALGO_SCO_PAN = 0x2,
|
||||
BT_8192E_2ANT_COEX_ALGO_HID = 0x3,
|
||||
BT_8192E_2ANT_COEX_ALGO_A2DP = 0x4,
|
||||
BT_8192E_2ANT_COEX_ALGO_A2DP_PANHS = 0x5,
|
||||
BT_8192E_2ANT_COEX_ALGO_PANEDR = 0x6,
|
||||
BT_8192E_2ANT_COEX_ALGO_PANHS = 0x7,
|
||||
BT_8192E_2ANT_COEX_ALGO_PANEDR_A2DP = 0x8,
|
||||
BT_8192E_2ANT_COEX_ALGO_PANEDR_HID = 0x9,
|
||||
BT_8192E_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0xa,
|
||||
BT_8192E_2ANT_COEX_ALGO_HID_A2DP = 0xb,
|
||||
BT_8192E_2ANT_COEX_ALGO_MAX = 0xc
|
||||
}BT_8192E_2ANT_COEX_ALGO,*PBT_8192E_2ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8192E_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;
|
||||
|
||||
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];
|
||||
|
||||
u1Byte preSsType;
|
||||
u1Byte curSsType;
|
||||
|
||||
u4Byte preRaMask;
|
||||
u4Byte curRaMask;
|
||||
u1Byte curRaMaskType;
|
||||
u1Byte preArfrType;
|
||||
u1Byte curArfrType;
|
||||
u1Byte preRetryLimitType;
|
||||
u1Byte curRetryLimitType;
|
||||
u1Byte preAmpduTimeType;
|
||||
u1Byte curAmpduTimeType;
|
||||
} COEX_DM_8192E_2ANT, *PCOEX_DM_8192E_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8192E_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;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8192E_2ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8192E_2ANT_MAX];
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
}COEX_STA_8192E_2ANT, *PCOEX_STA_8192E_2ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8192e2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8192e2ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,171 @@
|
|||
//===========================================
|
||||
// The following is for 8723A 1Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_INFO_8723A_1ANT_B_FTP BIT7
|
||||
#define BT_INFO_8723A_1ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8723A_1ANT_B_HID BIT5
|
||||
#define BT_INFO_8723A_1ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8723A_1ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8723A_1ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8723A_1ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8723A_1ANT_B_CONNECTION BIT0
|
||||
|
||||
typedef enum _BT_STATE_8723A_1ANT{
|
||||
BT_STATE_8723A_1ANT_DISABLED = 0,
|
||||
BT_STATE_8723A_1ANT_NO_CONNECTION = 1,
|
||||
BT_STATE_8723A_1ANT_CONNECT_IDLE = 2,
|
||||
BT_STATE_8723A_1ANT_INQ_OR_PAG = 3,
|
||||
BT_STATE_8723A_1ANT_ACL_ONLY_BUSY = 4,
|
||||
BT_STATE_8723A_1ANT_SCO_ONLY_BUSY = 5,
|
||||
BT_STATE_8723A_1ANT_ACL_SCO_BUSY = 6,
|
||||
BT_STATE_8723A_1ANT_HID_BUSY = 7,
|
||||
BT_STATE_8723A_1ANT_HID_SCO_BUSY = 8,
|
||||
BT_STATE_8723A_1ANT_MAX
|
||||
}BT_STATE_8723A_1ANT, *PBT_STATE_8723A_1ANT;
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8723A_1ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8723A_1ANT{
|
||||
BT_INFO_SRC_8723A_1ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8723A_1ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8723A_1ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8723A_1ANT_MAX
|
||||
}BT_INFO_SRC_8723A_1ANT,*PBT_INFO_SRC_8723A_1ANT;
|
||||
|
||||
typedef enum _BT_8723A_1ANT_BT_STATUS{
|
||||
BT_8723A_1ANT_BT_STATUS_IDLE = 0x0,
|
||||
BT_8723A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8723A_1ANT_BT_STATUS_NON_IDLE = 0x2,
|
||||
BT_8723A_1ANT_BT_STATUS_MAX
|
||||
}BT_8723A_1ANT_BT_STATUS,*PBT_8723A_1ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8723A_1ANT_COEX_ALGO{
|
||||
BT_8723A_1ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8723A_1ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8723A_1ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8723A_1ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8723A_1ANT_COEX_ALGO_PANEDR = 0x4,
|
||||
BT_8723A_1ANT_COEX_ALGO_PANHS = 0x5,
|
||||
BT_8723A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x6,
|
||||
BT_8723A_1ANT_COEX_ALGO_PANEDR_HID = 0x7,
|
||||
BT_8723A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x8,
|
||||
BT_8723A_1ANT_COEX_ALGO_HID_A2DP = 0x9,
|
||||
BT_8723A_1ANT_COEX_ALGO_MAX
|
||||
}BT_8723A_1ANT_COEX_ALGO,*PBT_8723A_1ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8723A_1ANT{
|
||||
// fw mechanism
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
BOOLEAN bPreIgnoreWlanAct;
|
||||
u1Byte prePsTdma;
|
||||
u1Byte curPsTdma;
|
||||
u1Byte psTdmaPara[5];
|
||||
u1Byte psTdmaDuAdjType;
|
||||
u4Byte psTdmaMonitorCnt;
|
||||
u4Byte psTdmaGlobalCnt;
|
||||
BOOLEAN bResetTdmaAdjust;
|
||||
BOOLEAN bPrePsTdmaOn;
|
||||
BOOLEAN bCurPsTdmaOn;
|
||||
|
||||
// sw mechanism
|
||||
BOOLEAN bPreRfRxLpfShrink;
|
||||
BOOLEAN bCurRfRxLpfShrink;
|
||||
u4Byte btRf0x1eBackup;
|
||||
BOOLEAN bPreLowPenaltyRa;
|
||||
BOOLEAN bCurLowPenaltyRa;
|
||||
u4Byte preVal0x6c0;
|
||||
u4Byte curVal0x6c0;
|
||||
u4Byte preVal0x6c8;
|
||||
u4Byte curVal0x6c8;
|
||||
u1Byte preVal0x6cc;
|
||||
u1Byte curVal0x6cc;
|
||||
BOOLEAN bLimitedDig;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
u1Byte curAlgorithm;
|
||||
u1Byte btStatus;
|
||||
u1Byte wifiChnlInfo[3];
|
||||
} COEX_DM_8723A_1ANT, *PCOEX_DM_8723A_1ANT;
|
||||
|
||||
typedef struct _COEX_STA_8723A_1ANT{
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preBtRssiState1;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8723A_1ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8723A_1ANT_MAX];
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
//BOOLEAN bHoldForStackOperation;
|
||||
//u1Byte bHoldPeriodCnt;
|
||||
// this is for c2h hang work-around
|
||||
u4Byte c2hHangDetectCnt;
|
||||
}COEX_STA_8723A_1ANT, *PCOEX_STA_8723A_1ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8723a1ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,180 @@
|
|||
//===========================================
|
||||
// The following is for 8723A 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_INFO_8723A_2ANT_B_FTP BIT7
|
||||
#define BT_INFO_8723A_2ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8723A_2ANT_B_HID BIT5
|
||||
#define BT_INFO_8723A_2ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8723A_2ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8723A_2ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8723A_2ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8723A_2ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8723A_2ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8723A_2ANT{
|
||||
BT_INFO_SRC_8723A_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8723A_2ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8723A_2ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8723A_2ANT_MAX
|
||||
}BT_INFO_SRC_8723A_2ANT,*PBT_INFO_SRC_8723A_2ANT;
|
||||
|
||||
typedef enum _BT_8723A_2ANT_BT_STATUS{
|
||||
BT_8723A_2ANT_BT_STATUS_IDLE = 0x0,
|
||||
BT_8723A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8723A_2ANT_BT_STATUS_NON_IDLE = 0x2,
|
||||
BT_8723A_2ANT_BT_STATUS_MAX
|
||||
}BT_8723A_2ANT_BT_STATUS,*PBT_8723A_2ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8723A_2ANT_COEX_ALGO{
|
||||
BT_8723A_2ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8723A_2ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8723A_2ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8723A_2ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8723A_2ANT_COEX_ALGO_PANEDR = 0x4,
|
||||
BT_8723A_2ANT_COEX_ALGO_PANHS = 0x5,
|
||||
BT_8723A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x6,
|
||||
BT_8723A_2ANT_COEX_ALGO_PANEDR_HID = 0x7,
|
||||
BT_8723A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x8,
|
||||
BT_8723A_2ANT_COEX_ALGO_HID_A2DP = 0x9,
|
||||
BT_8723A_2ANT_COEX_ALGO_MAX
|
||||
}BT_8723A_2ANT_COEX_ALGO,*PBT_8723A_2ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8723A_2ANT{
|
||||
// fw mechanism
|
||||
BOOLEAN bPreDecBtPwr;
|
||||
BOOLEAN bCurDecBtPwr;
|
||||
//BOOLEAN bPreBtLnaConstrain;
|
||||
//BOOLEAN bCurBtLnaConstrain;
|
||||
//u1Byte bPreBtPsdMode;
|
||||
//u1Byte bCurBtPsdMode;
|
||||
u1Byte preFwDacSwingLvl;
|
||||
u1Byte curFwDacSwingLvl;
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
BOOLEAN bPreIgnoreWlanAct;
|
||||
u1Byte prePsTdma;
|
||||
u1Byte curPsTdma;
|
||||
u1Byte psTdmaPara[5];
|
||||
u1Byte psTdmaDuAdjType;
|
||||
BOOLEAN bResetTdmaAdjust;
|
||||
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 preVal0x6c8;
|
||||
u4Byte curVal0x6c8;
|
||||
u1Byte preVal0x6cc;
|
||||
u1Byte curVal0x6cc;
|
||||
BOOLEAN bLimitedDig;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
u1Byte curAlgorithm;
|
||||
u1Byte btStatus;
|
||||
u1Byte wifiChnlInfo[3];
|
||||
} COEX_DM_8723A_2ANT, *PCOEX_DM_8723A_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8723A_2ANT{
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preBtRssiState1;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8723A_2ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8723A_2ANT_MAX];
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
BOOLEAN bHoldForStackOperation;
|
||||
u1Byte bHoldPeriodCnt;
|
||||
// this is for c2h hang work-around
|
||||
u4Byte c2hHangDetectCnt;
|
||||
}COEX_STA_8723A_2ANT, *PCOEX_STA_8723A_2ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8723a2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_StackOperationNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723a2ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,214 @@
|
|||
//===========================================
|
||||
// The following is for 8723B 1ANT BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8723B_1ANT 1
|
||||
|
||||
#define BT_INFO_8723B_1ANT_B_FTP BIT7
|
||||
#define BT_INFO_8723B_1ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8723B_1ANT_B_HID BIT5
|
||||
#define BT_INFO_8723B_1ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8723B_1ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8723B_1ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8723B_1ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8723B_1ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BT_INFO_8723B_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
|
||||
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8723B_1ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8723B_1ANT{
|
||||
BT_INFO_SRC_8723B_1ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8723B_1ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8723B_1ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8723B_1ANT_MAX
|
||||
}BT_INFO_SRC_8723B_1ANT,*PBT_INFO_SRC_8723B_1ANT;
|
||||
|
||||
typedef enum _BT_8723B_1ANT_BT_STATUS{
|
||||
BT_8723B_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8723B_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8723B_1ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8723B_1ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8723B_1ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8723B_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8723B_1ANT_BT_STATUS_MAX
|
||||
}BT_8723B_1ANT_BT_STATUS,*PBT_8723B_1ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8723B_1ANT_WIFI_STATUS{
|
||||
BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8723B_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
|
||||
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
|
||||
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
|
||||
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
|
||||
BT_8723B_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
|
||||
BT_8723B_1ANT_WIFI_STATUS_MAX
|
||||
}BT_8723B_1ANT_WIFI_STATUS,*PBT_8723B_1ANT_WIFI_STATUS;
|
||||
|
||||
typedef enum _BT_8723B_1ANT_COEX_ALGO{
|
||||
BT_8723B_1ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8723B_1ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8723B_1ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8723B_1ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8723B_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
|
||||
BT_8723B_1ANT_COEX_ALGO_PANEDR = 0x5,
|
||||
BT_8723B_1ANT_COEX_ALGO_PANHS = 0x6,
|
||||
BT_8723B_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
|
||||
BT_8723B_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
|
||||
BT_8723B_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
|
||||
BT_8723B_1ANT_COEX_ALGO_HID_A2DP = 0xa,
|
||||
BT_8723B_1ANT_COEX_ALGO_MAX = 0xb,
|
||||
}BT_8723B_1ANT_COEX_ALGO,*PBT_8723B_1ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8723B_1ANT{
|
||||
// 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;
|
||||
|
||||
u1Byte errorCondition;
|
||||
} COEX_DM_8723B_1ANT, *PCOEX_DM_8723B_1ANT;
|
||||
|
||||
typedef struct _COEX_STA_8723B_1ANT{
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bHidExist;
|
||||
BOOLEAN bPanExist;
|
||||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
BOOLEAN bFinishInitHW;
|
||||
u4Byte specialPktPeriodCnt;
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
BOOLEAN bBtTxRxMask;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8723B_1ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_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;
|
||||
}COEX_STA_8723B_1ANT, *PCOEX_STA_8723B_1ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8723b1ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_CoexDmReset(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,193 @@
|
|||
//===========================================
|
||||
// The following is for 8723B 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8723B_2ANT 1
|
||||
|
||||
|
||||
#define BT_INFO_8723B_2ANT_B_FTP BIT7
|
||||
#define BT_INFO_8723B_2ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8723B_2ANT_B_HID BIT5
|
||||
#define BT_INFO_8723B_2ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8723B_2ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8723B_2ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8723B_2ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8723B_2ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8723B_2ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8723B_2ANT{
|
||||
BT_INFO_SRC_8723B_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8723B_2ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8723B_2ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8723B_2ANT_MAX
|
||||
}BT_INFO_SRC_8723B_2ANT,*PBT_INFO_SRC_8723B_2ANT;
|
||||
|
||||
typedef enum _BT_8723B_2ANT_BT_STATUS{
|
||||
BT_8723B_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8723B_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8723B_2ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8723B_2ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8723B_2ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8723B_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8723B_2ANT_BT_STATUS_MAX
|
||||
}BT_8723B_2ANT_BT_STATUS,*PBT_8723B_2ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8723B_2ANT_COEX_ALGO{
|
||||
BT_8723B_2ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8723B_2ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8723B_2ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8723B_2ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8723B_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
|
||||
BT_8723B_2ANT_COEX_ALGO_PANEDR = 0x5,
|
||||
BT_8723B_2ANT_COEX_ALGO_PANHS = 0x6,
|
||||
BT_8723B_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
|
||||
BT_8723B_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
|
||||
BT_8723B_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
|
||||
BT_8723B_2ANT_COEX_ALGO_HID_A2DP = 0xa,
|
||||
BT_8723B_2ANT_COEX_ALGO_MAX = 0xb,
|
||||
}BT_8723B_2ANT_COEX_ALGO,*PBT_8723B_2ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8723B_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;
|
||||
} COEX_DM_8723B_2ANT, *PCOEX_DM_8723B_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8723B_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_8723B_2ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8723B_2ANT_MAX];
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
}COEX_STA_8723B_2ANT, *PCOEX_STA_8723B_2ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8723b2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8723b2ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,202 @@
|
|||
//===========================================
|
||||
// The following is for 8812A_1ANT BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_INFO_8812A_1ANT_B_FTP BIT7
|
||||
#define BT_INFO_8812A_1ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8812A_1ANT_B_HID BIT5
|
||||
#define BT_INFO_8812A_1ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8812A_1ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8812A_1ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8812A_1ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8812A_1ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BT_INFO_8812A_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
|
||||
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
|
||||
|
||||
#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
|
||||
|
||||
typedef enum _BT_INFO_SRC_8812A_1ANT{
|
||||
BT_INFO_SRC_8812A_1ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8812A_1ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8812A_1ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8812A_1ANT_MAX
|
||||
}BT_INFO_SRC_8812A_1ANT,*PBT_INFO_SRC_8812A_1ANT;
|
||||
|
||||
typedef enum _BT_8812A_1ANT_BT_STATUS{
|
||||
BT_8812A_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8812A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8812A_1ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8812A_1ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8812A_1ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8812A_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8812A_1ANT_BT_STATUS_MAX
|
||||
}BT_8812A_1ANT_BT_STATUS,*PBT_8812A_1ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8812A_1ANT_WIFI_STATUS{
|
||||
BT_8812A_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8812A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
|
||||
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
|
||||
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
|
||||
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
|
||||
BT_8812A_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
|
||||
BT_8812A_1ANT_WIFI_STATUS_MAX
|
||||
}BT_8812A_1ANT_WIFI_STATUS,*PBT_8812A_1ANT_WIFI_STATUS;
|
||||
|
||||
typedef enum _BT_8812A_1ANT_COEX_ALGO{
|
||||
BT_8812A_1ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8812A_1ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8812A_1ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8812A_1ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8812A_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
|
||||
BT_8812A_1ANT_COEX_ALGO_PANEDR = 0x5,
|
||||
BT_8812A_1ANT_COEX_ALGO_PANHS = 0x6,
|
||||
BT_8812A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
|
||||
BT_8812A_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
|
||||
BT_8812A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
|
||||
BT_8812A_1ANT_COEX_ALGO_HID_A2DP = 0xa,
|
||||
BT_8812A_1ANT_COEX_ALGO_MAX = 0xb,
|
||||
}BT_8812A_1ANT_COEX_ALGO,*PBT_8812A_1ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8812A_1ANT{
|
||||
// fw mechanism
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
BOOLEAN bPreIgnoreWlanAct;
|
||||
u1Byte prePsTdma;
|
||||
u1Byte curPsTdma;
|
||||
u1Byte psTdmaPara[5];
|
||||
u1Byte psTdmaDuAdjType;
|
||||
BOOLEAN bResetTdmaAdjust;
|
||||
BOOLEAN bPrePsTdmaOn;
|
||||
BOOLEAN bCurPsTdmaOn;
|
||||
BOOLEAN bPreBtAutoReport;
|
||||
BOOLEAN bCurBtAutoReport;
|
||||
u1Byte preLps;
|
||||
u1Byte curLps;
|
||||
u1Byte preRpwm;
|
||||
u1Byte curRpwm;
|
||||
|
||||
// sw mechanism
|
||||
BOOLEAN bPreLowPenaltyRa;
|
||||
BOOLEAN bCurLowPenaltyRa;
|
||||
BOOLEAN bPreDacSwingOn;
|
||||
u4Byte preVal0x6c0;
|
||||
u4Byte curVal0x6c0;
|
||||
u4Byte preVal0x6c4;
|
||||
u4Byte curVal0x6c4;
|
||||
u4Byte preVal0x6c8;
|
||||
u4Byte curVal0x6c8;
|
||||
u1Byte preVal0x6cc;
|
||||
u1Byte curVal0x6cc;
|
||||
|
||||
// algorithm related
|
||||
u1Byte preAlgorithm;
|
||||
u1Byte curAlgorithm;
|
||||
u1Byte btStatus;
|
||||
u1Byte wifiChnlInfo[3];
|
||||
|
||||
u4Byte preRaMask;
|
||||
u4Byte curRaMask;
|
||||
|
||||
u1Byte errorCondition;
|
||||
} COEX_DM_8812A_1ANT, *PCOEX_DM_8812A_1ANT;
|
||||
|
||||
typedef struct _COEX_STA_8812A_1ANT{
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bHidExist;
|
||||
BOOLEAN bPanExist;
|
||||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8812A_1ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8812A_1ANT_MAX];
|
||||
u4Byte btInfoQueryCnt;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
}COEX_STA_8812A_1ANT, *PCOEX_STA_8812A_1ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8812a1ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a1ant_DbgControl(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte opCode,
|
||||
IN u1Byte opLen,
|
||||
IN pu1Byte pData
|
||||
);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,214 @@
|
|||
//===========================================
|
||||
// The following is for 8812A 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8812A_2ANT 0
|
||||
|
||||
#define BT_INFO_8812A_2ANT_B_FTP BIT7
|
||||
#define BT_INFO_8812A_2ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8812A_2ANT_B_HID BIT5
|
||||
#define BT_INFO_8812A_2ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8812A_2ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8812A_2ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8812A_2ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8812A_2ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BT_INFO_8812A_2ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
|
||||
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8812A_2ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8812A_2ANT{
|
||||
BT_INFO_SRC_8812A_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8812A_2ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8812A_2ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8812A_2ANT_MAX
|
||||
}BT_INFO_SRC_8812A_2ANT,*PBT_INFO_SRC_8812A_2ANT;
|
||||
|
||||
typedef enum _BT_8812A_2ANT_BT_STATUS{
|
||||
BT_8812A_2ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8812A_2ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8812A_2ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8812A_2ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8812A_2ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8812A_2ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8812A_2ANT_BT_STATUS_MAX
|
||||
}BT_8812A_2ANT_BT_STATUS,*PBT_8812A_2ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8812A_2ANT_COEX_ALGO{
|
||||
BT_8812A_2ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8812A_2ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8812A_2ANT_COEX_ALGO_SCO_HID = 0x2,
|
||||
BT_8812A_2ANT_COEX_ALGO_HID = 0x3,
|
||||
BT_8812A_2ANT_COEX_ALGO_A2DP = 0x4,
|
||||
BT_8812A_2ANT_COEX_ALGO_A2DP_PANHS = 0x5,
|
||||
BT_8812A_2ANT_COEX_ALGO_PANEDR = 0x6,
|
||||
BT_8812A_2ANT_COEX_ALGO_PANHS = 0x7,
|
||||
BT_8812A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x8,
|
||||
BT_8812A_2ANT_COEX_ALGO_PANEDR_HID = 0x9,
|
||||
BT_8812A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0xa,
|
||||
BT_8812A_2ANT_COEX_ALGO_HID_A2DP_PANHS = 0xb,
|
||||
BT_8812A_2ANT_COEX_ALGO_HID_A2DP = 0xc,
|
||||
BT_8812A_2ANT_COEX_ALGO_MAX = 0xd
|
||||
}BT_8812A_2ANT_COEX_ALGO,*PBT_8812A_2ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8812A_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 bAutoTdmaAdjust;
|
||||
BOOLEAN bAutoTdmaAdjustLowRssi;
|
||||
BOOLEAN bPrePsTdmaOn;
|
||||
BOOLEAN bCurPsTdmaOn;
|
||||
BOOLEAN bPreBtAutoReport;
|
||||
BOOLEAN bCurBtAutoReport;
|
||||
u1Byte preLps;
|
||||
u1Byte curLps;
|
||||
u1Byte preRpwm;
|
||||
u1Byte curRpwm;
|
||||
|
||||
// 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;
|
||||
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 curRaMaskType;
|
||||
u1Byte preArfrType;
|
||||
u1Byte curArfrType;
|
||||
u1Byte preRetryLimitType;
|
||||
u1Byte curRetryLimitType;
|
||||
u1Byte preAmpduTimeType;
|
||||
u1Byte curAmpduTimeType;
|
||||
} COEX_DM_8812A_2ANT, *PCOEX_DM_8812A_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8812A_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;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8812A_2ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8812A_2ANT_MAX];
|
||||
u4Byte btInfoQueryCnt;
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
}COEX_STA_8812A_2ANT, *PCOEX_STA_8812A_2ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8812a2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8812a2ant_DbgControl(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte opCode,
|
||||
IN u1Byte opLen,
|
||||
IN pu1Byte pData
|
||||
);
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,211 @@
|
|||
//===========================================
|
||||
// The following is for 8821A 1ANT BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_AUTO_REPORT_ONLY_8821A_1ANT 0
|
||||
|
||||
#define BT_INFO_8821A_1ANT_B_FTP BIT7
|
||||
#define BT_INFO_8821A_1ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8821A_1ANT_B_HID BIT5
|
||||
#define BT_INFO_8821A_1ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8821A_1ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8821A_1ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8821A_1ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8821A_1ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BT_INFO_8821A_1ANT_A2DP_BASIC_RATE(_BT_INFO_EXT_) \
|
||||
(((_BT_INFO_EXT_&BIT0))? TRUE:FALSE)
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8821A_1ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8821A_1ANT{
|
||||
BT_INFO_SRC_8821A_1ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8821A_1ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8821A_1ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8821A_1ANT_MAX
|
||||
}BT_INFO_SRC_8821A_1ANT,*PBT_INFO_SRC_8821A_1ANT;
|
||||
|
||||
typedef enum _BT_8821A_1ANT_BT_STATUS{
|
||||
BT_8821A_1ANT_BT_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8821A_1ANT_BT_STATUS_CONNECTED_IDLE = 0x1,
|
||||
BT_8821A_1ANT_BT_STATUS_INQ_PAGE = 0x2,
|
||||
BT_8821A_1ANT_BT_STATUS_ACL_BUSY = 0x3,
|
||||
BT_8821A_1ANT_BT_STATUS_SCO_BUSY = 0x4,
|
||||
BT_8821A_1ANT_BT_STATUS_ACL_SCO_BUSY = 0x5,
|
||||
BT_8821A_1ANT_BT_STATUS_MAX
|
||||
}BT_8821A_1ANT_BT_STATUS,*PBT_8821A_1ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8821A_1ANT_WIFI_STATUS{
|
||||
BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_IDLE = 0x0,
|
||||
BT_8821A_1ANT_WIFI_STATUS_NON_CONNECTED_ASSO_AUTH_SCAN = 0x1,
|
||||
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SCAN = 0x2,
|
||||
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_SPECIAL_PKT = 0x3,
|
||||
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_IDLE = 0x4,
|
||||
BT_8821A_1ANT_WIFI_STATUS_CONNECTED_BUSY = 0x5,
|
||||
BT_8821A_1ANT_WIFI_STATUS_MAX
|
||||
}BT_8821A_1ANT_WIFI_STATUS,*PBT_8821A_1ANT_WIFI_STATUS;
|
||||
|
||||
typedef enum _BT_8821A_1ANT_COEX_ALGO{
|
||||
BT_8821A_1ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8821A_1ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8821A_1ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8821A_1ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8821A_1ANT_COEX_ALGO_A2DP_PANHS = 0x4,
|
||||
BT_8821A_1ANT_COEX_ALGO_PANEDR = 0x5,
|
||||
BT_8821A_1ANT_COEX_ALGO_PANHS = 0x6,
|
||||
BT_8821A_1ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
|
||||
BT_8821A_1ANT_COEX_ALGO_PANEDR_HID = 0x8,
|
||||
BT_8821A_1ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
|
||||
BT_8821A_1ANT_COEX_ALGO_HID_A2DP = 0xa,
|
||||
BT_8821A_1ANT_COEX_ALGO_MAX = 0xb,
|
||||
}BT_8821A_1ANT_COEX_ALGO,*PBT_8821A_1ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8821A_1ANT{
|
||||
// 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;
|
||||
|
||||
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;
|
||||
|
||||
u1Byte errorCondition;
|
||||
} COEX_DM_8821A_1ANT, *PCOEX_DM_8821A_1ANT;
|
||||
|
||||
typedef struct _COEX_STA_8821A_1ANT{
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bHidExist;
|
||||
BOOLEAN bPanExist;
|
||||
|
||||
BOOLEAN bUnderLps;
|
||||
BOOLEAN bUnderIps;
|
||||
u4Byte specialPktPeriodCnt;
|
||||
u4Byte highPriorityTx;
|
||||
u4Byte highPriorityRx;
|
||||
u4Byte lowPriorityTx;
|
||||
u4Byte lowPriorityRx;
|
||||
u1Byte btRssi;
|
||||
u1Byte preBtRssiState;
|
||||
u1Byte preWifiRssiState[4];
|
||||
BOOLEAN bC2hBtInfoReqSent;
|
||||
u1Byte btInfoC2h[BT_INFO_SRC_8821A_1ANT_MAX][10];
|
||||
u4Byte btInfoC2hCnt[BT_INFO_SRC_8821A_1ANT_MAX];
|
||||
BOOLEAN bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
}COEX_STA_8821A_1ANT, *PCOEX_STA_8821A_1ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8821a1ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a1ant_DbgControl(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte opCode,
|
||||
IN u1Byte opLen,
|
||||
IN pu1Byte pData
|
||||
);
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,182 @@
|
|||
//===========================================
|
||||
// The following is for 8821A 2Ant BT Co-exist definition
|
||||
//===========================================
|
||||
#define BT_INFO_8821A_2ANT_B_FTP BIT7
|
||||
#define BT_INFO_8821A_2ANT_B_A2DP BIT6
|
||||
#define BT_INFO_8821A_2ANT_B_HID BIT5
|
||||
#define BT_INFO_8821A_2ANT_B_SCO_BUSY BIT4
|
||||
#define BT_INFO_8821A_2ANT_B_ACL_BUSY BIT3
|
||||
#define BT_INFO_8821A_2ANT_B_INQ_PAGE BIT2
|
||||
#define BT_INFO_8821A_2ANT_B_SCO_ESCO BIT1
|
||||
#define BT_INFO_8821A_2ANT_B_CONNECTION BIT0
|
||||
|
||||
#define BTC_RSSI_COEX_THRESH_TOL_8821A_2ANT 2
|
||||
|
||||
typedef enum _BT_INFO_SRC_8821A_2ANT{
|
||||
BT_INFO_SRC_8821A_2ANT_WIFI_FW = 0x0,
|
||||
BT_INFO_SRC_8821A_2ANT_BT_RSP = 0x1,
|
||||
BT_INFO_SRC_8821A_2ANT_BT_ACTIVE_SEND = 0x2,
|
||||
BT_INFO_SRC_8821A_2ANT_MAX
|
||||
}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_MAX
|
||||
}BT_8821A_2ANT_BT_STATUS,*PBT_8821A_2ANT_BT_STATUS;
|
||||
|
||||
typedef enum _BT_8821A_2ANT_COEX_ALGO{
|
||||
BT_8821A_2ANT_COEX_ALGO_UNDEFINED = 0x0,
|
||||
BT_8821A_2ANT_COEX_ALGO_SCO = 0x1,
|
||||
BT_8821A_2ANT_COEX_ALGO_HID = 0x2,
|
||||
BT_8821A_2ANT_COEX_ALGO_A2DP = 0x3,
|
||||
BT_8821A_2ANT_COEX_ALGO_A2DP_PANHS = 0x4,
|
||||
BT_8821A_2ANT_COEX_ALGO_PANEDR = 0x5,
|
||||
BT_8821A_2ANT_COEX_ALGO_PANHS = 0x6,
|
||||
BT_8821A_2ANT_COEX_ALGO_PANEDR_A2DP = 0x7,
|
||||
BT_8821A_2ANT_COEX_ALGO_PANEDR_HID = 0x8,
|
||||
BT_8821A_2ANT_COEX_ALGO_HID_A2DP_PANEDR = 0x9,
|
||||
BT_8821A_2ANT_COEX_ALGO_HID_A2DP = 0xa,
|
||||
BT_8821A_2ANT_COEX_ALGO_MAX = 0xb,
|
||||
}BT_8821A_2ANT_COEX_ALGO,*PBT_8821A_2ANT_COEX_ALGO;
|
||||
|
||||
typedef struct _COEX_DM_8821A_2ANT{
|
||||
// fw mechanism
|
||||
BOOLEAN bPreDecBtPwr;
|
||||
BOOLEAN bCurDecBtPwr;
|
||||
u1Byte preFwDacSwingLvl;
|
||||
u1Byte curFwDacSwingLvl;
|
||||
BOOLEAN bCurIgnoreWlanAct;
|
||||
BOOLEAN bPreIgnoreWlanAct;
|
||||
u1Byte prePsTdma;
|
||||
u1Byte curPsTdma;
|
||||
u1Byte psTdmaPara[5];
|
||||
u1Byte psTdmaDuAdjType;
|
||||
BOOLEAN bResetTdmaAdjust;
|
||||
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];
|
||||
} COEX_DM_8821A_2ANT, *PCOEX_DM_8821A_2ANT;
|
||||
|
||||
typedef struct _COEX_STA_8821A_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;
|
||||
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 bC2hBtInquiryPage;
|
||||
u1Byte btRetryCnt;
|
||||
u1Byte btInfoExt;
|
||||
}COEX_STA_8821A_2ANT, *PCOEX_STA_8821A_2ANT;
|
||||
|
||||
//===========================================
|
||||
// The following is interface which will notify coex module.
|
||||
//===========================================
|
||||
VOID
|
||||
EXhalbtc8821a2ant_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtc8821a2ant_DisplayCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
|
@ -0,0 +1,708 @@
|
|||
#ifndef __HALBTC_OUT_SRC_H__
|
||||
#define __HALBTC_OUT_SRC_H__
|
||||
|
||||
#define NORMAL_EXEC FALSE
|
||||
#define FORCE_EXEC TRUE
|
||||
|
||||
#define BTC_RF_A 0x0
|
||||
#define BTC_RF_B 0x1
|
||||
#define BTC_RF_C 0x2
|
||||
#define BTC_RF_D 0x3
|
||||
|
||||
#define BTC_SMSP SINGLEMAC_SINGLEPHY
|
||||
#define BTC_DMDP DUALMAC_DUALPHY
|
||||
#define BTC_DMSP DUALMAC_SINGLEPHY
|
||||
#define BTC_MP_UNKNOWN 0xff
|
||||
|
||||
#define BT_COEX_ANT_TYPE_PG 0
|
||||
#define BT_COEX_ANT_TYPE_ANTDIV 1
|
||||
#define BT_COEX_ANT_TYPE_DETECTED 2
|
||||
|
||||
#define BTC_MIMO_PS_STATIC 0 // 1ss
|
||||
#define BTC_MIMO_PS_DYNAMIC 1 // 2ss
|
||||
|
||||
#define BTC_RATE_DISABLE 0
|
||||
#define BTC_RATE_ENABLE 1
|
||||
|
||||
// single Antenna definition
|
||||
#define BTC_ANT_PATH_WIFI 0
|
||||
#define BTC_ANT_PATH_BT 1
|
||||
#define BTC_ANT_PATH_PTA 2
|
||||
// dual Antenna definition
|
||||
#define BTC_ANT_WIFI_AT_MAIN 0
|
||||
#define BTC_ANT_WIFI_AT_AUX 1
|
||||
// coupler Antenna definition
|
||||
#define BTC_ANT_WIFI_AT_CPL_MAIN 0
|
||||
#define BTC_ANT_WIFI_AT_CPL_AUX 1
|
||||
|
||||
typedef enum _BTC_POWERSAVE_TYPE{
|
||||
BTC_PS_WIFI_NATIVE = 0, // wifi original power save behavior
|
||||
BTC_PS_LPS_ON = 1,
|
||||
BTC_PS_LPS_OFF = 2,
|
||||
BTC_PS_MAX
|
||||
} BTC_POWERSAVE_TYPE, *PBTC_POWERSAVE_TYPE;
|
||||
|
||||
typedef enum _BTC_BT_REG_TYPE{
|
||||
BTC_BT_REG_RF = 0,
|
||||
BTC_BT_REG_MODEM = 1,
|
||||
BTC_BT_REG_BLUEWIZE = 2,
|
||||
BTC_BT_REG_VENDOR = 3,
|
||||
BTC_BT_REG_LE = 4,
|
||||
BTC_BT_REG_MAX
|
||||
} BTC_BT_REG_TYPE, *PBTC_BT_REG_TYPE;
|
||||
|
||||
typedef enum _BTC_CHIP_INTERFACE{
|
||||
BTC_INTF_UNKNOWN = 0,
|
||||
BTC_INTF_PCI = 1,
|
||||
BTC_INTF_USB = 2,
|
||||
BTC_INTF_SDIO = 3,
|
||||
BTC_INTF_MAX
|
||||
} BTC_CHIP_INTERFACE, *PBTC_CHIP_INTERFACE;
|
||||
|
||||
typedef enum _BTC_CHIP_TYPE{
|
||||
BTC_CHIP_UNDEF = 0,
|
||||
BTC_CHIP_CSR_BC4 = 1,
|
||||
BTC_CHIP_CSR_BC8 = 2,
|
||||
BTC_CHIP_RTL8723A = 3,
|
||||
BTC_CHIP_RTL8821 = 4,
|
||||
BTC_CHIP_RTL8723B = 5,
|
||||
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
|
||||
#define WIFI_HS_CONNECTED BIT2
|
||||
#define WIFI_P2P_GO_CONNECTED BIT3
|
||||
#define WIFI_P2P_GC_CONNECTED BIT4
|
||||
|
||||
// following is for command line utility
|
||||
#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 btdmAntPos; //Bryant Add to indicate Antenna Position for (pgAntNum = 2) && (btdmAntNum =1) (DPDT+1Ant case)
|
||||
BOOLEAN bBtExist;
|
||||
} BTC_BOARD_INFO, *PBTC_BOARD_INFO;
|
||||
|
||||
typedef enum _BTC_DBG_OPCODE{
|
||||
BTC_DBG_SET_COEX_NORMAL = 0x0,
|
||||
BTC_DBG_SET_COEX_WIFI_ONLY = 0x1,
|
||||
BTC_DBG_SET_COEX_BT_ONLY = 0x2,
|
||||
BTC_DBG_SET_COEX_DEC_BT_PWR = 0x3,
|
||||
BTC_DBG_SET_COEX_BT_AFH_MAP = 0x4,
|
||||
BTC_DBG_SET_COEX_BT_IGNORE_WLAN_ACT = 0x5,
|
||||
BTC_DBG_MAX
|
||||
}BTC_DBG_OPCODE,*PBTC_DBG_OPCODE;
|
||||
|
||||
typedef enum _BTC_RSSI_STATE{
|
||||
BTC_RSSI_STATE_HIGH = 0x0,
|
||||
BTC_RSSI_STATE_MEDIUM = 0x1,
|
||||
BTC_RSSI_STATE_LOW = 0x2,
|
||||
BTC_RSSI_STATE_STAY_HIGH = 0x3,
|
||||
BTC_RSSI_STATE_STAY_MEDIUM = 0x4,
|
||||
BTC_RSSI_STATE_STAY_LOW = 0x5,
|
||||
BTC_RSSI_MAX
|
||||
}BTC_RSSI_STATE,*PBTC_RSSI_STATE;
|
||||
#define BTC_RSSI_HIGH(_rssi_) ((_rssi_==BTC_RSSI_STATE_HIGH||_rssi_==BTC_RSSI_STATE_STAY_HIGH)? TRUE:FALSE)
|
||||
#define BTC_RSSI_MEDIUM(_rssi_) ((_rssi_==BTC_RSSI_STATE_MEDIUM||_rssi_==BTC_RSSI_STATE_STAY_MEDIUM)? TRUE:FALSE)
|
||||
#define BTC_RSSI_LOW(_rssi_) ((_rssi_==BTC_RSSI_STATE_LOW||_rssi_==BTC_RSSI_STATE_STAY_LOW)? TRUE:FALSE)
|
||||
|
||||
typedef enum _BTC_WIFI_ROLE{
|
||||
BTC_ROLE_STATION = 0x0,
|
||||
BTC_ROLE_AP = 0x1,
|
||||
BTC_ROLE_IBSS = 0x2,
|
||||
BTC_ROLE_HS_MODE = 0x3,
|
||||
BTC_ROLE_MAX
|
||||
}BTC_WIFI_ROLE,*PBTC_WIFI_ROLE;
|
||||
|
||||
typedef enum _BTC_WIFI_BW_MODE{
|
||||
BTC_WIFI_BW_LEGACY = 0x0,
|
||||
BTC_WIFI_BW_HT20 = 0x1,
|
||||
BTC_WIFI_BW_HT40 = 0x2,
|
||||
BTC_WIFI_BW_MAX
|
||||
}BTC_WIFI_BW_MODE,*PBTC_WIFI_BW_MODE;
|
||||
|
||||
typedef enum _BTC_WIFI_TRAFFIC_DIR{
|
||||
BTC_WIFI_TRAFFIC_TX = 0x0,
|
||||
BTC_WIFI_TRAFFIC_RX = 0x1,
|
||||
BTC_WIFI_TRAFFIC_MAX
|
||||
}BTC_WIFI_TRAFFIC_DIR,*PBTC_WIFI_TRAFFIC_DIR;
|
||||
|
||||
typedef enum _BTC_WIFI_PNP{
|
||||
BTC_WIFI_PNP_WAKE_UP = 0x0,
|
||||
BTC_WIFI_PNP_SLEEP = 0x1,
|
||||
BTC_WIFI_PNP_MAX
|
||||
}BTC_WIFI_PNP,*PBTC_WIFI_PNP;
|
||||
|
||||
//for 8723b-d cut large current issue
|
||||
typedef enum _BT_WIFI_COEX_STATE{
|
||||
BTC_WIFI_STAT_INIT,
|
||||
BTC_WIFI_STAT_IQK,
|
||||
BTC_WIFI_STAT_NORMAL_OFF,
|
||||
BTC_WIFI_STAT_MP_OFF,
|
||||
BTC_WIFI_STAT_NORMAL,
|
||||
BTC_WIFI_STAT_ANT_DIV,
|
||||
BTC_WIFI_STAT_MAX
|
||||
}BT_WIFI_COEX_STATE,*PBT_WIFI_COEX_STATE;
|
||||
|
||||
// defined for BFP_BTC_GET
|
||||
typedef enum _BTC_GET_TYPE{
|
||||
// type BOOLEAN
|
||||
BTC_GET_BL_HS_OPERATION,
|
||||
BTC_GET_BL_HS_CONNECTING,
|
||||
BTC_GET_BL_WIFI_CONNECTED,
|
||||
BTC_GET_BL_WIFI_BUSY,
|
||||
BTC_GET_BL_WIFI_SCAN,
|
||||
BTC_GET_BL_WIFI_LINK,
|
||||
BTC_GET_BL_WIFI_ROAM,
|
||||
BTC_GET_BL_WIFI_4_WAY_PROGRESS,
|
||||
BTC_GET_BL_WIFI_UNDER_5G,
|
||||
BTC_GET_BL_WIFI_AP_MODE_ENABLE,
|
||||
BTC_GET_BL_WIFI_ENABLE_ENCRYPTION,
|
||||
BTC_GET_BL_WIFI_UNDER_B_MODE,
|
||||
BTC_GET_BL_WIFI_IS_IN_MP_MODE,
|
||||
BTC_GET_BL_EXT_SWITCH,
|
||||
|
||||
// type s4Byte
|
||||
BTC_GET_S4_WIFI_RSSI,
|
||||
BTC_GET_S4_HS_RSSI,
|
||||
|
||||
// type u4Byte
|
||||
BTC_GET_U4_WIFI_BW,
|
||||
BTC_GET_U4_WIFI_TRAFFIC_DIRECTION,
|
||||
BTC_GET_U4_WIFI_FW_VER,
|
||||
BTC_GET_U4_WIFI_LINK_STATUS,
|
||||
BTC_GET_U4_BT_PATCH_VER,
|
||||
|
||||
// type u1Byte
|
||||
BTC_GET_U1_WIFI_DOT11_CHNL,
|
||||
BTC_GET_U1_WIFI_CENTRAL_CHNL,
|
||||
BTC_GET_U1_WIFI_HS_CHNL,
|
||||
BTC_GET_U1_MAC_PHY_MODE,
|
||||
BTC_GET_U1_AP_NUM,
|
||||
|
||||
//===== for 1Ant ======
|
||||
BTC_GET_U1_LPS_MODE,
|
||||
|
||||
BTC_GET_MAX
|
||||
}BTC_GET_TYPE,*PBTC_GET_TYPE;
|
||||
|
||||
// defined for BFP_BTC_SET
|
||||
typedef enum _BTC_SET_TYPE{
|
||||
// type BOOLEAN
|
||||
BTC_SET_BL_BT_DISABLE,
|
||||
BTC_SET_BL_BT_TRAFFIC_BUSY,
|
||||
BTC_SET_BL_BT_LIMITED_DIG,
|
||||
BTC_SET_BL_FORCE_TO_ROAM,
|
||||
BTC_SET_BL_TO_REJ_AP_AGG_PKT,
|
||||
BTC_SET_BL_BT_CTRL_AGG_SIZE,
|
||||
BTC_SET_BL_INC_SCAN_DEV_NUM,
|
||||
BTC_SET_BL_BT_TX_RX_MASK,
|
||||
|
||||
// type u1Byte
|
||||
BTC_SET_U1_RSSI_ADJ_VAL_FOR_AGC_TABLE_ON,
|
||||
BTC_SET_U1_AGG_BUF_SIZE,
|
||||
|
||||
// type trigger some action
|
||||
BTC_SET_ACT_GET_BT_RSSI,
|
||||
BTC_SET_ACT_AGGREGATE_CTRL,
|
||||
//===== for 1Ant ======
|
||||
// type BOOLEAN
|
||||
|
||||
// type u1Byte
|
||||
BTC_SET_U1_RSSI_ADJ_VAL_FOR_1ANT_COEX_TYPE,
|
||||
BTC_SET_U1_LPS_VAL,
|
||||
BTC_SET_U1_RPWM_VAL,
|
||||
// type trigger some action
|
||||
BTC_SET_ACT_LEAVE_LPS,
|
||||
BTC_SET_ACT_ENTER_LPS,
|
||||
BTC_SET_ACT_NORMAL_LPS,
|
||||
BTC_SET_ACT_DISABLE_LOW_POWER,
|
||||
BTC_SET_ACT_UPDATE_RAMASK,
|
||||
BTC_SET_ACT_SEND_MIMO_PS,
|
||||
// BT Coex related
|
||||
BTC_SET_ACT_CTRL_BT_INFO,
|
||||
BTC_SET_ACT_CTRL_BT_COEX,
|
||||
BTC_SET_ACT_CTRL_8723B_ANT,
|
||||
//=================
|
||||
BTC_SET_MAX
|
||||
}BTC_SET_TYPE,*PBTC_SET_TYPE;
|
||||
|
||||
typedef enum _BTC_DBG_DISP_TYPE{
|
||||
BTC_DBG_DISP_COEX_STATISTICS = 0x0,
|
||||
BTC_DBG_DISP_BT_LINK_INFO = 0x1,
|
||||
BTC_DBG_DISP_FW_PWR_MODE_CMD = 0x2,
|
||||
BTC_DBG_DISP_MAX
|
||||
}BTC_DBG_DISP_TYPE,*PBTC_DBG_DISP_TYPE;
|
||||
|
||||
typedef enum _BTC_NOTIFY_TYPE_IPS{
|
||||
BTC_IPS_LEAVE = 0x0,
|
||||
BTC_IPS_ENTER = 0x1,
|
||||
BTC_IPS_MAX
|
||||
}BTC_NOTIFY_TYPE_IPS,*PBTC_NOTIFY_TYPE_IPS;
|
||||
typedef enum _BTC_NOTIFY_TYPE_LPS{
|
||||
BTC_LPS_DISABLE = 0x0,
|
||||
BTC_LPS_ENABLE = 0x1,
|
||||
BTC_LPS_MAX
|
||||
}BTC_NOTIFY_TYPE_LPS,*PBTC_NOTIFY_TYPE_LPS;
|
||||
typedef enum _BTC_NOTIFY_TYPE_SCAN{
|
||||
BTC_SCAN_FINISH = 0x0,
|
||||
BTC_SCAN_START = 0x1,
|
||||
BTC_SCAN_MAX
|
||||
}BTC_NOTIFY_TYPE_SCAN,*PBTC_NOTIFY_TYPE_SCAN;
|
||||
typedef enum _BTC_NOTIFY_TYPE_ASSOCIATE{
|
||||
BTC_ASSOCIATE_FINISH = 0x0,
|
||||
BTC_ASSOCIATE_START = 0x1,
|
||||
BTC_ASSOCIATE_MAX
|
||||
}BTC_NOTIFY_TYPE_ASSOCIATE,*PBTC_NOTIFY_TYPE_ASSOCIATE;
|
||||
typedef enum _BTC_NOTIFY_TYPE_MEDIA_STATUS{
|
||||
BTC_MEDIA_DISCONNECT = 0x0,
|
||||
BTC_MEDIA_CONNECT = 0x1,
|
||||
BTC_MEDIA_MAX
|
||||
}BTC_NOTIFY_TYPE_MEDIA_STATUS,*PBTC_NOTIFY_TYPE_MEDIA_STATUS;
|
||||
typedef enum _BTC_NOTIFY_TYPE_SPECIAL_PACKET{
|
||||
BTC_PACKET_UNKNOWN = 0x0,
|
||||
BTC_PACKET_DHCP = 0x1,
|
||||
BTC_PACKET_ARP = 0x2,
|
||||
BTC_PACKET_EAPOL = 0x3,
|
||||
BTC_PACKET_MAX
|
||||
}BTC_NOTIFY_TYPE_SPECIAL_PACKET,*PBTC_NOTIFY_TYPE_SPECIAL_PACKET;
|
||||
typedef enum _BTC_NOTIFY_TYPE_STACK_OPERATION{
|
||||
BTC_STACK_OP_NONE = 0x0,
|
||||
BTC_STACK_OP_INQ_PAGE_PAIR_START = 0x1,
|
||||
BTC_STACK_OP_INQ_PAGE_PAIR_FINISH = 0x2,
|
||||
BTC_STACK_OP_MAX
|
||||
}BTC_NOTIFY_TYPE_STACK_OPERATION,*PBTC_NOTIFY_TYPE_STACK_OPERATION;
|
||||
|
||||
//Bryant Add
|
||||
typedef enum _BTC_ANTENNA_POS{
|
||||
BTC_ANTENNA_AT_MAIN_PORT = 0x1,
|
||||
BTC_ANTENNA_AT_AUX_PORT = 0x2,
|
||||
}BTC_ANTENNA_POS,*PBTC_ANTENNA_POS;
|
||||
|
||||
typedef u1Byte
|
||||
(*BFP_BTC_R1)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
typedef u2Byte
|
||||
(*BFP_BTC_R2)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
typedef u4Byte
|
||||
(*BFP_BTC_R4)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_W1)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte RegAddr,
|
||||
IN u1Byte Data
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_W1_BIT_MASK)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte regAddr,
|
||||
IN u1Byte bitMask,
|
||||
IN u1Byte data1b
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_W2)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte RegAddr,
|
||||
IN u2Byte Data
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_W4)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte Data
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_SET_BB_REG)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
typedef u4Byte
|
||||
(*BFP_BTC_GET_BB_REG)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_SET_RF_REG)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u1Byte eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
typedef u4Byte
|
||||
(*BFP_BTC_GET_RF_REG)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u1Byte eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_FILL_H2C)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u1Byte elementId,
|
||||
IN u4Byte cmdLen,
|
||||
IN pu1Byte pCmdBuffer
|
||||
);
|
||||
|
||||
typedef BOOLEAN
|
||||
(*BFP_BTC_GET)(
|
||||
IN PVOID pBtCoexist,
|
||||
IN u1Byte getType,
|
||||
OUT PVOID pOutBuf
|
||||
);
|
||||
|
||||
typedef BOOLEAN
|
||||
(*BFP_BTC_SET)(
|
||||
IN PVOID pBtCoexist,
|
||||
IN u1Byte setType,
|
||||
OUT PVOID pInBuf
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_SET_BT_REG)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u1Byte regType,
|
||||
IN u4Byte offset,
|
||||
IN u4Byte value
|
||||
);
|
||||
typedef u4Byte
|
||||
(*BFP_BTC_GET_BT_REG)(
|
||||
IN PVOID pBtcContext,
|
||||
IN u1Byte regType,
|
||||
IN u4Byte offset
|
||||
);
|
||||
typedef VOID
|
||||
(*BFP_BTC_DISP_DBG_MSG)(
|
||||
IN PVOID pBtCoexist,
|
||||
IN u1Byte dispType
|
||||
);
|
||||
|
||||
typedef struct _BTC_BT_INFO{
|
||||
BOOLEAN bBtDisabled;
|
||||
u1Byte rssiAdjustForAgcTableOn;
|
||||
u1Byte rssiAdjustFor1AntCoexType;
|
||||
BOOLEAN bPreBtCtrlAggBufSize;
|
||||
BOOLEAN bBtCtrlAggBufSize;
|
||||
BOOLEAN bRejectAggPkt;
|
||||
BOOLEAN bIncreaseScanDevNum;
|
||||
BOOLEAN bBtTxRxMask;
|
||||
u1Byte preAggBufSize;
|
||||
u1Byte aggBufSize;
|
||||
BOOLEAN bBtBusy;
|
||||
BOOLEAN bLimitedDig;
|
||||
u2Byte btHciVer;
|
||||
u2Byte btRealFwVer;
|
||||
u1Byte btFwVer;
|
||||
|
||||
BOOLEAN bBtDisableLowPwr;
|
||||
|
||||
BOOLEAN bBtCtrlLps;
|
||||
BOOLEAN bBtLpsOn;
|
||||
BOOLEAN bForceToRoam; // for 1Ant solution
|
||||
u1Byte lpsVal;
|
||||
u1Byte rpwmVal;
|
||||
u4Byte raMask;
|
||||
} BTC_BT_INFO, *PBTC_BT_INFO;
|
||||
|
||||
typedef struct _BTC_STACK_INFO{
|
||||
BOOLEAN bProfileNotified;
|
||||
u2Byte hciVersion; // stack hci version
|
||||
u1Byte numOfLink;
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bAclExist;
|
||||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bHidExist;
|
||||
u1Byte numOfHid;
|
||||
BOOLEAN bPanExist;
|
||||
BOOLEAN bUnknownAclExist;
|
||||
s1Byte minBtRssi;
|
||||
} BTC_STACK_INFO, *PBTC_STACK_INFO;
|
||||
|
||||
typedef struct _BTC_BT_LINK_INFO{
|
||||
BOOLEAN bBtLinkExist;
|
||||
BOOLEAN bScoExist;
|
||||
BOOLEAN bScoOnly;
|
||||
BOOLEAN bA2dpExist;
|
||||
BOOLEAN bA2dpOnly;
|
||||
BOOLEAN bHidExist;
|
||||
BOOLEAN bHidOnly;
|
||||
BOOLEAN bPanExist;
|
||||
BOOLEAN bPanOnly;
|
||||
} BTC_BT_LINK_INFO, *PBTC_BT_LINK_INFO;
|
||||
|
||||
typedef struct _BTC_STATISTICS{
|
||||
u4Byte cntBind;
|
||||
u4Byte cntInitHwConfig;
|
||||
u4Byte cntInitCoexDm;
|
||||
u4Byte cntIpsNotify;
|
||||
u4Byte cntLpsNotify;
|
||||
u4Byte cntScanNotify;
|
||||
u4Byte cntConnectNotify;
|
||||
u4Byte cntMediaStatusNotify;
|
||||
u4Byte cntSpecialPacketNotify;
|
||||
u4Byte cntBtInfoNotify;
|
||||
u4Byte cntPeriodical;
|
||||
u4Byte cntCoexDmSwitch;
|
||||
u4Byte cntStackOperationNotify;
|
||||
u4Byte cntDbgCtrl;
|
||||
} BTC_STATISTICS, *PBTC_STATISTICS;
|
||||
|
||||
typedef struct _BTC_COEXIST{
|
||||
BOOLEAN bBinded; // make sure only one adapter can bind the data context
|
||||
PVOID Adapter; // default adapter
|
||||
BTC_BOARD_INFO boardInfo;
|
||||
BTC_BT_INFO btInfo; // some bt info referenced by non-bt module
|
||||
BTC_STACK_INFO stackInfo;
|
||||
BTC_BT_LINK_INFO btLinkInfo;
|
||||
BTC_CHIP_INTERFACE chipInterface;
|
||||
|
||||
BOOLEAN bInitilized;
|
||||
BOOLEAN bStopCoexDm;
|
||||
BOOLEAN bManualControl;
|
||||
pu1Byte cliBuf;
|
||||
BTC_STATISTICS statistics;
|
||||
u1Byte pwrModeVal[10];
|
||||
|
||||
// function pointers
|
||||
// io related
|
||||
BFP_BTC_R1 fBtcRead1Byte;
|
||||
BFP_BTC_W1 fBtcWrite1Byte;
|
||||
BFP_BTC_W1_BIT_MASK fBtcWrite1ByteBitMask;
|
||||
BFP_BTC_R2 fBtcRead2Byte;
|
||||
BFP_BTC_W2 fBtcWrite2Byte;
|
||||
BFP_BTC_R4 fBtcRead4Byte;
|
||||
BFP_BTC_W4 fBtcWrite4Byte;
|
||||
// read/write bb related
|
||||
BFP_BTC_SET_BB_REG fBtcSetBbReg;
|
||||
BFP_BTC_GET_BB_REG fBtcGetBbReg;
|
||||
|
||||
// read/write rf related
|
||||
BFP_BTC_SET_RF_REG fBtcSetRfReg;
|
||||
BFP_BTC_GET_RF_REG fBtcGetRfReg;
|
||||
|
||||
// fill h2c related
|
||||
BFP_BTC_FILL_H2C fBtcFillH2c;
|
||||
// other
|
||||
BFP_BTC_DISP_DBG_MSG fBtcDispDbgMsg;
|
||||
// normal get/set related
|
||||
BFP_BTC_GET fBtcGet;
|
||||
BFP_BTC_SET fBtcSet;
|
||||
|
||||
BFP_BTC_GET_BT_REG fBtcGetBtReg;
|
||||
BFP_BTC_SET_BT_REG fBtcSetBtReg;
|
||||
} BTC_COEXIST, *PBTC_COEXIST;
|
||||
|
||||
extern BTC_COEXIST GLBtCoexist;
|
||||
|
||||
BOOLEAN
|
||||
EXhalbtcoutsrc_InitlizeVariables(
|
||||
IN PVOID Adapter
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_InitHwConfig(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN bWifiOnly
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_InitCoexDm(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_IpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_LpsNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_ScanNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_ConnectNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte action
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_MediaStatusNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN RT_MEDIA_STATUS mediaStatus
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_SpecialPacketNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pktType
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_BtInfoNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN pu1Byte tmpBuf,
|
||||
IN u1Byte length
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_StackOperationNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte type
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_HaltNotify(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_PnpNotify(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte pnpState
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_CoexDmSwitch(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN BOOLEAN antInverse
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_Periodical(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_DbgControl(
|
||||
IN PBTC_COEXIST pBtCoexist,
|
||||
IN u1Byte opCode,
|
||||
IN u1Byte opLen,
|
||||
IN pu1Byte pData
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_StackUpdateProfileInfo(
|
||||
VOID
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_SetHciVersion(
|
||||
IN u2Byte hciVersion
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_SetBtPatchVersion(
|
||||
IN u2Byte btHciVersion,
|
||||
IN u2Byte btPatchVersion
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_UpdateMinBtRssi(
|
||||
IN s1Byte btRssi
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_SetBtExist(
|
||||
IN BOOLEAN bBtExist
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_SetChipType(
|
||||
IN u1Byte chipType
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_SetAntNum(
|
||||
IN u1Byte type,
|
||||
IN u1Byte antNum,
|
||||
IN BOOLEAN antInverse
|
||||
);
|
||||
VOID
|
||||
EXhalbtcoutsrc_DisplayBtCoexInfo(
|
||||
IN PBTC_COEXIST pBtCoexist
|
||||
);
|
||||
|
||||
#endif
|
|
@ -0,0 +1,56 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Copyright(c) 2013 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 __MP_PRECOMP_H__
|
||||
#define __MP_PRECOMP_H__
|
||||
|
||||
#include <drv_types.h>
|
||||
#include <hal_data.h>
|
||||
|
||||
#define BT_TMP_BUF_SIZE 100
|
||||
|
||||
#ifdef PLATFORM_LINUX
|
||||
#define rsprintf snprintf
|
||||
#elif defined(PLATFORM_WINDOWS)
|
||||
#define rsprintf sprintf_s
|
||||
#endif
|
||||
|
||||
#define DCMD_Printf DBG_BT_INFO
|
||||
|
||||
#define delay_ms(ms) rtw_mdelay_os(ms)
|
||||
|
||||
#ifdef bEnable
|
||||
#undef bEnable
|
||||
#endif
|
||||
|
||||
#include "HalBtcOutSrc.h"
|
||||
#include "HalBtc8188c2Ant.h"
|
||||
#include "HalBtc8192d2Ant.h"
|
||||
#include "HalBtc8192e1Ant.h"
|
||||
#include "HalBtc8192e2Ant.h"
|
||||
#include "HalBtc8723a1Ant.h"
|
||||
#include "HalBtc8723a2Ant.h"
|
||||
#include "HalBtc8723b1Ant.h"
|
||||
#include "HalBtc8723b2Ant.h"
|
||||
#include "HalBtc8812a1Ant.h"
|
||||
#include "HalBtc8812a2Ant.h"
|
||||
#include "HalBtc8821a1Ant.h"
|
||||
#include "HalBtc8821a2Ant.h"
|
||||
|
||||
#endif // __MP_PRECOMP_H__
|
|
@ -0,0 +1,530 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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"
|
||||
|
||||
|
||||
#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) == 1)
|
||||
#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
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 __HAL_PHY_RF_H__
|
||||
#define __HAL_PHY_RF_H__
|
||||
|
||||
typedef enum _SPUR_CAL_METHOD {
|
||||
PLL_RESET,
|
||||
AFE_PHASE_SEL
|
||||
} SPUR_CAL_METHOD;
|
||||
|
||||
typedef enum _PWRTRACK_CONTROL_METHOD {
|
||||
BBSWING,
|
||||
TXAGC,
|
||||
MIX_MODE
|
||||
} PWRTRACK_METHOD;
|
||||
|
||||
typedef VOID (*FuncSetPwr)(PDM_ODM_T, PWRTRACK_METHOD, u1Byte, u1Byte);
|
||||
typedef VOID (*FuncIQK)(PDM_ODM_T, u1Byte, u1Byte, u1Byte);
|
||||
typedef VOID (*FuncLCK)(PDM_ODM_T);
|
||||
typedef VOID (*FuncSwing)(PDM_ODM_T, pu1Byte*, pu1Byte*, pu1Byte*, pu1Byte*);
|
||||
|
||||
typedef struct _TXPWRTRACK_CFG {
|
||||
u1Byte SwingTableSize_CCK;
|
||||
u1Byte SwingTableSize_OFDM;
|
||||
u1Byte Threshold_IQK;
|
||||
u1Byte AverageThermalNum;
|
||||
u1Byte RfPathCount;
|
||||
u4Byte ThermalRegAddr;
|
||||
FuncSetPwr ODM_TxPwrTrackSetPwr;
|
||||
FuncIQK DoIQK;
|
||||
FuncLCK PHY_LCCalibrate;
|
||||
FuncSwing GetDeltaSwingTable;
|
||||
} TXPWRTRACK_CFG, *PTXPWRTRACK_CFG;
|
||||
|
||||
void ConfigureTxpowerTrack(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PTXPWRTRACK_CFG pConfig
|
||||
);
|
||||
|
||||
|
||||
VOID
|
||||
ODM_ClearTxPowerTrackingState(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_TXPowerTrackingCallback_ThermalMeter(
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
#else
|
||||
IN PADAPTER Adapter
|
||||
#endif
|
||||
);
|
||||
|
||||
|
||||
|
||||
#define ODM_TARGET_CHNL_NUM_2G_5G 59
|
||||
|
||||
|
||||
VOID
|
||||
ODM_ResetIQKResult(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
u1Byte
|
||||
ODM_GetRightChnlPlaceforIQK(
|
||||
IN u1Byte chnl
|
||||
);
|
||||
|
||||
|
||||
#endif // #ifndef __HAL_PHY_RF_H__
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,136 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 __ODMANTDIV_H__
|
||||
#define __ODMANTDIV_H__
|
||||
|
||||
|
||||
|
||||
#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_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
|
||||
|
||||
VOID
|
||||
ODM_AntDivInit(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_AntDiv(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
|
||||
|
||||
VOID
|
||||
ODM_UpdateRxIdleAnt(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte Ant
|
||||
);
|
||||
|
||||
#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
|
||||
);
|
||||
#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
VOID
|
||||
ODM_SW_AntDiv_Callback(void *FunctionContext);
|
||||
#endif //#if (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
#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_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
|
||||
|
||||
#endif //#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
|
||||
#endif //#ifndef __ODMANTDIV_H__
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,231 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,57 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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_REGDEFINE11AC_H__
|
||||
#define __ODM_REGDEFINE11AC_H__
|
||||
|
||||
//2 RF REG LIST
|
||||
|
||||
|
||||
|
||||
//2 BB REG LIST
|
||||
//PAGE 8
|
||||
#define ODM_REG_CCK_RPT_FORMAT_11AC 0x804
|
||||
#define ODM_REG_BB_RX_PATH_11AC 0x808
|
||||
//PAGE 9
|
||||
#define ODM_REG_OFDM_FA_RST_11AC 0x9A4
|
||||
//PAGE A
|
||||
#define ODM_REG_CCK_CCA_11AC 0xA0A
|
||||
#define ODM_REG_CCK_FA_RST_11AC 0xA2C
|
||||
#define ODM_REG_CCK_FA_11AC 0xA5C
|
||||
//PAGE C
|
||||
#define ODM_REG_IGI_A_11AC 0xC50
|
||||
//PAGE E
|
||||
#define ODM_REG_IGI_B_11AC 0xE50
|
||||
//PAGE F
|
||||
#define ODM_REG_OFDM_FA_11AC 0xF48
|
||||
|
||||
|
||||
//2 MAC REG LIST
|
||||
#define ODM_REG_RESP_TX_11AC 0x6D8
|
||||
|
||||
|
||||
|
||||
//DIG Related
|
||||
#define ODM_BIT_IGI_11AC 0xFFFFFFFF
|
||||
#define ODM_BIT_CCK_RPT_FORMAT_11AC BIT16
|
||||
#define ODM_BIT_BB_RX_PATH_11AC 0xF
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,174 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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_REGDEFINE11N_H__
|
||||
#define __ODM_REGDEFINE11N_H__
|
||||
|
||||
|
||||
//2 RF REG LIST
|
||||
#define ODM_REG_RF_MODE_11N 0x00
|
||||
#define ODM_REG_RF_0B_11N 0x0B
|
||||
#define ODM_REG_CHNBW_11N 0x18
|
||||
#define ODM_REG_T_METER_11N 0x24
|
||||
#define ODM_REG_RF_25_11N 0x25
|
||||
#define ODM_REG_RF_26_11N 0x26
|
||||
#define ODM_REG_RF_27_11N 0x27
|
||||
#define ODM_REG_RF_2B_11N 0x2B
|
||||
#define ODM_REG_RF_2C_11N 0x2C
|
||||
#define ODM_REG_RXRF_A3_11N 0x3C
|
||||
#define ODM_REG_T_METER_92D_11N 0x42
|
||||
#define ODM_REG_T_METER_88E_11N 0x42
|
||||
|
||||
|
||||
|
||||
//2 BB REG LIST
|
||||
//PAGE 8
|
||||
#define ODM_REG_BB_CTRL_11N 0x800
|
||||
#define ODM_REG_RF_PIN_11N 0x804
|
||||
#define ODM_REG_PSD_CTRL_11N 0x808
|
||||
#define ODM_REG_TX_ANT_CTRL_11N 0x80C
|
||||
#define ODM_REG_BB_PWR_SAV5_11N 0x818
|
||||
#define ODM_REG_CCK_RPT_FORMAT_11N 0x824
|
||||
#define ODM_REG_RX_DEFUALT_A_11N 0x858
|
||||
#define ODM_REG_RX_DEFUALT_B_11N 0x85A
|
||||
#define ODM_REG_BB_PWR_SAV3_11N 0x85C
|
||||
#define ODM_REG_ANTSEL_CTRL_11N 0x860
|
||||
#define ODM_REG_RX_ANT_CTRL_11N 0x864
|
||||
#define ODM_REG_PIN_CTRL_11N 0x870
|
||||
#define ODM_REG_BB_PWR_SAV1_11N 0x874
|
||||
#define ODM_REG_ANTSEL_PATH_11N 0x878
|
||||
#define ODM_REG_BB_3WIRE_11N 0x88C
|
||||
#define ODM_REG_SC_CNT_11N 0x8C4
|
||||
#define ODM_REG_PSD_DATA_11N 0x8B4
|
||||
//PAGE 9
|
||||
#define ODM_REG_ANT_MAPPING1_11N 0x914
|
||||
#define ODM_REG_ANT_MAPPING2_11N 0x918
|
||||
//PAGE A
|
||||
#define ODM_REG_CCK_ANTDIV_PARA1_11N 0xA00
|
||||
#define ODM_REG_CCK_CCA_11N 0xA0A
|
||||
#define ODM_REG_CCK_ANTDIV_PARA2_11N 0xA0C
|
||||
#define ODM_REG_CCK_ANTDIV_PARA3_11N 0xA10
|
||||
#define ODM_REG_CCK_ANTDIV_PARA4_11N 0xA14
|
||||
#define ODM_REG_CCK_FILTER_PARA1_11N 0xA22
|
||||
#define ODM_REG_CCK_FILTER_PARA2_11N 0xA23
|
||||
#define ODM_REG_CCK_FILTER_PARA3_11N 0xA24
|
||||
#define ODM_REG_CCK_FILTER_PARA4_11N 0xA25
|
||||
#define ODM_REG_CCK_FILTER_PARA5_11N 0xA26
|
||||
#define ODM_REG_CCK_FILTER_PARA6_11N 0xA27
|
||||
#define ODM_REG_CCK_FILTER_PARA7_11N 0xA28
|
||||
#define ODM_REG_CCK_FILTER_PARA8_11N 0xA29
|
||||
#define ODM_REG_CCK_FA_RST_11N 0xA2C
|
||||
#define ODM_REG_CCK_FA_MSB_11N 0xA58
|
||||
#define ODM_REG_CCK_FA_LSB_11N 0xA5C
|
||||
#define ODM_REG_CCK_CCA_CNT_11N 0xA60
|
||||
#define ODM_REG_BB_PWR_SAV4_11N 0xA74
|
||||
//PAGE B
|
||||
#define ODM_REG_LNA_SWITCH_11N 0xB2C
|
||||
#define ODM_REG_PATH_SWITCH_11N 0xB30
|
||||
#define ODM_REG_RSSI_CTRL_11N 0xB38
|
||||
#define ODM_REG_CONFIG_ANTA_11N 0xB68
|
||||
#define ODM_REG_RSSI_BT_11N 0xB9C
|
||||
//PAGE C
|
||||
#define ODM_REG_OFDM_FA_HOLDC_11N 0xC00
|
||||
#define ODM_REG_BB_RX_PATH_11N 0xC04
|
||||
#define ODM_REG_TRMUX_11N 0xC08
|
||||
#define ODM_REG_OFDM_FA_RSTC_11N 0xC0C
|
||||
#define ODM_REG_RXIQI_MATRIX_11N 0xC14
|
||||
#define ODM_REG_TXIQK_MATRIX_LSB1_11N 0xC4C
|
||||
#define ODM_REG_IGI_A_11N 0xC50
|
||||
#define ODM_REG_ANTDIV_PARA2_11N 0xC54
|
||||
#define ODM_REG_IGI_B_11N 0xC58
|
||||
#define ODM_REG_ANTDIV_PARA3_11N 0xC5C
|
||||
#define ODM_REG_L1SBD_PD_CH_11N 0XC6C
|
||||
#define ODM_REG_BB_PWR_SAV2_11N 0xC70
|
||||
#define ODM_REG_RX_OFF_11N 0xC7C
|
||||
#define ODM_REG_TXIQK_MATRIXA_11N 0xC80
|
||||
#define ODM_REG_TXIQK_MATRIXB_11N 0xC88
|
||||
#define ODM_REG_TXIQK_MATRIXA_LSB2_11N 0xC94
|
||||
#define ODM_REG_TXIQK_MATRIXB_LSB2_11N 0xC9C
|
||||
#define ODM_REG_RXIQK_MATRIX_LSB_11N 0xCA0
|
||||
#define ODM_REG_ANTDIV_PARA1_11N 0xCA4
|
||||
#define ODM_REG_OFDM_FA_TYPE1_11N 0xCF0
|
||||
//PAGE D
|
||||
#define ODM_REG_OFDM_FA_RSTD_11N 0xD00
|
||||
#define ODM_REG_OFDM_FA_TYPE2_11N 0xDA0
|
||||
#define ODM_REG_OFDM_FA_TYPE3_11N 0xDA4
|
||||
#define ODM_REG_OFDM_FA_TYPE4_11N 0xDA8
|
||||
//PAGE E
|
||||
#define ODM_REG_TXAGC_A_6_18_11N 0xE00
|
||||
#define ODM_REG_TXAGC_A_24_54_11N 0xE04
|
||||
#define ODM_REG_TXAGC_A_1_MCS32_11N 0xE08
|
||||
#define ODM_REG_TXAGC_A_MCS0_3_11N 0xE10
|
||||
#define ODM_REG_TXAGC_A_MCS4_7_11N 0xE14
|
||||
#define ODM_REG_TXAGC_A_MCS8_11_11N 0xE18
|
||||
#define ODM_REG_TXAGC_A_MCS12_15_11N 0xE1C
|
||||
#define ODM_REG_FPGA0_IQK_11N 0xE28
|
||||
#define ODM_REG_TXIQK_TONE_A_11N 0xE30
|
||||
#define ODM_REG_RXIQK_TONE_A_11N 0xE34
|
||||
#define ODM_REG_TXIQK_PI_A_11N 0xE38
|
||||
#define ODM_REG_RXIQK_PI_A_11N 0xE3C
|
||||
#define ODM_REG_TXIQK_11N 0xE40
|
||||
#define ODM_REG_RXIQK_11N 0xE44
|
||||
#define ODM_REG_IQK_AGC_PTS_11N 0xE48
|
||||
#define ODM_REG_IQK_AGC_RSP_11N 0xE4C
|
||||
#define ODM_REG_BLUETOOTH_11N 0xE6C
|
||||
#define ODM_REG_RX_WAIT_CCA_11N 0xE70
|
||||
#define ODM_REG_TX_CCK_RFON_11N 0xE74
|
||||
#define ODM_REG_TX_CCK_BBON_11N 0xE78
|
||||
#define ODM_REG_OFDM_RFON_11N 0xE7C
|
||||
#define ODM_REG_OFDM_BBON_11N 0xE80
|
||||
#define ODM_REG_TX2RX_11N 0xE84
|
||||
#define ODM_REG_TX2TX_11N 0xE88
|
||||
#define ODM_REG_RX_CCK_11N 0xE8C
|
||||
#define ODM_REG_RX_OFDM_11N 0xED0
|
||||
#define ODM_REG_RX_WAIT_RIFS_11N 0xED4
|
||||
#define ODM_REG_RX2RX_11N 0xED8
|
||||
#define ODM_REG_STANDBY_11N 0xEDC
|
||||
#define ODM_REG_SLEEP_11N 0xEE0
|
||||
#define ODM_REG_PMPD_ANAEN_11N 0xEEC
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//2 MAC REG LIST
|
||||
#define ODM_REG_BB_RST_11N 0x02
|
||||
#define ODM_REG_ANTSEL_PIN_11N 0x4C
|
||||
#define ODM_REG_EARLY_MODE_11N 0x4D0
|
||||
#define ODM_REG_RSSI_MONITOR_11N 0x4FE
|
||||
#define ODM_REG_EDCA_VO_11N 0x500
|
||||
#define ODM_REG_EDCA_VI_11N 0x504
|
||||
#define ODM_REG_EDCA_BE_11N 0x508
|
||||
#define ODM_REG_EDCA_BK_11N 0x50C
|
||||
#define ODM_REG_TXPAUSE_11N 0x522
|
||||
#define ODM_REG_RESP_TX_11N 0x6D8
|
||||
#define ODM_REG_ANT_TRAIN_PARA1_11N 0x7b0
|
||||
#define ODM_REG_ANT_TRAIN_PARA2_11N 0x7b4
|
||||
|
||||
|
||||
//DIG Related
|
||||
#define ODM_BIT_IGI_11N 0x0000007F
|
||||
#define ODM_BIT_CCK_RPT_FORMAT_11N BIT9
|
||||
#define ODM_BIT_BB_RX_PATH_11N 0xF
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,629 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 "odm_precomp.h"
|
||||
|
||||
|
||||
VOID
|
||||
ODM_InitDebugSetting(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
pDM_Odm->DebugLevel = ODM_DBG_LOUD;
|
||||
|
||||
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_DYNAMIC_ATC |
|
||||
|
||||
//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 0
|
||||
/*------------------Declare variable-----------------------
|
||||
// Define debug flag array for common debug print macro. */
|
||||
u4Byte ODM_DBGP_Type[ODM_DBGP_TYPE_MAX];
|
||||
|
||||
/* Define debug print header for every service module. */
|
||||
ODM_DBGP_HEAD_T ODM_DBGP_Head;
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DBGP_Flag_Init
|
||||
*
|
||||
* Overview: Refresh all debug print control flag content to zero.
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 10/20/2006 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void ODM_DBGP_Flag_Init(void)
|
||||
{
|
||||
u1Byte i;
|
||||
|
||||
for (i = 0; i < ODM_DBGP_TYPE_MAX; i++)
|
||||
{
|
||||
ODM_DBGP_Type[i] = 0;
|
||||
}
|
||||
|
||||
#ifndef ADSL_AP_BUILD_WORKAROUND
|
||||
#if DBG
|
||||
// 2010/06/02 MH Free build driver can not out any debug message!!!
|
||||
// Init Debug flag enable condition
|
||||
|
||||
ODM_DBGP_Type[FINIT] = \
|
||||
// INIT_EEPROM |
|
||||
// INIT_TxPower |
|
||||
// INIT_IQK |
|
||||
// INIT_RF |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FDM] = \
|
||||
// WA_IOT |
|
||||
// DM_PWDB |
|
||||
// DM_Monitor |
|
||||
// DM_DIG |
|
||||
// DM_EDCA_Turbo |
|
||||
// DM_BT30 |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FIOCTL] = \
|
||||
// IOCTL_IRP |
|
||||
// IOCTL_IRP_DETAIL |
|
||||
// IOCTL_IRP_STATISTICS |
|
||||
// IOCTL_IRP_HANDLE |
|
||||
// IOCTL_BT_HCICMD |
|
||||
// IOCTL_BT_HCICMD_DETAIL |
|
||||
// IOCTL_BT_HCICMD_EXT |
|
||||
// IOCTL_BT_EVENT |
|
||||
// IOCTL_BT_EVENT_DETAIL |
|
||||
// IOCTL_BT_EVENT_PERIODICAL |
|
||||
// IOCTL_BT_TX_ACLDATA |
|
||||
// IOCTL_BT_TX_ACLDATA_DETAIL |
|
||||
// IOCTL_BT_RX_ACLDATA |
|
||||
// IOCTL_BT_RX_ACLDATA_DETAIL |
|
||||
// IOCTL_BT_TP |
|
||||
// IOCTL_STATE |
|
||||
// IOCTL_BT_LOGO |
|
||||
// IOCTL_CALLBACK_FUN |
|
||||
// IOCTL_PARSE_BT_PKT |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FBT] = \
|
||||
// BT_TRACE |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FEEPROM] = \
|
||||
// EEPROM_W |
|
||||
// EFUSE_PG |
|
||||
// EFUSE_READ_ALL |
|
||||
// EFUSE_ANALYSIS |
|
||||
// EFUSE_PG_DETAIL |
|
||||
0;
|
||||
|
||||
ODM_DBGP_Type[FDBG_CTRL] = \
|
||||
// DBG_CTRL_TRACE |
|
||||
// DBG_CTRL_INBAND_NOISE |
|
||||
0;
|
||||
|
||||
// 2011/07/20 MH Add for short cut
|
||||
ODM_DBGP_Type[FSHORT_CUT] = \
|
||||
// SHCUT_TX |
|
||||
// SHCUT_RX |
|
||||
0;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
/* Define debug header of every service module. */
|
||||
//ODM_DBGP_Head.pMANS = "\n\r[MANS] ";
|
||||
//ODM_DBGP_Head.pRTOS = "\n\r[RTOS] ";
|
||||
//ODM_DBGP_Head.pALM = "\n\r[ALM] ";
|
||||
//ODM_DBGP_Head.pPEM = "\n\r[PEM] ";
|
||||
//ODM_DBGP_Head.pCMPK = "\n\r[CMPK] ";
|
||||
//ODM_DBGP_Head.pRAPD = "\n\r[RAPD] ";
|
||||
//ODM_DBGP_Head.pTXPB = "\n\r[TXPB] ";
|
||||
//ODM_DBGP_Head.pQUMG = "\n\r[QUMG] ";
|
||||
|
||||
} /* DBGP_Flag_Init */
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
u4Byte GlobalDebugLevel = DBG_LOUD;
|
||||
//
|
||||
// 2009/06/22 MH Allow Fre build to print none debug info at init time.
|
||||
//
|
||||
#if DBG
|
||||
u8Byte GlobalDebugComponents = \
|
||||
// COMP_TRACE |
|
||||
// COMP_DBG |
|
||||
// COMP_INIT |
|
||||
// COMP_OID_QUERY |
|
||||
// COMP_OID_SET |
|
||||
// COMP_RECV |
|
||||
// COMP_SEND |
|
||||
// COMP_IO |
|
||||
// COMP_POWER |
|
||||
// COMP_MLME |
|
||||
// COMP_SCAN |
|
||||
// COMP_SYSTEM |
|
||||
// COMP_SEC |
|
||||
// COMP_AP |
|
||||
// COMP_TURBO |
|
||||
// COMP_QOS |
|
||||
// COMP_AUTHENTICATOR |
|
||||
// COMP_BEACON |
|
||||
// COMP_ANTENNA |
|
||||
// COMP_RATE |
|
||||
// COMP_EVENTS |
|
||||
// COMP_FPGA |
|
||||
// COMP_RM |
|
||||
// COMP_MP |
|
||||
// COMP_RXDESC |
|
||||
// COMP_CKIP |
|
||||
// COMP_DIG |
|
||||
// COMP_TXAGC |
|
||||
// COMP_HIPWR |
|
||||
// COMP_HALDM |
|
||||
// COMP_RSNA |
|
||||
// COMP_INDIC |
|
||||
// COMP_LED |
|
||||
// COMP_RF |
|
||||
// COMP_DUALMACSWITCH |
|
||||
// COMP_EASY_CONCURRENT |
|
||||
|
||||
//1!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//1//1Attention Please!!!<11n or 8190 specific code should be put below this line>
|
||||
//1!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
// COMP_HT |
|
||||
// COMP_POWER_TRACKING |
|
||||
// COMP_RX_REORDER |
|
||||
// COMP_AMSDU |
|
||||
// COMP_WPS |
|
||||
// COMP_RATR |
|
||||
// COMP_RESET |
|
||||
// COMP_CMD |
|
||||
// COMP_EFUSE |
|
||||
// COMP_MESH_INTERWORKING |
|
||||
// COMP_CCX |
|
||||
// COMP_IOCTL |
|
||||
// COMP_GP |
|
||||
// COMP_TXAGG |
|
||||
// COMP_BB_POWERSAVING |
|
||||
// COMP_SWAS |
|
||||
// COMP_P2P |
|
||||
// COMP_MUX |
|
||||
// COMP_FUNC |
|
||||
// COMP_TDLS |
|
||||
// COMP_OMNIPEEK |
|
||||
// COMP_PSD |
|
||||
0;
|
||||
|
||||
|
||||
#else
|
||||
u8Byte GlobalDebugComponents = 0;
|
||||
#endif
|
||||
|
||||
#if (RT_PLATFORM==PLATFORM_LINUX)
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0))
|
||||
EXPORT_SYMBOL(GlobalDebugComponents);
|
||||
EXPORT_SYMBOL(GlobalDebugLevel);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*------------------Declare variable-----------------------
|
||||
// Define debug flag array for common debug print macro. */
|
||||
u4Byte DBGP_Type[DBGP_TYPE_MAX];
|
||||
|
||||
/* Define debug print header for every service module. */
|
||||
DBGP_HEAD_T DBGP_Head;
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DBGP_Flag_Init
|
||||
*
|
||||
* Overview: Refresh all debug print control flag content to zero.
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 10/20/2006 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void DBGP_Flag_Init(void)
|
||||
{
|
||||
u1Byte i;
|
||||
|
||||
for (i = 0; i < DBGP_TYPE_MAX; i++)
|
||||
{
|
||||
DBGP_Type[i] = 0;
|
||||
}
|
||||
|
||||
#if DBG
|
||||
// 2010/06/02 MH Free build driver can not out any debug message!!!
|
||||
// Init Debug flag enable condition
|
||||
|
||||
DBGP_Type[FINIT] = \
|
||||
// INIT_EEPROM |
|
||||
// INIT_TxPower |
|
||||
// INIT_IQK |
|
||||
// INIT_RF |
|
||||
0;
|
||||
|
||||
DBGP_Type[FDM] = \
|
||||
// WA_IOT |
|
||||
// DM_PWDB |
|
||||
// DM_Monitor |
|
||||
// DM_DIG |
|
||||
// DM_EDCA_Turbo |
|
||||
// DM_BT30 |
|
||||
0;
|
||||
|
||||
DBGP_Type[FIOCTL] = \
|
||||
// IOCTL_IRP |
|
||||
// IOCTL_IRP_DETAIL |
|
||||
// IOCTL_IRP_STATISTICS |
|
||||
// IOCTL_IRP_HANDLE |
|
||||
// IOCTL_BT_HCICMD |
|
||||
// IOCTL_BT_HCICMD_DETAIL |
|
||||
// IOCTL_BT_HCICMD_EXT |
|
||||
// IOCTL_BT_EVENT |
|
||||
// IOCTL_BT_EVENT_DETAIL |
|
||||
// IOCTL_BT_EVENT_PERIODICAL |
|
||||
// IOCTL_BT_TX_ACLDATA |
|
||||
// IOCTL_BT_TX_ACLDATA_DETAIL |
|
||||
// IOCTL_BT_RX_ACLDATA |
|
||||
// IOCTL_BT_RX_ACLDATA_DETAIL |
|
||||
// IOCTL_BT_TP |
|
||||
// IOCTL_STATE |
|
||||
// IOCTL_BT_LOGO |
|
||||
// IOCTL_CALLBACK_FUN |
|
||||
// IOCTL_PARSE_BT_PKT |
|
||||
0;
|
||||
|
||||
DBGP_Type[FBT] = \
|
||||
// BT_TRACE |
|
||||
0;
|
||||
|
||||
DBGP_Type[FEEPROM] = \
|
||||
// EEPROM_W |
|
||||
// EFUSE_PG |
|
||||
// EFUSE_READ_ALL |
|
||||
// EFUSE_ANALYSIS |
|
||||
// EFUSE_PG_DETAIL |
|
||||
0;
|
||||
|
||||
DBGP_Type[FDBG_CTRL] = \
|
||||
// DBG_CTRL_TRACE |
|
||||
// DBG_CTRL_INBAND_NOISE |
|
||||
0;
|
||||
|
||||
// 2011/07/20 MH Add for short cut
|
||||
DBGP_Type[FSHORT_CUT] = \
|
||||
// SHCUT_TX |
|
||||
// SHCUT_RX |
|
||||
0;
|
||||
|
||||
#endif
|
||||
/* Define debug header of every service module. */
|
||||
DBGP_Head.pMANS = "\n\r[MANS] ";
|
||||
DBGP_Head.pRTOS = "\n\r[RTOS] ";
|
||||
DBGP_Head.pALM = "\n\r[ALM] ";
|
||||
DBGP_Head.pPEM = "\n\r[PEM] ";
|
||||
DBGP_Head.pCMPK = "\n\r[CMPK] ";
|
||||
DBGP_Head.pRAPD = "\n\r[RAPD] ";
|
||||
DBGP_Head.pTXPB = "\n\r[TXPB] ";
|
||||
DBGP_Head.pQUMG = "\n\r[QUMG] ";
|
||||
|
||||
} /* DBGP_Flag_Init */
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DBG_PrintAllFlag
|
||||
*
|
||||
* Overview: Print All debug flag
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 12/10/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void DBG_PrintAllFlag(void)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 0 FQoS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 1 FTX\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 2 FRX\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 3 FSEC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 4 FMGNT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 5 FMLME\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 6 FRESOURCE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 7 FBEACON\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 8 FISR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 9 FPHY\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 11 FMP\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 12 FPWR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 13 FDM\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 14 FDBG_CTRL\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 15 FC2H\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("DBGFLAG 16 FBT\n"));
|
||||
} // DBG_PrintAllFlag
|
||||
|
||||
|
||||
extern void DBG_PrintAllComp(void)
|
||||
{
|
||||
u1Byte i;
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("GlobalDebugComponents Definition\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT0 COMP_TRACE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT1 COMP_DBG\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT2 COMP_INIT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT3 COMP_OID_QUERY\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT4 COMP_OID_SET\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT5 COMP_RECV\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT6 COMP_SEND\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT7 COMP_IO\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT8 COMP_POWER\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT9 COMP_MLME\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT10 COMP_SCAN\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT11 COMP_SYSTEM\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT12 COMP_SEC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT13 COMP_AP\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT14 COMP_TURBO\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT15 COMP_QOS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT16 COMP_AUTHENTICATOR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT17 COMP_BEACON\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT18 COMP_BEACON\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT19 COMP_RATE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT20 COMP_EVENTS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT21 COMP_FPGA\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT22 COMP_RM\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT23 COMP_MP\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT24 COMP_RXDESC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT25 COMP_CKIP\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT26 COMP_DIG\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT27 COMP_TXAGC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT28 COMP_HIPWR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT29 COMP_HALDM\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT30 COMP_RSNA\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT31 COMP_INDIC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT32 COMP_LED\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT33 COMP_RF\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT34 COMP_HT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT35 COMP_POWER_TRACKING\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT36 COMP_POWER_TRACKING\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT37 COMP_AMSDU\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT38 COMP_WPS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT39 COMP_RATR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT40 COMP_RESET\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT41 COMP_CMD\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT42 COMP_EFUSE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT43 COMP_MESH_INTERWORKING\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT43 COMP_CCX\n"));
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("GlobalDebugComponents = %"i64fmt"x\n", GlobalDebugComponents));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("Enable DBG COMP ="));
|
||||
for (i = 0; i < 64; i++)
|
||||
{
|
||||
if (GlobalDebugComponents & ((u8Byte)0x1 << i) )
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT%02d |\n", i));
|
||||
}
|
||||
}
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("\n"));
|
||||
|
||||
} // DBG_PrintAllComp
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Function: DBG_PrintFlagEvent
|
||||
*
|
||||
* Overview: Print dedicated debug flag event
|
||||
*
|
||||
* Input: NONE
|
||||
*
|
||||
* Output: NONE
|
||||
*
|
||||
* Return: NONE
|
||||
*
|
||||
* Revised History:
|
||||
* When Who Remark
|
||||
* 12/10/2008 MHC Create Version 0.
|
||||
*
|
||||
*---------------------------------------------------------------------------*/
|
||||
extern void DBG_PrintFlagEvent(u1Byte DbgFlag)
|
||||
{
|
||||
switch(DbgFlag)
|
||||
{
|
||||
case FQoS:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 QoS_INIT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 QoS_VISTA\n"));
|
||||
break;
|
||||
|
||||
case FTX:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 TX_DESC\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 TX_DESC_TID\n"));
|
||||
break;
|
||||
|
||||
case FRX:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 RX_DATA\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 RX_PHY_STS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 RX_PHY_SS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 RX_PHY_SQ\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 RX_PHY_ASTS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 5 RX_ERR_LEN\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 6 RX_DEFRAG\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 7 RX_ERR_RATE\n"));
|
||||
break;
|
||||
|
||||
case FSEC:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("NA\n"));
|
||||
break;
|
||||
|
||||
case FMGNT:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("NA\n"));
|
||||
break;
|
||||
|
||||
case FMLME:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 MEDIA_STS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 LINK_STS\n"));
|
||||
break;
|
||||
|
||||
case FRESOURCE:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 OS_CHK\n"));
|
||||
break;
|
||||
|
||||
case FBEACON:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 BCN_SHOW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 BCN_PEER\n"));
|
||||
break;
|
||||
|
||||
case FISR:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 ISR_CHK\n"));
|
||||
break;
|
||||
|
||||
case FPHY:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 PHY_BBR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 PHY_BBW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 PHY_RFR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 PHY_RFW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 PHY_MACR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 5 PHY_MACW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 6 PHY_ALLR\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 7 PHY_ALLW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 8 PHY_TXPWR\n"));
|
||||
break;
|
||||
|
||||
case FMP:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 MP_RX\n"));
|
||||
break;
|
||||
|
||||
case FEEPROM:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 EEPROM_W\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 EFUSE_PG\n"));
|
||||
break;
|
||||
|
||||
case FPWR:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 LPS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 IPS\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 PWRSW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 PWRHW\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 4 PWRHAL\n"));
|
||||
break;
|
||||
|
||||
case FDM:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 WA_IOT\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 DM_PWDB\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 DM_Monitor\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 3 DM_DIG\n"));
|
||||
break;
|
||||
|
||||
case FDBG_CTRL:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 DBG_CTRL_TRACE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 DBG_CTRL_INBAND_NOISE\n"));
|
||||
break;
|
||||
|
||||
case FC2H:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 C2H_Summary\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 C2H_PacketData\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 2 C2H_ContentData\n"));
|
||||
break;
|
||||
|
||||
case FBT:
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 0 BT_TRACE\n"));
|
||||
ODM_RT_TRACE(pDM_Odm,COMP_CMD, DBG_LOUD, ("BIT 1 BT_RFPoll\n"));
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
} // DBG_PrintFlagEvent
|
||||
|
||||
|
||||
extern void DBG_DumpMem(const u1Byte DbgComp,
|
||||
const u1Byte DbgLevel,
|
||||
pu1Byte pMem,
|
||||
u2Byte Len)
|
||||
{
|
||||
u2Byte i;
|
||||
|
||||
for (i=0;i<((Len>>3) + 1);i++)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm,DbgComp, DbgLevel, ("%02X %02X %02X %02X %02X %02X %02X %02X\n",
|
||||
*(pMem+(i*8)), *(pMem+(i*8+1)), *(pMem+(i*8+2)), *(pMem+(i*8+3)),
|
||||
*(pMem+(i*8+4)), *(pMem+(i*8+5)), *(pMem+(i*8+6)), *(pMem+(i*8+7))));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,892 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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_DBG_H__
|
||||
#define __ODM_DBG_H__
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the debug levels
|
||||
//
|
||||
// 1. DBG_TRACE and DBG_LOUD are used for normal cases.
|
||||
// So that, they can help SW engineer to develope or trace states changed
|
||||
// and also help HW enginner to trace every operation to and from HW,
|
||||
// e.g IO, Tx, Rx.
|
||||
//
|
||||
// 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases,
|
||||
// which help us to debug SW or HW.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Never used in a call to ODM_RT_TRACE()!
|
||||
//
|
||||
#define ODM_DBG_OFF 1
|
||||
|
||||
//
|
||||
// Fatal bug.
|
||||
// For example, Tx/Rx/IO locked up, OS hangs, memory access violation,
|
||||
// resource allocation failed, unexpected HW behavior, HW BUG and so on.
|
||||
//
|
||||
#define ODM_DBG_SERIOUS 2
|
||||
|
||||
//
|
||||
// Abnormal, rare, or unexpeted cases.
|
||||
// For example, IRP/Packet/OID canceled, device suprisely unremoved and so on.
|
||||
//
|
||||
#define ODM_DBG_WARNING 3
|
||||
|
||||
//
|
||||
// Normal case with useful information about current SW or HW state.
|
||||
// For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status,
|
||||
// SW protocol state change, dynamic mechanism state change and so on.
|
||||
//
|
||||
#define ODM_DBG_LOUD 4
|
||||
|
||||
//
|
||||
// Normal case with detail execution flow or information.
|
||||
//
|
||||
#define ODM_DBG_TRACE 5
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the tracing components
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
//BB Functions
|
||||
#define ODM_COMP_DIG BIT0
|
||||
#define ODM_COMP_RA_MASK BIT1
|
||||
#define ODM_COMP_DYNAMIC_TXPWR BIT2
|
||||
#define ODM_COMP_FA_CNT BIT3
|
||||
#define ODM_COMP_RSSI_MONITOR BIT4
|
||||
#define ODM_COMP_CCK_PD BIT5
|
||||
#define ODM_COMP_ANT_DIV BIT6
|
||||
#define ODM_COMP_PWR_SAVE BIT7
|
||||
#define ODM_COMP_PWR_TRAIN BIT8
|
||||
#define ODM_COMP_RATE_ADAPTIVE BIT9
|
||||
#define ODM_COMP_PATH_DIV BIT10
|
||||
#define ODM_COMP_PSD BIT11
|
||||
#define ODM_COMP_DYNAMIC_PRICCA BIT12
|
||||
#define ODM_COMP_RXHP BIT13
|
||||
#define ODM_COMP_MP BIT14
|
||||
#define ODM_COMP_DYNAMIC_ATC BIT15
|
||||
//MAC Functions
|
||||
#define ODM_COMP_EDCA_TURBO BIT16
|
||||
#define ODM_COMP_EARLY_MODE BIT17
|
||||
//RF Functions
|
||||
#define ODM_COMP_TX_PWR_TRACK BIT24
|
||||
#define ODM_COMP_RX_GAIN_TRACK BIT25
|
||||
#define ODM_COMP_CALIBRATION BIT26
|
||||
//Common Functions
|
||||
#define ODM_COMP_COMMON BIT30
|
||||
#define ODM_COMP_INIT BIT31
|
||||
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
#define RT_PRINTK DbgPrint
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
#define DbgPrint printk
|
||||
#define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args);
|
||||
#define RT_DISP(dbgtype, dbgflag, printstr)
|
||||
#else
|
||||
#define DbgPrint panic_printk
|
||||
#define RT_PRINTK(fmt, args...) DbgPrint( "%s(): " fmt, __FUNCTION__, ## args);
|
||||
#endif
|
||||
|
||||
#ifndef ASSERT
|
||||
#define ASSERT(expr)
|
||||
#endif
|
||||
|
||||
#if DBG
|
||||
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \
|
||||
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel || level == ODM_DBG_SERIOUS)) \
|
||||
{ \
|
||||
RT_PRINTK fmt; \
|
||||
}
|
||||
|
||||
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt) \
|
||||
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
|
||||
{ \
|
||||
RT_PRINTK fmt; \
|
||||
}
|
||||
|
||||
#define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \
|
||||
if(!(expr)) { \
|
||||
DbgPrint( "Assertion failed! %s at ......\n", #expr); \
|
||||
DbgPrint( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
|
||||
RT_PRINTK fmt; \
|
||||
ASSERT(FALSE); \
|
||||
}
|
||||
#define ODM_dbg_enter() { DbgPrint("==> %s\n", __FUNCTION__); }
|
||||
#define ODM_dbg_exit() { DbgPrint("<== %s\n", __FUNCTION__); }
|
||||
#define ODM_dbg_trace(str) { DbgPrint("%s:%s\n", __FUNCTION__, str); }
|
||||
|
||||
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr) \
|
||||
if(((comp) & pDM_Odm->DebugComponents) && (level <= pDM_Odm->DebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte __ptr = (pu1Byte)ptr; \
|
||||
DbgPrint("[ODM] "); \
|
||||
DbgPrint(title_str); \
|
||||
DbgPrint(" "); \
|
||||
for( __i=0; __i<6; __i++ ) \
|
||||
DbgPrint("%02X%s", __ptr[__i], (__i==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
#else
|
||||
#define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)
|
||||
#define ODM_RT_TRACE_F(pDM_Odm, comp, level, fmt)
|
||||
#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)
|
||||
#define ODM_dbg_enter()
|
||||
#define ODM_dbg_exit()
|
||||
#define ODM_dbg_trace(str)
|
||||
#define ODM_PRINT_ADDR(pDM_Odm, comp, level, title_str, ptr)
|
||||
#endif
|
||||
|
||||
|
||||
VOID
|
||||
ODM_InitDebugSetting(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
|
||||
|
||||
#if 0
|
||||
#if DBG
|
||||
#define DbgPrint printk
|
||||
|
||||
#define PRINT_DATA(_TitleString, _HexData, _HexDataLen) \
|
||||
{ \
|
||||
char *szTitle = _TitleString; \
|
||||
pu1Byte pbtHexData = _HexData; \
|
||||
u4Byte u4bHexDataLen = _HexDataLen; \
|
||||
u4Byte __i; \
|
||||
DbgPrint("%s", szTitle); \
|
||||
for (__i=0;__i<u4bHexDataLen;__i++) \
|
||||
{ \
|
||||
if ((__i & 15) == 0) \
|
||||
{ \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
DbgPrint("%02X%s", pbtHexData[__i], ( ((__i&3)==3) ? " " : " ") ); \
|
||||
} \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
// RT_PRINT_XXX macros: implemented for debugging purpose.
|
||||
// Added by Annie, 2005-11-21.
|
||||
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
|
||||
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_HexData; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
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"); \
|
||||
}
|
||||
|
||||
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr) \
|
||||
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint(" "); \
|
||||
for( __i=0; __i<6; __i++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum) \
|
||||
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i, __j; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint("\n"); \
|
||||
for( __i=0; __i<(int)_AddNum; __i++ ) \
|
||||
{ \
|
||||
for( __j=0; __j<6; __j++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i*6+__j], (__j==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
// Added by Annie, 2005-11-22.
|
||||
#define MAX_STR_LEN 64
|
||||
#define PRINTABLE(_ch) (_ch>=' ' &&_ch<='~' ) // I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.
|
||||
|
||||
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) \
|
||||
if(((_Comp) & ODM_GlobalDebugComponents) && (_Level <= ODM_GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
u1Byte buffer[MAX_STR_LEN]; \
|
||||
int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
|
||||
PlatformZeroMemory( buffer, MAX_STR_LEN ); \
|
||||
PlatformMoveMemory( buffer, (pu1Byte)_Ptr, length ); \
|
||||
for( __i=0; __i<MAX_STR_LEN; __i++ ) \
|
||||
{ \
|
||||
if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
|
||||
} \
|
||||
buffer[length] = '\0'; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint(": %d, <%s>\n", _Len, buffer); \
|
||||
}
|
||||
|
||||
#else // of #if DBG
|
||||
#define DbgPrint(...)
|
||||
#define PRINT_DATA(_TitleString, _HexData, _HexDataLen)
|
||||
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen)
|
||||
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr)
|
||||
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum)
|
||||
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len)
|
||||
#endif // of #if DBG
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if 0
|
||||
/* Define debug print header for every service module.*/
|
||||
typedef struct tag_ODM_DBGP_Service_Module_Header_Name_Structure
|
||||
{
|
||||
const char *pMANS;
|
||||
const char *pRTOS;
|
||||
const char *pALM;
|
||||
const char *pPEM;
|
||||
const char *pCMPK;
|
||||
const char *pRAPD;
|
||||
const char *pTXPB;
|
||||
const char *pQUMG;
|
||||
}ODM_DBGP_HEAD_T;
|
||||
|
||||
|
||||
/* Define different debug flag for dedicated service modules in debug flag array. */
|
||||
// Each module has independt 32 bit debug flag you cnn define the flag as yout require.
|
||||
typedef enum tag_ODM_DBGP_Flag_Type_Definition
|
||||
{
|
||||
ODM_FTX = 0,
|
||||
ODM_FRX ,
|
||||
ODM_FPHY ,
|
||||
ODM_FPWR ,
|
||||
ODM_FDM ,
|
||||
ODM_FC2H ,
|
||||
ODM_FBT ,
|
||||
ODM_DBGP_TYPE_MAX
|
||||
}ODM_DBGP_FLAG_E;
|
||||
|
||||
|
||||
// Define TX relative debug bit --> FTX
|
||||
#define ODM_TX_DESC BIT0
|
||||
#define ODM_TX_DESC_TID BIT1
|
||||
#define ODM_TX_PATH BIT2
|
||||
|
||||
// Define RX relative debug bit --> FRX
|
||||
#define ODM_RX_DATA BIT0
|
||||
#define ODM_RX_PHY_STS BIT1
|
||||
#define ODM_RX_PHY_SS BIT2
|
||||
#define ODM_RX_PHY_SQ BIT3
|
||||
#define ODM_RX_PHY_ASTS BIT4
|
||||
#define ODM_RX_ERR_LEN BIT5
|
||||
#define ODM_RX_DEFRAG BIT6
|
||||
#define ODM_RX_ERR_RATE BIT7
|
||||
#define ODM_RX_PATH BIT8
|
||||
#define ODM_RX_BEACON BIT9
|
||||
|
||||
// Define PHY-BB/RF/MAC check module bit --> FPHY
|
||||
#define ODM_PHY_BBR BIT0
|
||||
#define ODM_PHY_BBW BIT1
|
||||
#define ODM_PHY_RFR BIT2
|
||||
#define ODM_PHY_RFW BIT3
|
||||
#define ODM_PHY_MACR BIT4
|
||||
#define ODM_PHY_MACW BIT5
|
||||
#define ODM_PHY_ALLR BIT6
|
||||
#define ODM_PHY_ALLW BIT7
|
||||
#define ODM_PHY_TXPWR BIT8
|
||||
#define ODM_PHY_PWRDIFF BIT9
|
||||
#define ODM_PHY_SICR BIT10
|
||||
#define ODM_PHY_SICW BIT11
|
||||
|
||||
|
||||
|
||||
|
||||
extern u4Byte ODM_GlobalDebugLevel;
|
||||
|
||||
|
||||
#if DBG
|
||||
extern u8Byte ODM_GlobalDebugComponents;
|
||||
#endif
|
||||
#endif
|
||||
#if 0
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the debug levels
|
||||
//
|
||||
// 1. DBG_TRACE and DBG_LOUD are used for normal cases.
|
||||
// So that, they can help SW engineer to develope or trace states changed
|
||||
// and also help HW enginner to trace every operation to and from HW,
|
||||
// e.g IO, Tx, Rx.
|
||||
//
|
||||
// 2. DBG_WARNNING and DBG_SERIOUS are used for unusual or error cases,
|
||||
// which help us to debug SW or HW.
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// Never used in a call to ODM_RT_TRACE(pDM_Odm,)!
|
||||
//
|
||||
#define DBG_OFF 0
|
||||
|
||||
//
|
||||
// Deprecated! Don't use it!
|
||||
// TODO: fix related debug message!
|
||||
//
|
||||
//#define DBG_SEC 1
|
||||
|
||||
//
|
||||
// Fatal bug.
|
||||
// For example, Tx/Rx/IO locked up, OS hangs, memory access violation,
|
||||
// resource allocation failed, unexpected HW behavior, HW BUG and so on.
|
||||
//
|
||||
#define DBG_SERIOUS 2
|
||||
|
||||
//
|
||||
// Abnormal, rare, or unexpeted cases.
|
||||
// For example, IRP/Packet/OID canceled, device suprisely unremoved and so on.
|
||||
//
|
||||
#define DBG_WARNING 3
|
||||
|
||||
//
|
||||
// Normal case with useful information about current SW or HW state.
|
||||
// For example, Tx/Rx descriptor to fill, Tx/Rx descriptor completed status,
|
||||
// SW protocol state change, dynamic mechanism state change and so on.
|
||||
//
|
||||
#define DBG_LOUD 4
|
||||
|
||||
//
|
||||
// Normal case with detail execution flow or information.
|
||||
//
|
||||
#define DBG_TRACE 5
|
||||
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Define the tracing components
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
#define COMP_TRACE BIT0 // For function call tracing.
|
||||
#define COMP_DBG BIT1 // Only for temporary debug message.
|
||||
#define COMP_INIT BIT2 // during driver initialization / halt / reset.
|
||||
#define COMP_OID_QUERY BIT3 // Query OID.
|
||||
#define COMP_OID_SET BIT4 // Set OID.
|
||||
#define COMP_RECV BIT5 // Reveive part data path.
|
||||
#define COMP_SEND BIT6 // Send part path.
|
||||
#define COMP_IO BIT7 // I/O Related. Added by Annie, 2006-03-02.
|
||||
#define COMP_POWER BIT8 // 802.11 Power Save mode or System/Device Power state related.
|
||||
#define COMP_MLME BIT9 // 802.11 link related: join/start BSS, leave BSS.
|
||||
#define COMP_SCAN BIT10 // For site survey.
|
||||
#define COMP_SYSTEM BIT11 // For general platform function.
|
||||
#define COMP_SEC BIT12 // For Security.
|
||||
#define COMP_AP BIT13 // For AP mode related.
|
||||
#define COMP_TURBO BIT14 // For Turbo Mode related. By Annie, 2005-10-21.
|
||||
#define COMP_QOS BIT15 // For QoS.
|
||||
#define COMP_AUTHENTICATOR BIT16 // For AP mode Authenticator. Added by Annie, 2006-01-30.
|
||||
#define COMP_BEACON BIT17 // For Beacon related, by rcnjko.
|
||||
#define COMP_ANTENNA BIT18 // For Antenna diversity related, by rcnjko.
|
||||
#define COMP_RATE BIT19 // For Rate Adaptive mechanism, 2006.07.02, by rcnjko. #define COMP_EVENTS 0x00000080 // Event handling
|
||||
#define COMP_EVENTS BIT20 // Event handling
|
||||
#define COMP_FPGA BIT21 // For FPGA verfication
|
||||
#define COMP_RM BIT22 // For Radio Measurement.
|
||||
#define COMP_MP BIT23 // For mass production test, by shien chang, 2006.07.13
|
||||
#define COMP_RXDESC BIT24 // Show Rx desc information for SD3 debug. Added by Annie, 2006-07-15.
|
||||
#define COMP_CKIP BIT25 // For CCX 1 S13: CKIP. Added by Annie, 2006-08-14.
|
||||
#define COMP_DIG BIT26 // For DIG, 2006.09.25, by rcnjko.
|
||||
#define COMP_TXAGC BIT27 // For Tx power, 060928, by rcnjko.
|
||||
#define COMP_HIPWR BIT28 // For High Power Mechanism, 060928, by rcnjko.
|
||||
#define COMP_HALDM BIT29 // For HW Dynamic Mechanism, 061010, by rcnjko.
|
||||
#define COMP_RSNA BIT30 // For RSNA IBSS , 061201, by CCW.
|
||||
#define COMP_INDIC BIT31 // For link indication
|
||||
#define COMP_LED BIT32 // For LED.
|
||||
#define COMP_RF BIT33 // For RF.
|
||||
//1!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//1//1Attention Please!!!<11n or 8190 specific code should be put below this line>
|
||||
//1!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
#define COMP_HT BIT34 // For 802.11n HT related information. by Emily 2006-8-11
|
||||
#define COMP_POWER_TRACKING BIT35 //FOR 8190 TX POWER TRACKING
|
||||
#define COMP_RX_REORDER BIT36 // 8190 Rx Reorder
|
||||
#define COMP_AMSDU BIT37 // For A-MSDU Debugging
|
||||
#define COMP_WPS BIT38 //WPS Debug Message
|
||||
#define COMP_RATR BIT39
|
||||
#define COMP_RESET BIT40
|
||||
// For debug command to print on dbgview!!
|
||||
#define COMP_CMD BIT41
|
||||
#define COMP_EFUSE BIT42
|
||||
#define COMP_MESH_INTERWORKING BIT43
|
||||
#define COMP_CCX BIT44 //CCX Debug Flag
|
||||
#define COMP_IOCTL BIT45 // IO Control
|
||||
#define COMP_GP BIT46 // For generic parser.
|
||||
#define COMP_TXAGG BIT47
|
||||
#define COMP_HVL BIT48 // For Ndis 6.2 Context Swirch and Hardware Virtualiztion Layer
|
||||
#define COMP_TEST BIT49
|
||||
#define COMP_BB_POWERSAVING BIT50
|
||||
#define COMP_SWAS BIT51 // For SW Antenna Switch
|
||||
#define COMP_P2P BIT52
|
||||
#define COMP_MUX BIT53
|
||||
#define COMP_FUNC BIT54
|
||||
#define COMP_TDLS BIT55
|
||||
#define COMP_OMNIPEEK BIT56
|
||||
#define COMP_DUALMACSWITCH BIT60 // 2010/12/27 Add for Dual mac mode debug
|
||||
#define COMP_EASY_CONCURRENT BIT61 // 2010/12/27 Add for easy cncurrent mode debug
|
||||
#define COMP_PSD BIT63 //2011/3/9 Add for WLAN PSD for BT AFH
|
||||
|
||||
#define COMP_DFS BIT62
|
||||
|
||||
#define COMP_ALL UINT64_C(0xFFFFFFFFFFFFFFFF) // All components
|
||||
// For debug print flag to use
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
/* 2007/07/13 MH *//*------For DeBuG Print modeue------*/
|
||||
|
||||
/* Defnie structure to store different debug flag variable. Every debug flag
|
||||
is a UINT32 integer and you can assign 32 different events. */
|
||||
typedef struct tag_DBGP_Debug_Flag_Structure
|
||||
{
|
||||
u4Byte Mans; /* Main Scheduler module. */
|
||||
u4Byte Rtos; /* RTOS module. */
|
||||
u4Byte Alarm; /* Alarm module. */
|
||||
u4Byte Pm; /* Performance monitor module. */
|
||||
}DBGP_FLAG_T;
|
||||
|
||||
/* Define debug print header for every service module.*/
|
||||
typedef struct tag_DBGP_Service_Module_Header_Name_Structure
|
||||
{
|
||||
const char *pMANS;
|
||||
const char *pRTOS;
|
||||
const char *pALM;
|
||||
const char *pPEM;
|
||||
const char *pCMPK;
|
||||
const char *pRAPD;
|
||||
const char *pTXPB;
|
||||
const char *pQUMG;
|
||||
}DBGP_HEAD_T;
|
||||
|
||||
|
||||
/* Define different debug flag for dedicated service modules in debug flag array. */
|
||||
// Each module has independt 32 bit debug flag you cnn define the flag as yout require.
|
||||
typedef enum tag_DBGP_Flag_Type_Definition
|
||||
{
|
||||
FQoS = 0,
|
||||
FTX = 1,
|
||||
FRX = 2,
|
||||
FSEC = 3,
|
||||
FMGNT = 4,
|
||||
FMLME = 5,
|
||||
FRESOURCE = 6,
|
||||
FBEACON = 7,
|
||||
FISR = 8,
|
||||
FPHY = 9,
|
||||
FMP = 10,
|
||||
FEEPROM = 11,
|
||||
FPWR = 12,
|
||||
FDM = 13,
|
||||
FDBG_CTRL = 14,
|
||||
FC2H = 15,
|
||||
FBT = 16,
|
||||
FINIT = 17,
|
||||
FIOCTL = 18,
|
||||
FSHORT_CUT = 19,
|
||||
DBGP_TYPE_MAX
|
||||
}DBGP_FLAG_E;
|
||||
|
||||
|
||||
// Define Qos Relative debug flag bit --> FQoS
|
||||
#define QoS_INIT BIT0
|
||||
#define QoS_VISTA BIT1
|
||||
|
||||
// Define TX relative debug bit --> FTX
|
||||
#define TX_DESC BIT0
|
||||
#define TX_DESC_TID BIT1
|
||||
#define TX_PATH BIT2
|
||||
|
||||
// Define RX relative debug bit --> FRX
|
||||
#define RX_DATA BIT0
|
||||
#define RX_PHY_STS BIT1
|
||||
#define RX_PHY_SS BIT2
|
||||
#define RX_PHY_SQ BIT3
|
||||
#define RX_PHY_ASTS BIT4
|
||||
#define RX_ERR_LEN BIT5
|
||||
#define RX_DEFRAG BIT6
|
||||
#define RX_ERR_RATE BIT7
|
||||
#define RX_PATH BIT8
|
||||
#define RX_BEACON BIT9
|
||||
|
||||
// Define Security relative debug bit --> FSEC
|
||||
|
||||
// Define MGNT relative debug bit --> FMGNT
|
||||
|
||||
// Define MLME relative debug bit --> FMLME
|
||||
#define MEDIA_STS BIT0
|
||||
#define LINK_STS BIT1
|
||||
|
||||
// Define OS resource check module bit --> FRESOURCE
|
||||
#define OS_CHK BIT0
|
||||
|
||||
// Define beacon content check module bit --> FBEACON
|
||||
#define BCN_SHOW BIT0
|
||||
#define BCN_PEER BIT1
|
||||
|
||||
// Define ISR/IMR check module bit --> FISR
|
||||
#define ISR_CHK BIT0
|
||||
|
||||
// Define PHY-BB/RF/MAC check module bit --> FPHY
|
||||
#define PHY_BBR BIT0
|
||||
#define PHY_BBW BIT1
|
||||
#define PHY_RFR BIT2
|
||||
#define PHY_RFW BIT3
|
||||
#define PHY_MACR BIT4
|
||||
#define PHY_MACW BIT5
|
||||
#define PHY_ALLR BIT6
|
||||
#define PHY_ALLW BIT7
|
||||
#define PHY_TXPWR BIT8
|
||||
#define PHY_PWRDIFF BIT9
|
||||
#define PHY_SICR BIT10
|
||||
#define PHY_SICW BIT11
|
||||
|
||||
// Define MPT driver check module bit --> FMP
|
||||
#define MP_RX BIT0
|
||||
#define MP_SWICH_CH BIT1
|
||||
|
||||
// Define EEPROM and EFUSE check module bit --> FEEPROM
|
||||
#define EEPROM_W BIT0
|
||||
#define EFUSE_PG BIT1
|
||||
#define EFUSE_READ_ALL BIT2
|
||||
#define EFUSE_ANALYSIS BIT3
|
||||
#define EFUSE_PG_DETAIL BIT4
|
||||
|
||||
// Define power save check module bit --> FPWR
|
||||
#define LPS BIT0
|
||||
#define IPS BIT1
|
||||
#define PWRSW BIT2
|
||||
#define PWRHW BIT3
|
||||
#define PWRHAL BIT4
|
||||
|
||||
// Define Dynamic Mechanism check module bit --> FDM
|
||||
#define WA_IOT BIT0
|
||||
#define DM_PWDB BIT1
|
||||
#define DM_Monitor BIT2
|
||||
#define DM_DIG BIT3
|
||||
#define DM_EDCA_Turbo BIT4
|
||||
#define DM_BT30 BIT5
|
||||
|
||||
// Define Dbg Control module bit --> FDBG_CTRL
|
||||
#define DBG_CTRL_TRACE BIT0
|
||||
#define DBG_CTRL_INBAND_NOISE BIT1
|
||||
|
||||
// Define FW C2H Cmd check module bit --> FC2H
|
||||
#define C2H_Summary BIT0
|
||||
#define C2H_PacketData BIT1
|
||||
#define C2H_ContentData BIT2
|
||||
// Define BT Cmd check module bit --> FBT
|
||||
#define BT_TRACE BIT0
|
||||
#define BT_RFPoll BIT1
|
||||
|
||||
// Define init check for module bit --> FINIT
|
||||
#define INIT_EEPROM BIT0
|
||||
#define INIT_TxPower BIT1
|
||||
#define INIT_IQK BIT2
|
||||
#define INIT_RF BIT3
|
||||
|
||||
// Define IOCTL Cmd check module bit --> FIOCTL
|
||||
// section 1 : IRP related
|
||||
#define IOCTL_IRP BIT0
|
||||
#define IOCTL_IRP_DETAIL BIT1
|
||||
#define IOCTL_IRP_STATISTICS BIT2
|
||||
#define IOCTL_IRP_HANDLE BIT3
|
||||
// section 2 : HCI command/event
|
||||
#define IOCTL_BT_HCICMD BIT8
|
||||
#define IOCTL_BT_HCICMD_DETAIL BIT9
|
||||
#define IOCTL_BT_HCICMD_EXT BIT10
|
||||
#define IOCTL_BT_EVENT BIT11
|
||||
#define IOCTL_BT_EVENT_DETAIL BIT12
|
||||
#define IOCTL_BT_EVENT_PERIODICAL BIT13
|
||||
// section 3 : BT tx/rx data and throughput
|
||||
#define IOCTL_BT_TX_ACLDATA BIT16
|
||||
#define IOCTL_BT_TX_ACLDATA_DETAIL BIT17
|
||||
#define IOCTL_BT_RX_ACLDATA BIT18
|
||||
#define IOCTL_BT_RX_ACLDATA_DETAIL BIT19
|
||||
#define IOCTL_BT_TP BIT20
|
||||
// section 4 : BT connection state machine.
|
||||
#define IOCTL_STATE BIT21
|
||||
#define IOCTL_BT_LOGO BIT22
|
||||
// section 5 : BT function trace
|
||||
#define IOCTL_CALLBACK_FUN BIT24
|
||||
#define IOCTL_PARSE_BT_PKT BIT25
|
||||
#define IOCTL_BT_TX_PKT BIT26
|
||||
#define IOCTL_BT_FLAG_MON BIT27
|
||||
|
||||
//
|
||||
// Define init check for module bit --> FSHORT_CUT
|
||||
// 2011/07/20 MH Add for short but definition.
|
||||
//
|
||||
#define SHCUT_TX BIT0
|
||||
#define SHCUT_RX BIT1
|
||||
|
||||
|
||||
/* 2007/07/13 MH *//*------For DeBuG Print modeue------*/
|
||||
/*------------------------------Define structure----------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
#if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
|
||||
#define RT_PRINTK(fmt, args...) printk( "%s(): " fmt, __FUNCTION__, ## args);
|
||||
|
||||
#if DBG
|
||||
#define ODM_RT_TRACE(pDM_Odm,comp, level, fmt) \
|
||||
if(((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
RT_PRINTK fmt; \
|
||||
}
|
||||
|
||||
#define RT_TRACE_F(comp, level, fmt) \
|
||||
if(((comp) & GlobalDebugComponents) && (level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
RT_PRINTK fmt; \
|
||||
}
|
||||
|
||||
#define RT_ASSERT(expr,fmt) \
|
||||
if(!(expr)) { \
|
||||
printk( "Assertion failed! %s at ......\n", #expr); \
|
||||
printk( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \
|
||||
}
|
||||
#define dbg_enter() { printk("==> %s\n", __FUNCTION__); }
|
||||
#define dbg_exit() { printk("<== %s\n", __FUNCTION__); }
|
||||
#define dbg_trace(str) { printk("%s:%s\n", __FUNCTION__, str); }
|
||||
#else
|
||||
#define ODM_RT_TRACE(pDM_Odm,comp, level, fmt)
|
||||
#define RT_TRACE_F(comp, level, fmt)
|
||||
#define RT_ASSERT(expr, fmt)
|
||||
#define dbg_enter()
|
||||
#define dbg_exit()
|
||||
#define dbg_trace(str)
|
||||
#endif
|
||||
|
||||
#if DBG
|
||||
#define DbgPrint printk
|
||||
|
||||
#define PRINT_DATA(_TitleString, _HexData, _HexDataLen) \
|
||||
{ \
|
||||
char *szTitle = _TitleString; \
|
||||
pu1Byte pbtHexData = _HexData; \
|
||||
u4Byte u4bHexDataLen = _HexDataLen; \
|
||||
u4Byte __i; \
|
||||
DbgPrint("%s", szTitle); \
|
||||
for (__i=0;__i<u4bHexDataLen;__i++) \
|
||||
{ \
|
||||
if ((__i & 15) == 0) \
|
||||
{ \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
DbgPrint("%02X%s", pbtHexData[__i], ( ((__i&3)==3) ? " " : " ") ); \
|
||||
} \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
// RT_PRINT_XXX macros: implemented for debugging purpose.
|
||||
// Added by Annie, 2005-11-21.
|
||||
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen) \
|
||||
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_HexData; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
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"); \
|
||||
}
|
||||
|
||||
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr) \
|
||||
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint(" "); \
|
||||
for( __i=0; __i<6; __i++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i], (__i==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
}
|
||||
|
||||
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum) \
|
||||
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i, __j; \
|
||||
pu1Byte ptr = (pu1Byte)_Ptr; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint("\n"); \
|
||||
for( __i=0; __i<(int)_AddNum; __i++ ) \
|
||||
{ \
|
||||
for( __j=0; __j<6; __j++ ) \
|
||||
DbgPrint("%02X%s", ptr[__i*6+__j], (__j==5)?"":"-"); \
|
||||
DbgPrint("\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
// Added by Annie, 2005-11-22.
|
||||
#define MAX_STR_LEN 64
|
||||
#define PRINTABLE(_ch) (_ch>=' ' &&_ch<='~' ) // I want to see ASCII 33 to 126 only. Otherwise, I print '?'. Annie, 2005-11-22.
|
||||
|
||||
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len) \
|
||||
if(((_Comp) & GlobalDebugComponents) && (_Level <= GlobalDebugLevel)) \
|
||||
{ \
|
||||
int __i; \
|
||||
u1Byte buffer[MAX_STR_LEN]; \
|
||||
int length = (_Len<MAX_STR_LEN)? _Len : (MAX_STR_LEN-1) ; \
|
||||
PlatformZeroMemory( buffer, MAX_STR_LEN ); \
|
||||
PlatformMoveMemory( buffer, (pu1Byte)_Ptr, length ); \
|
||||
for( __i=0; __i<MAX_STR_LEN; __i++ ) \
|
||||
{ \
|
||||
if( !PRINTABLE(buffer[__i]) ) buffer[__i] = '?'; \
|
||||
} \
|
||||
buffer[length] = '\0'; \
|
||||
DbgPrint("Rtl819x: "); \
|
||||
DbgPrint(_TitleString); \
|
||||
DbgPrint(": %d, <%s>\n", _Len, buffer); \
|
||||
}
|
||||
|
||||
#else // of #if DBG
|
||||
#define DbgPrint(...)
|
||||
#define PRINT_DATA(_TitleString, _HexData, _HexDataLen)
|
||||
#define RT_PRINT_DATA(_Comp, _Level, _TitleString, _HexData, _HexDataLen)
|
||||
#define RT_PRINT_ADDR(_Comp, _Level, _TitleString, _Ptr)
|
||||
#define RT_PRINT_ADDRS(_Comp, _Level, _TitleString, _Ptr, _AddNum)
|
||||
#define RT_PRINT_STR(_Comp, _Level, _TitleString, _Ptr, _Len)
|
||||
#endif // of #if DBG
|
||||
|
||||
|
||||
|
||||
#endif // #if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
|
||||
|
||||
#define DEBUG_PRINT 1
|
||||
|
||||
// Please add new OS's print API by yourself
|
||||
|
||||
//#if (RT_PLATFORM==PLATFORM_WINDOWS)
|
||||
#if (DEBUG_PRINT == 1) && DBG
|
||||
#define RT_DISP(dbgtype, dbgflag, printstr)\
|
||||
{\
|
||||
if (DBGP_Type[dbgtype] & dbgflag)\
|
||||
{\
|
||||
DbgPrint printstr;\
|
||||
}\
|
||||
}
|
||||
|
||||
#define RT_DISP_ADDR(dbgtype, dbgflag, printstr, _Ptr)\
|
||||
{\
|
||||
if (DBGP_Type[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 RT_DISP_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)\
|
||||
{\
|
||||
if (DBGP_Type[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"); \
|
||||
}\
|
||||
}
|
||||
|
||||
#define FunctionIn(_comp) ODM_RT_TRACE(pDM_Odm,(_comp), DBG_LOUD, ("==========> %s\n", __FUNCTION__))
|
||||
#define FunctionOut(_comp) ODM_RT_TRACE(pDM_Odm,(_comp), DBG_LOUD, ("<========== %s\n", __FUNCTION__))
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#define RT_DISP(dbgtype, dbgflag, printstr)
|
||||
#define RT_DISP_ADDR(dbgtype, dbgflag, printstr, _Ptr)
|
||||
#define RT_DISP_DATA(dbgtype, dbgflag, _TitleString, _HexData, _HexDataLen)
|
||||
|
||||
#define FunctionIn(_comp)
|
||||
#define FunctionOut(_comp)
|
||||
#endif
|
||||
/*------------------------Export Marco Definition---------------------------*/
|
||||
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
extern u4Byte DBGP_Type[DBGP_TYPE_MAX];
|
||||
extern DBGP_HEAD_T DBGP_Head;
|
||||
|
||||
/*------------------------Export global variable----------------------------*/
|
||||
|
||||
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
extern void DBGP_Flag_Init(void);
|
||||
extern void DBG_PrintAllFlag(void);
|
||||
extern void DBG_PrintAllComp(void);
|
||||
extern void DBG_PrintFlagEvent(u1Byte DbgFlag);
|
||||
extern void DBG_DumpMem(const u1Byte DbgComp,
|
||||
const u1Byte DbgLevel,
|
||||
pu1Byte pMem,
|
||||
u2Byte Len);
|
||||
|
||||
/*--------------------------Exported Function prototype---------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
extern u4Byte GlobalDebugLevel;
|
||||
extern u8Byte GlobalDebugComponents;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __ODM_DBG_H__
|
||||
|
|
@ -0,0 +1,750 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 "odm_precomp.h"
|
||||
|
||||
//
|
||||
// ODM IO Relative API.
|
||||
//
|
||||
|
||||
u1Byte
|
||||
ODM_Read1Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
return RTL_R8(RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return rtw_read8(Adapter,RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PlatformEFIORead1Byte(Adapter, RegAddr);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
u2Byte
|
||||
ODM_Read2Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
return RTL_R16(RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return rtw_read16(Adapter,RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PlatformEFIORead2Byte(Adapter, RegAddr);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_Read4Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
return RTL_R32(RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return rtw_read32(Adapter,RegAddr);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PlatformEFIORead4Byte(Adapter, RegAddr);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_Write1Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u1Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
RTL_W8(RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
rtw_write8(Adapter,RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformEFIOWrite1Byte(Adapter, RegAddr, Data);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_Write2Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u2Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
RTL_W16(RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
rtw_write16(Adapter,RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformEFIOWrite2Byte(Adapter, RegAddr, Data);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_Write4Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
RTL_W32(RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
rtw_write32(Adapter,RegAddr, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformEFIOWrite4Byte(Adapter, RegAddr, Data);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_SetMACReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
PHY_SetBBReg(pDM_Odm->priv, RegAddr, BitMask, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetBBReg(Adapter, RegAddr, BitMask, Data);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_GetMACReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return PHY_QueryMacReg(pDM_Odm->priv, RegAddr, BitMask);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_WIN))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryMacReg(Adapter, RegAddr, BitMask);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE))
|
||||
return PHY_QueryBBReg(pDM_Odm->Adapter, RegAddr, BitMask);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_SetBBReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
PHY_SetBBReg(pDM_Odm->priv, RegAddr, BitMask, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetBBReg(Adapter, RegAddr, BitMask, Data);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_GetBBReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return PHY_QueryBBReg(pDM_Odm->priv, RegAddr, BitMask);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryBBReg(Adapter, RegAddr, BitMask);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_SetRFReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
PHY_SetRFReg(pDM_Odm->priv, eRFPath, RegAddr, BitMask, Data);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PHY_SetRFReg(Adapter, eRFPath, RegAddr, BitMask, Data);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_GetRFReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return PHY_QueryRFReg(pDM_Odm->priv, eRFPath, RegAddr, BitMask, 1);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & (ODM_CE|ODM_WIN))
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
return PHY_QueryRFReg(Adapter, eRFPath, RegAddr, BitMask);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ODM Memory relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_AllocateMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID *pPtr,
|
||||
IN u4Byte length
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
*pPtr = kmalloc(length, GFP_ATOMIC);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
*pPtr = rtw_zvmalloc(length);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformAllocateMemory(Adapter, pPtr, length);
|
||||
#endif
|
||||
}
|
||||
|
||||
// length could be ignored, used to detect memory leakage.
|
||||
VOID
|
||||
ODM_FreeMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID pPtr,
|
||||
IN u4Byte length
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
kfree(pPtr);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
rtw_vmfree(pPtr, length);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
//PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformFreeMemory(pPtr, length);
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_MoveMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID pDest,
|
||||
IN PVOID pSrc,
|
||||
IN u4Byte Length
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
_rtw_memcpy(pDest, pSrc, Length);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformMoveMemory(pDest, pSrc, Length);
|
||||
#endif
|
||||
}
|
||||
|
||||
s4Byte ODM_CompareMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PVOID pBuf1,
|
||||
IN PVOID pBuf2,
|
||||
IN u4Byte length
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return memcmp(pBuf1,pBuf2,length);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
return _rtw_memcmp(pBuf1,pBuf2,length);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
return PlatformCompareMemory(pBuf1,pBuf2,length);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ODM MISC relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_AcquireSpinLock(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN RT_SPINLOCK_TYPE type
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformAcquireSpinLock(Adapter, type);
|
||||
#endif
|
||||
}
|
||||
VOID
|
||||
ODM_ReleaseSpinLock(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN RT_SPINLOCK_TYPE type
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE & ODM_CE )
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformReleaseSpinLock(Adapter, type);
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// Work item relative API. FOr MP driver only~!
|
||||
//
|
||||
VOID
|
||||
ODM_InitializeWorkItem(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_WORK_ITEM pRtWorkItem,
|
||||
IN RT_WORKITEM_CALL_BACK RtWorkItemCallback,
|
||||
IN PVOID pContext,
|
||||
IN const char* szID
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformInitializeWorkItem(Adapter, pRtWorkItem, RtWorkItemCallback, pContext, szID);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_StartWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformStartWorkItem(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_StopWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformStopWorkItem(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_FreeWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformFreeWorkItem(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_ScheduleWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformScheduleWorkItem(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_IsWorkItemScheduled(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformIsWorkItemScheduled(pRtWorkItem);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ODM Timer relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_StallExecution(
|
||||
IN u4Byte usDelay
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_udelay_os(usDelay);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformStallExecution(usDelay);
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_delay_ms(IN u4Byte ms)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
delay_ms(ms);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_mdelay_os(ms);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
delay_ms(ms);
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_delay_us(IN u4Byte us)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
delay_us(us);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_udelay_os(us);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PlatformStallExecution(us);
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_sleep_ms(IN u4Byte ms)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_msleep_os(ms);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_sleep_us(IN u4Byte us)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
rtw_usleep_os(us);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_SetTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer,
|
||||
IN u4Byte msDelay
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
mod_timer(pTimer, jiffies + (msDelay+9)/10);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
_set_timer(pTimer,msDelay ); //ms
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformSetTimer(Adapter, pTimer, msDelay);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
VOID
|
||||
ODM_InitializeTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer,
|
||||
IN RT_TIMER_CALL_BACK CallBackFunc,
|
||||
IN PVOID pContext,
|
||||
IN const char* szID
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
pTimer->function = CallBackFunc;
|
||||
pTimer->data = (unsigned long)pDM_Odm;
|
||||
init_timer(pTimer);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
_init_timer(pTimer,Adapter->pnetdev,CallBackFunc,pDM_Odm);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformInitializeTimer(Adapter, pTimer, CallBackFunc,pContext,szID);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_CancelTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
del_timer_sync(pTimer);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
_cancel_timer_ex(pTimer);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
PlatformCancelTimer(Adapter, pTimer);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
ODM_ReleaseTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
|
||||
// <20120301, Kordan> If the initilization fails, InitializeAdapterXxx will return regardless of InitHalDm.
|
||||
// Hence, uninitialized timers cause BSOD when the driver releases resources since the init fail.
|
||||
if (pTimer == 0)
|
||||
{
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_SERIOUS, ("=====>ODM_ReleaseTimer(), The timer is NULL! Please check it!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
PlatformReleaseTimer(Adapter, pTimer);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// ODM FW relative API.
|
||||
//
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
VOID
|
||||
ODM_FillH2CCmd(
|
||||
IN PADAPTER Adapter,
|
||||
IN u1Byte ElementID,
|
||||
IN u4Byte CmdLen,
|
||||
IN pu1Byte pCmdBuffer
|
||||
)
|
||||
{
|
||||
if(IS_HARDWARE_TYPE_JAGUAR(Adapter))
|
||||
{
|
||||
switch(ElementID)
|
||||
{
|
||||
case ODM_H2C_RSSI_REPORT:
|
||||
FillH2CCmd8812(Adapter, H2C_8812_RSSI_REPORT, CmdLen, pCmdBuffer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else if(IS_HARDWARE_TYPE_8192E(Adapter))
|
||||
{
|
||||
switch(ElementID)
|
||||
{
|
||||
case ODM_H2C_RSSI_REPORT:
|
||||
FillH2CCmd8812(Adapter, H2C_8812_RSSI_REPORT, CmdLen, pCmdBuffer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(IS_HARDWARE_TYPE_8723B(Adapter))
|
||||
{
|
||||
//
|
||||
// <Roger_TODO> We should take RTL8723B into consideration, 2012.10.08
|
||||
//
|
||||
switch(ElementID)
|
||||
{
|
||||
case ODM_H2C_RSSI_REPORT:
|
||||
FillH2CCmd8723B(Adapter, H2C_8723B_RSSI_REPORT, CmdLen, pCmdBuffer);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
else if(IS_HARDWARE_TYPE_8188E(Adapter))
|
||||
{
|
||||
switch(ElementID)
|
||||
{
|
||||
case ODM_H2C_PSD_RESULT:
|
||||
FillH2CCmd88E(Adapter, H2C_88E_PSD_RESULT, CmdLen, pCmdBuffer);
|
||||
break;
|
||||
case ODM_H2C_RSSI_REPORT:
|
||||
if(IS_VENDOR_8188E_I_CUT_SERIES(Adapter))
|
||||
FillH2CCmd88E(Adapter, H2C_88E_RSSI_REPORT, CmdLen, pCmdBuffer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch(ElementID)
|
||||
{
|
||||
case ODM_H2C_RSSI_REPORT:
|
||||
FillH2CCmd92C(Adapter, H2C_RSSI_REPORT, CmdLen, pCmdBuffer);
|
||||
break;
|
||||
case ODM_H2C_PSD_RESULT:
|
||||
FillH2CCmd92C(Adapter, H2C_92C_PSD_RESULT, CmdLen, pCmdBuffer);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
u4Byte
|
||||
ODM_FillH2CCmd(
|
||||
IN pu1Byte pH2CBuffer,
|
||||
IN u4Byte H2CBufferLen,
|
||||
IN u4Byte CmdNum,
|
||||
IN pu4Byte pElementID,
|
||||
IN pu4Byte pCmdLen,
|
||||
IN pu1Byte* pCmbBuffer,
|
||||
IN pu1Byte CmdStartSeq
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
//FillH2CCmd(pH2CBuffer, H2CBufferLen, CmdNum, pElementID, pCmdLen, pCmbBuffer, CmdStartSeq);
|
||||
return FALSE;
|
||||
#endif
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
u4Byte
|
||||
ODM_GetCurrentTime(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return 0;
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
return rtw_get_current_time();
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
s4Byte
|
||||
ODM_GetProgressingTime(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Start_Time
|
||||
)
|
||||
{
|
||||
#if(DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
|
||||
return 0;
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_CE)
|
||||
return rtw_get_passing_time_ms(Start_Time);
|
||||
#elif(DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,394 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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_INTERFACE_H__
|
||||
#define __ODM_INTERFACE_H__
|
||||
|
||||
|
||||
|
||||
//
|
||||
// =========== Constant/Structure/Enum/... Define
|
||||
//
|
||||
|
||||
|
||||
|
||||
//
|
||||
// =========== Macro Define
|
||||
//
|
||||
|
||||
#define _reg_all(_name) ODM_##_name
|
||||
#define _reg_ic(_name, _ic) ODM_##_name##_ic
|
||||
#define _bit_all(_name) BIT_##_name
|
||||
#define _bit_ic(_name, _ic) BIT_##_name##_ic
|
||||
|
||||
// _cat: implemented by Token-Pasting Operator.
|
||||
#if 0
|
||||
#define _cat(_name, _ic_type, _func) \
|
||||
( \
|
||||
_func##_all(_name) \
|
||||
)
|
||||
#endif
|
||||
|
||||
/*===================================
|
||||
|
||||
#define ODM_REG_DIG_11N 0xC50
|
||||
#define ODM_REG_DIG_11AC 0xDDD
|
||||
|
||||
ODM_REG(DIG,_pDM_Odm)
|
||||
=====================================*/
|
||||
|
||||
#define _reg_11N(_name) ODM_REG_##_name##_11N
|
||||
#define _reg_11AC(_name) ODM_REG_##_name##_11AC
|
||||
#define _bit_11N(_name) ODM_BIT_##_name##_11N
|
||||
#define _bit_11AC(_name) ODM_BIT_##_name##_11AC
|
||||
|
||||
#if 1 //TODO: enable it if we need to support run-time to differentiate between 92C_SERIES and JAGUAR_SERIES.
|
||||
#define _cat(_name, _ic_type, _func) \
|
||||
( \
|
||||
((_ic_type) & ODM_IC_11N_SERIES)? _func##_11N(_name): \
|
||||
_func##_11AC(_name) \
|
||||
)
|
||||
#endif
|
||||
#if 0 // only sample code
|
||||
#define _cat(_name, _ic_type, _func) \
|
||||
( \
|
||||
((_ic_type) & ODM_RTL8192C)? _func##_ic(_name, _8192C): \
|
||||
((_ic_type) & ODM_RTL8192D)? _func##_ic(_name, _8192D): \
|
||||
((_ic_type) & ODM_RTL8192S)? _func##_ic(_name, _8192S): \
|
||||
((_ic_type) & ODM_RTL8723A)? _func##_ic(_name, _8723A): \
|
||||
((_ic_type) & ODM_RTL8188E)? _func##_ic(_name, _8188E): \
|
||||
_func##_ic(_name, _8195) \
|
||||
)
|
||||
#endif
|
||||
|
||||
// _name: name of register or bit.
|
||||
// Example: "ODM_REG(R_A_AGC_CORE1, pDM_Odm)"
|
||||
// gets "ODM_R_A_AGC_CORE1" or "ODM_R_A_AGC_CORE1_8192C", depends on SupportICType.
|
||||
#define ODM_REG(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _reg)
|
||||
#define ODM_BIT(_name, _pDM_Odm) _cat(_name, _pDM_Odm->SupportICType, _bit)
|
||||
|
||||
typedef enum _ODM_H2C_CMD
|
||||
{
|
||||
ODM_H2C_RSSI_REPORT = 0,
|
||||
ODM_H2C_PSD_RESULT=1,
|
||||
ODM_H2C_PathDiv = 2,
|
||||
ODM_MAX_H2CCMD
|
||||
}ODM_H2C_CMD;
|
||||
|
||||
|
||||
//
|
||||
// 2012/02/17 MH For non-MP compile pass only. Linux does not support workitem.
|
||||
// Suggest HW team to use thread instead of workitem. Windows also support the feature.
|
||||
//
|
||||
#if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
|
||||
typedef void *PRT_WORK_ITEM ;
|
||||
typedef void RT_WORKITEM_HANDLE,*PRT_WORKITEM_HANDLE;
|
||||
typedef VOID (*RT_WORKITEM_CALL_BACK)(PVOID pContext);
|
||||
|
||||
#if 0
|
||||
typedef struct tasklet_struct RT_WORKITEM_HANDLE, *PRT_WORKITEM_HANDLE;
|
||||
|
||||
typedef struct _RT_WORK_ITEM
|
||||
{
|
||||
|
||||
RT_WORKITEM_HANDLE Handle; // Platform-dependent handle for this workitem, e.g. Ndis Workitem object.
|
||||
PVOID Adapter; // Pointer to Adapter object.
|
||||
PVOID pContext; // Parameter to passed to CallBackFunc().
|
||||
RT_WORKITEM_CALL_BACK CallbackFunc; // Callback function of the workitem.
|
||||
u1Byte RefCount; // 0: driver is going to unload, 1: No such workitem scheduled, 2: one workitem is schedueled.
|
||||
PVOID pPlatformExt; // Pointer to platform-dependent extension.
|
||||
BOOLEAN bFree;
|
||||
char szID[36]; // An identity string of this workitem.
|
||||
}RT_WORK_ITEM, *PRT_WORK_ITEM;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
// =========== Extern Variable ??? It should be forbidden.
|
||||
//
|
||||
|
||||
|
||||
//
|
||||
// =========== EXtern Function Prototype
|
||||
//
|
||||
|
||||
|
||||
u1Byte
|
||||
ODM_Read1Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
|
||||
u2Byte
|
||||
ODM_Read2Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_Read4Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_Write1Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u1Byte Data
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_Write2Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u2Byte Data
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_Write4Byte(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_SetMACReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_GetMACReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_SetBBReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_GetBBReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_SetRFReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
u4Byte
|
||||
ODM_GetRFReg(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN ODM_RF_RADIO_PATH_E eRFPath,
|
||||
IN u4Byte RegAddr,
|
||||
IN u4Byte BitMask
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// Memory Relative Function.
|
||||
//
|
||||
VOID
|
||||
ODM_AllocateMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID *pPtr,
|
||||
IN u4Byte length
|
||||
);
|
||||
VOID
|
||||
ODM_FreeMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID pPtr,
|
||||
IN u4Byte length
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_MoveMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT PVOID pDest,
|
||||
IN PVOID pSrc,
|
||||
IN u4Byte Length
|
||||
);
|
||||
|
||||
s4Byte ODM_CompareMemory(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PVOID pBuf1,
|
||||
IN PVOID pBuf2,
|
||||
IN u4Byte length
|
||||
);
|
||||
|
||||
//
|
||||
// ODM MISC-spin lock relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_AcquireSpinLock(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN RT_SPINLOCK_TYPE type
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_ReleaseSpinLock(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN RT_SPINLOCK_TYPE type
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ODM MISC-workitem relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_InitializeWorkItem(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_WORK_ITEM pRtWorkItem,
|
||||
IN RT_WORKITEM_CALL_BACK RtWorkItemCallback,
|
||||
IN PVOID pContext,
|
||||
IN const char* szID
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_StartWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_StopWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_FreeWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_ScheduleWorkItem(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_IsWorkItemScheduled(
|
||||
IN PRT_WORK_ITEM pRtWorkItem
|
||||
);
|
||||
|
||||
//
|
||||
// ODM Timer relative API.
|
||||
//
|
||||
VOID
|
||||
ODM_StallExecution(
|
||||
IN u4Byte usDelay
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_delay_ms(IN u4Byte ms);
|
||||
|
||||
|
||||
|
||||
VOID
|
||||
ODM_delay_us(IN u4Byte us);
|
||||
|
||||
VOID
|
||||
ODM_sleep_ms(IN u4Byte ms);
|
||||
|
||||
VOID
|
||||
ODM_sleep_us(IN u4Byte us);
|
||||
|
||||
VOID
|
||||
ODM_SetTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer,
|
||||
IN u4Byte msDelay
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_InitializeTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer,
|
||||
IN RT_TIMER_CALL_BACK CallBackFunc,
|
||||
IN PVOID pContext,
|
||||
IN const char* szID
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_CancelTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_ReleaseTimer(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN PRT_TIMER pTimer
|
||||
);
|
||||
|
||||
|
||||
//
|
||||
// ODM FW relative API.
|
||||
//
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_WIN)
|
||||
VOID
|
||||
ODM_FillH2CCmd(
|
||||
IN PADAPTER Adapter,
|
||||
IN u1Byte ElementID,
|
||||
IN u4Byte CmdLen,
|
||||
IN pu1Byte pCmdBuffer
|
||||
);
|
||||
#else
|
||||
u4Byte
|
||||
ODM_FillH2CCmd(
|
||||
IN pu1Byte pH2CBuffer,
|
||||
IN u4Byte H2CBufferLen,
|
||||
IN u4Byte CmdNum,
|
||||
IN pu4Byte pElementID,
|
||||
IN pu4Byte pCmdLen,
|
||||
IN pu1Byte* pCmbBuffer,
|
||||
IN pu1Byte CmdStartSeq
|
||||
);
|
||||
#endif
|
||||
|
||||
u4Byte
|
||||
ODM_GetCurrentTime(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
s4Byte
|
||||
ODM_GetProgressingTime(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Start_Time
|
||||
);
|
||||
|
||||
#endif // __ODM_INTERFACE_H__
|
||||
|
|
@ -0,0 +1,307 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 "odm_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 "odm.h"
|
||||
#include "odm_HWConfig.h"
|
||||
#include "odm_debug.h"
|
||||
#include "odm_RegDefine11AC.h"
|
||||
#include "odm_RegDefine11N.h"
|
||||
#include "odm_AntDiv.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"
|
||||
#endif
|
||||
|
||||
#if (RTL8723B_SUPPORT==1)
|
||||
#include "rtl8723b/HalPhyRf_8723B.h"//for IQK,LCK,Power-tracking
|
||||
#include "rtl8723b_hal.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include "odm_interface.h"
|
||||
#include "odm_reg.h"
|
||||
|
||||
#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/odm_RTL8192C.h"
|
||||
#endif
|
||||
#if (RTL8192D_SUPPORT==1)
|
||||
#include "rtl8192d/odm_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/odm_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/odm_RegConfig8188E.h"
|
||||
#include "rtl8188e/odm_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/odm_RegConfig8192E.h"
|
||||
#include "rtl8192e/odm_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/odm_RTL8723B.h"
|
||||
#include "rtl8723b/odm_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/odm_RegConfig8812A.h"
|
||||
#include "rtl8812a/odm_RTL8812A.h"
|
||||
#if (TESTCHIP_SUPPORT == 1)
|
||||
#include "rtl8812a/HalHWImg8812A_TestChip_MAC.h"
|
||||
#include "rtl8812a/HalHWImg8812A_TestChip_RF.h"
|
||||
#include "rtl8812a/HalHWImg8812A_TestChip_BB.h"
|
||||
#endif
|
||||
#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/odm_RegConfig8821A.h"
|
||||
#include "rtl8821a/odm_RTL8821A.h"
|
||||
#if (TESTCHIP_SUPPORT == 1)
|
||||
#include "rtl8821a/HalHWImg8821A_TestChip_MAC.h"
|
||||
#include "rtl8821a/HalHWImg8821A_TestChip_RF.h"
|
||||
#include "rtl8821a/HalHWImg8821A_TestChip_BB.h"
|
||||
#include "rtl8821a/HalHWImg8821A_TestChip_FW.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif // __ODM_PRECOMP_H__
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
*
|
||||
******************************************************************************/
|
||||
//============================================================
|
||||
// File Name: odm_reg.h
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// This file is for general register definition.
|
||||
//
|
||||
//
|
||||
//============================================================
|
||||
#ifndef __HAL_ODM_REG_H__
|
||||
#define __HAL_ODM_REG_H__
|
||||
|
||||
//
|
||||
// Register Definition
|
||||
//
|
||||
|
||||
//MAC REG
|
||||
#define ODM_BB_RESET 0x002
|
||||
#define ODM_DUMMY 0x4fe
|
||||
#define RF_T_METER_OLD 0x24
|
||||
#define RF_T_METER_NEW 0x42
|
||||
|
||||
#define ODM_EDCA_VO_PARAM 0x500
|
||||
#define ODM_EDCA_VI_PARAM 0x504
|
||||
#define ODM_EDCA_BE_PARAM 0x508
|
||||
#define ODM_EDCA_BK_PARAM 0x50C
|
||||
#define ODM_TXPAUSE 0x522
|
||||
|
||||
//BB REG
|
||||
#define ODM_FPGA_PHY0_PAGE8 0x800
|
||||
#define ODM_PSD_SETTING 0x808
|
||||
#define ODM_AFE_SETTING 0x818
|
||||
#define ODM_TXAGC_B_24_54 0x834
|
||||
#define ODM_TXAGC_B_MCS32_5 0x838
|
||||
#define ODM_TXAGC_B_MCS0_MCS3 0x83c
|
||||
#define ODM_TXAGC_B_MCS4_MCS7 0x848
|
||||
#define ODM_TXAGC_B_MCS8_MCS11 0x84c
|
||||
#define ODM_ANALOG_REGISTER 0x85c
|
||||
#define ODM_RF_INTERFACE_OUTPUT 0x860
|
||||
#define ODM_TXAGC_B_MCS12_MCS15 0x868
|
||||
#define ODM_TXAGC_B_11_A_2_11 0x86c
|
||||
#define ODM_AD_DA_LSB_MASK 0x874
|
||||
#define ODM_ENABLE_3_WIRE 0x88c
|
||||
#define ODM_PSD_REPORT 0x8b4
|
||||
#define ODM_R_ANT_SELECT 0x90c
|
||||
#define ODM_CCK_ANT_SELECT 0xa07
|
||||
#define ODM_CCK_PD_THRESH 0xa0a
|
||||
#define ODM_CCK_RF_REG1 0xa11
|
||||
#define ODM_CCK_MATCH_FILTER 0xa20
|
||||
#define ODM_CCK_RAKE_MAC 0xa2e
|
||||
#define ODM_CCK_CNT_RESET 0xa2d
|
||||
#define ODM_CCK_TX_DIVERSITY 0xa2f
|
||||
#define ODM_CCK_FA_CNT_MSB 0xa5b
|
||||
#define ODM_CCK_FA_CNT_LSB 0xa5c
|
||||
#define ODM_CCK_NEW_FUNCTION 0xa75
|
||||
#define ODM_OFDM_PHY0_PAGE_C 0xc00
|
||||
#define ODM_OFDM_RX_ANT 0xc04
|
||||
#define ODM_R_A_RXIQI 0xc14
|
||||
#define ODM_R_A_AGC_CORE1 0xc50
|
||||
#define ODM_R_A_AGC_CORE2 0xc54
|
||||
#define ODM_R_B_AGC_CORE1 0xc58
|
||||
#define ODM_R_AGC_PAR 0xc70
|
||||
#define ODM_R_HTSTF_AGC_PAR 0xc7c
|
||||
#define ODM_TX_PWR_TRAINING_A 0xc90
|
||||
#define ODM_TX_PWR_TRAINING_B 0xc98
|
||||
#define ODM_OFDM_FA_CNT1 0xcf0
|
||||
#define ODM_OFDM_PHY0_PAGE_D 0xd00
|
||||
#define ODM_OFDM_FA_CNT2 0xda0
|
||||
#define ODM_OFDM_FA_CNT3 0xda4
|
||||
#define ODM_OFDM_FA_CNT4 0xda8
|
||||
#define ODM_TXAGC_A_6_18 0xe00
|
||||
#define ODM_TXAGC_A_24_54 0xe04
|
||||
#define ODM_TXAGC_A_1_MCS32 0xe08
|
||||
#define ODM_TXAGC_A_MCS0_MCS3 0xe10
|
||||
#define ODM_TXAGC_A_MCS4_MCS7 0xe14
|
||||
#define ODM_TXAGC_A_MCS8_MCS11 0xe18
|
||||
#define ODM_TXAGC_A_MCS12_MCS15 0xe1c
|
||||
|
||||
//RF REG
|
||||
#define ODM_GAIN_SETTING 0x00
|
||||
#define ODM_CHANNEL 0x18
|
||||
|
||||
//Ant Detect Reg
|
||||
#define ODM_DPDT 0x300
|
||||
|
||||
//PSD Init
|
||||
#define ODM_PSDREG 0x808
|
||||
|
||||
//92D Path Div
|
||||
#define PATHDIV_REG 0xB30
|
||||
#define PATHDIV_TRI 0xBA0
|
||||
|
||||
|
||||
//
|
||||
// Bitmap Definition
|
||||
//
|
||||
|
||||
#define BIT_FA_RESET BIT0
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,265 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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_TYPES_H__
|
||||
#define __ODM_TYPES_H__
|
||||
|
||||
//
|
||||
// Define Different SW team support
|
||||
//
|
||||
#define ODM_AP 0x01 //BIT0
|
||||
#define ODM_ADSL 0x02 //BIT1
|
||||
#define ODM_CE 0x04 //BIT2
|
||||
#define ODM_WIN 0x08 //BIT3
|
||||
|
||||
#define DM_ODM_SUPPORT_TYPE ODM_CE
|
||||
|
||||
// Deifne HW endian support
|
||||
#define ODM_ENDIAN_BIG 0
|
||||
#define ODM_ENDIAN_LITTLE 1
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE != ODM_WIN)
|
||||
#define RT_PCI_INTERFACE 1
|
||||
#define RT_USB_INTERFACE 2
|
||||
#define RT_SDIO_INTERFACE 3
|
||||
#endif
|
||||
|
||||
typedef enum _HAL_STATUS{
|
||||
HAL_STATUS_SUCCESS,
|
||||
HAL_STATUS_FAILURE,
|
||||
/*RT_STATUS_PENDING,
|
||||
RT_STATUS_RESOURCE,
|
||||
RT_STATUS_INVALID_CONTEXT,
|
||||
RT_STATUS_INVALID_PARAMETER,
|
||||
RT_STATUS_NOT_SUPPORT,
|
||||
RT_STATUS_OS_API_FAILED,*/
|
||||
}HAL_STATUS,*PHAL_STATUS;
|
||||
|
||||
|
||||
#if( (DM_ODM_SUPPORT_TYPE == ODM_AP) ||(DM_ODM_SUPPORT_TYPE == ODM_ADSL) || (DM_ODM_SUPPORT_TYPE == ODM_CE))
|
||||
|
||||
#define VISTA_USB_RX_REVISE 0
|
||||
|
||||
//
|
||||
// Declare for ODM spin lock defintion temporarily fro compile pass.
|
||||
//
|
||||
typedef enum _RT_SPINLOCK_TYPE{
|
||||
RT_TX_SPINLOCK = 1,
|
||||
RT_RX_SPINLOCK = 2,
|
||||
RT_RM_SPINLOCK = 3,
|
||||
RT_CAM_SPINLOCK = 4,
|
||||
RT_SCAN_SPINLOCK = 5,
|
||||
RT_LOG_SPINLOCK = 7,
|
||||
RT_BW_SPINLOCK = 8,
|
||||
RT_CHNLOP_SPINLOCK = 9,
|
||||
RT_RF_OPERATE_SPINLOCK = 10,
|
||||
RT_INITIAL_SPINLOCK = 11,
|
||||
RT_RF_STATE_SPINLOCK = 12, // For RF state. Added by Bruce, 2007-10-30.
|
||||
#if VISTA_USB_RX_REVISE
|
||||
RT_USBRX_CONTEXT_SPINLOCK = 13,
|
||||
RT_USBRX_POSTPROC_SPINLOCK = 14, // protect data of Adapter->IndicateW/ IndicateR
|
||||
#endif
|
||||
//Shall we define Ndis 6.2 SpinLock Here ?
|
||||
RT_PORT_SPINLOCK=16,
|
||||
RT_H2C_SPINLOCK = 20, // For H2C cmd. Added by tynli. 2009.11.09.
|
||||
|
||||
RT_BTData_SPINLOCK=25,
|
||||
|
||||
RT_WAPI_OPTION_SPINLOCK=26,
|
||||
RT_WAPI_RX_SPINLOCK=27,
|
||||
|
||||
// add for 92D CCK control issue
|
||||
RT_CCK_PAGEA_SPINLOCK = 28,
|
||||
RT_BUFFER_SPINLOCK = 29,
|
||||
RT_CHANNEL_AND_BANDWIDTH_SPINLOCK = 30,
|
||||
RT_GEN_TEMP_BUF_SPINLOCK = 31,
|
||||
RT_AWB_SPINLOCK = 32,
|
||||
RT_FW_PS_SPINLOCK = 33,
|
||||
RT_HW_TIMER_SPIN_LOCK = 34,
|
||||
RT_MPT_WI_SPINLOCK = 35,
|
||||
RT_P2P_SPIN_LOCK = 36, // Protect P2P context
|
||||
RT_DBG_SPIN_LOCK = 37,
|
||||
RT_IQK_SPINLOCK = 38,
|
||||
RT_PENDED_OID_SPINLOCK = 39,
|
||||
RT_CHNLLIST_SPINLOCK = 40,
|
||||
RT_INDIC_SPINLOCK = 41, //protect indication
|
||||
}RT_SPINLOCK_TYPE;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
#define STA_INFO_T RT_WLAN_STA
|
||||
#define PSTA_INFO_T PRT_WLAN_STA
|
||||
|
||||
// typedef unsigned long u4Byte,*pu4Byte;
|
||||
#define CONFIG_HW_ANTENNA_DIVERSITY
|
||||
#define CONFIG_SW_ANTENNA_DIVERSITY
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
|
||||
// To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
|
||||
#define ADSL_AP_BUILD_WORKAROUND
|
||||
#define AP_BUILD_WORKAROUND
|
||||
//
|
||||
#ifdef CONFIG_ANT_SWITCH
|
||||
#define CONFIG_HW_ANTENNA_DIVERSITY
|
||||
#if ( defined(CONFIG_NO_2G_DIVERSITY) && defined(CONFIG_NO_5G_DIVERSITY) )
|
||||
#define CONFIG_NOT_SUPPORT_ANTDIV
|
||||
#elif( !defined(CONFIG_NO_2G_DIVERSITY) && defined(CONFIG_NO_5G_DIVERSITY) )
|
||||
#define CONFIG_2G_SUPPORT_ANTDIV
|
||||
#elif( defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY) )
|
||||
#define CONFIG_5G_SUPPORT_ANTDIV
|
||||
#elif( !defined(CONFIG_NO_2G_DIVERSITY) && !defined(CONFIG_NO_5G_DIVERSITY) )
|
||||
#define CONFIG_2G5G_SUPPORT_ANTDIV
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef AP_BUILD_WORKAROUND
|
||||
#include "../typedef.h"
|
||||
#else
|
||||
typedef void VOID,*PVOID;
|
||||
typedef unsigned char BOOLEAN,*PBOOLEAN;
|
||||
typedef unsigned char u1Byte,*pu1Byte;
|
||||
typedef unsigned short u2Byte,*pu2Byte;
|
||||
typedef unsigned int u4Byte,*pu4Byte;
|
||||
typedef unsigned long long u8Byte,*pu8Byte;
|
||||
typedef char s1Byte,*ps1Byte;
|
||||
typedef short s2Byte,*ps2Byte;
|
||||
typedef long s4Byte,*ps4Byte;
|
||||
typedef long long s8Byte,*ps8Byte;
|
||||
#endif
|
||||
|
||||
typedef struct rtl8192cd_priv *prtl8192cd_priv;
|
||||
typedef struct stat_info STA_INFO_T,*PSTA_INFO_T;
|
||||
typedef struct timer_list RT_TIMER, *PRT_TIMER;
|
||||
typedef void * RT_TIMER_CALL_BACK;
|
||||
|
||||
#define DEV_BUS_TYPE RT_PCI_INTERFACE
|
||||
|
||||
#define _TRUE 1
|
||||
#define _FALSE 0
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_ADSL)
|
||||
|
||||
// To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.
|
||||
#define ADSL_AP_BUILD_WORKAROUND
|
||||
#define ADSL_BUILD_WORKAROUND
|
||||
//
|
||||
|
||||
typedef unsigned char BOOLEAN,*PBOOLEAN;
|
||||
typedef unsigned char u1Byte,*pu1Byte;
|
||||
typedef unsigned short u2Byte,*pu2Byte;
|
||||
typedef unsigned int u4Byte,*pu4Byte;
|
||||
typedef unsigned long long u8Byte,*pu8Byte;
|
||||
typedef char s1Byte,*ps1Byte;
|
||||
typedef short s2Byte,*ps2Byte;
|
||||
typedef long s4Byte,*ps4Byte;
|
||||
typedef long long s8Byte,*ps8Byte;
|
||||
|
||||
typedef struct rtl8192cd_priv *prtl8192cd_priv;
|
||||
typedef struct stat_info STA_INFO_T,*PSTA_INFO_T;
|
||||
typedef struct timer_list RT_TIMER, *PRT_TIMER;
|
||||
typedef void * RT_TIMER_CALL_BACK;
|
||||
|
||||
#define DEV_BUS_TYPE RT_PCI_INTERFACE
|
||||
|
||||
#define _TRUE 1
|
||||
#define _FALSE 0
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
|
||||
#include <drv_types.h>
|
||||
|
||||
#if 0
|
||||
typedef u8 u1Byte, *pu1Byte;
|
||||
typedef u16 u2Byte,*pu2Byte;
|
||||
typedef u32 u4Byte,*pu4Byte;
|
||||
typedef u64 u8Byte,*pu8Byte;
|
||||
typedef s8 s1Byte,*ps1Byte;
|
||||
typedef s16 s2Byte,*ps2Byte;
|
||||
typedef s32 s4Byte,*ps4Byte;
|
||||
typedef s64 s8Byte,*ps8Byte;
|
||||
#else
|
||||
#define u1Byte u8
|
||||
#define pu1Byte u8*
|
||||
|
||||
#define u2Byte u16
|
||||
#define pu2Byte u16*
|
||||
|
||||
#define u4Byte u32
|
||||
#define pu4Byte u32*
|
||||
|
||||
#define u8Byte u64
|
||||
#define pu8Byte u64*
|
||||
|
||||
#define s1Byte s8
|
||||
#define ps1Byte s8*
|
||||
|
||||
#define s2Byte s16
|
||||
#define ps2Byte s16*
|
||||
|
||||
#define s4Byte s32
|
||||
#define ps4Byte s32*
|
||||
|
||||
#define s8Byte s64
|
||||
#define ps8Byte s64*
|
||||
|
||||
#endif
|
||||
#ifdef CONFIG_USB_HCI
|
||||
#define DEV_BUS_TYPE RT_USB_INTERFACE
|
||||
#elif defined(CONFIG_PCI_HCI)
|
||||
#define DEV_BUS_TYPE RT_PCI_INTERFACE
|
||||
#elif defined(CONFIG_SDIO_HCI)
|
||||
#define DEV_BUS_TYPE RT_SDIO_INTERFACE
|
||||
#elif defined(CONFIG_GSPI_HCI)
|
||||
#define DEV_BUS_TYPE RT_SDIO_INTERFACE
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(CONFIG_LITTLE_ENDIAN)
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_LITTLE
|
||||
#elif defined (CONFIG_BIG_ENDIAN)
|
||||
#define ODM_ENDIAN_TYPE ODM_ENDIAN_BIG
|
||||
#endif
|
||||
|
||||
typedef struct timer_list RT_TIMER, *PRT_TIMER;
|
||||
typedef void * RT_TIMER_CALL_BACK;
|
||||
#define STA_INFO_T struct sta_info
|
||||
#define PSTA_INFO_T struct sta_info *
|
||||
|
||||
|
||||
|
||||
#define TRUE _TRUE
|
||||
#define FALSE _FALSE
|
||||
|
||||
|
||||
#define SET_TX_DESC_ANTSEL_A_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 24, 1, __Value)
|
||||
#define SET_TX_DESC_ANTSEL_B_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+8, 25, 1, __Value)
|
||||
#define SET_TX_DESC_ANTSEL_C_88E(__pTxDesc, __Value) SET_BITS_TO_LE_4BYTE(__pTxDesc+28, 29, 1, __Value)
|
||||
|
||||
//define useless flag to avoid compile warning
|
||||
#define USE_WORKITEM 0
|
||||
#define FOR_BRAZIL_PRETEST 0
|
||||
#define FPGA_TWO_MAC_VERIFICATION 0
|
||||
#define RTL8881A_SUPPORT 0
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __ODM_TYPES_H__
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,796 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8192E_SUPPORT == 1)
|
||||
static BOOLEAN
|
||||
CheckCondition(
|
||||
const u4Byte Condition,
|
||||
const u4Byte Hex
|
||||
)
|
||||
{
|
||||
u4Byte _board = (Hex & 0x000000FF);
|
||||
u4Byte _interface = (Hex & 0x0000FF00) >> 8;
|
||||
u4Byte _platform = (Hex & 0x00FF0000) >> 16;
|
||||
u4Byte cond = Condition;
|
||||
|
||||
if ( Condition == 0xCDCDCDCD )
|
||||
return TRUE;
|
||||
|
||||
cond = Condition & 0x000000FF;
|
||||
if ( (_board != cond) && (cond != 0xFF) )
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x0000FF00;
|
||||
cond = cond >> 8;
|
||||
if ( ((_interface & cond) == 0) && (cond != 0x07) )
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x00FF0000;
|
||||
cond = cond >> 16;
|
||||
if ( ((_platform & cond) == 0) && (cond != 0x0F) )
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* AGC_TAB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_MP_8192E_AGC_TAB[] = {
|
||||
0xFF010718, 0xABCD,
|
||||
0xC78, 0xFA000001,
|
||||
0xC78, 0xF9010001,
|
||||
0xC78, 0xF8020001,
|
||||
0xC78, 0xF7030001,
|
||||
0xC78, 0xF6040001,
|
||||
0xC78, 0xF5050001,
|
||||
0xC78, 0xF4060001,
|
||||
0xC78, 0xF3070001,
|
||||
0xC78, 0xF2080001,
|
||||
0xC78, 0xF1090001,
|
||||
0xC78, 0xF00A0001,
|
||||
0xC78, 0xEF0B0001,
|
||||
0xC78, 0xEE0C0001,
|
||||
0xC78, 0xED0D0001,
|
||||
0xC78, 0xEC0E0001,
|
||||
0xC78, 0xEB0F0001,
|
||||
0xC78, 0xEA100001,
|
||||
0xC78, 0xE9110001,
|
||||
0xC78, 0xE8120001,
|
||||
0xC78, 0xE7130001,
|
||||
0xC78, 0xE6140001,
|
||||
0xC78, 0xE5150001,
|
||||
0xC78, 0xE4160001,
|
||||
0xC78, 0xE3170001,
|
||||
0xC78, 0xE2180001,
|
||||
0xC78, 0xE1190001,
|
||||
0xC78, 0x8A1A0001,
|
||||
0xC78, 0x891B0001,
|
||||
0xC78, 0x881C0001,
|
||||
0xC78, 0x871D0001,
|
||||
0xC78, 0x861E0001,
|
||||
0xC78, 0x851F0001,
|
||||
0xC78, 0x84200001,
|
||||
0xC78, 0x83210001,
|
||||
0xC78, 0x82220001,
|
||||
0xC78, 0x6A230001,
|
||||
0xC78, 0x69240001,
|
||||
0xC78, 0x68250001,
|
||||
0xC78, 0x67260001,
|
||||
0xC78, 0x66270001,
|
||||
0xC78, 0x65280001,
|
||||
0xC78, 0x64290001,
|
||||
0xC78, 0x632A0001,
|
||||
0xC78, 0x622B0001,
|
||||
0xC78, 0x612C0001,
|
||||
0xC78, 0x602D0001,
|
||||
0xC78, 0x472E0001,
|
||||
0xC78, 0x462F0001,
|
||||
0xC78, 0x45300001,
|
||||
0xC78, 0x44310001,
|
||||
0xC78, 0x43320001,
|
||||
0xC78, 0x42330001,
|
||||
0xC78, 0x41340001,
|
||||
0xC78, 0x40350001,
|
||||
0xC78, 0x40360001,
|
||||
0xC78, 0x40370001,
|
||||
0xC78, 0x40380001,
|
||||
0xC78, 0x40390001,
|
||||
0xC78, 0x403A0001,
|
||||
0xC78, 0x403B0001,
|
||||
0xC78, 0x403C0001,
|
||||
0xC78, 0x403D0001,
|
||||
0xC78, 0x403E0001,
|
||||
0xC78, 0x403F0001,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0xC78, 0xFB000001,
|
||||
0xC78, 0xFB010001,
|
||||
0xC78, 0xFB020001,
|
||||
0xC78, 0xFB030001,
|
||||
0xC78, 0xFB040001,
|
||||
0xC78, 0xFB050001,
|
||||
0xC78, 0xFA060001,
|
||||
0xC78, 0xF9070001,
|
||||
0xC78, 0xF8080001,
|
||||
0xC78, 0xF7090001,
|
||||
0xC78, 0xF60A0001,
|
||||
0xC78, 0xF50B0001,
|
||||
0xC78, 0xF40C0001,
|
||||
0xC78, 0xF30D0001,
|
||||
0xC78, 0xF20E0001,
|
||||
0xC78, 0xF10F0001,
|
||||
0xC78, 0xF0100001,
|
||||
0xC78, 0xEF110001,
|
||||
0xC78, 0xEE120001,
|
||||
0xC78, 0xED130001,
|
||||
0xC78, 0xEC140001,
|
||||
0xC78, 0xEB150001,
|
||||
0xC78, 0xEA160001,
|
||||
0xC78, 0xE9170001,
|
||||
0xC78, 0xE8180001,
|
||||
0xC78, 0xE7190001,
|
||||
0xC78, 0xC81A0001,
|
||||
0xC78, 0xC71B0001,
|
||||
0xC78, 0xC61C0001,
|
||||
0xC78, 0x071D0001,
|
||||
0xC78, 0x061E0001,
|
||||
0xC78, 0x051F0001,
|
||||
0xC78, 0x04200001,
|
||||
0xC78, 0x03210001,
|
||||
0xC78, 0xAA220001,
|
||||
0xC78, 0xA9230001,
|
||||
0xC78, 0xA8240001,
|
||||
0xC78, 0xA7250001,
|
||||
0xC78, 0xA6260001,
|
||||
0xC78, 0x85270001,
|
||||
0xC78, 0x84280001,
|
||||
0xC78, 0x83290001,
|
||||
0xC78, 0x252A0001,
|
||||
0xC78, 0x242B0001,
|
||||
0xC78, 0x232C0001,
|
||||
0xC78, 0x222D0001,
|
||||
0xC78, 0x672E0001,
|
||||
0xC78, 0x662F0001,
|
||||
0xC78, 0x65300001,
|
||||
0xC78, 0x64310001,
|
||||
0xC78, 0x63320001,
|
||||
0xC78, 0x62330001,
|
||||
0xC78, 0x61340001,
|
||||
0xC78, 0x45350001,
|
||||
0xC78, 0x44360001,
|
||||
0xC78, 0x43370001,
|
||||
0xC78, 0x42380001,
|
||||
0xC78, 0x41390001,
|
||||
0xC78, 0x403A0001,
|
||||
0xC78, 0x403B0001,
|
||||
0xC78, 0x403C0001,
|
||||
0xC78, 0x403D0001,
|
||||
0xC78, 0x403E0001,
|
||||
0xC78, 0x403F0001,
|
||||
0xFF010718, 0xDEAD,
|
||||
0xFF010718, 0xABCD,
|
||||
0xC78, 0xFA400001,
|
||||
0xC78, 0xF9410001,
|
||||
0xC78, 0xF8420001,
|
||||
0xC78, 0xF7430001,
|
||||
0xC78, 0xF6440001,
|
||||
0xC78, 0xF5450001,
|
||||
0xC78, 0xF4460001,
|
||||
0xC78, 0xF3470001,
|
||||
0xC78, 0xF2480001,
|
||||
0xC78, 0xF1490001,
|
||||
0xC78, 0xF04A0001,
|
||||
0xC78, 0xEF4B0001,
|
||||
0xC78, 0xEE4C0001,
|
||||
0xC78, 0xED4D0001,
|
||||
0xC78, 0xEC4E0001,
|
||||
0xC78, 0xEB4F0001,
|
||||
0xC78, 0xEA500001,
|
||||
0xC78, 0xE9510001,
|
||||
0xC78, 0xE8520001,
|
||||
0xC78, 0xE7530001,
|
||||
0xC78, 0xE6540001,
|
||||
0xC78, 0xE5550001,
|
||||
0xC78, 0xE4560001,
|
||||
0xC78, 0xE3570001,
|
||||
0xC78, 0xE2580001,
|
||||
0xC78, 0xE1590001,
|
||||
0xC78, 0x8A5A0001,
|
||||
0xC78, 0x895B0001,
|
||||
0xC78, 0x885C0001,
|
||||
0xC78, 0x875D0001,
|
||||
0xC78, 0x865E0001,
|
||||
0xC78, 0x855F0001,
|
||||
0xC78, 0x84600001,
|
||||
0xC78, 0x83610001,
|
||||
0xC78, 0x82620001,
|
||||
0xC78, 0x6A630001,
|
||||
0xC78, 0x69640001,
|
||||
0xC78, 0x68650001,
|
||||
0xC78, 0x67660001,
|
||||
0xC78, 0x66670001,
|
||||
0xC78, 0x65680001,
|
||||
0xC78, 0x64690001,
|
||||
0xC78, 0x636A0001,
|
||||
0xC78, 0x626B0001,
|
||||
0xC78, 0x616C0001,
|
||||
0xC78, 0x606D0001,
|
||||
0xC78, 0x476E0001,
|
||||
0xC78, 0x466F0001,
|
||||
0xC78, 0x45700001,
|
||||
0xC78, 0x44710001,
|
||||
0xC78, 0x43720001,
|
||||
0xC78, 0x42730001,
|
||||
0xC78, 0x41740001,
|
||||
0xC78, 0x40750001,
|
||||
0xC78, 0x40760001,
|
||||
0xC78, 0x40770001,
|
||||
0xC78, 0x40780001,
|
||||
0xC78, 0x40790001,
|
||||
0xC78, 0x407A0001,
|
||||
0xC78, 0x407B0001,
|
||||
0xC78, 0x407C0001,
|
||||
0xC78, 0x407D0001,
|
||||
0xC78, 0x407E0001,
|
||||
0xC78, 0x407F0001,
|
||||
0xC50, 0x00040222,
|
||||
0xC50, 0x00040220,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0xC78, 0xFB400001,
|
||||
0xC78, 0xFB410001,
|
||||
0xC78, 0xFB420001,
|
||||
0xC78, 0xFB430001,
|
||||
0xC78, 0xFB440001,
|
||||
0xC78, 0xFB450001,
|
||||
0xC78, 0xFA460001,
|
||||
0xC78, 0xF9470001,
|
||||
0xC78, 0xF8480001,
|
||||
0xC78, 0xF7490001,
|
||||
0xC78, 0xF64A0001,
|
||||
0xC78, 0xF54B0001,
|
||||
0xC78, 0xF44C0001,
|
||||
0xC78, 0xF34D0001,
|
||||
0xC78, 0xF24E0001,
|
||||
0xC78, 0xF14F0001,
|
||||
0xC78, 0xF0500001,
|
||||
0xC78, 0xEF510001,
|
||||
0xC78, 0xEE520001,
|
||||
0xC78, 0xED530001,
|
||||
0xC78, 0xEC540001,
|
||||
0xC78, 0xEB550001,
|
||||
0xC78, 0xEA560001,
|
||||
0xC78, 0xE9570001,
|
||||
0xC78, 0xE8580001,
|
||||
0xC78, 0xE7590001,
|
||||
0xC78, 0xE65A0001,
|
||||
0xC78, 0xE55B0001,
|
||||
0xC78, 0xE45C0001,
|
||||
0xC78, 0xE35D0001,
|
||||
0xC78, 0xE25E0001,
|
||||
0xC78, 0xE15F0001,
|
||||
0xC78, 0x8A600001,
|
||||
0xC78, 0x89610001,
|
||||
0xC78, 0x88620001,
|
||||
0xC78, 0x87630001,
|
||||
0xC78, 0x86640001,
|
||||
0xC78, 0x85650001,
|
||||
0xC78, 0x84660001,
|
||||
0xC78, 0x83670001,
|
||||
0xC78, 0x82680001,
|
||||
0xC78, 0x6B690001,
|
||||
0xC78, 0x6A6A0001,
|
||||
0xC78, 0x696B0001,
|
||||
0xC78, 0x686C0001,
|
||||
0xC78, 0x676D0001,
|
||||
0xC78, 0x666E0001,
|
||||
0xC78, 0x656F0001,
|
||||
0xC78, 0x64700001,
|
||||
0xC78, 0x63710001,
|
||||
0xC78, 0x62720001,
|
||||
0xC78, 0x61730001,
|
||||
0xC78, 0x49740001,
|
||||
0xC78, 0x48750001,
|
||||
0xC78, 0x47760001,
|
||||
0xC78, 0x46770001,
|
||||
0xC78, 0x45780001,
|
||||
0xC78, 0x44790001,
|
||||
0xC78, 0x437A0001,
|
||||
0xC78, 0x427B0001,
|
||||
0xC78, 0x417C0001,
|
||||
0xC78, 0x407D0001,
|
||||
0xC78, 0x407E0001,
|
||||
0xC78, 0x407F0001,
|
||||
0xC50, 0x00040022,
|
||||
0xC50, 0x00040020,
|
||||
0xFF010718, 0xDEAD,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_AGC_TAB(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte _interface = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_MP_8192E_AGC_TAB)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_MP_8192E_AGC_TAB;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += _interface << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8192E_AGC_TAB, hex = 0x%X\n", hex));
|
||||
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigBB_AGC_8192E(pDM_Odm, v1, bMaskDWord, v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigBB_AGC_8192E(pDM_Odm, v1, bMaskDWord, v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_MP_8192E_PHY_REG[] = {
|
||||
0x800, 0x80040000,
|
||||
0x804, 0x00000003,
|
||||
0x808, 0x0000FC00,
|
||||
0x80C, 0x0000000A,
|
||||
0x810, 0x10001331,
|
||||
0x814, 0x020C3D10,
|
||||
0x818, 0x02220385,
|
||||
0x81C, 0x00000000,
|
||||
0x820, 0x01000100,
|
||||
0x824, 0x00390204,
|
||||
0x828, 0x01000100,
|
||||
0x82C, 0x00390204,
|
||||
0x830, 0x32323232,
|
||||
0x834, 0x30303030,
|
||||
0x838, 0x30303030,
|
||||
0x83C, 0x30303030,
|
||||
0x840, 0x00010000,
|
||||
0x844, 0x00010000,
|
||||
0x848, 0x28282828,
|
||||
0x84C, 0x28282828,
|
||||
0x850, 0x00000000,
|
||||
0x854, 0x00000000,
|
||||
0x858, 0x009A009A,
|
||||
0x85C, 0x01000014,
|
||||
0x860, 0x66F60000,
|
||||
0x864, 0x061F0000,
|
||||
0x868, 0x30303030,
|
||||
0x86C, 0x30303030,
|
||||
0x870, 0x00000000,
|
||||
0x874, 0x55004200,
|
||||
0x878, 0x08080808,
|
||||
0x87C, 0x00000000,
|
||||
0x880, 0xB0000C1C,
|
||||
0x884, 0x00000001,
|
||||
0x888, 0x00000000,
|
||||
0x88C, 0xCC0000C0,
|
||||
0x890, 0x00000800,
|
||||
0x894, 0xFFFFFFFE,
|
||||
0x898, 0x40302010,
|
||||
0x900, 0x00000000,
|
||||
0x904, 0x00000023,
|
||||
0x908, 0x00000000,
|
||||
0x90C, 0x81121313,
|
||||
0x910, 0x806C0001,
|
||||
0x914, 0x00000001,
|
||||
0x918, 0x00000000,
|
||||
0x91C, 0x00010000,
|
||||
0x924, 0x00000001,
|
||||
0x928, 0x00000000,
|
||||
0x92C, 0x00000000,
|
||||
0x930, 0x00000000,
|
||||
0x934, 0x00000000,
|
||||
0x938, 0x00000000,
|
||||
0x93C, 0x00000000,
|
||||
0x940, 0x00000000,
|
||||
0x944, 0x00000000,
|
||||
0x94C, 0x00000008,
|
||||
0xA00, 0x00D0C7C8,
|
||||
0xA04, 0x81FF000C,
|
||||
0xA08, 0x8C838300,
|
||||
0xA0C, 0x2E68120F,
|
||||
0xA10, 0x95009B78,
|
||||
0xA14, 0x1114D028,
|
||||
0xA18, 0x00881117,
|
||||
0xA1C, 0x89140F00,
|
||||
0xA20, 0x1A1B0000,
|
||||
0xA24, 0x090E1317,
|
||||
0xA28, 0x00000204,
|
||||
0xA2C, 0x00D30000,
|
||||
0xA70, 0x101FFF00,
|
||||
0xA74, 0x00000007,
|
||||
0xA78, 0x00000900,
|
||||
0xA7C, 0x225B0606,
|
||||
0xA80, 0x218075B1,
|
||||
0xB38, 0x00000000,
|
||||
0xC00, 0x48071D40,
|
||||
0xC04, 0x03A05633,
|
||||
0xC08, 0x000000E4,
|
||||
0xC0C, 0x6C6C6C6C,
|
||||
0xC10, 0x08800000,
|
||||
0xC14, 0x40000100,
|
||||
0xC18, 0x08800000,
|
||||
0xC1C, 0x40000100,
|
||||
0xC20, 0x00000000,
|
||||
0xC24, 0x00000000,
|
||||
0xC28, 0x00000000,
|
||||
0xC2C, 0x00000000,
|
||||
0xC30, 0x69E9AC47,
|
||||
0xC34, 0x469652AF,
|
||||
0xC38, 0x49795994,
|
||||
0xC3C, 0x0A97971C,
|
||||
0xC40, 0x1F7C403F,
|
||||
0xC44, 0x000100B7,
|
||||
0xC48, 0xEC020107,
|
||||
0xC4C, 0x007F037F,
|
||||
0xFF010718, 0xABCD,
|
||||
0xC50, 0x00340220,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0xC50, 0x00340020,
|
||||
0xFF010718, 0xDEAD,
|
||||
0xC54, 0x0080801F,
|
||||
0xFF010718, 0xABCD,
|
||||
0xC58, 0x00000220,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0xC58, 0x00000020,
|
||||
0xFF010718, 0xDEAD,
|
||||
0xC5C, 0x00248492,
|
||||
0xC60, 0x00000000,
|
||||
0xC64, 0x7112848B,
|
||||
0xC68, 0x47C00BFF,
|
||||
0xC6C, 0x00000036,
|
||||
0xC70, 0x00000600,
|
||||
0xC74, 0x02013169,
|
||||
0xC78, 0x0000001F,
|
||||
0xC7C, 0x00B91612,
|
||||
0xFF010718, 0xABCD,
|
||||
0xC80, 0x2D4000B5,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0xC80, 0x40000100,
|
||||
0xFF010718, 0xDEAD,
|
||||
0xC84, 0x21F60000,
|
||||
0xFF010718, 0xABCD,
|
||||
0xC88, 0x2D4000B5,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0xC88, 0x40000100,
|
||||
0xFF010718, 0xDEAD,
|
||||
0xC8C, 0xA0E40000,
|
||||
0xC90, 0x00121820,
|
||||
0xC94, 0x00000000,
|
||||
0xC98, 0x00121820,
|
||||
0xC9C, 0x00007F7F,
|
||||
0xCA0, 0x00000000,
|
||||
0xCA4, 0x000300A0,
|
||||
0xCA8, 0x00000000,
|
||||
0xCAC, 0x00000000,
|
||||
0xCB0, 0x00000000,
|
||||
0xCB4, 0x00000000,
|
||||
0xCB8, 0x00000000,
|
||||
0xCBC, 0x28000000,
|
||||
0xCC0, 0x00000000,
|
||||
0xCC4, 0x00000000,
|
||||
0xCC8, 0x00000000,
|
||||
0xCCC, 0x00000000,
|
||||
0xCD0, 0x00000000,
|
||||
0xCD4, 0x00000000,
|
||||
0xCD8, 0x64B22427,
|
||||
0xCDC, 0x00766932,
|
||||
0xCE0, 0x00222222,
|
||||
0xCE4, 0x00040000,
|
||||
0xCE8, 0x77644302,
|
||||
0xCEC, 0x2F97D40C,
|
||||
0xD00, 0x00080740,
|
||||
0xD04, 0x00020403,
|
||||
0xD08, 0x0000907F,
|
||||
0xD0C, 0x20010201,
|
||||
0xD10, 0xA0633333,
|
||||
0xD14, 0x3333BC43,
|
||||
0xD18, 0x7A8F5B6B,
|
||||
0xD1C, 0x0000007F,
|
||||
0xD2C, 0xCC979975,
|
||||
0xD30, 0x00000000,
|
||||
0xD34, 0x80608000,
|
||||
0xD38, 0x00000000,
|
||||
0xD3C, 0x00127353,
|
||||
0xD40, 0x00000000,
|
||||
0xD44, 0x00000000,
|
||||
0xD48, 0x00000000,
|
||||
0xD4C, 0x00000000,
|
||||
0xD50, 0x6437140A,
|
||||
0xD54, 0x00000000,
|
||||
0xD58, 0x00000282,
|
||||
0xD5C, 0x30032064,
|
||||
0xD60, 0x4653DE68,
|
||||
0xD64, 0x04518A3C,
|
||||
0xD68, 0x00002101,
|
||||
0xD6C, 0x2A201C16,
|
||||
0xD70, 0x1812362E,
|
||||
0xD74, 0x322C2220,
|
||||
0xD78, 0x000E3C24,
|
||||
0xD80, 0x01081008,
|
||||
0xD84, 0x00000800,
|
||||
0xD88, 0xF0B50000,
|
||||
0xE00, 0x30303030,
|
||||
0xE04, 0x30303030,
|
||||
0xE08, 0x03903030,
|
||||
0xE10, 0x30303030,
|
||||
0xE14, 0x30303030,
|
||||
0xE18, 0x30303030,
|
||||
0xE1C, 0x30303030,
|
||||
0xE28, 0x00000000,
|
||||
0xE30, 0x1000DC1F,
|
||||
0xE34, 0x10008C1F,
|
||||
0xE38, 0x02140102,
|
||||
0xE3C, 0x681604C2,
|
||||
0xE40, 0x01007C00,
|
||||
0xE44, 0x01004800,
|
||||
0xE48, 0xFB000000,
|
||||
0xE4C, 0x000028D1,
|
||||
0xE50, 0x1000DC1F,
|
||||
0xE54, 0x10008C1F,
|
||||
0xE58, 0x02140102,
|
||||
0xE5C, 0x28160D05,
|
||||
0xE60, 0x00000008,
|
||||
0xE68, 0x0FC05656,
|
||||
0xE6C, 0x03C09696,
|
||||
0xE70, 0x03C09696,
|
||||
0xE74, 0x0C005656,
|
||||
0xE78, 0x0C005656,
|
||||
0xE7C, 0x0C005656,
|
||||
0xE80, 0x0C005656,
|
||||
0xE84, 0x03C09696,
|
||||
0xE88, 0x0C005656,
|
||||
0xE8C, 0x03C09696,
|
||||
0xED0, 0x03C09696,
|
||||
0xED4, 0x03C09696,
|
||||
0xED8, 0x03C09696,
|
||||
0xEDC, 0x0000D6D6,
|
||||
0xEE0, 0x0000D6D6,
|
||||
0xEEC, 0x0FC01616,
|
||||
0xEE4, 0xB0000C1C,
|
||||
0xEE8, 0x00000001,
|
||||
0xF14, 0x00000003,
|
||||
0xF4C, 0x00000000,
|
||||
0xF00, 0x00000300,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_PHY_REG(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte _interface = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_MP_8192E_PHY_REG)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_MP_8192E_PHY_REG;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += _interface << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8192E_PHY_REG, hex = 0x%X\n", hex));
|
||||
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigBB_PHY_8192E(pDM_Odm, v1, bMaskDWord, v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigBB_PHY_8192E(pDM_Odm, v1, bMaskDWord, v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_PG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_MP_8192E_PHY_REG_PG[] = {
|
||||
0, 0, 0, 0x00000e08, 0x0000ff00, 0x00003200,
|
||||
0, 0, 1, 0x00000e08, 0x0000ff00, 0x00003200,
|
||||
0, 0, 0, 0x0000086c, 0xffffff00, 0x32323200,
|
||||
0, 0, 1, 0x0000086c, 0xffffff00, 0x32323200,
|
||||
0, 0, 0, 0x00000e00, 0xffffffff, 0x36364040,
|
||||
0, 0, 1, 0x00000e00, 0xffffffff, 0x34343636,
|
||||
0, 0, 0, 0x00000e04, 0xffffffff, 0x28283234,
|
||||
0, 0, 1, 0x00000e04, 0xffffffff, 0x28283032,
|
||||
0, 0, 0, 0x00000e10, 0xffffffff, 0x38383840,
|
||||
0, 0, 1, 0x00000e10, 0xffffffff, 0x34363840,
|
||||
0, 0, 0, 0x00000e14, 0xffffffff, 0x26283038,
|
||||
0, 0, 1, 0x00000e14, 0xffffffff, 0x26283032,
|
||||
0, 0, 1, 0x00000e18, 0xffffffff, 0x36384040,
|
||||
0, 0, 1, 0x00000e1c, 0xffffffff, 0x24262832,
|
||||
0, 1, 0, 0x00000838, 0xffffff00, 0x32323200,
|
||||
0, 1, 1, 0x00000838, 0xffffff00, 0x32323200,
|
||||
0, 1, 0, 0x0000086c, 0x000000ff, 0x00000032,
|
||||
0, 1, 1, 0x0000086c, 0x000000ff, 0x00000032,
|
||||
0, 1, 0, 0x00000830, 0xffffffff, 0x36364040,
|
||||
0, 1, 1, 0x00000830, 0xffffffff, 0x34343636,
|
||||
0, 1, 0, 0x00000834, 0xffffffff, 0x28283234,
|
||||
0, 1, 1, 0x00000834, 0xffffffff, 0x28283032,
|
||||
0, 1, 0, 0x0000083c, 0xffffffff, 0x38383840,
|
||||
0, 1, 1, 0x0000083c, 0xffffffff, 0x34363840,
|
||||
0, 1, 0, 0x00000848, 0xffffffff, 0x26283038,
|
||||
0, 1, 1, 0x00000848, 0xffffffff, 0x26283032,
|
||||
0, 1, 1, 0x0000084c, 0xffffffff, 0x36384040,
|
||||
0, 1, 1, 0x00000868, 0xffffffff, 0x24262832
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_PHY_REG_PG(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte _interface = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_MP_8192E_PHY_REG_PG)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_MP_8192E_PHY_REG_PG;
|
||||
|
||||
pDM_Odm->PhyRegPgVersion = 1;
|
||||
pDM_Odm->PhyRegPgValueType = PHY_REG_PG_EXACT_VALUE;
|
||||
hex += board;
|
||||
hex += _interface << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
for (i = 0; i < ArrayLen; i += 6 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
u4Byte v3 = Array[i+2];
|
||||
u4Byte v4 = Array[i+3];
|
||||
u4Byte v5 = Array[i+4];
|
||||
u4Byte v6 = Array[i+5];
|
||||
|
||||
// this line is a line of pure_body
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigBB_PHY_REG_PG_8192E(pDM_Odm, v1, v2, v3, v4, v5, v6);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // this line is the start of branch
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // don't need the hw_body
|
||||
i += 2; // skip the pair of expression
|
||||
v1 = Array[i];
|
||||
v2 = Array[i+1];
|
||||
v3 = Array[i+2];
|
||||
while (v2 != 0xDEAD)
|
||||
{
|
||||
i += 3;
|
||||
v1 = Array[i];
|
||||
v2 = Array[i+1];
|
||||
v3 = Array[i+1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 (RTL8192E_SUPPORT == 1)
|
||||
#ifndef __INC_MP_BB_HW_IMG_8192E_H
|
||||
#define __INC_MP_BB_HW_IMG_8192E_H
|
||||
|
||||
//static BOOLEAN CheckCondition(const u4Byte Condition, const u4Byte Hex);
|
||||
|
||||
/******************************************************************************
|
||||
* AGC_TAB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_AGC_TAB( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_PHY_REG( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* PHY_REG_PG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_PHY_REG_PG( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,61 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 (RTL8192E_SUPPORT == 1)
|
||||
#ifndef __INC_MP_FW_HW_IMG_8192E_H
|
||||
#define __INC_MP_FW_HW_IMG_8192E_H
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* FW_AP.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadFirmware_MP_8192E_FW_AP(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT u1Byte *pFirmware,
|
||||
OUT u4Byte *pFirmwareSize
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* FW_NIC.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadFirmware_MP_8192E_FW_NIC(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT u1Byte *pFirmware,
|
||||
OUT u4Byte *pFirmwareSize
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* FW_WoWLAN.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadFirmware_MP_8192E_FW_WoWLAN(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT u1Byte *pFirmware,
|
||||
OUT u4Byte *pFirmwareSize
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,61 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 (RTL8192E_SUPPORT == 1)
|
||||
#ifndef __INC_MP_FW_HW_IMG_8192E_H
|
||||
#define __INC_MP_FW_HW_IMG_8192E_H
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* FW_AP.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadFirmware_MP_8192E_FW_AP_WoWLAN(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT u1Byte *pFirmware,
|
||||
OUT u4Byte *pFirmwareSize
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* FW_NIC.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadFirmware_MP_8192E_FW_NIC(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT u1Byte *pFirmware,
|
||||
OUT u4Byte *pFirmwareSize
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* FW_WoWLAN.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadFirmware_MP_8192E_FW_WoWLAN(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT u1Byte *pFirmware,
|
||||
OUT u4Byte *pFirmwareSize
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
|
@ -0,0 +1,236 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8192E_SUPPORT == 1)
|
||||
static BOOLEAN
|
||||
CheckCondition(
|
||||
const u4Byte Condition,
|
||||
const u4Byte Hex
|
||||
)
|
||||
{
|
||||
u4Byte _board = (Hex & 0x000000FF);
|
||||
u4Byte _interface = (Hex & 0x0000FF00) >> 8;
|
||||
u4Byte _platform = (Hex & 0x00FF0000) >> 16;
|
||||
u4Byte cond = Condition;
|
||||
|
||||
if ( Condition == 0xCDCDCDCD )
|
||||
return TRUE;
|
||||
|
||||
cond = Condition & 0x000000FF;
|
||||
if ( (_board != cond) && (cond != 0xFF) )
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x0000FF00;
|
||||
cond = cond >> 8;
|
||||
if ( ((_interface & cond) == 0) && (cond != 0x07) )
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x00FF0000;
|
||||
cond = cond >> 16;
|
||||
if ( ((_platform & cond) == 0) && (cond != 0x0F) )
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* MAC_REG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_MP_8192E_MAC_REG[] = {
|
||||
0x011, 0x000000EB,
|
||||
0x012, 0x00000007,
|
||||
0x014, 0x00000075,
|
||||
0x303, 0x000000A7,
|
||||
0x428, 0x0000000A,
|
||||
0x429, 0x00000010,
|
||||
0x430, 0x00000000,
|
||||
0x431, 0x00000000,
|
||||
0x432, 0x00000000,
|
||||
0x433, 0x00000001,
|
||||
0x434, 0x00000004,
|
||||
0x435, 0x00000005,
|
||||
0x436, 0x00000007,
|
||||
0x437, 0x00000008,
|
||||
0x43C, 0x00000004,
|
||||
0x43D, 0x00000005,
|
||||
0x43E, 0x00000007,
|
||||
0x43F, 0x00000008,
|
||||
0x440, 0x0000005D,
|
||||
0x441, 0x00000001,
|
||||
0x442, 0x00000000,
|
||||
0x444, 0x00000010,
|
||||
0x445, 0x00000000,
|
||||
0x446, 0x00000000,
|
||||
0x447, 0x00000000,
|
||||
0x448, 0x00000000,
|
||||
0x449, 0x000000F0,
|
||||
0x44A, 0x0000000F,
|
||||
0x44B, 0x0000003E,
|
||||
0x44C, 0x00000010,
|
||||
0x44D, 0x00000000,
|
||||
0x44E, 0x00000000,
|
||||
0x44F, 0x00000000,
|
||||
0x450, 0x00000000,
|
||||
0x451, 0x000000F0,
|
||||
0x452, 0x0000000F,
|
||||
0x453, 0x00000000,
|
||||
0x456, 0x0000005E,
|
||||
0x460, 0x00000066,
|
||||
0x461, 0x00000066,
|
||||
0x4C8, 0x000000FF,
|
||||
0x4C9, 0x00000008,
|
||||
0x4CC, 0x000000FF,
|
||||
0x4CD, 0x000000FF,
|
||||
0x4CE, 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,
|
||||
0x540, 0x00000012,
|
||||
0x541, 0x00000064,
|
||||
0x550, 0x00000010,
|
||||
0x551, 0x00000010,
|
||||
0x559, 0x00000002,
|
||||
0x55C, 0x00000050,
|
||||
0x55D, 0x000000FF,
|
||||
0x605, 0x00000030,
|
||||
0x608, 0x0000000E,
|
||||
0x609, 0x0000002A,
|
||||
0x620, 0x000000FF,
|
||||
0x621, 0x000000FF,
|
||||
0x622, 0x000000FF,
|
||||
0x623, 0x000000FF,
|
||||
0x624, 0x000000FF,
|
||||
0x625, 0x000000FF,
|
||||
0x626, 0x000000FF,
|
||||
0x627, 0x000000FF,
|
||||
0x638, 0x00000050,
|
||||
0x63C, 0x0000000A,
|
||||
0x63D, 0x0000000A,
|
||||
0x63E, 0x0000000E,
|
||||
0x63F, 0x0000000E,
|
||||
0x640, 0x00000040,
|
||||
0x642, 0x00000040,
|
||||
0x643, 0x00000000,
|
||||
0x652, 0x000000C8,
|
||||
0x66E, 0x00000005,
|
||||
0x700, 0x00000021,
|
||||
0x701, 0x00000043,
|
||||
0x702, 0x00000065,
|
||||
0x703, 0x00000087,
|
||||
0x708, 0x00000021,
|
||||
0x709, 0x00000043,
|
||||
0x70A, 0x00000065,
|
||||
0x70B, 0x00000087,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_MAC_REG(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte _interface = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_MP_8192E_MAC_REG)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_MP_8192E_MAC_REG;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += _interface << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8192E_MAC_REG, hex = 0x%X\n", hex));
|
||||
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigMAC_8192E(pDM_Odm, v1, (u1Byte)v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigMAC_8192E(pDM_Odm, v1, (u1Byte)v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 (RTL8192E_SUPPORT == 1)
|
||||
#ifndef __INC_MP_MAC_HW_IMG_8192E_H
|
||||
#define __INC_MP_MAC_HW_IMG_8192E_H
|
||||
|
||||
//static BOOLEAN CheckCondition(const u4Byte Condition, const u4Byte Hex);
|
||||
|
||||
/******************************************************************************
|
||||
* MAC_REG.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_MAC_REG( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
|
@ -0,0 +1,988 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8192E_SUPPORT == 1)
|
||||
static BOOLEAN
|
||||
CheckCondition(
|
||||
const u4Byte Condition,
|
||||
const u4Byte Hex
|
||||
)
|
||||
{
|
||||
u4Byte _board = (Hex & 0x000000FF);
|
||||
u4Byte _interface = (Hex & 0x0000FF00) >> 8;
|
||||
u4Byte _platform = (Hex & 0x00FF0000) >> 16;
|
||||
u4Byte cond = Condition;
|
||||
|
||||
if ( Condition == 0xCDCDCDCD )
|
||||
return TRUE;
|
||||
|
||||
cond = Condition & 0x000000FF;
|
||||
if ( (_board != cond) && (cond != 0xFF) )
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x0000FF00;
|
||||
cond = cond >> 8;
|
||||
if ( ((_interface & cond) == 0) && (cond != 0x07) )
|
||||
return FALSE;
|
||||
|
||||
cond = Condition & 0x00FF0000;
|
||||
cond = cond >> 16;
|
||||
if ( ((_platform & cond) == 0) && (cond != 0x0F) )
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* RadioA.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_MP_8192E_RadioA[] = {
|
||||
0x07F, 0x00000082,
|
||||
0x081, 0x0003FC00,
|
||||
0x000, 0x00030000,
|
||||
0x008, 0x00008400,
|
||||
0x018, 0x00000407,
|
||||
0x019, 0x00000012,
|
||||
0x01B, 0x00000064,
|
||||
0x01E, 0x00080009,
|
||||
0x01F, 0x00000880,
|
||||
0x02F, 0x0001A060,
|
||||
0x03F, 0x00000000,
|
||||
0x042, 0x000060C0,
|
||||
0x057, 0x000D0000,
|
||||
0x058, 0x000BE180,
|
||||
0x067, 0x00001552,
|
||||
0x083, 0x00000000,
|
||||
0x0B0, 0x000FF9F1,
|
||||
0x0B1, 0x00055418,
|
||||
0x0B2, 0x0008CC00,
|
||||
0x0B4, 0x00043083,
|
||||
0x0B5, 0x00008166,
|
||||
0x0B6, 0x0000803E,
|
||||
0x0B7, 0x0001C69F,
|
||||
0x0B8, 0x0000407F,
|
||||
0x0B9, 0x00080001,
|
||||
0x0BA, 0x00040001,
|
||||
0x0BB, 0x00000400,
|
||||
0x0BF, 0x000C0000,
|
||||
0x0C2, 0x00002400,
|
||||
0x0C3, 0x00000009,
|
||||
0x0C4, 0x00040C91,
|
||||
0x0C5, 0x00099999,
|
||||
0x0C6, 0x000000A3,
|
||||
0x0C7, 0x00088820,
|
||||
0x0C8, 0x00076C06,
|
||||
0x0C9, 0x00000000,
|
||||
0x0CA, 0x00080000,
|
||||
0x0DF, 0x00000180,
|
||||
0x0EF, 0x000001A0,
|
||||
0x051, 0x00069545,
|
||||
0x052, 0x0007E45E,
|
||||
0x053, 0x00000071,
|
||||
0x056, 0x00051FF3,
|
||||
0x035, 0x000000A8,
|
||||
0x035, 0x000001E2,
|
||||
0x035, 0x000002A8,
|
||||
0x036, 0x00001C24,
|
||||
0x036, 0x00009C24,
|
||||
0x036, 0x00011C24,
|
||||
0x036, 0x00019C24,
|
||||
0x018, 0x00000C07,
|
||||
0x05A, 0x00048000,
|
||||
0x019, 0x000739D0,
|
||||
0xFF010718, 0xABCD,
|
||||
0x034, 0x0000A093,
|
||||
0x034, 0x0000908F,
|
||||
0x034, 0x0000808C,
|
||||
0x034, 0x0000704D,
|
||||
0x034, 0x0000604A,
|
||||
0x034, 0x00005047,
|
||||
0x034, 0x0000400A,
|
||||
0x034, 0x00003007,
|
||||
0x034, 0x00002004,
|
||||
0x034, 0x00001001,
|
||||
0x034, 0x00000000,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x034, 0x0000ADD7,
|
||||
0x034, 0x00009DD4,
|
||||
0x034, 0x00008DD1,
|
||||
0x034, 0x00007DCE,
|
||||
0x034, 0x00006DCB,
|
||||
0x034, 0x00005DC8,
|
||||
0x034, 0x00004DC5,
|
||||
0x034, 0x000034CC,
|
||||
0x034, 0x0000244F,
|
||||
0x034, 0x0000144C,
|
||||
0x034, 0x00000014,
|
||||
0xFF010718, 0xDEAD,
|
||||
0x000, 0x00030159,
|
||||
0x084, 0x00068180,
|
||||
0x086, 0x0000014E,
|
||||
0x087, 0x00048E00,
|
||||
0x08E, 0x00065540,
|
||||
0x08F, 0x00088000,
|
||||
0x0EF, 0x000020A0,
|
||||
0xFF010718, 0xABCD,
|
||||
0x03B, 0x000F07B0,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x03B, 0x000F02B0,
|
||||
0xFF010718, 0xDEAD,
|
||||
0x03B, 0x000EF7B0,
|
||||
0x03B, 0x000D4FB0,
|
||||
0x03B, 0x000CF060,
|
||||
0x03B, 0x000B0090,
|
||||
0x03B, 0x000A0080,
|
||||
0x03B, 0x00090080,
|
||||
0x03B, 0x0008F780,
|
||||
0xFF010718, 0xABCD,
|
||||
0x03B, 0x000787B0,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x03B, 0x00078730,
|
||||
0xFF010718, 0xDEAD,
|
||||
0x03B, 0x00060FB0,
|
||||
0x03B, 0x0005FFA0,
|
||||
0x03B, 0x00040620,
|
||||
0x03B, 0x00037090,
|
||||
0x03B, 0x00020080,
|
||||
0x03B, 0x0001F060,
|
||||
0x03B, 0x0000FFB0,
|
||||
0x0EF, 0x000000A0,
|
||||
0x0FE, 0x00000000,
|
||||
0x018, 0x0000FC07,
|
||||
0x0FE, 0x00000000,
|
||||
0x0FE, 0x00000000,
|
||||
0x0FE, 0x00000000,
|
||||
0x0FE, 0x00000000,
|
||||
0x01E, 0x00000001,
|
||||
0x01F, 0x00080000,
|
||||
0x000, 0x00033E70,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_RadioA(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte _interface = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_MP_8192E_RadioA)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_MP_8192E_RadioA;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += _interface << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8192E_RadioA, hex = 0x%X\n", hex));
|
||||
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigRF_RadioA_8192E(pDM_Odm, v1, v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigRF_RadioA_8192E(pDM_Odm, v1, v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* RadioB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u4Byte Array_MP_8192E_RadioB[] = {
|
||||
0x07F, 0x00000082,
|
||||
0x081, 0x0003FC00,
|
||||
0x000, 0x00030000,
|
||||
0x008, 0x00008400,
|
||||
0x018, 0x00000407,
|
||||
0x019, 0x00000012,
|
||||
0x01B, 0x00000064,
|
||||
0x01E, 0x00080009,
|
||||
0x01F, 0x00000880,
|
||||
0x02F, 0x0001A060,
|
||||
0x03F, 0x00000000,
|
||||
0x042, 0x000060C0,
|
||||
0x057, 0x000D0000,
|
||||
0x058, 0x000BE180,
|
||||
0x067, 0x00001552,
|
||||
0x07F, 0x00000082,
|
||||
0x081, 0x0003F000,
|
||||
0x083, 0x00000000,
|
||||
0x0DF, 0x00000180,
|
||||
0x0EF, 0x000001A0,
|
||||
0x051, 0x00069545,
|
||||
0x052, 0x0007E42E,
|
||||
0x053, 0x00000071,
|
||||
0x056, 0x00051FF3,
|
||||
0x035, 0x000000A8,
|
||||
0x035, 0x000001E0,
|
||||
0x035, 0x000002A8,
|
||||
0x036, 0x00001CA8,
|
||||
0x036, 0x00009C24,
|
||||
0x036, 0x00011C24,
|
||||
0x036, 0x00019C24,
|
||||
0x018, 0x00000C07,
|
||||
0x05A, 0x00048000,
|
||||
0x019, 0x000739D0,
|
||||
0xFF010718, 0xABCD,
|
||||
0x034, 0x0000A093,
|
||||
0x034, 0x0000908F,
|
||||
0x034, 0x0000808C,
|
||||
0x034, 0x0000704D,
|
||||
0x034, 0x0000604A,
|
||||
0x034, 0x00005047,
|
||||
0x034, 0x0000400A,
|
||||
0x034, 0x00003007,
|
||||
0x034, 0x00002004,
|
||||
0x034, 0x00001001,
|
||||
0x034, 0x00000000,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x034, 0x0000ADD7,
|
||||
0x034, 0x00009DD4,
|
||||
0x034, 0x00008DD1,
|
||||
0x034, 0x00007DCE,
|
||||
0x034, 0x00006DCB,
|
||||
0x034, 0x00005DC8,
|
||||
0x034, 0x00004DC5,
|
||||
0x034, 0x000034CC,
|
||||
0x034, 0x0000244F,
|
||||
0x034, 0x0000144C,
|
||||
0x034, 0x00000014,
|
||||
0xFF010718, 0xDEAD,
|
||||
0x000, 0x00030159,
|
||||
0x084, 0x00068180,
|
||||
0x086, 0x000000CE,
|
||||
0x087, 0x00048A00,
|
||||
0x08E, 0x00065540,
|
||||
0x08F, 0x00088000,
|
||||
0x0EF, 0x000020A0,
|
||||
0xFF010718, 0xABCD,
|
||||
0x03B, 0x000F07B0,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x03B, 0x000F02B0,
|
||||
0xFF010718, 0xDEAD,
|
||||
0x03B, 0x000EF7B0,
|
||||
0x03B, 0x000D4FB0,
|
||||
0x03B, 0x000CF060,
|
||||
0x03B, 0x000B0090,
|
||||
0x03B, 0x000A0080,
|
||||
0x03B, 0x00090080,
|
||||
0x03B, 0x0008F780,
|
||||
0xFF010718, 0xABCD,
|
||||
0x03B, 0x000787B0,
|
||||
0xCDCDCDCD, 0xCDCD,
|
||||
0x03B, 0x00078730,
|
||||
0xFF010718, 0xDEAD,
|
||||
0x03B, 0x00060FB0,
|
||||
0x03B, 0x0005FFA0,
|
||||
0x03B, 0x00040620,
|
||||
0x03B, 0x00037090,
|
||||
0x03B, 0x00020080,
|
||||
0x03B, 0x0001F060,
|
||||
0x03B, 0x0000FFB0,
|
||||
0x0EF, 0x000000A0,
|
||||
0x000, 0x00010159,
|
||||
0x0FE, 0x00000000,
|
||||
0x0FE, 0x00000000,
|
||||
0x0FE, 0x00000000,
|
||||
0x0FE, 0x00000000,
|
||||
0x01E, 0x00000001,
|
||||
0x01F, 0x00080000,
|
||||
0x000, 0x00033E70,
|
||||
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_RadioB(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
#define READ_NEXT_PAIR(v1, v2, i) do { i += 2; v1 = Array[i]; v2 = Array[i+1]; } while(0)
|
||||
|
||||
u4Byte hex = 0;
|
||||
u4Byte i = 0;
|
||||
u2Byte count = 0;
|
||||
pu4Byte ptr_array = NULL;
|
||||
u1Byte platform = pDM_Odm->SupportPlatform;
|
||||
u1Byte _interface = pDM_Odm->SupportInterface;
|
||||
u1Byte board = pDM_Odm->BoardType;
|
||||
u4Byte ArrayLen = sizeof(Array_MP_8192E_RadioB)/sizeof(u4Byte);
|
||||
pu4Byte Array = Array_MP_8192E_RadioB;
|
||||
|
||||
|
||||
hex += board;
|
||||
hex += _interface << 8;
|
||||
hex += platform << 16;
|
||||
hex += 0xFF000000;
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8192E_RadioB, hex = 0x%X\n", hex));
|
||||
|
||||
for (i = 0; i < ArrayLen; i += 2 )
|
||||
{
|
||||
u4Byte v1 = Array[i];
|
||||
u4Byte v2 = Array[i+1];
|
||||
|
||||
// This (offset, data) pair meets the condition.
|
||||
if ( v1 < 0xCDCDCDCD )
|
||||
{
|
||||
odm_ConfigRF_RadioB_8192E(pDM_Odm, v1, v2);
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{ // This line is the start line of branch.
|
||||
if ( !CheckCondition(Array[i], hex) )
|
||||
{ // Discard the following (offset, data) pairs.
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
i -= 2; // prevent from for-loop += 2
|
||||
}
|
||||
else // Configure matched pairs and skip to end of if-else.
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
while (v2 != 0xDEAD &&
|
||||
v2 != 0xCDEF &&
|
||||
v2 != 0xCDCD && i < ArrayLen -2)
|
||||
{
|
||||
odm_ConfigRF_RadioB_8192E(pDM_Odm, v1, v2);
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
while (v2 != 0xDEAD && i < ArrayLen -2)
|
||||
{
|
||||
READ_NEXT_PAIR(v1, v2, i);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_AP.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_AP_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_AP_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_AP_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 6, 7, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_AP_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_AP_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_AP_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_AP_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_AP_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_AP_8192E[] = {0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_AP_8192E[] = {0, 0, 0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_AP_8192E[] = {0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_AP_8192E[] = {0, 0, 0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_TxPowerTrack_AP(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_MP_8192E\n"));
|
||||
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE);
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE);
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_AP_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_PCIE.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_PCIE_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_PCIE_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_PCIE_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 6, 7, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_PCIE_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_PCIE_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_PCIE_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_PCIE_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_PCIE_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_PCIE_8192E[] = {0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_PCIE_8192E[] = {0, 0, 0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_PCIE_8192E[] = {0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_PCIE_8192E[] = {0, 0, 0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_TxPowerTrack_PCIE(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_MP_8192E\n"));
|
||||
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE);
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE);
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_PCIE_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_USB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_USB_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 1, 2, 2, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_USB_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 16, 17, 17, 18, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 19, 20, 20, 20},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_USB_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 1, 2, 3, 3, 4, 4, 5, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 14, 14, 14, 14},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 6, 7, 7, 8, 8, 9, 10, 11, 11, 12, 13, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 15, 16, 16, 16, 16, 16, 16, 16},
|
||||
};
|
||||
u1Byte gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_USB_8192E[][DELTA_SWINGIDX_SIZE] = {
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
{0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15, 16, 17, 18, 18, 19, 20, 21, 21, 21},
|
||||
};
|
||||
#if 0
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_USB_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_USB_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_USB_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_USB_8192E[] = {0, 0, 1, 2, 2, 2, 3, 3, 3, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_USB_8192E[] = {0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_USB_8192E[] = {0, 0, 0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_USB_8192E[] = {0, 0, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_USB_8192E[] = {0, 0, 0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
#else
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_USB_8192E[] = {0, 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 5, 7, 7, 7, 8, 9, 9, 9, 10, 10, 11, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_USB_8192E[] = {0, 0, 0, 1, 2, 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_USB_8192E[] = {0, 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 5, 7, 7, 7, 8, 9, 9, 9, 10, 10, 11, 12, 13, 14, 15} ;
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_USB_8192E[] = {0, 0, 0, 1, 2, 2, 2, 3, 4, 4, 5, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_USB_8192E[] = {0, 0, 1, 1, 2, 2, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_USB_8192E[] = {0, 0, 0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_USB_8192E[] = {0, 0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
u1Byte gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_USB_8192E[] = {0, 0, 0, 0, 1, 1, 1, 3, 3, 4, 4, 4, 4, 6, 6, 6, 6, 7, 7, 7, 9, 10, 10, 11, 11, 12, 12, 13, 14, 15};
|
||||
|
||||
#endif
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_TxPowerTrack_USB(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
PODM_RF_CAL_T pRFCalibrateInfo = &(pDM_Odm->RFCalibrateInfo);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_MP_8192E\n"));
|
||||
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_P, gDeltaSwingTableIdx_MP_2GA_P_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GA_N, gDeltaSwingTableIdx_MP_2GA_N_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_P, gDeltaSwingTableIdx_MP_2GB_P_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GB_N, gDeltaSwingTableIdx_MP_2GB_N_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE);
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_P, gDeltaSwingTableIdx_MP_2GCCKA_P_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKA_N, gDeltaSwingTableIdx_MP_2GCCKA_N_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_P, gDeltaSwingTableIdx_MP_2GCCKB_P_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_2GCCKB_N, gDeltaSwingTableIdx_MP_2GCCKB_N_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE);
|
||||
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_P, gDeltaSwingTableIdx_MP_5GA_P_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GA_N, gDeltaSwingTableIdx_MP_5GA_N_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_P, gDeltaSwingTableIdx_MP_5GB_P_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
ODM_MoveMemory(pDM_Odm, pRFCalibrateInfo->DeltaSwingTableIdx_5GB_N, gDeltaSwingTableIdx_MP_5GB_N_TxPowerTrack_USB_8192E, DELTA_SWINGIDX_SIZE*3);
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
* TXPWR_LMT.TXT
|
||||
******************************************************************************/
|
||||
|
||||
pu1Byte Array_MP_8192E_TXPWR_LMT[] = {
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "01", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "01", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "01", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "02", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "02", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "02", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "03", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "03", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "03", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "04", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "04", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "04", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "05", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "05", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "05", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "06", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "06", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "06", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "07", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "07", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "07", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "08", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "08", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "08", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "09", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "09", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "09", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "10", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "10", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "10", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "11", "34",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "11", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "11", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "12", "63",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "12", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "12", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "13", "63",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "13", "32",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "13", "32",
|
||||
"FCC", "2.4G", "20M", "CCK", "1T", "14", "63",
|
||||
"ETSI", "2.4G", "20M", "CCK", "1T", "14", "63",
|
||||
"MKK", "2.4G", "20M", "CCK", "1T", "14", "32",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "01", "30",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "01", "28",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "01", "28",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "02", "30",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "02", "28",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "02", "28",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "03", "34",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "03", "32",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "03", "34",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "04", "34",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "04", "32",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "04", "34",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "05", "34",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "05", "32",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "05", "34",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "06", "34",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "06", "32",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "06", "34",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "07", "34",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "07", "32",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "07", "34",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "08", "34",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "08", "32",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "08", "34",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "09", "30",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "09", "28",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "09", "28",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "10", "30",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "10", "28",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "10", "28",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "11", "30",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "11", "28",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "11", "28",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "12", "63",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "12", "28",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "12", "28",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "13", "63",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "13", "28",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "13", "28",
|
||||
"FCC", "2.4G", "20M", "OFDM", "1T", "14", "63",
|
||||
"ETSI", "2.4G", "20M", "OFDM", "1T", "14", "63",
|
||||
"MKK", "2.4G", "20M", "OFDM", "1T", "14", "63",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "01", "30",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "01", "28",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "01", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "02", "30",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "02", "28",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "02", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "03", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "03", "32",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "03", "34",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "04", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "04", "32",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "04", "34",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "05", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "05", "32",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "05", "34",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "06", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "06", "32",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "06", "34",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "07", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "07", "32",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "07", "34",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "08", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "08", "32",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "08", "34",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "09", "30",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "09", "28",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "09", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "10", "30",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "10", "28",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "10", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "11", "30",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "11", "28",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "11", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "12", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "12", "28",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "12", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "13", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "13", "28",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "13", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "1T", "14", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "1T", "14", "63",
|
||||
"MKK", "2.4G", "20M", "HT", "1T", "14", "63",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "01", "28",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "01", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "01", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "02", "28",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "02", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "02", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "03", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "03", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "03", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "04", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "04", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "04", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "05", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "05", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "05", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "06", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "06", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "06", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "07", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "07", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "07", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "08", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "08", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "08", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "09", "26",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "09", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "09", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "10", "26",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "10", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "10", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "11", "26",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "11", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "11", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "12", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "12", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "12", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "13", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "13", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "13", "28",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "14", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "14", "63",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "14", "63",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "01", "28",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "01", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "01", "26",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "02", "28",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "02", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "02", "26",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "03", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "03", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "03", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "04", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "04", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "04", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "05", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "05", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "05", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "06", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "06", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "06", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "07", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "07", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "07", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "08", "34",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "08", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "08", "30",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "09", "28",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "09", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "09", "26",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "10", "28",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "10", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "10", "26",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "11", "28",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "11", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "11", "26",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "12", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "12", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "12", "26",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "13", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "13", "26",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "13", "26",
|
||||
"FCC", "2.4G", "20M", "HT", "2T", "14", "63",
|
||||
"ETSI", "2.4G", "20M", "HT", "2T", "14", "63",
|
||||
"MKK", "2.4G", "20M", "HT", "2T", "14", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "01", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "01", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "01", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "02", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "02", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "02", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "03", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "03", "28",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "03", "28",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "04", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "04", "28",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "04", "28",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "05", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "05", "28",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "05", "28",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "06", "32",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "06", "32",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "06", "30",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "07", "32",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "07", "32",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "07", "30",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "08", "32",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "08", "32",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "08", "30",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "09", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "09", "28",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "09", "28",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "10", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "10", "28",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "10", "28",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "11", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "11", "28",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "11", "28",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "12", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "12", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "12", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "13", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "13", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "13", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "1T", "14", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "1T", "14", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "1T", "14", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "01", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "01", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "01", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "02", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "02", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "02", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "03", "20",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "03", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "03", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "04", "20",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "04", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "04", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "05", "20",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "05", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "05", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "06", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "06", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "06", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "07", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "07", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "07", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "08", "28",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "08", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "08", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "09", "22",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "09", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "09", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "10", "22",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "10", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "10", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "11", "22",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "11", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "11", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "12", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "12", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "12", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "13", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "13", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "13", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "14", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "14", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "14", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "01", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "01", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "01", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "02", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "02", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "02", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "03", "26",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "03", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "03", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "04", "26",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "04", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "04", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "05", "26",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "05", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "05", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "06", "30",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "06", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "06", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "07", "30",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "07", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "07", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "08", "30",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "08", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "08", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "09", "26",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "09", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "09", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "10", "26",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "10", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "10", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "11", "26",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "11", "26",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "11", "26",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "12", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "12", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "12", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "13", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "13", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "13", "63",
|
||||
"FCC", "2.4G", "40M", "HT", "2T", "14", "63",
|
||||
"ETSI", "2.4G", "40M", "HT", "2T", "14", "63",
|
||||
"MKK", "2.4G", "40M", "HT", "2T", "14", "63"
|
||||
};
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_TXPWR_LMT(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
u4Byte i = 0;
|
||||
u4Byte ArrayLen = sizeof(Array_MP_8192E_TXPWR_LMT)/sizeof(pu1Byte);
|
||||
pu1Byte *Array = Array_MP_8192E_TXPWR_LMT;
|
||||
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm, ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ReadAndConfig_MP_8192E_TXPWR_LMT\n"));
|
||||
|
||||
for (i = 0; i < ArrayLen; i += 7 )
|
||||
{
|
||||
pu1Byte regulation = Array[i];
|
||||
pu1Byte band = Array[i+1];
|
||||
pu1Byte bandwidth = Array[i+2];
|
||||
pu1Byte rate = Array[i+3];
|
||||
pu1Byte rfPath = Array[i+4];
|
||||
pu1Byte chnl = Array[i+5];
|
||||
pu1Byte val = Array[i+6];
|
||||
|
||||
odm_ConfigBB_TXPWR_LMT_8192E(pDM_Odm, regulation, band, bandwidth, rate, rfPath, chnl, val);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 (RTL8192E_SUPPORT == 1)
|
||||
#ifndef __INC_MP_RF_HW_IMG_8192E_H
|
||||
#define __INC_MP_RF_HW_IMG_8192E_H
|
||||
|
||||
//static BOOLEAN CheckCondition(const u4Byte Condition, const u4Byte Hex);
|
||||
|
||||
/******************************************************************************
|
||||
* RadioA.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_RadioA( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* RadioB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_RadioB( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_AP.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_TxPowerTrack_AP( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_PCIE.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_TxPowerTrack_PCIE( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* TxPowerTrack_USB.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_TxPowerTrack_USB( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
/******************************************************************************
|
||||
* TXPWR_LMT.TXT
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
ODM_ReadAndConfig_MP_8192E_TXPWR_LMT( // TC: Test Chip, MP: MP Chip
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#endif
|
||||
#endif // end of HWIMG_SUPPORT
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,131 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 __HAL_PHY_RF_8192E_H__
|
||||
#define __HAL_PHY_RF_8192E_H__
|
||||
|
||||
/*--------------------------Define Parameters-------------------------------*/
|
||||
#define IQK_DELAY_TIME_92E 10 //ms
|
||||
#define index_mapping_NUM_92E 15
|
||||
#define AVG_THERMAL_NUM_92E 4
|
||||
|
||||
#include "../HalPhyRf.h"
|
||||
|
||||
void ConfigureTxpowerTrack_8192E(
|
||||
PTXPWRTRACK_CFG pConfig
|
||||
);
|
||||
|
||||
VOID
|
||||
GetDeltaSwingTable_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
OUT pu1Byte *TemperatureUP_A,
|
||||
OUT pu1Byte *TemperatureDOWN_A,
|
||||
OUT pu1Byte *TemperatureUP_B,
|
||||
OUT pu1Byte *TemperatureDOWN_B
|
||||
);
|
||||
|
||||
void DoIQK_8192E(
|
||||
PDM_ODM_T pDM_Odm,
|
||||
u1Byte DeltaThermalIndex,
|
||||
u1Byte ThermalValue,
|
||||
u1Byte Threshold
|
||||
);
|
||||
|
||||
VOID
|
||||
ODM_TxPwrTrackSetPwr92E(
|
||||
PDM_ODM_T pDM_Odm,
|
||||
PWRTRACK_METHOD Method,
|
||||
u1Byte RFPath,
|
||||
u1Byte ChannelMappedIndex
|
||||
);
|
||||
|
||||
//1 7. IQK
|
||||
|
||||
void
|
||||
PHY_IQCalibrate_8192E(
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
#else
|
||||
IN PADAPTER Adapter,
|
||||
#endif
|
||||
IN BOOLEAN bReCovery);
|
||||
|
||||
|
||||
//
|
||||
// LC calibrate
|
||||
//
|
||||
void
|
||||
PHY_LCCalibrate_8192E(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
//
|
||||
// AP calibrate
|
||||
//
|
||||
void
|
||||
PHY_APCalibrate_8192E(
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
#else
|
||||
IN PADAPTER pAdapter,
|
||||
#endif
|
||||
IN s1Byte delta);
|
||||
void
|
||||
PHY_DigitalPredistortion_8192E( IN PADAPTER pAdapter);
|
||||
|
||||
|
||||
VOID
|
||||
_PHY_SaveADDARegisters_92E(
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
#else
|
||||
IN PADAPTER pAdapter,
|
||||
#endif
|
||||
IN pu4Byte ADDAReg,
|
||||
IN pu4Byte ADDABackup,
|
||||
IN u4Byte RegisterNum
|
||||
);
|
||||
|
||||
VOID
|
||||
_PHY_PathADDAOn_92E(
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
#else
|
||||
IN PADAPTER pAdapter,
|
||||
#endif
|
||||
IN pu4Byte ADDAReg,
|
||||
IN BOOLEAN isPathAOn,
|
||||
IN BOOLEAN is2T
|
||||
);
|
||||
|
||||
VOID
|
||||
_PHY_MACSettingCalibration_92E(
|
||||
#if (DM_ODM_SUPPORT_TYPE & ODM_AP)
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
#else
|
||||
IN PADAPTER pAdapter,
|
||||
#endif
|
||||
IN pu4Byte MACReg,
|
||||
IN pu4Byte MACBackup
|
||||
);
|
||||
|
||||
|
||||
#endif // #ifndef __HAL_PHY_RF_8188E_H__
|
||||
|
|
@ -0,0 +1,437 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8192E_SUPPORT == 1)
|
||||
|
||||
VOID
|
||||
odm_Write_Dynamic_CCA(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte CurrentMFstate
|
||||
)
|
||||
{
|
||||
pPri_CCA_T PrimaryCCA = &(pDM_Odm->DM_PriCCA);
|
||||
|
||||
if (PrimaryCCA->MF_state != CurrentMFstate){
|
||||
|
||||
ODM_SetBBReg(pDM_Odm, ODM_REG_L1SBD_PD_CH_11N, BIT8|BIT7, CurrentMFstate);
|
||||
}
|
||||
|
||||
PrimaryCCA->MF_state = CurrentMFstate;
|
||||
|
||||
}
|
||||
|
||||
VOID
|
||||
odm_PrimaryCCA_Check_Init(
|
||||
IN PDM_ODM_T pDM_Odm)
|
||||
{
|
||||
#if((DM_ODM_SUPPORT_TYPE==ODM_WIN) ||(DM_ODM_SUPPORT_TYPE==ODM_AP))
|
||||
PADAPTER pAdapter = pDM_Odm->Adapter;
|
||||
pPri_CCA_T PrimaryCCA = &(pDM_Odm->DM_PriCCA);
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
|
||||
pHalData->RTSEN = 0;
|
||||
PrimaryCCA->DupRTS_flag = 0;
|
||||
PrimaryCCA->intf_flag = 0;
|
||||
PrimaryCCA->intf_type = 0;
|
||||
PrimaryCCA->Monitor_flag = 0;
|
||||
PrimaryCCA->PriCCA_flag = 0;
|
||||
PrimaryCCA->CH_offset = 0;
|
||||
PrimaryCCA->MF_state = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
VOID
|
||||
odm_DynamicPrimaryCCA_Check(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
if(pDM_Odm->SupportICType != ODM_RTL8192E)
|
||||
return;
|
||||
|
||||
switch (pDM_Odm->SupportPlatform)
|
||||
{
|
||||
case ODM_WIN:
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE==ODM_WIN)
|
||||
odm_DynamicPrimaryCCAMP(pDM_Odm);
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ODM_CE:
|
||||
#if(DM_ODM_SUPPORT_TYPE==ODM_CE)
|
||||
|
||||
#endif
|
||||
break;
|
||||
|
||||
case ODM_AP:
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
odm_DynamicPrimaryCCAAP(pDM_Odm);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if(DM_ODM_SUPPORT_TYPE==ODM_WIN)
|
||||
|
||||
VOID
|
||||
odm_DynamicPrimaryCCAMP(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
PADAPTER pAdapter = pDM_Odm->Adapter;
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
|
||||
PFALSE_ALARM_STATISTICS FalseAlmCnt = &(pDM_Odm->FalseAlmCnt);
|
||||
pPri_CCA_T PrimaryCCA = &(pDM_Odm->DM_PriCCA);
|
||||
BOOLEAN Is40MHz = FALSE;
|
||||
u8Byte OFDM_CCA, OFDM_FA, BW_USC_Cnt, BW_LSC_Cnt;
|
||||
u1Byte SecCHOffset;
|
||||
u1Byte CurMFstate;
|
||||
static u1Byte CountDown = Monitor_TIME;
|
||||
|
||||
OFDM_CCA = FalseAlmCnt->Cnt_OFDM_CCA;
|
||||
OFDM_FA = FalseAlmCnt->Cnt_Ofdm_fail;
|
||||
BW_USC_Cnt = FalseAlmCnt->Cnt_BW_USC;
|
||||
BW_LSC_Cnt = FalseAlmCnt->Cnt_BW_LSC;
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: OFDM CCA=%d\n", OFDM_CCA));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: OFDM FA=%d\n", OFDM_FA));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: BW_USC=%d\n", BW_USC_Cnt));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: BW_LSC=%d\n", BW_LSC_Cnt));
|
||||
Is40MHz = *(pDM_Odm->pBandWidth);
|
||||
SecCHOffset = *(pDM_Odm->pSecChOffset); // NIC: 2: sec is below, 1: sec is above
|
||||
//DbgPrint("92E: SecCHOffset = %d\n", SecCHOffset);
|
||||
if(IsAPModeExist(pAdapter)){
|
||||
CurMFstate = MF_USC_LSC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!pDM_Odm->bLinked){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
|
||||
if(Is40MHz){
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: Cont Down= %d\n", CountDown));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: Primary_CCA_flag=%d\n", PrimaryCCA->PriCCA_flag));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: Intf_Type=%d\n", PrimaryCCA->intf_type));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: Intf_flag=%d\n", PrimaryCCA->intf_flag ));
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_DYNAMIC_PRICCA, ODM_DBG_LOUD, ("92E: Duplicate RTS Flag=%d\n", PrimaryCCA->DupRTS_flag));
|
||||
//DbgPrint("92E RTS_EN=%d\n", pHalData->RTSEN);
|
||||
|
||||
if(PrimaryCCA->PriCCA_flag == 0){
|
||||
|
||||
if(SecCHOffset == 2){ // Primary channel is above NOTE: duplicate CTS can remove this condition
|
||||
|
||||
if((OFDM_CCA > OFDMCCA_TH) && (BW_LSC_Cnt>(BW_USC_Cnt + BW_Ind_Bias))
|
||||
&& (OFDM_FA>(OFDM_CCA>>1))){
|
||||
|
||||
PrimaryCCA->intf_type = 1;
|
||||
PrimaryCCA->intf_flag = 1;
|
||||
CurMFstate = MF_USC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
PrimaryCCA->PriCCA_flag = 1;
|
||||
}
|
||||
else if((OFDM_CCA > OFDMCCA_TH) && (BW_LSC_Cnt>(BW_USC_Cnt + BW_Ind_Bias))
|
||||
&& (OFDM_FA < (OFDM_CCA>>1))){
|
||||
|
||||
PrimaryCCA->intf_type = 2;
|
||||
PrimaryCCA->intf_flag = 1;
|
||||
CurMFstate = MF_USC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
PrimaryCCA->PriCCA_flag = 1;
|
||||
PrimaryCCA->DupRTS_flag = 1;
|
||||
pHalData->RTSEN = 1;
|
||||
}
|
||||
else{
|
||||
|
||||
PrimaryCCA->intf_type = 0;
|
||||
PrimaryCCA->intf_flag = 0;
|
||||
CurMFstate = MF_USC_LSC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
pHalData->RTSEN = 0;
|
||||
PrimaryCCA->DupRTS_flag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
else if (SecCHOffset == 1){
|
||||
|
||||
if((OFDM_CCA > OFDMCCA_TH) && (BW_USC_Cnt > (BW_LSC_Cnt + BW_Ind_Bias))
|
||||
&& (OFDM_FA > (OFDM_CCA>>1))){
|
||||
|
||||
PrimaryCCA->intf_type = 1;
|
||||
PrimaryCCA->intf_flag = 1;
|
||||
CurMFstate = MF_LSC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
PrimaryCCA->PriCCA_flag = 1;
|
||||
}
|
||||
else if((OFDM_CCA > OFDMCCA_TH) && (BW_USC_Cnt>(BW_LSC_Cnt + BW_Ind_Bias))
|
||||
&& (OFDM_FA < (OFDM_CCA>>1))){
|
||||
|
||||
PrimaryCCA->intf_type = 2;
|
||||
PrimaryCCA->intf_flag = 1;
|
||||
CurMFstate = MF_LSC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
PrimaryCCA->PriCCA_flag = 1;
|
||||
PrimaryCCA->DupRTS_flag = 1;
|
||||
pHalData->RTSEN = 1;
|
||||
}
|
||||
else{
|
||||
|
||||
PrimaryCCA->intf_type = 0;
|
||||
PrimaryCCA->intf_flag = 0;
|
||||
CurMFstate = MF_USC_LSC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
pHalData->RTSEN = 0;
|
||||
PrimaryCCA->DupRTS_flag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else{ // PrimaryCCA->PriCCA_flag==1
|
||||
|
||||
CountDown--;
|
||||
if(CountDown == 0){
|
||||
CountDown = Monitor_TIME;
|
||||
PrimaryCCA->PriCCA_flag = 0;
|
||||
CurMFstate = MF_USC_LSC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate); // default
|
||||
pHalData->RTSEN = 0;
|
||||
PrimaryCCA->DupRTS_flag = 0;
|
||||
PrimaryCCA->intf_type = 0;
|
||||
PrimaryCCA->intf_flag = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#elif(DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
|
||||
VOID
|
||||
odm_DynamicPrimaryCCAAP(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
PADAPTER Adapter = pDM_Odm->Adapter;
|
||||
prtl8192cd_priv priv = pDM_Odm->priv;
|
||||
PFALSE_ALARM_STATISTICS FalseAlmCnt = &(pDM_Odm->FalseAlmCnt);
|
||||
pPri_CCA_T PrimaryCCA = &(pDM_Odm->DM_PriCCA);
|
||||
|
||||
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
|
||||
u1Byte i;
|
||||
static u4Byte Count_Down = Monitor_TIME;
|
||||
BOOLEAN STA_BW = FALSE, STA_BW_pre = FALSE, STA_BW_TMP = FALSE;
|
||||
BOOLEAN bConnected = FALSE;
|
||||
BOOLEAN Is40MHz = FALSE;
|
||||
u1Byte SecCHOffset;
|
||||
u1Byte CurMFstate;
|
||||
PSTA_INFO_T pstat;
|
||||
|
||||
Is40MHz = *(pDM_Odm->pBandWidth);
|
||||
SecCHOffset = *(pDM_Odm->pSecChOffset); // AP: 1: sec is below, 2: sec is above
|
||||
|
||||
|
||||
for(i=0; i<ODM_ASSOCIATE_ENTRY_NUM; i++){
|
||||
pstat = pDM_Odm->pODM_StaInfo[i];
|
||||
if(IS_STA_VALID(pstat)){
|
||||
|
||||
STA_BW_TMP = pstat->tx_bw;
|
||||
if(STA_BW_TMP > STA_BW){
|
||||
STA_BW = STA_BW_TMP;
|
||||
}
|
||||
bConnected = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if(Is40MHz){
|
||||
|
||||
if(PrimaryCCA->PriCCA_flag == 0){
|
||||
|
||||
if(bConnected){
|
||||
|
||||
if(STA_BW == 0){ //2 STA BW=20M
|
||||
|
||||
PrimaryCCA->PriCCA_flag = 1;
|
||||
if(SecCHOffset==1){
|
||||
CurMFstate = MF_USC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
}
|
||||
else if(SecCHOffset==2){
|
||||
CurMFstate = MF_USC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
}
|
||||
}
|
||||
else{ //2 STA BW=40M
|
||||
if(PrimaryCCA->intf_flag == 0){
|
||||
|
||||
odm_Intf_Detection(pDM_Odm);
|
||||
}
|
||||
else{ // intf_flag = 1
|
||||
|
||||
if(PrimaryCCA->intf_type == 1){
|
||||
|
||||
if(PrimaryCCA->CH_offset == 1){
|
||||
|
||||
CurMFstate = MF_USC;
|
||||
if(SecCHOffset == 1){ // AP, 1: primary is above 2: primary is below
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
}
|
||||
}
|
||||
else if(PrimaryCCA->CH_offset == 2){
|
||||
|
||||
CurMFstate = MF_LSC;
|
||||
if(SecCHOffset == 2){
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(PrimaryCCA->intf_type==2){
|
||||
|
||||
if(PrimaryCCA->CH_offset==1){
|
||||
|
||||
//ODM_SetBBReg(pDM_Odm, ODM_REG_L1SBD_PD_CH_11N, BIT8|BIT7, MF_USC);
|
||||
pHalData->RTSEN = 1;
|
||||
}
|
||||
else if(PrimaryCCA->CH_offset==2){
|
||||
|
||||
//ODM_SetBBReg(pDM_Odm, ODM_REG_L1SBD_PD_CH_11N, BIT8|BIT7, MF_LSC);
|
||||
pHalData->RTSEN = 1;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else{ // disconnected interference detection
|
||||
|
||||
odm_Intf_Detection(pDM_Odm);
|
||||
}// end of disconnected
|
||||
|
||||
|
||||
}
|
||||
else{ // PrimaryCCA->PriCCA_flag == 1
|
||||
|
||||
if(STA_BW==0){
|
||||
|
||||
STA_BW_pre = STA_BW;
|
||||
return;
|
||||
}
|
||||
|
||||
Count_Down--;
|
||||
if((Count_Down == 0) || ((STA_BW & STA_BW_pre) != 1)){
|
||||
|
||||
Count_Down = Monitor_TIME;
|
||||
PrimaryCCA->PriCCA_flag = 0;
|
||||
PrimaryCCA->intf_type = 0;
|
||||
PrimaryCCA->intf_flag = 0;
|
||||
CurMFstate = MF_USC_LSC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate); // default
|
||||
pHalData->RTSEN = 0;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
STA_BW_pre = STA_BW;
|
||||
|
||||
}
|
||||
else{
|
||||
//2 Reset
|
||||
odm_PrimaryCCA_Check_Init(pDM_Odm);
|
||||
CurMFstate = MF_USC_LSC;
|
||||
odm_Write_Dynamic_CCA(pDM_Odm, CurMFstate);
|
||||
Count_Down = Monitor_TIME;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
VOID
|
||||
odm_Intf_Detection(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
)
|
||||
{
|
||||
PFALSE_ALARM_STATISTICS FalseAlmCnt = &(pDM_Odm->FalseAlmCnt);
|
||||
pPri_CCA_T PrimaryCCA = &(pDM_Odm->DM_PriCCA);
|
||||
|
||||
if((FalseAlmCnt->Cnt_OFDM_CCA>OFDMCCA_TH)
|
||||
&&(FalseAlmCnt->Cnt_BW_LSC>(FalseAlmCnt->Cnt_BW_USC+BW_Ind_Bias))){
|
||||
|
||||
PrimaryCCA->intf_flag = 1;
|
||||
PrimaryCCA->CH_offset = 1; // 1:LSC, 2:USC
|
||||
if(FalseAlmCnt->Cnt_Ofdm_fail>(FalseAlmCnt->Cnt_OFDM_CCA>>1)){
|
||||
PrimaryCCA->intf_type = 1;
|
||||
}
|
||||
else{
|
||||
PrimaryCCA->intf_type = 2;
|
||||
}
|
||||
}
|
||||
else if((FalseAlmCnt->Cnt_OFDM_CCA>OFDMCCA_TH)
|
||||
&&(FalseAlmCnt->Cnt_BW_USC>(FalseAlmCnt->Cnt_BW_LSC+BW_Ind_Bias))){
|
||||
|
||||
PrimaryCCA->intf_flag = 1;
|
||||
PrimaryCCA->CH_offset = 2; // 1:LSC, 2:USC
|
||||
if(FalseAlmCnt->Cnt_Ofdm_fail>(FalseAlmCnt->Cnt_OFDM_CCA>>1)){
|
||||
PrimaryCCA->intf_type = 1;
|
||||
}
|
||||
else{
|
||||
PrimaryCCA->intf_type = 2;
|
||||
}
|
||||
}
|
||||
else{
|
||||
PrimaryCCA->intf_flag = 0;
|
||||
PrimaryCCA->intf_type = 0;
|
||||
PrimaryCCA->CH_offset = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // RTL8192E_SUPPORT == 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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_RTL8192E_H__
|
||||
#define __ODM_RTL8192E_H__
|
||||
|
||||
#define OFDMCCA_TH 500
|
||||
#define BW_Ind_Bias 500
|
||||
#define MF_USC 2
|
||||
#define MF_LSC 1
|
||||
#define MF_USC_LSC 0
|
||||
#define Monitor_TIME 30
|
||||
|
||||
VOID
|
||||
odm_Write_Dynamic_CCA(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u1Byte CurrentMFstate
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_PrimaryCCA_Check_Init(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_DynamicPrimaryCCA_Check(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
|
||||
|
||||
VOID
|
||||
odm_DynamicPrimaryCCAMP(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
|
||||
|
||||
VOID
|
||||
odm_DynamicPrimaryCCAAP(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
VOID
|
||||
odm_Intf_Detection(
|
||||
IN PDM_ODM_T pDM_Odm
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -0,0 +1,235 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 "../odm_precomp.h"
|
||||
|
||||
#if (RTL8192E_SUPPORT == 1)
|
||||
|
||||
void
|
||||
odm_ConfigRFReg_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data,
|
||||
IN ODM_RF_RADIO_PATH_E RF_PATH,
|
||||
IN u4Byte RegAddr
|
||||
)
|
||||
{
|
||||
if(Addr == 0xfe || Addr == 0xffe)
|
||||
{
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
ODM_SetRFReg(pDM_Odm, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
|
||||
|
||||
//For disable/enable test in high temperature, the B6 value will fail to fill. Suggestion by Ed 20130.
|
||||
if(Addr == 0xb6)
|
||||
{
|
||||
u4Byte getvalue=0;
|
||||
u1Byte count =0;
|
||||
getvalue = ODM_GetRFReg(pDM_Odm, RF_PATH, Addr, bMaskDWord);
|
||||
|
||||
ODM_delay_us(1);
|
||||
|
||||
while((getvalue>>8)!=(Data>>8))
|
||||
{
|
||||
count++;
|
||||
ODM_SetRFReg(pDM_Odm, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
|
||||
ODM_delay_us(1);
|
||||
getvalue = ODM_GetRFReg(pDM_Odm, RF_PATH, Addr, bMaskDWord);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [B6] getvalue 0x%x, Data 0x%x, count %d\n", getvalue, Data,count));
|
||||
if(count>5)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(Addr == 0xb2)
|
||||
{
|
||||
u4Byte getvalue=0;
|
||||
u1Byte count =0;
|
||||
getvalue = ODM_GetRFReg(pDM_Odm, RF_PATH, Addr, bMaskDWord);
|
||||
|
||||
ODM_delay_us(1);
|
||||
|
||||
while(getvalue!=Data)
|
||||
{
|
||||
count++;
|
||||
ODM_SetRFReg(pDM_Odm, RF_PATH, RegAddr, bRFRegOffsetMask, Data);
|
||||
ODM_delay_us(1);
|
||||
//Do LCK againg
|
||||
ODM_SetRFReg(pDM_Odm, RF_PATH, 0x18, bRFRegOffsetMask, 0x0fc07);
|
||||
ODM_delay_us(1);
|
||||
getvalue = ODM_GetRFReg(pDM_Odm, RF_PATH, Addr, bMaskDWord);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [B2] getvalue 0x%x, Data 0x%x, count %d\n", getvalue, Data,count));
|
||||
if(count>5)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
odm_ConfigRF_RadioA_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
u4Byte content = 0x1000; // RF_Content: radioa_txt
|
||||
u4Byte maskforPhySet= (u4Byte)(content&0xE000);
|
||||
|
||||
odm_ConfigRFReg_8192E(pDM_Odm, Addr, Data, ODM_RF_PATH_A, Addr|maskforPhySet);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioA] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigRF_RadioB_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
u4Byte content = 0x1001; // RF_Content: radiob_txt
|
||||
u4Byte maskforPhySet= (u4Byte)(content&0xE000);
|
||||
|
||||
odm_ConfigRFReg_8192E(pDM_Odm, Addr, Data, ODM_RF_PATH_B, Addr|maskforPhySet);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigRFWithHeaderFile: [RadioB] %08X %08X\n", Addr, Data));
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigMAC_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u1Byte Data
|
||||
)
|
||||
{
|
||||
ODM_Write1Byte(pDM_Odm, Addr, Data);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigMACWithHeaderFile: [MAC_REG] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigBB_AGC_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [AGC_TAB] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_REG_PG_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Band,
|
||||
IN u4Byte RfPath,
|
||||
IN u4Byte TxNum,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
if (Addr == 0xfe || Addr == 0xffe)
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
else
|
||||
{
|
||||
#if !(DM_ODM_SUPPORT_TYPE&ODM_AP)
|
||||
PHY_StoreTxPowerByRate(pDM_Odm->Adapter, Band, RfPath, TxNum, Addr, Bitmask, Data);
|
||||
#endif
|
||||
}
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_LOUD, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X %08X\n", Addr, Bitmask, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
)
|
||||
{
|
||||
if (Addr == 0xfe)
|
||||
#ifdef CONFIG_LONG_DELAY_ISSUE
|
||||
ODM_sleep_ms(50);
|
||||
#else
|
||||
ODM_delay_ms(50);
|
||||
#endif
|
||||
else if (Addr == 0xfd)
|
||||
ODM_delay_ms(5);
|
||||
else if (Addr == 0xfc)
|
||||
ODM_delay_ms(1);
|
||||
else if (Addr == 0xfb)
|
||||
ODM_delay_us(50);
|
||||
else if (Addr == 0xfa)
|
||||
ODM_delay_us(5);
|
||||
else if (Addr == 0xf9)
|
||||
ODM_delay_us(1);
|
||||
else
|
||||
{
|
||||
ODM_SetBBReg(pDM_Odm, Addr, Bitmask, Data);
|
||||
}
|
||||
|
||||
// Add 1us delay between BB/RF register setting.
|
||||
ODM_delay_us(1);
|
||||
ODM_RT_TRACE(pDM_Odm,ODM_COMP_INIT, ODM_DBG_TRACE, ("===> ODM_ConfigBBWithHeaderFile: [PHY_REG] %08X %08X\n", Addr, Data));
|
||||
}
|
||||
|
||||
void
|
||||
odm_ConfigBB_TXPWR_LMT_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN pu1Byte Regulation,
|
||||
IN pu1Byte Band,
|
||||
IN pu1Byte Bandwidth,
|
||||
IN pu1Byte RateSection,
|
||||
IN pu1Byte RfPath,
|
||||
IN pu1Byte Channel,
|
||||
IN pu1Byte PowerLimit
|
||||
)
|
||||
{
|
||||
#if (DM_ODM_SUPPORT_TYPE & (ODM_WIN))
|
||||
PHY_SetTxPowerLimit(pDM_Odm, Regulation, Band,
|
||||
Bandwidth, RateSection, RfPath, Channel, PowerLimit);
|
||||
#elif (DM_ODM_SUPPORT_TYPE & (ODM_CE))
|
||||
PHY_SetTxPowerLimit(pDM_Odm->Adapter, Regulation, Band,
|
||||
Bandwidth, RateSection, RfPath, Channel, PowerLimit);
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* 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 __INC_ODM_REGCONFIG_H_8192E
|
||||
#define __INC_ODM_REGCONFIG_H_8192E
|
||||
|
||||
#if (RTL8192E_SUPPORT == 1)
|
||||
|
||||
void
|
||||
odm_ConfigRFReg_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data,
|
||||
IN ODM_RF_RADIO_PATH_E RF_PATH,
|
||||
IN u4Byte RegAddr
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigRF_RadioA_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigRF_RadioB_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigMAC_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u1Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigBB_AGC_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_REG_PG_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Band,
|
||||
IN u4Byte RfPath,
|
||||
IN u4Byte TxNum,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigBB_PHY_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN u4Byte Addr,
|
||||
IN u4Byte Bitmask,
|
||||
IN u4Byte Data
|
||||
);
|
||||
|
||||
void
|
||||
odm_ConfigBB_TXPWR_LMT_8192E(
|
||||
IN PDM_ODM_T pDM_Odm,
|
||||
IN pu1Byte Regulation,
|
||||
IN pu1Byte Band,
|
||||
IN pu1Byte Bandwidth,
|
||||
IN pu1Byte RateSection,
|
||||
IN pu1Byte RfPath,
|
||||
IN pu1Byte Channel,
|
||||
IN pu1Byte PowerLimit
|
||||
);
|
||||
|
||||
|
||||
#endif
|
||||
#endif // end of SUPPORT
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue