phydm_pathdiv.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 __PHYDMPATHDIV_H__
  26. #define __PHYDMPATHDIV_H__
  27. #ifdef CONFIG_PATH_DIVERSITY
  28. #define PATHDIV_VERSION "3.1"
  29. #define USE_PATH_A_AS_DEFAULT_ANT /* @for 8814 dynamic TX path selection */
  30. #define NUM_RESET_DTP_PERIOD 5
  31. #define ANT_DECT_RSSI_TH 3
  32. #define PATH_A 1
  33. #define PATH_B 2
  34. #define PATH_C 3
  35. #define PATH_D 4
  36. #define PHYDM_AUTO_PATH 0
  37. #define PHYDM_FIX_PATH 1
  38. #define NUM_CHOOSE2_FROM4 6
  39. #define NUM_CHOOSE3_FROM4 4
  40. enum phydm_dtp_state {
  41. PHYDM_DTP_INIT = 1,
  42. PHYDM_DTP_RUNNING_1
  43. };
  44. enum phydm_path_div_type {
  45. PHYDM_2R_PATH_DIV = 1,
  46. PHYDM_4R_PATH_DIV = 2
  47. };
  48. void phydm_process_rssi_for_path_div(
  49. void *dm_void,
  50. void *phy_info_void,
  51. void *pkt_info_void);
  52. struct _ODM_PATH_DIVERSITY_ {
  53. u8 resp_tx_path;
  54. u8 path_sel[ODM_ASSOCIATE_ENTRY_NUM];
  55. u32 path_a_sum[ODM_ASSOCIATE_ENTRY_NUM];
  56. u32 path_b_sum[ODM_ASSOCIATE_ENTRY_NUM];
  57. u16 path_a_cnt[ODM_ASSOCIATE_ENTRY_NUM];
  58. u16 path_b_cnt[ODM_ASSOCIATE_ENTRY_NUM];
  59. u8 phydm_path_div_type;
  60. #if RTL8814A_SUPPORT
  61. u32 path_a_sum_all;
  62. u32 path_b_sum_all;
  63. u32 path_c_sum_all;
  64. u32 path_d_sum_all;
  65. u32 path_a_cnt_all;
  66. u32 path_b_cnt_all;
  67. u32 path_c_cnt_all;
  68. u32 path_d_cnt_all;
  69. u8 dtp_period;
  70. boolean is_become_linked;
  71. boolean is_u3_mode;
  72. u8 num_tx_path;
  73. u8 default_path;
  74. u8 num_candidate;
  75. u8 ant_candidate_1;
  76. u8 ant_candidate_2;
  77. u8 ant_candidate_3;
  78. u8 phydm_dtp_state;
  79. u8 dtp_check_patha_counter;
  80. boolean fix_path_bfer;
  81. u8 search_space_2[NUM_CHOOSE2_FROM4];
  82. u8 search_space_3[NUM_CHOOSE3_FROM4];
  83. u8 pre_tx_path;
  84. u8 use_path_a_as_default_ant;
  85. boolean is_path_a_exist;
  86. #endif
  87. };
  88. void phydm_c2h_dtp_handler(void *dm_void, u8 *cmd_buf, u8 cmd_len);
  89. void phydm_path_diversity_init(void *dm_void);
  90. void odm_path_diversity(void *dm_void);
  91. void phydm_pathdiv_debug(void *dm_void, char input[][16], u32 *_used,
  92. char *output, u32 *_out_len);
  93. #endif /* @#ifdef CONFIG_PATH_DIVERSITY */
  94. #endif /* @#ifndef __ODMPATHDIV_H__ */