rtl8188eu: Remove ANTENNA DIVERSITY configuration variables and dead code

These changes include the following:
1. CONFIG_SW_ANTENNA_DIVERSITY - not selected
2. CONFIG_HW_ANTENNA_DIVERSITY - selected
3. CONFIG_ANTENNA_DIVERSITY - selected

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-14 14:10:10 -05:00
parent 9ba4954378
commit 951757e916
17 changed files with 42 additions and 944 deletions

View file

@ -2197,7 +2197,6 @@ _func_exit_;
#endif #endif
#ifdef CONFIG_ANTENNA_DIVERSITY
static void antenna_select_wk_hdl(_adapter *padapter, u8 antenna) static void antenna_select_wk_hdl(_adapter *padapter, u8 antenna)
{ {
rtw_hal_set_hwreg(padapter, HW_VAR_ANTENNA_DIVERSITY_SELECT, (u8 *)(&antenna)); rtw_hal_set_hwreg(padapter, HW_VAR_ANTENNA_DIVERSITY_SELECT, (u8 *)(&antenna));
@ -2247,9 +2246,7 @@ _func_exit_;
return res; return res;
} }
#endif
void power_saving_wk_hdl(_adapter *padapter, u8 *pbuf, int sz);
void power_saving_wk_hdl(_adapter *padapter, u8 *pbuf, int sz) void power_saving_wk_hdl(_adapter *padapter, u8 *pbuf, int sz)
{ {
rtw_ps_processor(padapter); rtw_ps_processor(padapter);
@ -2550,11 +2547,9 @@ u8 rtw_drvextra_cmd_hdl(_adapter *padapter, unsigned char *pbuf)
rpt_timer_setting_wk_hdl(padapter, pdrvextra_cmd->type_size); rpt_timer_setting_wk_hdl(padapter, pdrvextra_cmd->type_size);
break; break;
#endif #endif
#ifdef CONFIG_ANTENNA_DIVERSITY
case ANT_SELECT_WK_CID: case ANT_SELECT_WK_CID:
antenna_select_wk_hdl(padapter, pdrvextra_cmd->type_size); antenna_select_wk_hdl(padapter, pdrvextra_cmd->type_size);
break; break;
#endif
#ifdef CONFIG_P2P_PS #ifdef CONFIG_P2P_PS
case P2P_PS_WK_CID: case P2P_PS_WK_CID:
p2p_ps_wk_hdl(padapter, pdrvextra_cmd->type_size); p2p_ps_wk_hdl(padapter, pdrvextra_cmd->type_size);

View file

@ -661,9 +661,7 @@ void update_network(WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src,
_func_enter_; _func_enter_;
#ifdef CONFIG_ANTENNA_DIVERSITY
rtw_hal_antdiv_rssi_compared(padapter, dst, src); /* this will update src.Rssi, need consider again */ rtw_hal_antdiv_rssi_compared(padapter, dst, src); /* this will update src.Rssi, need consider again */
#endif
#if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) && 1 #if defined(DBG_RX_SIGNAL_DISPLAY_PROCESSING) && 1
if (strcmp(dst->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) { if (strcmp(dst->Ssid.Ssid, DBG_RX_SIGNAL_DISPLAY_SSID_MONITORED) == 0) {
@ -786,9 +784,7 @@ _func_enter_;
/* list_del_init(&oldest->list); */ /* list_del_init(&oldest->list); */
pnetwork = oldest; pnetwork = oldest;
#ifdef CONFIG_ANTENNA_DIVERSITY
rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna)); rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna));
#endif
_rtw_memcpy(&(pnetwork->network), target, get_WLAN_BSSID_EX_sz(target)); _rtw_memcpy(&(pnetwork->network), target, get_WLAN_BSSID_EX_sz(target));
/* variable initialize */ /* variable initialize */
pnetwork->fixed = false; pnetwork->fixed = false;
@ -801,8 +797,7 @@ _func_enter_;
/* bss info not receving from the right channel */ /* bss info not receving from the right channel */
if (pnetwork->network.PhyInfo.SignalQuality == 101) if (pnetwork->network.PhyInfo.SignalQuality == 101)
pnetwork->network.PhyInfo.SignalQuality = 0; pnetwork->network.PhyInfo.SignalQuality = 0;
} } else {
else {
/* Otherwise just pull from the free list */ /* Otherwise just pull from the free list */
pnetwork = rtw_alloc_network(pmlmepriv); /* will update scan_time */ pnetwork = rtw_alloc_network(pmlmepriv); /* will update scan_time */
@ -814,10 +809,7 @@ _func_enter_;
bssid_ex_sz = get_WLAN_BSSID_EX_sz(target); bssid_ex_sz = get_WLAN_BSSID_EX_sz(target);
target->Length = bssid_ex_sz; target->Length = bssid_ex_sz;
#ifdef CONFIG_ANTENNA_DIVERSITY
/* target->PhyInfo.Optimum_antenna = pHalData->CurAntenna; */
rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna)); rtw_hal_get_def_var(adapter, HAL_DEF_CURRENT_ANTENNA, &(target->PhyInfo.Optimum_antenna));
#endif
_rtw_memcpy(&(pnetwork->network), target, bssid_ex_sz ); _rtw_memcpy(&(pnetwork->network), target, bssid_ex_sz );
pnetwork->last_scanned = rtw_get_current_time(); pnetwork->last_scanned = rtw_get_current_time();
@ -1263,16 +1255,10 @@ _func_enter_;
pmlmepriv->to_join = false; pmlmepriv->to_join = false;
if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) { if (!check_fwstate(&padapter->mlmepriv, _FW_LINKED)) {
#ifdef CONFIG_SW_ANTENNA_DIVERSITY
rtw_hal_set_hwreg(padapter, HW_VAR_ANTENNA_DIVERSITY_LINK, 0);
#endif
set_fwstate(pmlmepriv, _FW_LINKED); set_fwstate(pmlmepriv, _FW_LINKED);
rtw_led_control(padapter, LED_CTL_LINK); rtw_led_control(padapter, LED_CTL_LINK);
#ifdef CONFIG_DRVEXT_MODULE #ifdef CONFIG_DRVEXT_MODULE
if (padapter->drvextpriv.enable_wpa) { if (padapter->drvextpriv.enable_wpa) {
indicate_l2_connect(padapter); indicate_l2_connect(padapter);
@ -2389,7 +2375,6 @@ _func_enter_;
rtw_free_assoc_resources(adapter, 0); rtw_free_assoc_resources(adapter, 0);
} }
#ifdef CONFIG_ANTENNA_DIVERSITY
rtw_hal_get_def_var(adapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv)); rtw_hal_get_def_var(adapter, HAL_DEF_IS_SUPPORT_ANT_DIV, &(bSupportAntDiv));
if (true == bSupportAntDiv) if (true == bSupportAntDiv)
{ {
@ -2400,7 +2385,6 @@ _func_enter_;
(2==CurrentAntenna)?"A":"B" (2==CurrentAntenna)?"A":"B"
); );
} }
#endif
ret = rtw_joinbss_cmd(adapter, candidate); ret = rtw_joinbss_cmd(adapter, candidate);

View file

