Path: blob/master/ALFA-W1F1/RTL8814AU/hal/phydm/phydm_dynamictxpower.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* The full GNU General Public License is included in this distribution in the14* file called LICENSE.15*16* Contact Information:17* wlanfae <[email protected]>18* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,19* Hsinchu 300, Taiwan.20*21* Larry Finger <[email protected]>22*23*****************************************************************************/2425#ifndef __PHYDMDYNAMICTXPOWER_H__26#define __PHYDMDYNAMICTXPOWER_H__2728#ifdef CONFIG_DYNAMIC_TX_TWR29/* @============================================================30* Definition31* ============================================================32*/3334/* 2019.2.12, refine code structure and set macid 127 only for 22C*/35#define DYNAMIC_TXPWR_VERSION "1.8"3637#if (DM_ODM_SUPPORT_TYPE == ODM_AP)38#define TX_POWER_NEAR_FIELD_THRESH_LVL2 7439#define TX_POWER_NEAR_FIELD_THRESH_LVL1 6040#define TX_POWER_NEAR_FIELD_THRESH_AP 0x3F41#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)42#define TX_POWER_NEAR_FIELD_THRESH_LVL2 7443#define TX_POWER_NEAR_FIELD_THRESH_LVL1 6744#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)45#define TX_POWER_NEAR_FIELD_THRESH_LVL2 7446#define TX_POWER_NEAR_FIELD_THRESH_LVL1 6047#endif4849#if (DM_ODM_SUPPORT_TYPE == ODM_AP)50#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL3 25551#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL2 7452#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL1 6053#elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)54#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL3 9055#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL2 8556#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL1 8057#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)58#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL3 9059#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL2 8560#define TX_PWR_NEAR_FIELD_TH_JGR3_LVL1 8061#endif6263#define tx_high_pwr_level_normal 064#define tx_high_pwr_level_level1 165#define tx_high_pwr_level_level2 266#define tx_high_pwr_level_level3 367#define tx_high_pwr_level_unchange 46869/* @============================================================70* enumrate71* ============================================================72*/73enum phydm_dtp_power_offset {74PHYDM_OFFSET_ZERO = 0,75PHYDM_OFFSET_MINUS_3DB = 1,76PHYDM_OFFSET_MINUS_7DB = 2,77PHYDM_OFFSET_MINUS_11DB = 3,78PHYDM_OFFSET_ADD_3DB = 4,79PHYDM_OFFSET_ADD_6DB = 580};8182enum phydm_dtp_power_offset_2nd {83PHYDM_2ND_OFFSET_ZERO = 0,84PHYDM_2ND_OFFSET_MINUS_3DB = 1,85PHYDM_2ND_OFFSET_MINUS_7DB = 2,86PHYDM_2ND_OFFSET_MINUS_11DB = 387};8889enum phydm_dtp_power_offset_bbram {90/*@ HW min use 1dB*/91PHYDM_BBRAM_OFFSET_ZERO = 0,92PHYDM_BBRAM_OFFSET_MINUS_3DB = -3,93PHYDM_BBRAM_OFFSET_MINUS_7DB = -7,94PHYDM_BBRAM_OFFSET_MINUS_11DB = -1195};9697enum phydm_dtp_power_pkt_type {98RAM_PWR_OFST0 = 0,99RAM_PWR_OFST1 = 1,100REG_PWR_OFST0 = 2,101REG_PWR_OFST1 = 3102};103104/* @============================================================105* structure106* ============================================================107*/108109/* @============================================================110* Function Prototype111* ============================================================112*/113114extern void115odm_set_dyntxpwr(void *dm_void, u8 *desc, u8 mac_id);116117void phydm_dynamic_tx_power(void *dm_void);118119void phydm_dynamic_tx_power_init(void *dm_void);120121void phydm_dtp_debug(void *dm_void, char input[][16], u32 *_used, char *output,122u32 *_out_len);123124#if (DM_ODM_SUPPORT_TYPE == ODM_WIN)125void odm_dynamic_tx_power_win(void *dm_void);126#endif127128#endif129#endif130131132