All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.01.org
Subject: [PATCH 6/7] netdev: remove callback/userdata/timeout from FT-over-DS action
Date: Wed, 12 May 2021 12:21:43 -0700	[thread overview]
Message-ID: <20210512192144.348398-6-prestwoj@gmail.com> (raw)
In-Reply-To: <20210512192144.348398-1-prestwoj@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4397 bytes --]

Since netdev maintains the list of FT over DS info structs there is not
any need for station to get callbacks when the initial action frame
is received, or not. This removes the need for the callback handler,
user data, and response timeout.
---
 src/netdev.c  | 38 +-------------------------------------
 src/netdev.h  |  4 +---
 src/station.c |  3 +--
 3 files changed, 3 insertions(+), 42 deletions(-)

diff --git a/src/netdev.c b/src/netdev.c
index c194e78f..55a63dd2 100644
--- a/src/netdev.c
+++ b/src/netdev.c
@@ -95,9 +95,6 @@ struct netdev_handshake_state {
 struct netdev_ft_over_ds_info {
 	struct ft_ds_info super;
 	struct netdev *netdev;
-	struct l_timeout *timeout;
-	netdev_ft_over_ds_cb_t cb;
-	void *user_data;
 
 	bool parsed : 1;
 };
@@ -3760,9 +3757,6 @@ static void prepare_ft(struct netdev *netdev, struct scan_bss *target_bss)
 static void netdev_ft_over_ds_auth_failed(struct netdev_ft_over_ds_info *info,
 						uint16_t status)
 {
-	if (info->cb)
-		info->cb(info->netdev, status, info->super.aa, info->user_data);
-
 	l_queue_remove(info->netdev->ft_ds_list, info);
 	ft_ds_info_free(&info->super);
 }
@@ -3822,14 +3816,8 @@ static void netdev_ft_response_frame_event(const struct mmpdu_header *hdr,
 	if (ret < 0)
 		goto ft_error;
 
-	l_timeout_remove(info->timeout);
-	info->timeout = NULL;
-
 	info->parsed = true;
 
-	if (info->cb)
-		info->cb(netdev, 0, info->super.aa, info->user_data);
-
 	return;
 
 ft_error:
@@ -3958,34 +3946,16 @@ static void netdev_ft_request_cb(struct l_genl_msg *msg, void *user_data)
 	}
 }
 
-static void netdev_ft_over_ds_timeout(struct l_timeout *timeout,
-					void *user_data)
-{
-	struct netdev_ft_over_ds_info *info = user_data;
-
-	l_timeout_remove(info->timeout);
-	info->timeout = NULL;
-
-	l_debug("");
-
-	netdev_ft_over_ds_auth_failed(info, MMPDU_STATUS_CODE_UNSPECIFIED);
-}
-
 static void netdev_ft_ds_info_free(struct ft_ds_info *ft)
 {
 	struct netdev_ft_over_ds_info *info = l_container_of(ft,
 					struct netdev_ft_over_ds_info, super);
 
-	if (info->timeout)
-		l_timeout_remove(info->timeout);
-
 	l_free(info);
 }
 
 int netdev_fast_transition_over_ds_action(struct netdev *netdev,
-					const struct scan_bss *target_bss,
-					netdev_ft_over_ds_cb_t cb,
-					void *user_data)
+					const struct scan_bss *target_bss)
 {
 	struct netdev_ft_over_ds_info *info;
 	uint8_t ft_req[14];
@@ -4013,9 +3983,6 @@ int netdev_fast_transition_over_ds_action(struct netdev *netdev,
 	l_getrandom(info->super.snonce, 32);
 	info->super.free = netdev_ft_ds_info_free;
 
-	info->cb = cb;
-	info->user_data = user_data;
-
 	ft_req[0] = 6; /* FT category */
 	ft_req[1] = 1; /* FT Request action */
 	memcpy(ft_req + 2, netdev->addr, 6);
@@ -4037,9 +4004,6 @@ int netdev_fast_transition_over_ds_action(struct netdev *netdev,
 
 	l_queue_push_head(netdev->ft_ds_list, info);
 
-	info->timeout = l_timeout_create_ms(300, netdev_ft_over_ds_timeout,
-						info, NULL);
-
 	netdev_send_action_framev(netdev, netdev->handshake->aa, iovs, 2,
 					netdev->frequency,
 					netdev_ft_request_cb,
diff --git a/src/netdev.h b/src/netdev.h
index 987504f6..f625957b 100644
--- a/src/netdev.h
+++ b/src/netdev.h
@@ -163,9 +163,7 @@ int netdev_reassociate(struct netdev *netdev, struct scan_bss *target_bss,
 int netdev_fast_transition(struct netdev *netdev, struct scan_bss *target_bss,
 				netdev_connect_cb_t cb);
 int netdev_fast_transition_over_ds_action(struct netdev *netdev,
-					const struct scan_bss *target_bss,
-					netdev_ft_over_ds_cb_t cb,
-					void *user_data);
+					const struct scan_bss *target_bss);
 int netdev_fast_transition_over_ds(struct netdev *netdev,
 					struct scan_bss *target_bss,
 					netdev_connect_cb_t cb);
diff --git a/src/station.c b/src/station.c
index 9e1b9cc0..352a485e 100644
--- a/src/station.c
+++ b/src/station.c
@@ -2497,8 +2497,7 @@ static void foreach_over_ds_action(void *data, void *user_data)
 	 * when the time comes these can be referenced for a roam
 	 */
 	if (station_can_fast_transition(hs, bss))
-		netdev_fast_transition_over_ds_action(station->netdev, bss,
-							NULL, NULL);
+		netdev_fast_transition_over_ds_action(station->netdev, bss);
 }
 
 static void station_connect_cb(struct netdev *netdev, enum netdev_result result,
-- 
2.31.1

  parent reply	other threads:[~2021-05-12 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-12 19:21 [PATCH 1/7] station: factor out logic for choosing FT James Prestwood
2021-05-12 19:21 ` [PATCH 2/7] station: remove ap_directed_roam check for over-DS James Prestwood
2021-05-12 19:21 ` [PATCH 3/7] ft: break up FT action parsing into two steps James Prestwood
2021-05-12 19:21 ` [PATCH 4/7] netdev: handle multiple concurrent FT-over-DS action frames James Prestwood
2021-05-12 19:21 ` [PATCH 5/7] station: send FT-over-DS actions upon connection James Prestwood
2021-05-12 19:21 ` James Prestwood [this message]
2021-05-12 19:21 ` [PATCH 7/7] auto-t: update FT-over-DS test for new behavior James Prestwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210512192144.348398-6-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.