@ -7973,7 +7973,6 @@ void site_survey(_adapter *padapter)
pmlmeinfo->scan_cnt = 0; pmlmeinfo->scan_cnt = 0;
#endif /* CONFIG_DMP_STA_NODE_SCAN_UNDER_AP_MODE */ #endif /* CONFIG_DMP_STA_NODE_SCAN_UNDER_AP_MODE */
#ifdef CONFIG_ANTENNA_DIVERSITY
/* 20100721:Interrupt scan operation here. */ /* 20100721:Interrupt scan operation here. */
/* For SW antenna diversity before link, it needs to switch to another antenna and scan again. */ /* For SW antenna diversity before link, it needs to switch to another antenna and scan again. */
/* It compares the scan result and select beter one to do connection. */ /* It compares the scan result and select beter one to do connection. */
@ -7985,8 +7984,6 @@ void site_survey(_adapter *padapter)
set_survey_timer(pmlmeext, pmlmeext->chan_scan_time); set_survey_timer(pmlmeext, pmlmeext->chan_scan_time);
return; return;
} }
#endif
#ifdef CONFIG_P2P #ifdef CONFIG_P2P
if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH)) if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_SCAN) || rtw_p2p_chk_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH))
rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo)); rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo));
@ -8093,30 +8090,22 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI
bssid->Rssi = precv_frame->u.hdr.attrib.phy_info.RecvSignalPower; /* in dBM.raw data */ bssid->Rssi = precv_frame->u.hdr.attrib.phy_info.RecvSignalPower; /* in dBM.raw data */
bssid->PhyInfo.SignalQuality = precv_frame->u.hdr.attrib.phy_info.SignalQuality;/* in percentage */ bssid->PhyInfo.SignalQuality = precv_frame->u.hdr.attrib.phy_info.SignalQuality;/* in percentage */
bssid->PhyInfo.SignalStrength = precv_frame->u.hdr.attrib.phy_info.SignalStrength;/* in percentage */ bssid->PhyInfo.SignalStrength = precv_frame->u.hdr.attrib.phy_info.SignalStrength;/* in percentage */
#ifdef CONFIG_ANTENNA_DIVERSITY
/* rtw_hal_get_hwreg(padapter, HW_VAR_CURRENT_ANTENNA, (u8 *)(&bssid->PhyInfo.Optimum_antenna)); */
rtw_hal_get_def_var(padapter, HAL_DEF_CURRENT_ANTENNA, &bssid->PhyInfo.Optimum_antenna); rtw_hal_get_def_var(padapter, HAL_DEF_CURRENT_ANTENNA, &bssid->PhyInfo.Optimum_antenna);
#endif
/* checking SSID */ /* checking SSID */
if ((p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset)) == NULL) if ((p = rtw_get_ie(bssid->IEs + ie_offset, _SSID_IE_, &len, bssid->IELength - ie_offset)) == NULL) {
{
DBG_88E("marc: cannot find SSID for survey event\n"); DBG_88E("marc: cannot find SSID for survey event\n");
return _FAIL; return _FAIL;
} }
if (*(p + 1)) if (*(p + 1)) {
{ if (len > NDIS_802_11_LENGTH_SSID) {
if (len > NDIS_802_11_LENGTH_SSID)
{
DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len); DBG_88E("%s()-%d: IE too long (%d) for survey event\n", __func__, __LINE__, len);
return _FAIL; return _FAIL;
} }
_rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1)); _rtw_memcpy(bssid->Ssid.Ssid, (p + 2), *(p + 1));
bssid->Ssid.SsidLength = *(p + 1); bssid->Ssid.SsidLength = *(p + 1);
} } else {
else
{
bssid->Ssid.SsidLength = 0; bssid->Ssid.SsidLength = 0;
} }
@ -9708,20 +9697,13 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf)
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network)); WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX*)(&(pmlmeinfo->network));
#ifdef CONFIG_ANTENNA_DIVERSITY
struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf; struct joinbss_parm *pparm = (struct joinbss_parm *)pbuf;
#endif /* CONFIG_ANTENNA_DIVERSITY */
u32 i; u32 i;
/* u32 initialgain; */
/* u32 acparm; */
/* check already connecting to AP or not */ /* check already connecting to AP or not */
if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) if (pmlmeinfo->state & WIFI_FW_ASSOC_SUCCESS) {
{
if (pmlmeinfo->state & WIFI_FW_STATION_STATE) if (pmlmeinfo->state & WIFI_FW_STATION_STATE)
{
issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, 5, 100); issue_deauth_ex(padapter, pnetwork->MacAddress, WLAN_REASON_DEAUTH_LEAVING, 5, 100);
}
pmlmeinfo->state = WIFI_FW_NULL_STATE; pmlmeinfo->state = WIFI_FW_NULL_STATE;
@ -9731,16 +9713,13 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf)
_cancel_timer_ex(&pmlmeext->link_timer); _cancel_timer_ex(&pmlmeext->link_timer);
/* set MSR to nolink -> infra. mode */ /* set MSR to nolink -> infra. mode */
/* Set_MSR(padapter, _HW_STATE_NOLINK_); */
Set_MSR(padapter, _HW_STATE_STATION_); Set_MSR(padapter, _HW_STATE_STATION_);
rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, NULL); rtw_hal_set_hwreg(padapter, HW_VAR_MLME_DISCONNECT, NULL);
} }
#ifdef CONFIG_ANTENNA_DIVERSITY
rtw_antenna_select_cmd(padapter, pparm->network.PhyInfo.Optimum_antenna, false); rtw_antenna_select_cmd(padapter, pparm->network.PhyInfo.Optimum_antenna, false);
#endif
rtw_joinbss_reset(padapter); rtw_joinbss_reset(padapter);

View file

@ -352,7 +352,6 @@ void rtw_hal_bcn_related_reg_setting(_adapter *padapter)
} }
#ifdef CONFIG_ANTENNA_DIVERSITY
u8 rtw_hal_antdiv_before_linked(_adapter *padapter) u8 rtw_hal_antdiv_before_linked(_adapter *padapter)
{ {
if (padapter->HalFunc.AntDivBeforeLinkHandler) if (padapter->HalFunc.AntDivBeforeLinkHandler)
@ -364,7 +363,6 @@ void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_B
if (padapter->HalFunc.AntDivCompareHandler) if (padapter->HalFunc.AntDivCompareHandler)
padapter->HalFunc.AntDivCompareHandler(padapter, dst, src); padapter->HalFunc.AntDivCompareHandler(padapter, dst, src);
} }
#endif
#ifdef DBG_CONFIG_ERROR_DETECT #ifdef DBG_CONFIG_ERROR_DETECT
void rtw_hal_sreset_init(_adapter *padapter) void rtw_hal_sreset_init(_adapter *padapter)

846
hal/odm.c
View file

