Skip to contentSkip to conversation

Associations support

PATCH In review Miquel Raynal 2 participants 4 messages Nov 28, 2023 – Dec 7, 2023 IEEE 802.15.4

lore
Share & tools
lore

Miquel Raynal

author maintainer
#0 lore raw

cover Associations support

Hello,

Associations will be part of the next kernel merge window, so here is the userspace part to interact with it.

Thanks,
Miquèl

Miquel Raynal (2):
iwpan: Synchronize nl802154.h with the latest association changes
iwpan: Add associations support

 src/info.c     |   4 ++
 src/mac.c      | 187 +++++++++++++++++++++++++++++++++++++++++++++++++
 src/nl802154.h |  22 +++++-
 3 files changed, 211 insertions(+), 2 deletions(-)
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 1/2 iwpan: Synchronize nl802154.h with the latest association changes

Synchronize the header with Linux to get the new commands and attributes in order to be able to interact about associations.

---
 src/nl802154.h | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)
src/nl802154.h +20 -2
index 410ee95..44706f0 100644
@@ -64,6 +64,10 @@ enum nl802154_commands {
 	NL802154_CMD_SCAN_DONE,
 	NL802154_CMD_SEND_BEACONS,
 	NL802154_CMD_STOP_BEACONS,
+	NL802154_CMD_ASSOCIATE,
+	NL802154_CMD_DISASSOCIATE,
+	NL802154_CMD_SET_MAX_ASSOCIATIONS,
+	NL802154_CMD_LIST_ASSOCIATIONS,
 
 	/* add new commands above here */
 
@@ -133,6 +137,8 @@ enum nl802154_attrs {
 	NL802154_ATTR_SCAN_DURATION,
 	NL802154_ATTR_SCAN_DONE_REASON,
 	NL802154_ATTR_BEACON_INTERVAL,
+	NL802154_ATTR_MAX_ASSOCIATIONS,
+	NL802154_ATTR_PEER,
 
 	/* add attributes here, update the policy in nl802154.c */
 
@@ -372,8 +378,6 @@ enum nl802154_supported_bool_states {
 	NL802154_SUPPORTED_BOOL_MAX = __NL802154_SUPPORTED_BOOL_AFTER_LAST - 1
 };
 
-#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
-
 enum nl802154_dev_addr_modes {
 	NL802154_DEV_ADDR_NONE,
 	__NL802154_DEV_ADDR_INVALID,
@@ -393,12 +397,26 @@ enum nl802154_dev_addr_attrs {
 	NL802154_DEV_ADDR_ATTR_SHORT,
 	NL802154_DEV_ADDR_ATTR_EXTENDED,
 	NL802154_DEV_ADDR_ATTR_PAD,
+	NL802154_DEV_ADDR_ATTR_PEER_TYPE,
 
 	/* keep last */
 	__NL802154_DEV_ADDR_ATTR_AFTER_LAST,
 	NL802154_DEV_ADDR_ATTR_MAX = __NL802154_DEV_ADDR_ATTR_AFTER_LAST - 1
 };
 
+enum nl802154_peer_type {
+	NL802154_PEER_TYPE_UNSPEC,
+
+	NL802154_PEER_TYPE_PARENT,
+	NL802154_PEER_TYPE_CHILD,
+
+	/* keep last */
+	__NL802154_PEER_TYPE_AFTER_LAST,
+	NL802154_PEER_TYPE_MAX = __NL802154_PEER_TYPE_AFTER_LAST - 1
+};
+
+#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
+
 enum nl802154_key_id_modes {
 	NL802154_KEY_ID_MODE_IMPLICIT,
 	NL802154_KEY_ID_MODE_INDEX,
Signature · 1 line
2.34.1
author maintainer
#2 lore raw

PATCH 2/2 iwpan: Add associations support

In reply to Miquel Raynal

Show how to interact with the kernel to request an association/disassociation or listing the associated devices.

---
 src/info.c |   4 ++
 src/mac.c  | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 191 insertions(+)
src/info.c +4 -0
index 8b7e98e..1386624 100644
@@ -217,6 +217,10 @@ static const char *commands[NL802154_CMD_MAX + 1] = {
 	[NL802154_CMD_SET_MAX_CSMA_BACKOFFS] = "set_max_csma_backoffs",
 	[NL802154_CMD_SET_LBT_MODE] = "set_lbt_mode",
 	[NL802154_CMD_SET_ACKREQ_DEFAULT] = "set_ackreq_default",
+	[NL802154_CMD_LIST_ASSOCIATIONS] = "list_associations",
+	[NL802154_CMD_SET_MAX_ASSOCIATIONS] = "set_max_associations",
+	[NL802154_CMD_ASSOCIATE] = "associate",
+	[NL802154_CMD_DISASSOCIATE] = "disassociate",
 };
 
 static char cmdbuf[100];
src/mac.c +187 -0

190 lines not on this page · raw message

Signature · 1 line
2.34.1
maintainer
#3 lore raw
In reply to Miquel Raynal

Hello.

Quoted 8 lines · Miquel Raynal

Hello,

Associations will be part of the next kernel merge window, so here is the userspace part to interact with it.

Thanks,
Miquèl

Quoted 9 lines

Miquel Raynal (2):
iwpan: Synchronize nl802154.h with the latest association changes
iwpan: Add associations support

  src/info.c     |   4 ++
  src/mac.c      | 187 +++++++++++++++++++++++++++++++++++++++++++++++++
  src/nl802154.h |  22 +++++-
  3 files changed, 211 insertions(+), 2 deletions(-)

I pushed both of thee now into the associations-support topic branch of wpan-tools. Once A kernel is released with the support we can merge it into the main branch.

regards
Stefan Schmidt