halrf_iqk.h 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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 __HALRF_IQK_H__
  26. #define __HALRF_IQK_H__
  27. /*--------------------------Define Parameters-------------------------------*/
  28. #define LOK_delay 1
  29. #define WBIQK_delay 10
  30. #define TX_IQK 0
  31. #define RX_IQK 1
  32. #define TXIQK 0
  33. #define RXIQK1 1
  34. #define RXIQK2 2
  35. #define kcount_limit_80m 2
  36. #define kcount_limit_others 4
  37. #define rxiqk_gs_limit 10
  38. #define NUM 4
  39. /*-----------------------End Define Parameters-----------------------*/
  40. struct dm_iqk_info {
  41. boolean lok_fail[NUM];
  42. boolean iqk_fail[2][NUM];
  43. u32 iqc_matrix[2][NUM];
  44. u8 iqk_times;
  45. u32 rf_reg18;
  46. u32 rf_reg08;
  47. u32 lna_idx;
  48. u8 iqk_step;
  49. u8 rxiqk_step;
  50. u8 tmp1bcc;
  51. u8 kcount;
  52. u8 rfk_ing; /*bit0:IQKing, bit1:LCKing, bit2:DPKing*/
  53. boolean rfk_forbidden;
  54. #if (RTL8814A_SUPPORT == 1 || RTL8822B_SUPPORT == 1 || RTL8821C_SUPPORT == 1 ||\
  55. RTL8195B_SUPPORT == 1 || RTL8198F_SUPPORT == 1)
  56. u32 iqk_channel[2];
  57. boolean iqk_fail_report[2][4][2]; /*channel/path/TRX(TX:0, RX:1) */
  58. /*channel / path / TRX(TX:0, RX:1) / CFIR_real*/
  59. /*channel index = 2 is just for debug*/
  60. u32 iqk_cfir_real[3][4][2][8];
  61. /*channel / path / TRX(TX:0, RX:1) / CFIR_imag*/
  62. /*channel index = 2 is just for debug*/
  63. u32 iqk_cfir_imag[3][4][2][8];
  64. u8 retry_count[2][4][3]; /* channel / path / (TXK:0, RXK1:1, RXK2:2) */
  65. u8 gs_retry_count[2][4][2]; /* channel / path / (GSRXK1:0, GSRXK2:1) */
  66. /* channel / path 0:SRXK1 fail, 1:RXK1 fail 2:RXK2 fail */
  67. u8 rxiqk_fail_code[2][4];
  68. u32 lok_idac[2][4]; /*channel / path*/
  69. u16 rxiqk_agc[2][4]; /*channel / path*/
  70. u32 bypass_iqk[2][4]; /*channel / 0xc94/0xe94*/
  71. u32 txgap_result[8]; /*txagpK result */
  72. u32 tmp_gntwl;
  73. boolean is_btg;
  74. boolean isbnd;
  75. boolean is_reload;
  76. boolean segment_iqk;
  77. boolean is_hwtx;
  78. boolean xym_read;
  79. boolean trximr_enable;
  80. u32 rx_xym[2][10];
  81. u32 tx_xym[2][10];
  82. u32 gs1_xym[2][6];
  83. u32 gs2_xym[2][6];
  84. u32 rxk1_xym[2][6];
  85. #endif
  86. };
  87. #endif /*#ifndef __HALRF_IQK_H__*/