1 /******************************************************************************
3 * Copyright(c) 2007 - 2016 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 __PHYDMADAPTIVITY_H__
27 #define __PHYDMADAPTIVITY_H__
29 /*20160902 changed by Kevin, refine method for searching pwdb lower bound*/
30 #define ADAPTIVITY_VERSION "9.3.5"
32 #define pwdb_upper_bound 7
36 PHYDM_ADAPINFO_CARRIER_SENSE_ENABLE = 0,
37 PHYDM_ADAPINFO_DCBACKOFF,
38 PHYDM_ADAPINFO_DYNAMICLINKADAPTIVITY,
39 PHYDM_ADAPINFO_TH_L2H_INI,
40 PHYDM_ADAPINFO_TH_EDCCA_HL_DIFF,
41 PHYDM_ADAPINFO_AP_NUM_TH
46 phydm_disable_lna = 0,
50 enum phydm_trx_mux_type {
52 phydm_standby_mode = 1,
57 enum phydm_mac_edcca_type {
58 phydm_ignore_edcca = 0,
59 phydm_dont_ignore_edcca = 1
62 struct adaptivity_statistics {
64 s8 th_edcca_hl_diff_backup;
72 bool dynamic_link_adaptivity;
75 bool acs_for_adaptivity;
81 void phydm_pause_edcca(void *dm_void, bool is_pasue_edcca);
83 void phydm_check_adaptivity(void *dm_void);
85 void phydm_check_environment(void *dm_void);
87 void phydm_nhm_counter_statistics_init(void *dm_void);
89 void phydm_nhm_counter_statistics(void *dm_void);
91 void phydm_nhm_counter_statistics_reset(void *dm_void);
93 void phydm_get_nhm_counter_statistics(void *dm_void);
95 void phydm_mac_edcca_state(void *dm_void, enum phydm_mac_edcca_type state);
97 void phydm_set_edcca_threshold(void *dm_void, s8 H2L, s8 L2H);
99 void phydm_set_trx_mux(void *dm_void, enum phydm_trx_mux_type tx_mode,
100 enum phydm_trx_mux_type rx_mode);
102 bool phydm_cal_nhm_cnt(void *dm_void);
104 void phydm_search_pwdb_lower_bound(void *dm_void);
106 void phydm_adaptivity_info_init(void *dm_void, enum phydm_adapinfo cmn_info,
109 void phydm_adaptivity_init(void *dm_void);
111 void phydm_adaptivity(void *dm_void);
113 void phydm_set_edcca_threshold_api(void *dm_void, u8 IGI);
115 void phydm_pause_edcca_work_item_callback(void *dm_void);
117 void phydm_resume_edcca_work_item_callback(void *dm_void);