diff options
author | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-03-24 12:05:57 +0100 |
---|---|---|
committer | Stefan Schmidt <stefan@datenfreihafen.org> | 2023-03-24 17:19:12 +0100 |
commit | 822452fb6c696bb2331649ce6fbb49e49261cc71 (patch) | |
tree | 326041ddfb52d1c4a55a7178a07efd0218a088f1 /net | |
parent | d021d218f6d924ff5417c64b2e41d184e4bb32d3 (diff) | |
download | linux-822452fb6c696bb2331649ce6fbb49e49261cc71.tar.gz linux-822452fb6c696bb2331649ce6fbb49e49261cc71.tar.bz2 linux-822452fb6c696bb2331649ce6fbb49e49261cc71.zip |
net: ieee802154: Handle limited devices with only datagram support
Some devices, like HardMAC ones can be a bit limited in the way they
handle mac commands. In particular, they might just not support it at
all and instead only be able to transmit and receive regular data
packets. In this case, they cannot be used for any of the internal
management commands that we have introduced so far and must be flagged
accordingly.
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Acked-by: Alexander Aring <aahringo@redhat.com>
Link: https://lore.kernel.org/r/20230324110558.90707-2-miquel.raynal@bootlin.com
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Diffstat (limited to 'net')
-rw-r--r-- | net/ieee802154/nl802154.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index a20ac4bb48a4..cd688b51d977 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1417,6 +1417,11 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info) return -EINVAL; } + if (wpan_phy->flags & WPAN_PHY_FLAG_DATAGRAMS_ONLY) { + NL_SET_ERR_MSG(info->extack, "PHY only supports datagrams"); + return -EOPNOTSUPP; + } + request = kzalloc(sizeof(*request), GFP_KERNEL); if (!request) return -ENOMEM; @@ -1584,6 +1589,11 @@ nl802154_send_beacons(struct sk_buff *skb, struct genl_info *info) return -EPERM; } + if (wpan_phy->flags & WPAN_PHY_FLAG_DATAGRAMS_ONLY) { + NL_SET_ERR_MSG(info->extack, "PHY only supports datagrams"); + return -EOPNOTSUPP; + } + request = kzalloc(sizeof(*request), GFP_KERNEL); if (!request) return -ENOMEM; |