From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH v3 04/14] frame-xchg: create global group enum
Date: Thu, 15 Sep 2022 15:07:31 -0700 [thread overview]
Message-ID: <20220915220741.1128728-4-prestwoj@gmail.com> (raw)
In-Reply-To: <20220915220741.1128728-1-prestwoj@gmail.com>
Only P2P utilizes groups for now but to avoid conflicts in group
numbers for other modules create a global list which can be added
to as needed.
---
src/frame-xchg.h | 7 +++++++
src/p2p.c | 24 +++++++++---------------
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/src/frame-xchg.h b/src/frame-xchg.h
index 360bb4d4..5b55ded8 100644
--- a/src/frame-xchg.h
+++ b/src/frame-xchg.h
@@ -37,6 +37,13 @@ struct frame_xchg_prefix {
size_t len;
};
+enum frame_xchg_group {
+ FRAME_GROUP_DEFAULT = 0,
+ FRAME_GROUP_P2P_LISTEN,
+ FRAME_GROUP_P2P_CONNECT,
+ FRAME_GROUP_FT,
+};
+
bool frame_watch_add(uint64_t wdev_id, uint32_t group, uint16_t frame_type,
const uint8_t *prefix, size_t prefix_len,
frame_watch_cb_t handler, void *user_data,
diff --git a/src/p2p.c b/src/p2p.c
index 45a1b70b..cfd8560a 100644
--- a/src/p2p.c
+++ b/src/p2p.c
@@ -190,12 +190,6 @@ static const int channels_scan_2_4_other[] = { 2, 3, 4, 5, 7, 8, 9, 10 };
*/
#define P2P_GO_INTENT 2
-enum {
- FRAME_GROUP_DEFAULT = 0,
- FRAME_GROUP_LISTEN,
- FRAME_GROUP_CONNECT,
-};
-
static bool p2p_device_match(const void *a, const void *b)
{
const struct p2p_device *dev = a;
@@ -718,7 +712,7 @@ static void p2p_connection_reset(struct p2p_device *dev)
netdev_watch_remove(dev->conn_netdev_watch_id);
- frame_watch_group_remove(dev->wdev_id, FRAME_GROUP_CONNECT);
+ frame_watch_group_remove(dev->wdev_id, FRAME_GROUP_P2P_CONNECT);
frame_xchg_stop_wdev(dev->wdev_id);
if (!dev->enabled || (dev->enabled && dev->start_stop_cmd_id)) {
@@ -2527,13 +2521,13 @@ respond:
if (status == P2P_STATUS_SUCCESS)
p2p_peer_frame_xchg(peer, iov, dev->addr, 0, 600, 0, true,
- FRAME_GROUP_CONNECT,
+ FRAME_GROUP_P2P_CONNECT,
p2p_go_negotiation_resp_done,
&p2p_frame_go_neg_confirm,
p2p_go_negotiation_confirm_cb, NULL);
else
p2p_peer_frame_xchg(peer, iov, dev->addr, 0, 0, 0, true,
- FRAME_GROUP_CONNECT,
+ FRAME_GROUP_P2P_CONNECT,
p2p_go_negotiation_resp_err_done, NULL);
l_debug("GO Negotiation Response sent with status %i", status);
@@ -2804,7 +2798,7 @@ static bool p2p_go_negotiation_resp_cb(const struct mmpdu_header *mpdu,
iov[iov_len].iov_base = NULL;
p2p_peer_frame_xchg(dev->conn_peer, iov, dev->conn_peer->device_addr,
- 0, 0, 0, false, FRAME_GROUP_CONNECT,
+ 0, 0, 0, false, FRAME_GROUP_P2P_CONNECT,
p2p_go_negotiation_confirm_done, NULL);
l_free(confirm_body);
@@ -2893,7 +2887,7 @@ static void p2p_start_go_negotiation(struct p2p_device *dev)
p2p_peer_frame_xchg(dev->conn_peer, iov, dev->conn_peer->device_addr,
100, resp_timeout, 256, false,
- FRAME_GROUP_CONNECT,
+ FRAME_GROUP_P2P_CONNECT,
p2p_go_negotiation_req_done,
&p2p_frame_go_neg_resp,
p2p_go_negotiation_resp_cb, NULL);
@@ -3035,7 +3029,7 @@ static void p2p_start_provision_discovery(struct p2p_device *dev)
* sent to the P2P Device Address of the P2P Group Owner"
*/
p2p_peer_frame_xchg(dev->conn_peer, iov, dev->conn_peer->device_addr,
- 200, 600, 8, false, FRAME_GROUP_CONNECT,
+ 200, 600, 8, false, FRAME_GROUP_P2P_CONNECT,
p2p_provision_disc_req_done,
&p2p_frame_pd_resp, p2p_provision_disc_resp_cb,
NULL);
@@ -4167,9 +4161,9 @@ static void p2p_device_discovery_start(struct p2p_device *dev)
dev->listen_channel = channels_social[l_getrandom_uint32() %
L_ARRAY_SIZE(channels_social)];
- frame_watch_add(dev->wdev_id, FRAME_GROUP_LISTEN, 0x0040,
+ frame_watch_add(dev->wdev_id, FRAME_GROUP_P2P_LISTEN, 0x0040,
(uint8_t *) "", 0, p2p_device_probe_cb, dev, NULL);
- frame_watch_add(dev->wdev_id, FRAME_GROUP_LISTEN, 0x00d0,
+ frame_watch_add(dev->wdev_id, FRAME_GROUP_P2P_LISTEN, 0x00d0,
p2p_frame_go_neg_req.data, p2p_frame_go_neg_req.len,
p2p_device_go_negotiation_req_cb, dev, NULL);
@@ -4187,7 +4181,7 @@ static void p2p_device_discovery_stop(struct p2p_device *dev)
l_timeout_remove(dev->scan_timeout);
p2p_device_roc_cancel(dev);
- frame_watch_group_remove(dev->wdev_id, FRAME_GROUP_LISTEN);
+ frame_watch_group_remove(dev->wdev_id, FRAME_GROUP_P2P_LISTEN);
}
static void p2p_device_enable_cb(struct l_genl_msg *msg, void *user_data)
--
2.34.3
next prev parent reply other threads:[~2022-09-15 22:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 22:07 [PATCH v3 01/14] frame-xchg: add type to frame_xchg_prefix James Prestwood
2022-09-15 22:07 ` [PATCH v3 02/14] station: don't set OCVC for FT AKMs James Prestwood
2022-09-15 22:07 ` [PATCH v3 03/14] ft: remove OCI element from auth/assoc James Prestwood
2022-09-16 16:05 ` Denis Kenzior
2022-09-16 16:18 ` James Prestwood
2022-09-15 22:07 ` James Prestwood [this message]
2022-09-16 16:06 ` [PATCH v3 04/14] frame-xchg: create global group enum Denis Kenzior
2022-09-16 16:28 ` James Prestwood
2022-09-15 22:07 ` [PATCH v3 05/14] ft: netdev: prep for FT isolation into ft.c James Prestwood
2022-09-15 22:07 ` [PATCH v3 06/14] netdev: use new ft_sm for over-DS James Prestwood
2022-09-15 22:07 ` [PATCH v3 07/14] ft: implement offchannel authentication James Prestwood
2022-09-15 22:07 ` [PATCH v3 08/14] netdev: update FT-over-Air to use ft_authenticate() James Prestwood
2022-09-15 22:07 ` [PATCH v3 09/14] ft: remove unused code after refactor James Prestwood
2022-09-15 22:07 ` [PATCH v3 10/14] ft: add ft_sm_can_associate James Prestwood
2022-09-15 22:07 ` [PATCH v3 11/14] netdev: check for authentication for FT-over-DS James Prestwood
2022-09-15 22:07 ` [PATCH v3 12/14] station: create list of roam candidates James Prestwood
2022-09-15 22:07 ` [PATCH v3 13/14] station: try multiple " James Prestwood
2022-09-15 22:07 ` [PATCH v3 14/14] netdev: add NETDEV_EVENT_FT_AUTHENTICATE, handle in station James Prestwood
2022-09-16 16:04 ` [PATCH v3 01/14] frame-xchg: add type to frame_xchg_prefix Denis Kenzior
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=20220915220741.1128728-4-prestwoj@gmail.com \
--to=prestwoj@gmail.com \
--cc=iwd@lists.linux.dev \
/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.