blob: 80928f75500cdc3f2429ba8a835858b5eb00ca59 [file] [log] [blame]
Dmitry Shmidt61d9df32012-08-29 16:22:06 -07001/*
2 * IEEE 802.11v WNM related functions and structures
3 * Copyright (c) 2011-2012, Qualcomm Atheros, Inc.
4 *
5 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
7 */
8
9#ifndef WNM_STA_H
10#define WNM_STA_H
11
Dmitry Shmidt44c95782013-05-17 09:51:35 -070012struct measurement_pilot {
Dmitry Shmidt44c95782013-05-17 09:51:35 -070013 u8 measurement_pilot;
Dmitry Shmidtf940fbd2014-04-10 10:23:13 -070014 u8 subelem_len;
15 u8 subelems[255];
Dmitry Shmidt44c95782013-05-17 09:51:35 -070016};
17
Dmitry Shmidt44c95782013-05-17 09:51:35 -070018struct multiple_bssid {
Dmitry Shmidt44c95782013-05-17 09:51:35 -070019 u8 max_bssid_indicator;
Dmitry Shmidtf940fbd2014-04-10 10:23:13 -070020 u8 subelem_len;
21 u8 subelems[255];
Dmitry Shmidt44c95782013-05-17 09:51:35 -070022};
23
24struct neighbor_report {
25 u8 bssid[ETH_ALEN];
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -080026 u32 bssid_info;
Dmitry Shmidt44c95782013-05-17 09:51:35 -070027 u8 regulatory_class;
28 u8 channel_number;
29 u8 phy_type;
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -080030 u8 preference; /* valid if preference_present=1 */
31 u16 tsf_offset; /* valid if tsf_present=1 */
32 u16 beacon_int; /* valid if tsf_present=1 */
33 char country[2]; /* valid if country_present=1 */
34 u8 rm_capab[5]; /* valid if rm_capab_present=1 */
35 u16 bearing; /* valid if bearing_present=1 */
36 u16 rel_height; /* valid if bearing_present=1 */
37 u32 distance; /* valid if bearing_present=1 */
38 u64 bss_term_tsf; /* valid if bss_term_present=1 */
39 u16 bss_term_dur; /* valid if bss_term_present=1 */
Sunil Ravi2a14cf12023-11-21 00:54:38 +000040 unsigned int disassoc_imminent:1;
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -080041 unsigned int preference_present:1;
42 unsigned int tsf_present:1;
43 unsigned int country_present:1;
44 unsigned int rm_capab_present:1;
45 unsigned int bearing_present:1;
46 unsigned int bss_term_present:1;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070047#ifdef CONFIG_MBO
Sunil Ravi79e6c4f2025-01-04 00:47:06 +000048 unsigned int drv_mbo_reject:1;
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070049#endif /* CONFIG_MBO */
Dmitry Shmidt44c95782013-05-17 09:51:35 -070050 struct measurement_pilot *meas_pilot;
Dmitry Shmidt44c95782013-05-17 09:51:35 -070051 struct multiple_bssid *mul_bssid;
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -080052 int freq;
Dmitry Shmidt44c95782013-05-17 09:51:35 -070053};
54
55
Dmitry Shmidt61d9df32012-08-29 16:22:06 -070056int ieee802_11_send_wnmsleep_req(struct wpa_supplicant *wpa_s,
Dmitry Shmidta54fa5f2013-01-15 13:53:35 -080057 u8 action, u16 intval, struct wpabuf *tfs_req);
Dmitry Shmidt61d9df32012-08-29 16:22:06 -070058
59void ieee802_11_rx_wnm_action(struct wpa_supplicant *wpa_s,
Dmitry Shmidtfb79edc2014-01-10 10:45:54 -080060 const struct ieee80211_mgmt *mgmt, size_t len);
Dmitry Shmidt61d9df32012-08-29 16:22:06 -070061
Dmitry Shmidt44c95782013-05-17 09:51:35 -070062int wnm_send_bss_transition_mgmt_query(struct wpa_supplicant *wpa_s,
Dmitry Shmidtd2986c22017-10-23 14:22:09 -070063 u8 query_reason,
64 const char *btm_candidates,
65 int cand_list);
66
Hai Shalom39ba6fc2019-01-22 12:40:38 -080067int wnm_send_coloc_intf_report(struct wpa_supplicant *wpa_s, u8 dialog_token,
68 const struct wpabuf *elems);
69void wnm_set_coloc_intf_elems(struct wpa_supplicant *wpa_s,
70 struct wpabuf *elems);
Dmitry Shmidt44c95782013-05-17 09:51:35 -070071
Sunil Ravi99c035e2024-07-12 01:42:03 +000072int wnm_btm_resp_tx_status(struct wpa_supplicant *wpa_s, const u8 *data,
73 size_t data_len);
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -080074
75#ifdef CONFIG_WNM
76
Sunil Ravi99c035e2024-07-12 01:42:03 +000077int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check);
Hai Shalom39ba6fc2019-01-22 12:40:38 -080078void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s);
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -080079
Sunil Ravi99c035e2024-07-12 01:42:03 +000080bool wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss);
81
82void wnm_btm_reset(struct wpa_supplicant *wpa_s);
83
84static inline bool wnm_active_bss_trans_mgmt(struct wpa_supplicant *wpa_s)
85{
86 return !!wpa_s->wnm_dialog_token;
87}
88
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -080089#else /* CONFIG_WNM */
90
91static inline int wnm_scan_process(struct wpa_supplicant *wpa_s,
92 int reply_on_fail)
93{
94 return 0;
95}
96
Hai Shalom39ba6fc2019-01-22 12:40:38 -080097static inline void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s)
98{
99}
100
Sunil Ravi99c035e2024-07-12 01:42:03 +0000101static inline bool
102wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss)
103{
104 return false;
105}
106
107static inline void wnm_btm_reset(struct wpa_supplicant *wpa_s)
108{
109}
110
111static inline bool wnm_active_bss_trans_mgmt(struct wpa_supplicant *wpa_s)
112{
113 return false;
114}
115
Dmitry Shmidtfb45fd52015-01-05 13:08:17 -0800116#endif /* CONFIG_WNM */
117
Dmitry Shmidt61d9df32012-08-29 16:22:06 -0700118#endif /* WNM_STA_H */