aboutsummaryrefslogtreecommitdiff
path: root/include/net
diff options
context:
space:
mode:
authorMiquel Raynal <[email protected]>2023-09-27 20:12:10 +0200
committerMiquel Raynal <[email protected]>2023-11-20 11:43:03 +0100
commit601f160b61b2152ef84a663f856350d5dd9e752a (patch)
tree035f2a6481882b2079378a5075c41c39e27612ff /include/net
parent9860d9be89f420f3793fb798faadea11c723e08a (diff)
mac802154: Handle association requests from peers
Coordinators may have to handle association requests from peers which want to join the PAN. The logic involves: - Acknowledging the request (done by hardware) - If requested, a random short address that is free on this PAN should be chosen for the device. - Sending an association response with the short address allocated for the peer and expecting it to be ack'ed. If anything fails during this procedure, the peer is considered not associated. Signed-off-by: Miquel Raynal <[email protected]> Acked-by: Stefan Schmidt <[email protected]> Acked-by: Alexander Aring <[email protected]> Link: https://lore.kernel.org/linux-wpan/[email protected]
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg802154.h7
-rw-r--r--include/net/ieee802154_netdev.h6
2 files changed, 13 insertions, 0 deletions
diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
index 9b036ab20079..c844ae63bc04 100644
--- a/include/net/cfg802154.h
+++ b/include/net/cfg802154.h
@@ -583,4 +583,11 @@ struct ieee802154_pan_device *
cfg802154_device_is_child(struct wpan_dev *wpan_dev,
struct ieee802154_addr *target);
+/**
+ * cfg802154_get_free_short_addr - Get a free address among the known devices
+ * @wpan_dev: the wpan device
+ * @return: a random short address expectedly unused on our PAN
+ */
+__le16 cfg802154_get_free_short_addr(struct wpan_dev *wpan_dev);
+
#endif /* __NET_CFG802154_H */
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h
index 16194356cfe7..4de858f9929e 100644
--- a/include/net/ieee802154_netdev.h
+++ b/include/net/ieee802154_netdev.h
@@ -211,6 +211,12 @@ struct ieee802154_association_req_frame {
struct ieee802154_assoc_req_pl assoc_req_pl;
};
+struct ieee802154_association_resp_frame {
+ struct ieee802154_hdr mhr;
+ struct ieee802154_mac_cmd_pl mac_pl;
+ struct ieee802154_assoc_resp_pl assoc_resp_pl;
+};
+
struct ieee802154_disassociation_notif_frame {
struct ieee802154_hdr mhr;
struct ieee802154_mac_cmd_pl mac_pl;