Path: blob/master/ALFA-W1F1/RTL8814AU/include/HalPwrSeqCmd.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 __HALPWRSEQCMD_H__15#define __HALPWRSEQCMD_H__1617#include <drv_types.h>1819/*---------------------------------------------*/20/* 3 The value of cmd: 4 bits21*---------------------------------------------*/22#define PWR_CMD_READ 0x0023/* offset: the read register offset24* msk: the mask of the read value25* value: N/A, left by 026* note: dirver shall implement this function by read & msk */2728#define PWR_CMD_WRITE 0x0129/* offset: the read register offset30* msk: the mask of the write bits31* value: write value32* note: driver shall implement this cmd by read & msk after write */3334#define PWR_CMD_POLLING 0x0235/* offset: the read register offset36* msk: the mask of the polled value37* value: the value to be polled, masked by the msd field.38* note: driver shall implement this cmd by39* do {40* if( (Read(offset) & msk) == (value & msk) )41* break;42* } while(not timeout); */4344#define PWR_CMD_DELAY 0x0345/* offset: the value to delay46* msk: N/A47* value: the unit of delay, 0: us, 1: ms */4849#define PWR_CMD_END 0x0450/* offset: N/A51* msk: N/A52* value: N/A */5354/*---------------------------------------------*/55/* 3 The value of base: 4 bits56*---------------------------------------------57* define the base address of each block */58#define PWR_BASEADDR_MAC 0x0059#define PWR_BASEADDR_USB 0x0160#define PWR_BASEADDR_PCIE 0x0261#define PWR_BASEADDR_SDIO 0x036263/*---------------------------------------------*/64/* 3 The value of interface_msk: 4 bits65*---------------------------------------------*/66#define PWR_INTF_SDIO_MSK BIT(0)67#define PWR_INTF_USB_MSK BIT(1)68#define PWR_INTF_PCI_MSK BIT(2)69#define PWR_INTF_ALL_MSK (BIT(0) | BIT(1) | BIT(2) | BIT(3))7071/*---------------------------------------------*/72/* 3 The value of fab_msk: 4 bits73*---------------------------------------------*/74#define PWR_FAB_TSMC_MSK BIT(0)75#define PWR_FAB_UMC_MSK BIT(1)76#define PWR_FAB_ALL_MSK (BIT(0) | BIT(1) | BIT(2) | BIT(3))7778/*---------------------------------------------*/79/* 3 The value of cut_msk: 8 bits80*---------------------------------------------*/81#define PWR_CUT_TESTCHIP_MSK BIT(0)82#define PWR_CUT_A_MSK BIT(1)83#define PWR_CUT_B_MSK BIT(2)84#define PWR_CUT_C_MSK BIT(3)85#define PWR_CUT_D_MSK BIT(4)86#define PWR_CUT_E_MSK BIT(5)87#define PWR_CUT_F_MSK BIT(6)88#define PWR_CUT_G_MSK BIT(7)89#define PWR_CUT_ALL_MSK 0xFF909192typedef enum _PWRSEQ_CMD_DELAY_UNIT_ {93PWRSEQ_DELAY_US,94PWRSEQ_DELAY_MS,95} PWRSEQ_DELAY_UNIT;9697typedef struct _WL_PWR_CFG_ {98u16 offset;99u8 cut_msk;100u8 fab_msk:4;101u8 interface_msk:4;102u8 base:4;103u8 cmd:4;104u8 msk;105u8 value;106} WLAN_PWR_CFG, *PWLAN_PWR_CFG;107108109#define GET_PWR_CFG_OFFSET(__PWR_CMD) ((__PWR_CMD).offset)110#define GET_PWR_CFG_CUT_MASK(__PWR_CMD) ((__PWR_CMD).cut_msk)111#define GET_PWR_CFG_FAB_MASK(__PWR_CMD) ((__PWR_CMD).fab_msk)112#define GET_PWR_CFG_INTF_MASK(__PWR_CMD) ((__PWR_CMD).interface_msk)113#define GET_PWR_CFG_BASE(__PWR_CMD) ((__PWR_CMD).base)114#define GET_PWR_CFG_CMD(__PWR_CMD) ((__PWR_CMD).cmd)115#define GET_PWR_CFG_MASK(__PWR_CMD) ((__PWR_CMD).msk)116#define GET_PWR_CFG_VALUE(__PWR_CMD) ((__PWR_CMD).value)117118119/* ********************************************************************************120* Prototype of protected function.121* ******************************************************************************** */122u8 HalPwrSeqCmdParsing(123PADAPTER padapter,124u8 CutVersion,125u8 FabVersion,126u8 InterfaceType,127WLAN_PWR_CFG PwrCfgCmd[]);128129#endif130131132