1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-27 07:34:04 +00:00
rtl8812au/hal/phydm/halrf/halrf_iqk.h

104 lines
3.0 KiB
C
Raw Normal View History

2018-06-22 16:48:32 +00:00
/******************************************************************************
*
2018-08-24 20:52:34 +00:00
* Copyright(c) 2007 - 2017 Realtek Corporation.
2018-06-22 16:48:32 +00:00
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of version 2 of the GNU General Public License as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2018-08-24 20:52:34 +00:00
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
2018-06-22 16:48:32 +00:00
* more details.
*
2018-08-24 20:52:34 +00:00
* The full GNU General Public License is included in this distribution in the
* file called LICENSE.
*
* Contact Information:
* wlanfae <wlanfae@realtek.com>
* Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
* Hsinchu 300, Taiwan.
*
* Larry Finger <Larry.Finger@lwfinger.net>
*
2018-06-22 16:48:32 +00:00
*****************************************************************************/
2019-05-24 19:43:57 +00:00
#ifndef __HALRF_IQK_H__
#define __HALRF_IQK_H__
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
/*@--------------------------Define Parameters-------------------------------*/
#define LOK_delay 1
#define WBIQK_delay 10
#define TX_IQK 0
#define RX_IQK 1
#define TXIQK 0
#define RXIQK1 1
#define RXIQK2 2
2018-06-22 16:48:32 +00:00
#define kcount_limit_80m 2
#define kcount_limit_others 4
2018-08-24 20:52:34 +00:00
#define rxiqk_gs_limit 10
2019-05-24 19:43:57 +00:00
#define TXWBIQK_EN 1
#define RXWBIQK_EN 1
#define NUM 4
/*@-----------------------End Define Parameters-----------------------*/
2018-06-22 16:48:32 +00:00
2019-05-24 19:43:57 +00:00
struct dm_dack_info {
u32 ic_a;
u32 qc_a;
u32 ic_b;
u32 qc_b;
};
2018-06-22 16:48:32 +00:00
2018-08-24 20:52:34 +00:00
struct dm_iqk_info {
2019-05-24 19:43:57 +00:00
boolean lok_fail[NUM];
boolean iqk_fail[2][NUM];
u32 iqc_matrix[2][NUM];
u8 iqk_times;
u32 rf_reg18;
u32 rf_reg08;
u32 lna_idx;
u8 iqk_step;
u8 rxiqk_step;
u8 tmp1bcc;
u8 txgain;
u8 kcount;
u8 rfk_ing; /*bit0:IQKing, bit1:LCKing, bit2:DPKing*/
boolean rfk_forbidden;
u8 rxbb;
#if (RTL8814A_SUPPORT == 1 || RTL8822B_SUPPORT == 1 || RTL8821C_SUPPORT == 1 ||\
RTL8195B_SUPPORT == 1 || RTL8198F_SUPPORT == 1 ||\
RTL8814B_SUPPORT == 1 || RTL8822C_SUPPORT == 1)
u32 iqk_channel[2];
boolean iqk_fail_report[2][4][2]; /*channel/path/TRX(TX:0, RX:1) */
/*channel / path / TRX(TX:0, RX:1) / CFIR_real*/
/*channel index = 2 is just for debug*/
u32 iqk_cfir_real[3][4][2][8];
/*channel / path / TRX(TX:0, RX:1) / CFIR_imag*/
/*channel index = 2 is just for debug*/
u32 iqk_cfir_imag[3][4][2][8];
u8 retry_count[2][4][3]; /* channel / path / (TXK:0, RXK1:1, RXK2:2) */
u8 gs_retry_count[2][4][2]; /* channel / path / (GSRXK1:0, GSRXK2:1) */
/* channel / path 0:SRXK1 fail, 1:RXK1 fail 2:RXK2 fail */
u8 rxiqk_fail_code[2][4];
u32 lok_idac[2][4]; /*channel / path*/
u16 rxiqk_agc[2][4]; /*channel / path*/
u32 bypass_iqk[2][4]; /*channel / 0xc94/0xe94*/
u32 txgap_result[8]; /*txagpK result */
u32 tmp_gntwl;
boolean is_btg;
boolean isbnd;
2018-06-22 16:48:32 +00:00
boolean is_reload;
boolean segment_iqk;
boolean is_hwtx;
2019-05-24 19:43:57 +00:00
boolean xym_read;
2018-06-22 16:48:32 +00:00
boolean trximr_enable;
2019-05-24 19:43:57 +00:00
u32 rx_xym[2][10];
u32 tx_xym[2][10];
u32 gs1_xym[2][6];
u32 gs2_xym[2][6];
u32 rxk1_xym[2][6];
2018-06-22 16:48:32 +00:00
#endif
};
2019-05-24 19:43:57 +00:00
#endif /*__HALRF_IQK_H__*/