xref: /freebsd/contrib/wpa/wpa_supplicant/wnm_sta.h (revision a90b9d0159070121c221b966469c3e36d912bf82)
1f05cddf9SRui Paulo /*
2f05cddf9SRui Paulo  * IEEE 802.11v WNM related functions and structures
3f05cddf9SRui Paulo  * Copyright (c) 2011-2012, Qualcomm Atheros, Inc.
4f05cddf9SRui Paulo  *
5f05cddf9SRui Paulo  * This software may be distributed under the terms of the BSD license.
6f05cddf9SRui Paulo  * See README for more details.
7f05cddf9SRui Paulo  */
8f05cddf9SRui Paulo 
9f05cddf9SRui Paulo #ifndef WNM_STA_H
10f05cddf9SRui Paulo #define WNM_STA_H
11f05cddf9SRui Paulo 
125b9c547cSRui Paulo struct measurement_pilot {
135b9c547cSRui Paulo 	u8 measurement_pilot;
145b9c547cSRui Paulo 	u8 subelem_len;
155b9c547cSRui Paulo 	u8 subelems[255];
165b9c547cSRui Paulo };
175b9c547cSRui Paulo 
185b9c547cSRui Paulo struct multiple_bssid {
195b9c547cSRui Paulo 	u8 max_bssid_indicator;
205b9c547cSRui Paulo 	u8 subelem_len;
215b9c547cSRui Paulo 	u8 subelems[255];
225b9c547cSRui Paulo };
235b9c547cSRui Paulo 
245b9c547cSRui Paulo struct neighbor_report {
255b9c547cSRui Paulo 	u8 bssid[ETH_ALEN];
265b9c547cSRui Paulo 	u32 bssid_info;
275b9c547cSRui Paulo 	u8 regulatory_class;
285b9c547cSRui Paulo 	u8 channel_number;
295b9c547cSRui Paulo 	u8 phy_type;
305b9c547cSRui Paulo 	u8 preference; /* valid if preference_present=1 */
315b9c547cSRui Paulo 	u16 tsf_offset; /* valid if tsf_present=1 */
325b9c547cSRui Paulo 	u16 beacon_int; /* valid if tsf_present=1 */
335b9c547cSRui Paulo 	char country[2]; /* valid if country_present=1 */
345b9c547cSRui Paulo 	u8 rm_capab[5]; /* valid if rm_capab_present=1 */
355b9c547cSRui Paulo 	u16 bearing; /* valid if bearing_present=1 */
365b9c547cSRui Paulo 	u16 rel_height; /* valid if bearing_present=1 */
375b9c547cSRui Paulo 	u32 distance; /* valid if bearing_present=1 */
385b9c547cSRui Paulo 	u64 bss_term_tsf; /* valid if bss_term_present=1 */
395b9c547cSRui Paulo 	u16 bss_term_dur; /* valid if bss_term_present=1 */
40*a90b9d01SCy Schubert 	unsigned int disassoc_imminent:1;
415b9c547cSRui Paulo 	unsigned int preference_present:1;
425b9c547cSRui Paulo 	unsigned int tsf_present:1;
435b9c547cSRui Paulo 	unsigned int country_present:1;
445b9c547cSRui Paulo 	unsigned int rm_capab_present:1;
455b9c547cSRui Paulo 	unsigned int bearing_present:1;
465b9c547cSRui Paulo 	unsigned int bss_term_present:1;
4785732ac8SCy Schubert 	unsigned int acceptable:1;
4885732ac8SCy Schubert #ifdef CONFIG_MBO
4985732ac8SCy Schubert 	unsigned int is_first:1;
5085732ac8SCy Schubert #endif /* CONFIG_MBO */
515b9c547cSRui Paulo 	struct measurement_pilot *meas_pilot;
525b9c547cSRui Paulo 	struct multiple_bssid *mul_bssid;
535b9c547cSRui Paulo 	int freq;
545b9c547cSRui Paulo };
555b9c547cSRui Paulo 
56f05cddf9SRui Paulo 
57f05cddf9SRui Paulo int ieee802_11_send_wnmsleep_req(struct wpa_supplicant *wpa_s,
58f05cddf9SRui Paulo 				 u8 action, u16 intval, struct wpabuf *tfs_req);
59f05cddf9SRui Paulo 
60f05cddf9SRui Paulo void ieee802_11_rx_wnm_action(struct wpa_supplicant *wpa_s,
615b9c547cSRui Paulo 			      const struct ieee80211_mgmt *mgmt, size_t len);
625b9c547cSRui Paulo 
635b9c547cSRui Paulo int wnm_send_bss_transition_mgmt_query(struct wpa_supplicant *wpa_s,
6485732ac8SCy Schubert 				       u8 query_reason,
6585732ac8SCy Schubert 				       const char *btm_candidates,
6685732ac8SCy Schubert 				       int cand_list);
6785732ac8SCy Schubert 
6885732ac8SCy Schubert int wnm_send_coloc_intf_report(struct wpa_supplicant *wpa_s, u8 dialog_token,
6985732ac8SCy Schubert 			       const struct wpabuf *elems);
7085732ac8SCy Schubert void wnm_set_coloc_intf_elems(struct wpa_supplicant *wpa_s,
7185732ac8SCy Schubert 			      struct wpabuf *elems);
725b9c547cSRui Paulo 
73*a90b9d01SCy Schubert int wnm_btm_resp_tx_status(struct wpa_supplicant *wpa_s, const u8 *data,
74*a90b9d01SCy Schubert 			   size_t data_len);
755b9c547cSRui Paulo 
765b9c547cSRui Paulo #ifdef CONFIG_WNM
775b9c547cSRui Paulo 
78*a90b9d01SCy Schubert int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check);
7985732ac8SCy Schubert void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s);
805b9c547cSRui Paulo 
81*a90b9d01SCy Schubert bool wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss);
82*a90b9d01SCy Schubert 
83*a90b9d01SCy Schubert void wnm_btm_reset(struct wpa_supplicant *wpa_s);
84*a90b9d01SCy Schubert 
wnm_active_bss_trans_mgmt(struct wpa_supplicant * wpa_s)85*a90b9d01SCy Schubert static inline bool wnm_active_bss_trans_mgmt(struct wpa_supplicant *wpa_s)
86*a90b9d01SCy Schubert {
87*a90b9d01SCy Schubert 	return !!wpa_s->wnm_dialog_token;
88*a90b9d01SCy Schubert }
89*a90b9d01SCy Schubert 
905b9c547cSRui Paulo #else /* CONFIG_WNM */
915b9c547cSRui Paulo 
wnm_scan_process(struct wpa_supplicant * wpa_s,int reply_on_fail)925b9c547cSRui Paulo static inline int wnm_scan_process(struct wpa_supplicant *wpa_s,
935b9c547cSRui Paulo 				   int reply_on_fail)
945b9c547cSRui Paulo {
955b9c547cSRui Paulo 	return 0;
965b9c547cSRui Paulo }
975b9c547cSRui Paulo 
wnm_clear_coloc_intf_reporting(struct wpa_supplicant * wpa_s)9885732ac8SCy Schubert static inline void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s)
9985732ac8SCy Schubert {
10085732ac8SCy Schubert }
10185732ac8SCy Schubert 
102*a90b9d01SCy Schubert static inline bool
wnm_is_bss_excluded(struct wpa_supplicant * wpa_s,struct wpa_bss * bss)103*a90b9d01SCy Schubert wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
104*a90b9d01SCy Schubert {
105*a90b9d01SCy Schubert 	return false;
106*a90b9d01SCy Schubert }
107*a90b9d01SCy Schubert 
wnm_btm_reset(struct wpa_supplicant * wpa_s)108*a90b9d01SCy Schubert static inline void wnm_btm_reset(struct wpa_supplicant *wpa_s)
109*a90b9d01SCy Schubert {
110*a90b9d01SCy Schubert }
111*a90b9d01SCy Schubert 
wnm_active_bss_trans_mgmt(struct wpa_supplicant * wpa_s)112*a90b9d01SCy Schubert static inline bool wnm_active_bss_trans_mgmt(struct wpa_supplicant *wpa_s)
113*a90b9d01SCy Schubert {
114*a90b9d01SCy Schubert 	return false;
115*a90b9d01SCy Schubert }
116*a90b9d01SCy Schubert 
1175b9c547cSRui Paulo #endif /* CONFIG_WNM */
118f05cddf9SRui Paulo 
119f05cddf9SRui Paulo #endif /* WNM_STA_H */
120