@ -1193,13 +1193,7 @@ odm_CommonInfoSelfInit(
pDM_Odm->pbNet_closed = &pDM_Odm->bool_temp; pDM_Odm->pbNet_closed = &pDM_Odm->bool_temp;
#endif #endif
if (pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8192D)) if (pDM_Odm->SupportICType & (ODM_RTL8192C|ODM_RTL8192D))
{
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV; pDM_Odm->AntDivType = CG_TRX_HW_ANTDIV;
#elif (defined(CONFIG_SW_ANTENNA_DIVERSITY))
pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV;
#endif
}
if (pDM_Odm->SupportICType & (ODM_RTL8723A)) if (pDM_Odm->SupportICType & (ODM_RTL8723A))
pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV; pDM_Odm->AntDivType = CGCS_RX_SW_ANTDIV;
@ -1354,7 +1348,6 @@ ODM_InitAllWorkItems(PDM_ODM_T pDM_Odm )
(RT_WORKITEM_CALL_BACK)odm_CCKTXPathDiversityWorkItemCallback, (RT_WORKITEM_CALL_BACK)odm_CCKTXPathDiversityWorkItemCallback,
(void *)pAdapter, (void *)pAdapter,
"CCKTXPathDiversityWorkItem"); "CCKTXPathDiversityWorkItem");
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
#if (RTL8188E_SUPPORT == 1) #if (RTL8188E_SUPPORT == 1)
ODM_InitializeWorkItem( ODM_InitializeWorkItem(
pDM_Odm, pDM_Odm,
@ -1362,7 +1355,6 @@ ODM_InitAllWorkItems(PDM_ODM_T pDM_Odm )
(RT_WORKITEM_CALL_BACK)odm_FastAntTrainingWorkItemCallback, (RT_WORKITEM_CALL_BACK)odm_FastAntTrainingWorkItemCallback,
(void *)pAdapter, (void *)pAdapter,
"FastAntTrainingWorkitem"); "FastAntTrainingWorkitem");
#endif
#endif #endif
ODM_InitializeWorkItem( ODM_InitializeWorkItem(
pDM_Odm, pDM_Odm,
@ -3989,13 +3981,11 @@ ODM_InitAllTimers(
(RT_TIMER_CALL_BACK)odm_SwAntDivChkAntSwitchCallback, NULL, "SwAntennaSwitchTimer"); (RT_TIMER_CALL_BACK)odm_SwAntDivChkAntSwitchCallback, NULL, "SwAntennaSwitchTimer");
#if (!(DM_ODM_SUPPORT_TYPE == ODM_CE)) #if (!(DM_ODM_SUPPORT_TYPE == ODM_CE))
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
#if (RTL8188E_SUPPORT == 1) #if (RTL8188E_SUPPORT == 1)
ODM_InitializeTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer, ODM_InitializeTimer(pDM_Odm,&pDM_Odm->FastAntTrainingTimer,
(RT_TIMER_CALL_BACK)odm_FastAntTrainingCallback, NULL, "FastAntTrainingTimer"); (RT_TIMER_CALL_BACK)odm_FastAntTrainingCallback, NULL, "FastAntTrainingTimer");
#endif #endif
#endif #endif
#endif
#if (DM_ODM_SUPPORT_TYPE == ODM_MP) #if (DM_ODM_SUPPORT_TYPE == ODM_MP)
ODM_InitializeTimer(pDM_Odm, &pDM_Odm->PSDTimer, ODM_InitializeTimer(pDM_Odm, &pDM_Odm->PSDTimer,
@ -4291,801 +4281,66 @@ odm_TXPowerTrackingThermalMeterCheck(
/* 3============================================================ */ /* 3============================================================ */
/* 3 SW Antenna Diversity */ /* 3 SW Antenna Diversity */
/* 3============================================================ */ /* 3============================================================ */
#if (defined(CONFIG_SW_ANTENNA_DIVERSITY)) void odm_SwAntDivInit(PDM_ODM_T pDM_Odm)
void
odm_SwAntDivInit(
PDM_ODM_T pDM_Odm
)
{ {
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_CE))
odm_SwAntDivInit_NIC(pDM_Odm);
#elif (DM_ODM_SUPPORT_TYPE == ODM_AP)
dm_SW_AntennaSwitchInit(pDM_Odm->priv);
#endif
} }
#if (RTL8723A_SUPPORT==1)
/* Only for 8723A SW ANT DIV INIT--2012--07--17 */ void ODM_SwAntDivChkPerPktRssi(PDM_ODM_T pDM_Odm, u1Byte StationID, PODM_PHY_INFO_T pPhyInfo)
void
odm_SwAntDivInit_NIC_8723A(
PDM_ODM_T pDM_Odm)
{ {
pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; }
PADAPTER Adapter = pDM_Odm->Adapter;
u1Byte btAntNum=BT_GetPGAntNum(Adapter);
void odm_SwAntDivChkAntSwitch(PDM_ODM_T pDM_Odm, u1Byte Step)
if (IS_HARDWARE_TYPE_8723A(Adapter))
{ {
pDM_SWAT_Table->ANTA_ON =true;
/* Set default antenna B status by PG */
if (btAntNum == Ant_x2)
pDM_SWAT_Table->ANTB_ON = true;
else if (btAntNum ==Ant_x1)
pDM_SWAT_Table->ANTB_ON = false;
else
pDM_SWAT_Table->ANTB_ON = true;
}
}
#endif
void
odm_SwAntDivInit_NIC(
PDM_ODM_T pDM_Odm
)
{
pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
/* Init SW ANT DIV mechanism for 8723AE/AU/AS Neil Chen--2012--07--17--- */
/* CE/AP/ADSL no using SW ANT DIV for 8723A Series IC */
#if (RTL8723A_SUPPORT==1)
if (pDM_Odm->SupportICType == ODM_RTL8723A)
{
odm_SwAntDivInit_NIC_8723A(pDM_Odm);
}
#endif
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS:Init SW Antenna Switch\n"));
pDM_SWAT_Table->RSSI_sum_A = 0;
pDM_SWAT_Table->RSSI_cnt_A = 0;
pDM_SWAT_Table->RSSI_sum_B = 0;
pDM_SWAT_Table->RSSI_cnt_B = 0;
pDM_SWAT_Table->CurAntenna = Antenna_A;
pDM_SWAT_Table->PreAntenna = Antenna_A;
pDM_SWAT_Table->try_flag = 0xff;
pDM_SWAT_Table->PreRSSI = 0;
pDM_SWAT_Table->SWAS_NoLink_State = 0;
pDM_SWAT_Table->bTriggerAntennaSwitch = 0;
pDM_SWAT_Table->SelectAntennaMap=0xAA;
pDM_SWAT_Table->lastTxOkCnt = 0;
pDM_SWAT_Table->lastRxOkCnt = 0;
pDM_SWAT_Table->TXByteCnt_A = 0;
pDM_SWAT_Table->TXByteCnt_B = 0;
pDM_SWAT_Table->RXByteCnt_A = 0;
pDM_SWAT_Table->RXByteCnt_B = 0;
pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW;
pDM_SWAT_Table->SWAS_NoLink_BK_Reg860 = ODM_Read4Byte(pDM_Odm, 0x860);
}
/* */
/* 20100514 Joseph: */
/* Add new function to reset the state of antenna diversity before link. */
/* */
static void
ODM_SwAntDivResetBeforeLink(
PDM_ODM_T pDM_Odm
)
{
pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
pDM_SWAT_Table->SWAS_NoLink_State = 0;
}
/* */
/* 20100514 Luke/Joseph: */
/* Add new function to reset antenna diversity state after link. */
/* */
void
ODM_SwAntDivRestAfterLink(
PDM_ODM_T pDM_Odm
)
{
pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
pDM_SWAT_Table->RSSI_cnt_A = 0;
pDM_SWAT_Table->RSSI_cnt_B = 0;
pDM_Odm->RSSI_test = false;
pDM_SWAT_Table->try_flag = 0xff;
pDM_SWAT_Table->RSSI_Trying = 0;
pDM_SWAT_Table->SelectAntennaMap=0xAA;
}
void
ODM_SwAntDivChkPerPktRssi(
PDM_ODM_T pDM_Odm,
u1Byte StationID,
PODM_PHY_INFO_T pPhyInfo
)
{
SWAT_T *pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
if (!(pDM_Odm->SupportAbility & (ODM_BB_ANT_DIV)))
return;
if (StationID == pDM_SWAT_Table->RSSI_target)
{
/* 1 RSSI for SW Antenna Switch */
if (pDM_SWAT_Table->CurAntenna == Antenna_A)
{
pDM_SWAT_Table->RSSI_sum_A += pPhyInfo->RxPWDBAll;
pDM_SWAT_Table->RSSI_cnt_A++;
}
else
{
pDM_SWAT_Table->RSSI_sum_B += pPhyInfo->RxPWDBAll;
pDM_SWAT_Table->RSSI_cnt_B++;
}
}
}
/* */
void
odm_SwAntDivChkAntSwitch(
PDM_ODM_T pDM_Odm,
u1Byte Step
)
{
/* */
/* For AP/ADSL use prtl8192cd_priv */
/* For CE/NIC use PADAPTER */
/* */
PADAPTER pAdapter = pDM_Odm->Adapter;
prtl8192cd_priv priv = pDM_Odm->priv;
/* */
/* 2011/09/29 MH In HW integration first stage, we provide 4 different handle to operate */
/* at the same time. In the stage2/3, we need to prive universal interface and merge all */
/* HW dynamic mechanism. */
/* */
switch (pDM_Odm->SupportPlatform)
{
case ODM_MP:
case ODM_CE:
odm_SwAntDivChkAntSwitchNIC(pDM_Odm, Step);
break;
case ODM_AP:
case ODM_ADSL:
#if (DM_ODM_SUPPORT_TYPE & (ODM_AP |ODM_ADSL))
if (priv->pshare->rf_ft_var.antSw_enable && (priv->up_time % 4==1))
dm_SW_AntennaSwitch(priv, SWAW_STEP_PEAK);
#endif
break;
}
}
/* */
/* 20100514 Luke/Joseph: */
/* Add new function for antenna diversity after link. */
/* This is the main function of antenna diversity after link. */
/* This function is called in HalDmWatchDog() and ODM_SwAntDivChkAntSwitchCallback(). */
/* HalDmWatchDog() calls this function with SWAW_STEP_PEAK to initialize the antenna test. */
/* In SWAW_STEP_PEAK, another antenna and a 500ms timer will be set for testing. */
/* After 500ms, ODM_SwAntDivChkAntSwitchCallback() calls this function to compare the signal just */
/* listened on the air with the RSSI of original antenna. */
/* It chooses the antenna with better RSSI. */
/* There is also a aged policy for error trying. Each error trying will cost more 5 seconds waiting */
/* penalty to get next try. */
void
ODM_SetAntenna(
PDM_ODM_T pDM_Odm,
u1Byte Antenna)
{
ODM_SetBBReg(pDM_Odm, 0x860, BIT8|BIT9, Antenna);
}
/* 2012--09--06-- */
/* Note: Antenna_Main--> Antenna_A */
/* Antenna_Aux---> Antenna_B */
/* */
void
odm_SwAntDivChkAntSwitchNIC(
PDM_ODM_T pDM_Odm,
u1Byte Step
)
{
#if ((RTL8192C_SUPPORT==1)||(RTL8723A_SUPPORT==1))
pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
s4Byte curRSSI=100, RSSI_A, RSSI_B;
u1Byte nextAntenna=Antenna_B;
u8Byte curTxOkCnt, curRxOkCnt;
u8Byte CurByteCnt=0, PreByteCnt=0;
u1Byte Score_A=0, Score_B=0;
u1Byte i;
if (!(pDM_Odm->SupportAbility & ODM_BB_ANT_DIV))
return;
if (pDM_Odm->SupportICType & (ODM_RTL8192D|ODM_RTL8188E))
return;
if ((pDM_Odm->SupportICType == ODM_RTL8192C) &&(pDM_Odm->RFType == ODM_2T2R))
return;
if (pDM_Odm->SupportPlatform & ODM_MP)
{
if (*(pDM_Odm->pAntennaTest))
return;
}
if ((pDM_SWAT_Table->ANTA_ON == false) ||(pDM_SWAT_Table->ANTB_ON == false))
{
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,
("odm_SwAntDivChkAntSwitch(): No AntDiv Mechanism, Antenna A or B is off\n"));
return;
}
/* Radio off: Status reset to default and return. */
if (*(pDM_Odm->pbPowerSaving)==true) /* pHalData->eRFPowerState==eRfOff */
{
ODM_SwAntDivRestAfterLink(pDM_Odm);
return;
}
/* Handling step mismatch condition. */
/* Peak step is not finished at last time. Recover the variable and check again. */
if ( Step != pDM_SWAT_Table->try_flag )
{
ODM_SwAntDivRestAfterLink(pDM_Odm);
}
#if (DM_ODM_SUPPORT_TYPE &( ODM_MP| ODM_CE ))
if (pDM_SWAT_Table->try_flag == 0xff)
{
pDM_SWAT_Table->RSSI_target = 0xff;
#if (DM_ODM_SUPPORT_TYPE & ODM_CE)
{
u1Byte index = 0;
PSTA_INFO_T pEntry = NULL;
for (index=0; index<ODM_ASSOCIATE_ENTRY_NUM; index++)
{
pEntry = pDM_Odm->pODM_StaInfo[i];
if (IS_STA_VALID(pEntry) ) {
break;
}
}
if (pEntry == NULL)
{
ODM_SwAntDivRestAfterLink(pDM_Odm);
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): No Link.\n"));
return;
}
else
{
pDM_SWAT_Table->RSSI_target = index;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): RSSI_target is PEER STA\n"));
}
}
#elif (DM_ODM_SUPPORT_TYPE & ODM_MP)
{
PADAPTER pAdapter = pDM_Odm->Adapter;
PMGNT_INFO pMgntInfo=&pAdapter->MgntInfo;
/* Select RSSI checking target */
if (pMgntInfo->mAssoc && !ACTING_AS_AP(pAdapter))
{
/* Target: Infrastructure mode AP. */
/* pDM_SWAT_Table->RSSI_target = NULL; */
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("odm_SwAntDivChkAntSwitch(): RSSI_target is DEF AP!\n"));
}
else
{
u1Byte index = 0;
PSTA_INFO_T pEntry = NULL;
PADAPTER pTargetAdapter = NULL;
if (pMgntInfo->mIbss )
{
/* Target: AP/IBSS peer. */
pTargetAdapter = pAdapter;
}
else
{
pTargetAdapter = GetFirstAPAdapter(pAdapter);
}
if (pTargetAdapter != NULL)
{
for (index=0; index<ODM_ASSOCIATE_ENTRY_NUM; index++)
{
pEntry = AsocEntry_EnumStation(pTargetAdapter, index);
if (pEntry != NULL)
{
if (pEntry->bAssociated)
break;
}
}
}
if (pEntry == NULL)
{
ODM_SwAntDivRestAfterLink(pDM_Odm);
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): No Link.\n"));
return;
}
else
{
/* pDM_SWAT_Table->RSSI_target = pEntry; */
pDM_SWAT_Table->RSSI_target = index;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("odm_SwAntDivChkAntSwitch(): RSSI_target is PEER STA\n"));
}
}/* end if (pMgntInfo->mAssoc && !ACTING_AS_AP(Adapter)) */
}
#endif
pDM_SWAT_Table->RSSI_cnt_A = 0;
pDM_SWAT_Table->RSSI_cnt_B = 0;
pDM_SWAT_Table->try_flag = 0;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD,("odm_SwAntDivChkAntSwitch(): Set try_flag to 0 prepare for peak!\n"));
return;
}
else
{
#if (DM_ODM_SUPPORT_TYPE &( ODM_MP))
curTxOkCnt = pAdapter->TxStats.NumTxBytesUnicast - pDM_SWAT_Table->lastTxOkCnt;
curRxOkCnt =pAdapter->RxStats.NumRxBytesUnicast - pDM_SWAT_Table->lastRxOkCnt;
pDM_SWAT_Table->lastTxOkCnt = pAdapter->TxStats.NumTxBytesUnicast;
pDM_SWAT_Table->lastRxOkCnt = pAdapter->RxStats.NumRxBytesUnicast;
#else
curTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast) - pDM_SWAT_Table->lastTxOkCnt;
curRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast) - pDM_SWAT_Table->lastRxOkCnt;
pDM_SWAT_Table->lastTxOkCnt = *(pDM_Odm->pNumTxBytesUnicast);
pDM_SWAT_Table->lastRxOkCnt = *(pDM_Odm->pNumRxBytesUnicast);
#endif
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("curTxOkCnt = %lld\n",curTxOkCnt));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("curRxOkCnt = %lld\n",curRxOkCnt));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("lastTxOkCnt = %lld\n",pDM_SWAT_Table->lastTxOkCnt));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("lastRxOkCnt = %lld\n",pDM_SWAT_Table->lastRxOkCnt));
if (pDM_SWAT_Table->try_flag == 1) {
if (pDM_SWAT_Table->CurAntenna == Antenna_A) {
pDM_SWAT_Table->TXByteCnt_A += curTxOkCnt;
pDM_SWAT_Table->RXByteCnt_A += curRxOkCnt;
} else {
pDM_SWAT_Table->TXByteCnt_B += curTxOkCnt;
pDM_SWAT_Table->RXByteCnt_B += curRxOkCnt;
}
nextAntenna = (pDM_SWAT_Table->CurAntenna == Antenna_A)? Antenna_B : Antenna_A;
pDM_SWAT_Table->RSSI_Trying--;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("RSSI_Trying = %d\n",pDM_SWAT_Table->RSSI_Trying));
if (pDM_SWAT_Table->RSSI_Trying == 0) {
CurByteCnt = (pDM_SWAT_Table->CurAntenna == Antenna_A)? (pDM_SWAT_Table->TXByteCnt_A+pDM_SWAT_Table->RXByteCnt_A) : (pDM_SWAT_Table->TXByteCnt_B+pDM_SWAT_Table->RXByteCnt_B);
PreByteCnt = (pDM_SWAT_Table->CurAntenna == Antenna_A)? (pDM_SWAT_Table->TXByteCnt_B+pDM_SWAT_Table->RXByteCnt_B) : (pDM_SWAT_Table->TXByteCnt_A+pDM_SWAT_Table->RXByteCnt_A);
if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH)
PreByteCnt = PreByteCnt*9;
else if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_LOW)
PreByteCnt = PreByteCnt*2;
if (pDM_SWAT_Table->RSSI_cnt_A > 0)
RSSI_A = pDM_SWAT_Table->RSSI_sum_A/pDM_SWAT_Table->RSSI_cnt_A;
else
RSSI_A = 0;
if (pDM_SWAT_Table->RSSI_cnt_B > 0)
RSSI_B = pDM_SWAT_Table->RSSI_sum_B/pDM_SWAT_Table->RSSI_cnt_B;
else
RSSI_B = 0;
curRSSI = (pDM_SWAT_Table->CurAntenna == Antenna_A)? RSSI_A : RSSI_B;
pDM_SWAT_Table->PreRSSI = (pDM_SWAT_Table->CurAntenna == Antenna_A)? RSSI_B : RSSI_A;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Luke:PreRSSI = %d, CurRSSI = %d\n",pDM_SWAT_Table->PreRSSI, curRSSI));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: preAntenna= %s, curAntenna= %s\n",
(pDM_SWAT_Table->PreAntenna == Antenna_A?"A":"B"), (pDM_SWAT_Table->CurAntenna == Antenna_A?"A":"B")));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Luke:RSSI_A= %d, RSSI_cnt_A = %d, RSSI_B= %d, RSSI_cnt_B = %d\n",
RSSI_A, pDM_SWAT_Table->RSSI_cnt_A, RSSI_B, pDM_SWAT_Table->RSSI_cnt_B));
} }
} else {
if (pDM_SWAT_Table->RSSI_cnt_A > 0)
RSSI_A = pDM_SWAT_Table->RSSI_sum_A/pDM_SWAT_Table->RSSI_cnt_A;
else
RSSI_A = 0;
if (pDM_SWAT_Table->RSSI_cnt_B > 0)
RSSI_B = pDM_SWAT_Table->RSSI_sum_B/pDM_SWAT_Table->RSSI_cnt_B;
else
RSSI_B = 0;
curRSSI = (pDM_SWAT_Table->CurAntenna == Antenna_A)? RSSI_A : RSSI_B;
pDM_SWAT_Table->PreRSSI = (pDM_SWAT_Table->PreAntenna == Antenna_A)? RSSI_A : RSSI_B;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Ekul:PreRSSI = %d, CurRSSI = %d\n", pDM_SWAT_Table->PreRSSI, curRSSI));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: preAntenna= %s, curAntenna= %s\n",
(pDM_SWAT_Table->PreAntenna == Antenna_A?"A":"B"), (pDM_SWAT_Table->CurAntenna == Antenna_A?"A":"B")));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Ekul:RSSI_A= %d, RSSI_cnt_A = %d, RSSI_B= %d, RSSI_cnt_B = %d\n",
RSSI_A, pDM_SWAT_Table->RSSI_cnt_A, RSSI_B, pDM_SWAT_Table->RSSI_cnt_B));
}
/* 1 Trying State */
if ((pDM_SWAT_Table->try_flag == 1)&&(pDM_SWAT_Table->RSSI_Trying == 0)) {
if (pDM_SWAT_Table->TestMode == TP_MODE) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: TestMode = TP_MODE"));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("TRY:CurByteCnt = %lld,", CurByteCnt));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("TRY:PreByteCnt = %lld\n",PreByteCnt));
if (CurByteCnt < PreByteCnt) {
if (pDM_SWAT_Table->CurAntenna == Antenna_A)
pDM_SWAT_Table->SelectAntennaMap=pDM_SWAT_Table->SelectAntennaMap<<1;
else
pDM_SWAT_Table->SelectAntennaMap=(pDM_SWAT_Table->SelectAntennaMap<<1)+1;
} else {
if (pDM_SWAT_Table->CurAntenna == Antenna_A)
pDM_SWAT_Table->SelectAntennaMap=(pDM_SWAT_Table->SelectAntennaMap<<1)+1;
else
pDM_SWAT_Table->SelectAntennaMap=pDM_SWAT_Table->SelectAntennaMap<<1;
}
for (i= 0; i<8; i++) {
if (((pDM_SWAT_Table->SelectAntennaMap>>i)&BIT0) == 1)
Score_A++;
else
Score_B++;
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SelectAntennaMap=%x\n ",pDM_SWAT_Table->SelectAntennaMap));
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("Score_A=%d, Score_B=%d\n", Score_A, Score_B));
if (pDM_SWAT_Table->CurAntenna == Antenna_A) {
nextAntenna = (Score_A > Score_B)?Antenna_A:Antenna_B;
} else {
nextAntenna = (Score_B > Score_A)?Antenna_B:Antenna_A;
}
if (nextAntenna != pDM_SWAT_Table->CurAntenna) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: Switch back to another antenna"));
} else {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: current anntena is good\n"));
}
}
if (pDM_SWAT_Table->TestMode == RSSI_MODE) {
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: TestMode = RSSI_MODE"));
pDM_SWAT_Table->SelectAntennaMap=0xAA;
if (curRSSI < pDM_SWAT_Table->PreRSSI) /* Current antenna is worse than previous antenna */
{
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: Switch back to another antenna"));
nextAntenna = (pDM_SWAT_Table->CurAntenna == Antenna_A)? Antenna_B : Antenna_A;
}
else /* current anntena is good */
{
nextAntenna =pDM_SWAT_Table->CurAntenna;
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: current anntena is good\n"));
}
}
pDM_SWAT_Table->try_flag = 0;
pDM_Odm->RSSI_test = false;
pDM_SWAT_Table->RSSI_sum_A = 0;
pDM_SWAT_Table->RSSI_cnt_A = 0;
pDM_SWAT_Table->RSSI_sum_B = 0;
pDM_SWAT_Table->RSSI_cnt_B = 0;
pDM_SWAT_Table->TXByteCnt_A = 0;
pDM_SWAT_Table->TXByteCnt_B = 0;
pDM_SWAT_Table->RXByteCnt_A = 0;
pDM_SWAT_Table->RXByteCnt_B = 0;
}
/* 1 Normal State */
else if (pDM_SWAT_Table->try_flag == 0)
{
if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH)
{
if ((curTxOkCnt+curRxOkCnt) > 3750000)/* if (PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) */
pDM_SWAT_Table->TrafficLoad = TRAFFIC_HIGH;
else
pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW;
}
else if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_LOW)
{
if ((curTxOkCnt+curRxOkCnt) > 3750000) /* if (PlatformDivision64(curTxOkCnt+curRxOkCnt, 2) > 1875000) */
pDM_SWAT_Table->TrafficLoad = TRAFFIC_HIGH;
else
pDM_SWAT_Table->TrafficLoad = TRAFFIC_LOW;
}
if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH)
pDM_SWAT_Table->bTriggerAntennaSwitch = 0;
/* Prepare To Try Antenna */
nextAntenna = (pDM_SWAT_Table->CurAntenna == Antenna_A)? Antenna_B : Antenna_A;
pDM_SWAT_Table->try_flag = 1;
pDM_Odm->RSSI_test = true;
if ((curRxOkCnt+curTxOkCnt) > 1000)
{
pDM_SWAT_Table->RSSI_Trying = 4;
pDM_SWAT_Table->TestMode = TP_MODE;
}
else
{
pDM_SWAT_Table->RSSI_Trying = 2;
pDM_SWAT_Table->TestMode = RSSI_MODE;
}
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: Normal State -> Begin Trying!\n"));
pDM_SWAT_Table->RSSI_sum_A = 0;
pDM_SWAT_Table->RSSI_cnt_A = 0;
pDM_SWAT_Table->RSSI_sum_B = 0;
pDM_SWAT_Table->RSSI_cnt_B = 0;
}
}
/* 1 4.Change TRX antenna */
if (nextAntenna != pDM_SWAT_Table->CurAntenna)
{
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("SWAS: Change TX Antenna!\n "));
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
ODM_SetAntenna(pDM_Odm,nextAntenna);
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
{
bool bEnqueue;
bEnqueue = (pDM_Odm->SupportInterface == ODM_ITRF_PCIE)?false :true;
rtw_antenna_select_cmd(pDM_Odm->Adapter, nextAntenna, bEnqueue);
}
#endif
}
/* 1 5.Reset Statistics */
pDM_SWAT_Table->PreAntenna = pDM_SWAT_Table->CurAntenna;
pDM_SWAT_Table->CurAntenna = nextAntenna;
pDM_SWAT_Table->PreRSSI = curRSSI;
/* 1 6.Set next timer */
{
PADAPTER pAdapter = pDM_Odm->Adapter;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
if (pDM_SWAT_Table->RSSI_Trying == 0)
return;
if (pDM_SWAT_Table->RSSI_Trying%2 == 0)
{
if (pDM_SWAT_Table->TestMode == TP_MODE)
{
if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH)
{
ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 10 ); /* ms */
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_SW_AntennaSwitch(): Test another antenna for 10 ms\n"));
}
else if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_LOW)
{
ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 50 ); /* ms */
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_SW_AntennaSwitch(): Test another antenna for 50 ms\n"));
}
}
else
{
ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 500 ); /* ms */
ODM_RT_TRACE(pDM_Odm, ODM_COMP_ANT_DIV, ODM_DBG_LOUD, ("dm_SW_AntennaSwitch(): Test another antenna for 500 ms\n"));
}
}
else
{
if (pDM_SWAT_Table->TestMode == TP_MODE)
{
if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_HIGH)
ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 90 ); /* ms */
else if (pDM_SWAT_Table->TrafficLoad == TRAFFIC_LOW)
ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 100 ); /* ms */
}
else
ODM_SetTimer(pDM_Odm,&pDM_SWAT_Table->SwAntennaSwitchTimer, 100 ); /* ms */
}
}
#endif /* #if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_CE)) */
#endif /* #if (RTL8192C_SUPPORT==1) */
}
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
u1Byte
odm_SwAntDivSelectChkChnl(
PADAPTER Adapter
)
{
#if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM)
u1Byte index, target_chnl=0;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
PDM_ODM_T pDM_Odm = &pHalData->DM_OutSrc;
u1Byte chnl_peer_cnt[14] = {0};
if (Adapter->MgntInfo.tmpNumBssDesc==0)
{
return 0;
}
else
{
/* 20100519 Joseph: Select checking channel from current scan list. */
/* We just choose the channel with most APs to be the test scan channel. */
for (index=0; index<Adapter->MgntInfo.tmpNumBssDesc; index++)
{
/* Add by hpfan: prevent access invalid channel number */
/* TODO: Verify channel number by channel plan */
if (Adapter->MgntInfo.tmpbssDesc[index].ChannelNumber == 0 ||
Adapter->MgntInfo.tmpbssDesc[index].ChannelNumber > 13)
continue;
chnl_peer_cnt[Adapter->MgntInfo.tmpbssDesc[index].ChannelNumber-1]++;
}
for (index=0; index<14; index++)
{
if (chnl_peer_cnt[index]>chnl_peer_cnt[target_chnl])
target_chnl = index;
}
target_chnl+=1;
ODM_RT_TRACE(pDM_Odm,COMP_SWAS, DBG_LOUD,
("odm_SwAntDivSelectChkChnl(): Channel %d is select as test channel.\n", target_chnl));
return target_chnl;
}
#else
return 0;
#endif
}
void
odm_SwAntDivConsructChkScanChnl(
PADAPTER Adapter,
u1Byte ChkChnl
)
{
PMGNT_INFO pMgntInfo = &Adapter->MgntInfo;
PRT_CHANNEL_LIST pChannelList = GET_RT_CHANNEL_LIST(pMgntInfo);
u1Byte index;
if (ChkChnl==0)
{
/* 20100519 Joseph: Original antenna scanned nothing. */
/* Test antenna shall scan all channel with half period in this condition. */
RtActChannelList(Adapter, RT_CHNL_LIST_ACTION_CONSTRUCT_SCAN_LIST, NULL, NULL);
for (index=0; index<pChannelList->ChannelLen; index++)
pChannelList->ChannelInfo[index].ScanPeriod /= 2;
}
else
{
/* The using of this CustomizedScanRequest is a trick to rescan the two channels */
/* under the NORMAL scanning process. It will not affect MGNT_INFO.CustomizedScanRequest. */
CUSTOMIZED_SCAN_REQUEST CustomScanReq;
CustomScanReq.bEnabled = true;
CustomScanReq.Channels[0] = ChkChnl;
CustomScanReq.Channels[1] = pMgntInfo->dot11CurrentChannelNumber;
CustomScanReq.nChannels = 2;
CustomScanReq.ScanType = SCAN_ACTIVE;
CustomScanReq.Duration = DEFAULT_ACTIVE_SCAN_PERIOD;
RtActChannelList(Adapter, RT_CHNL_LIST_ACTION_CONSTRUCT_SCAN_LIST, &CustomScanReq, NULL);
}
}
#endif /* if (DM_ODM_SUPPORT_TYPE == ODM_MP) */
/* */
/* 20100514 Luke/Joseph: */
/* Callback function for 500ms antenna test trying. */
/* */
#if (DM_ODM_SUPPORT_TYPE == ODM_MP)
void
odm_SwAntDivChkAntSwitchCallback(
PRT_TIMER pTimer
)
{
PADAPTER Adapter = (PADAPTER)pTimer->Adapter;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
pSWAT_T pDM_SWAT_Table = &pHalData->DM_OutSrc.DM_SWAT_Table;
#if DEV_BUS_TYPE==RT_PCI_INTERFACE
#if USE_WORKITEM
ODM_ScheduleWorkItem(&pDM_SWAT_Table->SwAntennaSwitchWorkitem);
#else
odm_SwAntDivChkAntSwitch(&pHalData->DM_OutSrc, SWAW_STEP_DETERMINE);
#endif
#else
ODM_ScheduleWorkItem(&pDM_SWAT_Table->SwAntennaSwitchWorkitem);
#endif
}
void
odm_SwAntDivChkAntSwitchWorkitemCallback(
void * pContext
)
{
PADAPTER pAdapter = (PADAPTER)pContext;
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(pAdapter);
odm_SwAntDivChkAntSwitch(&pHalData->DM_OutSrc, SWAW_STEP_DETERMINE);
}
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext)
{
PDM_ODM_T pDM_Odm= (PDM_ODM_T)FunctionContext;
PADAPTER padapter = pDM_Odm->Adapter;
if (padapter->net_closed == true)
return;
odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_DETERMINE);
}
#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext)
{
PDM_ODM_T pDM_Odm= (PDM_ODM_T)FunctionContext;
odm_SwAntDivChkAntSwitch(pDM_Odm, SWAW_STEP_DETERMINE);
}
#endif
#else /* if (defined(CONFIG_SW_ANTENNA_DIVERSITY)) */
void odm_SwAntDivInit( PDM_ODM_T pDM_Odm ) {}
void ODM_SwAntDivChkPerPktRssi(
PDM_ODM_T pDM_Odm,
u1Byte StationID,
PODM_PHY_INFO_T pPhyInfo
) {}
void odm_SwAntDivChkAntSwitch(
PDM_ODM_T pDM_Odm,
u1Byte Step
) {}
static void ODM_SwAntDivResetBeforeLink(PDM_ODM_T pDM_Odm) static void ODM_SwAntDivResetBeforeLink(PDM_ODM_T pDM_Odm)
{ {
}
void ODM_SwAntDivRestAfterLink(PDM_ODM_T pDM_Odm)
{
} }
void ODM_SwAntDivRestAfterLink( PDM_ODM_T pDM_Odm ){}
#if (DM_ODM_SUPPORT_TYPE == ODM_MP) #if (DM_ODM_SUPPORT_TYPE == ODM_MP)
u1Byte odm_SwAntDivSelectChkChnl( PADAPTER Adapter ){ return 0;} u1Byte odm_SwAntDivSelectChkChnl(PADAPTER Adapter)
void {
odm_SwAntDivConsructChkScanChnl( return 0;
PADAPTER Adapter, }
u1Byte ChkChnl
){} void odm_SwAntDivConsructChkScanChnl(PADAPTER Adapter, u1Byte ChkChnl)
{
}
#endif #endif
#if (DM_ODM_SUPPORT_TYPE == ODM_MP) #if (DM_ODM_SUPPORT_TYPE == ODM_MP)
void odm_SwAntDivChkAntSwitchCallback( PRT_TIMER pTimer){} void odm_SwAntDivChkAntSwitchCallback(PRT_TIMER pTimer)
void odm_SwAntDivChkAntSwitchWorkitemCallback(void * pContext ){} {
}
void odm_SwAntDivChkAntSwitchWorkitemCallback(void *pContext)
{
}
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE) #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext){} void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext)
{
}
#elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL)) #elif (DM_ODM_SUPPORT_TYPE & (ODM_AP|ODM_ADSL))
void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext){} void odm_SwAntDivChkAntSwitchCallback(void *FunctionContext)
{
}
#endif #endif
#endif /* if (defined(CONFIG_SW_ANTENNA_DIVERSITY)) */
#if (DM_ODM_SUPPORT_TYPE == ODM_MP) #if (DM_ODM_SUPPORT_TYPE == ODM_MP)
#if ((defined(CONFIG_SW_ANTENNA_DIVERSITY))||(defined(CONFIG_HW_ANTENNA_DIVERSITY))) bool ODM_SwAntDivCheckBeforeLink8192C(PDM_ODM_T pDM_Odm)
bool
ODM_SwAntDivCheckBeforeLink8192C(
PDM_ODM_T pDM_Odm
)
{ {
#if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM) #if (RT_MEM_SIZE_LEVEL != RT_MEM_SIZE_MINIMUM)
PADAPTER Adapter = pDM_Odm->Adapter; PADAPTER Adapter = pDM_Odm->Adapter;
HAL_DATA_TYPE *pHalData=NULL; HAL_DATA_TYPE *pHalData=NULL;
PMGNT_INFO pMgntInfo = NULL; PMGNT_INFO pMgntInfo = NULL;
/* pSWAT_T pDM_SWAT_Table = &Adapter->DM_SWAT_Table; */
pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table; pSWAT_T pDM_SWAT_Table = &pDM_Odm->DM_SWAT_Table;
pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable; pFAT_T pDM_FatTable = &pDM_Odm->DM_FatTable;
@ -5280,17 +4535,6 @@ return false;
return false; return false;
} }
#else
bool
ODM_SwAntDivCheckBeforeLink8192C(
PDM_ODM_T pDM_Odm
)
{
return false;
}
#endif /* if ((defined(CONFIG_SW_ANTENNA_DIVERSITY))||(defined(CONFIG_HW_ANTENNA_DIVERSITY))) */
#endif /* if (DM_ODM_SUPPORT_TYPE==ODM_MP) */ #endif /* if (DM_ODM_SUPPORT_TYPE==ODM_MP) */
@ -5298,7 +4542,6 @@ ODM_SwAntDivCheckBeforeLink8192C(
/* 3 SW Antenna Diversity */ /* 3 SW Antenna Diversity */
/* 3============================================================ */ /* 3============================================================ */
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
static void odm_InitHybridAntDiv_88C_92D( static void odm_InitHybridAntDiv_88C_92D(
PDM_ODM_T pDM_Odm PDM_ODM_T pDM_Odm
) )
@ -5797,25 +5040,6 @@ ODM_Diversity_AntennaSelect(
} }
#endif #endif
#else /* if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) */
void odm_InitHybridAntDiv( PDM_ODM_T pDM_Odm ){}
void odm_HwAntDiv( PDM_ODM_T pDM_Odm){}
#if (DM_ODM_SUPPORT_TYPE==ODM_MP)
void ODM_SetTxAntByTxInfo_88C_92D(
PDM_ODM_T pDM_Odm,
pu1Byte pDesc,
u1Byte macId
){}
#elif (DM_ODM_SUPPORT_TYPE==ODM_CE)
void ODM_SetTxAntByTxInfo_88C_92D( PDM_ODM_T pDM_Odm){ }
#elif (DM_ODM_SUPPORT_TYPE==ODM_AP)
void ODM_SetTxAntByTxInfo_88C_92D( PDM_ODM_T pDM_Odm){ }
#endif
#endif /* if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) */
/* */ /* */
/* EDCA Turbo */ /* EDCA Turbo */
/* */ /* */

