2014-07-29 21:25:01 +02:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* Wireless daemon for Linux
|
|
|
|
*
|
2019-10-25 00:43:08 +02:00
|
|
|
* Copyright (C) 2013-2019 Intel Corporation. All rights reserved.
|
2014-07-29 21:25:01 +02:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2014-08-07 08:52:42 +02:00
|
|
|
#include <stdint.h>
|
2014-07-29 21:25:01 +02:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2016-05-16 19:21:26 +02:00
|
|
|
struct wiphy;
|
2017-01-20 06:49:40 +01:00
|
|
|
struct scan_bss;
|
2019-04-11 21:14:27 +02:00
|
|
|
struct scan_freq_set;
|
2020-07-09 02:04:32 +02:00
|
|
|
struct wiphy_radio_work_item;
|
2021-07-27 20:59:52 +02:00
|
|
|
struct ie_rsn_info;
|
2022-12-16 22:27:35 +01:00
|
|
|
struct band_freq_attrs;
|
2021-07-27 20:59:52 +02:00
|
|
|
enum security;
|
2022-12-09 20:39:27 +01:00
|
|
|
enum band_freq;
|
2020-07-09 02:04:32 +02:00
|
|
|
|
|
|
|
typedef bool (*wiphy_radio_work_func_t)(struct wiphy_radio_work_item *item);
|
|
|
|
typedef void (*wiphy_radio_work_destroy_func_t)(
|
|
|
|
struct wiphy_radio_work_item *item);
|
|
|
|
|
|
|
|
struct wiphy_radio_work_item_ops {
|
|
|
|
wiphy_radio_work_func_t do_work;
|
|
|
|
wiphy_radio_work_destroy_func_t destroy;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wiphy_radio_work_item {
|
|
|
|
uint32_t id;
|
|
|
|
int priority;
|
|
|
|
const struct wiphy_radio_work_item_ops *ops;
|
|
|
|
};
|
2014-10-24 04:47:38 +02:00
|
|
|
|
2022-03-02 20:55:26 +01:00
|
|
|
enum {
|
2022-09-22 00:31:46 +02:00
|
|
|
WIPHY_WORK_PRIORITY_FT = 0,
|
|
|
|
WIPHY_WORK_PRIORITY_FRAME = 1,
|
|
|
|
WIPHY_WORK_PRIORITY_OFFCHANNEL = 1,
|
|
|
|
WIPHY_WORK_PRIORITY_CONNECT = 2,
|
|
|
|
WIPHY_WORK_PRIORITY_SCAN = 3,
|
|
|
|
WIPHY_WORK_PRIORITY_PERIODIC_SCAN = 4,
|
2022-03-02 20:55:26 +01:00
|
|
|
};
|
2022-01-11 18:45:09 +01:00
|
|
|
|
2018-11-29 18:22:50 +01:00
|
|
|
enum wiphy_state_watch_event {
|
|
|
|
WIPHY_STATE_WATCH_EVENT_POWERED,
|
|
|
|
WIPHY_STATE_WATCH_EVENT_RFKILLED,
|
2022-08-03 23:36:37 +02:00
|
|
|
WIPHY_STATE_WATCH_EVENT_REGDOM_STARTED,
|
|
|
|
WIPHY_STATE_WATCH_EVENT_REGDOM_DONE,
|
2018-11-29 18:22:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef void (*wiphy_state_watch_func_t)(struct wiphy *wiphy,
|
|
|
|
enum wiphy_state_watch_event event,
|
|
|
|
void *user_data);
|
|
|
|
typedef void (*wiphy_destroy_func_t)(void *user_data);
|
|
|
|
|
2016-05-16 19:21:26 +02:00
|
|
|
enum ie_rsn_cipher_suite wiphy_select_cipher(struct wiphy *wiphy,
|
|
|
|
uint16_t mask);
|
2022-11-02 23:51:06 +01:00
|
|
|
uint16_t wiphy_get_supported_ciphers(struct wiphy *wiphy, uint16_t mask);
|
|
|
|
|
2018-09-24 23:29:53 +02:00
|
|
|
enum ie_rsn_akm_suite wiphy_select_akm(struct wiphy *wiphy,
|
2021-07-27 20:59:52 +02:00
|
|
|
const struct scan_bss *bss,
|
|
|
|
enum security security,
|
|
|
|
const struct ie_rsn_info *info,
|
2019-04-19 21:59:03 +02:00
|
|
|
bool fils_capable_hint);
|
2016-05-16 19:21:26 +02:00
|
|
|
|
2016-06-01 22:20:33 +02:00
|
|
|
struct wiphy *wiphy_find(int wiphy_id);
|
2022-03-02 20:57:00 +01:00
|
|
|
static inline struct wiphy *wiphy_find_by_wdev(uint64_t w)
|
|
|
|
{
|
|
|
|
return wiphy_find(w >> 32);
|
|
|
|
}
|
2020-07-02 19:35:27 +02:00
|
|
|
|
2020-02-03 23:25:07 +01:00
|
|
|
bool wiphy_is_blacklisted(const struct wiphy *wiphy);
|
2016-06-01 22:20:33 +02:00
|
|
|
|
2019-04-11 03:10:23 +02:00
|
|
|
struct wiphy *wiphy_create(uint32_t wiphy_id, const char *name);
|
2020-02-03 23:25:07 +01:00
|
|
|
void wiphy_update_name(struct wiphy *wiphy, const char *name);
|
2019-04-20 22:29:06 +02:00
|
|
|
void wiphy_create_complete(struct wiphy *wiphy);
|
2019-04-11 03:10:23 +02:00
|
|
|
bool wiphy_destroy(struct wiphy *wiphy);
|
2020-02-03 23:25:07 +01:00
|
|
|
void wiphy_update_from_genl(struct wiphy *wiphy, struct l_genl_msg *msg);
|
2019-04-11 03:10:23 +02:00
|
|
|
|
2019-04-11 21:14:27 +02:00
|
|
|
bool wiphy_constrain_freq_set(const struct wiphy *wiphy,
|
|
|
|
struct scan_freq_set *set);
|
|
|
|
|
2020-02-04 00:37:08 +01:00
|
|
|
uint32_t wiphy_get_id(struct wiphy *wiphy);
|
2016-07-12 04:13:54 +02:00
|
|
|
const char *wiphy_get_path(struct wiphy *wiphy);
|
2016-09-13 21:36:46 +02:00
|
|
|
uint32_t wiphy_get_supported_bands(struct wiphy *wiphy);
|
2019-02-28 01:44:17 +01:00
|
|
|
const struct scan_freq_set *wiphy_get_supported_freqs(
|
|
|
|
const struct wiphy *wiphy);
|
2022-12-16 22:27:35 +01:00
|
|
|
|
2022-12-16 22:27:38 +01:00
|
|
|
const struct band_freq_attrs *wiphy_get_frequency_info(
|
|
|
|
const struct wiphy *wiphy,
|
|
|
|
uint32_t freq);
|
2022-12-30 23:12:13 +01:00
|
|
|
const struct band_freq_attrs *wiphy_get_frequency_info_list(
|
|
|
|
const struct wiphy *wiphy,
|
|
|
|
enum band_freq band,
|
|
|
|
size_t *size);
|
|
|
|
|
2023-09-29 18:19:57 +02:00
|
|
|
int wiphy_band_is_disabled(const struct wiphy *wiphy, enum band_freq band);
|
2022-12-16 22:27:38 +01:00
|
|
|
|
2022-09-28 21:48:51 +02:00
|
|
|
bool wiphy_supports_probe_resp_offload(struct wiphy *wiphy);
|
2021-07-27 19:59:03 +02:00
|
|
|
bool wiphy_can_transition_disable(struct wiphy *wiphy);
|
2021-10-19 23:52:46 +02:00
|
|
|
bool wiphy_can_offload(struct wiphy *wiphy);
|
2021-03-22 17:01:51 +01:00
|
|
|
bool wiphy_supports_cmds_auth_assoc(struct wiphy *wiphy);
|
2019-01-16 04:14:54 +01:00
|
|
|
bool wiphy_can_randomize_mac_addr(struct wiphy *wiphy);
|
2019-07-10 23:23:13 +02:00
|
|
|
bool wiphy_rrm_capable(struct wiphy *wiphy);
|
2021-10-04 18:48:52 +02:00
|
|
|
bool wiphy_supports_ext_key_id(struct wiphy *wiphy);
|
2018-05-24 19:12:10 +02:00
|
|
|
bool wiphy_has_feature(struct wiphy *wiphy, uint32_t feature);
|
2018-05-24 20:12:36 +02:00
|
|
|
bool wiphy_has_ext_feature(struct wiphy *wiphy, uint32_t feature);
|
2018-05-09 00:54:40 +02:00
|
|
|
uint8_t wiphy_get_max_num_ssids_per_scan(struct wiphy *wiphy);
|
2019-11-06 23:16:23 +01:00
|
|
|
uint16_t wiphy_get_max_scan_ie_len(struct wiphy *wiphy);
|
2019-10-21 15:55:09 +02:00
|
|
|
uint32_t wiphy_get_max_roc_duration(struct wiphy *wiphy);
|
2018-08-07 18:53:31 +02:00
|
|
|
bool wiphy_supports_iftype(struct wiphy *wiphy, uint32_t iftype);
|
2022-12-09 20:39:27 +01:00
|
|
|
const uint8_t *wiphy_get_supported_rates(struct wiphy *wiphy,
|
|
|
|
enum band_freq band,
|
2019-10-28 15:04:53 +01:00
|
|
|
unsigned int *out_num);
|
2019-09-14 00:26:30 +02:00
|
|
|
bool wiphy_supports_qos_set_map(struct wiphy *wiphy);
|
2021-03-15 18:29:30 +01:00
|
|
|
bool wiphy_supports_firmware_roam(struct wiphy *wiphy);
|
2019-05-08 03:15:26 +02:00
|
|
|
const char *wiphy_get_driver(struct wiphy *wiphy);
|
2019-07-02 01:28:07 +02:00
|
|
|
const char *wiphy_get_name(struct wiphy *wiphy);
|
2021-10-01 15:49:07 +02:00
|
|
|
bool wiphy_uses_default_if(struct wiphy *wiphy);
|
2021-10-07 22:49:45 +02:00
|
|
|
bool wiphy_control_port_enabled(struct wiphy *wiphy);
|
2023-06-15 21:24:12 +02:00
|
|
|
bool wiphy_power_save_disabled(struct wiphy *wiphy);
|
2024-10-23 20:29:09 +02:00
|
|
|
bool wiphy_owe_disabled(struct wiphy *wiphy);
|
2019-07-10 17:53:07 +02:00
|
|
|
const uint8_t *wiphy_get_extended_capabilities(struct wiphy *wiphy,
|
|
|
|
uint32_t iftype);
|
2019-08-23 15:55:54 +02:00
|
|
|
const uint8_t *wiphy_get_rm_enabled_capabilities(struct wiphy *wiphy);
|
2021-07-13 21:43:52 +02:00
|
|
|
bool wiphy_get_rsnxe(const struct wiphy *wiphy, uint8_t *buf, size_t len);
|
2020-04-23 18:24:35 +02:00
|
|
|
void wiphy_get_reg_domain_country(struct wiphy *wiphy, char *out);
|
2022-08-03 23:36:40 +02:00
|
|
|
bool wiphy_country_is_unknown(struct wiphy *wiphy);
|
2022-12-20 22:43:15 +01:00
|
|
|
bool wiphy_supports_uapsd(const struct wiphy *wiphy);
|
2024-08-29 13:41:00 +02:00
|
|
|
bool wiphy_supports_cmd_offchannel(const struct wiphy *wiphy);
|
2018-08-07 18:15:23 +02:00
|
|
|
|
2022-12-20 22:43:12 +01:00
|
|
|
const uint8_t *wiphy_get_ht_capabilities(const struct wiphy *wiphy,
|
|
|
|
enum band_freq band,
|
|
|
|
size_t *size);
|
2019-07-02 01:28:26 +02:00
|
|
|
void wiphy_generate_random_address(struct wiphy *wiphy, uint8_t addr[static 6]);
|
2023-11-27 05:38:45 +01:00
|
|
|
void wiphy_generate_address_from_ssid(struct wiphy *wiphy,
|
|
|
|
const uint8_t *ssid, size_t ssid_len,
|
2020-03-18 19:54:17 +01:00
|
|
|
uint8_t addr[static 6]);
|
2019-07-02 01:28:26 +02:00
|
|
|
|
2021-05-28 23:06:26 +02:00
|
|
|
int wiphy_estimate_data_rate(struct wiphy *wiphy,
|
|
|
|
const void *ies, uint16_t ies_len,
|
|
|
|
const struct scan_bss *bss,
|
|
|
|
uint64_t *out_data_rate);
|
2022-08-04 20:51:08 +02:00
|
|
|
bool wiphy_regdom_is_updating(struct wiphy *wiphy);
|
2021-05-28 23:06:26 +02:00
|
|
|
|
2018-11-29 18:22:50 +01:00
|
|
|
uint32_t wiphy_state_watch_add(struct wiphy *wiphy,
|
|
|
|
wiphy_state_watch_func_t func, void *user_data,
|
|
|
|
wiphy_destroy_func_t destroy);
|
|
|
|
bool wiphy_state_watch_remove(struct wiphy *wiphy, uint32_t id);
|
2020-07-09 02:04:32 +02:00
|
|
|
|
|
|
|
uint32_t wiphy_radio_work_insert(struct wiphy *wiphy,
|
|
|
|
struct wiphy_radio_work_item *item,
|
|
|
|
int priority,
|
|
|
|
const struct wiphy_radio_work_item_ops *ops);
|
|
|
|
void wiphy_radio_work_done(struct wiphy *wiphy, uint32_t id);
|
2021-12-06 21:17:25 +01:00
|
|
|
int wiphy_radio_work_is_running(struct wiphy *wiphy, uint32_t id);
|
2023-05-18 18:49:59 +02:00
|
|
|
uint32_t wiphy_radio_work_reschedule(struct wiphy *wiphy,
|
|
|
|
struct wiphy_radio_work_item *item);
|