Path: blob/master/ALFA-W1F1/RTL8814AU/include/Hal8188EPhyCfg.h
1307 views
/******************************************************************************1*2* Copyright(c) 2007 - 2017 Realtek Corporation.3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of version 2 of the GNU General Public License as6* published by the Free Software Foundation.7*8* This program is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for11* more details.12*13*****************************************************************************/14#ifndef __INC_HAL8188EPHYCFG_H__15#define __INC_HAL8188EPHYCFG_H__161718/*--------------------------Define Parameters-------------------------------*/19#define LOOP_LIMIT 520#define MAX_STALL_TIME 50 /* us */21#define AntennaDiversityValue 0x80 /* (Adapter->bSoftwareAntennaDiversity ? 0x00 : 0x80) */22#define MAX_TXPWR_IDX_NMODE_92S 6323#define Reset_Cnt_Limit 32425#ifdef CONFIG_PCI_HCI26#define MAX_AGGR_NUM 0x0B27#else28#define MAX_AGGR_NUM 0x0729#endif /* CONFIG_PCI_HCI */303132/*--------------------------Define Parameters-------------------------------*/333435/*------------------------------Define structure----------------------------*/3637#define MAX_TX_COUNT_8188E 13839/* BB/RF related */404142/*------------------------------Define structure----------------------------*/434445/*------------------------Export global variable----------------------------*/46/*------------------------Export global variable----------------------------*/474849/*------------------------Export Marco Definition---------------------------*/50/*------------------------Export Marco Definition---------------------------*/515253/*--------------------------Exported Function prototype---------------------*/54/*55* BB and RF register read/write56* */57u32 PHY_QueryBBReg8188E(PADAPTER Adapter,58u32 RegAddr,59u32 BitMask);60void PHY_SetBBReg8188E(PADAPTER Adapter,61u32 RegAddr,62u32 BitMask,63u32 Data);64u32 PHY_QueryRFReg8188E(PADAPTER Adapter,65enum rf_path eRFPath,66u32 RegAddr,67u32 BitMask);68void PHY_SetRFReg8188E(PADAPTER Adapter,69enum rf_path eRFPath,70u32 RegAddr,71u32 BitMask,72u32 Data);7374/*75* Initialization related function76*/77/* MAC/BB/RF HAL config */78int PHY_MACConfig8188E(PADAPTER Adapter);79int PHY_BBConfig8188E(PADAPTER Adapter);80int PHY_RFConfig8188E(PADAPTER Adapter);8182/* RF config */83int rtl8188e_PHY_ConfigRFWithParaFile( PADAPTER Adapter, u8 *pFileName, enum rf_path eRFPath);8485/*86* RF Power setting87*/88/* extern BOOLEAN PHY_SetRFPowerState(PADAPTER Adapter,89* RT_RF_POWER_STATE eRFPowerState); */9091/*92* BB TX Power R/W93* */94void PHY_SetTxPowerLevel8188E(PADAPTER Adapter,95u8 channel);9697void98PHY_SetTxPowerIndex_8188E(99PADAPTER Adapter,100u32 PowerIndex,101enum rf_path RFPath,102u8 Rate103);104105u8106PHY_GetTxPowerIndex_8188E(107PADAPTER pAdapter,108enum rf_path RFPath,109u8 Rate,110u8 BandWidth,111u8 Channel,112struct txpwr_idx_comp *tic113);114115/*116* Switch bandwidth for 8192S117*/118/* extern void PHY_SetBWModeCallback8192C(PRT_TIMER pTimer ); */119void PHY_SetBWMode8188E(PADAPTER pAdapter,120enum channel_width ChnlWidth,121unsigned char Offset);122123/*124* Set FW CMD IO for 8192S.125*/126/* extern BOOLEAN HalSetIO8192C(PADAPTER Adapter,127* IO_TYPE IOType); */128129/*130* Set A2 entry to fw for 8192S131* */132extern void FillA2Entry8192C(PADAPTER Adapter,133u8 index,134u8 *val);135136137/*138* channel switch related funciton139*/140/* extern void PHY_SwChnlCallback8192C(PRT_TIMER pTimer ); */141void PHY_SwChnl8188E(PADAPTER pAdapter,142u8 channel);143144void145PHY_SetSwChnlBWMode8188E(146PADAPTER Adapter,147u8 channel,148enum channel_width Bandwidth,149u8 Offset40,150u8 Offset80151);152153void154PHY_SetRFEReg_8188E(155PADAPTER Adapter156);157/*158* BB/MAC/RF other monitor API159* */160void phy_set_rf_path_switch_8188e(struct dm_struct *phydm, bool bMain);161162extern void163PHY_SwitchEphyParameter(164PADAPTER Adapter165);166167extern void168PHY_EnableHostClkReq(169PADAPTER Adapter170);171172BOOLEAN173SetAntennaConfig92C(174PADAPTER Adapter,175u8 DefaultAnt176);177178/*--------------------------Exported Function prototype---------------------*/179180/*181* Initialization related function182*183* MAC/BB/RF HAL config */184/* extern s32 PHY_MACConfig8723(PADAPTER padapter);185* s32 PHY_BBConfig8723(PADAPTER padapter);186* s32 PHY_RFConfig8723(PADAPTER padapter); */187188189190/* ******************************************************************191* Note: If SIC_ENABLE under PCIE, because of the slow operation192* you should193* 2) "#define RTL8723_FPGA_VERIFICATION 1" in Precomp.h.WlanE.Windows194* 3) "#define RTL8190_Download_Firmware_From_Header 0" in Precomp.h.WlanE.Windows if needed.195* */196#if (RTL8188E_SUPPORT == 1) && (RTL8188E_FPGA_TRUE_PHY_VERIFICATION == 1)197#define SIC_ENABLE 1198#define SIC_HW_SUPPORT 1199#else200#define SIC_ENABLE 0201#define SIC_HW_SUPPORT 0202#endif203/* ****************************************************************** */204205206#define SIC_MAX_POLL_CNT 5207208#if (SIC_HW_SUPPORT == 1)209#define SIC_CMD_READY 0210#define SIC_CMD_PREWRITE 0x1211#if (RTL8188E_SUPPORT == 1)212#define SIC_CMD_WRITE 0x40213#define SIC_CMD_PREREAD 0x2214#define SIC_CMD_READ 0x80215#define SIC_CMD_INIT 0xf0216#define SIC_INIT_VAL 0xff217218#define SIC_INIT_REG 0x1b7219#define SIC_CMD_REG 0x1EB /* 1byte */220#define SIC_ADDR_REG 0x1E8 /* 1b4~1b5, 2 bytes */221#define SIC_DATA_REG 0x1EC /* 1b0~1b3 */222#else223#define SIC_CMD_WRITE 0x11224#define SIC_CMD_PREREAD 0x2225#define SIC_CMD_READ 0x12226#define SIC_CMD_INIT 0x1f227#define SIC_INIT_VAL 0xff228229#define SIC_INIT_REG 0x1b7230#define SIC_CMD_REG 0x1b6 /* 1byte */231#define SIC_ADDR_REG 0x1b4 /* 1b4~1b5, 2 bytes */232#define SIC_DATA_REG 0x1b0 /* 1b0~1b3 */233#endif234#else235#define SIC_CMD_READY 0236#define SIC_CMD_WRITE 1237#define SIC_CMD_READ 2238239#if (RTL8188E_SUPPORT == 1)240#define SIC_CMD_REG 0x1EB /* 1byte */241#define SIC_ADDR_REG 0x1E8 /* 1b9~1ba, 2 bytes */242#define SIC_DATA_REG 0x1EC /* 1bc~1bf */243#else244#define SIC_CMD_REG 0x1b8 /* 1byte */245#define SIC_ADDR_REG 0x1b9 /* 1b9~1ba, 2 bytes */246#define SIC_DATA_REG 0x1bc /* 1bc~1bf */247#endif248#endif249250#if (SIC_ENABLE == 1)251void SIC_Init( PADAPTER Adapter);252#endif253254255#endif /* __INC_HAL8192CPHYCFG_H */256257258