OSDN Git Service

Add rtl8821ce driver version 5.5.2
[android-x86/external-kernel-drivers.git] / rtl8821ce / hal / phydm / phydm_primary_cca.h
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
26 #ifndef __PHYDM_PRIMARYCCA_H__
27 #define __PHYDM_PRIMARYCCA_H__
28
29 #ifdef PHYDM_PRIMARY_CCA
30 #define PRIMARYCCA_VERSION "2.0"
31
32 /*@============================================================*/
33 /*@Definition */
34 /*@============================================================*/
35
36 #if (DM_ODM_SUPPORT_TYPE == ODM_CE)
37 #define SECOND_CH_AT_LSB        2       /*@primary CH @ MSB,  SD4: HAL_PRIME_CHNL_OFFSET_UPPER*/
38 #define SECOND_CH_AT_USB        1       /*@primary CH @ LSB,   SD4: HAL_PRIME_CHNL_OFFSET_LOWER*/
39 #elif (DM_ODM_SUPPORT_TYPE == ODM_WIN)
40 #define SECOND_CH_AT_LSB        2       /*@primary CH @ MSB,  SD7: HAL_PRIME_CHNL_OFFSET_UPPER*/
41 #define SECOND_CH_AT_USB        1       /*@primary CH @ LSB,   SD7: HAL_PRIME_CHNL_OFFSET_LOWER*/
42 #else /*if (DM_ODM_SUPPORT_TYPE == ODM_AP)*/
43 #define SECOND_CH_AT_LSB        1       /*@primary CH @ MSB,  SD8: HT_2NDCH_OFFSET_BELOW*/
44 #define SECOND_CH_AT_USB        2       /*@primary CH @ LSB,   SD8: HT_2NDCH_OFFSET_ABOVE*/
45 #endif
46
47 #define OFDMCCA_TH              500
48 #define bw_ind_bias             500
49 #define PRI_CCA_MONITOR_TIME    30
50
51 /*@============================================================*/
52 /*structure and define*/
53 /*@============================================================*/
54 enum primary_cca_ch_position { /*N-series REG0xc6c[8:7]*/
55         MF_USC_LSC      = 0,
56         MF_LSC          = 1,
57         MF_USC          = 2
58 };
59
60 struct phydm_pricca_struct {
61         #if (RTL8188E_SUPPORT == 1) || (RTL8192E_SUPPORT == 1)
62         u8      pri_cca_flag;
63         u8      intf_flag;
64         u8      intf_type;
65         u8      monitor_flag;
66         u8      ch_offset;
67         #endif
68         u8      dup_rts_flag;
69         u8      cca_th_40m_bkp; /*@c84[31:28]*/
70         enum channel_width      pre_bw;
71         u8      pri_cca_is_become_linked;
72         u8      mf_state;
73 };
74
75 /*@============================================================*/
76 /*@function prototype*/
77 /*@============================================================*/
78 void phydm_write_dynamic_cca(void *dm_void, u8 curr_mf_state);
79
80 boolean odm_dynamic_primary_cca_dup_rts(void *dm_void);
81
82 void phydm_primary_cca_init(void *dm_void);
83
84 void phydm_primary_cca(void *dm_void);
85 #endif /*@#ifdef PHYDM_PRIMARY_CCA*/
86 #endif /*@#ifndef       __PHYDM_PRIMARYCCA_H__*/