1 /******************************************************************************
3 * Copyright(c) 2007 - 2017 Realtek Corporation.
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.
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
14 * The full GNU General Public License is included in this distribution in the
15 * file called LICENSE.
17 * Contact Information:
18 * wlanfae <wlanfae@realtek.com>
19 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20 * Hsinchu 300, Taiwan.
22 * Larry Finger <Larry.Finger@lwfinger.net>
24 *****************************************************************************/
26 #ifndef __PHYDM_PRIMARYCCA_H__
27 #define __PHYDM_PRIMARYCCA_H__
29 #ifdef PHYDM_PRIMARY_CCA
30 #define PRIMARYCCA_VERSION "2.0"
32 /*@============================================================*/
34 /*@============================================================*/
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*/
47 #define OFDMCCA_TH 500
48 #define bw_ind_bias 500
49 #define PRI_CCA_MONITOR_TIME 30
51 /*@============================================================*/
52 /*structure and define*/
53 /*@============================================================*/
54 enum primary_cca_ch_position { /*N-series REG0xc6c[8:7]*/
60 struct phydm_pricca_struct {
61 #if (RTL8188E_SUPPORT == 1) || (RTL8192E_SUPPORT == 1)
69 u8 cca_th_40m_bkp; /*@c84[31:28]*/
70 enum channel_width pre_bw;
71 u8 pri_cca_is_become_linked;
75 /*@============================================================*/
76 /*@function prototype*/
77 /*@============================================================*/
78 void phydm_write_dynamic_cca(void *dm_void, u8 curr_mf_state);
80 boolean odm_dynamic_primary_cca_dup_rts(void *dm_void);
82 void phydm_primary_cca_init(void *dm_void);
84 void phydm_primary_cca(void *dm_void);
85 #endif /*@#ifdef PHYDM_PRIMARY_CCA*/
86 #endif /*@#ifndef __PHYDM_PRIMARYCCA_H__*/