summaryrefslogtreecommitdiffstats
path: root/net/mac802154/llsec.c
diff options
context:
space:
mode:
authorMiquel Raynal <miquel.raynal@bootlin.com>2023-01-25 11:29:23 +0100
committerStefan Schmidt <stefan@datenfreihafen.org>2023-01-28 13:55:10 +0100
commit3accf4762734a69ebd03cba989249c78ac7dfc7e (patch)
tree403c80eb108413d4f0d4fc4e68e9fb2dc86a0b5b /net/mac802154/llsec.c
parent9bc114504b07207d671593f6f6d787d55dcf91bd (diff)
downloadlinux-3accf4762734a69ebd03cba989249c78ac7dfc7e.tar.gz
linux-3accf4762734a69ebd03cba989249c78ac7dfc7e.tar.bz2
linux-3accf4762734a69ebd03cba989249c78ac7dfc7e.zip
mac802154: Handle basic beaconing
Implement the core hooks in order to provide the softMAC layer support for sending beacons. Coordinators may be requested to send beacons in a beacon enabled PAN in order for the other devices around to self discover the available PANs automatically. Changing the channels is prohibited while a beacon operation is ongoing. The implementation uses a workqueue triggered at a certain interval depending on the symbol duration for the current channel and the interval order provided. Sending beacons in response to a BEACON_REQ frame (ie. answering active scans) is not yet supported. This initial patchset has no security support (llsec). Co-developed-by: David Girault <david.girault@qorvo.com> Signed-off-by: David Girault <david.girault@qorvo.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Acked-by: Alexander Aring <aahringo@redhat.com> Link: https://lore.kernel.org/r/20230125102923.135465-3-miquel.raynal@bootlin.com Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'net/mac802154/llsec.c')
-rw-r--r--net/mac802154/llsec.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/net/mac802154/llsec.c b/net/mac802154/llsec.c
index 55550ead2ced..8d2eabc71bbe 100644
--- a/net/mac802154/llsec.c
+++ b/net/mac802154/llsec.c
@@ -707,7 +707,10 @@ int mac802154_llsec_encrypt(struct mac802154_llsec *sec, struct sk_buff *skb)
hlen = ieee802154_hdr_pull(skb, &hdr);
- if (hlen < 0 || hdr.fc.type != IEEE802154_FC_TYPE_DATA)
+ /* TODO: control frames security support */
+ if (hlen < 0 ||
+ (hdr.fc.type != IEEE802154_FC_TYPE_DATA &&
+ hdr.fc.type != IEEE802154_FC_TYPE_BEACON))
return -EINVAL;
if (!hdr.fc.security_enabled ||