1 /****************************************************************************** 2 * 3 * Copyright(c) 2007 - 2017 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_MBO_H_ 17 #define __RTW_MBO_H_ 18 19 #define rtw_mbo_wifi_logo_test(a) ((a->registrypriv.wifi_spec) == 1) 20 21 #define rtw_mbo_set_ext_cap_internw(_pEleStart, _val) \ 22 SET_BITS_TO_LE_1BYTE(((u8 *)(_pEleStart))+3, 7, 1, _val) 23 24 #define rtw_mbo_wnm_notification_req(c, a) \ 25 (((c) == RTW_WLAN_CATEGORY_WNM) && \ 26 (((a) == RTW_WLAN_ACTION_WNM_NOTIF_REQ))) 27 28 /* IEEE Std 802.11-2016 Table 9-46 - Status codes */ 29 #define RTW_ASSOC_DENIED_NO_MORE_STAS 17 30 #define RTW_ASSOC_REFUSED_TEMPORARILY 30 31 32 /* MBO-OCE Information Element */ 33 #define RTW_MBO_EID WLAN_EID_VENDOR_SPECIFIC 34 #define RTW_MBO_OUI 0x506F9A 35 #define RTW_MBO_OUI_TYPE 0x16 36 37 /* Non-preferred Channel Report */ 38 #define RTW_MBO_ATTR_NPREF_CH_RPT_ID 0x2 39 /* Cellular Data Capabilities */ 40 #define RTW_MBO_ATTR_CELL_DATA_CAP_ID 0x3 41 /* Association Disallowed */ 42 #define RTW_MBO_ATTR_ASSOC_DISABLED_ID 0x4 43 /* Transition Reason Code */ 44 #define RTW_MBO_ATTR_TRANS_RES_ID 0x6 45 /* Transition Rejection Reason Code */ 46 #define RTW_MBO_ATTR_TRANS_REJ_ID 0x7 47 /* Association Retry Delay */ 48 #define RTW_MBO_ATTR_TASSOC_RETRY_ID 0x8 49 50 #define RTW_MBO_MAX_CH_LIST_NUM MAX_CHANNEL_NUM 51 52 #define RTW_MBO_MAX_CH_RPT_NUM 32 53 54 struct npref_ch { 55 u8 op_class; 56 u8 chs[RTW_MBO_MAX_CH_LIST_NUM]; 57 size_t nm_of_ch; 58 u8 preference; 59 u8 reason; 60 }; 61 62 struct npref_ch_rtp { 63 struct npref_ch ch_rpt[RTW_MBO_MAX_CH_RPT_NUM]; 64 size_t nm_of_rpt; 65 }; 66 67 void rtw_mbo_build_cell_data_cap_attr( 68 _adapter *padapter, u8 **pframe, struct pkt_attrib *pattrib); 69 70 void rtw_mbo_update_ie_data( 71 _adapter *padapter, u8 *pie, u32 ie_len); 72 73 void rtw_mbo_build_supp_op_class_elem( 74 _adapter *padapter, u8 **pframe, struct pkt_attrib *pattrib); 75 76 void rtw_mbo_build_npref_ch_rpt_attr( 77 _adapter *padapter, u8 **pframe, struct pkt_attrib *pattrib); 78 79 void rtw_mbo_build_trans_reject_reason_attr( 80 _adapter *padapter, u8 **pframe, struct pkt_attrib *pattrib, u8 *pres); 81 82 u8 rtw_mbo_disallowed_network(struct wlan_network *pnetwork); 83 84 void rtw_mbo_build_exented_cap( 85 _adapter *padapter, u8 **pframe, struct pkt_attrib *pattrib); 86 87 ssize_t rtw_mbo_proc_non_pref_chans_set( 88 struct file *pfile, const char __user *buffer, 89 size_t count, loff_t *pos, void *pdata); 90 91 int rtw_mbo_proc_non_pref_chans_get( 92 struct seq_file *m, void *v); 93 94 ssize_t rtw_mbo_proc_cell_data_set( 95 struct file *pfile, const char __user *buffer, 96 size_t count, loff_t *pos, void *pdata); 97 98 int rtw_mbo_proc_cell_data_get( 99 struct seq_file *m, void *v); 100 101 void rtw_mbo_wnm_notification_parsing( 102 _adapter *padapter, const u8 *pdata, size_t data_len); 103 104 void rtw_mbo_build_wnm_notification( 105 _adapter *padapter, u8 **pframe, struct pkt_attrib *pattrib); 106 107 void rtw_mbo_build_probe_req_ies( 108 _adapter *padapter, u8 **pframe, struct pkt_attrib *pattrib); 109 110 void rtw_mbo_build_assoc_req_ies( 111 _adapter *padapter, u8 **pframe, struct pkt_attrib *pattrib); 112 113 #endif /* __RTW_MBO_H_ */ 114 115