summaryrefslogtreecommitdiff
path: root/include/net/cfg802154.h
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-09-27 21:12:11 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-11-20 13:43:11 +0300
commitce93b9378c306e6bcc4e0bd817acf4195b4a0288 (patch)
tree4c7f07c23df129cb6de67409cdb49a9ba4f346b9 /include/net/cfg802154.h
parent601f160b61b2152ef84a663f856350d5dd9e752a (diff)
downloadlinux-ce93b9378c306e6bcc4e0bd817acf4195b4a0288.tar.xz
ieee802154: Add support for limiting the number of associated devices
Coordinators may refuse associations. We need a user input for that. Let's add a new netlink command which can provide a maximum number of devices we accept to associate with as a first step. Later, we could also forward the request to userspace and check whether the association should be accepted or not. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Stefan Schmidt <stefan@datenfreihafen.org> Acked-by: Alexander Aring <aahringo@redhat.com> Link: https://lore.kernel.org/linux-wpan/20230927181214.129346-9-miquel.raynal@bootlin.com
Diffstat (limited to 'include/net/cfg802154.h')
-rw-r--r--include/net/cfg802154.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
index c844ae63bc04..0d3e9af00198 100644
--- a/include/net/cfg802154.h
+++ b/include/net/cfg802154.h
@@ -506,6 +506,7 @@ struct wpan_dev {
struct mutex association_lock;
struct ieee802154_pan_device *parent;
struct list_head children;
+ unsigned int max_associations;
};
#define to_phy(_dev) container_of(_dev, struct wpan_phy, dev)
@@ -584,6 +585,13 @@ cfg802154_device_is_child(struct wpan_dev *wpan_dev,
struct ieee802154_addr *target);
/**
+ * cfg802154_set_max_associations - Limit the number of future associations
+ * @wpan_dev: the wpan device
+ * @max: the maximum number of devices we accept to associate
+ */
+void cfg802154_set_max_associations(struct wpan_dev *wpan_dev, unsigned int max);
+
+/**
* 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