dm.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2009-2012 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. * You should have received a copy of the GNU General Public License along with
  15. * this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
  17. *
  18. * The full GNU General Public License is included in this distribution in the
  19. * file called LICENSE.
  20. *
  21. * Contact Information:
  22. * wlanfae <wlanfae@realtek.com>
  23. * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
  24. * Hsinchu 300, Taiwan.
  25. *
  26. * Larry Finger <Larry.Finger@lwfinger.net>
  27. *
  28. *****************************************************************************/
  29. #ifndef __RTL_92S_DM_H__
  30. #define __RTL_92S_DM_H__
  31. enum dm_dig_alg {
  32. DIG_ALGO_BY_FALSE_ALARM = 0,
  33. DIG_ALGO_BY_RSSI = 1,
  34. DIG_ALGO_BEFORE_CONNECT_BY_RSSI_AND_ALARM = 2,
  35. DIG_ALGO_BY_TOW_PORT = 3,
  36. DIG_ALGO_MAX
  37. };
  38. enum dm_dig_two_port_alg {
  39. DIG_TWO_PORT_ALGO_RSSI = 0,
  40. DIG_TWO_PORT_ALGO_FALSE_ALARM = 1,
  41. };
  42. enum dm_dig_dbg {
  43. DM_DBG_OFF = 0,
  44. DM_DBG_ON = 1,
  45. DM_DBG_MAX
  46. };
  47. enum dm_dig_sta {
  48. DM_STA_DIG_OFF = 0,
  49. DM_STA_DIG_ON,
  50. DM_STA_DIG_MAX
  51. };
  52. enum dm_dig_connect {
  53. DIG_STA_DISCONNECT = 0,
  54. DIG_STA_CONNECT = 1,
  55. DIG_STA_BEFORE_CONNECT = 2,
  56. DIG_AP_DISCONNECT = 3,
  57. DIG_AP_CONNECT = 4,
  58. DIG_AP_ADD_STATION = 5,
  59. DIG_CONNECT_MAX
  60. };
  61. enum dm_dig_ext_port_alg {
  62. DIG_EXT_PORT_STAGE_0 = 0,
  63. DIG_EXT_PORT_STAGE_1 = 1,
  64. DIG_EXT_PORT_STAGE_2 = 2,
  65. DIG_EXT_PORT_STAGE_3 = 3,
  66. DIG_EXT_PORT_STAGE_MAX = 4,
  67. };
  68. enum dm_ratr_sta {
  69. DM_RATR_STA_HIGH = 0,
  70. DM_RATR_STA_MIDDLEHIGH = 1,
  71. DM_RATR_STA_MIDDLE = 2,
  72. DM_RATR_STA_MIDDLELOW = 3,
  73. DM_RATR_STA_LOW = 4,
  74. DM_RATR_STA_ULTRALOW = 5,
  75. DM_RATR_STA_MAX
  76. };
  77. #define DM_TYPE_BYFW 0
  78. #define DM_TYPE_BYDRIVER 1
  79. #define TX_HIGH_PWR_LEVEL_NORMAL 0
  80. #define TX_HIGH_PWR_LEVEL_LEVEL1 1
  81. #define TX_HIGH_PWR_LEVEL_LEVEL2 2
  82. #define HAL_DM_DIG_DISABLE BIT(0) /* Disable Dig */
  83. #define HAL_DM_HIPWR_DISABLE BIT(1) /* Disable High Power */
  84. #define TX_HIGHPWR_LEVEL_NORMAL 0
  85. #define TX_HIGHPWR_LEVEL_NORMAL1 1
  86. #define TX_HIGHPWR_LEVEL_NORMAL2 2
  87. #define TX_POWER_NEAR_FIELD_THRESH_LVL2 74
  88. #define TX_POWER_NEAR_FIELD_THRESH_LVL1 67
  89. #define DM_DIG_THRESH_HIGH 40
  90. #define DM_DIG_THRESH_LOW 35
  91. #define DM_FALSEALARM_THRESH_LOW 40
  92. #define DM_FALSEALARM_THRESH_HIGH 1000
  93. #define DM_DIG_HIGH_PWR_THRESH_HIGH 75
  94. #define DM_DIG_HIGH_PWR_THRESH_LOW 70
  95. #define DM_DIG_BACKOFF 12
  96. #define DM_DIG_MAX 0x3e
  97. #define DM_DIG_MIN 0x1c
  98. #define DM_DIG_MIN_Netcore 0x12
  99. #define DM_DIG_BACKOFF_MAX 12
  100. #define DM_DIG_BACKOFF_MIN -4
  101. void rtl92s_dm_watchdog(struct ieee80211_hw *hw);
  102. void rtl92s_dm_init(struct ieee80211_hw *hw);
  103. void rtl92s_dm_init_edca_turbo(struct ieee80211_hw *hw);
  104. #endif