Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp2974268pxb; Mon, 17 Jan 2022 09:16:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyv2s9F1i0QCXjZVkmtrJsVOhqYWxrEyg9ZdOyl6OStIM6aRY4DaMtuIH32iIw5z8U1uNZ0 X-Received: by 2002:a63:a706:: with SMTP id d6mr19732789pgf.584.1642439774504; Mon, 17 Jan 2022 09:16:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642439774; cv=none; d=google.com; s=arc-20160816; b=CLha3Ui6WeX7nB3gZx5qSsHEcUhhJSIPzRxVqXQdwGtrIwpJhLwc/Q3g+bprCaa7fM InEu6qGaQfYYVAyp6sTa7MHec1ua8Vt163YIdsnlsFm93JsxaSwumVTtIrdRHxkU8mM8 bynsY6lvlfx4zJYFuAEvTrQyUZ6WOUdGOuZ7nzISdh0EDUofraNBrFCcG4rKSwysrEx8 B2XE0tSEkbrHIIfu7H8f1kA15rI5dquunGxoLc09DRUb0WPQZHWLhwXoRMCAUNaWRuVN f8XQHHO4YLmQgchXMNFdBSDhZ50Nj1YBJqX3hapjaXLjFZ7e1GuXbpsAJuFVNiPu3XZw 3nWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=puhf8wOwDM7dVYZDyIk3R1onCUllSCi8jhthyS4MfA8=; b=AJcB/hJtXzydru/nVkmlavhwr7lbgp7VPKRJGFJ5x21Uat9IIvQlEcSeKSgHDGp/wY mDzZncdQMMqdOq3JvvrO8L2bdrZJ4jjA20yo0msec1Dul7XipcCpv1jMhvViGwGH3D2K wXP4DDmFmWoAc5l8Ft1FUmqVXj9Vr6MasefSIIsahRvmsUNe1uge+sRQfWtIW0VN83FV pS2kHwY6sc3WkbeOymw63JbLRK1zG3rpaXH3h0CpCoCloq7sk0F3tG3q5NQykMGpFV0V wlMt6/G5Zq1fRR3aFtxZ4ua8VW5FEwVGenJ1OX7Sak/Nc8y5zalFnTLByEbUfPkvnYtD jmLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k12si15854843pfc.47.2022.01.17.09.16.05; Mon, 17 Jan 2022 09:16:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239561AbiAQL4U (ORCPT + 70 others); Mon, 17 Jan 2022 06:56:20 -0500 Received: from relay12.mail.gandi.net ([217.70.178.232]:36365 "EHLO relay12.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236730AbiAQLz4 (ORCPT ); Mon, 17 Jan 2022 06:55:56 -0500 Received: (Authenticated sender: miquel.raynal@bootlin.com) by relay12.mail.gandi.net (Postfix) with ESMTPSA id 06231200009; Mon, 17 Jan 2022 11:55:53 +0000 (UTC) From: Miquel Raynal To: Alexander Aring , Stefan Schmidt , linux-wpan@vger.kernel.org Cc: netdev@vger.kernel.org, linux-wireless@vger.kernel.org, David Girault , Romuald Despres , Frederic Blain , Nicolas Schodet , Michael Hennerich , Jakub Kicinski , Varka Bhadram , Xue Liu , Alan Ott , Thomas Petazzoni , Miquel Raynal Subject: [PATCH v3 40/41] net: ieee802154: Handle limited devices with only datagram support Date: Mon, 17 Jan 2022 12:54:39 +0100 Message-Id: <20220117115440.60296-41-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220117115440.60296-1-miquel.raynal@bootlin.com> References: <20220117115440.60296-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org 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 --- include/net/cfg802154.h | 3 +++ net/ieee802154/nl802154.c | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h index 57bbc7eb22df..98a202e0e626 100644 --- a/include/net/cfg802154.h +++ b/include/net/cfg802154.h @@ -301,11 +301,14 @@ wpan_phy_cca_cmp(const struct wpan_phy_cca *a, const struct wpan_phy_cca *b) * level setting. * @WPAN_PHY_FLAG_CCA_MODE: Indicates that transceiver will support cca mode * setting. + * @WPAN_PHY_FLAG_DATAGRAMS_ONLY: Indicates that transceiver is only able to + * send/receive datagrams. */ enum wpan_phy_flags { WPAN_PHY_FLAG_TXPOWER = BIT(1), WPAN_PHY_FLAG_CCA_ED_LEVEL = BIT(2), WPAN_PHY_FLAG_CCA_MODE = BIT(3), + WPAN_PHY_FLAG_DATAGRAMS_ONLY = BIT(4), }; struct wpan_phy { diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c index 1a0ce95625ec..443e5aba1aa9 100644 --- a/net/ieee802154/nl802154.c +++ b/net/ieee802154/nl802154.c @@ -1323,6 +1323,9 @@ static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info) if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) return -EOPNOTSUPP; + if (wpan_phy->flags & WPAN_PHY_FLAG_DATAGRAMS_ONLY) + return -EOPNOTSUPP; + request = kzalloc(sizeof(*request), GFP_KERNEL); if (!request) return -ENOMEM; @@ -1699,6 +1702,9 @@ nl802154_send_beacons(struct sk_buff *skb, struct genl_info *info) if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR) return -EOPNOTSUPP; + if (wpan_phy->flags & WPAN_PHY_FLAG_DATAGRAMS_ONLY) + return -EOPNOTSUPP; + request = kzalloc(sizeof(*request), GFP_KERNEL); if (!request) return -ENOMEM; -- 2.27.0