mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-03 10:32:33 +01:00
dpp: pass dpp_sm to dpp_send_frame
The SM has the wdev_id already, so rather than using that or looking up just pass the dpp_sm directly.
This commit is contained in:
parent
fc61e5fe46
commit
9aae6e2c16
23
src/dpp.c
23
src/dpp.c
@ -213,20 +213,21 @@ static void dpp_send_frame_cb(struct l_genl_msg *msg, void *user_data)
|
|||||||
l_error("Error sending frame");
|
l_error("Error sending frame");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dpp_send_frame(uint64_t wdev_id, struct iovec *iov, size_t iov_len,
|
static void dpp_send_frame(struct dpp_sm *dpp,
|
||||||
uint32_t freq)
|
struct iovec *iov, size_t iov_len,
|
||||||
|
uint32_t freq)
|
||||||
{
|
{
|
||||||
struct l_genl_msg *msg;
|
struct l_genl_msg *msg;
|
||||||
|
|
||||||
msg = l_genl_msg_new_sized(NL80211_CMD_FRAME, 512);
|
msg = l_genl_msg_new_sized(NL80211_CMD_FRAME, 512);
|
||||||
l_genl_msg_append_attr(msg, NL80211_ATTR_WDEV, 8, &wdev_id);
|
l_genl_msg_append_attr(msg, NL80211_ATTR_WDEV, 8, &dpp->wdev_id);
|
||||||
l_genl_msg_append_attr(msg, NL80211_ATTR_WIPHY_FREQ, 4, &freq);
|
l_genl_msg_append_attr(msg, NL80211_ATTR_WIPHY_FREQ, 4, &freq);
|
||||||
l_genl_msg_append_attr(msg, NL80211_ATTR_OFFCHANNEL_TX_OK, 0, NULL);
|
l_genl_msg_append_attr(msg, NL80211_ATTR_OFFCHANNEL_TX_OK, 0, NULL);
|
||||||
l_genl_msg_append_attrv(msg, NL80211_ATTR_FRAME, iov, iov_len);
|
l_genl_msg_append_attrv(msg, NL80211_ATTR_FRAME, iov, iov_len);
|
||||||
|
|
||||||
l_debug("Sending frame on frequency %u", freq);
|
l_debug("Sending frame on frequency %u", freq);
|
||||||
|
|
||||||
if (!l_genl_family_send(nl80211, msg, dpp_send_frame_cb, NULL, NULL)) {
|
if (!l_genl_family_send(nl80211, msg, dpp_send_frame_cb, dpp, NULL)) {
|
||||||
l_error("Could not send CMD_FRAME");
|
l_error("Could not send CMD_FRAME");
|
||||||
l_genl_msg_unref(msg);
|
l_genl_msg_unref(msg);
|
||||||
}
|
}
|
||||||
@ -378,7 +379,7 @@ static void dpp_configuration_start(struct dpp_sm *dpp, const uint8_t *addr)
|
|||||||
|
|
||||||
dpp->state = DPP_STATE_CONFIGURING;
|
dpp->state = DPP_STATE_CONFIGURING;
|
||||||
|
|
||||||
dpp_send_frame(dpp->wdev_id, iov, 2, dpp->current_freq);
|
dpp_send_frame(dpp, iov, 2, dpp->current_freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_config_result(struct dpp_sm *dpp, const uint8_t *to)
|
static void send_config_result(struct dpp_sm *dpp, const uint8_t *to)
|
||||||
@ -401,7 +402,7 @@ static void send_config_result(struct dpp_sm *dpp, const uint8_t *to)
|
|||||||
iov[1].iov_base = attrs;
|
iov[1].iov_base = attrs;
|
||||||
iov[1].iov_len = ptr - attrs;
|
iov[1].iov_len = ptr - attrs;
|
||||||
|
|
||||||
dpp_send_frame(dpp->wdev_id, iov, 2, dpp->current_freq);
|
dpp_send_frame(dpp, iov, 2, dpp->current_freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dpp_write_config(struct dpp_configuration *config,
|
static void dpp_write_config(struct dpp_configuration *config,
|
||||||
@ -730,7 +731,7 @@ static void dpp_send_config_response(struct dpp_sm *dpp, uint8_t status)
|
|||||||
iov[1].iov_base = attrs;
|
iov[1].iov_base = attrs;
|
||||||
iov[1].iov_len = ptr - attrs;
|
iov[1].iov_len = ptr - attrs;
|
||||||
|
|
||||||
dpp_send_frame(dpp->wdev_id, iov, 2, dpp->current_freq);
|
dpp_send_frame(dpp, iov, 2, dpp->current_freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dpp_handle_config_request_frame(const struct mmpdu_header *frame,
|
static void dpp_handle_config_request_frame(const struct mmpdu_header *frame,
|
||||||
@ -1033,8 +1034,7 @@ static void send_authenticate_response(struct dpp_sm *dpp)
|
|||||||
iov[1].iov_base = attrs;
|
iov[1].iov_base = attrs;
|
||||||
iov[1].iov_len = ptr - attrs;
|
iov[1].iov_len = ptr - attrs;
|
||||||
|
|
||||||
dpp_send_frame(netdev_get_wdev_id(dpp->netdev), iov, 2,
|
dpp_send_frame(dpp, iov, 2, dpp->current_freq);
|
||||||
dpp->current_freq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void authenticate_confirm(struct dpp_sm *dpp, const uint8_t *from,
|
static void authenticate_confirm(struct dpp_sm *dpp, const uint8_t *from,
|
||||||
@ -1200,8 +1200,7 @@ static void dpp_auth_request_failed(struct dpp_sm *dpp,
|
|||||||
iov[1].iov_base = attrs;
|
iov[1].iov_base = attrs;
|
||||||
iov[1].iov_len = ptr - attrs;
|
iov[1].iov_len = ptr - attrs;
|
||||||
|
|
||||||
dpp_send_frame(netdev_get_wdev_id(dpp->netdev), iov, 2,
|
dpp_send_frame(dpp, iov, 2, dpp->current_freq);
|
||||||
dpp->current_freq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool dpp_check_roles(struct dpp_sm *dpp, uint8_t peer_capa)
|
static bool dpp_check_roles(struct dpp_sm *dpp, uint8_t peer_capa)
|
||||||
@ -1241,7 +1240,7 @@ static void dpp_presence_announce(struct dpp_sm *dpp)
|
|||||||
l_debug("Sending presense annoucement on frequency %u and waiting %u",
|
l_debug("Sending presense annoucement on frequency %u and waiting %u",
|
||||||
dpp->current_freq, dpp->dwell);
|
dpp->current_freq, dpp->dwell);
|
||||||
|
|
||||||
dpp_send_frame(netdev_get_wdev_id(netdev), iov, 2, dpp->current_freq);
|
dpp_send_frame(dpp, iov, 2, dpp->current_freq);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dpp_roc_started(void *user_data)
|
static void dpp_roc_started(void *user_data)
|
||||||
|
Loading…
Reference in New Issue
Block a user