Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 1 | /* |
| 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 Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 12 | struct measurement_pilot { |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 13 | u8 measurement_pilot; |
Dmitry Shmidt | f940fbd | 2014-04-10 10:23:13 -0700 | [diff] [blame] | 14 | u8 subelem_len; |
| 15 | u8 subelems[255]; |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 16 | }; |
| 17 | |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 18 | struct multiple_bssid { |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 19 | u8 max_bssid_indicator; |
Dmitry Shmidt | f940fbd | 2014-04-10 10:23:13 -0700 | [diff] [blame] | 20 | u8 subelem_len; |
| 21 | u8 subelems[255]; |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 22 | }; |
| 23 | |
| 24 | struct neighbor_report { |
| 25 | u8 bssid[ETH_ALEN]; |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 26 | u32 bssid_info; |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 27 | u8 regulatory_class; |
| 28 | u8 channel_number; |
| 29 | u8 phy_type; |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 30 | 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 Ravi | 2a14cf1 | 2023-11-21 00:54:38 +0000 | [diff] [blame] | 40 | unsigned int disassoc_imminent:1; |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 41 | 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 Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 47 | unsigned int acceptable:1; |
| 48 | #ifdef CONFIG_MBO |
| 49 | unsigned int is_first:1; |
| 50 | #endif /* CONFIG_MBO */ |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 51 | struct measurement_pilot *meas_pilot; |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 52 | struct multiple_bssid *mul_bssid; |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 53 | int freq; |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 54 | }; |
| 55 | |
| 56 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 57 | int ieee802_11_send_wnmsleep_req(struct wpa_supplicant *wpa_s, |
Dmitry Shmidt | a54fa5f | 2013-01-15 13:53:35 -0800 | [diff] [blame] | 58 | u8 action, u16 intval, struct wpabuf *tfs_req); |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 59 | |
| 60 | void ieee802_11_rx_wnm_action(struct wpa_supplicant *wpa_s, |
Dmitry Shmidt | fb79edc | 2014-01-10 10:45:54 -0800 | [diff] [blame] | 61 | const struct ieee80211_mgmt *mgmt, size_t len); |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 62 | |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 63 | int wnm_send_bss_transition_mgmt_query(struct wpa_supplicant *wpa_s, |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 64 | u8 query_reason, |
| 65 | const char *btm_candidates, |
| 66 | int cand_list); |
| 67 | |
Hai Shalom | 39ba6fc | 2019-01-22 12:40:38 -0800 | [diff] [blame] | 68 | int wnm_send_coloc_intf_report(struct wpa_supplicant *wpa_s, u8 dialog_token, |
| 69 | const struct wpabuf *elems); |
| 70 | void wnm_set_coloc_intf_elems(struct wpa_supplicant *wpa_s, |
| 71 | struct wpabuf *elems); |
Dmitry Shmidt | 44c9578 | 2013-05-17 09:51:35 -0700 | [diff] [blame] | 72 | |
Sunil Ravi | 99c035e | 2024-07-12 01:42:03 +0000 | [diff] [blame] | 73 | int wnm_btm_resp_tx_status(struct wpa_supplicant *wpa_s, const u8 *data, |
| 74 | size_t data_len); |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 75 | |
| 76 | #ifdef CONFIG_WNM |
| 77 | |
Sunil Ravi | 99c035e | 2024-07-12 01:42:03 +0000 | [diff] [blame] | 78 | int wnm_scan_process(struct wpa_supplicant *wpa_s, bool pre_scan_check); |
Hai Shalom | 39ba6fc | 2019-01-22 12:40:38 -0800 | [diff] [blame] | 79 | void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s); |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 80 | |
Sunil Ravi | 99c035e | 2024-07-12 01:42:03 +0000 | [diff] [blame] | 81 | bool wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss); |
| 82 | |
| 83 | void wnm_btm_reset(struct wpa_supplicant *wpa_s); |
| 84 | |
| 85 | static inline bool wnm_active_bss_trans_mgmt(struct wpa_supplicant *wpa_s) |
| 86 | { |
| 87 | return !!wpa_s->wnm_dialog_token; |
| 88 | } |
| 89 | |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 90 | #else /* CONFIG_WNM */ |
| 91 | |
| 92 | static inline int wnm_scan_process(struct wpa_supplicant *wpa_s, |
| 93 | int reply_on_fail) |
| 94 | { |
| 95 | return 0; |
| 96 | } |
| 97 | |
Hai Shalom | 39ba6fc | 2019-01-22 12:40:38 -0800 | [diff] [blame] | 98 | static inline void wnm_clear_coloc_intf_reporting(struct wpa_supplicant *wpa_s) |
| 99 | { |
| 100 | } |
| 101 | |
Sunil Ravi | 99c035e | 2024-07-12 01:42:03 +0000 | [diff] [blame] | 102 | static inline bool |
| 103 | wnm_is_bss_excluded(struct wpa_supplicant *wpa_s, struct wpa_bss *bss) |
| 104 | { |
| 105 | return false; |
| 106 | } |
| 107 | |
| 108 | static inline void wnm_btm_reset(struct wpa_supplicant *wpa_s) |
| 109 | { |
| 110 | } |
| 111 | |
| 112 | static inline bool wnm_active_bss_trans_mgmt(struct wpa_supplicant *wpa_s) |
| 113 | { |
| 114 | return false; |
| 115 | } |
| 116 | |
Dmitry Shmidt | fb45fd5 | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 117 | #endif /* CONFIG_WNM */ |
| 118 | |
Dmitry Shmidt | 61d9df3 | 2012-08-29 16:22:06 -0700 | [diff] [blame] | 119 | #endif /* WNM_STA_H */ |