phydm_acs.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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 __PHYDMACS_H__
  21. #define __PHYDMACS_H__
  22. #define ACS_VERSION "1.1" /*20150729 by YuChen*/
  23. #define CLM_VERSION "1.0"
  24. #define ODM_MAX_CHANNEL_2G 14
  25. #define ODM_MAX_CHANNEL_5G 24
  26. /* For phydm_auto_channel_select_setting_ap() */
  27. #define STORE_DEFAULT_NHM_SETTING 0
  28. #define RESTORE_DEFAULT_NHM_SETTING 1
  29. #define ACS_NHM_SETTING 2
  30. struct _ACS_ {
  31. boolean is_force_acs_result;
  32. u8 clean_channel_2g;
  33. u8 clean_channel_5g;
  34. u16 channel_info_2g[2][ODM_MAX_CHANNEL_2G]; /* Channel_Info[1]: channel score, Channel_Info[2]:Channel_Scan_Times */
  35. u16 channel_info_5g[2][ODM_MAX_CHANNEL_5G];
  36. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  37. u8 acs_step;
  38. /* NHM count 0-11 */
  39. u8 nhm_cnt[14][11];
  40. /* AC-Series, for storing previous setting */
  41. u32 reg0x990;
  42. u32 reg0x994;
  43. u32 reg0x998;
  44. u32 reg0x99c;
  45. u8 reg0x9a0; /* u8 */
  46. /* N-Series, for storing previous setting */
  47. u32 reg0x890;
  48. u32 reg0x894;
  49. u32 reg0x898;
  50. u32 reg0x89c;
  51. u8 reg0xe28; /* u8 */
  52. #endif
  53. };
  54. void
  55. odm_auto_channel_select_init(
  56. void *p_dm_void
  57. );
  58. void
  59. odm_auto_channel_select_reset(
  60. void *p_dm_void
  61. );
  62. void
  63. odm_auto_channel_select(
  64. void *p_dm_void,
  65. u8 channel
  66. );
  67. u8
  68. odm_get_auto_channel_select_result(
  69. void *p_dm_void,
  70. u8 band
  71. );
  72. #if (DM_ODM_SUPPORT_TYPE & ODM_AP)
  73. void
  74. phydm_auto_channel_select_setting_ap(
  75. void *p_dm_void,
  76. u32 setting, /* 0: STORE_DEFAULT_NHM_SETTING; 1: RESTORE_DEFAULT_NHM_SETTING, 2: ACS_NHM_SETTING */
  77. u32 acs_step
  78. );
  79. void
  80. phydm_get_nhm_statistics_ap(
  81. void *p_dm_void,
  82. u32 idx, /* @ 2G, Real channel number = idx+1 */
  83. u32 acs_step
  84. );
  85. #endif /* #if ( DM_ODM_SUPPORT_TYPE & ODM_AP ) */
  86. #endif /* #ifndef __PHYDMACS_H__ */