View file

@ -691,13 +691,11 @@ odm_RxPhyStatus92CSeries_Parsing(
#endif #endif
/* For 92C/92D HW (Hybrid) Antenna Diversity */ /* For 92C/92D HW (Hybrid) Antenna Diversity */
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
pDM_SWAT_Table->antsel = pPhyStaRpt->ant_sel; pDM_SWAT_Table->antsel = pPhyStaRpt->ant_sel;
/* For 88E HW Antenna Diversity */ /* For 88E HW Antenna Diversity */
pDM_Odm->DM_FatTable.antsel_rx_keep_0 = pPhyStaRpt->ant_sel; pDM_Odm->DM_FatTable.antsel_rx_keep_0 = pPhyStaRpt->ant_sel;
pDM_Odm->DM_FatTable.antsel_rx_keep_1 = pPhyStaRpt->ant_sel_b; pDM_Odm->DM_FatTable.antsel_rx_keep_1 = pPhyStaRpt->ant_sel_b;
pDM_Odm->DM_FatTable.antsel_rx_keep_2 = pPhyStaRpt->antsel_rx_keep_2; pDM_Odm->DM_FatTable.antsel_rx_keep_2 = pPhyStaRpt->antsel_rx_keep_2;
#endif
} }
void void
@ -743,7 +741,6 @@ static void odm_Process_RSSIForDM(
isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M) && (pPktinfo->Rate <= DESC92C_RATE11M)) ? true : false; isCCKrate = ((pPktinfo->Rate >= DESC92C_RATE1M) && (pPktinfo->Rate <= DESC92C_RATE11M)) ? true : false;
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
#if ((RTL8192C_SUPPORT == 1) ||(RTL8192D_SUPPORT == 1)) #if ((RTL8192C_SUPPORT == 1) ||(RTL8192D_SUPPORT == 1))
if (pDM_Odm->SupportICType & ODM_RTL8192C|ODM_RTL8192D) if (pDM_Odm->SupportICType & ODM_RTL8192C|ODM_RTL8192D)
{ {
@ -794,7 +791,6 @@ static void odm_Process_RSSIForDM(
} }
#endif #endif
#endif /* if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) */
/* Smart Antenna Debug Message------------------ */ /* Smart Antenna Debug Message------------------ */
UndecoratedSmoothedCCK = pEntry->rssi_stat.UndecoratedSmoothedCCK; UndecoratedSmoothedCCK = pEntry->rssi_stat.UndecoratedSmoothedCCK;

View file

@ -44,7 +44,6 @@ ODM_DIG_LowerBound_88E(
} }
#if (defined(CONFIG_HW_ANTENNA_DIVERSITY))
static void static void
odm_RX_HWAntDivInit( odm_RX_HWAntDivInit(
PDM_ODM_T pDM_Odm PDM_ODM_T pDM_Odm
@ -704,25 +703,6 @@ ODM_AntennaDiversity_88E(
#endif #endif
} }
#else /* if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) */
#if (DM_ODM_SUPPORT_TYPE & (ODM_MP|ODM_CE))
void
ODM_SetTxAntByTxInfo_88E(
PDM_ODM_T pDM_Odm,
pu1Byte pDesc,
u1Byte macId
)
{
}
#else/* (DM_ODM_SUPPORT_TYPE == ODM_AP) */
void
ODM_SetTxAntByTxInfo_88E(
PDM_ODM_T pDM_Odm
)
{
}
#endif
#endif /* if (defined(CONFIG_HW_ANTENNA_DIVERSITY)) */
/* 3============================================================ */ /* 3============================================================ */
/* 3 Dynamic Primary CCA */ /* 3 Dynamic Primary CCA */
/* 3============================================================ */ /* 3============================================================ */

View file

@ -350,9 +350,6 @@ void rtl8188e_init_dm_priv(PADAPTER Adapter)
PDM_ODM_T podmpriv = &pHalData->odmpriv; PDM_ODM_T podmpriv = &pHalData->odmpriv;
_rtw_memset(pdmpriv, 0, sizeof(struct dm_priv)); _rtw_memset(pdmpriv, 0, sizeof(struct dm_priv));
Init_ODM_ComInfo_88E(Adapter); Init_ODM_ComInfo_88E(Adapter);
#ifdef CONFIG_SW_ANTENNA_DIVERSITY
ODM_InitAllTimers(podmpriv );
#endif
ODM_InitDebugSetting(podmpriv); ODM_InitDebugSetting(podmpriv);
} }
@ -361,21 +358,15 @@ void rtl8188e_deinit_dm_priv(PADAPTER Adapter)
PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter);
struct dm_priv *pdmpriv = &pHalData->dmpriv; struct dm_priv *pdmpriv = &pHalData->dmpriv;
PDM_ODM_T podmpriv = &pHalData->odmpriv; PDM_ODM_T podmpriv = &pHalData->odmpriv;
#ifdef CONFIG_SW_ANTENNA_DIVERSITY
ODM_CancelAllTimers(podmpriv);
#endif
} }
#ifdef CONFIG_ANTENNA_DIVERSITY
/* Add new function to reset the state of antenna diversity before link. */ /* Add new function to reset the state of antenna diversity before link. */
/* */ /* */
/* Compare RSSI for deciding antenna */ /* Compare RSSI for deciding antenna */
void AntDivCompare8188E(PADAPTER Adapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src) void AntDivCompare8188E(PADAPTER Adapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src)
{ {
HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter);
if (0 != pHalData->AntDivCfg ) if (0 != pHalData->AntDivCfg) {
{
/* select optimum_antenna for before linked =>For antenna diversity */ /* select optimum_antenna for before linked =>For antenna diversity */
if (dst->Rssi >= src->Rssi )/* keep org parameter */ if (dst->Rssi >= src->Rssi )/* keep org parameter */
{ {
@ -399,10 +390,7 @@ u8 AntDivBeforeLink8188E(PADAPTER Adapter )
return false; return false;
if (check_fwstate(pmlmepriv, _FW_LINKED) == true) if (check_fwstate(pmlmepriv, _FW_LINKED) == true)
{
return false; return false;
}
if (pDM_SWAT_Table->SWAS_NoLink_State == 0){ if (pDM_SWAT_Table->SWAS_NoLink_State == 0){
/* switch channel */ /* switch channel */
@ -417,4 +405,3 @@ u8 AntDivBeforeLink8188E(PADAPTER Adapter )
} }
} }
#endif

View file

@ -2552,11 +2552,8 @@ void rtl8188e_set_hal_ops(struct hal_ops *pHalFunc)
pHalFunc->run_thread= &rtl8188e_start_thread; pHalFunc->run_thread= &rtl8188e_start_thread;
pHalFunc->cancel_thread= &rtl8188e_stop_thread; pHalFunc->cancel_thread= &rtl8188e_stop_thread;
#ifdef CONFIG_ANTENNA_DIVERSITY
pHalFunc->AntDivBeforeLinkHandler = &AntDivBeforeLink8188E; pHalFunc->AntDivBeforeLinkHandler = &AntDivBeforeLink8188E;
pHalFunc->AntDivCompareHandler = &AntDivCompare8188E; pHalFunc->AntDivCompareHandler = &AntDivCompare8188E;
#endif
pHalFunc->read_bbreg = &rtl8188e_PHY_QueryBBReg; pHalFunc->read_bbreg = &rtl8188e_PHY_QueryBBReg;
pHalFunc->write_bbreg = &rtl8188e_PHY_SetBBReg; pHalFunc->write_bbreg = &rtl8188e_PHY_SetBBReg;
pHalFunc->read_rfreg = &rtl8188e_PHY_QueryRFReg; pHalFunc->read_rfreg = &rtl8188e_PHY_QueryRFReg;

View file

@ -437,14 +437,11 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz ,u8 bag
} }
#ifdef CONFIG_HW_ANTENNA_DIVERSITY /* CONFIG_ANTENNA_DIVERSITY */
ODM_SetTxAntByTxInfo_88E(&pHalData->odmpriv, pmem, pattrib->mac_id); ODM_SetTxAntByTxInfo_88E(&pHalData->odmpriv, pmem, pattrib->mac_id);
#endif
rtl8188eu_cal_txdesc_chksum(ptxdesc); rtl8188eu_cal_txdesc_chksum(ptxdesc);
_dbg_dump_tx_info(padapter,pxmitframe->frame_tag,ptxdesc); _dbg_dump_tx_info(padapter,pxmitframe->frame_tag,ptxdesc);
return pull; return pull;
} }

