GNU Linux-libre 4.14.259-gnu1
[releases.git] / drivers / staging / rtlwifi / phydm / phydm_iqk.h
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2016  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
26 #ifndef __PHYDMIQK_H__
27 #define __PHYDMIQK_H__
28
29 /*--------------------------Define Parameters-------------------------------*/
30 #define LOK_delay 1
31 #define WBIQK_delay 10
32 #define TX_IQK 0
33 #define RX_IQK 1
34 #define TXIQK 0
35 #define RXIQK1 1
36 #define RXIQK2 2
37 #define GSRXK1 0
38 #define GSRXK2 1
39 #define kcount_limit_80m 2
40 #define kcount_limit_others 4
41 #define rxiqk_gs_limit 4
42
43 #define NUM 4
44 /*----------------------End Define Parameters-------------------------------*/
45
46 struct dm_iqk_info {
47         bool lok_fail[NUM];
48         bool iqk_fail[2][NUM];
49         u32 iqc_matrix[2][NUM];
50         u8 iqk_times;
51         u32 rf_reg18;
52         u32 lna_idx;
53         u8 rxiqk_step;
54         u8 tmp1bcc;
55         u8 kcount;
56
57         u32 iqk_channel[2];
58         bool iqk_fail_report[2][4][2]; /*channel/path/TRX(TX:0, RX:1) */
59         u32 iqk_cfir_real[2][4][2]
60                          [8]; /*channel / path / TRX(TX:0, RX:1) / CFIR_real*/
61         u32 iqk_cfir_imag[2][4][2]
62                          [8]; /*channel / path / TRX(TX:0, RX:1) / CFIR_imag*/
63         u8 retry_count[2][4][3]; /* channel / path / (TXK:0, RXK1:1, RXK2:2) */
64         u8 gs_retry_count[2][4][2]; /* channel / path / (GSRXK1:0, GSRXK2:1) */
65         u8 rxiqk_fail_code[2][4]; /* channel / path
66                                    * 0:SRXK1 fail, 1:RXK1 fail 2:RXK2 fail
67                                    */
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 tmp_gntwl;
72         bool is_btg;
73         bool isbnd;
74 };
75
76 #endif