phydm_dynamictxpower.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2017 Realtek Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of version 2 of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. *
  14. * The full GNU General Public License is included in this distribution in the
  15. * file called LICENSE.
  16. *
  17. * Contact Information:
  18. * wlanfae <wlanfae@realtek.com>
  19. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  20. * Hsinchu 300, Taiwan.
  21. *
  22. * Larry Finger <Larry.Finger@lwfinger.net>
  23. *
  24. *****************************************************************************/
  25. #ifndef __PHYDMDYNAMICTXPOWER_H__
  26. #define __PHYDMDYNAMICTXPOWER_H__
  27. #ifdef CONFIG_DYNAMIC_TX_TWR
  28. /* @============================================================
  29. * Definition
  30. * ============================================================
  31. */
  32. /*@#define DYNAMIC_TXPWR_VERSION "1.0"*/
  33. /*@#define DYNAMIC_TXPWR_VERSION "1.3" */ /*@2015.08.26, Add 8814 Dynamic TX power*/
  34. #define DYNAMIC_TXPWR_VERSION "1.4" /*@2015.11.06, Add CE 8821A Dynamic TX power*/
  35. #if (DM_ODM_SUPPORT_TYPE == ODM_AP)
  36. #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
  37. #define TX_POWER_NEAR_FIELD_THRESH_LVL1 60
  38. #define TX_POWER_NEAR_FIELD_THRESH_AP 0x3F
  39. #elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
  40. #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
  41. #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67
  42. #elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
  43. #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
  44. #define TX_POWER_NEAR_FIELD_THRESH_LVL1 60
  45. #endif
  46. #define tx_high_pwr_level_normal 0
  47. #define tx_high_pwr_level_level1 1
  48. #define tx_high_pwr_level_level2 2
  49. #define tx_high_pwr_level_level3 3
  50. #define tx_high_pwr_level_unchange 4
  51. /* @============================================================
  52. * enumrate
  53. * ============================================================
  54. */
  55. enum phydm_dtp_power_offset {
  56. PHYDM_OFFSET_ZERO = 0,
  57. PHYDM_OFFSET_MINUS_3DB = 1,
  58. PHYDM_OFFSET_MINUS_7DB = 2,
  59. PHYDM_OFFSET_MINUS_11DB = 3,
  60. PHYDM_OFFSET_ADD_3DB = 4,
  61. PHYDM_OFFSET_ADD_6DB = 5
  62. };
  63. enum phydm_dtp_power_offset_2ndtype {
  64. PHYDM_2ND_OFFSET_ZERO = 0,
  65. PHYDM_2ND_OFFSET_MINUS_3DB = 2,
  66. PHYDM_2ND_OFFSET_MINUS_7DB = 3,
  67. PHYDM_2ND_OFFSET_MINUS_11DB = 1
  68. };
  69. /* @============================================================
  70. * structure
  71. * ============================================================
  72. */
  73. /* @============================================================
  74. * Function Prototype
  75. * ============================================================
  76. */
  77. extern void
  78. odm_set_dyntxpwr(void *dm_void, u8 *desc, u8 mac_id);
  79. void phydm_dynamic_tx_power(void *dm_void);
  80. void phydm_dynamic_tx_power_init(void *dm_void);
  81. void phydm_dtp_debug(void *dm_void, char input[][16], u32 *_used, char *output,
  82. u32 *_out_len);
  83. #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
  84. void odm_dynamic_tx_power_win(void *dm_void);
  85. #endif
  86. #endif
  87. #endif