Release 4.11 drivers/staging/rtl8188eu/hal/rtl8188e_dm.c
/******************************************************************************
*
* 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.
*
******************************************************************************/
/* */
/* Description: */
/* */
/* This file is for 92CE/92CU dynamic mechanism only */
/* */
/* */
/* */
#define _RTL8188E_DM_C_
#include <osdep_service.h>
#include <drv_types.h>
#include <rtl8188e_hal.h>
/* Initialize GPIO setting registers */
static void dm_InitGPIOSetting(struct adapter *Adapter)
{
u8 tmp1byte;
tmp1byte = usb_read8(Adapter, REG_GPIO_MUXCFG);
tmp1byte &= (GPIOSEL_GPIO | ~GPIOSEL_ENBT);
usb_write8(Adapter, REG_GPIO_MUXCFG, tmp1byte);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 39 | 95.12% | 1 | 33.33% |
Navin Patidar | 2 | 4.88% | 2 | 66.67% |
Total | 41 | 100.00% | 3 | 100.00% |
/* */
/* functions */
/* */
static void Init_ODM_ComInfo_88E(struct adapter *Adapter)
{
struct hal_data_8188e *hal_data = Adapter->HalData;
struct dm_priv *pdmpriv = &hal_data->dmpriv;
struct odm_dm_struct *dm_odm = &(hal_data->odmpriv);
/* Init Value */
memset(dm_odm, 0, sizeof(*dm_odm));
dm_odm->Adapter = Adapter;
dm_odm->SupportPlatform = ODM_CE;
dm_odm->SupportICType = ODM_RTL8188E;
dm_odm->CutVersion = ODM_CUT_A;
dm_odm->bIsMPChip = hal_data->VersionID.ChipType == NORMAL_CHIP;
dm_odm->PatchID = hal_data->CustomerID;
dm_odm->bWIFITest = Adapter->registrypriv.wifi_spec;
dm_odm->AntDivType = hal_data->TRxAntDivType;
/* Tx power tracking BB swing table. */
/* The base index = 12. +((12-n)/2)dB 13~?? = decrease tx pwr by -((n-12)/2)dB */
dm_odm->BbSwingIdxOfdm = 12; /* Set defalut value as index 12. */
dm_odm->BbSwingIdxOfdmCurrent = 12;
dm_odm->BbSwingFlagOfdm = false;
pdmpriv->InitODMFlag = ODM_RF_CALIBRATION |
ODM_RF_TX_PWR_TRACK;
dm_odm->SupportAbility = pdmpriv->InitODMFlag;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 102 | 65.81% | 1 | 14.29% |
Ivan Safonov | 51 | 32.90% | 4 | 57.14% |
Thomas Meyer | 1 | 0.65% | 1 | 14.29% |
Navin Patidar | 1 | 0.65% | 1 | 14.29% |
Total | 155 | 100.00% | 7 | 100.00% |
static void Update_ODM_ComInfo_88E(struct adapter *Adapter)
{
struct mlme_ext_priv *pmlmeext = &Adapter->mlmeextpriv;
struct mlme_priv *pmlmepriv = &Adapter->mlmepriv;
struct pwrctrl_priv *pwrctrlpriv = &Adapter->pwrctrlpriv;
struct hal_data_8188e *hal_data = Adapter->HalData;
struct odm_dm_struct *dm_odm = &(hal_data->odmpriv);
struct dm_priv *pdmpriv = &hal_data->dmpriv;
int i;
pdmpriv->InitODMFlag = ODM_BB_DIG |
ODM_BB_RA_MASK |
ODM_BB_DYNAMIC_TXPWR |
ODM_BB_FA_CNT |
ODM_BB_RSSI_MONITOR |
ODM_BB_CCK_PD |
ODM_BB_PWR_SAVE |
ODM_MAC_EDCA_TURBO |
ODM_RF_CALIBRATION |
ODM_RF_TX_PWR_TRACK;
if (hal_data->AntDivCfg)
pdmpriv->InitODMFlag |= ODM_BB_ANT_DIV;
if (Adapter->registrypriv.mp_mode == 1) {
pdmpriv->InitODMFlag = ODM_RF_CALIBRATION |
ODM_RF_TX_PWR_TRACK;
}
dm_odm->SupportAbility = pdmpriv->InitODMFlag;
dm_odm->pNumTxBytesUnicast = &Adapter->xmitpriv.tx_bytes;
dm_odm->pNumRxBytesUnicast = &Adapter->recvpriv.rx_bytes;
dm_odm->pWirelessMode = &pmlmeext->cur_wireless_mode;
dm_odm->pSecChOffset = &hal_data->nCur40MhzPrimeSC;
dm_odm->pSecurity = (u8 *)&Adapter->securitypriv.dot11PrivacyAlgrthm;
dm_odm->pBandWidth = (u8 *)&hal_data->CurrentChannelBW;
dm_odm->pChannel = &hal_data->CurrentChannel;
dm_odm->pbNet_closed = (bool *)&Adapter->net_closed;
dm_odm->mp_mode = &Adapter->registrypriv.mp_mode;
dm_odm->pbScanInProcess = (bool *)&pmlmepriv->bScanInProcess;
dm_odm->pbPowerSaving = (bool *)&pwrctrlpriv->bpower_saving;
dm_odm->AntDivType = hal_data->TRxAntDivType;
/* Tx power tracking BB swing table. */
/* The base index = 12. +((12-n)/2)dB 13~?? = decrease tx pwr by -((n-12)/2)dB */
dm_odm->BbSwingIdxOfdm = 12; /* Set defalut value as index 12. */
dm_odm->BbSwingIdxOfdmCurrent = 12;
dm_odm->BbSwingFlagOfdm = false;
for (i = 0; i < NUM_STA; i++)
ODM_CmnInfoPtrArrayHook(dm_odm, ODM_CMNINFO_STA_STATUS, i, NULL);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 237 | 74.29% | 1 | 20.00% |
Ivan Safonov | 82 | 25.71% | 4 | 80.00% |
Total | 319 | 100.00% | 5 | 100.00% |
void rtl8188e_InitHalDm(struct adapter *Adapter)
{
struct dm_priv *pdmpriv = &Adapter->HalData->dmpriv;
struct odm_dm_struct *dm_odm = &(Adapter->HalData->odmpriv);
dm_InitGPIOSetting(Adapter);
pdmpriv->DM_Type = DM_Type_ByDriver;
pdmpriv->DMFlag = DYNAMIC_FUNC_DISABLE;
Update_ODM_ComInfo_88E(Adapter);
ODM_DMInit(dm_odm);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 57 | 90.48% | 1 | 50.00% |
Ivan Safonov | 6 | 9.52% | 1 | 50.00% |
Total | 63 | 100.00% | 2 | 100.00% |
void rtw_hal_dm_watchdog(struct adapter *Adapter)
{
u8 hw_init_completed = false;
struct mlme_priv *pmlmepriv = NULL;
u8 bLinked = false;
hw_init_completed = Adapter->hw_init_completed;
if (!hw_init_completed)
goto skip_dm;
/* ODM */
pmlmepriv = &Adapter->mlmepriv;
if ((check_fwstate(pmlmepriv, WIFI_AP_STATE)) ||
(check_fwstate(pmlmepriv, WIFI_ADHOC_STATE |
WIFI_ADHOC_MASTER_STATE))) {
if (Adapter->stapriv.asoc_sta_count > 2)
bLinked = true;
} else {/* Station mode */
if (check_fwstate(pmlmepriv, _FW_LINKED))
bLinked = true;
}
Adapter->HalData->odmpriv.bLinked = bLinked;
ODM_DMWatchdog(&Adapter->HalData->odmpriv);
skip_dm:
/* Check GPIO to determine current RF on/off and Pbc status. */
/* Check Hardware Radio ON/OFF or not */
return;
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 106 | 82.17% | 1 | 20.00% |
Sudip Mukherjee | 13 | 10.08% | 1 | 20.00% |
Ivan Safonov | 10 | 7.75% | 3 | 60.00% |
Total | 129 | 100.00% | 5 | 100.00% |
void rtw_hal_dm_init(struct adapter *Adapter)
{
struct dm_priv *pdmpriv = &Adapter->HalData->dmpriv;
struct odm_dm_struct *podmpriv = &Adapter->HalData->odmpriv;
memset(pdmpriv, 0, sizeof(struct dm_priv));
Init_ODM_ComInfo_88E(Adapter);
ODM_InitDebugSetting(podmpriv);
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 49 | 85.96% | 1 | 25.00% |
Ivan Safonov | 7 | 12.28% | 2 | 50.00% |
Navin Patidar | 1 | 1.75% | 1 | 25.00% |
Total | 57 | 100.00% | 4 | 100.00% |
/* Add new function to reset the state of antenna diversity before link. */
/* Compare RSSI for deciding antenna */
void rtw_hal_antdiv_rssi_compared(struct adapter *Adapter, struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src)
{
if (0 != Adapter->HalData->AntDivCfg) {
/* select optimum_antenna for before linked =>For antenna diversity */
if (dst->Rssi >= src->Rssi) {/* keep org parameter */
src->Rssi = dst->Rssi;
src->PhyInfo.Optimum_antenna = dst->PhyInfo.Optimum_antenna;
}
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 62 | 93.94% | 1 | 33.33% |
Ivan Safonov | 4 | 6.06% | 2 | 66.67% |
Total | 66 | 100.00% | 3 | 100.00% |
/* Add new function to reset the state of antenna diversity before link. */
u8 rtw_hal_antdiv_before_linked(struct adapter *Adapter)
{
struct odm_dm_struct *dm_odm = &Adapter->HalData->odmpriv;
struct sw_ant_switch *dm_swat_tbl = &dm_odm->DM_SWAT_Table;
struct mlme_priv *pmlmepriv = &(Adapter->mlmepriv);
/* Condition that does not need to use antenna diversity. */
if (Adapter->HalData->AntDivCfg == 0)
return false;
if (check_fwstate(pmlmepriv, _FW_LINKED))
return false;
if (dm_swat_tbl->SWAS_NoLink_State == 0) {
/* switch channel */
dm_swat_tbl->SWAS_NoLink_State = 1;
dm_swat_tbl->CurAntenna = (dm_swat_tbl->CurAntenna == Antenna_A) ? Antenna_B : Antenna_A;
rtw_antenna_select_cmd(Adapter, dm_swat_tbl->CurAntenna, false);
return true;
} else {
dm_swat_tbl->SWAS_NoLink_State = 0;
return false;
}
}
Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 122 | 94.57% | 1 | 33.33% |
Ivan Safonov | 7 | 5.43% | 2 | 66.67% |
Total | 129 | 100.00% | 3 | 100.00% |
Overall Contributors
Person | Tokens | Prop | Commits | CommitProp |
Larry Finger | 800 | 81.14% | 1 | 6.25% |
Ivan Safonov | 167 | 16.94% | 9 | 56.25% |
Sudip Mukherjee | 13 | 1.32% | 1 | 6.25% |
Navin Patidar | 4 | 0.41% | 3 | 18.75% |
Thomas Meyer | 1 | 0.10% | 1 | 6.25% |
Kyle Kuffermann | 1 | 0.10% | 1 | 6.25% |
Total | 986 | 100.00% | 16 | 100.00% |
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.