mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-26 18:59:22 +01:00
scan: Separate IE attr creation into logical block
This also introduces the max IE length check and exludes the addition of IEs for the drivers that don't support it.
This commit is contained in:
parent
0490c25fde
commit
aea6c1ccb6
51
src/scan.c
51
src/scan.c
@ -266,34 +266,15 @@ static void scan_build_attr_scan_frequencies(struct l_genl_msg *msg,
|
|||||||
l_genl_msg_leave_nested(msg);
|
l_genl_msg_leave_nested(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool scan_mac_address_randomization_is_disabled(void)
|
static void scan_build_attr_ie(struct l_genl_msg *msg,
|
||||||
{
|
struct scan_context *sc,
|
||||||
const struct l_settings *config = iwd_get_config();
|
|
||||||
bool disabled;
|
|
||||||
|
|
||||||
if (!l_settings_get_bool(config, "Scan",
|
|
||||||
"DisableMacAddressRandomization",
|
|
||||||
&disabled))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return disabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct l_genl_msg *scan_build_cmd(struct scan_context *sc,
|
|
||||||
bool ignore_flush_flag, bool is_passive,
|
|
||||||
const struct scan_parameters *params)
|
const struct scan_parameters *params)
|
||||||
{
|
{
|
||||||
struct l_genl_msg *msg;
|
|
||||||
uint32_t flags = 0;
|
|
||||||
struct iovec iov[3];
|
struct iovec iov[3];
|
||||||
unsigned int iov_elems = 0;
|
unsigned int iov_elems = 0;
|
||||||
const uint8_t *ext_capa;
|
const uint8_t *ext_capa;
|
||||||
uint8_t interworking[3];
|
uint8_t interworking[3];
|
||||||
|
|
||||||
msg = l_genl_msg_new(NL80211_CMD_TRIGGER_SCAN);
|
|
||||||
|
|
||||||
l_genl_msg_append_attr(msg, NL80211_ATTR_WDEV, 8, &sc->wdev_id);
|
|
||||||
|
|
||||||
ext_capa = wiphy_get_extended_capabilities(sc->wiphy,
|
ext_capa = wiphy_get_extended_capabilities(sc->wiphy,
|
||||||
NL80211_IFTYPE_STATION);
|
NL80211_IFTYPE_STATION);
|
||||||
/*
|
/*
|
||||||
@ -325,6 +306,34 @@ static struct l_genl_msg *scan_build_cmd(struct scan_context *sc,
|
|||||||
}
|
}
|
||||||
|
|
||||||
l_genl_msg_append_attrv(msg, NL80211_ATTR_IE, iov, iov_elems);
|
l_genl_msg_append_attrv(msg, NL80211_ATTR_IE, iov, iov_elems);
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool scan_mac_address_randomization_is_disabled(void)
|
||||||
|
{
|
||||||
|
const struct l_settings *config = iwd_get_config();
|
||||||
|
bool disabled;
|
||||||
|
|
||||||
|
if (!l_settings_get_bool(config, "Scan",
|
||||||
|
"DisableMacAddressRandomization",
|
||||||
|
&disabled))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return disabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct l_genl_msg *scan_build_cmd(struct scan_context *sc,
|
||||||
|
bool ignore_flush_flag, bool is_passive,
|
||||||
|
const struct scan_parameters *params)
|
||||||
|
{
|
||||||
|
struct l_genl_msg *msg;
|
||||||
|
uint32_t flags = 0;
|
||||||
|
|
||||||
|
msg = l_genl_msg_new(NL80211_CMD_TRIGGER_SCAN);
|
||||||
|
|
||||||
|
l_genl_msg_append_attr(msg, NL80211_ATTR_WDEV, 8, &sc->wdev_id);
|
||||||
|
|
||||||
|
if (wiphy_get_max_scan_ie_len(sc->wiphy))
|
||||||
|
scan_build_attr_ie(msg, sc, params);
|
||||||
|
|
||||||
if (params->freqs)
|
if (params->freqs)
|
||||||
scan_build_attr_scan_frequencies(msg, params->freqs);
|
scan_build_attr_scan_frequencies(msg, params->freqs);
|
||||||
|
Loading…
Reference in New Issue
Block a user