mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-11-23 07:29:28 +01:00
scan: change signature of scan_build_cmd
This allows scan_build_cmd to take advantage of a full scan context. For example to check the feature availability of wiphy, etc.
This commit is contained in:
parent
bece39619b
commit
a681e845a6
@ -274,7 +274,7 @@ static void scan_freq_count(uint32_t freq, void *user_data)
|
|||||||
*count += 1;
|
*count += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct l_genl_msg *scan_build_cmd(uint32_t ifindex, bool passive,
|
static struct l_genl_msg *scan_build_cmd(struct scan_context *sc, bool passive,
|
||||||
const struct scan_parameters *params)
|
const struct scan_parameters *params)
|
||||||
{
|
{
|
||||||
struct l_genl_msg *msg;
|
struct l_genl_msg *msg;
|
||||||
@ -288,7 +288,7 @@ static struct l_genl_msg *scan_build_cmd(uint32_t ifindex, bool passive,
|
|||||||
msg = l_genl_msg_new_sized(NL80211_CMD_TRIGGER_SCAN,
|
msg = l_genl_msg_new_sized(NL80211_CMD_TRIGGER_SCAN,
|
||||||
64 + params->extra_ie_size +
|
64 + params->extra_ie_size +
|
||||||
4 * n_channels);
|
4 * n_channels);
|
||||||
l_genl_msg_append_attr(msg, NL80211_ATTR_IFINDEX, 4, &ifindex);
|
l_genl_msg_append_attr(msg, NL80211_ATTR_IFINDEX, 4, &sc->ifindex);
|
||||||
|
|
||||||
if (!passive) {
|
if (!passive) {
|
||||||
l_genl_msg_enter_nested(msg, NL80211_ATTR_SCAN_SSIDS);
|
l_genl_msg_enter_nested(msg, NL80211_ATTR_SCAN_SSIDS);
|
||||||
@ -336,7 +336,7 @@ static uint32_t scan_common(uint32_t ifindex, bool passive,
|
|||||||
sr->passive = passive;
|
sr->passive = passive;
|
||||||
sr->id = ++next_scan_request_id;
|
sr->id = ++next_scan_request_id;
|
||||||
|
|
||||||
sr->start_cmd = scan_build_cmd(ifindex, passive, params);
|
sr->start_cmd = scan_build_cmd(sc, passive, params);
|
||||||
if (!sr->start_cmd)
|
if (!sr->start_cmd)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -501,7 +501,7 @@ static bool scan_periodic_send_start(struct scan_context *sc)
|
|||||||
struct scan_parameters params = {};
|
struct scan_parameters params = {};
|
||||||
struct l_genl_msg *msg;
|
struct l_genl_msg *msg;
|
||||||
|
|
||||||
msg = scan_build_cmd(sc->ifindex, true, ¶ms);
|
msg = scan_build_cmd(sc, true, ¶ms);
|
||||||
if (!msg)
|
if (!msg)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user