View file

@ -2976,20 +2976,12 @@ _func_enter_;
} }
break; break;
#endif #endif
#ifdef CONFIG_SW_ANTENNA_DIVERSITY
case HW_VAR_ANTENNA_DIVERSITY_LINK:
ODM_SwAntDivRestAfterLink(podmpriv);
break;
#endif
#ifdef CONFIG_ANTENNA_DIVERSITY
case HW_VAR_ANTENNA_DIVERSITY_SELECT: case HW_VAR_ANTENNA_DIVERSITY_SELECT:
{ {
u8 Optimum_antenna = (*(u8 *)val); u8 Optimum_antenna = (*(u8 *)val);
u8 Ant ; u8 Ant ;
/* switch antenna to Optimum_antenna */ /* switch antenna to Optimum_antenna */
if (pHalData->CurAntenna != Optimum_antenna) if (pHalData->CurAntenna != Optimum_antenna) {
{
Ant = (Optimum_antenna==2)?MAIN_ANT:AUX_ANT; Ant = (Optimum_antenna==2)?MAIN_ANT:AUX_ANT;
ODM_UpdateRxIdleAnt_88E(&pHalData->odmpriv, Ant); ODM_UpdateRxIdleAnt_88E(&pHalData->odmpriv, Ant);
@ -2997,7 +2989,6 @@ _func_enter_;
} }
} }
break; break;
#endif
case HW_VAR_EFUSE_BYTES: /* To set EFUE total used bytes, added by Roger, 2008.12.22. */ case HW_VAR_EFUSE_BYTES: /* To set EFUE total used bytes, added by Roger, 2008.12.22. */
pHalData->EfuseUsedBytes = *((u16 *)val); pHalData->EfuseUsedBytes = *((u16 *)val);
break; break;
@ -3196,11 +3187,9 @@ _func_enter_;
} }
} }
break; break;
#ifdef CONFIG_ANTENNA_DIVERSITY
case HW_VAR_CURRENT_ANTENNA: case HW_VAR_CURRENT_ANTENNA:
val[0] = pHalData->CurAntenna; val[0] = pHalData->CurAntenna;
break; break;
#endif
case HW_VAR_EFUSE_BYTES: /* To get EFUE total used bytes, added by Roger, 2008.12.22. */ case HW_VAR_EFUSE_BYTES: /* To get EFUE total used bytes, added by Roger, 2008.12.22. */
*((u16 *)(val)) = pHalData->EfuseUsedBytes; *((u16 *)(val)) = pHalData->EfuseUsedBytes;
break; break;
@ -3255,14 +3244,10 @@ GetHalDefVar8188EUsb(
#endif #endif
break; break;
case HAL_DEF_IS_SUPPORT_ANT_DIV: case HAL_DEF_IS_SUPPORT_ANT_DIV:
#ifdef CONFIG_ANTENNA_DIVERSITY
*((u8 *)pValue) = (pHalData->AntDivCfg==0)?false:true; *((u8 *)pValue) = (pHalData->AntDivCfg==0)?false:true;
#endif
break; break;
case HAL_DEF_CURRENT_ANTENNA: case HAL_DEF_CURRENT_ANTENNA:
#ifdef CONFIG_ANTENNA_DIVERSITY
*(( u8*)pValue) = pHalData->CurAntenna; *(( u8*)pValue) = pHalData->CurAntenna;
#endif
break; break;
case HAL_DEF_DRVINFO_SZ: case HAL_DEF_DRVINFO_SZ:
*(( u32*)pValue) = DRVINFO_SZ; *(( u32*)pValue) = DRVINFO_SZ;

View file

@ -77,14 +77,6 @@
#define CONFIG_XMIT_THREAD_MODE #define CONFIG_XMIT_THREAD_MODE
#endif #endif
//befor link
#define CONFIG_ANTENNA_DIVERSITY
//after link
#ifdef CONFIG_ANTENNA_DIVERSITY
#define CONFIG_HW_ANTENNA_DIVERSITY
#endif
#define CONFIG_AP_MODE #define CONFIG_AP_MODE
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE
#ifdef CONFIG_INTERRUPT_BASED_TXBCN #ifdef CONFIG_INTERRUPT_BASED_TXBCN

View file

@ -204,10 +204,8 @@ struct hal_ops {
void (*run_thread)(_adapter *padapter); void (*run_thread)(_adapter *padapter);
void (*cancel_thread)(_adapter *padapter); void (*cancel_thread)(_adapter *padapter);
#ifdef CONFIG_ANTENNA_DIVERSITY
u8 (*AntDivBeforeLinkHandler)(_adapter *padapter); u8 (*AntDivBeforeLinkHandler)(_adapter *padapter);
void (*AntDivCompareHandler)(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src); void (*AntDivCompareHandler)(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src);
#endif
u8 (*interface_ps_func)(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id, u8* val); u8 (*interface_ps_func)(_adapter *padapter,HAL_INTF_PS_FUNC efunc_id, u8* val);
s32 (*hal_xmit)(_adapter *padapter, struct xmit_frame *pxmitframe); s32 (*hal_xmit)(_adapter *padapter, struct xmit_frame *pxmitframe);
@ -424,10 +422,8 @@ void rtw_hal_set_bwmode(_adapter *padapter, HT_CHANNEL_WIDTH Bandwidth, u8 Offse
void rtw_hal_set_chan(_adapter *padapter, u8 channel); void rtw_hal_set_chan(_adapter *padapter, u8 channel);
void rtw_hal_dm_watchdog(_adapter *padapter); void rtw_hal_dm_watchdog(_adapter *padapter);
#ifdef CONFIG_ANTENNA_DIVERSITY
u8 rtw_hal_antdiv_before_linked(_adapter *padapter); u8 rtw_hal_antdiv_before_linked(_adapter *padapter);
void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src); void rtw_hal_antdiv_rssi_compared(_adapter *padapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src);
#endif
#ifdef DBG_CONFIG_ERROR_DETECT #ifdef DBG_CONFIG_ERROR_DETECT
void rtw_hal_sreset_init(_adapter *padapter); void rtw_hal_sreset_init(_adapter *padapter);

View file

@ -263,7 +263,6 @@ typedef struct _SW_Antenna_Switch_
u8Byte RXByteCnt_B; u8Byte RXByteCnt_B;
u1Byte TrafficLoad; u1Byte TrafficLoad;
RT_TIMER SwAntennaSwitchTimer; RT_TIMER SwAntennaSwitchTimer;
#ifdef CONFIG_HW_ANTENNA_DIVERSITY
//Hybrid Antenna Diversity //Hybrid Antenna Diversity
u4Byte CCK_Ant1_Cnt[ASSOCIATE_ENTRY_NUM]; u4Byte CCK_Ant1_Cnt[ASSOCIATE_ENTRY_NUM];
u4Byte CCK_Ant2_Cnt[ASSOCIATE_ENTRY_NUM]; u4Byte CCK_Ant2_Cnt[ASSOCIATE_ENTRY_NUM];
@ -275,9 +274,6 @@ typedef struct _SW_Antenna_Switch_
u1Byte TargetSTA; u1Byte TargetSTA;
u1Byte antsel; u1Byte antsel;
u1Byte RxIdleAnt; u1Byte RxIdleAnt;
#endif
}SWAT_T, *pSWAT_T; }SWAT_T, *pSWAT_T;
typedef struct _EDCA_TURBO_ typedef struct _EDCA_TURBO_

