Revert "[wpa_supplicant] Cumulative patch from c4e90da6d"
This reverts commit 39bc25d3a79c1375de430a7918d949c1a86f70c6.
Test: Compilation
Change-Id: Iae7670429466958911b5296cb1359bceecc0b03e
Exempt-From-Owner-Approval: Revert since it's breaking the build
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 23423d9..d34c679 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -58,16 +58,6 @@
#define HOSTAPD_CHAN_VHT_130_30 0x04000000
#define HOSTAPD_CHAN_VHT_150_10 0x08000000
-/* Allowed bandwidth mask */
-enum hostapd_chan_width_attr {
- HOSTAPD_CHAN_WIDTH_10 = BIT(0),
- HOSTAPD_CHAN_WIDTH_20 = BIT(1),
- HOSTAPD_CHAN_WIDTH_40P = BIT(2),
- HOSTAPD_CHAN_WIDTH_40M = BIT(3),
- HOSTAPD_CHAN_WIDTH_80 = BIT(4),
- HOSTAPD_CHAN_WIDTH_160 = BIT(5),
-};
-
/* Filter gratuitous ARP */
#define WPA_DATA_FRAME_FILTER_FLAG_ARP BIT(0)
/* Filter unsolicited Neighbor Advertisement */
@@ -121,13 +111,6 @@
int flag;
/**
- * allowed_bw - Allowed channel width bitmask
- *
- * See enum hostapd_chan_width_attr.
- */
- u32 allowed_bw;
-
- /**
* max_tx_power - Regulatory transmit power limit in dBm
*/
u8 max_tx_power;
@@ -931,10 +914,10 @@
* passphrase - RSN passphrase for PSK
*
* This value is made available only for WPA/WPA2-Personal (PSK) and
- * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
- * is the 8..63 character ASCII passphrase, if available. Please note
- * that this can be %NULL if passphrase was not used to generate the
- * PSK. In that case, the psk field must be used to fetch the PSK.
+ * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
+ * the 8..63 character ASCII passphrase, if available. Please note that
+ * this can be %NULL if passphrase was not used to generate the PSK. In
+ * that case, the psk field must be used to fetch the PSK.
*/
const char *passphrase;
@@ -942,9 +925,9 @@
* psk - RSN PSK (alternative for passphrase for PSK)
*
* This value is made available only for WPA/WPA2-Personal (PSK) and
- * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK. This
- * is the 32-octet (256-bit) PSK, if available. The driver wrapper
- * should be prepared to handle %NULL value as an error.
+ * only for drivers that set WPA_DRIVER_FLAGS_4WAY_HANDSHAKE. This is
+ * the 32-octet (256-bit) PSK, if available. The driver wrapper should
+ * be prepared to handle %NULL value as an error.
*/
const u8 *psk;
@@ -1384,23 +1367,6 @@
* service).
*/
int multicast_to_unicast;
-
- /**
- * ftm_responder - Whether FTM responder is enabled
- */
- int ftm_responder;
-
- /**
- * lci - Binary data, the content of an LCI report IE with type 8 as
- * defined in IEEE Std 802.11-2016, 9.4.2.22.10
- */
- const struct wpabuf *lci;
-
- /**
- * civic - Binary data, the content of a measurement report IE with
- * type 11 as defined in IEEE Std 802.11-2016, 9.4.2.22.13
- */
- const struct wpabuf *civic;
};
struct wpa_driver_mesh_bss_params {
@@ -1458,7 +1424,6 @@
#define WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 0x00002000
#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 0x00004000
#define WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 0x00008000
-#define WPA_DRIVER_CAPA_KEY_MGMT_SAE 0x00010000
/** Bitfield of supported key management suites */
unsigned int key_mgmt;
@@ -1492,7 +1457,7 @@
#define WPA_DRIVER_FLAGS_DFS_OFFLOAD 0x00000004
/** Driver takes care of RSN 4-way handshake internally; PMK is configured with
* struct wpa_driver_ops::set_key using alg = WPA_ALG_PMK */
-#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X 0x00000008
+#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE 0x00000008
/** Driver is for a wired Ethernet interface */
#define WPA_DRIVER_FLAGS_WIRED 0x00000010
/** Driver provides separate commands for authentication and association (SME in
@@ -1614,10 +1579,6 @@
#define WPA_DRIVER_FLAGS_MFP_OPTIONAL 0x0040000000000000ULL
/** Driver is a self-managed regulatory device */
#define WPA_DRIVER_FLAGS_SELF_MANAGED_REGULATORY 0x0080000000000000ULL
-/** Driver supports FTM responder functionality */
-#define WPA_DRIVER_FLAGS_FTM_RESPONDER 0x0100000000000000ULL
-/** Driver support 4-way handshake offload for WPA-Personal */
-#define WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK 0x0200000000000000ULL
u64 flags;
#define FULL_AP_CLIENT_STATE_SUPP(drv_flags) \
@@ -1941,21 +1902,19 @@
SMPS_INVALID,
};
-#define WPA_INVALID_NOISE 9999
+/* enum chan_width - Channel width definitions */
+enum chan_width {
+ CHAN_WIDTH_20_NOHT,
+ CHAN_WIDTH_20,
+ CHAN_WIDTH_40,
+ CHAN_WIDTH_80,
+ CHAN_WIDTH_80P80,
+ CHAN_WIDTH_160,
+ CHAN_WIDTH_UNKNOWN
+};
/**
* struct wpa_signal_info - Information about channel signal quality
- * @frequency: control frequency
- * @above_threshold: true if the above threshold was crossed
- * (relevant for a CQM event)
- * @current_signal: in dBm
- * @avg_signal: in dBm
- * @avg_beacon_signal: in dBm
- * @current_noise: %WPA_INVALID_NOISE if not supported
- * @current_txrate: current TX rate
- * @chanwidth: channel width
- * @center_frq1: center frequency for the first segment
- * @center_frq2: center frequency for the second segment (if relevant)
*/
struct wpa_signal_info {
u32 frequency;
@@ -1971,26 +1930,6 @@
};
/**
- * struct wpa_channel_info - Information about the current channel
- * @frequency: Center frequency of the primary 20 MHz channel
- * @chanwidth: Width of the current operating channel
- * @sec_channel: Location of the secondary 20 MHz channel (either +1 or -1).
- * This field is only filled in when using a 40 MHz channel.
- * @center_frq1: Center frequency of frequency segment 0
- * @center_frq2: Center frequency of frequency segment 1 (for 80+80 channels)
- * @seg1_idx: Frequency segment 1 index when using a 80+80 channel. This is
- * derived from center_frq2 for convenience.
- */
-struct wpa_channel_info {
- u32 frequency;
- enum chan_width chanwidth;
- int sec_channel;
- int center_frq1;
- int center_frq2;
- u8 seg1_idx;
-};
-
-/**
* struct beacon_data - Beacon data
* @head: Head portion of Beacon frame (before TIM IE)
* @tail: Tail portion of Beacon frame (after TIM IE)
@@ -3426,14 +3365,6 @@
int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
/**
- * channel_info - Get parameters of the current operating channel
- * @priv: Private driver interface data
- * @channel_info: Channel info structure
- * Returns: 0 on success, negative (<0) on failure
- */
- int (*channel_info)(void *priv, struct wpa_channel_info *channel_info);
-
- /**
* set_authmode - Set authentication algorithm(s) for static WEP
* @priv: Private driver interface data
* @authmode: 1=Open System, 2=Shared Key, 3=both
@@ -3714,7 +3645,7 @@
/**
* status - Get driver interface status information
* @priv: Private driver interface data
- * @buf: Buffer for printing the status information
+ * @buf: Buffer for printing tou the status information
* @buflen: Maximum length of the buffer
* Returns: Length of written status information or -1 on failure
*/
@@ -3838,14 +3769,6 @@
int (*set_transmit_next_pn)(void *priv, struct transmit_sa *sa);
/**
- * set_receive_lowest_pn - Set receive lowest PN
- * @priv: Private driver interface data
- * @sa: secure association
- * Returns: 0 on success, -1 on failure (or if not supported)
- */
- int (*set_receive_lowest_pn)(void *priv, struct receive_sa *sa);
-
- /**
* create_receive_sc - create secure channel for receiving
* @priv: Private driver interface data
* @sc: secure channel
@@ -4156,15 +4079,6 @@
*/
int (*send_external_auth_status)(void *priv,
struct external_auth *params);
-
- /**
- * set_4addr_mode - Set 4-address mode
- * @priv: Private driver interface data
- * @bridge_ifname: Bridge interface name
- * @val: 0 - disable 4addr mode, 1 - enable 4addr mode
- * Returns: 0 on success, < 0 on failure
- */
- int (*set_4addr_mode)(void *priv, const char *bridge_ifname, int val);
};
/**
@@ -5607,8 +5521,6 @@
/* Convert chan_width to a string for logging and control interfaces */
const char * channel_width_to_string(enum chan_width width);
-int channel_width_to_int(enum chan_width width);
-
int ht_supported(const struct hostapd_hw_modes *mode);
int vht_supported(const struct hostapd_hw_modes *mode);
diff --git a/src/drivers/driver_atheros.c b/src/drivers/driver_atheros.c
index 62f5baa..16c2ae9 100644
--- a/src/drivers/driver_atheros.c
+++ b/src/drivers/driver_atheros.c
@@ -1329,11 +1329,11 @@
}
atheros_raw_receive(drv, NULL,
(u8 *) custom + MGMT_FRAM_TAG_SIZE, len);
- } else if (os_strncmp(custom, "Manage.auth ", 12) == 0) {
+ } else if (os_strncmp(custom, "Manage.auth ", 12) == 0) {
/* Format: "Manage.auth <frame len>" | zero padding | frame */
int len = atoi(custom + 12);
- if (len < 0 ||
- MGMT_FRAM_TAG_SIZE + len > end - custom) {
+ if (len < 0 ||
+ MGMT_FRAM_TAG_SIZE + len > end - custom) {
wpa_printf(MSG_DEBUG,
"Invalid Manage.auth event length %d", len);
return;
@@ -1342,7 +1342,7 @@
(u8 *) custom + MGMT_FRAM_TAG_SIZE, len);
#endif /* CONFIG_IEEE80211W || CONFIG_IEEE80211R || CONFIG_FILS */
#ifdef ATHEROS_USE_RAW_RECEIVE
- } else if (os_strncmp(custom, "Manage.action ", 14) == 0) {
+ } else if (os_strncmp(custom, "Manage.action ", 14) == 0) {
/* Format: "Manage.assoc_req <frame len>" | zero padding | frame
*/
int len = atoi(custom + 14);
diff --git a/src/drivers/driver_common.c b/src/drivers/driver_common.c
index e55e6cd..ac0916e 100644
--- a/src/drivers/driver_common.c
+++ b/src/drivers/driver_common.c
@@ -115,25 +115,6 @@
}
-int channel_width_to_int(enum chan_width width)
-{
- switch (width) {
- case CHAN_WIDTH_20_NOHT:
- case CHAN_WIDTH_20:
- return 20;
- case CHAN_WIDTH_40:
- return 40;
- case CHAN_WIDTH_80:
- return 80;
- case CHAN_WIDTH_80P80:
- case CHAN_WIDTH_160:
- return 160;
- default:
- return 0;
- }
-}
-
-
int ht_supported(const struct hostapd_hw_modes *mode)
{
if (!(mode->flags & HOSTAPD_MODE_FLAG_HT_INFO_KNOWN)) {
@@ -253,8 +234,7 @@
DF2S(DRIVER_IE);
DF2S(SET_KEYS_AFTER_ASSOC);
DF2S(DFS_OFFLOAD);
- DF2S(4WAY_HANDSHAKE_PSK);
- DF2S(4WAY_HANDSHAKE_8021X);
+ DF2S(4WAY_HANDSHAKE);
DF2S(WIRED);
DF2S(SME);
DF2S(AP);
diff --git a/src/drivers/driver_hostap.c b/src/drivers/driver_hostap.c
index 61b39b1..597da33 100644
--- a/src/drivers/driver_hostap.c
+++ b/src/drivers/driver_hostap.c
@@ -231,11 +231,7 @@
}
memset(&ifr, 0, sizeof(ifr));
- if (os_snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%sap",
- drv->iface) >= (int) sizeof(ifr.ifr_name)) {
- wpa_printf(MSG_ERROR, "hostap: AP interface name truncated");
- return -1;
- }
+ snprintf(ifr.ifr_name, sizeof(ifr.ifr_name), "%sap", drv->iface);
if (ioctl(drv->sock, SIOCGIFINDEX, &ifr) != 0) {
wpa_printf(MSG_ERROR, "ioctl(SIOCGIFINDEX): %s",
strerror(errno));
@@ -352,10 +348,7 @@
struct ifreq ifr;
char ifname[IFNAMSIZ];
- if (os_snprintf(ifname, IFNAMSIZ, "%sap", drv->iface) >= IFNAMSIZ) {
- wpa_printf(MSG_ERROR, "hostap: AP interface name truncated");
- return -1;
- }
+ os_snprintf(ifname, IFNAMSIZ, "%sap", drv->iface);
if (linux_set_iface_flags(drv->ioctl_sock, ifname, dev_up) < 0)
return -1;
@@ -1131,7 +1124,6 @@
for (i = 0; i < 14; i++) {
mode->channels[i].chan = i + 1;
mode->channels[i].freq = chan2freq[i];
- mode->channels[i].allowed_bw = HOSTAPD_CHAN_WIDTH_20;
/* TODO: Get allowed channel list from the driver */
if (i >= 11)
mode->channels[i].flag = HOSTAPD_CHAN_DISABLED;
diff --git a/src/drivers/driver_macsec_linux.c b/src/drivers/driver_macsec_linux.c
index 9d981bb..e89b3ba 100644
--- a/src/drivers/driver_macsec_linux.c
+++ b/src/drivers/driver_macsec_linux.c
@@ -177,9 +177,6 @@
if (drv->controlled_port_enabled_set) {
struct rtnl_link *change = rtnl_link_alloc();
- wpa_printf(MSG_DEBUG, DRV_PREFIX
- "%s: try_commit controlled_port_enabled=%d",
- drv->ifname, drv->controlled_port_enabled);
if (!change)
return -1;
@@ -199,24 +196,13 @@
drv->controlled_port_enabled_set = FALSE;
}
- if (drv->protect_frames_set) {
- wpa_printf(MSG_DEBUG, DRV_PREFIX
- "%s: try_commit protect_frames=%d",
- drv->ifname, drv->protect_frames);
+ if (drv->protect_frames_set)
rtnl_link_macsec_set_protect(drv->link, drv->protect_frames);
- }
- if (drv->encrypt_set) {
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: try_commit encrypt=%d",
- drv->ifname, drv->encrypt);
+ if (drv->encrypt_set)
rtnl_link_macsec_set_encrypt(drv->link, drv->encrypt);
- }
if (drv->replay_protect_set) {
- wpa_printf(MSG_DEBUG, DRV_PREFIX
- "%s: try_commit replay_protect=%d replay_window=%d",
- drv->ifname, drv->replay_protect,
- drv->replay_window);
rtnl_link_macsec_set_replay_protect(drv->link,
drv->replay_protect);
if (drv->replay_protect)
@@ -224,12 +210,8 @@
drv->replay_window);
}
- if (drv->encoding_sa_set) {
- wpa_printf(MSG_DEBUG, DRV_PREFIX
- "%s: try_commit encoding_sa=%d",
- drv->ifname, drv->encoding_sa);
+ if (drv->encoding_sa_set)
rtnl_link_macsec_set_encoding_sa(drv->link, drv->encoding_sa);
- }
err = rtnl_link_add(drv->sk, drv->link, 0);
if (err < 0)
@@ -336,8 +318,6 @@
drv->common.ifname);
goto cache;
}
- wpa_printf(MSG_DEBUG, DRV_PREFIX "ifname=%s parent_ifi=%d",
- drv->common.ifname, drv->parent_ifi);
err = init_genl_ctx(drv);
if (err < 0)
@@ -659,7 +639,7 @@
DRV_PREFIX "failed to communicate: %d (%s)",
ret, nl_geterror(-ret));
- ctx->cb_arg.pn = NULL;
+ ctx->cb_arg.pn = 0;
out_free_msg:
nlmsg_free(msg);
@@ -690,50 +670,6 @@
/**
- * macsec_drv_set_receive_lowest_pn - Set receive lowest PN
- * @priv: Private driver interface data
- * @sa: secure association
- * Returns: 0 on success, -1 on failure (or if not supported)
- */
-static int macsec_drv_set_receive_lowest_pn(void *priv, struct receive_sa *sa)
-{
- struct macsec_drv_data *drv = priv;
- struct macsec_genl_ctx *ctx = &drv->ctx;
- struct nl_msg *msg;
- struct nlattr *nest;
- int ret = -1;
-
- wpa_printf(MSG_DEBUG,
- DRV_PREFIX "%s: set_receive_lowest_pn -> %d: %d",
- drv->ifname, sa->an, sa->next_pn);
-
- msg = msg_prepare(MACSEC_CMD_UPD_RXSA, ctx, drv->ifi);
- if (!msg)
- return ret;
-
- nest = nla_nest_start(msg, MACSEC_ATTR_SA_CONFIG);
- if (!nest)
- goto nla_put_failure;
-
- NLA_PUT_U8(msg, MACSEC_SA_ATTR_AN, sa->an);
- NLA_PUT_U32(msg, MACSEC_SA_ATTR_PN, sa->next_pn);
-
- nla_nest_end(msg, nest);
-
- ret = nl_send_recv(ctx->sk, msg);
- if (ret < 0) {
- wpa_printf(MSG_ERROR,
- DRV_PREFIX "failed to communicate: %d (%s)",
- ret, nl_geterror(-ret));
- }
-
-nla_put_failure:
- nlmsg_free(msg);
- return ret;
-}
-
-
-/**
* macsec_drv_get_transmit_next_pn - Get transmit next PN
* @priv: Private driver interface data
* @sa: secure association
@@ -818,10 +754,8 @@
struct nl_msg *msg;
int ret = -1;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: create_receive_sc -> " SCISTR
- " (conf_offset=%u validation=%d)",
- drv->ifname, SCI2STR(sc->sci.addr, sc->sci.port),
- conf_offset, validation);
+ wpa_printf(MSG_DEBUG, "%s -> " SCISTR, __func__,
+ SCI2STR(sc->sci.addr, sc->sci.port));
msg = msg_prepare(MACSEC_CMD_ADD_RXSC, ctx, drv->ifi);
if (!msg)
@@ -856,8 +790,8 @@
struct nl_msg *msg;
int ret = -1;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: delete_receive_sc -> " SCISTR,
- drv->ifname, SCI2STR(sc->sci.addr, sc->sci.port));
+ wpa_printf(MSG_DEBUG, "%s -> " SCISTR, __func__,
+ SCI2STR(sc->sci.addr, sc->sci.port));
msg = msg_prepare(MACSEC_CMD_DEL_RXSC, ctx, drv->ifi);
if (!msg)
@@ -893,17 +827,8 @@
struct nlattr *nest;
int ret = -1;
- wpa_printf(MSG_DEBUG,
- DRV_PREFIX "%s: create_receive_sa -> %d on " SCISTR
- " (enable_receive=%d next_pn=%u)",
- drv->ifname, sa->an,
- SCI2STR(sa->sc->sci.addr, sa->sc->sci.port),
- sa->enable_receive, sa->next_pn);
- wpa_hexdump(MSG_DEBUG, DRV_PREFIX "SA keyid",
- &sa->pkey->key_identifier,
- sizeof(sa->pkey->key_identifier));
- wpa_hexdump_key(MSG_DEBUG, DRV_PREFIX "SA key",
- sa->pkey->key, sa->pkey->key_len);
+ wpa_printf(MSG_DEBUG, "%s -> %d on " SCISTR, __func__, sa->an,
+ SCI2STR(sa->sc->sci.addr, sa->sc->sci.port));
msg = msg_prepare(MACSEC_CMD_ADD_RXSA, ctx, drv->ifi);
if (!msg)
@@ -952,8 +877,7 @@
struct nlattr *nest;
int ret = -1;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: delete_receive_sa -> %d on "
- SCISTR, drv->ifname, sa->an,
+ wpa_printf(MSG_DEBUG, "%s -> %d on " SCISTR, __func__, sa->an,
SCI2STR(sa->sc->sci.addr, sa->sc->sci.port));
msg = msg_prepare(MACSEC_CMD_DEL_RXSA, ctx, drv->ifi);
@@ -1030,8 +954,7 @@
struct macsec_drv_data *drv = priv;
struct macsec_genl_ctx *ctx = &drv->ctx;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: enable_receive_sa -> %d on "
- SCISTR, drv->ifname, sa->an,
+ wpa_printf(MSG_DEBUG, "%s -> %d on " SCISTR, __func__, sa->an,
SCI2STR(sa->sc->sci.addr, sa->sc->sci.port));
return set_active_rx_sa(ctx, drv->ifi, mka_sci_u64(&sa->sc->sci),
@@ -1050,8 +973,7 @@
struct macsec_drv_data *drv = priv;
struct macsec_genl_ctx *ctx = &drv->ctx;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: disable_receive_sa -> %d on "
- SCISTR, drv->ifname, sa->an,
+ wpa_printf(MSG_DEBUG, "%s -> %d on " SCISTR, __func__, sa->an,
SCI2STR(sa->sc->sci.addr, sa->sc->sci.port));
return set_active_rx_sa(ctx, drv->ifi, mka_sci_u64(&sa->sc->sci),
@@ -1087,7 +1009,7 @@
*/
static int macsec_drv_create_transmit_sc(
void *priv, struct transmit_sc *sc,
- unsigned int conf_offset)
+ enum confidentiality_offset conf_offset)
{
struct macsec_drv_data *drv = priv;
struct rtnl_link *link;
@@ -1095,10 +1017,7 @@
u64 sci;
int err;
- wpa_printf(MSG_DEBUG, DRV_PREFIX
- "%s: create_transmit_sc -> " SCISTR " (conf_offset=%d)",
- drv->common.ifname, SCI2STR(sc->sci.addr, sc->sci.port),
- conf_offset);
+ wpa_printf(MSG_DEBUG, "%s", __func__);
if (!drv->sk) {
wpa_printf(MSG_ERROR, DRV_PREFIX "NULL rtnl socket");
@@ -1141,9 +1060,6 @@
drv->ifi = rtnl_link_get_ifindex(link);
ifname = rtnl_link_get_name(link);
- wpa_printf(MSG_DEBUG,
- DRV_PREFIX "%s: create_transmit_sc: ifi=%d ifname=%s",
- drv->common.ifname, drv->ifi, ifname);
os_strlcpy(drv->ifname, ifname, sizeof(drv->ifname));
rtnl_link_put(link);
@@ -1172,8 +1088,7 @@
struct macsec_drv_data *drv = priv;
int err;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: delete_transmit_sc -> " SCISTR,
- drv->ifname, SCI2STR(sc->sci.addr, sc->sci.port));
+ wpa_printf(MSG_DEBUG, "%s", __func__);
if (!drv->sk)
return 0;
@@ -1210,16 +1125,7 @@
struct nlattr *nest;
int ret = -1;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: create_transmit_sa -> %d on "
- SCISTR " (enable_transmit=%d next_pn=%u)",
- drv->ifname, sa->an,
- SCI2STR(sa->sc->sci.addr, sa->sc->sci.port),
- sa->enable_transmit, sa->next_pn);
- wpa_hexdump(MSG_DEBUG, DRV_PREFIX "SA keyid",
- &sa->pkey->key_identifier,
- sizeof(sa->pkey->key_identifier));
- wpa_hexdump_key(MSG_DEBUG, DRV_PREFIX "SA key",
- sa->pkey->key, sa->pkey->key_len);
+ wpa_printf(MSG_DEBUG, "%s -> %d", __func__, sa->an);
msg = msg_prepare(MACSEC_CMD_ADD_TXSA, ctx, drv->ifi);
if (!msg)
@@ -1265,9 +1171,7 @@
struct nlattr *nest;
int ret = -1;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: delete_transmit_sa -> %d on "
- SCISTR, drv->ifname, sa->an,
- SCI2STR(sa->sc->sci.addr, sa->sc->sci.port));
+ wpa_printf(MSG_DEBUG, "%s -> %d", __func__, sa->an);
msg = msg_prepare(MACSEC_CMD_DEL_TXSA, ctx, drv->ifi);
if (!msg)
@@ -1339,9 +1243,7 @@
struct macsec_genl_ctx *ctx = &drv->ctx;
int ret;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: enable_transmit_sa -> %d on "
- SCISTR, drv->ifname, sa->an,
- SCI2STR(sa->sc->sci.addr, sa->sc->sci.port));
+ wpa_printf(MSG_DEBUG, "%s -> %d", __func__, sa->an);
ret = set_active_tx_sa(ctx, drv->ifi, sa->an, TRUE);
if (ret < 0) {
@@ -1367,38 +1269,12 @@
struct macsec_drv_data *drv = priv;
struct macsec_genl_ctx *ctx = &drv->ctx;
- wpa_printf(MSG_DEBUG, DRV_PREFIX "%s: disable_transmit_sa -> %d on "
- SCISTR, drv->ifname, sa->an,
- SCI2STR(sa->sc->sci.addr, sa->sc->sci.port));
+ wpa_printf(MSG_DEBUG, "%s -> %d", __func__, sa->an);
return set_active_tx_sa(ctx, drv->ifi, sa->an, FALSE);
}
-static int macsec_drv_status(void *priv, char *buf, size_t buflen)
-{
- struct macsec_drv_data *drv = priv;
- int res;
- char *pos, *end;
-
- pos = buf;
- end = buf + buflen;
-
- res = os_snprintf(pos, end - pos,
- "ifname=%s\n"
- "ifi=%d\n"
- "parent_ifname=%s\n"
- "parent_ifi=%d\n",
- drv->common.ifname, drv->ifi,
- drv->ifname, drv->parent_ifi);
- if (os_snprintf_error(end - pos, res))
- return pos - buf;
- pos += res;
-
- return pos - buf;
-}
-
-
const struct wpa_driver_ops wpa_driver_macsec_linux_ops = {
.name = "macsec_linux",
.desc = "MACsec Ethernet driver for Linux",
@@ -1417,7 +1293,6 @@
.set_current_cipher_suite = macsec_drv_set_current_cipher_suite,
.enable_controlled_port = macsec_drv_enable_controlled_port,
.get_receive_lowest_pn = macsec_drv_get_receive_lowest_pn,
- .set_receive_lowest_pn = macsec_drv_set_receive_lowest_pn,
.get_transmit_next_pn = macsec_drv_get_transmit_next_pn,
.set_transmit_next_pn = macsec_drv_set_transmit_next_pn,
.create_receive_sc = macsec_drv_create_receive_sc,
@@ -1432,6 +1307,4 @@
.delete_transmit_sa = macsec_drv_delete_transmit_sa,
.enable_transmit_sa = macsec_drv_enable_transmit_sa,
.disable_transmit_sa = macsec_drv_disable_transmit_sa,
-
- .status = macsec_drv_status,
};
diff --git a/src/drivers/driver_macsec_qca.c b/src/drivers/driver_macsec_qca.c
index 8372393..e397950 100644
--- a/src/drivers/driver_macsec_qca.c
+++ b/src/drivers/driver_macsec_qca.c
@@ -383,7 +383,7 @@
}
-static int macsec_qca_set_transmit_next_pn(void *priv, struct transmit_sa *sa)
+int macsec_qca_set_transmit_next_pn(void *priv, struct transmit_sa *sa)
{
struct macsec_qca_data *drv = priv;
int ret = 0;
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index 0a70e22..771e766 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -40,9 +40,6 @@
#include "driver_nl80211.h"
-#ifndef NETLINK_CAP_ACK
-#define NETLINK_CAP_ACK 10
-#endif /* NETLINK_CAP_ACK */
/* support for extack if compilation headers are too old */
#ifndef NETLINK_EXT_ACK
#define NETLINK_EXT_ACK 11
@@ -409,11 +406,6 @@
setsockopt(nl_socket_get_fd(nl_handle), SOL_NETLINK,
NETLINK_EXT_ACK, &opt, sizeof(opt));
- /* try to set NETLINK_CAP_ACK to 1, ignoring errors */
- opt = 1;
- setsockopt(nl_socket_get_fd(nl_handle), SOL_NETLINK,
- NETLINK_CAP_ACK, &opt, sizeof(opt));
-
err = nl_send_auto_complete(nl_handle, msg);
if (err < 0)
goto out;
@@ -1477,7 +1469,7 @@
{
struct nl_msg *msg;
- sig->current_signal = -WPA_INVALID_NOISE;
+ sig->current_signal = -9999;
sig->current_txrate = 0;
if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_GET_STATION)) ||
@@ -1539,7 +1531,7 @@
{
struct nl_msg *msg;
- sig_change->current_noise = WPA_INVALID_NOISE;
+ sig_change->current_noise = 9999;
sig_change->frequency = drv->assoc_freq;
msg = nl80211_drv_msg(drv, NLM_F_DUMP, NL80211_CMD_GET_SURVEY);
@@ -1547,70 +1539,6 @@
}
-static int get_channel_info(struct nl_msg *msg, void *arg)
-{
- struct nlattr *tb[NL80211_ATTR_MAX + 1] = { 0 };
- struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
- struct wpa_channel_info *chan_info = arg;
-
- nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
- genlmsg_attrlen(gnlh, 0), NULL);
-
- os_memset(chan_info, 0, sizeof(struct wpa_channel_info));
- chan_info->chanwidth = CHAN_WIDTH_UNKNOWN;
-
- if (tb[NL80211_ATTR_WIPHY_FREQ])
- chan_info->frequency =
- nla_get_u32(tb[NL80211_ATTR_WIPHY_FREQ]);
- if (tb[NL80211_ATTR_CHANNEL_WIDTH])
- chan_info->chanwidth = convert2width(
- nla_get_u32(tb[NL80211_ATTR_CHANNEL_WIDTH]));
- if (tb[NL80211_ATTR_WIPHY_CHANNEL_TYPE]) {
- enum nl80211_channel_type ct =
- nla_get_u32(tb[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
-
- switch (ct) {
- case NL80211_CHAN_HT40MINUS:
- chan_info->sec_channel = -1;
- break;
- case NL80211_CHAN_HT40PLUS:
- chan_info->sec_channel = 1;
- break;
- default:
- chan_info->sec_channel = 0;
- break;
- }
- }
- if (tb[NL80211_ATTR_CENTER_FREQ1])
- chan_info->center_frq1 =
- nla_get_u32(tb[NL80211_ATTR_CENTER_FREQ1]);
- if (tb[NL80211_ATTR_CENTER_FREQ2])
- chan_info->center_frq2 =
- nla_get_u32(tb[NL80211_ATTR_CENTER_FREQ2]);
-
- if (chan_info->center_frq2) {
- u8 seg1_idx = 0;
-
- if (ieee80211_freq_to_chan(chan_info->center_frq2, &seg1_idx) !=
- NUM_HOSTAPD_MODES)
- chan_info->seg1_idx = seg1_idx;
- }
-
- return NL_SKIP;
-}
-
-
-static int nl80211_channel_info(void *priv, struct wpa_channel_info *ci)
-{
- struct i802_bss *bss = priv;
- struct wpa_driver_nl80211_data *drv = bss->drv;
- struct nl_msg *msg;
-
- msg = nl80211_drv_msg(drv, 0, NL80211_CMD_GET_INTERFACE);
- return send_and_recv_msgs(drv, msg, get_channel_info, ci);
-}
-
-
static void wpa_driver_nl80211_event_receive(int sock, void *eloop_ctx,
void *handle)
{
@@ -2241,11 +2169,6 @@
ret = -1;
#endif /* CONFIG_DPP */
#ifdef CONFIG_IEEE80211W
-#ifdef CONFIG_OCV
- /* SA Query Request */
- if (nl80211_register_action_frame(bss, (u8 *) "\x08\x00", 2) < 0)
- ret = -1;
-#endif /* CONFIG_OCV */
/* SA Query Response */
if (nl80211_register_action_frame(bss, (u8 *) "\x08\x01", 2) < 0)
ret = -1;
@@ -3039,7 +2962,7 @@
#endif /* CONFIG_DRIVER_NL80211_QCA */
if (alg == WPA_ALG_PMK &&
- (drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X))
+ (drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE))
return nl80211_set_pmk(drv, key, key_len, addr);
if (alg == WPA_ALG_NONE) {
@@ -3242,8 +3165,7 @@
int wpa_driver_nl80211_mlme(struct wpa_driver_nl80211_data *drv,
const u8 *addr, int cmd, u16 reason_code,
- int local_state_change,
- struct nl_handle *nl_connect)
+ int local_state_change)
{
int ret;
struct nl_msg *msg;
@@ -3257,10 +3179,7 @@
return -1;
}
- if (nl_connect)
- ret = send_and_recv(drv->global, nl_connect, msg, NULL, NULL);
- else
- ret = send_and_recv_msgs(drv, msg, NULL, NULL);
+ ret = send_and_recv_msgs(drv, msg, NULL, NULL);
if (ret) {
wpa_dbg(drv->ctx, MSG_DEBUG,
"nl80211: MLME command failed: reason=%u ret=%d (%s)",
@@ -3271,8 +3190,7 @@
static int wpa_driver_nl80211_disconnect(struct wpa_driver_nl80211_data *drv,
- int reason_code,
- struct nl_handle *nl_connect)
+ int reason_code)
{
int ret;
int drv_associated = drv->associated;
@@ -3281,7 +3199,7 @@
nl80211_mark_disconnected(drv);
/* Disconnect command doesn't need BSSID - it uses cached value */
ret = wpa_driver_nl80211_mlme(drv, NULL, NL80211_CMD_DISCONNECT,
- reason_code, 0, nl_connect);
+ reason_code, 0);
/*
* For locally generated disconnect, supplicant already generates a
* DEAUTH event, so ignore the event from NL80211.
@@ -3303,19 +3221,13 @@
nl80211_mark_disconnected(drv);
return nl80211_leave_ibss(drv, 1);
}
- if (!(drv->capa.flags & WPA_DRIVER_FLAGS_SME)) {
- struct nl_handle *nl_connect = NULL;
-
- if (bss->use_nl_connect)
- nl_connect = bss->nl_connect;
- return wpa_driver_nl80211_disconnect(drv, reason_code,
- nl_connect);
- }
+ if (!(drv->capa.flags & WPA_DRIVER_FLAGS_SME))
+ return wpa_driver_nl80211_disconnect(drv, reason_code);
wpa_printf(MSG_DEBUG, "%s(addr=" MACSTR " reason_code=%d)",
__func__, MAC2STR(addr), reason_code);
nl80211_mark_disconnected(drv);
ret = wpa_driver_nl80211_mlme(drv, addr, NL80211_CMD_DEAUTHENTICATE,
- reason_code, 0, NULL);
+ reason_code, 0);
/*
* For locally generated deauthenticate, supplicant already generates a
* DEAUTH event, so ignore the event from NL80211.
@@ -4045,7 +3957,7 @@
struct wpa_driver_nl80211_data *drv = bss->drv;
struct nl_msg *msg;
u8 cmd = NL80211_CMD_NEW_BEACON;
- int ret = -ENOBUFS;
+ int ret;
int beacon_set;
int num_suites;
int smps_mode;
@@ -4251,29 +4163,6 @@
goto fail;
}
- if (params->ftm_responder) {
- struct nlattr *ftm;
-
- if (!(drv->capa.flags & WPA_DRIVER_FLAGS_FTM_RESPONDER)) {
- ret = -ENOTSUP;
- goto fail;
- }
-
- ftm = nla_nest_start(msg, NL80211_ATTR_FTM_RESPONDER);
- if (!ftm ||
- nla_put_flag(msg, NL80211_FTM_RESP_ATTR_ENABLED) ||
- (params->lci &&
- nla_put(msg, NL80211_FTM_RESP_ATTR_LCI,
- wpabuf_len(params->lci),
- wpabuf_head(params->lci))) ||
- (params->civic &&
- nla_put(msg, NL80211_FTM_RESP_ATTR_CIVICLOC,
- wpabuf_len(params->civic),
- wpabuf_head(params->civic))))
- goto fail;
- nla_nest_end(msg, ftm);
- }
-
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
if (ret) {
wpa_printf(MSG_DEBUG, "nl80211: Beacon set failed: %d (%s)",
@@ -4325,7 +4214,7 @@
return ret;
fail:
nlmsg_free(msg);
- return ret;
+ return -ENOBUFS;
}
@@ -5576,16 +5465,9 @@
return -1;
}
- if (params->req_key_mgmt_offload &&
- (drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X)) {
- wpa_printf(MSG_DEBUG, " * WANT_1X_4WAY_HS");
- if (nla_put_flag(msg, NL80211_ATTR_WANT_1X_4WAY_HS))
- return -1;
- }
-
/* Add PSK in case of 4-way handshake offload */
if (params->psk &&
- (drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK)) {
+ (drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE)) {
wpa_hexdump_key(MSG_DEBUG, " * PSK", params->psk, 32);
if (nla_put(msg, NL80211_ATTR_PMK, 32, params->psk))
return -1;
@@ -5716,10 +5598,9 @@
goto fail;
if (nl_connect)
- ret = send_and_recv(drv->global, nl_connect, msg,
- NULL, (void *) -1);
+ ret = send_and_recv(drv->global, nl_connect, msg, NULL, NULL);
else
- ret = send_and_recv_msgs(drv, msg, NULL, (void *) -1);
+ ret = send_and_recv_msgs(drv, msg, NULL, NULL);
msg = NULL;
if (ret) {
@@ -5731,7 +5612,6 @@
}
fail:
- nl80211_nlmsg_clear(msg);
nlmsg_free(msg);
return ret;
@@ -5762,7 +5642,7 @@
"disconnecting before reassociation "
"attempt");
if (wpa_driver_nl80211_disconnect(
- drv, WLAN_REASON_PREV_AUTH_NOT_VALID, nl_connect))
+ drv, WLAN_REASON_PREV_AUTH_NOT_VALID))
return -1;
ret = wpa_driver_nl80211_try_connect(drv, params, nl_connect);
}
@@ -5793,13 +5673,8 @@
if (wpa_driver_nl80211_set_mode(priv, nlmode) < 0)
return -1;
- if (params->auth_alg & WPA_AUTH_ALG_SAE) {
+ if (params->auth_alg & WPA_AUTH_ALG_SAE)
nl_connect = bss->nl_connect;
- bss->use_nl_connect = 1;
- } else {
- bss->use_nl_connect = 0;
- }
-
return wpa_driver_nl80211_connect(drv, params, nl_connect);
}
@@ -6406,7 +6281,6 @@
struct wpa_driver_nl80211_data *drv = bss->drv;
struct nl_msg *msg;
struct nlattr *txq, *params;
- int res;
msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_WIPHY);
if (!msg)
@@ -6452,11 +6326,7 @@
nla_nest_end(msg, txq);
- res = send_and_recv_msgs(drv, msg, NULL, NULL);
- wpa_printf(MSG_DEBUG,
- "nl80211: TX queue param set: queue=%d aifs=%d cw_min=%d cw_max=%d burst_time=%d --> res=%d",
- queue, aifs, cw_min, cw_max, burst_time, res);
- if (res == 0)
+ if (send_and_recv_msgs(drv, msg, NULL, NULL) == 0)
return 0;
msg = NULL;
fail:
@@ -6755,12 +6625,9 @@
}
return i802_set_sta_vlan(priv, addr, name, 0);
} else {
- if (bridge_ifname &&
- linux_br_del_if(drv->global->ioctl_sock, bridge_ifname,
- name) < 0)
- wpa_printf(MSG_INFO,
- "nl80211: Failed to remove interface %s from bridge %s: %s",
- name, bridge_ifname, strerror(errno));
+ if (bridge_ifname)
+ linux_br_del_if(drv->global->ioctl_sock, bridge_ifname,
+ name);
i802_set_sta_vlan(priv, addr, bss->ifname, 0);
nl80211_remove_iface(drv, if_nametoindex(name));
@@ -7929,12 +7796,11 @@
params->fils_cache_id)) ||
(params->pmk_len && params->pmk_len <= PMK_MAX_LEN &&
nla_put(msg, NL80211_ATTR_PMK, params->pmk_len, params->pmk))) {
- nl80211_nlmsg_clear(msg);
nlmsg_free(msg);
return -ENOBUFS;
}
- return send_and_recv_msgs(bss->drv, msg, NULL, (void *) -1);
+ return send_and_recv_msgs(bss->drv, msg, NULL, NULL);
}
@@ -8706,8 +8572,6 @@
struct wpa_driver_nl80211_data *drv = bss->drv;
int res;
char *pos, *end;
- struct nl_msg *msg;
- char alpha2[3] = { 0, 0, 0 };
pos = buf;
end = buf + buflen;
@@ -8852,23 +8716,6 @@
pos += res;
}
- msg = nlmsg_alloc();
- if (msg &&
- nl80211_cmd(drv, msg, 0, NL80211_CMD_GET_REG) &&
- nla_put_u32(msg, NL80211_ATTR_WIPHY, drv->wiphy_idx) == 0) {
- if (send_and_recv_msgs(drv, msg, nl80211_get_country,
- alpha2) == 0 &&
- alpha2[0]) {
- res = os_snprintf(pos, end - pos, "country=%s\n",
- alpha2);
- if (os_snprintf_error(end - pos, res))
- return pos - buf;
- pos += res;
- }
- } else {
- nlmsg_free(msg);
- }
-
return pos - buf;
}
@@ -10801,49 +10648,6 @@
}
-static int nl80211_set_4addr_mode(void *priv, const char *bridge_ifname,
- int val)
-{
- struct i802_bss *bss = priv;
- struct wpa_driver_nl80211_data *drv = bss->drv;
- struct nl_msg *msg;
- int ret = -ENOBUFS;
-
- wpa_printf(MSG_DEBUG, "nl80211: %s 4addr mode (bridge_ifname: %s)",
- val ? "Enable" : "Disable", bridge_ifname);
-
- msg = nl80211_cmd_msg(drv->first_bss, 0, NL80211_CMD_SET_INTERFACE);
- if (!msg || nla_put_u8(msg, NL80211_ATTR_4ADDR, val))
- goto fail;
-
- if (bridge_ifname[0] && bss->added_if_into_bridge && !val) {
- if (linux_br_del_if(drv->global->ioctl_sock,
- bridge_ifname, bss->ifname)) {
- wpa_printf(MSG_ERROR,
- "nl80211: Failed to remove interface %s from bridge %s",
- bss->ifname, bridge_ifname);
- return -1;
- }
- bss->added_if_into_bridge = 0;
- }
-
- ret = send_and_recv_msgs(drv, msg, NULL, NULL);
- msg = NULL;
- if (!ret) {
- if (bridge_ifname[0] && val &&
- i802_check_bridge(drv, bss, bridge_ifname, bss->ifname) < 0)
- return -1;
- return 0;
- }
-
-fail:
- nlmsg_free(msg);
- wpa_printf(MSG_ERROR, "nl80211: Failed to enable/disable 4addr");
-
- return ret;
-}
-
-
const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.name = "nl80211",
.desc = "Linux nl80211/cfg80211",
@@ -10903,7 +10707,6 @@
.resume = wpa_driver_nl80211_resume,
.signal_monitor = nl80211_signal_monitor,
.signal_poll = nl80211_signal_poll,
- .channel_info = nl80211_channel_info,
.send_frame = nl80211_send_frame,
.set_param = nl80211_set_param,
.get_radio_name = nl80211_get_radio_name,
@@ -10973,5 +10776,4 @@
.get_ext_capab = nl80211_get_ext_capab,
.update_connect_params = nl80211_update_connection_params,
.send_external_auth_status = nl80211_send_external_auth_status,
- .set_4addr_mode = nl80211_set_4addr_mode,
};
diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h
index 1e7fe7a..5ac0c7d 100644
--- a/src/drivers/driver_nl80211.h
+++ b/src/drivers/driver_nl80211.h
@@ -66,7 +66,6 @@
unsigned int wdev_id_set:1;
unsigned int added_if:1;
unsigned int static_ap:1;
- unsigned int use_nl_connect:1;
u8 addr[ETH_ALEN];
@@ -166,7 +165,6 @@
unsigned int he_capab_vendor_cmd_avail:1;
unsigned int fetch_bss_trans_status:1;
unsigned int roam_vendor_cmd_avail:1;
- unsigned int get_supported_akm_suites_avail:1;
u64 vendor_scan_cookie;
u64 remain_on_chan_cookie;
@@ -254,8 +252,7 @@
enum nl80211_iftype nlmode);
int wpa_driver_nl80211_mlme(struct wpa_driver_nl80211_data *drv,
const u8 *addr, int cmd, u16 reason_code,
- int local_state_change,
- struct nl_handle *nl_connect);
+ int local_state_change);
int nl80211_create_monitor_interface(struct wpa_driver_nl80211_data *drv);
void nl80211_remove_monitor_interface(struct wpa_driver_nl80211_data *drv);
diff --git a/src/drivers/driver_nl80211_capa.c b/src/drivers/driver_nl80211_capa.c
index 37eeb5e..7b360d2 100644
--- a/src/drivers/driver_nl80211_capa.c
+++ b/src/drivers/driver_nl80211_capa.c
@@ -403,11 +403,10 @@
capa->flags |= WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD;
if (ext_feature_isset(ext_features, len,
- NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK))
- capa->flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK;
- if (ext_feature_isset(ext_features, len,
+ NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK) &&
+ ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X))
- capa->flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X;
+ capa->flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE;
if (ext_feature_isset(ext_features, len,
NL80211_EXT_FEATURE_MFP_OPTIONAL))
@@ -429,10 +428,6 @@
NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION))
capa->flags |= WPA_DRIVER_FLAGS_OCE_STA;
#endif /* CONFIG_MBO */
-
- if (ext_feature_isset(ext_features, len,
- NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER))
- capa->flags |= WPA_DRIVER_FLAGS_FTM_RESPONDER;
}
@@ -787,9 +782,6 @@
case QCA_NL80211_VENDOR_SUBCMD_ROAM:
drv->roam_vendor_cmd_avail = 1;
break;
- case QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_AKMS:
- drv->get_supported_akm_suites_avail = 1;
- break;
#endif /* CONFIG_DRIVER_NL80211_QCA */
}
}
@@ -962,126 +954,6 @@
}
-static unsigned int get_akm_suites_info(struct nlattr *tb)
-{
- int i, num;
- unsigned int key_mgmt = 0;
- u32 *akms;
-
- if (!tb)
- return 0;
-
- num = nla_len(tb) / sizeof(u32);
- akms = nla_data(tb);
- for (i = 0; i < num; i++) {
- u32 a = akms[i];
-
- wpa_printf(MSG_DEBUG,
- "nl80211: Supported AKM %02x-%02x-%02x:%u",
- a >> 24, (a >> 16) & 0xff,
- (a >> 8) & 0xff, a & 0xff);
- switch (a) {
- case RSN_AUTH_KEY_MGMT_UNSPEC_802_1X:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_WPA |
- WPA_DRIVER_CAPA_KEY_MGMT_WPA2;
- break;
- case RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK |
- WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK;
- break;
- case RSN_AUTH_KEY_MGMT_FT_802_1X:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT;
- break;
- case RSN_AUTH_KEY_MGMT_FT_PSK:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_PSK;
- break;
- case RSN_AUTH_KEY_MGMT_802_1X_SUITE_B:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B;
- break;
- case RSN_AUTH_KEY_MGMT_802_1X_SUITE_B_192:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_SUITE_B_192;
- break;
- case RSN_AUTH_KEY_MGMT_OWE:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_OWE;
- break;
- case RSN_AUTH_KEY_MGMT_DPP:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_DPP;
- break;
- case RSN_AUTH_KEY_MGMT_FILS_SHA256:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256;
- break;
- case RSN_AUTH_KEY_MGMT_FILS_SHA384:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384;
- break;
- case RSN_AUTH_KEY_MGMT_FT_FILS_SHA256:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256;
- break;
- case RSN_AUTH_KEY_MGMT_FT_FILS_SHA384:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384;
- break;
- case RSN_AUTH_KEY_MGMT_SAE:
- key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_SAE;
- break;
- }
- }
-
- return key_mgmt;
-}
-
-
-static int get_akm_suites_handler(struct nl_msg *msg, void *arg)
-{
- struct nlattr *tb[NL80211_ATTR_MAX + 1];
- struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
- unsigned int *key_mgmt = arg;
-
- nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
- genlmsg_attrlen(gnlh, 0), NULL);
-
- if (tb[NL80211_ATTR_VENDOR_DATA]) {
- struct nlattr *nl_vend = tb[NL80211_ATTR_VENDOR_DATA];
- struct nlattr *tb_data[NL80211_ATTR_MAX + 1];
-
- nla_parse(tb_data, NL80211_ATTR_MAX,
- nla_data(nl_vend), nla_len(nl_vend), NULL);
-
- *key_mgmt =
- get_akm_suites_info(tb_data[NL80211_ATTR_AKM_SUITES]);
- }
-
- return NL_SKIP;
-}
-
-
-static int qca_nl80211_get_akm_suites(struct wpa_driver_nl80211_data *drv)
-{
- struct nl_msg *msg;
- unsigned int key_mgmt = 0;
- int ret;
-
- if (!drv->get_supported_akm_suites_avail)
- return -1;
-
- if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_VENDOR)) ||
- nla_put_u32(msg, NL80211_ATTR_VENDOR_ID, OUI_QCA) ||
- nla_put_u32(msg, NL80211_ATTR_VENDOR_SUBCMD,
- QCA_NL80211_VENDOR_SUBCMD_GET_SUPPORTED_AKMS)) {
- nlmsg_free(msg);
- return -1;
- }
-
- ret = send_and_recv_msgs(drv, msg, get_akm_suites_handler, &key_mgmt);
- if (!ret) {
- wpa_printf(MSG_DEBUG,
- "nl80211: Replace capa.key_mgmt based on driver advertised capabilities: 0x%x",
- key_mgmt);
- drv->capa.key_mgmt = key_mgmt;
- }
-
- return ret;
-}
-
-
static int qca_nl80211_he_capab_handler(struct nl_msg *msg, void *arg)
{
struct nlattr *tb[NL80211_ATTR_MAX + 1];
@@ -1307,18 +1179,11 @@
drv->capa.key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 |
WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384 |
WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA256 |
- WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384 |
- WPA_DRIVER_CAPA_KEY_MGMT_SAE;
+ WPA_DRIVER_CAPA_KEY_MGMT_FT_FILS_SHA384;
else if (drv->capa.flags & WPA_DRIVER_FLAGS_FILS_SK_OFFLOAD)
drv->capa.key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA256 |
WPA_DRIVER_CAPA_KEY_MGMT_FILS_SHA384;
-#ifdef CONFIG_DRIVER_NL80211_QCA
- /* Override drv->capa.key_mgmt based on driver advertised capability
- * constraints, if available. */
- qca_nl80211_get_akm_suites(drv);
-#endif /* CONFIG_DRIVER_NL80211_QCA */
-
drv->capa.auth = WPA_DRIVER_AUTH_OPEN |
WPA_DRIVER_AUTH_SHARED |
WPA_DRIVER_AUTH_LEAP;
@@ -1442,7 +1307,6 @@
u8 channel;
chan->freq = nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_FREQ]);
chan->flag = 0;
- chan->allowed_bw = ~0;
chan->dfs_cac_ms = 0;
if (ieee80211_freq_to_chan(chan->freq, &channel) != NUM_HOSTAPD_MODES)
chan->chan = channel;
@@ -1458,19 +1322,6 @@
if (tb_freq[NL80211_FREQUENCY_ATTR_GO_CONCURRENT])
chan->flag |= HOSTAPD_CHAN_GO_CONCURRENT;
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_10MHZ])
- chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_10;
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_20MHZ])
- chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_20;
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40_PLUS])
- chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_40P;
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_HT40_MINUS])
- chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_40M;
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_80MHZ])
- chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_80;
- if (tb_freq[NL80211_FREQUENCY_ATTR_NO_160MHZ])
- chan->allowed_bw &= ~HOSTAPD_CHAN_WIDTH_160;
-
if (tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]) {
enum nl80211_dfs_state state =
nla_get_u32(tb_freq[NL80211_FREQUENCY_ATTR_DFS_STATE]);
@@ -1505,12 +1356,6 @@
[NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
[NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
[NL80211_FREQUENCY_ATTR_DFS_STATE] = { .type = NLA_U32 },
- [NL80211_FREQUENCY_ATTR_NO_10MHZ] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_20MHZ] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_HT40_PLUS] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_HT40_MINUS] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_80MHZ] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_160MHZ] = { .type = NLA_FLAG },
};
int new_channels = 0;
struct hostapd_channel_data *channel;
@@ -2087,61 +1932,6 @@
}
-static const char * modestr(enum hostapd_hw_mode mode)
-{
- switch (mode) {
- case HOSTAPD_MODE_IEEE80211B:
- return "802.11b";
- case HOSTAPD_MODE_IEEE80211G:
- return "802.11g";
- case HOSTAPD_MODE_IEEE80211A:
- return "802.11a";
- case HOSTAPD_MODE_IEEE80211AD:
- return "802.11ad";
- default:
- return "?";
- }
-}
-
-
-static void nl80211_dump_chan_list(struct hostapd_hw_modes *modes,
- u16 num_modes)
-{
- int i;
-
- if (!modes)
- return;
-
- for (i = 0; i < num_modes; i++) {
- struct hostapd_hw_modes *mode = &modes[i];
- char str[200];
- char *pos = str;
- char *end = pos + sizeof(str);
- int j, res;
-
- for (j = 0; j < mode->num_channels; j++) {
- struct hostapd_channel_data *chan = &mode->channels[j];
-
- res = os_snprintf(pos, end - pos, " %d%s%s%s",
- chan->freq,
- (chan->flag & HOSTAPD_CHAN_DISABLED) ?
- "[DISABLED]" : "",
- (chan->flag & HOSTAPD_CHAN_NO_IR) ?
- "[NO_IR]" : "",
- (chan->flag & HOSTAPD_CHAN_RADAR) ?
- "[RADAR]" : "");
- if (os_snprintf_error(end - pos, res))
- break;
- pos += res;
- }
-
- *pos = '\0';
- wpa_printf(MSG_DEBUG, "nl80211: Mode IEEE %s:%s",
- modestr(mode->mode), str);
- }
-}
-
-
struct hostapd_hw_modes *
nl80211_get_hw_feature_data(void *priv, u16 *num_modes, u16 *flags,
u8 *dfs_domain)
@@ -2173,8 +1963,6 @@
}
if (send_and_recv_msgs(drv, msg, phy_info_handler, &result) == 0) {
- struct hostapd_hw_modes *modes;
-
nl80211_set_regulatory_flags(drv, &result);
if (result.failed) {
int i;
@@ -2190,10 +1978,8 @@
*dfs_domain = result.dfs_domain;
- modes = wpa_driver_nl80211_postprocess_modes(result.modes,
- num_modes);
- nl80211_dump_chan_list(modes, *num_modes);
- return modes;
+ return wpa_driver_nl80211_postprocess_modes(result.modes,
+ num_modes);
}
return NULL;
diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c
index 06e619b..5b8efbc 100644
--- a/src/drivers/driver_nl80211_event.c
+++ b/src/drivers/driver_nl80211_event.c
@@ -754,12 +754,12 @@
* disconnection event for the old AP may show up after
* we have started connection with the new AP.
*/
- wpa_printf(MSG_DEBUG,
- "nl80211: Ignore deauth/disassoc event from old AP "
- MACSTR
- " when already connecting with " MACSTR,
- MAC2STR(bssid),
- MAC2STR(drv->auth_attempt_bssid));
+ wpa_printf(MSG_DEBUG,
+ "nl80211: Ignore deauth/disassoc event from old AP "
+ MACSTR
+ " when already connecting with " MACSTR,
+ MAC2STR(bssid),
+ MAC2STR(drv->auth_attempt_bssid));
return;
}
@@ -2183,54 +2183,6 @@
}
-static void nl80211_dump_freq(const char *title, struct nlattr *nl_freq)
-{
- static struct nla_policy freq_policy[NL80211_FREQUENCY_ATTR_MAX + 1] = {
- [NL80211_FREQUENCY_ATTR_FREQ] = { .type = NLA_U32 },
- [NL80211_FREQUENCY_ATTR_DISABLED] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_NO_IR] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_RADAR] = { .type = NLA_FLAG },
- [NL80211_FREQUENCY_ATTR_MAX_TX_POWER] = { .type = NLA_U32 },
- };
- struct nlattr *tb[NL80211_FREQUENCY_ATTR_MAX + 1];
- u32 freq = 0, max_tx_power = 0;
-
- nla_parse(tb, NL80211_FREQUENCY_ATTR_MAX,
- nla_data(nl_freq), nla_len(nl_freq), freq_policy);
-
- if (tb[NL80211_FREQUENCY_ATTR_FREQ])
- freq = nla_get_u32(tb[NL80211_FREQUENCY_ATTR_FREQ]);
- if (tb[NL80211_FREQUENCY_ATTR_MAX_TX_POWER])
- max_tx_power =
- nla_get_u32(tb[NL80211_FREQUENCY_ATTR_MAX_TX_POWER]);
-
- wpa_printf(MSG_DEBUG,
- "nl80211: Channel (%s): freq=%u max_tx_power=%u%s%s%s",
- title, freq, max_tx_power,
- tb[NL80211_FREQUENCY_ATTR_DISABLED] ? " disabled" : "",
- tb[NL80211_FREQUENCY_ATTR_NO_IR] ? " no-IR" : "",
- tb[NL80211_FREQUENCY_ATTR_RADAR] ? " radar" : "");
-}
-
-
-static void nl80211_reg_beacon_hint_event(struct wpa_driver_nl80211_data *drv,
- struct nlattr *tb[])
-{
- union wpa_event_data data;
-
- wpa_printf(MSG_DEBUG, "nl80211: Regulatory beacon hint");
- os_memset(&data, 0, sizeof(data));
- data.channel_list_changed.initiator = REGDOM_BEACON_HINT;
-
- if (tb[NL80211_ATTR_FREQ_BEFORE])
- nl80211_dump_freq("before", tb[NL80211_ATTR_FREQ_BEFORE]);
- if (tb[NL80211_ATTR_FREQ_AFTER])
- nl80211_dump_freq("after", tb[NL80211_ATTR_FREQ_AFTER]);
-
- wpa_supplicant_event(drv->ctx, EVENT_CHANNEL_LIST_CHANGED, &data);
-}
-
-
static void nl80211_external_auth(struct wpa_driver_nl80211_data *drv,
struct nlattr **tb)
{
@@ -2319,7 +2271,7 @@
ed.sta_opmode.addr = nla_data(tb[NL80211_ATTR_MAC]);
if (tb[NL80211_ATTR_SMPS_MODE]) {
- smps_mode = nla_get_u8(tb[NL80211_ATTR_SMPS_MODE]);
+ smps_mode = nla_get_u32(tb[NL80211_ATTR_SMPS_MODE]);
switch (smps_mode) {
case NL80211_SMPS_OFF:
ed.sta_opmode.smps_mode = SMPS_OFF;
@@ -2375,6 +2327,7 @@
struct nlattr **tb)
{
struct wpa_driver_nl80211_data *drv = bss->drv;
+ union wpa_event_data data;
int external_scan_event = 0;
wpa_printf(MSG_DEBUG, "nl80211: Drv Event %d (%s) received for %s",
@@ -2527,7 +2480,11 @@
nl80211_reg_change_event(drv, tb);
break;
case NL80211_CMD_REG_BEACON_HINT:
- nl80211_reg_beacon_hint_event(drv, tb);
+ wpa_printf(MSG_DEBUG, "nl80211: Regulatory beacon hint");
+ os_memset(&data, 0, sizeof(data));
+ data.channel_list_changed.initiator = REGDOM_BEACON_HINT;
+ wpa_supplicant_event(drv->ctx, EVENT_CHANNEL_LIST_CHANGED,
+ &data);
break;
case NL80211_CMD_NEW_STATION:
nl80211_new_station_event(drv, bss, tb);
diff --git a/src/drivers/driver_nl80211_scan.c b/src/drivers/driver_nl80211_scan.c
index 33a8d35..86501f4 100644
--- a/src/drivers/driver_nl80211_scan.c
+++ b/src/drivers/driver_nl80211_scan.c
@@ -866,8 +866,7 @@
"mismatch (" MACSTR ")", MAC2STR(addr));
wpa_driver_nl80211_mlme(drv, addr,
NL80211_CMD_DEAUTHENTICATE,
- WLAN_REASON_PREV_AUTH_NOT_VALID, 1,
- NULL);
+ WLAN_REASON_PREV_AUTH_NOT_VALID, 1);
}
}
diff --git a/src/drivers/driver_openbsd.c b/src/drivers/driver_openbsd.c
index c06e75c..e94eda0 100644
--- a/src/drivers/driver_openbsd.c
+++ b/src/drivers/driver_openbsd.c
@@ -62,8 +62,7 @@
wpa_driver_openbsd_get_capa(void *priv, struct wpa_driver_capa *capa)
{
os_memset(capa, 0, sizeof(*capa));
- capa->flags = WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK |
- WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X;
+ capa->flags = WPA_DRIVER_FLAGS_4WAY_HANDSHAKE;
return 0;
}
diff --git a/src/drivers/driver_wext.c b/src/drivers/driver_wext.c
index f7755cc..933b8d9 100644
--- a/src/drivers/driver_wext.c
+++ b/src/drivers/driver_wext.c
@@ -868,16 +868,14 @@
const char *ifname)
{
char buf[200], *res;
- int type, ret;
+ int type;
FILE *f;
if (strcmp(ifname, ".") == 0 || strcmp(ifname, "..") == 0)
return -1;
- ret = snprintf(buf, sizeof(buf), "/sys/class/net/%s/device/net/%s/type",
- drv->ifname, ifname);
- if (os_snprintf_error(sizeof(buf), ret))
- return -1;
+ snprintf(buf, sizeof(buf), "/sys/class/net/%s/device/net/%s/type",
+ drv->ifname, ifname);
f = fopen(buf, "r");
if (!f)
@@ -1647,8 +1645,7 @@
if (range->enc_capa & IW_ENC_CAPA_CIPHER_CCMP)
drv->capa.enc |= WPA_DRIVER_CAPA_ENC_CCMP;
if (range->enc_capa & IW_ENC_CAPA_4WAY_HANDSHAKE)
- drv->capa.flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_PSK |
- WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X;
+ drv->capa.flags |= WPA_DRIVER_FLAGS_4WAY_HANDSHAKE;
drv->capa.auth = WPA_DRIVER_AUTH_OPEN |
WPA_DRIVER_AUTH_SHARED |
WPA_DRIVER_AUTH_LEAP;
@@ -1679,7 +1676,7 @@
wpa_printf(MSG_DEBUG, "%s", __FUNCTION__);
- if (!(drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE_8021X))
+ if (!(drv->capa.flags & WPA_DRIVER_FLAGS_4WAY_HANDSHAKE))
return 0;
if (!psk)
@@ -2431,8 +2428,8 @@
struct iwreq iwr;
os_memset(si, 0, sizeof(*si));
- si->current_signal = -WPA_INVALID_NOISE;
- si->current_noise = WPA_INVALID_NOISE;
+ si->current_signal = -9999;
+ si->current_noise = 9999;
si->chanwidth = CHAN_WIDTH_UNKNOWN;
os_memset(&iwr, 0, sizeof(iwr));
diff --git a/src/drivers/driver_wired.c b/src/drivers/driver_wired.c
index c7537b7..7e09dcf 100644
--- a/src/drivers/driver_wired.c
+++ b/src/drivers/driver_wired.c
@@ -96,16 +96,16 @@
hdr = (struct ieee8023_hdr *) buf;
switch (ntohs(hdr->ethertype)) {
- case ETH_P_PAE:
- wpa_printf(MSG_MSGDUMP, "Received EAPOL packet");
- sa = hdr->src;
- os_memset(&event, 0, sizeof(event));
- event.new_sta.addr = sa;
- wpa_supplicant_event(ctx, EVENT_NEW_STA, &event);
+ case ETH_P_PAE:
+ wpa_printf(MSG_MSGDUMP, "Received EAPOL packet");
+ sa = hdr->src;
+ os_memset(&event, 0, sizeof(event));
+ event.new_sta.addr = sa;
+ wpa_supplicant_event(ctx, EVENT_NEW_STA, &event);
- pos = (u8 *) (hdr + 1);
- left = len - sizeof(*hdr);
- drv_event_eapol_rx(ctx, sa, pos, left);
+ pos = (u8 *) (hdr + 1);
+ left = len - sizeof(*hdr);
+ drv_event_eapol_rx(ctx, sa, pos, left);
break;
default:
diff --git a/src/drivers/drivers.mak b/src/drivers/drivers.mak
index 442c59c..1496b47 100644
--- a/src/drivers/drivers.mak
+++ b/src/drivers/drivers.mak
@@ -22,7 +22,6 @@
DRV_CFLAGS += -DCONFIG_DRIVER_MACSEC_LINUX
DRV_OBJS += ../src/drivers/driver_macsec_linux.o
NEED_DRV_WIRED_COMMON=1
-NEED_LIBNL=y
CONFIG_LIBNL3_ROUTE=y
endif
@@ -52,7 +51,37 @@
NEED_LINUX_IOCTL=y
NEED_RFKILL=y
NEED_RADIOTAP=y
-NEED_LIBNL=y
+
+ifdef CONFIG_LIBNL32
+ DRV_LIBS += -lnl-3
+ DRV_LIBS += -lnl-genl-3
+ DRV_CFLAGS += -DCONFIG_LIBNL20
+ ifdef LIBNL_INC
+ DRV_CFLAGS += -I$(LIBNL_INC)
+ else
+ PKG_CONFIG ?= pkg-config
+ DRV_CFLAGS += $(shell $(PKG_CONFIG) --cflags libnl-3.0)
+ endif
+ifdef CONFIG_LIBNL3_ROUTE
+ DRV_LIBS += -lnl-route-3
+ DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE
+endif
+else
+ ifdef CONFIG_LIBNL_TINY
+ DRV_LIBS += -lnl-tiny
+ else
+ ifndef CONFIG_OSX
+ DRV_LIBS += -lnl
+ endif
+ endif
+
+ ifdef CONFIG_LIBNL20
+ ifndef CONFIG_LIBNL_TINY
+ DRV_LIBS += -lnl-genl
+ endif
+ DRV_CFLAGS += -DCONFIG_LIBNL20
+ endif
+endif
endif
ifdef CONFIG_DRIVER_BSD
@@ -154,55 +183,26 @@
ifdef CONFIG_VLAN_NETLINK
ifdef CONFIG_FULL_DYNAMIC_VLAN
-NEED_LIBNL=y
-CONFIG_LIBNL3_ROUTE=y
-endif
-endif
-
-ifdef NEED_LIBNL
-ifndef CONFIG_LIBNL32
-ifndef CONFIG_LIBNL20
-ifndef CONFIG_LIBNL_TINY
-PKG_CONFIG ?= pkg-config
-HAVE_LIBNL3 := $(shell $(PKG_CONFIG) --exists libnl-3.0; echo $$?)
-ifeq ($(HAVE_LIBNL3),0)
-CONFIG_LIBNL32=y
-endif
-endif
-endif
-endif
-
ifdef CONFIG_LIBNL32
DRV_LIBS += -lnl-3
DRV_LIBS += -lnl-genl-3
+ DRV_LIBS += -lnl-route-3
DRV_CFLAGS += -DCONFIG_LIBNL20
- ifdef LIBNL_INC
- DRV_CFLAGS += -I$(LIBNL_INC)
- else
- PKG_CONFIG ?= pkg-config
- DRV_CFLAGS += $(shell $(PKG_CONFIG) --cflags libnl-3.0)
- endif
- ifdef CONFIG_LIBNL3_ROUTE
- DRV_LIBS += -lnl-route-3
- DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE
- endif
else
ifdef CONFIG_LIBNL_TINY
DRV_LIBS += -lnl-tiny
else
- ifndef CONFIG_OSX
- DRV_LIBS += -lnl
- endif
+ DRV_LIBS += -lnl
endif
ifdef CONFIG_LIBNL20
- ifndef CONFIG_LIBNL_TINY
- DRV_LIBS += -lnl-genl
- endif
+ DRV_LIBS += -lnl-genl
+ DRV_LIBS += -lnl-route
DRV_CFLAGS += -DCONFIG_LIBNL20
endif
endif
endif
+endif
##### COMMON VARS
DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS)
diff --git a/src/drivers/drivers.mk b/src/drivers/drivers.mk
index 599a0b5..cd25133 100644
--- a/src/drivers/drivers.mk
+++ b/src/drivers/drivers.mk
@@ -23,7 +23,6 @@
DRV_OBJS += src/drivers/driver_macsec_linux.c
NEED_DRV_WIRED_COMMON=1
CONFIG_LIBNL3_ROUTE=y
-NEED_LIBNL=y
endif
ifdef NEED_DRV_WIRED_COMMON
@@ -47,7 +46,29 @@
NEED_LINUX_IOCTL=y
NEED_RFKILL=y
NEED_RADIOTAP=y
-NEED_LIBNL=y
+
+ifdef CONFIG_LIBNL32
+ DRV_LIBS += -lnl-3
+ DRV_LIBS += -lnl-genl-3
+ DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3
+ifdef CONFIG_LIBNL3_ROUTE
+ DRV_LIBS += -lnl-route-3
+ DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE
+endif
+else
+ ifdef CONFIG_LIBNL_TINY
+ DRV_LIBS += -lnl-tiny
+ else
+ DRV_LIBS += -lnl
+ endif
+
+ ifdef CONFIG_LIBNL20
+ ifndef CONFIG_LIBNL_TINY
+ DRV_LIBS += -lnl-genl
+ endif
+ DRV_CFLAGS += -DCONFIG_LIBNL20
+ endif
+endif
endif
ifdef CONFIG_DRIVER_BSD
@@ -150,20 +171,11 @@
ifdef CONFIG_VLAN_NETLINK
ifdef CONFIG_FULL_DYNAMIC_VLAN
-NEED_LIBNL=y
-CONFIG_LIBNL3_ROUTE=y
-endif
-endif
-
-ifdef NEED_LIBNL
ifdef CONFIG_LIBNL32
DRV_LIBS += -lnl-3
DRV_LIBS += -lnl-genl-3
- DRV_CFLAGS += -DCONFIG_LIBNL20 -I/usr/include/libnl3
-ifdef CONFIG_LIBNL3_ROUTE
DRV_LIBS += -lnl-route-3
- DRV_CFLAGS += -DCONFIG_LIBNL3_ROUTE
-endif
+ DRV_CFLAGS += -DCONFIG_LIBNL20
else
ifdef CONFIG_LIBNL_TINY
DRV_LIBS += -lnl-tiny
@@ -172,13 +184,13 @@
endif
ifdef CONFIG_LIBNL20
- ifndef CONFIG_LIBNL_TINY
- DRV_LIBS += -lnl-genl
- endif
+ DRV_LIBS += -lnl-genl
+ DRV_LIBS += -lnl-route
DRV_CFLAGS += -DCONFIG_LIBNL20
endif
endif
endif
+endif
##### COMMON VARS
DRV_BOTH_CFLAGS := $(DRV_CFLAGS) $(DRV_WPA_CFLAGS) $(DRV_AP_CFLAGS)
diff --git a/src/drivers/linux_ioctl.c b/src/drivers/linux_ioctl.c
index 7edb9df..e21147a 100644
--- a/src/drivers/linux_ioctl.c
+++ b/src/drivers/linux_ioctl.c
@@ -12,7 +12,6 @@
#include <net/if_arp.h>
#include "utils/common.h"
-#include "common/linux_bridge.h"
#include "linux_ioctl.h"
@@ -120,14 +119,25 @@
}
+#ifndef SIOCBRADDBR
+#define SIOCBRADDBR 0x89a0
+#endif
+#ifndef SIOCBRDELBR
+#define SIOCBRDELBR 0x89a1
+#endif
+#ifndef SIOCBRADDIF
+#define SIOCBRADDIF 0x89a2
+#endif
+#ifndef SIOCBRDELIF
+#define SIOCBRDELIF 0x89a3
+#endif
+
+
int linux_br_add(int sock, const char *brname)
{
if (ioctl(sock, SIOCBRADDBR, brname) < 0) {
- int saved_errno = errno;
-
wpa_printf(MSG_DEBUG, "Could not add bridge %s: %s",
brname, strerror(errno));
- errno = saved_errno;
return -1;
}
@@ -160,11 +170,8 @@
os_strlcpy(ifr.ifr_name, brname, IFNAMSIZ);
ifr.ifr_ifindex = ifindex;
if (ioctl(sock, SIOCBRADDIF, &ifr) < 0) {
- int saved_errno = errno;
-
wpa_printf(MSG_DEBUG, "Could not add interface %s into bridge "
"%s: %s", ifname, brname, strerror(errno));
- errno = saved_errno;
return -1;
}
diff --git a/src/drivers/nl80211_copy.h b/src/drivers/nl80211_copy.h
index 31ae5c7..1766a12 100644
--- a/src/drivers/nl80211_copy.h
+++ b/src/drivers/nl80211_copy.h
@@ -1033,38 +1033,6 @@
* %NL80211_ATTR_CHANNEL_WIDTH,%NL80211_ATTR_NSS attributes with its
* address(specified in %NL80211_ATTR_MAC).
*
- * @NL80211_CMD_GET_FTM_RESPONDER_STATS: Retrieve FTM responder statistics, in
- * the %NL80211_ATTR_FTM_RESPONDER_STATS attribute.
- *
- * @NL80211_CMD_PEER_MEASUREMENT_START: start a (set of) peer measurement(s)
- * with the given parameters, which are encapsulated in the nested
- * %NL80211_ATTR_PEER_MEASUREMENTS attribute. Optionally, MAC address
- * randomization may be enabled and configured by specifying the
- * %NL80211_ATTR_MAC and %NL80211_ATTR_MAC_MASK attributes.
- * If a timeout is requested, use the %NL80211_ATTR_TIMEOUT attribute.
- * A u64 cookie for further %NL80211_ATTR_COOKIE use is is returned in
- * the netlink extended ack message.
- *
- * To cancel a measurement, close the socket that requested it.
- *
- * Measurement results are reported to the socket that requested the
- * measurement using @NL80211_CMD_PEER_MEASUREMENT_RESULT when they
- * become available, so applications must ensure a large enough socket
- * buffer size.
- *
- * Depending on driver support it may or may not be possible to start
- * multiple concurrent measurements.
- * @NL80211_CMD_PEER_MEASUREMENT_RESULT: This command number is used for the
- * result notification from the driver to the requesting socket.
- * @NL80211_CMD_PEER_MEASUREMENT_COMPLETE: Notification only, indicating that
- * the measurement completed, using the measurement cookie
- * (%NL80211_ATTR_COOKIE).
- *
- * @NL80211_CMD_NOTIFY_RADAR: Notify the kernel that a radar signal was
- * detected and reported by a neighboring device on the channel
- * indicated by %NL80211_ATTR_WIPHY_FREQ and other attributes
- * determining the width and type.
- *
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
@@ -1277,14 +1245,6 @@
NL80211_CMD_CONTROL_PORT_FRAME,
- NL80211_CMD_GET_FTM_RESPONDER_STATS,
-
- NL80211_CMD_PEER_MEASUREMENT_START,
- NL80211_CMD_PEER_MEASUREMENT_RESULT,
- NL80211_CMD_PEER_MEASUREMENT_COMPLETE,
-
- NL80211_CMD_NOTIFY_RADAR,
-
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
@@ -1741,7 +1701,7 @@
* the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID
* is included in the probe request, but the match attributes
* will never let it go through), -EINVAL may be returned.
- * If omitted, no filtering is done.
+ * If ommited, no filtering is done.
*
* @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
* interface combinations. In each nested item, it contains attributes
@@ -1846,7 +1806,7 @@
*
* @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
* used by the drivers which has MLME in firmware and does not have support
- * to report per station tx/rx activity to free up the station entry from
+ * to report per station tx/rx activity to free up the staion entry from
* the list. This needs to be used when the driver advertises the
* capability to timeout the stations.
*
@@ -2207,7 +2167,7 @@
*
* @NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST: When present the RSSI level for BSSs in
* the specified band is to be adjusted before doing
- * %NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI based comparison to figure out
+ * %NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI based comparision to figure out
* better BSSs. The attribute value is a packed structure
* value as specified by &struct nl80211_bss_select_rssi_adjust.
*
@@ -2281,24 +2241,6 @@
* association request when used with NL80211_CMD_NEW_STATION). Can be set
* only if %NL80211_STA_FLAG_WME is set.
*
- * @NL80211_ATTR_FTM_RESPONDER: nested attribute which user-space can include
- * in %NL80211_CMD_START_AP or %NL80211_CMD_SET_BEACON for fine timing
- * measurement (FTM) responder functionality and containing parameters as
- * possible, see &enum nl80211_ftm_responder_attr
- *
- * @NL80211_ATTR_FTM_RESPONDER_STATS: Nested attribute with FTM responder
- * statistics, see &enum nl80211_ftm_responder_stats.
- *
- * @NL80211_ATTR_TIMEOUT: Timeout for the given operation in milliseconds (u32),
- * if the attribute is not given no timeout is requested. Note that 0 is an
- * invalid value.
- *
- * @NL80211_ATTR_PEER_MEASUREMENTS: peer measurements request (and result)
- * data, uses nested attributes specified in
- * &enum nl80211_peer_measurement_attrs.
- * This is also used for capability advertisement in the wiphy information,
- * with the appropriate sub-attributes.
- *
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
@@ -2740,14 +2682,6 @@
NL80211_ATTR_HE_CAPABILITY,
- NL80211_ATTR_FTM_RESPONDER,
-
- NL80211_ATTR_FTM_RESPONDER_STATS,
-
- NL80211_ATTR_TIMEOUT,
-
- NL80211_ATTR_PEER_MEASUREMENTS,
-
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -3117,14 +3051,6 @@
* @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment
* @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)
* @NL80211_STA_INFO_ACK_SIGNAL_AVG: avg signal strength of ACK frames (s8, dBm)
- * @NL80211_STA_INFO_RX_MPDUS: total number of received packets (MPDUs)
- * (u32, from this station)
- * @NL80211_STA_INFO_FCS_ERROR_COUNT: total number of packets (MPDUs) received
- * with an FCS error (u32, from this station). This count may not include
- * some packets with an FCS error due to TA corruption. Hence this counter
- * might not be fully accurate.
- * @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a
- * mesh gate (u8, 0 or 1)
* @__NL80211_STA_INFO_AFTER_LAST: internal
* @NL80211_STA_INFO_MAX: highest possible station info attribute
*/
@@ -3165,9 +3091,6 @@
NL80211_STA_INFO_PAD,
NL80211_STA_INFO_ACK_SIGNAL,
NL80211_STA_INFO_ACK_SIGNAL_AVG,
- NL80211_STA_INFO_RX_MPDUS,
- NL80211_STA_INFO_FCS_ERROR_COUNT,
- NL80211_STA_INFO_CONNECTED_TO_GATE,
/* keep last */
__NL80211_STA_INFO_AFTER_LAST,
@@ -3947,11 +3870,6 @@
* remove it from the STA's list of peers. You may set this to 0 to disable
* the removal of the STA. Default is 30 minutes.
*
- * @NL80211_MESHCONF_CONNECTED_TO_GATE: If set to true then this mesh STA
- * will advertise that it is connected to a gate in the mesh formation
- * field. If left unset then the mesh formation field will only
- * advertise such if there is an active root mesh path.
- *
* @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
*/
enum nl80211_meshconf_params {
@@ -3984,7 +3902,6 @@
NL80211_MESHCONF_POWER_MODE,
NL80211_MESHCONF_AWAKE_WINDOW,
NL80211_MESHCONF_PLINK_TIMEOUT,
- NL80211_MESHCONF_CONNECTED_TO_GATE,
/* keep last */
__NL80211_MESHCONF_ATTR_AFTER_LAST,
@@ -4917,7 +4834,7 @@
* numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
* => allows a STA plus three P2P interfaces
*
- * The list of these four possibilities could completely be contained
+ * The list of these four possiblities could completely be contained
* within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate
* that any of these groups must match.
*
@@ -4947,7 +4864,7 @@
* enum nl80211_plink_state - state of a mesh peer link finite state machine
*
* @NL80211_PLINK_LISTEN: initial state, considered the implicit
- * state of non existent mesh peer links
+ * state of non existant mesh peer links
* @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
* this mesh peer
* @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
@@ -5308,13 +5225,6 @@
* @NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT: Driver/device can omit all data
* except for supported rates from the probe request content if requested
* by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag.
- * @NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER: Driver supports enabling fine
- * timing measurement responder role.
- *
- * @NL80211_EXT_FEATURE_CAN_REPLACE_PTK0: Driver/device confirm that they are
- * able to rekey an in-use key correctly. Userspace must not rekey PTK keys
- * if this flag is not set. Ignoring this can leak clear text packets and/or
- * freeze the connection.
*
* @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
@@ -5353,8 +5263,6 @@
NL80211_EXT_FEATURE_TXQS,
NL80211_EXT_FEATURE_SCAN_RANDOM_SN,
NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
- NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
- NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
@@ -5439,7 +5347,7 @@
* request parameters IE in the probe request
* @NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe responses
* @NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE: send probe request frames at
- * rate of at least 5.5M. In case non OCE AP is discovered in the channel,
+ * rate of at least 5.5M. In case non OCE AP is dicovered in the channel,
* only the first probe req in the channel will be sent in high rate.
* @NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: allow probe request
* tx deferral (dot11FILSProbeDelay shall be set to 15ms)
@@ -5894,458 +5802,4 @@
NL80211_EXTERNAL_AUTH_ABORT,
};
-/**
- * enum nl80211_ftm_responder_attributes - fine timing measurement
- * responder attributes
- * @__NL80211_FTM_RESP_ATTR_INVALID: Invalid
- * @NL80211_FTM_RESP_ATTR_ENABLED: FTM responder is enabled
- * @NL80211_FTM_RESP_ATTR_LCI: The content of Measurement Report Element
- * (9.4.2.22 in 802.11-2016) with type 8 - LCI (9.4.2.22.10),
- * i.e. starting with the measurement token
- * @NL80211_FTM_RESP_ATTR_CIVIC: The content of Measurement Report Element
- * (9.4.2.22 in 802.11-2016) with type 11 - Civic (Section 9.4.2.22.13),
- * i.e. starting with the measurement token
- * @__NL80211_FTM_RESP_ATTR_LAST: Internal
- * @NL80211_FTM_RESP_ATTR_MAX: highest FTM responder attribute.
- */
-enum nl80211_ftm_responder_attributes {
- __NL80211_FTM_RESP_ATTR_INVALID,
-
- NL80211_FTM_RESP_ATTR_ENABLED,
- NL80211_FTM_RESP_ATTR_LCI,
- NL80211_FTM_RESP_ATTR_CIVICLOC,
-
- /* keep last */
- __NL80211_FTM_RESP_ATTR_LAST,
- NL80211_FTM_RESP_ATTR_MAX = __NL80211_FTM_RESP_ATTR_LAST - 1,
-};
-
-/*
- * enum nl80211_ftm_responder_stats - FTM responder statistics
- *
- * These attribute types are used with %NL80211_ATTR_FTM_RESPONDER_STATS
- * when getting FTM responder statistics.
- *
- * @__NL80211_FTM_STATS_INVALID: attribute number 0 is reserved
- * @NL80211_FTM_STATS_SUCCESS_NUM: number of FTM sessions in which all frames
- * were ssfully answered (u32)
- * @NL80211_FTM_STATS_PARTIAL_NUM: number of FTM sessions in which part of the
- * frames were successfully answered (u32)
- * @NL80211_FTM_STATS_FAILED_NUM: number of failed FTM sessions (u32)
- * @NL80211_FTM_STATS_ASAP_NUM: number of ASAP sessions (u32)
- * @NL80211_FTM_STATS_NON_ASAP_NUM: number of non-ASAP sessions (u32)
- * @NL80211_FTM_STATS_TOTAL_DURATION_MSEC: total sessions durations - gives an
- * indication of how much time the responder was busy (u64, msec)
- * @NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM: number of unknown FTM triggers -
- * triggers from initiators that didn't finish successfully the negotiation
- * phase with the responder (u32)
- * @NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM: number of FTM reschedule requests
- * - initiator asks for a new scheduling although it already has scheduled
- * FTM slot (u32)
- * @NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM: number of FTM triggers out of
- * scheduled window (u32)
- * @NL80211_FTM_STATS_PAD: used for padding, ignore
- * @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
- * @NL80211_FTM_STATS_MAX: highest possible FTM responder stats attribute
- */
-enum nl80211_ftm_responder_stats {
- __NL80211_FTM_STATS_INVALID,
- NL80211_FTM_STATS_SUCCESS_NUM,
- NL80211_FTM_STATS_PARTIAL_NUM,
- NL80211_FTM_STATS_FAILED_NUM,
- NL80211_FTM_STATS_ASAP_NUM,
- NL80211_FTM_STATS_NON_ASAP_NUM,
- NL80211_FTM_STATS_TOTAL_DURATION_MSEC,
- NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM,
- NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM,
- NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM,
- NL80211_FTM_STATS_PAD,
-
- /* keep last */
- __NL80211_FTM_STATS_AFTER_LAST,
- NL80211_FTM_STATS_MAX = __NL80211_FTM_STATS_AFTER_LAST - 1
-};
-
-/**
- * enum nl80211_preamble - frame preamble types
- * @NL80211_PREAMBLE_LEGACY: legacy (HR/DSSS, OFDM, ERP PHY) preamble
- * @NL80211_PREAMBLE_HT: HT preamble
- * @NL80211_PREAMBLE_VHT: VHT preamble
- * @NL80211_PREAMBLE_DMG: DMG preamble
- */
-enum nl80211_preamble {
- NL80211_PREAMBLE_LEGACY,
- NL80211_PREAMBLE_HT,
- NL80211_PREAMBLE_VHT,
- NL80211_PREAMBLE_DMG,
-};
-
-/**
- * enum nl80211_peer_measurement_type - peer measurement types
- * @NL80211_PMSR_TYPE_INVALID: invalid/unused, needed as we use
- * these numbers also for attributes
- *
- * @NL80211_PMSR_TYPE_FTM: flight time measurement
- *
- * @NUM_NL80211_PMSR_TYPES: internal
- * @NL80211_PMSR_TYPE_MAX: highest type number
- */
-enum nl80211_peer_measurement_type {
- NL80211_PMSR_TYPE_INVALID,
-
- NL80211_PMSR_TYPE_FTM,
-
- NUM_NL80211_PMSR_TYPES,
- NL80211_PMSR_TYPE_MAX = NUM_NL80211_PMSR_TYPES - 1
-};
-
-/**
- * enum nl80211_peer_measurement_status - peer measurement status
- * @NL80211_PMSR_STATUS_SUCCESS: measurement completed successfully
- * @NL80211_PMSR_STATUS_REFUSED: measurement was locally refused
- * @NL80211_PMSR_STATUS_TIMEOUT: measurement timed out
- * @NL80211_PMSR_STATUS_FAILURE: measurement failed, a type-dependent
- * reason may be available in the response data
- */
-enum nl80211_peer_measurement_status {
- NL80211_PMSR_STATUS_SUCCESS,
- NL80211_PMSR_STATUS_REFUSED,
- NL80211_PMSR_STATUS_TIMEOUT,
- NL80211_PMSR_STATUS_FAILURE,
-};
-
-/**
- * enum nl80211_peer_measurement_req - peer measurement request attributes
- * @__NL80211_PMSR_REQ_ATTR_INVALID: invalid
- *
- * @NL80211_PMSR_REQ_ATTR_DATA: This is a nested attribute with measurement
- * type-specific request data inside. The attributes used are from the
- * enums named nl80211_peer_measurement_<type>_req.
- * @NL80211_PMSR_REQ_ATTR_GET_AP_TSF: include AP TSF timestamp, if supported
- * (flag attribute)
- *
- * @NUM_NL80211_PMSR_REQ_ATTRS: internal
- * @NL80211_PMSR_REQ_ATTR_MAX: highest attribute number
- */
-enum nl80211_peer_measurement_req {
- __NL80211_PMSR_REQ_ATTR_INVALID,
-
- NL80211_PMSR_REQ_ATTR_DATA,
- NL80211_PMSR_REQ_ATTR_GET_AP_TSF,
-
- /* keep last */
- NUM_NL80211_PMSR_REQ_ATTRS,
- NL80211_PMSR_REQ_ATTR_MAX = NUM_NL80211_PMSR_REQ_ATTRS - 1
-};
-
-/**
- * enum nl80211_peer_measurement_resp - peer measurement response attributes
- * @__NL80211_PMSR_RESP_ATTR_INVALID: invalid
- *
- * @NL80211_PMSR_RESP_ATTR_DATA: This is a nested attribute with measurement
- * type-specific results inside. The attributes used are from the enums
- * named nl80211_peer_measurement_<type>_resp.
- * @NL80211_PMSR_RESP_ATTR_STATUS: u32 value with the measurement status
- * (using values from &enum nl80211_peer_measurement_status.)
- * @NL80211_PMSR_RESP_ATTR_HOST_TIME: host time (%CLOCK_BOOTTIME) when the
- * result was measured; this value is not expected to be accurate to
- * more than 20ms. (u64, nanoseconds)
- * @NL80211_PMSR_RESP_ATTR_AP_TSF: TSF of the AP that the interface
- * doing the measurement is connected to when the result was measured.
- * This shall be accurately reported if supported and requested
- * (u64, usec)
- * @NL80211_PMSR_RESP_ATTR_FINAL: If results are sent to the host partially
- * (*e.g. with FTM per-burst data) this flag will be cleared on all but
- * the last result; if all results are combined it's set on the single
- * result.
- * @NL80211_PMSR_RESP_ATTR_PAD: padding for 64-bit attributes, ignore
- *
- * @NUM_NL80211_PMSR_RESP_ATTRS: internal
- * @NL80211_PMSR_RESP_ATTR_MAX: highest attribute number
- */
-enum nl80211_peer_measurement_resp {
- __NL80211_PMSR_RESP_ATTR_INVALID,
-
- NL80211_PMSR_RESP_ATTR_DATA,
- NL80211_PMSR_RESP_ATTR_STATUS,
- NL80211_PMSR_RESP_ATTR_HOST_TIME,
- NL80211_PMSR_RESP_ATTR_AP_TSF,
- NL80211_PMSR_RESP_ATTR_FINAL,
- NL80211_PMSR_RESP_ATTR_PAD,
-
- /* keep last */
- NUM_NL80211_PMSR_RESP_ATTRS,
- NL80211_PMSR_RESP_ATTR_MAX = NUM_NL80211_PMSR_RESP_ATTRS - 1
-};
-
-/**
- * enum nl80211_peer_measurement_peer_attrs - peer attributes for measurement
- * @__NL80211_PMSR_PEER_ATTR_INVALID: invalid
- *
- * @NL80211_PMSR_PEER_ATTR_ADDR: peer's MAC address
- * @NL80211_PMSR_PEER_ATTR_CHAN: channel definition, nested, using top-level
- * attributes like %NL80211_ATTR_WIPHY_FREQ etc.
- * @NL80211_PMSR_PEER_ATTR_REQ: This is a nested attribute indexed by
- * measurement type, with attributes from the
- * &enum nl80211_peer_measurement_req inside.
- * @NL80211_PMSR_PEER_ATTR_RESP: This is a nested attribute indexed by
- * measurement type, with attributes from the
- * &enum nl80211_peer_measurement_resp inside.
- *
- * @NUM_NL80211_PMSR_PEER_ATTRS: internal
- * @NL80211_PMSR_PEER_ATTR_MAX: highest attribute number
- */
-enum nl80211_peer_measurement_peer_attrs {
- __NL80211_PMSR_PEER_ATTR_INVALID,
-
- NL80211_PMSR_PEER_ATTR_ADDR,
- NL80211_PMSR_PEER_ATTR_CHAN,
- NL80211_PMSR_PEER_ATTR_REQ,
- NL80211_PMSR_PEER_ATTR_RESP,
-
- /* keep last */
- NUM_NL80211_PMSR_PEER_ATTRS,
- NL80211_PMSR_PEER_ATTR_MAX = NUM_NL80211_PMSR_PEER_ATTRS - 1,
-};
-
-/**
- * enum nl80211_peer_measurement_attrs - peer measurement attributes
- * @__NL80211_PMSR_ATTR_INVALID: invalid
- *
- * @NL80211_PMSR_ATTR_MAX_PEERS: u32 attribute used for capability
- * advertisement only, indicates the maximum number of peers
- * measurements can be done with in a single request
- * @NL80211_PMSR_ATTR_REPORT_AP_TSF: flag attribute in capability
- * indicating that the connected AP's TSF can be reported in
- * measurement results
- * @NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR: flag attribute in capability
- * indicating that MAC address randomization is supported.
- * @NL80211_PMSR_ATTR_TYPE_CAPA: capabilities reported by the device,
- * this contains a nesting indexed by measurement type, and
- * type-specific capabilities inside, which are from the enums
- * named nl80211_peer_measurement_<type>_capa.
- * @NL80211_PMSR_ATTR_PEERS: nested attribute, the nesting index is
- * meaningless, just a list of peers to measure with, with the
- * sub-attributes taken from
- * &enum nl80211_peer_measurement_peer_attrs.
- *
- * @NUM_NL80211_PMSR_ATTR: internal
- * @NL80211_PMSR_ATTR_MAX: highest attribute number
- */
-enum nl80211_peer_measurement_attrs {
- __NL80211_PMSR_ATTR_INVALID,
-
- NL80211_PMSR_ATTR_MAX_PEERS,
- NL80211_PMSR_ATTR_REPORT_AP_TSF,
- NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR,
- NL80211_PMSR_ATTR_TYPE_CAPA,
- NL80211_PMSR_ATTR_PEERS,
-
- /* keep last */
- NUM_NL80211_PMSR_ATTR,
- NL80211_PMSR_ATTR_MAX = NUM_NL80211_PMSR_ATTR - 1
-};
-
-/**
- * enum nl80211_peer_measurement_ftm_capa - FTM capabilities
- * @__NL80211_PMSR_FTM_CAPA_ATTR_INVALID: invalid
- *
- * @NL80211_PMSR_FTM_CAPA_ATTR_ASAP: flag attribute indicating ASAP mode
- * is supported
- * @NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP: flag attribute indicating non-ASAP
- * mode is supported
- * @NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI: flag attribute indicating if LCI
- * data can be requested during the measurement
- * @NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC: flag attribute indicating if civic
- * location data can be requested during the measurement
- * @NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES: u32 bitmap attribute of bits
- * from &enum nl80211_preamble.
- * @NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS: bitmap of values from
- * &enum nl80211_chan_width indicating the supported channel
- * bandwidths for FTM. Note that a higher channel bandwidth may be
- * configured to allow for other measurements types with different
- * bandwidth requirement in the same measurement.
- * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT: u32 attribute indicating
- * the maximum bursts exponent that can be used (if not present anything
- * is valid)
- * @NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST: u32 attribute indicating
- * the maximum FTMs per burst (if not present anything is valid)
- *
- * @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
- * @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
- */
-enum nl80211_peer_measurement_ftm_capa {
- __NL80211_PMSR_FTM_CAPA_ATTR_INVALID,
-
- NL80211_PMSR_FTM_CAPA_ATTR_ASAP,
- NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP,
- NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI,
- NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC,
- NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES,
- NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS,
- NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT,
- NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST,
-
- /* keep last */
- NUM_NL80211_PMSR_FTM_CAPA_ATTR,
- NL80211_PMSR_FTM_CAPA_ATTR_MAX = NUM_NL80211_PMSR_FTM_CAPA_ATTR - 1
-};
-
-/**
- * enum nl80211_peer_measurement_ftm_req - FTM request attributes
- * @__NL80211_PMSR_FTM_REQ_ATTR_INVALID: invalid
- *
- * @NL80211_PMSR_FTM_REQ_ATTR_ASAP: ASAP mode requested (flag)
- * @NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE: preamble type (see
- * &enum nl80211_preamble), optional for DMG (u32)
- * @NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP: number of bursts exponent as in
- * 802.11-2016 9.4.2.168 "Fine Timing Measurement Parameters element"
- * (u8, 0-15, optional with default 15 i.e. "no preference")
- * @NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD: interval between bursts in units
- * of 100ms (u16, optional with default 0)
- * @NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION: burst duration, as in 802.11-2016
- * Table 9-257 "Burst Duration field encoding" (u8, 0-15, optional with
- * default 15 i.e. "no preference")
- * @NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST: number of successful FTM frames
- * requested per burst
- * (u8, 0-31, optional with default 0 i.e. "no preference")
- * @NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES: number of FTMR frame retries
- * (u8, default 3)
- * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag)
- * @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC: request civic location data
- * (flag)
- *
- * @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
- * @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
- */
-enum nl80211_peer_measurement_ftm_req {
- __NL80211_PMSR_FTM_REQ_ATTR_INVALID,
-
- NL80211_PMSR_FTM_REQ_ATTR_ASAP,
- NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE,
- NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP,
- NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD,
- NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION,
- NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST,
- NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES,
- NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI,
- NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC,
-
- /* keep last */
- NUM_NL80211_PMSR_FTM_REQ_ATTR,
- NL80211_PMSR_FTM_REQ_ATTR_MAX = NUM_NL80211_PMSR_FTM_REQ_ATTR - 1
-};
-
-/**
- * enum nl80211_peer_measurement_ftm_failure_reasons - FTM failure reasons
- * @NL80211_PMSR_FTM_FAILURE_UNSPECIFIED: unspecified failure, not used
- * @NL80211_PMSR_FTM_FAILURE_NO_RESPONSE: no response from the FTM responder
- * @NL80211_PMSR_FTM_FAILURE_REJECTED: FTM responder rejected measurement
- * @NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL: we already know the peer is
- * on a different channel, so can't measure (if we didn't know, we'd
- * try and get no response)
- * @NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE: peer can't actually do FTM
- * @NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP: invalid T1/T4 timestamps
- * received
- * @NL80211_PMSR_FTM_FAILURE_PEER_BUSY: peer reports busy, you may retry
- * later (see %NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME)
- * @NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS: parameters were changed
- * by the peer and are no longer supported
- */
-enum nl80211_peer_measurement_ftm_failure_reasons {
- NL80211_PMSR_FTM_FAILURE_UNSPECIFIED,
- NL80211_PMSR_FTM_FAILURE_NO_RESPONSE,
- NL80211_PMSR_FTM_FAILURE_REJECTED,
- NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL,
- NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE,
- NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP,
- NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
- NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS,
-};
-
-/**
- * enum nl80211_peer_measurement_ftm_resp - FTM response attributes
- * @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid
- *
- * @NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON: FTM-specific failure reason
- * (u32, optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX: optional, if bursts are reported
- * as separate results then it will be the burst index 0...(N-1) and
- * the top level will indicate partial results (u32)
- * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS: number of FTM Request frames
- * transmitted (u32, optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES: number of FTM Request frames
- * that were acknowleged (u32, optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME: retry time received from the
- * busy peer (u32, seconds)
- * @NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP: actual number of bursts exponent
- * used by the responder (similar to request, u8)
- * @NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION: actual burst duration used by
- * the responder (similar to request, u8)
- * @NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST: actual FTMs per burst used
- * by the responder (similar to request, u8)
- * @NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG: average RSSI across all FTM action
- * frames (optional, s32, 1/2 dBm)
- * @NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD: RSSI spread across all FTM action
- * frames (optional, s32, 1/2 dBm)
- * @NL80211_PMSR_FTM_RESP_ATTR_TX_RATE: bitrate we used for the response to the
- * FTM action frame (optional, nested, using &enum nl80211_rate_info
- * attributes)
- * @NL80211_PMSR_FTM_RESP_ATTR_RX_RATE: bitrate the responder used for the FTM
- * action frame (optional, nested, using &enum nl80211_rate_info attrs)
- * @NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG: average RTT (s64, picoseconds, optional
- * but one of RTT/DIST must be present)
- * @NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE: RTT variance (u64, ps^2, note that
- * standard deviation is the square root of variance, optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD: RTT spread (u64, picoseconds,
- * optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG: average distance (s64, mm, optional
- * but one of RTT/DIST must be present)
- * @NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE: distance variance (u64, mm^2, note
- * that standard deviation is the square root of variance, optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD: distance spread (u64, mm, optional)
- * @NL80211_PMSR_FTM_RESP_ATTR_LCI: LCI data from peer (binary, optional);
- * this is the contents of the Measurement Report Element (802.11-2016
- * 9.4.2.22.1) starting with the Measurement Token, with Measurement
- * Type 8.
- * @NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC: civic location data from peer
- * (binary, optional);
- * this is the contents of the Measurement Report Element (802.11-2016
- * 9.4.2.22.1) starting with the Measurement Token, with Measurement
- * Type 11.
- * @NL80211_PMSR_FTM_RESP_ATTR_PAD: ignore, for u64/s64 padding only
- *
- * @NUM_NL80211_PMSR_FTM_RESP_ATTR: internal
- * @NL80211_PMSR_FTM_RESP_ATTR_MAX: highest attribute number
- */
-enum nl80211_peer_measurement_ftm_resp {
- __NL80211_PMSR_FTM_RESP_ATTR_INVALID,
-
- NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON,
- NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX,
- NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS,
- NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES,
- NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME,
- NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP,
- NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION,
- NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST,
- NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG,
- NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD,
- NL80211_PMSR_FTM_RESP_ATTR_TX_RATE,
- NL80211_PMSR_FTM_RESP_ATTR_RX_RATE,
- NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG,
- NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE,
- NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD,
- NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG,
- NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE,
- NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD,
- NL80211_PMSR_FTM_RESP_ATTR_LCI,
- NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC,
- NL80211_PMSR_FTM_RESP_ATTR_PAD,
-
- /* keep last */
- NUM_NL80211_PMSR_FTM_RESP_ATTR,
- NL80211_PMSR_FTM_RESP_ATTR_MAX = NUM_NL80211_PMSR_FTM_RESP_ATTR - 1
-};
-
#endif /* __LINUX_NL80211_H */