xref: /OK3568_Linux_fs/external/rkwifibt/drivers/rtl8821cs/include/rtw_rm_util.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /******************************************************************************
2*4882a593Smuzhiyun  *
3*4882a593Smuzhiyun  * Copyright(c) 2007 - 2019 Realtek Corporation.
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * This program is free software; you can redistribute it and/or modify it
6*4882a593Smuzhiyun  * under the terms of version 2 of the GNU General Public License as
7*4882a593Smuzhiyun  * published by the Free Software Foundation.
8*4882a593Smuzhiyun  *
9*4882a593Smuzhiyun  * This program is distributed in the hope that it will be useful, but WITHOUT
10*4882a593Smuzhiyun  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11*4882a593Smuzhiyun  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12*4882a593Smuzhiyun  * more details.
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  *****************************************************************************/
15*4882a593Smuzhiyun 
16*4882a593Smuzhiyun #ifndef _RTW_RM_UTIL_H_
17*4882a593Smuzhiyun #define _RTW_RM_UTIL_H_
18*4882a593Smuzhiyun /*
19*4882a593Smuzhiyun  * define the following channels as the max channels in each channel plan.
20*4882a593Smuzhiyun  * 2G, total 14 chnls
21*4882a593Smuzhiyun  * {1,2,3,4,5,6,7,8,9,10,11,12,13,14}
22*4882a593Smuzhiyun  * 5G, total 25 chnls
23*4882a593Smuzhiyun  * {36,40,44,48,52,56,60,64,100,104,108,112,116,120,124,128,132,136,140,144,149,153,157,161,165}
24*4882a593Smuzhiyun  */
25*4882a593Smuzhiyun #ifndef MAX
26*4882a593Smuzhiyun #define MAX(x, y) (((x) > (y)) ? (x) : (y))
27*4882a593Smuzhiyun #endif
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun u8 rm_get_oper_class_via_ch(u8 ch);
30*4882a593Smuzhiyun u8 rm_get_ch_set( struct rtw_ieee80211_channel *pch_set, u8 op_class, u8 ch_num);
31*4882a593Smuzhiyun u8 rm_get_ch_set_from_bcn_req_opt(
32*4882a593Smuzhiyun 	struct rtw_ieee80211_channel *pch_set, struct bcn_req_opt *opt);
33*4882a593Smuzhiyun u8 rm_get_bcn_rsni(struct rm_obj *prm, struct wlan_network *pnetwork);
34*4882a593Smuzhiyun u8 rm_get_bcn_rcpi(struct rm_obj *prm, struct wlan_network *pnetwork);
35*4882a593Smuzhiyun u8 rm_get_frame_rsni(struct rm_obj *prm, union recv_frame *pframe);
36*4882a593Smuzhiyun u8 translate_percentage_to_rcpi(u32 SignalStrengthIndex);
37*4882a593Smuzhiyun u8 translate_dbm_to_rcpi(s8 SignalPower);
38*4882a593Smuzhiyun u8 rm_gen_dialog_token(_adapter *padapter);
39*4882a593Smuzhiyun u8 rm_gen_meas_token(_adapter *padapter);
40*4882a593Smuzhiyun u32 rm_gen_rmid(_adapter *padapter, struct rm_obj *prm, u8 role);
41*4882a593Smuzhiyun int is_wildcard_bssid(u8 *bssid);
42*4882a593Smuzhiyun 
43*4882a593Smuzhiyun int rm_get_path_a_max_tx_power(_adapter *adapter, s8 *path_a);
44*4882a593Smuzhiyun int rm_get_tx_power(PADAPTER adapter, enum rf_path path, enum MGN_RATE rate, s8 *pwr);
45*4882a593Smuzhiyun int rm_get_rx_sensitivity(PADAPTER adapter, enum channel_width bw, enum MGN_RATE rate, s8 *pwr);
46*4882a593Smuzhiyun 
47*4882a593Smuzhiyun #endif /* _RTW_RM_UTIL_H_ */
48