View file

@ -103,9 +103,6 @@ typedef enum _RT_SPINLOCK_TYPE{
#define STA_INFO_T RT_WLAN_STA #define STA_INFO_T RT_WLAN_STA
#define PSTA_INFO_T PRT_WLAN_STA #define PSTA_INFO_T PRT_WLAN_STA
#define CONFIG_HW_ANTENNA_DIVERSITY
#define CONFIG_SW_ANTENNA_DIVERSITY
#elif (DM_ODM_SUPPORT_TYPE == ODM_AP) #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. // To let ADSL/AP project compile ok; it should be removed after all conflict are solved. Added by Annie, 2011-10-07.

View file

@ -56,9 +56,7 @@ void rtl8188e_deinit_dm_priv(PADAPTER Adapter);
void rtl8188e_InitHalDm(PADAPTER Adapter); void rtl8188e_InitHalDm(PADAPTER Adapter);
void rtl8188e_HalDmWatchDog(PADAPTER Adapter); void rtl8188e_HalDmWatchDog(PADAPTER Adapter);
#ifdef CONFIG_ANTENNA_DIVERSITY
void AntDivCompare8188E(PADAPTER Adapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src); void AntDivCompare8188E(PADAPTER Adapter, WLAN_BSSID_EX *dst, WLAN_BSSID_EX *src);
u8 AntDivBeforeLink8188E(PADAPTER Adapter ); u8 AntDivBeforeLink8188E(PADAPTER Adapter );
#endif
#endif #endif

View file

@ -948,10 +948,7 @@ u8 rtw_lps_ctrl_wk_cmd(_adapter*padapter, u8 lps_ctrl_type, u8 enqueue);
u8 rtw_rpt_timer_cfg_cmd(_adapter*padapter, u16 minRptTime); u8 rtw_rpt_timer_cfg_cmd(_adapter*padapter, u16 minRptTime);
#endif #endif
#ifdef CONFIG_ANTENNA_DIVERSITY
extern u8 rtw_antenna_select_cmd(_adapter*padapter, u8 antenna,u8 enqueue); extern u8 rtw_antenna_select_cmd(_adapter*padapter, u8 antenna,u8 enqueue);
#endif
extern u8 rtw_ps_cmd(_adapter*padapter); extern u8 rtw_ps_cmd(_adapter*padapter);
#ifdef CONFIG_AP_MODE #ifdef CONFIG_AP_MODE