1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2019 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 *****************************************************************************/ 15 16 #ifndef _RTW_RM_UTIL_H_ 17 #define _RTW_RM_UTIL_H_ 18 /* 19 * define the following channels as the max channels in each channel plan. 20 * 2G, total 14 chnls 21 * {1,2,3,4,5,6,7,8,9,10,11,12,13,14} 22 * 5G, total 25 chnls 23 * {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 */ 25 #ifndef MAX 26 #define MAX(x, y) (((x) > (y)) ? (x) : (y)) 27 #endif 28 29 u8 rm_get_oper_class_via_ch(u8 ch); 30 u8 rm_get_ch_set( struct rtw_ieee80211_channel *pch_set, u8 op_class, u8 ch_num); 31 u8 rm_get_ch_set_from_bcn_req_opt( 32 struct rtw_ieee80211_channel *pch_set, struct bcn_req_opt *opt); 33 u8 rm_get_bcn_rsni(struct rm_obj *prm, struct wlan_network *pnetwork); 34 u8 rm_get_bcn_rcpi(struct rm_obj *prm, struct wlan_network *pnetwork); 35 u8 rm_get_frame_rsni(struct rm_obj *prm, union recv_frame *pframe); 36 u8 translate_percentage_to_rcpi(u32 SignalStrengthIndex); 37 u8 translate_dbm_to_rcpi(s8 SignalPower); 38 u8 rm_gen_dialog_token(_adapter *padapter); 39 u8 rm_gen_meas_token(_adapter *padapter); 40 u32 rm_gen_rmid(_adapter *padapter, struct rm_obj *prm, u8 role); 41 int is_wildcard_bssid(u8 *bssid); 42 43 int rm_get_path_a_max_tx_power(_adapter *adapter, s8 *path_a); 44 int rm_get_tx_power(PADAPTER adapter, enum rf_path path, enum MGN_RATE rate, s8 *pwr); 45 int rm_get_rx_sensitivity(PADAPTER adapter, enum channel_width bw, enum MGN_RATE rate, s8 *pwr); 46 47 #endif /* _RTW_RM_UTIL_H_ */ 48