phydm_api.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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 __PHYDM_API_H__
  26. #define __PHYDM_API_H__
  27. #define PHYDM_API_VERSION "1.0" /* @2017.07.10 Dino, Add phydm_api.h*/
  28. /* @1 ============================================================
  29. * 1 Definition
  30. * 1 ============================================================
  31. */
  32. #define CN_CNT_MAX 10 /*@max condition number threshold*/
  33. #define FUNC_ENABLE 1
  34. #define FUNC_DISABLE 2
  35. /*@NBI API------------------------------------*/
  36. #define NBI_128TONE 27 /*register table size*/
  37. #define NBI_256TONE 59 /*register table size*/
  38. #define NUM_START_CH_80M 7
  39. #define NUM_START_CH_40M 14
  40. #define CH_OFFSET_40M 2
  41. #define CH_OFFSET_80M 6
  42. #define FFT_128_TYPE 1
  43. #define FFT_256_TYPE 2
  44. #define FREQ_POSITIVE 1
  45. #define FREQ_NEGATIVE 2
  46. /*@------------------------------------------------*/
  47. #ifndef PHYDM_COMMON_API_SUPPORT
  48. #define INVALID_RF_DATA 0xffffffff
  49. #define INVALID_TXAGC_DATA 0xff
  50. #endif
  51. /* @1 ============================================================
  52. * 1 structure
  53. * 1 ============================================================
  54. */
  55. struct phydm_api_stuc {
  56. u32 rxiqc_reg1; /*N-mode: for pathA REG0xc14*/
  57. u32 rxiqc_reg2; /*N-mode: for pathB REG0xc1c*/
  58. u8 tx_queue_bitmap; /*REG0x520[23:16]*/
  59. };
  60. /* @1 ============================================================
  61. * 1 enumeration
  62. * 1 ============================================================
  63. */
  64. /* @1 ============================================================
  65. * 1 function prototype
  66. * 1 ============================================================
  67. */
  68. void phydm_reset_bb_hw_cnt_ac(void *dm_void);
  69. void phydm_dynamic_ant_weighting(void *dm_void);
  70. #ifdef DYN_ANT_WEIGHTING_SUPPORT
  71. void phydm_ant_weight_dbg(void *dm_void, char input[][16], u32 *_used,
  72. char *output, u32 *_out_len);
  73. #endif
  74. void phydm_pathb_q_matrix_rotate_en(void *dm_void);
  75. void phydm_pathb_q_matrix_rotate(void *dm_void, u16 phase_idx);
  76. void phydm_trx_antenna_setting_init(void *dm_void, u8 num_rf_path);
  77. void phydm_config_ofdm_rx_path(void *dm_void, u32 path);
  78. void phydm_config_cck_rx_path(void *dm_void, enum bb_path path);
  79. void phydm_config_cck_rx_antenna_init(void *dm_void);
  80. void phydm_config_trx_path(void *dm_void, char input[][16], u32 *_used,
  81. char *output, u32 *_out_len);
  82. void phydm_tx_2path(void *dm_void);
  83. void phydm_stop_3_wire(void *dm_void, u8 set_type);
  84. u8 phydm_stop_ic_trx(void *dm_void, u8 set_type);
  85. void phydm_set_ext_switch(void *dm_void, u32 ext_ant_switch);
  86. void phydm_nbi_enable(void *dm_void, u32 enable);
  87. u8 phydm_csi_mask_setting(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,
  88. u32 sec_ch);
  89. u8 phydm_nbi_setting(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,
  90. u32 sec_ch);
  91. void phydm_nbi_debug(void *dm_void, char input[][16], u32 *_used,
  92. char *output, u32 *_out_len);
  93. void phydm_csi_debug(void *dm_void, char input[][16], u32 *_used,
  94. char *output, u32 *_out_len);
  95. void phydm_stop_ck320(void *dm_void, u8 enable);
  96. boolean
  97. phydm_set_bb_txagc_offset(void *dm_void, s8 power_offset, u8 add_half_db);
  98. #ifdef PHYDM_IC_JGR3_SERIES_SUPPORT
  99. u8 phydm_csi_mask_setting_jgr3(void *dm_void, u32 enable, u32 ch, u32 bw,
  100. u32 f_intf, u32 sec_ch, u8 wgt);
  101. void phydm_set_csi_mask_jgr3(void *dm_void, u32 tone_idx_tmp, u8 tone_direction,
  102. u8 wgt);
  103. u8 phydm_nbi_setting_jgr3(void *dm_void, u32 enable, u32 ch, u32 bw, u32 f_intf,
  104. u32 sec_ch, u8 path);
  105. void phydm_set_nbi_reg_jgr3(void *dm_void, u32 tone_idx_tmp, u8 tone_direction,
  106. u8 path);
  107. void phydm_nbi_enable_jgr3(void *dm_void, u32 enable, u8 path);
  108. #endif
  109. #ifdef PHYDM_COMMON_API_SUPPORT
  110. boolean
  111. phydm_api_shift_txagc(void *dm_void, u32 pwr_offset, enum rf_path path,
  112. boolean is_positive);
  113. boolean
  114. phydm_api_set_txagc(void *dm_void, u32 power_index, enum rf_path path,
  115. u8 hw_rate, boolean is_single_rate);
  116. u8 phydm_api_get_txagc(void *dm_void, enum rf_path path, u8 hw_rate);
  117. boolean
  118. phydm_api_switch_bw_channel(void *dm_void, u8 central_ch, u8 primary_ch_idx,
  119. enum channel_width bandwidth);
  120. boolean
  121. phydm_api_trx_mode(void *dm_void, enum bb_path tx_path, enum bb_path rx_path,
  122. boolean is_tx2_path);
  123. #endif
  124. #endif