13ff40c12SJohn Marino /*
23ff40c12SJohn Marino  * IEEE 802.11v WNM related functions and structures
33ff40c12SJohn Marino  * Copyright (c) 2011-2012, Qualcomm Atheros, Inc.
43ff40c12SJohn Marino  *
53ff40c12SJohn Marino  * This software may be distributed under the terms of the BSD license.
63ff40c12SJohn Marino  * See README for more details.
73ff40c12SJohn Marino  */
83ff40c12SJohn Marino 
93ff40c12SJohn Marino #ifndef WNM_STA_H
103ff40c12SJohn Marino #define WNM_STA_H
113ff40c12SJohn Marino 
123ff40c12SJohn Marino struct measurement_pilot {
133ff40c12SJohn Marino 	u8 measurement_pilot;
14*a1157835SDaniel Fojt 	u8 subelem_len;
15*a1157835SDaniel Fojt 	u8 subelems[255];
163ff40c12SJohn Marino };
173ff40c12SJohn Marino 
183ff40c12SJohn Marino struct multiple_bssid {
193ff40c12SJohn Marino 	u8 max_bssid_indicator;
20*a1157835SDaniel Fojt 	u8 subelem_len;
21*a1157835SDaniel Fojt 	u8 subelems[255];
223ff40c12SJohn Marino };
233ff40c12SJohn Marino 
243ff40c12SJohn Marino struct neighbor_report {
253ff40c12SJohn Marino 	u8 bssid[ETH_ALEN];
26*a1157835SDaniel Fojt 	u32 bssid_info;
273ff40c12SJohn Marino 	u8 regulatory_class;
283ff40c12SJohn Marino 	u8 channel_number;
293ff40c12SJohn Marino 	u8 phy_type;
30*a1157835SDaniel Fojt 	u8 preference; /* valid if preference_present=1 */
31*a1157835SDaniel Fojt 	u16 tsf_offset; /* valid if tsf_present=1 */
32*a1157835SDaniel Fojt 	u16 beacon_int; /* valid if tsf_present=1 */
33*a1157835SDaniel Fojt 	char country[2]; /* valid if country_present=1 */
34*a1157835SDaniel Fojt 	u8 rm_capab[5]; /* valid if rm_capab_present=1 */
35*a1157835SDaniel Fojt 	u16 bearing; /* valid if bearing_present=1 */
36*a1157835SDaniel Fojt 	u16 rel_height; /* valid if bearing_present=1 */
37*a1157835SDaniel Fojt 	u32 distance; /* valid if bearing_present=1 */
38*a1157835SDaniel Fojt 	u64 bss_term_tsf; /* valid if bss_term_present=1 */
39*a1157835SDaniel Fojt 	u16 bss_term_dur; /* valid if bss_term_present=1 */
40*a1157835SDaniel Fojt 	unsigned int preference_present:1;
41*a1157835SDaniel Fojt 	unsigned int tsf_present:1;
42*a1157835SDaniel Fojt 	unsigned int country_present:1;
43*a1157835SDaniel Fojt 	unsigned int rm_capab_present:1;
44*a1157835SDaniel Fojt 	unsigned int bearing_present:1;
45*a1157835SDaniel Fojt 	unsigned int bss_term_present:1;
46*a1157835SDaniel Fojt 	unsigned int acceptable:1;
47*a1157835SDaniel Fojt #ifdef CONFIG_MBO
48*a1157835SDaniel Fojt 	unsigned int is_first:1;
49*a1157835SDaniel Fojt #endif /* CONFIG_MBO */
503ff40c12SJohn Marino 	struct measurement_pilot *meas_pilot;
513ff40c12SJohn Marino 	struct multiple_bssid *mul_bssid;
52*a1157835SDaniel Fojt 	int freq;
533ff40c12SJohn Marino };
543ff40c12SJohn Marino 
553ff40c12SJohn Marino 
563ff40c12SJohn Marino int ieee802_11_send_wnmsleep_req(struct wpa_supplicant *wpa_s,
573ff40c12SJohn Marino 				 u8 action, u16 intval, struct wpabuf *tfs_req);
583ff40c12SJohn Marino 
593ff40c12SJohn Marino void ieee802_11_rx_wnm_action(struct wpa_supplicant *wpa_s,
603ff40c12SJohn Marino 			      const struct ieee80211_mgmt *mgmt, size_t len);
613ff40c12SJohn Marino 
623ff40c12SJohn Marino int wnm_send_bss_transition_mgmt_query(struct wpa_supplicant *wpa_s,
63*a1157835SDaniel Fojt 				       u8 query_reason,
64*a1157835SDaniel Fojt 				       const char *btm_candidates,
65*a1157835SDaniel Fojt 				       int cand_list);
66*a1157835SDaniel Fojt 
673ff40c12SJohn Marino void wnm_deallocate_memory(struct wpa_supplicant *wpa_s);
68*a1157835SDaniel Fojt int wnm_send_coloc_intf_report(struct wpa_supplicant *wpa_s, u8 dialog_token,
69*a1157835SDaniel Fojt 			       const struct wpabuf *elems);
70*a1157835SDaniel Fojt void wnm_set_coloc_intf_elems(struct wpa_supplicant *wpa_s,
71*a1157835SDaniel Fojt 			      struct wpabuf *elems);
72*a1157835SDaniel Fojt 
73*a1157835SDaniel Fojt 
74*a1157835SDaniel Fojt #ifdef CONFIG_WNM
75*a1157835SDaniel Fojt 
76*a1157835SDaniel Fojt int wnm_scan_process(struct wpa_supplicant *wpa_s, int reply_on_fail);
77*a1157835SDaniel Fojt void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s);
78*a1157835SDaniel Fojt 
79*a1157835SDaniel Fojt #else /* CONFIG_WNM */
80*a1157835SDaniel Fojt 
wnm_scan_process(struct wpa_supplicant * wpa_s,int reply_on_fail)81*a1157835SDaniel Fojt static inline int wnm_scan_process(struct wpa_supplicant *wpa_s,
82*a1157835SDaniel Fojt 				   int reply_on_fail)
83*a1157835SDaniel Fojt {
84*a1157835SDaniel Fojt 	return 0;
85*a1157835SDaniel Fojt }
86*a1157835SDaniel Fojt 
wnm_clear_coloc_intf_reporting(struct wpa_supplicant * wpa_s)87*a1157835SDaniel Fojt static inline void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s)
88*a1157835SDaniel Fojt {
89*a1157835SDaniel Fojt }
90*a1157835SDaniel Fojt 
91*a1157835SDaniel Fojt #endif /* CONFIG_WNM */
923ff40c12SJohn Marino 
933ff40c12SJohn Marino #endif /* WNM_STA_H */
94