1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /****************************************************************************** 3 * 4 * Copyright(c) 2007 - 2011 Realtek Corporation. All rights reserved. 5 * 6 * This program is free software; you can redistribute it and/or modify it 7 * under the terms of version 2 of the GNU General Public License as 8 * published by the Free Software Foundation. 9 * 10 * This program is distributed in the hope that it will be useful, but WITHOUT 11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 13 * more details. 14 * 15 * You should have received a copy of the GNU General Public License along with 16 * this program; if not, write to the Free Software Foundation, Inc., 17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA 18 * 19 * 20 ******************************************************************************/ 21 #ifndef __RTW_RSON_H_ 22 #define __RTW_RSON_H_ 23 24 25 #define RTW_RSON_VER 1 26 27 #define RTW_RSON_SCORE_NOTSUP 0x0 28 #define RTW_RSON_SCORE_NOTCNNT 0x1 29 #define RTW_RSON_SCORE_MAX 0xFF 30 #define RTW_RSON_HC_NOTREADY 0xFF 31 #define RTW_RSON_HC_ROOT 0x0 32 #define RTW_RSON_ALLOWCONNECT 0x1 33 #define RTW_RSON_DENYCONNECT 0x0 34 35 36 37 /* for rtw self-origanization spec 1 */ 38 struct rtw_rson_struct { 39 u8 ver; 40 u32 id; 41 u8 hopcnt; 42 u8 connectible; 43 u8 loading; 44 u8 res[16]; 45 } __attribute__((__packed__)); 46 47 void init_rtw_rson_data(struct dvobj_priv *dvobj); 48 void rtw_rson_get_property_str(_adapter *padapter, char *rson_data_str); 49 int rtw_rson_set_property(_adapter *padapter, char *field, char *value); 50 int rtw_rson_choose(struct wlan_network **candidate, struct wlan_network *competitor); 51 int rtw_get_rson_struct(WLAN_BSSID_EX *bssid, struct rtw_rson_struct *rson_data); 52 u8 rtw_cal_rson_score(struct rtw_rson_struct *cand_rson_data, NDIS_802_11_RSSI Rssi); 53 void rtw_rson_handle_ie(WLAN_BSSID_EX *bssid, u8 ie_offset); 54 u32 rtw_rson_append_ie(_adapter *padapter, unsigned char *pframe, u32 *len); 55 void rtw_rson_do_disconnect(_adapter *padapter); 56 void rtw_rson_join_done(_adapter *padapter); 57 int rtw_rson_isupdate_roamcan(struct mlme_priv *mlme, struct wlan_network **candidate, struct wlan_network *competitor); 58 void rtw_rson_show_survey_info(struct seq_file *m, _list *plist, _list *phead); 59 u8 rtw_rson_ap_check_sta(_adapter *padapter, u8 *pframe, uint pkt_len, unsigned short ie_offset); 60 u8 rtw_rson_scan_wk_cmd(_adapter *padapter, int op); 61 void rtw_rson_scan_cmd_hdl(_adapter *padapter, int op); 62 #endif /* __RTW_RSON_H_ */ 63