From patchwork Thu Feb 6 09:26:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863566 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 869C8226186; Thu, 6 Feb 2025 09:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834038; cv=none; b=murm/wMQl+nOQ3kGPdcE6HAwbD1ErgZyDIPifSfNxzAMA3sfD1ZJ5sroIIZMZaVoqbcUxemNJb4plV/Ug+zxwQ1mWg/L57kCvTcJPglhrK6npzyRZLpM6MsxHMPHJZo/GDSMdv6ichYbXVjhPPDKJgfifISE6D7hkdoR6+Z3goc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834038; c=relaxed/simple; bh=WSmza9m5lqfjaJbkYShhNi8pvsDhRW/0u6ShwBBGN1E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QHpyXtE0Rd/j1oECMgrdyunYAmfg6eM3eipxRrC4r1xWLUAMeCgVZ9Tjyj/n0KZ8s/RiEYBpig+NDHd4pvYRvNPGoLBfbiDsICAhILRcF46W3NmFRQpbQZW5RJC0ZupCLgl7PyUDxvnTUi3L8yl8puZd3TAXtApnPbtVMuk+nts= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=UFYvVPwB; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UFYvVPwB" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-38db104d35eso468555f8f.1; Thu, 06 Feb 2025 01:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834033; x=1739438833; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ukI9L+W3BVJpqtTUxee+mj8XRSqHm8hW8ALqrNrwT90=; b=UFYvVPwBqPP6HRNZLsrehCDlq+iud/Myh/+2h+1Z1to0vhZ/jVe/LkG3n1XyKhSPNN zrmgvWWfJblSwixanzVqBXA3kVACFh4LwB9Ol7ETUPfkwKpbr2m67wGzX8NNO7VTDAdZ 3AeZlB6sKBj0QdRwQEMTVmt5ATTXIEJYPtA9OC4MCAH2c+aHI01oMQCRqY9da8goUKZG 1erXDvQI3GTtEh4tOF50V6mALuSnSivztS9FRFFCQBB4xt1O7/YWrlU+DeTVLGhKxvhM r8ZmSMdgjYRJRPzzVzvRjPrGAkE+WKnaj2DD3SGt60un/l+BzqW0TJIwkEIFoCqE6NR2 S1fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834033; x=1739438833; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ukI9L+W3BVJpqtTUxee+mj8XRSqHm8hW8ALqrNrwT90=; b=iAy8Mu8Tti+i8+bFUtj91Emb42NNORx4VOTQfOlUMDLp8vMnbAKRKiOviF7WN2u/jQ gM00MLDOnTsdqICuiiVx2Z2HOfFG8qipaH6A8gKOvJ+CI+ZBBSRHVxHXjQKIj3GdIXZj pbnwhF+braG3J82R8WGi2HpwM5LzK+tj/EzKK7+W6Zw1pFVC2RyrtT0bgL0mjwSaHynZ Mwvok/p3a7By5ZYPiNxWYfGrf57CAOiMcTfj/h30C60M2PKBOAiwQhKsT3B1pkJdipoK klPL2T9bNsyK8n7CJDRa2rKml/q0JjQWp4ZLqli5/sm/D6Cg3wBN64YkV+v8913iKlee v0SQ== X-Forwarded-Encrypted: i=1; AJvYcCWF5nHaLdsbmKa7oOX3/RO2By7qIql1UCEYQOUzkgccuvBnDEwGTYo9Gtpt2L+psvmfnUqQNBRbB9O2OWQa/g==@vger.kernel.org X-Gm-Message-State: AOJu0YwoybFNme5e/mGhVGPBcgNUXYbjnNOyz1Jdl5SMYjFlYXW26GZ8 zJ7wUna0L3uub/HkEJcItHtd1l9RaXMjVsyGTKpTmK6raF+g6915vFMpiQ== X-Gm-Gg: ASbGncu/Wd/PfcGzjLJ7pIJqUqIqVSNrqd//a90Dk1lIV31hqW1amNorfw8RYzRuhj+ nSMyRj722zBx3TyEIpGEaZx6ZDmBzOzO5xNqmzumxrQrzlfIZp9fQlNRPwcqHLZ548bHpPGmg8Z B4sfJf9YglOLpqjmrQJlWhD/Evsij90oE9w1gM4O0dR+QWAWl92C8B1UBV0nCrAPVk1agE2qoho 3INpeVSrX8COU0xZCML43azEaZRgogikfLfzr2skgFOGTNnliG51rm2L5OoqnUHtq+Pv3FLMjzu k4a94vErsw+a8kkjmwWWc1QLgWZILhOCWA== X-Google-Smtp-Source: AGHT+IEv6GjGSfAPde2d78YDZAwTialtRKpWibkjMz9Rgy8IL0j0X4oH/0W2KzIpwdMmftDpUmvLTg== X-Received: by 2002:a05:6000:18a7:b0:38d:c037:9352 with SMTP id ffacd0b85a97d-38dc03795a0mr811743f8f.25.1738834033182; Thu, 06 Feb 2025 01:27:13 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:12 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 01/10] tools/net/ynl: remove extraneous plural from variable names Date: Thu, 6 Feb 2025 09:26:49 +0000 Message-ID: <20250206092658.1383-2-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 _decode_array_attr() uses variable subattrs in every branch when only one branch decodes more than a single attribute. Change the variable name to subattr in the branches that only decode a single attribute so that the intent is more obvious. Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski --- tools/net/ynl/pyynl/lib/ynl.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py index 08f8bf89cfc2..8b39d8b1eaa8 100644 --- a/tools/net/ynl/pyynl/lib/ynl.py +++ b/tools/net/ynl/pyynl/lib/ynl.py @@ -644,15 +644,15 @@ class YnlFamily(SpecFamily): subattrs = self._decode(NlAttrs(item.raw), attr_spec['nested-attributes']) decoded.append({ item.type: subattrs }) elif attr_spec["sub-type"] == 'binary': - subattrs = item.as_bin() + subattr = item.as_bin() if attr_spec.display_hint: - subattrs = self._formatted_string(subattrs, attr_spec.display_hint) - decoded.append(subattrs) + subattr = self._formatted_string(subattr, attr_spec.display_hint) + decoded.append(subattr) elif attr_spec["sub-type"] in NlAttr.type_formats: - subattrs = item.as_scalar(attr_spec['sub-type'], attr_spec.byte_order) + subattr = item.as_scalar(attr_spec['sub-type'], attr_spec.byte_order) if attr_spec.display_hint: - subattrs = self._formatted_string(subattrs, attr_spec.display_hint) - decoded.append(subattrs) + subattr = self._formatted_string(subattr, attr_spec.display_hint) + decoded.append(subattr) else: raise Exception(f'Unknown {attr_spec["sub-type"]} with name {attr_spec["name"]}') return decoded From patchwork Thu Feb 6 09:26:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 862960 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 86A2E226187; Thu, 6 Feb 2025 09:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834038; cv=none; b=aZf+11vpQGRsg126Q9gWR9Z4SUIL5yjMR+P4SIhMZy2aeW2X2ok4PhnNoLOMqWYqIZan8gxdyWwtc/Zc9p58Fc5J3L+eWtOVWPp2xtfhq5H4Ojg2j6fKJKW5vQPrl5BjNhmwQfDn5Hb8PdY1NzVMwbNnp9aEKgrSx8o+qHJTPTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834038; c=relaxed/simple; bh=MIEBxlmM/JehrSUbCdGYuUJVphACPYc5J2/hOlFW8bs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RSVVXCORaiDMRxpcCiD6daU8ODIdm1gYM1Cv6yJbDgnXZZygb4ofSYfdzCx2LBNszBS+KnIp5SsNbXaNnrvPGGoRFLxlKQ9jDm5w9siE/9RWxGq9hsJRQlOvdXJ0r+5v0s+bLLxhLPuQsskvj5JM5X3NwAPQQeP1RdHac6+kIR8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LPaSffdo; arc=none smtp.client-ip=209.85.221.53 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LPaSffdo" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-38dabb11eaaso306127f8f.0; Thu, 06 Feb 2025 01:27:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834034; x=1739438834; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=u1vk9Xp7oEUk84DuTuRzAw8DRnqd3iIb00KUqFXuLuQ=; b=LPaSffdorUg+Qs656HxlJhdeqqar6z7WZY6Rn0dTYLxyh1W2X5AOLk/bM9rHx9TMBw /CjiXP4JCEUU4aYMsdCoZBb9FuX3nJv1osRbCGH4gEm+63eZkT4nKTp/AvRekOoO3/uc NUy30TrvjAbY/Yv2cuE/oDbaE6W/VF/MBleQkfhnfpRPzLXf6QYpPMJEP9FqUgyhIPpZ WwQgA8m11BEXcqaHgUw9Cz+PhHFjkPjKcVq2qtxp4DEDcbywWAe8ehi2lt0nwkjH7fxu VIIxzE+B8K/ZqSgqcsnXRneelU12NtUW2nEdLsGtEDX+d9yzHQYo/emSGaT1om9oToto O+UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834034; x=1739438834; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u1vk9Xp7oEUk84DuTuRzAw8DRnqd3iIb00KUqFXuLuQ=; b=iF9IbXKK9Hr4O8vXV6O/2KNRX7zdskXEodc4s2vaqlM4SIUsPZmKLDCk7gVXUe+uIc sRlMVKFcmVs3sf7PpxnXIKz6qZuc1XO3hf2YXiED5QGcyFXCY82EzWt+MUT1NhleAk4B w39cRXMijZqJmsvwRAtsBCS9ZPt9Wx5ABJqGKkqPbyib83vbFF7BLVqc2q+1ku9kik9x k0tIB65+6upkA87JCYucxqlU76BwW3hazhK24/bZCNp/+k9WFr/c57L+msr0ZzFgrO3m 9NFlSA/0yjCJwz8QIl3Kw3HiMgTTzSEnX93Z3G2XuzCxnEYj9yomqS/eaMxlzRt1hm+e 1sDA== X-Forwarded-Encrypted: i=1; AJvYcCV/pEf/1HmQJyAJlEjh6w3nktCQGHb4hsZj+PkIXNMwCiCBClUE8fT7iyz8XqEiHWHO6P9bgQFmSLxlpM3kZA==@vger.kernel.org X-Gm-Message-State: AOJu0Yx6mgCTqgc1e2QJpqj5by0LGE2Euy4nkhaCczzEw6LNLsMDR2p1 bsvy+aFRz3xoBDr7IMmWiD1BgZdlFT533SQcPK8G0QMS0ZTWIYoZLDcB1g== X-Gm-Gg: ASbGncsUoTksKQOD6DSKxn0OAQ+pUzfysd+UB0YuXw/L+7h4jyGSaeir8zE+dSJKTzk hcMT1WQKXIZ8Lp1/yg+yU7PmYIY67aeHFlqP/3IhhtVT5GmFUGLVRegXsTdtQb4pMQ/AkbOb4uT EUWg2QL1kh2nL78OBnPjSsTEUXfPq3vfRAmSWztpUxhPrU/7sCyWLi0I7iQ2oCtlVYuNc6ka6NO Jy7VWU5EcNyxsQ/yBotABW3KyeBa1cxajhNMHCVW3vURjfLdE4L5RgVGIEBtXyym9MRt3GRgJUD 8tlWL2V7UIDohy73zt4RB3QkHOsermj5OA== X-Google-Smtp-Source: AGHT+IEVnvjK7wZFL1PKzBZVNeJCKllRpJAMMNZ3nV752+filVyzoxF59KUh7RPhMwKxRwW9pM0K7Q== X-Received: by 2002:adf:f810:0:b0:38d:b1ea:506a with SMTP id ffacd0b85a97d-38db488dea7mr4286616f8f.28.1738834034420; Thu, 06 Feb 2025 01:27:14 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:13 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 02/10] tools/net/ynl: support decoding indexed arrays as enums Date: Thu, 6 Feb 2025 09:26:50 +0000 Message-ID: <20250206092658.1383-3-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When decoding an indexed-array with a scalar subtype, it is currently only possible to add a display-hint. Add support for decoding each value as an enum. Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski --- tools/net/ynl/pyynl/lib/ynl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py index 8b39d8b1eaa8..b73e07f1f60c 100644 --- a/tools/net/ynl/pyynl/lib/ynl.py +++ b/tools/net/ynl/pyynl/lib/ynl.py @@ -650,7 +650,9 @@ class YnlFamily(SpecFamily): decoded.append(subattr) elif attr_spec["sub-type"] in NlAttr.type_formats: subattr = item.as_scalar(attr_spec['sub-type'], attr_spec.byte_order) - if attr_spec.display_hint: + if 'enum' in attr_spec: + subattr = self._decode_enum(subattr, attr_spec) + elif attr_spec.display_hint: subattr = self._formatted_string(subattr, attr_spec.display_hint) decoded.append(subattr) else: From patchwork Thu Feb 6 09:26:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863565 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 09E5522616A; Thu, 6 Feb 2025 09:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834039; cv=none; b=qhCIITGbe+pvcV6CorVVaSYs+g5M1dvMjpr6pidPPN2s8LFwuItF0NBzdtaFLk4VJURsT/88Zu0+jvcsqdwzMiVZrqU2PdJeG7eYWPCpvx45qtttJvDxHQ0UoaaeKSsz8JSmvi/nleMfGGpeZbZBbetThIJVHiiFHcp/H/wFx/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834039; c=relaxed/simple; bh=1sXRpKRdwQWU3PDhHFw9zXhzGGi7++rZDL+a2/5+euE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KHm0SdW9aQkM0uXrZLLd7/lHb7O/LN5mpxFcoOjgrd4+wl7b+Xckd0gMnbtYPrqZmwJAaRpOtKkgM8GncQ9gGrlxlL2Q5dlGUkM4XeQRRu+vOmiUDvx7CHUUzIS0IhFGmlyMpGNCWM8iDlFaSPfca5udaO2rIPi5zJR2v13dx1Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=m8ds3Pui; arc=none smtp.client-ip=209.85.221.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m8ds3Pui" Received: by mail-wr1-f42.google.com with SMTP id ffacd0b85a97d-38be3bfb045so1097149f8f.0; Thu, 06 Feb 2025 01:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834036; x=1739438836; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xRuritwii5Exw4qc/zxuGeTLgpqDh2QQL5NTFCoOB4M=; b=m8ds3PuiDCKcEgaCDGNjnRdNChC0bm/2X+fy+k+kNOCQNgq4tH3Gq6VbvQNbaR80iK xcIVF27+6K+A4nWrt4urfFeElIKWqSO8OvvPU3X9Wj0F70UhGIabvlbNTCCvsrThyloP fsxwqvEEWCf9xKd9hsXzu9yjMWnqeQIkXkGEK2w7GRKQ+rgoHdtxB9x3CNUb16upJi0v eK56KiDoOHQvuFOmmjHOEyXhtpPexHrxSLS9B2b3w73KhfCVGSWqxNiaIlyqZPWC/klM iUslFTiqZgTq4b/vPUU5Mi6SniXB1dNCBv/6IMunj/wQ7hA+OHcBw2IIJexhG3Lx3+Az DsOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834036; x=1739438836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xRuritwii5Exw4qc/zxuGeTLgpqDh2QQL5NTFCoOB4M=; b=I2bvJZ/XNcvfn85xRCA6Q4c1xFuEKww+8IHNx8ROR947v4Q1RxrXILWVHz0XdOFas/ foc9gDa6Tv2Xck4tnFRSdy1a+/FA26S1W2sQKOk5N73qlvpJ9YKYLSRc813FbpX9V6FH Ke85ZgBWkCeA1ZBoJBk0DrbNf8pk/2feitn08+TrNlxZRJFlAMFXWJ880yxk5kCsom/a WXS8fpP4BGRfNUljt7FPyCF9zu2Xm+OY9ncLRZSQk3RbMvrJtyhGprr/d7OqqC2AvKvD dpNKltxgpp91L71rWmT2+Wmc1v2inDB9TUyC5VEkWgZOqsMjhubbUjjqwYMkdw8+12DZ 9JNw== X-Forwarded-Encrypted: i=1; AJvYcCVxx2fFx/2N16EKFuapXF9LFrZzMZUlWQXadQfTbU42Ojq+yFByzI4p8xL4P7RVN0qVAN2FC78qPyURdGL6mw==@vger.kernel.org X-Gm-Message-State: AOJu0YxDTg9cPrJJ3hrnyZVnkhM9TfdGM3M7gQXttxdeEKfzcmM1yg5d e03WfRuQ6QpbfWNdZ0VzIKu0TzfcSjBGQAWpEGNPHs3n9OLWwrpQkf3rVw== X-Gm-Gg: ASbGncsjTb14NBy1rVkjXx45azilKP07fMdKZYRcJM717AXvbSdGFPa7H7YmdYmfRBt aOaPN9k8ET2pYQuVhIrDPvA8UsafXvzWaZ+xp6yi8cQVpUhVVPY0mF9lf03hzXjux5VX2V4RWLJ hId3hLN6DQRQgm6PSuW/nVSxsiJ4SCMZ44eg7MZS+BWCCBl45xlcH6W08bxg3agpJxg9bOfzM38 Jvyo7kRZfee2OVXRjtRyGjKLfIAbwzFxeZMOi6qfNR6YqUZURozO84IVoLeNMO+Fxgl7W+iumtE CzPSUBXcxW6YrLCFvRVP2xiGEZNxtrC06w== X-Google-Smtp-Source: AGHT+IEqkRquqipvlb3C01p0zAq874yy6Y6uF8yBPnALa/jMfkJM6yCw7Pfh+F9Q/nI1in4ypwpSMQ== X-Received: by 2002:a05:6000:188b:b0:38d:b7dc:30b8 with SMTP id ffacd0b85a97d-38dbb2cf5b8mr1980603f8f.18.1738834035501; Thu, 06 Feb 2025 01:27:15 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:14 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 03/10] tools/net/ynl: support rendering C array members to strings Date: Thu, 6 Feb 2025 09:26:51 +0000 Message-ID: <20250206092658.1383-4-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The nl80211 family encodes the list of supported ciphers as a C array of u32 values. Add support for translating arrays of scalars into strings for enum names and display hints. Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski --- tools/net/ynl/pyynl/lib/ynl.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py index b73e07f1f60c..62ce3340796f 100644 --- a/tools/net/ynl/pyynl/lib/ynl.py +++ b/tools/net/ynl/pyynl/lib/ynl.py @@ -627,6 +627,11 @@ class YnlFamily(SpecFamily): decoded = self._decode_struct(attr.raw, attr_spec.struct_name) elif attr_spec.sub_type: decoded = attr.as_c_array(attr_spec.sub_type) + if 'enum' in attr_spec: + decoded = [ self._decode_enum(x, attr_spec) for x in decoded ] + elif attr_spec.display_hint: + decoded = [ self._formatted_string(x, attr_spec.display_hint) + for x in decoded ] else: decoded = attr.as_bin() if attr_spec.display_hint: From patchwork Thu Feb 6 09:26:52 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 862958 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A0A6226532; Thu, 6 Feb 2025 09:27:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834041; cv=none; b=itTztw5ary+uLk48s7O4Bake5+Dh4OJI4yiCzO12XdrzTmAT9PCGQm2n3KYDf647mEZirMrWbN6+4R1pOCg2/GNwpzdPbxvYY+lVM/Y1rcix7ixeOQ0fQZhZzTivYv1vZL0gWSbbjsCDz0oWrLxBgNejsy/ONL/8ni9cWlUp3yI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834041; c=relaxed/simple; bh=lsdo6dOMRiEzgGmbLZEhh4vqI+MpuW1eJhzBvUC2vqc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZBD5jE/TwtCP7+YoPcaQx/Y76guJ4RpGbKNkGciypEVdlap7sMErRDxkJ1RmCdPk969b5zbmzyYjVMDFYmS4G9wt83Fuhk/1Wp4euAzHA3gXzWejPy3WMFMgjDIlfq7s+iYzWWJzyd6UAjBoDYFKpas01dwSczT6qxgNe4Lwkhg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Bns3L9ih; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Bns3L9ih" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-38db34a5c5fso275974f8f.2; Thu, 06 Feb 2025 01:27:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834037; x=1739438837; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jO41Ytx+7wXajgxryk6h+JVDmtp85gTH1SGrqcLWqHE=; b=Bns3L9ihj3JUcs5Nip9F8iGKpcJGGU4LvcASRkq87iDrz+GKwZIhMlab8x5JO064dR 1CyCuCtEZ7KQIM/96Ef6XaEREHOePDKd1BfNG2cU16xjnoNYtjaWIy1Z05t9PkTED8xK OvJ/gA6F9UTKsUN9iT2aIUt3RcEtmb02NJRh3b8RPkhVI3B+WFQg6fZsDR/EHHeuxKra iOM7DpqX+VuKBPUC48YheoQjRaezOExTD2Cij8Dng4yv8nLzIoauzgySnaHnY5DLal4u fQlfmhU5xb/hwUXvYqVBdnmbw+PyzhajwaJLcRS23TbpHr+jonDJV7WxVZSzRBhUUl2Q rIBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834037; x=1739438837; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jO41Ytx+7wXajgxryk6h+JVDmtp85gTH1SGrqcLWqHE=; b=c1YWvLGKgJaCSA4ArW3O5H3SxZIJdxeued8/qzIPN0Fb7kJMDtG5Gsk/KGnYAP5VRt 62Ckjyd4fFt0exyMOJcbW3fphMWuFdfenyx1KyQLfsy/SNeOh5sP64379zqByJyXv3mX RB9RNMqt8jeDsCYHqkLM+gqg1CtxhvwpVRhBlOUC2VhMtrU96Kt1XCclj+hL6jGqRE8v xkE82tp7/YVYNmwQYwwO72ZvCc7bK/G8RY97HIAOOqtBd6hlO4yo0L895JvSNRyGDwk7 O0ZEt06uNd9NoDQJYjgZDn/QpNhSOj/K9eIxHxh1QCr5twJnMPAPCs2hBkMXYxAHtRO2 yAVA== X-Forwarded-Encrypted: i=1; AJvYcCXr0vlrFJgevhbK9SQPXkuuCIKerm3STBPcJ5jWz+yLzS+WOiA4kBHWrjSp2essPOaxW1P8OW/D7uxvFUKMBA==@vger.kernel.org X-Gm-Message-State: AOJu0YwT7OwzkJS29U2Rce4TOCesTfUi+IAqLihmr6m/eWhEzggYQUfS jN8V5AMFIpxr3sFIJWRCqlhQeQjq7hsFvTS32Xibg/E5+HAoK+7RtZrXCg== X-Gm-Gg: ASbGncu5ffazKznwOfMl4UYnFM1wNjml0oO+/KJUM7ukk7CdFbG583bcvvAG6B+J6uU WAttCJ4HsAOJO/FDRHDknVQadWpHqfkHbhUYOvwgtQ/HTc+sBz7MYxIaaXkqnHKT9l3HPAvXcq9 lKlx8qJthpJYXCon1Mt7MF7LwdWqdk9Al+3IFna+pSUEMx4+7cGcJDpN7P5C95xzXsSXpPT20hE TMPfB1/yBFmvh0HbiLbQRZdBKei3+qnRj5T/Y2lk4YObaTtQKqp1uNY0MJTytr/+o1dKD5vkQYC OzOCfDDgxAU9wdhL6P4bUwt6B0hVq3hvHg== X-Google-Smtp-Source: AGHT+IHydIJwt+sylTTqPETMqbxKYDc+dpukzF3o3fO3g4pWts87u/KXodwwYjFI2g2aZ5N7U5xcFg== X-Received: by 2002:a5d:64e3:0:b0:38c:5d42:1516 with SMTP id ffacd0b85a97d-38db48cad35mr4640027f8f.34.1738834037310; Thu, 06 Feb 2025 01:27:17 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:16 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 04/10] tools/net/ynl: accept IP string inputs Date: Thu, 6 Feb 2025 09:26:52 +0000 Message-ID: <20250206092658.1383-5-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The ynl tool uses display-hint to know when to format IP addresses in printed output, but not to parse IP addresses from --json input. Add support for parsing ipv4 and ipv6 strings. Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski --- tools/net/ynl/pyynl/lib/ynl.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/tools/net/ynl/pyynl/lib/ynl.py b/tools/net/ynl/pyynl/lib/ynl.py index 62ce3340796f..dcc2c6b298d6 100644 --- a/tools/net/ynl/pyynl/lib/ynl.py +++ b/tools/net/ynl/pyynl/lib/ynl.py @@ -536,9 +536,11 @@ class YnlFamily(SpecFamily): try: return int(value) except (ValueError, TypeError) as e: - if 'enum' not in attr_spec: - raise e - return self._encode_enum(attr_spec, value) + if 'enum' in attr_spec: + return self._encode_enum(attr_spec, value) + if attr_spec.display_hint: + return self._from_string(value, attr_spec) + raise e def _add_attr(self, space, name, value, search_attrs): try: @@ -571,7 +573,10 @@ class YnlFamily(SpecFamily): if isinstance(value, bytes): attr_payload = value elif isinstance(value, str): - attr_payload = bytes.fromhex(value) + if attr.display_hint: + attr_payload = self._from_string(value, attr) + else: + attr_payload = bytes.fromhex(value) elif isinstance(value, dict) and attr.struct_name: attr_payload = self._encode_struct(attr.struct_name, value) else: @@ -906,6 +911,18 @@ class YnlFamily(SpecFamily): formatted = raw return formatted + def _from_string(self, string, attr_spec): + if attr_spec.display_hint in ['ipv4', 'ipv6']: + ip = ipaddress.ip_address(string) + if attr_spec['type'] == 'binary': + raw = ip.packed + else: + raw = int(ip) + else: + raise Exception(f"Display hint '{attr_spec.display_hint}' not implemented" + f" when parsing '{attr_spec['name']}'") + return raw + def handle_ntf(self, decoded): msg = dict() if self.include_raw: From patchwork Thu Feb 6 09:26:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863564 Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C485F22655A; Thu, 6 Feb 2025 09:27:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834042; cv=none; b=K+kGqwnp+U+SGAKijSFdAIDq4hoDrikKhlJEKP6EWB1IWV6jeWpP15hESFM8ThxwwmWdCYKgewFoq3FCcd39uUhweHPqkI+B8vJkI8JZeB1QCx+7u/W+cjFeQj6wHjEWsFk+JFt0JzBzsCjRSo3Q4Uz5cu0h8ZwnkKk8Yxd9I8w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834042; c=relaxed/simple; bh=uAA0SrBIEat8KHomEGBPPHi6DFugJWWC167a7gJeS1c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H5YBDL7dGj+Drp/BaFfpuWbdYGCZBnheAl5tdxm48CJ7/ZE4AjtdNU8BDE+2RoVmVVrOgK51mU5UTi8RwXSEml3tsO2Qmx9a7CG7CPE4U0nUwNaX4uISkf6E+DlsHr1qXqOCJRpFakIXRmwo12Ac8QFzU9Z4cswY53B+OIjC6zc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZPkOFREi; arc=none smtp.client-ip=209.85.128.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZPkOFREi" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43618283d48so4304865e9.1; Thu, 06 Feb 2025 01:27:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834038; x=1739438838; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xw9XalKM7KcIW2N2jDDGMQtPiQlecJSRq7lkkgga6Wc=; b=ZPkOFREiAIlMWQs7p6HLtC1OxymTeUf3neY6JiRf9jicc1jAZ18ul3/EqRn2H9HPkm b3PXK74+0r1N+uInMbVulp+sgI0tfc/zQobjGiucUyD+xgSDB6VnGe8PAayxNtjQmJeQ Qmf0rHrXMRXH7tn+WPhZrAUbkNG1lTYgjeI6C7QHKJ5bUmsXl0tYkvKdV7RADbI3BwwI fKr/FAJqVYtCgRs3kOib+axptEQAYYVMX2Mzy9D5AeNKUMNIwYoR/vOg6Q8l1/zAhDeO LUI1RkWyWJ6f4ETtasmL7OSgjiLLsW9LH0AzX1I8MNtY0DQULMSyuDj1uux6f7VrHyZn 4XSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834038; x=1739438838; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xw9XalKM7KcIW2N2jDDGMQtPiQlecJSRq7lkkgga6Wc=; b=b1veh06ibClXMm0ygEQKnxjj1Vq/eEg/vsuPmLwk8z/VUaj8PKlfafTL8Sxmh4B1sm +MCUCJzyE3y94ClBl5lbSnTkha1ft1kEBdQkr86M3ryJrwjyGP4tp6nXfcH4NMgUR4yT 3WLZnFJrg8oL4dtIcF7Jwl14jHtI6tZVQRDaAv52KQ9LmU1khT01tY60GSqfGQcFktI9 yKwb11s2wUrJn7OsLdTFahiIShhhsrbaftUOVBsdk+OixUfgK10JpeQ8jTlNkPKivLpo zMx2UwtGCf3PzePJpSZnIgNnYArBvH+oy+Ifh96nA88ypgZLfqqXlZg7QAf0YlOPCCx5 KVpg== X-Forwarded-Encrypted: i=1; AJvYcCXd8pq+/+JnvHVstHuSeZuBO1G0E0Tm2YVvTLAhUpGjJz9nkkFpKbfonxwITp+jty8u+BwMIRIhujp5j21rfQ==@vger.kernel.org X-Gm-Message-State: AOJu0Yz2VA9mhQXlJ64N7lYU/s/1iVNABus2qaZFqrl08ee11waTtsES TnLXmIs7VuuN7nE8FnmwFB5ueB06w2ImYk+BsKzLFOmeSzigh6efIH+LwA== X-Gm-Gg: ASbGncuYkZRGqo2RZaUe6JOmKGKg7VCRFD1dT4cI7ymbLtmY9j/hDQjf+dNjDKizI80 cdU0VD/VMoaylziMsJ2VHhtXRjlWvclYybYFwomhHXy3HcvDSnzkIdfIHjwthXBeIQxa/vM/3ne glGHgxV6Jz4bqvh/+5bbJAI7FHKw084WAKM0ojnfOSUuTlo9B24Th0mA+/9Df5Z0T621ZTtIiG9 V2a13PzBPS84Wv2uZK1kru8hbHjkMyh6IlY0VtgcMbPFEZtdOOMHHj+dS3ubPggM2r7+qS8wrvg jKGgedUWtFyREIaMDfoPjkE1Cr+yDyaT2w== X-Google-Smtp-Source: AGHT+IFsKWzmuGPREshk9x0xR8ujPED2HwsoSVLrOJMPwtUEytMYjnGepRB3adMb2KBden9DXQhgRA== X-Received: by 2002:a05:600c:5252:b0:434:a711:ace4 with SMTP id 5b1f17b1804b1-4390d43dc2amr45777375e9.17.1738834038431; Thu, 06 Feb 2025 01:27:18 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:17 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 05/10] tools/net/ynl: add s8, s16 to valid scalars in ynl-gen-c Date: Thu, 6 Feb 2025 09:26:53 +0000 Message-ID: <20250206092658.1383-6-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add the missing s8 and s16 scalar types to the list of recognised scalars in ynl-gen-c. Signed-off-by: Donald Hunter --- tools/net/ynl/pyynl/ynl_gen_c.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py index c2eabc90dce8..803d49bf7c33 100755 --- a/tools/net/ynl/pyynl/ynl_gen_c.py +++ b/tools/net/ynl/pyynl/ynl_gen_c.py @@ -1437,7 +1437,7 @@ class CodeWriter: self._ifdef_block = config_option -scalars = {'u8', 'u16', 'u32', 'u64', 's32', 's64', 'uint', 'sint'} +scalars = {'u8', 'u16', 'u32', 'u64', 's8', 's16', 's32', 's64', 'uint', 'sint'} direction_to_suffix = { 'reply': '_rsp', From patchwork Thu Feb 6 09:26:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 862957 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CED0722686D; Thu, 6 Feb 2025 09:27:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834043; cv=none; b=M75ViujFUGjuXDvrXYC6/p8VhI8Xpb+6HC8b9EO+q3hi9LACpG36nzIw8Bd2TvEdZeyPAuzoKb9KZeCjM3upM3O6RZaNBA2f65iEu9W6VyDZ8AO6xYsr/xZTQipJpHL7Ps7NeqLbIUHrL9ydAb+FlScda6cedQ9lo6K6nc7sV24= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834043; c=relaxed/simple; bh=fuqRzmevS9IAnW4Wt7PbWYeJ5MrRmH47PylvWWHflJE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l8azDr9tIYDVYGa4T73sm7IE35VJVqpQ+QLrWYXdQWtK/jFG4t4zkj5dt+mV60O9LK2/jx3HQ6m9IvCcWERtJzOZReH0lRK0S1cU7mJiriTnLXbDLWthD8Cbyc7qYOdqgwSRSwG7+3frk9jmauuFSlbn3HNip8yPuK/FlmVwjEM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JpiqV75Z; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JpiqV75Z" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso4248325e9.2; Thu, 06 Feb 2025 01:27:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834040; x=1739438840; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZD1A+FuJcFmQYzWvA7e1aKpjVc6S9z2H4uwtlJoHi/I=; b=JpiqV75ZGAoMmMIgM04T5tVs8cnvRJZ1snbAUQYJdsI3E3oj61zipmiNPQ0ivwCQmu oRjlZlDr+w0wsZpMTgNtwJFQ1rCxDbhrEekTh28/+l5DcTC3sx0Ju3fkInam4kfiMjAC 0Mgl1Zi4Yz8hb5V/obdB4yBPWj+UTL8Qqf/n8pL7EvV7peG8925O5EKnnitiKjeoZDpx q9B4qfIVixz1Leq177l2ZDNooTIDiWoYUpR9ZDGeyK/Bmojqi3tHVWgL3nZ50+Bcqg0a D2uUMksntgD60+xzQG7qsncuxCLvzEJOjTjIOgdjRk5RKcL9ZHQd01TYUU0MXnl67tBr 0z+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834040; x=1739438840; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZD1A+FuJcFmQYzWvA7e1aKpjVc6S9z2H4uwtlJoHi/I=; b=whsuRvxp6PTZ8sd1Gsx9WvCXCODj7KpVNQCMD70SX/yxCAptNoCvFZ+vbpJ4CZzZfk VXdszYX2JybyH8J/ki32FkuWeMYfd/PtTz0krITKNYoLH2LXAIILXMiRaNW850QCA8P1 x4H9XKHDyfKdCbF4aNjqyv8JAue4lIU9tu5xvc9A0mL+CZ6P1alB4pQyxOJf4qD22FKA 6QHkSOvaOdV1nYAXbpOcNvegOVzFiqUFEkHVcDvT2oMzyT+sV4NrUE+ahJ3eBQ5gKBix BiBnfDHchVPaYYkEZy5nrtgdB44eM+zXIYtekYmIO4fPXMBa0dw+lnCqA0OXO4hthSXS pR9Q== X-Forwarded-Encrypted: i=1; AJvYcCXof3b+RE3HWQjdfLI5jbJUY+54jAyMAzBb7QK6zwZulvlWMNdbEQ6ajmI9E18btN6kfu8NWgfiYsLAQifIOA==@vger.kernel.org X-Gm-Message-State: AOJu0YyotKcQwfw1uhHEncpTtLwhVEksRBmrXKv8VLw31OYxf95rI9GG BGILArPKnraUmaVQw3i4df3diIwwlUJQl2oWxSPhBdkUZLWVcio/EDlx3g== X-Gm-Gg: ASbGncuZYaPAHnldCS6+VMmTPfnLmspn9kJj2EPQvmBHpE98fZYKRVOyIS80kMVJ9xm +DQToBBlMt7zuG2w5Dhk5RfK18O4MrkDr7znNEeKDu0+GX/LGM5mGzRUy6BCtKXll01SJvfALJf IILwpdH3Ex7lr426dj3MeX/qrlAJr9L7Y7CUU4U+bR/uE4aRo5vYJy4HE5QmdswiaUBFJxVwtsH ra30Mbcsit/Cv7peCqV1Oij3lDQbjMxt486GcV4k2779/dA1K6E3nIXvpqGWiuyCM3GPZB2Y+GQ BTfHIjHBwOIcOSFqu6SmFZAUDpQ18xaxxw== X-Google-Smtp-Source: AGHT+IE2+vk6Rfl6Eu++lPJgFtF1FpwcfABD6MXwx6nAD6CU7x+IK4w9PgGkbatzHQXdJVujedD3Yw== X-Received: by 2002:a05:600c:19d4:b0:434:fdbc:5cf7 with SMTP id 5b1f17b1804b1-4390d56ccb4mr47840195e9.27.1738834039682; Thu, 06 Feb 2025 01:27:19 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:18 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 06/10] tools/net/ynl: sanitise enums with leading digits in ynl-gen-c Date: Thu, 6 Feb 2025 09:26:54 +0000 Message-ID: <20250206092658.1383-7-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Turn attribute names with leading digits into valid C names by prepending an underscore, e.g. 5ghz -> _5ghz Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski --- tools/net/ynl/pyynl/ynl_gen_c.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py index 803d49bf7c33..1316a4fe798a 100755 --- a/tools/net/ynl/pyynl/ynl_gen_c.py +++ b/tools/net/ynl/pyynl/ynl_gen_c.py @@ -45,6 +45,8 @@ class BaseNlLib: class Type(SpecAttr): + starts_with_digit = re.compile(r"^\d") + def __init__(self, family, attr_set, attr, value): super().__init__(family, attr_set, attr, value) @@ -74,6 +76,8 @@ class Type(SpecAttr): self.c_name = c_lower(self.name) if self.c_name in _C_KW: self.c_name += '_' + if self.starts_with_digit.match(self.c_name): + self.c_name = '_' + self.c_name # Added by resolve(): self.enum_name = None From patchwork Thu Feb 6 09:26:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863563 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C54BF226532; Thu, 6 Feb 2025 09:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834044; cv=none; b=bBItzI0Y+m+Os9I3sSoUUFckl3wya8/OpsLKevYNAkyWWGCihceSxQO+3k0YomiSC0nXyHsd9D1t2IEK9K8dHYhWRwG6EG4UzcYET1EtXqfOAoaVmfV72UCuda2L6fgSa/y829JxmkhQATC0GEvMADA7Wecv9xUGu9MGT13P3y0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834044; c=relaxed/simple; bh=uKcZT2zDhCk8R/AW5iSFkJK3WSSoEKelbgY7E8ifqI8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fqURKhqo8s+6k7fUtx2yL1IXDPqpT4ojtWaDX+9xGSf9AdgN9vlsEYe/3V4sFoCFVHssn/YDsZhxN9Vif6ghapM0YJwt9Ae+78fKDoiok7LJxSgTsEI4Ha7E/l4dKMGs+Mgr/Bz0BLVX4KIK9bNf9Apa7dE2OTwaZwDvAMawaTo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=QfEqDSG/; arc=none smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="QfEqDSG/" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-436326dcb1cso4172455e9.0; Thu, 06 Feb 2025 01:27:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834041; x=1739438841; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4gmsIRuDoMMbPVfyRmIRyVAKXjFuu0acHJd7odQj6dE=; b=QfEqDSG/sCY/V4D4IoQRu42jfPX3eE3obxXw7iX6VxY7zdGE8b0XTJSFK2v2kN/8AQ WLZp5gPam81+yvEi22+puCfpPSMfnLbFm5p7lk7c92hUZU3zOfzjaFDSNFtgA01d58wQ KEAIOYLqgb9wY4tGJXi4geBIJqQKzp4ESREkzFvrtyrt1J0xY5vRYZ7CbZm15aZDxedf ezeTujhkVNbC631mhhQg23OvO+8XgTRphdy2TNjk3fzKJazzaP/+ij3RwoxvY7xM9NuR O9WTo3C1nyqTPGduJxBEzvOUA2/EdrGvvowYEE5Iv568db3eE7HGDj57kEskucI+3/3O Riwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834041; x=1739438841; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4gmsIRuDoMMbPVfyRmIRyVAKXjFuu0acHJd7odQj6dE=; b=VyQzL9SHrLWb963vpxH4Z/pSArQBiVr5Zu+vsVFI534CcxMiKrwMEPWf6EVYKbu3z3 SwFbNLBpXPELbPPmED6cocYNWcjQ7KyiE+fjOj8LXYFeVqlF2SVIZtglGsyVaBYcudAv Zku60fNzGsOHTQA+F8ULivUIQjQM75ymm2BcNoKs266H0zA2bPQp7VIWqdhnMwQVkq9p JbbfmxBYciB8pSs1t7yKqaXV5nUF4ubof5OE9lxgRyG2v8YooeFopphtYsVvEaJfn9eX rvJHX3Du4w9zRyefnhijh68HeXvheG2aFrzYzN1+eFvQIdMWNRL1jzGB2R3KjlpgBGG8 tT9A== X-Forwarded-Encrypted: i=1; AJvYcCVxsBv78vGYB6jOAvxeIFyQDS+ssU3rqVdjpPf6QmIv7sG9ixkECOfLUc/clQ3D4++G/mEa2+qZZp3Go2WviA==@vger.kernel.org X-Gm-Message-State: AOJu0YxSpd+68XsOLN9OKFqDRC2KbmuMz3iWsARh45DmaplYBRXK3/F+ 29a5/AbR3wlSSvKXSq9JsvklectymW8wdHz+DqXeE+Hkhc61K75lLjA05Q== X-Gm-Gg: ASbGnctsZYmNluCj5eKu5sjdbVgJQp5zsWtzrSt6oTIxM+JMEoGLhamWi4aGvn+6tvr /Y91jYqeSodsCyKoSAy9N8M6rW4+Z3yBGzMsRLg6MEc4jzVg/BZWHulU+QOEFoUfzuZY9nqxEbx 1lHNkLmHDvb7gO+sBBXjbwa9g832runkfhBT3fBvpwvMpEkSe/jsIiDT+CLvLIHdkipLcJaH98w nn+47IrN3O3GlzpCKUM3OTCn7A0R+fYEKDUgoHEPofya4o6YGDOdcR3h2e+d+HbUEIFOt0YALzy YE3EPdlhO1uaaJVAnHl3jSSfipIybvxMYg== X-Google-Smtp-Source: AGHT+IEeuJUvH4F+nP+wc7totD0y3bHzs4WHDZ+ek0QKSi/073i8Fgiwnsv3CNYyLYcAn658d233xw== X-Received: by 2002:a05:600c:354a:b0:434:fbcd:1382 with SMTP id 5b1f17b1804b1-4390d435cf2mr61290065e9.11.1738834040699; Thu, 06 Feb 2025 01:27:20 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:20 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 07/10] tools/net/ynl: add indexed-array scalar support to ynl-gen-c Date: Thu, 6 Feb 2025 09:26:55 +0000 Message-ID: <20250206092658.1383-8-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Extend ynl-gen-c.py with support for indexed-array that has a scalar sub-type. Signed-off-by: Donald Hunter --- tools/net/ynl/pyynl/ynl_gen_c.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py index 1316a4fe798a..7e6454185310 100755 --- a/tools/net/ynl/pyynl/ynl_gen_c.py +++ b/tools/net/ynl/pyynl/ynl_gen_c.py @@ -687,7 +687,10 @@ class TypeArrayNest(Type): raise Exception(f"Sub-type {self.attr['sub-type']} not supported yet") def _attr_typol(self): - return f'.type = YNL_PT_NEST, .nest = &{self.nested_render_name}_nest, ' + if self.attr['sub-type'] in scalars: + return f'.type = YNL_PT_U{c_upper(self.sub_type[1:])}, ' + else: + return f'.type = YNL_PT_NEST, .nest = &{self.nested_render_name}_nest, ' def _attr_get(self, ri, var): local_vars = ['const struct nlattr *attr2;'] @@ -889,7 +892,7 @@ class AttrSet(SpecAttrSet): elif elem['type'] == 'nest': t = TypeNest(self.family, self, elem, value) elif elem['type'] == 'indexed-array' and 'sub-type' in elem: - if elem["sub-type"] == 'nest': + if elem["sub-type"] in ['nest', 'u32']: t = TypeArrayNest(self.family, self, elem, value) else: raise Exception(f'new_attr: unsupported sub-type {elem["sub-type"]}') @@ -1673,6 +1676,9 @@ def _multi_parse(ri, struct, init_lines, local_vars): if aspec["sub-type"] == 'nest': local_vars.append(f'const struct nlattr *attr_{aspec.c_name};') array_nests.add(arg) + elif aspec['sub-type'] in scalars: + local_vars.append(f'const struct nlattr *attr_{aspec.c_name};') + array_nests.add(arg) else: raise Exception(f'Not supported sub-type {aspec["sub-type"]}') if 'multi-attr' in aspec: @@ -1728,11 +1734,17 @@ def _multi_parse(ri, struct, init_lines, local_vars): ri.cw.p(f"dst->{aspec.c_name} = calloc(n_{aspec.c_name}, sizeof(*dst->{aspec.c_name}));") ri.cw.p(f"dst->n_{aspec.c_name} = n_{aspec.c_name};") ri.cw.p('i = 0;') - ri.cw.p(f"parg.rsp_policy = &{aspec.nested_render_name}_nest;") + if 'nested-attributes' in aspec: + ri.cw.p(f"parg.rsp_policy = &{aspec.nested_render_name}_nest;") ri.cw.block_start(line=f"ynl_attr_for_each_nested(attr, attr_{aspec.c_name})") - ri.cw.p(f"parg.data = &dst->{aspec.c_name}[i];") - ri.cw.p(f"if ({aspec.nested_render_name}_parse(&parg, attr, ynl_attr_type(attr)))") - ri.cw.p('return YNL_PARSE_CB_ERROR;') + if 'nested-attributes' in aspec: + ri.cw.p(f"parg.data = &dst->{aspec.c_name}[i];") + ri.cw.p(f"if ({aspec.nested_render_name}_parse(&parg, attr, ynl_attr_type(attr)))") + ri.cw.p('return YNL_PARSE_CB_ERROR;') + elif aspec.sub_type in scalars: + ri.cw.p(f"dst->{aspec.c_name}[i] = ynl_attr_get_{aspec.sub_type}(attr);") + else: + raise Exception(f"Nest parsing type not supported in {aspec['name']}") ri.cw.p('i++;') ri.cw.block_end() ri.cw.block_end() From patchwork Thu Feb 6 09:26:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 862956 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3CA6B227572; Thu, 6 Feb 2025 09:27:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834045; cv=none; b=b57zs7T1MiYZ50Hao3z06cTu+kcfon5uRe+TTNTSsh68u4hlS2XrLGPBYtS1ekCVHFJFfJLEBUPUpSEG5SBi5TEnFvoNLD2DB6EDM0kWAQVf9WsMqp/74lIbMHF6SVfFBUc7CG3xXWg0PbVSGAu9ZLlJqCw8pIsN+wBkkZv2hdc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834045; c=relaxed/simple; bh=l0ve3/ZfTrw8KX/paqRD9vxVfJgy5x+8T2goSjjrKvQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gcup8rUKs/p4q/WCXZrF4sV++n5qxX+sNCPzQiHpqYVvc09zjfWnc1rD51iNFl5ITLEu4jFt8yWAL8tXNv5W3BS09bI9BJ+SJ/yVCWKaaZHlKY8WmmkDXii6dWA7Glk1NHko/zeLpFuyA3iBiXUCs/lXbozguTUNM6B8cW74HGc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OykfYmAE; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OykfYmAE" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-436a03197b2so4009655e9.2; Thu, 06 Feb 2025 01:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834042; x=1739438842; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gfT6LZq3DFOpoqH60VVDcjGqtGHLOctS6hzPusqkWkg=; b=OykfYmAEOegkXqyhlWuWbmpxdNVHkTouE7PfCPJ8UPDMUk+/qkRFpUebHueTW6NpSJ dlacnJ8xudcFUIAXd9/oToHDoFOtM7QfFeyUCw6HHXmWUK17BbYXJqOPXOYBZvpqdnvD CzMiC2Q0Od9LXob3K8/7TguchCn3dqrQA59I9AyGmx+D38ocrHyeah7SX4jhbB5H7ZEW ePQKg6/S4HuWuBEvSwiKeQda1UztlwTp6rEy5yGbkLuIWIcSciropTPs/wXSUalXkf11 XORjPmAO5nMif2jF6mLhx5aOHfRzVDGIv/ii4hUg2vrfDnubNQDGkg4K2kTxsGf62wEp 0PFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834042; x=1739438842; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gfT6LZq3DFOpoqH60VVDcjGqtGHLOctS6hzPusqkWkg=; b=O2mnd/KdDxIBxdH/WdJQ5toq5FPSsWICOOq5SgcwT5sFrbfuJ6OOTUCUZb1xcYwC3p SlWXzsf6T3qvbl80oNVp09IrBIaafCXgqb22L+LhmQOyIA7dVtn5gzBTZujDes/fbXh4 jBTiKM8nwtt74Jn24VMTo5K9In/2EytYTsqfp95d8R2iDfYz53I0Q88eIHUFD/CIiv+a Q3mMzDjssX91z41rgnjfTxigkyqUI/miYoqCgoxqDgyKgQDTufeGF4OsAkZyw49JzAJr LGR9Fq/BqlZO0j2/YYrfanJnh/KXGKE/ptRSRl1goO+3NFsq0D0yztPOP/nwyCg2Tepn +MhA== X-Forwarded-Encrypted: i=1; AJvYcCVAFPxAn7FqN3ALRoxNDl1Mca6xTV7ASmZ2p4+laNYaCNf5jm5oGywVLIQjo/HzCOMxzCgb+pXIRdAyC0iHYg==@vger.kernel.org X-Gm-Message-State: AOJu0YyK87gWfwwXNi0Qvr9FeKwObzjMaoOgjD0IkoImAqVtAT6LL3Lf 8LRhOXHt92MStbU+6nhu4BLJ35IqaWPDH8cHeIVBxXY082rbV3j8NLAy8g== X-Gm-Gg: ASbGncuhv22TrBThQdHEi2U5hq87wPaAiOMULMebHDs3xozqvinpKRql50ThFUaN41A Tv06rprxoXtpHJJmlvZwi4J3mR5xc50v1KSW5aY2l5YJGBd263sihtiTM74QLBs2iK4enXcel8f mTXXvlb+GwLUVPlEeCWP8e6ZCgZSNYOBx0dr71z1xOv5IINlgsJ9f7d8Da0Ywlmjx5DNzdsmjlq DX+cle9vjYv1+U+8jBC4Wb0cKfmc+EFlUXPEMupEyJ3Cko7EfgH0YLWEQz/hQM38iuRxn3I4TGc AOTfYe1yp++xMZY/slXx/5GVboUDcxj/JQ== X-Google-Smtp-Source: AGHT+IGf0iUgly7IFSJWOfA0j8MMMW/pcIbelEXZkAjg5rzPPCZN6K/B+/0dRALENtHghKD2iqzL8Q== X-Received: by 2002:a05:600c:3c9b:b0:431:54d9:da57 with SMTP id 5b1f17b1804b1-4390d56f1a6mr54979735e9.30.1738834041951; Thu, 06 Feb 2025 01:27:21 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:21 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 08/10] netlink: specs: support nested structs in genetlink legacy Date: Thu, 6 Feb 2025 09:26:56 +0000 Message-ID: <20250206092658.1383-9-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Nested structs are already supported in netlink-raw. Add the same capability to the genetlink legacy schema. Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski --- Documentation/netlink/genetlink-legacy.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml index 16380e12cabe..7520f63ec3d2 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -151,6 +151,9 @@ properties: the right formatting mechanism when displaying values of this type. enum: [ hex, mac, fddi, ipv4, ipv6, uuid ] + struct: + description: Name of the nested struct type. + type: string # End genetlink-legacy attribute-sets: From patchwork Thu Feb 6 09:26:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863562 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 79A6E22758C; Thu, 6 Feb 2025 09:27:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834047; cv=none; b=Qkc7w1RZ6QMNBztL6HMDrZF4jj6CuYCWv3T5RtbwMPXdkZKPSDMIRr0qcLj8RMgNZWlWmP1FBXNJcqMRFxrc4HjIFCVMk6mj32JrdPKzPiqcqpNXISZ9t4mOOKRMhCDufUygCXAGHnb0chKeKx6ZZj6xNhb6PfZOvvW5wubnU4U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834047; c=relaxed/simple; bh=QmsEzKzzJGYOq874VAOHSiVw74tkMZ15y3+V3jZrZho=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V+AT0LyfJ5JWajrefgoNsLsYqKC1iJCYtpRbr70d1p3CwqIwcHd9/RsKeYGYUgRbnTUsF8YYNcZVfAvZKHYmFTGLC83JqKi9HRu5VS3HF9aaAR+hIKI79ORJVOQ7RjhMNga0dRzk8Amli+hZ8huF2Mrz9oNnSDN2sOujmnPM2dc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=eDoAVcam; arc=none smtp.client-ip=209.85.128.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="eDoAVcam" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so7427345e9.0; Thu, 06 Feb 2025 01:27:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834043; x=1739438843; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4agwNFdanzCPIa9NngSa+bE/mcZ7MdAmDzxhW61I1Yg=; b=eDoAVcamLNijWfqAGrL8nJ9KwZPOAZ1VycqbKI5UHlbhNfcK3AMVKcj9NqZi97YORw 6F/2pWEfxHnc6M4Lt++lp5O6Q4sZm1ZogK+HrH0572v7P4KOaQlS2EBpa7dEzVkI2lCg PHyF+diJuNBC/ZnrZYNX50bRqcsMN0Ty7pwH3W7Qj/KMSJxrZ13ll9GFUkC6oSzIvtXK wc6+GqDLi4vVq+bMnL7ucesfBvu97i81HPASIjnfkXFSKvUf6kZ+lU3CpqXov54P6/v/ 4F6o4tg1KuM3OSueiYoRgf2VGpuM9VIqQr+l4KfB3oC9zSOcj98bjTdfLRuam9q2eXI4 IQaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834043; x=1739438843; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4agwNFdanzCPIa9NngSa+bE/mcZ7MdAmDzxhW61I1Yg=; b=Wm1Sd5vniuiXqQVTLr0SinuOf7vHzKom3w43R/5rRcGHdd9s3rjrWQ4GHagwuCMtfN 2xz/wPXxtqaKg+i2/5lY/cgp3xbPNJvjuSKpgT3sc15EUTkoqGUMeXg8xW7MbnwokDDs +9jeFe0fwOrvyOxxrD2CoKmdnZ7yd//lAAKERMz29gE23Dq6KxZK0p+ACSdO9sCh6O79 BdQ2pYUMpBL/L9BDkpS+IpilMRQLzV8HWJzRCkXY1xDHKYyH6ueKJBpk9/0r1DswPamc 6Pityk8yjsCRvaUfynkzp+wJW6/hFn3SV9KHwbaKrpErpegNiwIUFRIE5UY6LsWmhkbX Rknw== X-Forwarded-Encrypted: i=1; AJvYcCVP4NzQrRk5rz0LTRilfm7FgQCKf4cOMt7rxXLC+Npzl5YLjRyWPP/4CRGUXKDVX08PT73a7KWVdM3TDWrjsg==@vger.kernel.org X-Gm-Message-State: AOJu0Yw09EVnUSf+HBLbixnk41jh6Lnl2bA2qXig0g6aoQ1iASxVCIIS 7J69w3iNpONeEieeWDe1/B/Vj0vIbLubqWMUzseSKTN3U0o0dWkdGUUDfw== X-Gm-Gg: ASbGnctHy6f621rtn2uxIcOY+1ToSUZRKOTCl7R6adwcOtULz7MA9qEz6KTLWyupPmk 2YLBTc8fDwxItOreT8AWUBr2J3LTxuwAWlS7dM0gmfW8qX4FvZbt1fF2pQejaIh9tbhV6dFq95p 2aRTrNO7Mz7JUZAgfX3Lzd7mcfqpXXWY2zkWwON7cVD8ciTddupkJDAraG716hebtjt73wDXHmX /e9zrim26G2c6aUZCoXZsdq1Cv4qZ+doHz0U6w5OdLA1y4xhabpKCxXi1s57lm0nCF3Jii9UdLg rn21TmhvqlAXmAvgOSPEbSiCgSIix6TSpQ== X-Google-Smtp-Source: AGHT+IERC9nP8+4HMx93VvS/7xBayoNuPNvFUZda3ucW7t1Sxz5E9YrIEfzCWRyLHcbpmQuTU4Wxyw== X-Received: by 2002:a05:600c:1d0f:b0:436:fa4f:a1cf with SMTP id 5b1f17b1804b1-4390d574df3mr49021995e9.29.1738834043170; Thu, 06 Feb 2025 01:27:23 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:22 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 09/10] netlink: specs: add s8, s16 to genetlink schemas Date: Thu, 6 Feb 2025 09:26:57 +0000 Message-ID: <20250206092658.1383-10-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add s8 and s16 types to the genetlink schemas to align scalar types across all schemas. Signed-off-by: Donald Hunter Reviewed-by: Jakub Kicinski --- Documentation/netlink/genetlink-c.yaml | 2 +- Documentation/netlink/genetlink-legacy.yaml | 2 +- Documentation/netlink/genetlink.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/netlink/genetlink-c.yaml b/Documentation/netlink/genetlink-c.yaml index 9660ffb1ed6a..1cfc8073a120 100644 --- a/Documentation/netlink/genetlink-c.yaml +++ b/Documentation/netlink/genetlink-c.yaml @@ -160,7 +160,7 @@ properties: type: string type: &attr-type enum: [ unused, pad, flag, binary, - uint, sint, u8, u16, u32, u64, s32, s64, + uint, sint, u8, u16, u32, u64, s8, s16, s32, s64, string, nest, indexed-array, nest-type-value ] doc: description: Documentation of the attribute. diff --git a/Documentation/netlink/genetlink-legacy.yaml b/Documentation/netlink/genetlink-legacy.yaml index 7520f63ec3d2..f98ed12a09c0 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -206,7 +206,7 @@ properties: type: &attr-type description: The netlink attribute type enum: [ unused, pad, flag, binary, bitfield32, - uint, sint, u8, u16, u32, u64, s32, s64, + uint, sint, u8, u16, u32, u64, s8, s16, s32, s64, string, nest, indexed-array, nest-type-value ] doc: description: Documentation of the attribute. diff --git a/Documentation/netlink/genetlink.yaml b/Documentation/netlink/genetlink.yaml index b036227b46f1..11c1592d49be 100644 --- a/Documentation/netlink/genetlink.yaml +++ b/Documentation/netlink/genetlink.yaml @@ -123,7 +123,7 @@ properties: type: string type: &attr-type enum: [ unused, pad, flag, binary, - uint, sint, u8, u16, u32, u64, s32, s64, + uint, sint, u8, u16, u32, u64, s8, s16, s32, s64, string, nest, indexed-array, nest-type-value ] doc: description: Documentation of the attribute. From patchwork Thu Feb 6 09:26:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 862955 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2AD0227B8A; Thu, 6 Feb 2025 09:27:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834050; cv=none; b=RZDQuiY6bGh9U0SE0YxAgizJazyfPxirn3y9ySgl1ekc/VBWXN94yJGuWicxCLN9xeZ+KSJBB97xobnF97yDtcadgl7HSxnRdObdBhUzFnMJHs2RNWTKMVdLJ4GP8gYvDDRHRdIJnPxaOlzhX8royU2COdyUNZ+o9C0aCtv/9pc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738834050; c=relaxed/simple; bh=J//whj/WztqgphhbN+Ts5aIj6lH5U92L1wnsIjw+I6U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lBUdvqyIWa/qJUzkLt3RYW3J939z7DeOfOOaufREFuIQ97ymzzrRXu3UVrg1qapU18j7ef2k/JGizf0ktpsZifzCeAqqQb7omAH/TEagyekxb3xrHH6KOwDaESYTy8Wmh4/g4YFCR4mUg154eBgp6RDFgX9F+oUuh0zBI/DZh9k= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=K37G6a5a; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K37G6a5a" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-436341f575fso6933365e9.1; Thu, 06 Feb 2025 01:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738834045; x=1739438845; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gq4sJP8ltVlOEWrmEy5m5pmhrH/LS8/dZLZhWWS4OOI=; b=K37G6a5az/o2vLZE9DG/QWX5O83x2QV9nMtnX7gOiJn8t1WUDEOQ7PvNTFc+A2SQHx qqi8pPAsojVNNNg4hoo3rjUS6/Iodklj19OnduhsUgLuI3YbbkaAm4ZGHn42Pvswwed6 06ifLnkAJ8u1rGrCXKI01UI1jPchi9JnayqmFQWYtz1CkJLuu1BtYg+RnDoku59axfQ4 HFE07Vb7BjCp3VM2tMCbPM7WWM/bx++yW2bAaxxH8m+FWu5b0v35r5jJixtBsrjSlVL5 agQcD3UsL8ZzuC50C9Hk/8G5LoSxHpmU/QSubcYyK2++lrcr2b+F0UM22eGaScy0Q1LA pDaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738834045; x=1739438845; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gq4sJP8ltVlOEWrmEy5m5pmhrH/LS8/dZLZhWWS4OOI=; b=Vy5HDboSp2WPBVy1X3Lyi4qUJrCpL7+7qsxGDZx/PCW8SP1zkZw0Rn208Fg0jfrcll hoU6prjULf4mg5wSQ9Gx8Wdn73gBf4BUNwTdrP9OVtqG2tnj8AayJo59vYtCifvRgeie 4HOHLNu+zystN7SYqDEdr1EwciAgsA0kURhtG8IzbsrYvvLmoJh6mZLroChje+sX/Xj/ JDxU+0cTYJiqxEEXH/ZFW3BvZFbeYz0DB4+b7eDv+74CLgr7OCTUcTM9J5lKTm+XZJWd hFBSTP6t7ePLTWi0M+Uk7ieoCHFa/OTjRTMVAxKUI0hKNPog4cbNpmhzecCsCgvxsL1d SdYQ== X-Forwarded-Encrypted: i=1; AJvYcCXqboyYuGSKmP8mhHrnohb2yHj7JuIyYMx7H95yFwl2whxkQDa0OdjNUDnEshYyLCCLQS7Ml9qs1HvI8BuDfw==@vger.kernel.org X-Gm-Message-State: AOJu0Ywg5TwDfxzvVoPzxw39/sbFmPs/laPEdIs6IO16/NY2OBhWFjEN yuuTaCNDPHJJoyZtwTfAx1xn+IDMN4UGtVj6DOXgjY4Scz5Irro0P0MiHg== X-Gm-Gg: ASbGncu4pAtvTZnHpY1NyiX1QMd9a8jkcxERgGGAa0Co4BtcYf5Ni2HUKch2fc2nc+B dQElClxLeUSIn7u/YcSgK3oxNL5FFyKFpBg4dhaqW3tbRlzfZfkLJqE5Q9JGSuRWUe6ckTqhYSG RqxYPPFx30Uvgq/5N0u7KOY1QKjQLYhm46X5HSTNt5BPc+60nmh9Kj3HdxmnLc1KVrX2TI23fG+ zlizpXFTu/gBMaaG30/+i30Uag8AixncXdMP40AEbN7hAVO9r4akV3TEJf/u7t4LaivvoDqtYce cN/2tLlVx7m3VwPRYu6X7U9z5CMqNIc59Q== X-Google-Smtp-Source: AGHT+IEa/pFusfcZEu0OSRk2t4hMfR89e8ViRjGPncFxLpp5794UrOv6rupqgpNbf/0HCS6MId4eKw== X-Received: by 2002:a05:600c:3b0f:b0:439:90f:ba9d with SMTP id 5b1f17b1804b1-4390d434f24mr51978245e9.8.1738834044519; Thu, 06 Feb 2025 01:27:24 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:c428:5404:970c:34c7]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dca004esm12832585e9.13.2025.02.06.01.27.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 01:27:23 -0800 (PST) From: Donald Hunter To: netdev@vger.kernel.org, Jakub Kicinski , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Johannes Berg , linux-wireless@vger.kernel.org Cc: donald.hunter@redhat.com, Donald Hunter Subject: [PATCH net-next v3 10/10] netlink: specs: wireless: add a spec for nl80211 Date: Thu, 6 Feb 2025 09:26:58 +0000 Message-ID: <20250206092658.1383-11-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250206092658.1383-1-donald.hunter@gmail.com> References: <20250206092658.1383-1-donald.hunter@gmail.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a rudimentary YNL spec for nl80211 that covers get-wiphy, get-interface and get-protocol-features. ./tools/net/ynl/pyynl/cli.py --family nl80211 \ --do get-protocol-features {'protocol-features': {'split-wiphy-dump'}} ./tools/net/ynl/pyynl/cli.py --family nl80211 \ --dump get-wiphy --json '{ "split-wiphy-dump": true }' ./tools/net/ynl/pyynl/cli.py --family nl80211 \ --dump get-interface Signed-off-by: Donald Hunter --- Documentation/netlink/specs/nl80211.yaml | 2000 ++++++++++++++++++++++ tools/net/ynl/Makefile.deps | 1 + 2 files changed, 2001 insertions(+) create mode 100644 Documentation/netlink/specs/nl80211.yaml diff --git a/Documentation/netlink/specs/nl80211.yaml b/Documentation/netlink/specs/nl80211.yaml new file mode 100644 index 000000000000..789a709bbd94 --- /dev/null +++ b/Documentation/netlink/specs/nl80211.yaml @@ -0,0 +1,2000 @@ +# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) + +name: nl80211 +protocol: genetlink-legacy + +doc: + Netlink API for 802.11 wireless devices + +definitions: + - + name: commands + type: enum + entries: + - unspec + - get-wiphy + - set-wiphy + - new-wiphy + - del-wiphy + - get-interface + - set-interface + - new-interface + - del-interface + - get-key + - set-key + - new-key + - del-key + - get-beacon + - set-beacon + - new-beacon + - del-beacon + - get-station + - set-station + - new-station + - del-station + - get-mpath + - set-mpath + - new-mpath + - del-mpath + - set-bss + - set-reg + - req-set-reg + - get-mesh-config + - set-mesh-config + - set-mgmt-extra-ie + - get-reg + - get-scan + - trigger-scan + - new-scan-results + - scan-aborted + - reg-change + - authenticate + - associate + - deauthenticate + - disassociate + - michael-mic-failure + - reg-beacon-hint + - join-ibss + - leave-ibss + - testmode + - connect + - roam + - disconnect + - set-wiphy-netns + - get-survey + - new-survey-results + - set-pmksa + - del-pmksa + - flush-pmksa + - remain-on-channel + - cancel-remain-on-channel + - set-tx-bitrate-mask + - register-action + - action + - action-tx-status + - set-power-save + - get-power-save + - set-cqm + - notify-cqm + - set-channel + - set-wds-peer + - frame-wait-cancel + - join-mesh + - leave-mesh + - unprot-deauthenticate + - unprot-disassociate + - new-peer-candidate + - get-wowlan + - set-wowlan + - start-sched-scan + - stop-sched-scan + - sched-scan-results + - sched-scan-stopped + - set-rekey-offload + - pmksa-candidate + - tdls-oper + - tdls-mgmt + - unexpected-frame + - probe-client + - register-beacons + - unexpected-4-addr-frame + - set-noack-map + - ch-switch-notify + - start-p2p-device + - stop-p2p-device + - conn-failed + - set-mcast-rate + - set-mac-acl + - radar-detect + - get-protocol-features + - update-ft-ies + - ft-event + - crit-protocol-start + - crit-protocol-stop + - get-coalesce + - set-coalesce + - channel-switch + - vendor + - set-qos-map + - add-tx-ts + - del-tx-ts + - get-mpp + - join-ocb + - leave-ocb + - ch-switch-started-notify + - tdls-channel-switch + - tdls-cancel-channel-switch + - wiphy-reg-change + - abort-scan + - start-nan + - stop-nan + - add-nan-function + - del-nan-function + - change-nan-config + - nan-match + - set-multicast-to-unicast + - update-connect-params + - set-pmk + - del-pmk + - port-authorized + - reload-regdb + - external-auth + - sta-opmode-changed + - control-port-frame + - get-ftm-responder-stats + - peer-measurement-start + - peer-measurement-result + - peer-measurement-complete + - notify-radar + - update-owe-info + - probe-mesh-link + - set-tid-config + - unprot-beacon + - control-port-frame-tx-status + - set-sar-specs + - obss-color-collision + - color-change-request + - color-change-started + - color-change-aborted + - color-change-completed + - set-fils-aad + - assoc-comeback + - add-link + - remove-link + - add-link-sta + - modify-link-sta + - remove-link-sta + - set-hw-timestamp + - links-removed + - set-tid-to-link-mapping + - + name: feature-flags + type: flags + entries: + - sk-tx-status + - ht-ibss + - inactivity-timer + - cell-base-reg-hints + - p2p-device-needs-channel + - sae + - low-priority-scan + - scan-flush + - ap-scan + - vif-txpower + - need-obss-scan + - p2p-go-ctwin + - p2p-go-oppps + - reserved + - advertise-chan-limits + - full-ap-client-state + - userspace-mpm + - active-monitor + - ap-mode-chan-width-change + - ds-param-set-ie-in-probes + - wfa-tpc-ie-in-proves + - quiet + - tx-power-insertion + - ackto-estimation + - static-smps + - dynamic-smps + - supports-wmm-admission + - mac-on-create + - tdls-channel-switch + - scan-random-mac-addr + - sched-scan-random-mac-addr + - no-random-mac-addr + - + name: ieee80211-mcs-info + type: struct + members: + - + name: rx-mask + type: binary + len: 10 + - + name: rx-highest + type: u16 + byte-order: little-endian + - + name: tx-params + type: u8 + - + name: reserved + type: binary + len: 3 + - + name: ieee80211-vht-mcs-info + type: struct + members: + - + name: rx-mcs-map + type: u16 + byte-order: little-endian + - + name: rx-highest + type: u16 + byte-order: little-endian + - + name: tx-mcs-map + type: u16 + byte-order: little-endian + - + name: tx-highest + type: u16 + byte-order: little-endian + - + name: ieee80211-ht-cap + type: struct + members: + - + name: cap-info + type: u16 + byte-order: little-endian + - + name: ampdu-params-info + type: u8 + - + name: mcs + type: binary + struct: ieee80211-mcs-info + - + name: extended-ht-cap-info + type: u16 + byte-order: little-endian + - + name: tx-bf-cap-info + type: u32 + byte-order: little-endian + - + name: antenna-selection-info + type: u8 + - + name: channel-type + type: enum + entries: + - no-ht + - ht20 + - ht40minus + - ht40plus + - + name: sta-flag-update + type: struct + members: + - + name: mask + type: u32 + - + name: set + type: u32 + - + name: protocol-features + type: flags + entries: + - split-wiphy-dump + +attribute-sets: + - + name: nl80211-attrs + name-prefix: nl80211-attr- + enum-name: nl80211-attrs + attr-max-name: num-nl80211-attr + attributes: + - + name: wiphy + type: u32 + - + name: wiphy-name + type: string + - + name: ifindex + type: u32 + - + name: ifname + type: string + - + name: iftype + type: u32 + - + name: mac + type: binary + display-hint: mac + - + name: key-data + type: binary + - + name: key-idx + type: u8 + - + name: key-cipher + type: u32 + - + name: key-seq + type: binary + - + name: key-default + type: flag + - + name: beacon-interval + type: u32 + - + name: dtim-period + type: u32 + - + name: beacon-head + type: binary + - + name: beacon-tail + type: binary + - + name: sta-aid + type: u16 + - + name: sta-flags + type: binary # TODO: nest + - + name: sta-listen-interval + type: u16 + - + name: sta-supported-rates + type: binary + - + name: sta-vlan + type: u32 + - + name: sta-info + type: binary # TODO: nest + - + name: wiphy-bands + type: nest + nested-attributes: wiphy-bands + - + name: mntr-flags + type: binary # TODO: nest + - + name: mesh-id + type: binary + - + name: sta-plink-action + type: u8 + - + name: mpath-next-hop + type: binary + display-hint: mac + - + name: mpath-info + type: binary # TODO: nest + - + name: bss-cts-prot + type: u8 + - + name: bss-short-preamble + type: u8 + - + name: bss-short-slot-time + type: u8 + - + name: ht-capability + type: binary + - + name: supported-iftypes + type: nest + nested-attributes: supported-iftypes + - + name: reg-alpha2 + type: binary + - + name: reg-rules + type: binary # TODO: nest + - + name: mesh-config + type: binary # TODO: nest + - + name: bss-basic-rates + type: binary + - + name: wiphy-txq-params + type: binary # TODO: nest + - + name: wiphy-freq + type: u32 + - + name: wiphy-channel-type + type: u32 + enum: channel-type + - + name: key-default-mgmt + type: flag + - + name: mgmt-subtype + type: u8 + - + name: ie + type: binary + - + name: max-num-scan-ssids + type: u8 + - + name: scan-frequencies + type: binary # TODO: nest + - + name: scan-ssids + type: binary # TODO: nest + - + name: generation + type: u32 + - + name: bss + type: binary # TODO: nest + - + name: reg-initiator + type: u8 + - + name: reg-type + type: u8 + - + name: supported-commands + type: indexed-array + sub-type: u32 + enum: commands + - + name: frame + type: binary + - + name: ssid + type: binary + - + name: auth-type + type: u32 + - + name: reason-code + type: u16 + - + name: key-type + type: u32 + - + name: max-scan-ie-len + type: u16 + - + name: cipher-suites + type: binary + sub-type: u32 + display-hint: hex + - + name: freq-before + type: binary # TODO: nest + - + name: freq-after + type: binary # TODO: nest + - + name: freq-fixed + type: flag + - + name: wiphy-retry-short + type: u8 + - + name: wiphy-retry-long + type: u8 + - + name: wiphy-frag-threshold + type: u32 + - + name: wiphy-rts-threshold + type: u32 + - + name: timed-out + type: flag + - + name: use-mfp + type: u32 + - + name: sta-flags2 + type: binary + struct: sta-flag-update + - + name: control-port + type: flag + - + name: testdata + type: binary + - + name: privacy + type: flag + - + name: disconnected-by-ap + type: flag + - + name: status-code + type: u16 + - + name: cipher-suites-pairwise + type: binary + - + name: cipher-suite-group + type: u32 + - + name: wpa-versions + type: u32 + - + name: akm-suites + type: binary + - + name: req-ie + type: binary + - + name: resp-ie + type: binary + - + name: prev-bssid + type: binary + - + name: key + type: binary # TODO: nest + - + name: keys + type: binary # TODO: nest + - + name: pid + type: u32 + - + name: 4addr + type: u8 + - + name: survey-info + type: binary # TODO: nest + - + name: pmkid + type: binary + - + name: max-num-pmkids + type: u8 + - + name: duration + type: u32 + - + name: cookie + type: u64 + - + name: wiphy-coverage-class + type: u8 + - + name: tx-rates + type: binary # TODO: nest + - + name: frame-match + type: binary + - + name: ack + type: flag + - + name: ps-state + type: u32 + - + name: cqm + type: binary # TODO: nest + - + name: local-state-change + type: flag + - + name: ap-isolate + type: u8 + - + name: wiphy-tx-power-setting + type: u32 + - + name: wiphy-tx-power-level + type: u32 + - + name: tx-frame-types + type: nest + nested-attributes: nl80211-iftype-attrs + - + name: rx-frame-types + type: nest + nested-attributes: nl80211-iftype-attrs + - + name: frame-type + type: u16 + - + name: control-port-ethertype + type: flag + - + name: control-port-no-encrypt + type: flag + - + name: support-ibss-rsn + type: flag + - + name: wiphy-antenna-tx + type: u32 + - + name: wiphy-antenna-rx + type: u32 + - + name: mcast-rate + type: u32 + - + name: offchannel-tx-ok + type: flag + - + name: bss-ht-opmode + type: u16 + - + name: key-default-types + type: binary # TODO: nest + - + name: max-remain-on-channel-duration + type: u32 + - + name: mesh-setup + type: binary # TODO: nest + - + name: wiphy-antenna-avail-tx + type: u32 + - + name: wiphy-antenna-avail-rx + type: u32 + - + name: support-mesh-auth + type: flag + - + name: sta-plink-state + type: u8 + - + name: wowlan-triggers + type: binary # TODO: nest + - + name: wowlan-triggers-supported + type: nest + nested-attributes: wowlan-triggers-attrs + - + name: sched-scan-interval + type: u32 + - + name: interface-combinations + type: indexed-array + sub-type: nest + nested-attributes: if-combination-attributes + - + name: software-iftypes + type: nest + nested-attributes: supported-iftypes + - + name: rekey-data + type: binary # TODO: nest + - + name: max-num-sched-scan-ssids + type: u8 + - + name: max-sched-scan-ie-len + type: u16 + - + name: scan-supp-rates + type: binary # TODO: nest + - + name: hidden-ssid + type: u32 + - + name: ie-probe-resp + type: binary + - + name: ie-assoc-resp + type: binary + - + name: sta-wme + type: binary # TODO: nest + - + name: support-ap-uapsd + type: flag + - + name: roam-support + type: flag + - + name: sched-scan-match + type: binary # TODO: nest + - + name: max-match-sets + type: u8 + - + name: pmksa-candidate + type: binary # TODO: nest + - + name: tx-no-cck-rate + type: flag + - + name: tdls-action + type: u8 + - + name: tdls-dialog-token + type: u8 + - + name: tdls-operation + type: u8 + - + name: tdls-support + type: flag + - + name: tdls-external-setup + type: flag + - + name: device-ap-sme + type: u32 + - + name: dont-wait-for-ack + type: flag + - + name: feature-flags + type: u32 + enum: feature-flags + enum-as-flags: True + - + name: probe-resp-offload + type: u32 + - + name: probe-resp + type: binary + - + name: dfs-region + type: u8 + - + name: disable-ht + type: flag + - + name: ht-capability-mask + type: binary + struct: ieee80211-ht-cap + - + name: noack-map + type: u16 + - + name: inactivity-timeout + type: u16 + - + name: rx-signal-dbm + type: u32 + - + name: bg-scan-period + type: u16 + - + name: wdev + type: u64 + - + name: user-reg-hint-type + type: u32 + - + name: conn-failed-reason + type: u32 + - + name: auth-data + type: binary + - + name: vht-capability + type: binary + - + name: scan-flags + type: u32 + - + name: channel-width + type: u32 + - + name: center-freq1 + type: u32 + - + name: center-freq2 + type: u32 + - + name: p2p-ctwindow + type: u8 + - + name: p2p-oppps + type: u8 + - + name: local-mesh-power-mode + type: u32 + - + name: acl-policy + type: u32 + - + name: mac-addrs + type: binary # TODO: nest + - + name: mac-acl-max + type: u32 + - + name: radar-event + type: u32 + - + name: ext-capa + type: binary + - + name: ext-capa-mask + type: binary + - + name: sta-capability + type: u16 + - + name: sta-ext-capability + type: binary + - + name: protocol-features + type: u32 + enum: protocol-features + - + name: split-wiphy-dump + type: flag + - + name: disable-vht + type: flag + - + name: vht-capability-mask + type: binary + - + name: mdid + type: u16 + - + name: ie-ric + type: binary + - + name: crit-prot-id + type: u16 + - + name: max-crit-prot-duration + type: u16 + - + name: peer-aid + type: u16 + - + name: coalesce-rule + type: binary # TODO: nest + - + name: ch-switch-count + type: u32 + - + name: ch-switch-block-tx + type: flag + - + name: csa-ies + type: binary # TODO: nest + - + name: cntdwn-offs-beacon + type: binary + - + name: cntdwn-offs-presp + type: binary + - + name: rxmgmt-flags + type: binary + - + name: sta-supported-channels + type: binary + - + name: sta-supported-oper-classes + type: binary + - + name: handle-dfs + type: flag + - + name: support-5-mhz + type: flag + - + name: support-10-mhz + type: flag + - + name: opmode-notif + type: u8 + - + name: vendor-id + type: u32 + - + name: vendor-subcmd + type: u32 + - + name: vendor-data + type: binary + - + name: vendor-events + type: binary + - + name: qos-map + type: binary + - + name: mac-hint + type: binary + display-hint: mac + - + name: wiphy-freq-hint + type: u32 + - + name: max-ap-assoc-sta + type: u32 + - + name: tdls-peer-capability + type: u32 + - + name: socket-owner + type: flag + - + name: csa-c-offsets-tx + type: binary + - + name: max-csa-counters + type: u8 + - + name: tdls-initiator + type: flag + - + name: use-rrm + type: flag + - + name: wiphy-dyn-ack + type: flag + - + name: tsid + type: u8 + - + name: user-prio + type: u8 + - + name: admitted-time + type: u16 + - + name: smps-mode + type: u8 + - + name: oper-class + type: u8 + - + name: mac-mask + type: binary + display-hint: mac + - + name: wiphy-self-managed-reg + type: flag + - + name: ext-features + type: binary + - + name: survey-radio-stats + type: binary + - + name: netns-fd + type: u32 + - + name: sched-scan-delay + type: u32 + - + name: reg-indoor + type: flag + - + name: max-num-sched-scan-plans + type: u32 + - + name: max-scan-plan-interval + type: u32 + - + name: max-scan-plan-iterations + type: u32 + - + name: sched-scan-plans + type: binary # TODO: nest + - + name: pbss + type: flag + - + name: bss-select + type: binary # TODO: nest + - + name: sta-support-p2p-ps + type: u8 + - + name: pad + type: binary + - + name: iftype-ext-capa + type: binary # TODO: nest + - + name: mu-mimo-group-data + type: binary + - + name: mu-mimo-follow-mac-addr + type: binary + display-hint: mac + - + name: scan-start-time-tsf + type: u64 + - + name: scan-start-time-tsf-bssid + type: binary + - + name: measurement-duration + type: u16 + - + name: measurement-duration-mandatory + type: flag + - + name: mesh-peer-aid + type: u16 + - + name: nan-master-pref + type: u8 + - + name: bands + type: u32 + - + name: nan-func + type: binary # TODO: nest + - + name: nan-match + type: binary # TODO: nest + - + name: fils-kek + type: binary + - + name: fils-nonces + type: binary + - + name: multicast-to-unicast-enabled + type: flag + - + name: bssid + type: binary + display-hint: mac + - + name: sched-scan-relative-rssi + type: s8 + - + name: sched-scan-rssi-adjust + type: binary + - + name: timeout-reason + type: u32 + - + name: fils-erp-username + type: binary + - + name: fils-erp-realm + type: binary + - + name: fils-erp-next-seq-num + type: u16 + - + name: fils-erp-rrk + type: binary + - + name: fils-cache-id + type: binary + - + name: pmk + type: binary + - + name: sched-scan-multi + type: flag + - + name: sched-scan-max-reqs + type: u32 + - + name: want-1x-4way-hs + type: flag + - + name: pmkr0-name + type: binary + - + name: port-authorized + type: binary + - + name: external-auth-action + type: u32 + - + name: external-auth-support + type: flag + - + name: nss + type: u8 + - + name: ack-signal + type: s32 + - + name: control-port-over-nl80211 + type: flag + - + name: txq-stats + type: nest + nested-attributes: txq-stats-attrs + - + name: txq-limit + type: u32 + - + name: txq-memory-limit + type: u32 + - + name: txq-quantum + type: u32 + - + name: he-capability + type: binary + - + name: ftm-responder + type: binary # TODO: nest + - + name: ftm-responder-stats + type: binary # TODO: nest + - + name: timeout + type: u32 + - + name: peer-measurements + type: binary # TODO: nest + - + name: airtime-weight + type: u16 + - + name: sta-tx-power-setting + type: u8 + - + name: sta-tx-power + type: s16 + - + name: sae-password + type: binary + - + name: twt-responder + type: flag + - + name: he-obss-pd + type: binary # TODO: nest + - + name: wiphy-edmg-channels + type: u8 + - + name: wiphy-edmg-bw-config + type: u8 + - + name: vlan-id + type: u16 + - + name: he-bss-color + type: binary # TODO: nest + - + name: iftype-akm-suites + type: binary # TODO: nest + - + name: tid-config + type: binary # TODO: nest + - + name: control-port-no-preauth + type: flag + - + name: pmk-lifetime + type: u32 + - + name: pmk-reauth-threshold + type: u8 + - + name: receive-multicast + type: flag + - + name: wiphy-freq-offset + type: u32 + - + name: center-freq1-offset + type: u32 + - + name: scan-freq-khz + type: binary # TODO: nest + - + name: he-6ghz-capability + type: binary + - + name: fils-discovery + type: binary # TOOD: nest + - + name: unsol-bcast-probe-resp + type: binary # TOOD: nest + - + name: s1g-capability + type: binary + - + name: s1g-capability-mask + type: binary + - + name: sae-pwe + type: u8 + - + name: reconnect-requested + type: binary + - + name: sar-spec + type: nest + nested-attributes: sar-attributes + - + name: disable-he + type: flag + - + name: obss-color-bitmap + type: u64 + - + name: color-change-count + type: u8 + - + name: color-change-color + type: u8 + - + name: color-change-elems + type: binary # TODO: nest + - + name: mbssid-config + type: binary # TODO: nest + - + name: mbssid-elems + type: binary # TODO: nest + - + name: radar-background + type: flag + - + name: ap-settings-flags + type: u32 + - + name: eht-capability + type: binary + - + name: disable-eht + type: flag + - + name: mlo-links + type: binary # TODO: nest + - + name: mlo-link-id + type: u8 + - + name: mld-addr + type: binary + display-hint: mac + - + name: mlo-support + type: flag + - + name: max-num-akm-suites + type: binary + - + name: eml-capability + type: u16 + - + name: mld-capa-and-ops + type: u16 + - + name: tx-hw-timestamp + type: u64 + - + name: rx-hw-timestamp + type: u64 + - + name: td-bitmap + type: binary + - + name: punct-bitmap + type: u32 + - + name: max-hw-timestamp-peers + type: u16 + - + name: hw-timestamp-enabled + type: flag + - + name: ema-rnr-elems + type: binary # TODO: nest + - + name: mlo-link-disabled + type: flag + - + name: bss-dump-include-use-data + type: flag + - + name: mlo-ttlm-dlink + type: u16 + - + name: mlo-ttlm-ulink + type: u16 + - + name: assoc-spp-amsdu + type: flag + - + name: wiphy-radios + type: binary # TODO: nest + - + name: wiphy-interface-combinations + type: binary # TODO: nest + - + name: vif-radio-mask + type: u32 + - + name: frame-type-attrs + subset-of: nl80211-attrs + attributes: + - + name: frame-type + - + name: wiphy-bands + name-prefix: nl80211-band- + attr-max-name: num-nl80211-bands + attributes: + - + name: 2ghz + doc: 2.4 GHz ISM band + value: 0 + type: nest + nested-attributes: band-attrs + - + name: 5ghz + doc: around 5 GHz band (4.9 - 5.7 GHz) + type: nest + nested-attributes: band-attrs + - + name: 60ghz + doc: around 60 GHz band (58.32 - 69.12 GHz) + type: nest + nested-attributes: band-attrs + - + name: 6ghz + type: nest + nested-attributes: band-attrs + - + name: s1ghz + type: nest + nested-attributes: band-attrs + - + name: lc + type: nest + nested-attributes: band-attrs + - + name: band-attrs + enum-name: nl80211-band-attr + name-prefix: nl80211-band-attr- + attributes: + - + name: freqs + type: indexed-array + sub-type: nest + nested-attributes: frequency-attrs + - + name: rates + type: indexed-array + sub-type: nest + nested-attributes: bitrate-attrs + - + name: ht-mcs-set + type: binary + struct: ieee80211-mcs-info + - + name: ht-capa + type: u16 + - + name: ht-ampdu-factor + type: u8 + - + name: ht-ampdu-density + type: u8 + - + name: vht-mcs-set + type: binary + struct: ieee80211-vht-mcs-info + - + name: vht-capa + type: u32 + - + name: iftype-data + type: indexed-array + sub-type: nest + nested-attributes: iftype-data-attrs + - + name: edmg-channels + type: binary + - + name: edmg-bw-config + type: binary + - + name: s1g-mcs-nss-set + type: binary + - + name: s1g-capa + type: binary + - + name: bitrate-attrs + name-prefix: nl80211-bitrate-attr- + attributes: + - + name: rate + type: u32 + - + name: 2ghz-shortpreamble + type: flag + - + name: frequency-attrs + name-prefix: nl80211-frequency-attr- + attributes: + - + name: freq + type: u32 + - + name: disabled + type: flag + - + name: no-ir + type: flag + - + name: no-ibss + name-prefix: __nl80211-frequency-attr- + type: flag + - + name: radar + type: flag + - + name: max-tx-power + type: u32 + - + name: dfs-state + type: u32 + - + name: dfs-time + type: binary + - + name: no-ht40-minus + type: binary + - + name: no-ht40-plus + type: binary + - + name: no-80mhz + type: binary + - + name: no-160mhz + type: binary + - + name: dfs-cac-time + type: binary + - + name: indoor-only + type: binary + - + name: ir-concurrent + type: binary + - + name: no-20mhz + type: binary + - + name: no-10mhz + type: binary + - + name: wmm + type: indexed-array + sub-type: nest + nested-attributes: wmm-attrs + - + name: no-he + type: binary + - + name: offset + type: u32 + - + name: 1mhz + type: binary + - + name: 2mhz + type: binary + - + name: 4mhz + type: binary + - + name: 8mhz + type: binary + - + name: 16mhz + type: binary + - + name: no-320mhz + type: binary + - + name: no-eht + type: binary + - + name: psd + type: binary + - + name: dfs-concurrent + type: binary + - + name: no-6ghz-vlp-client + type: binary + - + name: no-6ghz-afc-client + type: binary + - + name: can-monitor + type: binary + - + name: allow-6ghz-vlp-ap + type: binary + - + name: if-combination-attributes + enum-name: nl80211-if-combination-attrs + name-prefix: nl80211-iface-comb- + attr-max-name: max-nl80211-iface-comb + attributes: + - + name: limits + type: indexed-array + sub-type: nest + nested-attributes: iface-limit-attributes + - + name: maxnum + type: u32 + - + name: sta-ap-bi-match + type: flag + - + name: num-channels + type: u32 + - + name: radar-detect-widths + type: u32 + - + name: radar-detect-regions + type: u32 + - + name: bi-min-gcd + type: u32 + - + name: iface-limit-attributes + enum-name: nl80211-iface-limit-attrs + name-prefix: nl80211-iface-limit- + attr-max-name: max-nl80211-iface-limit + attributes: + - + name: max + type: u32 + - + name: types + type: nest + nested-attributes: supported-iftypes + - + name: iftype-data-attrs + name-prefix: nl80211-band-iftype-attr- + attributes: + - + name: iftypes + type: binary + - + name: he-cap-mac + type: binary + - + name: he-cap-phy + type: binary + - + name: he-cap-mcs-set + type: binary + - + name: he-cap-ppe + type: binary + - + name: he-6ghz-capa + type: binary + - + name: vendor-elems + type: binary + - + name: eht-cap-mac + type: binary + - + name: eht-cap-phy + type: binary + - + name: eht-cap-mcs-set + type: binary + - + name: eht-cap-ppe + type: binary + - + name: nl80211-iftype-attrs + enum-name: nl80211-iftype + name-prefix: nl80211-iftype- + attributes: + - + name: unspecified + type: nest + value: 0 + nested-attributes: frame-type-attrs + - + name: adhoc + type: nest + nested-attributes: frame-type-attrs + - + name: station + type: nest + nested-attributes: frame-type-attrs + - + name: ap + type: nest + nested-attributes: frame-type-attrs + - + name: ap-vlan + type: nest + nested-attributes: frame-type-attrs + - + name: wds + type: nest + nested-attributes: frame-type-attrs + - + name: monitor + type: nest + nested-attributes: frame-type-attrs + - + name: mesh-point + type: nest + nested-attributes: frame-type-attrs + - + name: p2p-client + type: nest + nested-attributes: frame-type-attrs + - + name: p2p-go + type: nest + nested-attributes: frame-type-attrs + - + name: p2p-device + type: nest + nested-attributes: frame-type-attrs + - + name: ocb + type: nest + nested-attributes: frame-type-attrs + - + name: nan + type: nest + nested-attributes: frame-type-attrs + - + name: sar-attributes + enum-name: nl80211-sar-attrs + name-prefix: nl80211-sar-attr- + attributes: + - + name: type + type: u32 + - + name: specs + type: indexed-array + sub-type: nest + nested-attributes: sar-specs + - + name: sar-specs + enum-name: nl80211-sar-specs-attrs + name-prefix: nl80211-sar-attr-specs- + attributes: + - + name: power + type: s32 + - + name: range-index + type: u32 + - + name: start-freq + type: u32 + - + name: end-freq + type: u32 + - + name: supported-iftypes + enum-name: nl80211-iftype + name-prefix: nl80211-iftype- + attributes: + - + name: adhoc + type: flag + - + name: station + type: flag + - + name: ap + type: flag + - + name: ap-vlan + type: flag + - + name: wds + type: flag + - + name: monitor + type: flag + - + name: mesh-point + type: flag + - + name: p2p-client + type: flag + - + name: p2p-go + type: flag + - + name: p2p-device + type: flag + - + name: ocb + type: flag + - + name: nan + type: flag + - + name: txq-stats-attrs + name-prefix: nl80211-txq-stats- + attributes: + - + name: backlog-bytes + type: u32 + - + name: backlog-packets + type: u32 + - + name: flows + type: u32 + - + name: drops + type: u32 + - + name: ecn-marks + type: u32 + - + name: overlimit + type: u32 + - + name: overmemory + type: u32 + - + name: collisions + type: u32 + - + name: tx-bytes + type: u32 + - + name: tx-packets + type: u32 + - + name: max-flows + type: u32 + - + name: wmm-attrs + enum-name: nl80211-wmm-rule + name-prefix: nl80211-wmmr- + attributes: + - + name: cw-min + type: u16 + - + name: cw-max + type: u16 + - + name: aifsn + type: u8 + - + name: txop + type: u16 + - + name: wowlan-triggers-attrs + enum-name: nl80211-wowlan-triggers + name-prefix: nl80211-wowlan-trig- + attr-max-name: max-nl80211-wowlan-trig + attributes: + - + name: any + type: flag + - + name: disconnect + type: flag + - + name: magic-pkt + type: flag + - + name: pkt-pattern + type: flag + - + name: gtk-rekey-supported + type: flag + - + name: gtk-rekey-failure + type: flag + - + name: eap-ident-request + type: flag + - + name: 4way-handshake + type: flag + - + name: rfkill-release + type: flag + - + name: wakeup-pkt-80211 + type: flag + - + name: wakeup-pkt-80211-len + type: flag + - + name: wakeup-pkt-8023 + type: flag + - + name: wakeup-pkt-8023-len + type: flag + - + name: tcp-connection + type: flag + - + name: wakeup-tcp-match + type: flag + - + name: wakeup-tcp-connlost + type: flag + - + name: wakeup-tcp-nomoretokens + type: flag + - + name: net-detect + type: flag + - + name: net-detect-results + type: flag + - + name: unprotected-deauth-disassoc + type: flag + +operations: + enum-model: directional + list: + - + name: get-wiphy + doc: | + Get information about a wiphy or dump a list of all wiphys. Requests to dump get-wiphy + should unconditionally include the split-wiphy-dump flag in the request. + attribute-set: nl80211-attrs + do: + request: + value: 1 + attributes: + - wiphy + - wdev + - ifindex + reply: + value: 3 + attributes: &wiphy-reply-attrs + - bands + - cipher-suites + - control-port-ethertype + - ext-capa + - ext-capa-mask + - ext-features + - feature-flags + - generation + - ht-capability-mask + - interface-combinations + - mac + - max-csa-counters + - max-match-sets + - max-num-akm-suites + - max-num-pmkids + - max-num-scan-ssids + - max-num-sched-scan-plans + - max-num-sched-scan-ssids + - max-remain-on-channel-duration + - max-scan-ie-len + - max-scan-plan-interval + - max-scan-plan-iterations + - max-sched-scan-ie-len + - offchannel-tx-ok + - rx-frame-types + - sar-spec + - sched-scan-max-reqs + - software-iftypes + - support-ap-uapsd + - supported-commands + - supported-iftypes + - tdls-external-setup + - tdls-support + - tx-frame-types + - txq-limit + - txq-memory-limit + - txq-quantum + - txq-stats + - vht-capability-mask + - wiphy + - wiphy-antenna-avail-rx + - wiphy-antenna-avail-tx + - wiphy-antenna-rx + - wiphy-antenna-tx + - wiphy-bands + - wiphy-coverage-class + - wiphy-frag-threshold + - wiphy-name + - wiphy-retry-long + - wiphy-retry-short + - wiphy-rts-threshold + - wowlan-triggers-supported + dump: + request: + attributes: + - wiphy + - wdev + - ifindex + - split-wiphy-dump + reply: + attributes: *wiphy-reply-attrs + - + name: get-interface + doc: Get information about an interface or dump a list of all interfaces + attribute-set: nl80211-attrs + do: + request: + value: 5 + attributes: + - ifname + reply: + value: 7 + attributes: &interface-reply-attrs + - ifname + - iftype + - ifindex + - wiphy + - wdev + - mac + - generation + - txq-stats + - 4addr + dump: + request: + attributes: + - ifname + reply: + attributes: *interface-reply-attrs + - + name: get-protocol-features + doc: Get information about supported protocol features + attribute-set: nl80211-attrs + do: + request: + value: 95 + attributes: + - protocol-features + reply: + value: 95 + attributes: + - protocol-features + +mcast-groups: + list: + - + name: config + - + name: scan + - + name: regulatory + - + name: mlme + - + name: vendor + - + name: nan + - + name: testmode diff --git a/tools/net/ynl/Makefile.deps b/tools/net/ynl/Makefile.deps index 0712b5e82eb7..d98d29bbd26c 100644 --- a/tools/net/ynl/Makefile.deps +++ b/tools/net/ynl/Makefile.deps @@ -21,6 +21,7 @@ CFLAGS_ethtool:=$(call get_hdr_inc,_LINUX_ETHTOOL_H,ethtool.h) \ CFLAGS_handshake:=$(call get_hdr_inc,_LINUX_HANDSHAKE_H,handshake.h) CFLAGS_mptcp_pm:=$(call get_hdr_inc,_LINUX_MPTCP_PM_H,mptcp_pm.h) CFLAGS_netdev:=$(call get_hdr_inc,_LINUX_NETDEV_H,netdev.h) +CFLAGS_nl80211:=$(call get_hdr_inc,__LINUX_NL802121_H,nl80211.h) CFLAGS_nlctrl:=$(call get_hdr_inc,__LINUX_GENERIC_NETLINK_H,genetlink.h) CFLAGS_nfsd:=$(call get_hdr_inc,_LINUX_NFSD_NETLINK_H,nfsd_netlink.h) CFLAGS_ovs_datapath:=$(call get_hdr_inc,__LINUX_OPENVSWITCH_H,openvswitch.h)