2014-12-19 06:59:46 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* 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_HAL8188EPHYCFG_H__
|
|
|
|
#define __INC_HAL8188EPHYCFG_H__
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------Define Parameters-------------------------------*/
|
|
|
|
#define LOOP_LIMIT 5
|
2015-03-16 14:43:53 +00:00
|
|
|
#define MAX_STALL_TIME 50 /* us */
|
2018-10-15 00:07:45 +00:00
|
|
|
#define AntennaDiversityValue 0x80 /* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */
|
2014-12-19 06:59:46 +00:00
|
|
|
#define MAX_TXPWR_IDX_NMODE_92S 63
|
|
|
|
#define Reset_Cnt_Limit 3
|
|
|
|
|
2018-10-15 00:07:45 +00:00
|
|
|
#ifdef CONFIG_PCI_HCI
|
|
|
|
#define MAX_AGGR_NUM 0x0B
|
|
|
|
#else
|
|
|
|
#define MAX_AGGR_NUM 0x07
|
|
|
|
#endif /* CONFIG_PCI_HCI */
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------Define Parameters-------------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------------Define structure----------------------------*/
|
|
|
|
|
2018-10-15 00:07:45 +00:00
|
|
|
#define MAX_TX_COUNT_8188E 1
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
/* BB/RF related */
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------------Define structure----------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------Export global variable----------------------------*/
|
|
|
|
/*------------------------Export global variable----------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
/*------------------------Export Marco Definition---------------------------*/
|
|
|
|
/*------------------------Export Marco Definition---------------------------*/
|
|
|
|
|
|
|
|
|
|
|
|
/*--------------------------Exported Function prototype---------------------*/
|
2018-10-15 00:07:45 +00:00
|
|
|
/*
|
|
|
|
* BB and RF register read/write
|
|
|
|
* */
|
2018-11-13 15:28:01 +00:00
|
|
|
u32 PHY_QueryBBReg8188E(PADAPTER Adapter,
|
|
|
|
u32 RegAddr,
|
|
|
|
u32 BitMask);
|
|
|
|
void PHY_SetBBReg8188E(PADAPTER Adapter,
|
|
|
|
u32 RegAddr,
|
|
|
|
u32 BitMask,
|
|
|
|
u32 Data);
|
|
|
|
u32 PHY_QueryRFReg8188E(PADAPTER Adapter,
|
|
|
|
u8 eRFPath,
|
|
|
|
u32 RegAddr,
|
|
|
|
u32 BitMask);
|
|
|
|
void PHY_SetRFReg8188E(PADAPTER Adapter,
|
|
|
|
u8 eRFPath,
|
|
|
|
u32 RegAddr,
|
|
|
|
u32 BitMask,
|
|
|
|
u32 Data);
|
2018-10-15 00:07:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Initialization related function
|
|
|
|
*/
|
2014-12-19 06:59:46 +00:00
|
|
|
/* MAC/BB/RF HAL config */
|
2018-11-13 15:28:01 +00:00
|
|
|
int PHY_MACConfig8188E(PADAPTER Adapter);
|
|
|
|
int PHY_BBConfig8188E(PADAPTER Adapter);
|
|
|
|
int PHY_RFConfig8188E(PADAPTER Adapter);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
/* RF config */
|
2018-11-13 15:28:01 +00:00
|
|
|
int rtl8188e_PHY_ConfigRFWithParaFile(PADAPTER Adapter, u8 *pFileName, u8 eRFPath);
|
2018-10-15 00:07:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* RF Power setting
|
|
|
|
*/
|
2018-11-16 20:56:35 +00:00
|
|
|
/* extern bool PHY_SetRFPowerState(PADAPTER Adapter,
|
2018-11-13 15:28:01 +00:00
|
|
|
* RT_RF_POWER_STATE eRFPowerState); */
|
2018-10-15 00:07:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* BB TX Power R/W
|
|
|
|
* */
|
2018-11-13 15:28:01 +00:00
|
|
|
void PHY_GetTxPowerLevel8188E(PADAPTER Adapter,
|
|
|
|
s32 *powerlevel);
|
|
|
|
void PHY_SetTxPowerLevel8188E(PADAPTER Adapter,
|
|
|
|
u8 channel);
|
2018-11-16 20:56:35 +00:00
|
|
|
bool PHY_UpdateTxPowerDbm8188E(PADAPTER Adapter,
|
2018-11-13 15:28:01 +00:00
|
|
|
int powerInDbm);
|
2018-10-15 00:07:45 +00:00
|
|
|
|
2018-11-13 03:24:45 +00:00
|
|
|
void
|
2018-10-15 00:07:45 +00:00
|
|
|
PHY_SetTxPowerIndex_8188E(
|
2018-11-13 15:28:01 +00:00
|
|
|
PADAPTER Adapter,
|
|
|
|
u32 PowerIndex,
|
|
|
|
u8 RFPath,
|
|
|
|
u8 Rate
|
2018-10-15 00:07:45 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
u8
|
|
|
|
PHY_GetTxPowerIndex_8188E(
|
2018-11-13 15:28:01 +00:00
|
|
|
PADAPTER pAdapter,
|
|
|
|
u8 RFPath,
|
|
|
|
u8 Rate,
|
|
|
|
u8 BandWidth,
|
|
|
|
u8 Channel,
|
2018-10-15 00:07:45 +00:00
|
|
|
struct txpwr_idx_comp *tic
|
|
|
|
);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Switch bandwidth for 8192S
|
|
|
|
*/
|
2018-11-13 15:28:01 +00:00
|
|
|
/* extern void PHY_SetBWModeCallback8192C( PRT_TIMER pTimer ); */
|
|
|
|
void PHY_SetBWMode8188E(PADAPTER pAdapter,
|
|
|
|
CHANNEL_WIDTH ChnlWidth,
|
|
|
|
unsigned char Offset);
|
2018-10-15 00:07:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Set FW CMD IO for 8192S.
|
|
|
|
*/
|
2018-11-16 20:56:35 +00:00
|
|
|
/* extern bool HalSetIO8192C(PADAPTER Adapter,
|
2018-11-13 15:28:01 +00:00
|
|
|
* IO_TYPE IOType); */
|
2018-10-15 00:07:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Set A2 entry to fw for 8192S
|
|
|
|
* */
|
2018-11-13 15:28:01 +00:00
|
|
|
extern void FillA2Entry8192C(PADAPTER Adapter,
|
|
|
|
u8 index,
|
|
|
|
u8 *val);
|
2018-10-15 00:07:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* channel switch related funciton
|
|
|
|
*/
|
2018-11-13 15:28:01 +00:00
|
|
|
/* extern void PHY_SwChnlCallback8192C( PRT_TIMER pTimer ); */
|
|
|
|
void PHY_SwChnl8188E(PADAPTER pAdapter,
|
|
|
|
u8 channel);
|
2018-10-15 00:07:45 +00:00
|
|
|
|
2018-11-13 03:24:45 +00:00
|
|
|
void
|
2018-10-15 00:07:45 +00:00
|
|
|
PHY_SetSwChnlBWMode8188E(
|
2018-11-13 15:28:01 +00:00
|
|
|
PADAPTER Adapter,
|
|
|
|
u8 channel,
|
|
|
|
CHANNEL_WIDTH Bandwidth,
|
|
|
|
u8 Offset40,
|
|
|
|
u8 Offset80
|
2018-10-15 00:07:45 +00:00
|
|
|
);
|
|
|
|
|
2018-11-13 03:24:45 +00:00
|
|
|
void
|
2018-10-15 00:07:45 +00:00
|
|
|
PHY_SetRFEReg_8188E(
|
2018-11-13 15:28:01 +00:00
|
|
|
PADAPTER Adapter
|
2018-10-15 00:07:45 +00:00
|
|
|
);
|
|
|
|
/*
|
|
|
|
* BB/MAC/RF other monitor API
|
|
|
|
* */
|
2018-11-13 15:28:01 +00:00
|
|
|
void phy_set_rf_path_switch_8188e(PADAPTER pAdapter, bool bMain);
|
2018-10-15 00:07:45 +00:00
|
|
|
|
2018-11-13 03:24:45 +00:00
|
|
|
extern void
|
2014-12-19 06:59:46 +00:00
|
|
|
PHY_SwitchEphyParameter(
|
2018-11-13 15:28:01 +00:00
|
|
|
PADAPTER Adapter
|
2018-10-15 00:07:45 +00:00
|
|
|
);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2018-11-13 03:24:45 +00:00
|
|
|
extern void
|
2014-12-19 06:59:46 +00:00
|
|
|
PHY_EnableHostClkReq(
|
2018-11-13 15:28:01 +00:00
|
|
|
PADAPTER Adapter
|
2018-10-15 00:07:45 +00:00
|
|
|
);
|
2014-12-19 06:59:46 +00:00
|
|
|
|
2018-11-16 20:56:35 +00:00
|
|
|
bool
|
2014-12-19 06:59:46 +00:00
|
|
|
SetAntennaConfig92C(
|
2018-11-13 15:28:01 +00:00
|
|
|
PADAPTER Adapter,
|
|
|
|
u8 DefaultAnt
|
2018-10-15 00:07:45 +00:00
|
|
|
);
|
2015-02-24 15:52:54 +00:00
|
|
|
|
2014-12-19 06:59:46 +00:00
|
|
|
/*--------------------------Exported Function prototype---------------------*/
|
|
|
|
|
2018-10-15 00:07:45 +00:00
|
|
|
/*
|
|
|
|
* Initialization related function
|
|
|
|
*
|
|
|
|
* MAC/BB/RF HAL config */
|
|
|
|
/* extern s32 PHY_MACConfig8723(PADAPTER padapter);
|
|
|
|
* s32 PHY_BBConfig8723(PADAPTER padapter);
|
|
|
|
* s32 PHY_RFConfig8723(PADAPTER padapter); */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************************************************************
|
|
|
|
* Note: If SIC_ENABLE under PCIE, because of the slow operation
|
|
|
|
* you should
|
|
|
|
* 2) "#define RTL8723_FPGA_VERIFICATION 1" in Precomp.h.WlanE.Windows
|
|
|
|
* 3) "#define RTL8190_Download_Firmware_From_Header 0" in Precomp.h.WlanE.Windows if needed.
|
|
|
|
* */
|
2018-12-17 17:08:55 +00:00
|
|
|
#if (RTL8188E_FPGAtrue_PHY_VERIFICATION == 1)
|
2018-10-15 00:07:45 +00:00
|
|
|
#define SIC_ENABLE 1
|
|
|
|
#define SIC_HW_SUPPORT 1
|
|
|
|
#else
|
|
|
|
#define SIC_ENABLE 0
|
|
|
|
#define SIC_HW_SUPPORT 0
|
|
|
|
#endif
|
|
|
|
/* ****************************************************************** */
|
2014-12-19 06:59:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
#define SIC_MAX_POLL_CNT 5
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
#if (SIC_HW_SUPPORT == 1)
|
2018-10-15 00:07:45 +00:00
|
|
|
#define SIC_CMD_READY 0
|
|
|
|
#define SIC_CMD_PREWRITE 0x1
|
|
|
|
#define SIC_CMD_WRITE 0x40
|
|
|
|
#define SIC_CMD_PREREAD 0x2
|
|
|
|
#define SIC_CMD_READ 0x80
|
|
|
|
#define SIC_CMD_INIT 0xf0
|
|
|
|
#define SIC_INIT_VAL 0xff
|
|
|
|
|
|
|
|
#define SIC_INIT_REG 0x1b7
|
|
|
|
#define SIC_CMD_REG 0x1EB /* 1byte */
|
|
|
|
#define SIC_ADDR_REG 0x1E8 /* 1b4~1b5, 2 bytes */
|
|
|
|
#define SIC_DATA_REG 0x1EC /* 1b0~1b3 */
|
2014-12-19 06:59:46 +00:00
|
|
|
#else
|
2018-10-15 00:07:45 +00:00
|
|
|
#define SIC_CMD_READY 0
|
|
|
|
#define SIC_CMD_WRITE 1
|
|
|
|
#define SIC_CMD_READ 2
|
|
|
|
|
|
|
|
#define SIC_CMD_REG 0x1EB /* 1byte */
|
|
|
|
#define SIC_ADDR_REG 0x1E8 /* 1b9~1ba, 2 bytes */
|
|
|
|
#define SIC_DATA_REG 0x1EC /* 1bc~1bf */
|
2014-12-19 06:59:46 +00:00
|
|
|
#endif
|
|
|
|
|
2015-08-15 18:02:34 +00:00
|
|
|
#if (SIC_ENABLE == 1)
|
2018-11-13 15:28:01 +00:00
|
|
|
void SIC_Init(PADAPTER Adapter);
|
2014-12-19 06:59:46 +00:00
|
|
|
#endif
|
|
|
|
|
2018-10-15 00:07:45 +00:00
|
|
|
|
|
|
|
#endif /* __INC_HAL8192CPHYCFG_H */
|