summaryrefslogtreecommitdiff
path: root/net/ieee802154/pan.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-09-27 20:12:11 +0200
committerMiquel Raynal <miquel.raynal@bootlin.com>2023-11-20 11:43:11 +0100
commitce93b9378c306e6bcc4e0bd817acf4195b4a0288 (patch)
tree4c7f07c23df129cb6de67409cdb49a9ba4f346b9 /net/ieee802154/pan.c
parent601f160b61b2152ef84a663f856350d5dd9e752a (diff)
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 'net/ieee802154/pan.c')
-rw-r--r--net/ieee802154/pan.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/ieee802154/pan.c b/net/ieee802154/pan.c
index 545461069197..fb5b0af2ef68 100644
--- a/net/ieee802154/pan.c
+++ b/net/ieee802154/pan.c
@@ -93,3 +93,11 @@ __le16 cfg802154_get_free_short_addr(struct wpan_dev *wpan_dev)
return addr;
}
EXPORT_SYMBOL_GPL(cfg802154_get_free_short_addr);
+
+void cfg802154_set_max_associations(struct wpan_dev *wpan_dev, unsigned int max)
+{
+ lockdep_assert_held(&wpan_dev->association_lock);
+
+ wpan_dev->max_associations = max;
+}
+EXPORT_SYMBOL_GPL(cfg802154_set_max_associations);