phydm_dynamic_rx_path.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /******************************************************************************
  2. *
  3. * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved.
  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. *
  19. ******************************************************************************/
  20. #ifndef __PHYDMDYMICRXPATH_H__
  21. #define __PHYDMDYMICRXPATH_H__
  22. #define DYNAMIC_RX_PATH_VERSION "1.0" /*2016.07.15 Dino */
  23. #define DRP_RSSI_TH 35
  24. #define INIT_DRP_TIMMER 0
  25. #define CANCEL_DRP_TIMMER 1
  26. #define RELEASE_DRP_TIMMER 2
  27. #if (CONFIG_DYNAMIC_RX_PATH == 1)
  28. enum drp_state_e {
  29. DRP_INIT_STATE = 0,
  30. DRP_TRAINING_STATE_0 = 1,
  31. DRP_TRAINING_STATE_1 = 2,
  32. DRP_TRAINING_STATE_2 = 3,
  33. DRP_DECISION_STATE = 4
  34. };
  35. enum adjustable_value_e {
  36. DRP_TRAINING_TIME = 0,
  37. DRP_TRAINING_PERIOD = 1,
  38. DRP_RSSI_THRESHOLD = 2,
  39. DRP_FA_THRESHOLD = 3,
  40. DRP_FA_DIFF_THRESHOLD = 4
  41. };
  42. struct _DYNAMIC_RX_PATH_ {
  43. u8 curr_rx_path;
  44. u8 drp_state;
  45. u16 training_time;
  46. u8 rssi_threshold;
  47. u32 fa_count_thresold;
  48. u32 fa_diff_threshold;
  49. u32 curr_cca_all_cnt_0;
  50. u32 curr_fa_all_cnt_0;
  51. u32 curr_cca_all_cnt_1;
  52. u32 curr_fa_all_cnt_1;
  53. u32 curr_cca_all_cnt_2;
  54. u32 curr_fa_all_cnt_2;
  55. u8 drp_skip_counter;
  56. u8 drp_period;
  57. u8 drp_init_finished;
  58. #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
  59. #if USE_WORKITEM
  60. RT_WORK_ITEM phydm_dynamic_rx_path_workitem;
  61. #endif
  62. #endif
  63. struct timer_list phydm_dynamic_rx_path_timer;
  64. };
  65. void
  66. phydm_process_phy_status_for_dynamic_rx_path(
  67. void *p_dm_void,
  68. void *p_phy_info_void,
  69. void *p_pkt_info_void
  70. );
  71. void
  72. phydm_dynamic_rx_path(
  73. void *p_dm_void
  74. );
  75. #if (DM_ODM_SUPPORT_TYPE == ODM_WIN)
  76. void
  77. phydm_dynamic_rx_path_callback(
  78. struct timer_list *p_timer
  79. );
  80. void
  81. phydm_dynamic_rx_path_workitem_callback(
  82. void *p_context
  83. );
  84. #else if (DM_ODM_SUPPORT_TYPE == ODM_CE)
  85. void
  86. phydm_dynamic_rx_path_callback(
  87. void *function_context
  88. );
  89. #endif
  90. void
  91. phydm_dynamic_rx_path_timers(
  92. void *p_dm_void,
  93. u8 state
  94. );
  95. void
  96. phydm_dynamic_rx_path_init(
  97. void *p_dm_void
  98. );
  99. void
  100. phydm_drp_debug(
  101. void *p_dm_void,
  102. u32 *const dm_value,
  103. u32 *_used,
  104. char *output,
  105. u32 *_out_len
  106. );
  107. void
  108. phydm_dynamic_rx_path_caller(
  109. void *p_dm_void
  110. );
  111. #endif
  112. #endif