Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Driver interaction with Linux nl80211/cfg80211 - definitions |
| 3 | * Copyright (c) 2002-2014, Jouni Malinen <j@w1.fi> |
| 4 | * Copyright (c) 2003-2004, Instant802 Networks, Inc. |
| 5 | * Copyright (c) 2005-2006, Devicescape Software, Inc. |
| 6 | * Copyright (c) 2007, Johannes Berg <johannes@sipsolutions.net> |
| 7 | * Copyright (c) 2009-2010, Atheros Communications |
| 8 | * |
| 9 | * This software may be distributed under the terms of the BSD license. |
| 10 | * See README for more details. |
| 11 | */ |
| 12 | |
| 13 | #ifndef DRIVER_NL80211_H |
| 14 | #define DRIVER_NL80211_H |
| 15 | |
| 16 | #include "nl80211_copy.h" |
| 17 | #include "utils/list.h" |
| 18 | #include "driver.h" |
| 19 | |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 20 | #ifndef NL_CAPABILITY_VERSION_3_5_0 |
| 21 | #define nla_nest_start(msg, attrtype) \ |
| 22 | nla_nest_start(msg, NLA_F_NESTED | (attrtype)) |
| 23 | #endif |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 24 | |
| 25 | struct nl80211_global { |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 26 | void *ctx; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 27 | struct dl_list interfaces; |
| 28 | int if_add_ifindex; |
| 29 | u64 if_add_wdevid; |
| 30 | int if_add_wdevid_set; |
| 31 | struct netlink_data *netlink; |
| 32 | struct nl_cb *nl_cb; |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 33 | struct nl_sock *nl; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 34 | int nl80211_id; |
Hai Shalom | c1a2144 | 2022-02-04 13:43:00 -0800 | [diff] [blame] | 35 | int nlctrl_id; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 36 | int ioctl_sock; /* socket for ioctl() use */ |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 37 | struct nl_sock *nl_event; |
Mir Ali | 8a8f100 | 2020-10-06 22:41:40 +0530 | [diff] [blame] | 38 | u8 p2p_perm_addr[ETH_ALEN]; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | struct nl80211_wiphy_data { |
| 42 | struct dl_list list; |
| 43 | struct dl_list bsss; |
| 44 | struct dl_list drvs; |
| 45 | |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 46 | struct nl_sock *nl_beacons; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 47 | struct nl_cb *nl_cb; |
| 48 | |
| 49 | int wiphy_idx; |
| 50 | }; |
| 51 | |
| 52 | struct i802_bss { |
| 53 | struct wpa_driver_nl80211_data *drv; |
| 54 | struct i802_bss *next; |
| 55 | int ifindex; |
| 56 | int br_ifindex; |
| 57 | u64 wdev_id; |
| 58 | char ifname[IFNAMSIZ + 1]; |
| 59 | char brname[IFNAMSIZ]; |
| 60 | unsigned int beacon_set:1; |
| 61 | unsigned int added_if_into_bridge:1; |
Hai Shalom | c9e41a1 | 2018-07-31 14:41:42 -0700 | [diff] [blame] | 62 | unsigned int already_in_bridge:1; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 63 | unsigned int added_bridge:1; |
| 64 | unsigned int in_deinit:1; |
| 65 | unsigned int wdev_id_set:1; |
| 66 | unsigned int added_if:1; |
| 67 | unsigned int static_ap:1; |
Hai Shalom | 74f70d4 | 2019-02-11 14:42:39 -0800 | [diff] [blame] | 68 | unsigned int use_nl_connect:1; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 69 | |
| 70 | u8 addr[ETH_ALEN]; |
| 71 | |
| 72 | int freq; |
| 73 | int bandwidth; |
| 74 | int if_dynamic; |
| 75 | |
| 76 | void *ctx; |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 77 | struct nl_sock *nl_preq, *nl_mgmt, *nl_connect; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 78 | struct nl_cb *nl_cb; |
| 79 | |
| 80 | struct nl80211_wiphy_data *wiphy_data; |
| 81 | struct dl_list wiphy_list; |
Dmitry Shmidt | ebd93af | 2017-02-21 13:40:44 -0800 | [diff] [blame] | 82 | u8 rand_addr[ETH_ALEN]; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 83 | }; |
| 84 | |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 85 | struct drv_nl80211_if_info { |
| 86 | int ifindex; |
| 87 | /* the AP/AP_VLAN iface that is in this bridge */ |
| 88 | int reason; |
| 89 | }; |
| 90 | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 91 | struct wpa_driver_nl80211_data { |
| 92 | struct nl80211_global *global; |
| 93 | struct dl_list list; |
| 94 | struct dl_list wiphy_list; |
| 95 | char phyname[32]; |
Dmitry Shmidt | 7d56b75 | 2015-12-22 10:59:44 -0800 | [diff] [blame] | 96 | unsigned int wiphy_idx; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 97 | u8 perm_addr[ETH_ALEN]; |
| 98 | void *ctx; |
| 99 | int ifindex; |
| 100 | int if_removed; |
| 101 | int if_disabled; |
| 102 | int ignore_if_down_event; |
| 103 | struct rfkill_data *rfkill; |
| 104 | struct wpa_driver_capa capa; |
| 105 | u8 *extended_capa, *extended_capa_mask; |
| 106 | unsigned int extended_capa_len; |
Dmitry Shmidt | d5ab1b5 | 2016-06-21 12:38:41 -0700 | [diff] [blame] | 107 | struct drv_nl80211_ext_capa { |
| 108 | enum nl80211_iftype iftype; |
| 109 | u8 *ext_capa, *ext_capa_mask; |
| 110 | unsigned int ext_capa_len; |
| 111 | } iface_ext_capa[NL80211_IFTYPE_MAX]; |
| 112 | unsigned int num_iface_ext_capa; |
| 113 | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 114 | int has_capability; |
Hai Shalom | 4fbc08f | 2020-05-18 12:37:00 -0700 | [diff] [blame] | 115 | int has_driver_key_mgmt; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 116 | |
| 117 | int operstate; |
| 118 | |
| 119 | int scan_complete_events; |
| 120 | enum scan_states { |
| 121 | NO_SCAN, SCAN_REQUESTED, SCAN_STARTED, SCAN_COMPLETED, |
| 122 | SCAN_ABORTED, SCHED_SCAN_STARTED, SCHED_SCAN_STOPPED, |
| 123 | SCHED_SCAN_RESULTS |
| 124 | } scan_state; |
| 125 | |
| 126 | u8 auth_bssid[ETH_ALEN]; |
| 127 | u8 auth_attempt_bssid[ETH_ALEN]; |
| 128 | u8 bssid[ETH_ALEN]; |
| 129 | u8 prev_bssid[ETH_ALEN]; |
| 130 | int associated; |
Sunil Ravi | 89eba10 | 2022-09-13 21:04:37 -0700 | [diff] [blame^] | 131 | int mlo_assoc_link_id; |
| 132 | struct driver_sta_mlo_info sta_mlo_info; |
Dmitry Shmidt | 9d9e602 | 2015-04-23 10:34:55 -0700 | [diff] [blame] | 133 | u8 ssid[SSID_MAX_LEN]; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 134 | size_t ssid_len; |
| 135 | enum nl80211_iftype nlmode; |
| 136 | enum nl80211_iftype ap_scan_as_station; |
| 137 | unsigned int assoc_freq; |
| 138 | |
| 139 | int monitor_sock; |
| 140 | int monitor_ifidx; |
| 141 | int monitor_refcount; |
| 142 | |
| 143 | unsigned int disabled_11b_rates:1; |
| 144 | unsigned int pending_remain_on_chan:1; |
| 145 | unsigned int in_interface_list:1; |
| 146 | unsigned int device_ap_sme:1; |
| 147 | unsigned int poll_command_supported:1; |
| 148 | unsigned int data_tx_status:1; |
| 149 | unsigned int scan_for_auth:1; |
| 150 | unsigned int retry_auth:1; |
| 151 | unsigned int use_monitor:1; |
| 152 | unsigned int ignore_next_local_disconnect:1; |
| 153 | unsigned int ignore_next_local_deauth:1; |
| 154 | unsigned int hostapd:1; |
Hai Shalom | c1a2144 | 2022-02-04 13:43:00 -0800 | [diff] [blame] | 155 | unsigned int start_mode_sta:1; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 156 | unsigned int start_iface_up:1; |
| 157 | unsigned int test_use_roc_tx:1; |
| 158 | unsigned int ignore_deauth_event:1; |
Dmitry Shmidt | 7f65602 | 2015-02-25 14:36:37 -0800 | [diff] [blame] | 159 | unsigned int vendor_cmd_test_avail:1; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 160 | unsigned int roaming_vendor_cmd_avail:1; |
| 161 | unsigned int dfs_vendor_cmd_avail:1; |
| 162 | unsigned int have_low_prio_scan:1; |
| 163 | unsigned int force_connect_cmd:1; |
| 164 | unsigned int addr_changed:1; |
| 165 | unsigned int get_features_vendor_cmd_avail:1; |
Dmitry Shmidt | ff787d5 | 2015-01-12 13:01:47 -0800 | [diff] [blame] | 166 | unsigned int set_rekey_offload:1; |
Dmitry Shmidt | 7f65602 | 2015-02-25 14:36:37 -0800 | [diff] [blame] | 167 | unsigned int p2p_go_ctwindow_supported:1; |
Ravi Joshi | e6ccb16 | 2015-07-16 17:45:41 -0700 | [diff] [blame] | 168 | unsigned int setband_vendor_cmd_avail:1; |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 169 | unsigned int get_pref_freq_list:1; |
| 170 | unsigned int set_prob_oper_freq:1; |
| 171 | unsigned int scan_vendor_cmd_avail:1; |
Dmitry Shmidt | e466304 | 2016-04-04 10:07:49 -0700 | [diff] [blame] | 172 | unsigned int connect_reassoc:1; |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 173 | unsigned int set_wifi_conf_vendor_cmd_avail:1; |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 174 | unsigned int fetch_bss_trans_status:1; |
| 175 | unsigned int roam_vendor_cmd_avail:1; |
Hai Shalom | c356592 | 2019-10-28 11:58:20 -0700 | [diff] [blame] | 176 | unsigned int add_sta_node_vendor_cmd_avail:1; |
Hai Shalom | b755a2a | 2020-04-23 21:49:02 -0700 | [diff] [blame] | 177 | unsigned int control_port_ap:1; |
Hai Shalom | e21d4e8 | 2020-04-29 16:34:06 -0700 | [diff] [blame] | 178 | unsigned int multicast_registrations:1; |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame] | 179 | unsigned int no_rrm:1; |
Hai Shalom | 6084025 | 2021-02-19 19:02:11 -0800 | [diff] [blame] | 180 | unsigned int get_sta_info_vendor_cmd_avail:1; |
| 181 | unsigned int fils_discovery:1; |
| 182 | unsigned int unsol_bcast_probe_resp:1; |
Hai Shalom | c1a2144 | 2022-02-04 13:43:00 -0800 | [diff] [blame] | 183 | unsigned int qca_do_acs:1; |
| 184 | unsigned int brcm_do_acs:1; |
Sunil Ravi | 89eba10 | 2022-09-13 21:04:37 -0700 | [diff] [blame^] | 185 | unsigned int uses_6ghz:1; |
| 186 | unsigned int secure_ranging_ctx_vendor_cmd_avail:1; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 187 | |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 188 | u64 vendor_scan_cookie; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 189 | u64 remain_on_chan_cookie; |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 190 | u64 send_frame_cookie; |
| 191 | #define MAX_SEND_FRAME_COOKIES 20 |
| 192 | u64 send_frame_cookies[MAX_SEND_FRAME_COOKIES]; |
| 193 | unsigned int num_send_frame_cookies; |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame] | 194 | u64 eapol_tx_cookie; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 195 | |
| 196 | unsigned int last_mgmt_freq; |
| 197 | |
| 198 | struct wpa_driver_scan_filter *filter_ssids; |
| 199 | size_t num_filter_ssids; |
| 200 | |
| 201 | struct i802_bss *first_bss; |
| 202 | |
| 203 | int eapol_tx_sock; |
| 204 | |
| 205 | int eapol_sock; /* socket for EAPOL frames */ |
| 206 | |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 207 | struct nl_sock *rtnl_sk; /* nl_sock for NETLINK_ROUTE */ |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 208 | |
Hai Shalom | 81f62d8 | 2019-07-22 12:10:00 -0700 | [diff] [blame] | 209 | struct drv_nl80211_if_info default_if_indices[16]; |
| 210 | struct drv_nl80211_if_info *if_indices; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 211 | int num_if_indices; |
| 212 | |
| 213 | /* From failed authentication command */ |
| 214 | int auth_freq; |
| 215 | u8 auth_bssid_[ETH_ALEN]; |
Dmitry Shmidt | 9d9e602 | 2015-04-23 10:34:55 -0700 | [diff] [blame] | 216 | u8 auth_ssid[SSID_MAX_LEN]; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 217 | size_t auth_ssid_len; |
| 218 | int auth_alg; |
| 219 | u8 *auth_ie; |
| 220 | size_t auth_ie_len; |
Hai Shalom | 6084025 | 2021-02-19 19:02:11 -0800 | [diff] [blame] | 221 | u8 *auth_data; |
| 222 | size_t auth_data_len; |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 223 | u8 auth_wep_key[4][16]; |
| 224 | size_t auth_wep_key_len[4]; |
| 225 | int auth_wep_tx_keyidx; |
| 226 | int auth_local_state_change; |
| 227 | int auth_p2p; |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 228 | |
| 229 | /* |
| 230 | * Tells whether the last scan issued from wpa_supplicant was a normal |
| 231 | * scan (NL80211_CMD_TRIGGER_SCAN) or a vendor scan |
| 232 | * (NL80211_CMD_VENDOR). 0 if no pending scan request. |
| 233 | */ |
| 234 | int last_scan_cmd; |
Andy Kuo | aba17c1 | 2022-04-14 16:05:31 +0800 | [diff] [blame] | 235 | #if defined(CONFIG_DRIVER_NL80211_BRCM) || defined(CONFIG_DRIVER_NL80211_SYNA) |
Mir Ali | 677e748 | 2020-11-12 19:49:02 +0530 | [diff] [blame] | 236 | unsigned int vendor_set_pmk:1; /* for legacy set_pmk method before NL80211_CMD_SET_PMK */ |
Andy Kuo | aba17c1 | 2022-04-14 16:05:31 +0800 | [diff] [blame] | 237 | #endif /* CONFIG_DRIVER_NL80211_BRCM || CONFIG_DRIVER_NL80211_SYNA */ |
Hai Shalom | 6084025 | 2021-02-19 19:02:11 -0800 | [diff] [blame] | 238 | #ifdef CONFIG_DRIVER_NL80211_QCA |
| 239 | bool roam_indication_done; |
| 240 | u8 *pending_roam_data; |
| 241 | size_t pending_roam_data_len; |
Hai Shalom | 6084025 | 2021-02-19 19:02:11 -0800 | [diff] [blame] | 242 | #endif /* CONFIG_DRIVER_NL80211_QCA */ |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 243 | }; |
| 244 | |
| 245 | struct nl_msg; |
| 246 | |
| 247 | void * nl80211_cmd(struct wpa_driver_nl80211_data *drv, |
| 248 | struct nl_msg *msg, int flags, uint8_t cmd); |
| 249 | struct nl_msg * nl80211_cmd_msg(struct i802_bss *bss, int flags, uint8_t cmd); |
| 250 | struct nl_msg * nl80211_drv_msg(struct wpa_driver_nl80211_data *drv, int flags, |
| 251 | uint8_t cmd); |
| 252 | struct nl_msg * nl80211_bss_msg(struct i802_bss *bss, int flags, uint8_t cmd); |
| 253 | int send_and_recv_msgs(struct wpa_driver_nl80211_data *drv, struct nl_msg *msg, |
| 254 | int (*valid_handler)(struct nl_msg *, void *), |
Hai Shalom | 899fcc7 | 2020-10-19 14:38:18 -0700 | [diff] [blame] | 255 | void *valid_data, |
| 256 | int (*ack_handler_custom)(struct nl_msg *, void *), |
| 257 | void *ack_data); |
Hai Shalom | b755a2a | 2020-04-23 21:49:02 -0700 | [diff] [blame] | 258 | struct nl_sock * get_connect_handle(struct i802_bss *bss); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 259 | int nl80211_create_iface(struct wpa_driver_nl80211_data *drv, |
| 260 | const char *ifname, enum nl80211_iftype iftype, |
| 261 | const u8 *addr, int wds, |
| 262 | int (*handler)(struct nl_msg *, void *), |
| 263 | void *arg, int use_existing); |
| 264 | void nl80211_remove_iface(struct wpa_driver_nl80211_data *drv, int ifidx); |
| 265 | unsigned int nl80211_get_assoc_freq(struct wpa_driver_nl80211_data *drv); |
Dmitry Shmidt | abb90a3 | 2016-12-05 15:34:39 -0800 | [diff] [blame] | 266 | int nl80211_get_assoc_ssid(struct wpa_driver_nl80211_data *drv, u8 *ssid); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 267 | enum chan_width convert2width(int width); |
| 268 | void nl80211_mark_disconnected(struct wpa_driver_nl80211_data *drv); |
| 269 | struct i802_bss * get_bss_ifindex(struct wpa_driver_nl80211_data *drv, |
| 270 | int ifindex); |
| 271 | int is_ap_interface(enum nl80211_iftype nlmode); |
| 272 | int is_sta_interface(enum nl80211_iftype nlmode); |
| 273 | int wpa_driver_nl80211_authenticate_retry(struct wpa_driver_nl80211_data *drv); |
| 274 | int nl80211_get_link_signal(struct wpa_driver_nl80211_data *drv, |
Sunil Ravi | 89eba10 | 2022-09-13 21:04:37 -0700 | [diff] [blame^] | 275 | const u8 *bssid, struct wpa_signal_info *sig); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 276 | int nl80211_get_link_noise(struct wpa_driver_nl80211_data *drv, |
| 277 | struct wpa_signal_info *sig_change); |
| 278 | int nl80211_get_wiphy_index(struct i802_bss *bss); |
| 279 | int wpa_driver_nl80211_set_mode(struct i802_bss *bss, |
| 280 | enum nl80211_iftype nlmode); |
| 281 | int wpa_driver_nl80211_mlme(struct wpa_driver_nl80211_data *drv, |
| 282 | const u8 *addr, int cmd, u16 reason_code, |
Hai Shalom | 74f70d4 | 2019-02-11 14:42:39 -0800 | [diff] [blame] | 283 | int local_state_change, |
Hai Shalom | c1a2144 | 2022-02-04 13:43:00 -0800 | [diff] [blame] | 284 | struct i802_bss *bss); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 285 | |
| 286 | int nl80211_create_monitor_interface(struct wpa_driver_nl80211_data *drv); |
| 287 | void nl80211_remove_monitor_interface(struct wpa_driver_nl80211_data *drv); |
| 288 | int nl80211_send_monitor(struct wpa_driver_nl80211_data *drv, |
| 289 | const void *data, size_t len, |
| 290 | int encrypt, int noack); |
| 291 | |
| 292 | int wpa_driver_nl80211_capa(struct wpa_driver_nl80211_data *drv); |
| 293 | struct hostapd_hw_modes * |
Dmitry Shmidt | d2986c2 | 2017-10-23 14:22:09 -0700 | [diff] [blame] | 294 | nl80211_get_hw_feature_data(void *priv, u16 *num_modes, u16 *flags, |
| 295 | u8 *dfs_domain); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 296 | |
| 297 | int process_global_event(struct nl_msg *msg, void *arg); |
| 298 | int process_bss_event(struct nl_msg *msg, void *arg); |
| 299 | |
Dmitry Shmidt | d5ab1b5 | 2016-06-21 12:38:41 -0700 | [diff] [blame] | 300 | const char * nl80211_iftype_str(enum nl80211_iftype mode); |
| 301 | |
Hai Shalom | 4fbc08f | 2020-05-18 12:37:00 -0700 | [diff] [blame] | 302 | void nl80211_restore_ap_mode(struct i802_bss *bss); |
| 303 | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 304 | #ifdef ANDROID |
Hai Shalom | fdcde76 | 2020-04-02 11:19:20 -0700 | [diff] [blame] | 305 | int android_nl_socket_set_nonblocking(struct nl_sock *handle); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 306 | int android_pno_start(struct i802_bss *bss, |
| 307 | struct wpa_driver_scan_params *params); |
| 308 | int android_pno_stop(struct i802_bss *bss); |
| 309 | extern int wpa_driver_nl80211_driver_cmd(void *priv, char *cmd, char *buf, |
| 310 | size_t buf_len); |
Hai Shalom | 6084025 | 2021-02-19 19:02:11 -0800 | [diff] [blame] | 311 | extern int wpa_driver_nl80211_driver_event(struct wpa_driver_nl80211_data *drv, |
| 312 | u32 vendor_id, u32 subcmd, |
| 313 | u8 *data, size_t len); |
| 314 | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 315 | |
| 316 | #ifdef ANDROID_P2P |
| 317 | int wpa_driver_set_p2p_noa(void *priv, u8 count, int start, int duration); |
| 318 | int wpa_driver_get_p2p_noa(void *priv, u8 *buf, size_t len); |
| 319 | int wpa_driver_set_p2p_ps(void *priv, int legacy_ps, int opp_ps, int ctwindow); |
| 320 | int wpa_driver_set_ap_wps_p2p_ie(void *priv, const struct wpabuf *beacon, |
| 321 | const struct wpabuf *proberesp, |
| 322 | const struct wpabuf *assocresp); |
| 323 | #endif /* ANDROID_P2P */ |
| 324 | #endif /* ANDROID */ |
| 325 | |
| 326 | |
| 327 | /* driver_nl80211_scan.c */ |
| 328 | |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 329 | void wpa_driver_nl80211_scan_timeout(void *eloop_ctx, void *timeout_ctx); |
| 330 | int wpa_driver_nl80211_scan(struct i802_bss *bss, |
| 331 | struct wpa_driver_scan_params *params); |
| 332 | int wpa_driver_nl80211_sched_scan(void *priv, |
Dmitry Shmidt | d7ff03d | 2015-12-04 14:49:35 -0800 | [diff] [blame] | 333 | struct wpa_driver_scan_params *params); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 334 | int wpa_driver_nl80211_stop_sched_scan(void *priv); |
| 335 | struct wpa_scan_results * wpa_driver_nl80211_get_scan_results(void *priv); |
| 336 | void nl80211_dump_scan(struct wpa_driver_nl80211_data *drv); |
Dmitry Shmidt | abb90a3 | 2016-12-05 15:34:39 -0800 | [diff] [blame] | 337 | int wpa_driver_nl80211_abort_scan(void *priv, u64 scan_cookie); |
Dmitry Shmidt | d80a401 | 2015-11-05 16:35:40 -0800 | [diff] [blame] | 338 | int wpa_driver_nl80211_vendor_scan(struct i802_bss *bss, |
| 339 | struct wpa_driver_scan_params *params); |
Dmitry Shmidt | 7f2c753 | 2016-08-15 09:48:12 -0700 | [diff] [blame] | 340 | int nl80211_set_default_scan_ies(void *priv, const u8 *ies, size_t ies_len); |
Dmitry Shmidt | 6c0da2b | 2015-01-05 13:08:17 -0800 | [diff] [blame] | 341 | |
| 342 | #endif /* DRIVER_NL80211_H */ |