From patchwork Fri Feb 7 12:14: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: 863557 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 DEE2B1DC9B4; Fri, 7 Feb 2025 12:15:21 +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=1738930523; cv=none; b=udCwdhLxxlQauOZ20fIVOeeL0sN001IhnQzK+6lqLe5KyFnC2Ty5Hy46i4H4nUH8EQXBrNI2zp7PXeTR2sa4unDAMSydppnSnZYEmkgSXqErgCxNOtT+YEgn80EyKvHs7/kZr/OWhBKq/0eEwnPDISjN6MWWcARVUxtQ+ZdEVMg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930523; c=relaxed/simple; bh=WSmza9m5lqfjaJbkYShhNi8pvsDhRW/0u6ShwBBGN1E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=L9s27ckPVdUfB2Ct8R+7lzHo5az2ZxFZSMRk51vWcSYs/jxC0IFFGwH75403vBFfgmObesw82dBgDH6MW4bBlZ9v3AYq+/7RHvj+tiUcWbYS0TILiPUNg4pr8qLup/79mpMrROt87uFqgMMfTURbyB3Eewox0uzeFQfofOPiq2g= 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=NelkyRY7; 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="NelkyRY7" Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-38da88e6db0so961924f8f.2; Fri, 07 Feb 2025 04:15:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930520; x=1739535320; 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=NelkyRY7OLkZgBxf+AUw9WMXeITUotRwzSfilCQe+akVzk1aKN5R8N1PTmxSyVsJ17 scnwfNLwo/HtZGw/EyNK8do5hw/e/dxLF0o9zDm+H48uQzz3dq5zqZ7B751VkWuNFtfO KJfcjCjNcyEU2xTLB/3loY2iMrmMXwutrBghXmeH8ixaiiJfJzDw2YuwoYU/7EG7B2Z3 mWz69acFqA1y648j2wP5rQZ2lEM1VB6OAeBJCFhUb+svmLqZiAhptXxP2fAl63h8JE0e ezyaenCSGBYDPtDpRA7Z8kf3fOpn8sbdvpNG6aJLhJs0e+zeeaeGpqaqxswZQ8Twxl1X H1lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930520; x=1739535320; 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=rHofOxC5xx9u9LGj3JVaSIcPuy6KIrPkw7xOh77zsRd/puGnKnQ6Yt+IOUTwfFiY/T Qtf5mP7aH46e7TDt6BNkGbqipPGMf9lhD6osxux2rJR3Scgk2AB++J5mXJaP8Cva7JX1 sqhOxpmf30DRfGKR7m6YZWAvTrw53EK7aWY4rAB3PHNdQHdkaLTZKL5k639reYQFgof7 8cQam3mhx/WLVJdlH2SZxKkKFXSGlog/C2JsGtZmYQUOBRuoFv78FWxQje73CMiWefsa Cog/ZnzdDsIgBrVY//CaPT+Di4JIj1vlI3hEqzCXG8t19vkuDL3fuwlGSfNT+8882Yv4 I7gA== X-Forwarded-Encrypted: i=1; AJvYcCWifuWFsosE1O3+zYO64akE67nFSAhmic3IE5J06hrCQaM3G4r/EmUpJYy7A2o8GA8i/y+Gs7DiznzqLT1NvQ==@vger.kernel.org X-Gm-Message-State: AOJu0YyQrAbYG+QTKjHYzeLzEyiP7KODorKHBe/y8fZ3IhzsRHRhCD4S MoGIndA/K/jB2nG1xLBVriuGUxsA1EUAPPaSwyZy05LV949QkSjJdvntZA== X-Gm-Gg: ASbGncskwnlFwP6vpKr3NKsaozRXubGY99/hNGJxmR2P8ZtjorpVNSqeyiP10ATT1Pg rflYxmmBjGAuc9mAOMvHNMgV/Vqxm2Figb8dVFBg720UD9hHzOOHpK/oaB13hyaY4MntyKRiIxJ TiKMW6ka+hSvMI0PJbbCCSbDfem0hfgmVH/0wWxdRuT2E1lB6j8HQG32KuE/HI3RtF1rWFvYGp5 ew+ejmPT+uDL/1XD3HUruMhSgVZVVF1V4QAufRjggTGPRxue+K6KFx8gQ4+uKlaEWXUvbZV09hQ JKaOG7tUfjCvtcD5IdhWZU1P6ag6nK7GZA== X-Google-Smtp-Source: AGHT+IE5bzxTXUzkblrWpaakpQwArAU9kIvC8pXsmccIfMbvzfZsR7+njlkdzXA8Nn/coHZz68pWcQ== X-Received: by 2002:a05:6000:1447:b0:38d:b547:6650 with SMTP id ffacd0b85a97d-38dc8fe575emr2066949f8f.27.1738930519410; Fri, 07 Feb 2025 04:15:19 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15: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 v4 01/10] tools/net/ynl: remove extraneous plural from variable names Date: Fri, 7 Feb 2025 12:14:58 +0000 Message-ID: <20250207121507.94221-2-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 Fri Feb 7 12:14:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863282 Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) (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 1E6721DED70; Fri, 7 Feb 2025 12:15:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930524; cv=none; b=ZdBlxAkn5G/mTNgkLyN6n7ZT05iwikgJdvAkeT3/FYtbLUevIEs7iopRr2646bLDYKRebbFrNZAhUCpoWawd7CmC7+F0O9/DSoFkXNds3XFlrBj3myx+nkcgARz3ezZG+q2ABIQFdsA1TUrHPKt+/A4S13UEdLtsXO6oF7A1gCQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930524; c=relaxed/simple; bh=MIEBxlmM/JehrSUbCdGYuUJVphACPYc5J2/hOlFW8bs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O54XfuctEz0dE5wMZz9TQfmZiy0HIfuhuBLhf+Vn+/jguBwqWEs59IYyzUy+hgtSAAIsV69ZU+7z9r7g+iC0NeulrvWXEEDY67VeZdy8HOL0sqwlEdwPsdmPpXwl99rkzo4dxDz0307D8REC2hg6lPAyEYFwTihQLdG4No+PvKs= 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=WDTqMpfu; arc=none smtp.client-ip=209.85.221.51 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="WDTqMpfu" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-38dae70f5d9so981893f8f.1; Fri, 07 Feb 2025 04:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930521; x=1739535321; 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=WDTqMpfuSWJx195IUsvbvQWVTetV11kxHRXaJXeUngO5ftRpZbu38Ru7s+bAjpotMA SsuHZnOODcolicN9ZE0vlwSo/eAG3ZbzOJtTT1zAGBQeKwZVqa1DI+iDKlPNKsCTdOz3 scgdyLv7hzw2hIKU+OsU2dQ32aRRPM+CqX9gWgTjErhQvJLCu0nhl9Wx+tXcAmczM0ap DkQmpY+oSL3BRW6WFvvbAQjH7IHdWF+k+eN3ydtWcW4B16wU/1PFxwOv0volDecwOQlG BrweB6Y8APgt2/jpqiTcSEzJl3vDfq5cgNIsq+tcjJTonK3bqt1c+PLppQiP34whoIPL GbwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930521; x=1739535321; 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=qwdeul6If6zOYw7Ro3vN0/8SIgAk47rOfQVWK+2IkWX4qbBPFXfeYDY0FH/YvOYvwg tYGftwHsYe4Icxtiv/fvNgSiQxyTanKSf6Qi/XNIt/mVQOPy0v/uRHEeE2+pCpCoQmvV Jb0LTGPWtSyiHfWyRzMlvX2b33Gb2vTaQ/6eRyUMog3ie9w1n8T+ZDqia/ovRWH35Vzr BDjHRWy12LcxrT9mETrxgsHOhE5mG/5sjA3oJBn76v94tQtydIsvAs7ICYMgKJiWHVnl LAixwfE3P7FTvBEGShLQvylr7MxA3oyhDBE2AjNWNCI8tKJkOC5rxavLWszDCD9aL1YO PdTw== X-Forwarded-Encrypted: i=1; AJvYcCW1/MtXVZcGihWz4Ej2cS9/ul6rhOi6YcF0oBjID1QvgVAWodfbxxFS7Dyuz89/BCl/K5LAIGG4dRnUVzdxXg==@vger.kernel.org X-Gm-Message-State: AOJu0Yxn6606i6NEEvmdS5+Jno+a1dfvL6Mupvs1CfcSgiZ1ZF2Ql6dQ 5vmqjhvLxUUuztmGFf330y57HKUnBGAgQa/kSvB+lBK4bUIgZAjZSmy1Qw== X-Gm-Gg: ASbGnctNkhsErn9yYxSqTxYWIeObhUv40u6soJxHm/OeQkEfgqBg0Vb5NhdtmSq5an8 MduHaNBUol1ZiIfBcDJd1/Vg5mNilIpnQuAgEsMUI8GfPSY0/v82vpyoRwPx4Wx5igKI5ttXvSW aphqFyhZ16iCWn2oqRbkAMdacHUZ/xruX745EIWbbjNFVHN4HBy94Fq+WFzekZzTzhTyIet6Jkz 2u+lUCpuKb9ZyQjFFcmBBSwoCx2GIuGzY8vi9Ook/icI4AWRvQC4/Mxq6ckFX6VsiTbyLsrh5uy WiZE3Jhb0UVvFm2vAxwNors6eA9M1tePqg== X-Google-Smtp-Source: AGHT+IFd3X8nCmxvTdVHSI5AyzCJNDKsm85FCH8nXcYKbP0k712HM/D7C18aiVLDI+Uq87gfWWEbjg== X-Received: by 2002:a05:6000:1888:b0:38d:cab2:9218 with SMTP id ffacd0b85a97d-38dcab29523mr1458633f8f.15.1738930520940; Fri, 07 Feb 2025 04:15:20 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15:19 -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 v4 02/10] tools/net/ynl: support decoding indexed arrays as enums Date: Fri, 7 Feb 2025 12:14:59 +0000 Message-ID: <20250207121507.94221-3-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 Fri Feb 7 12:15:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863556 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 5048D1E1A23; Fri, 7 Feb 2025 12:15: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=1738930526; cv=none; b=QccZaY+KYoNSabq2aPWSp3xjrCzUyoYP9FvLbTkYlJ+dLnpdOLAxGvl806J0xgJdDaPzZba5TqN9/y+PepCBrV6y2RHqzsngWlD2pW/u9luPs6A7wmj0rKUQN1Y8JZxFwH0SO4Wcj2/HOJbll+YNLGShEHrHnQ5aMd0m+P4MabY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930526; c=relaxed/simple; bh=1sXRpKRdwQWU3PDhHFw9zXhzGGi7++rZDL+a2/5+euE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bSfaWZLBMqTZR6wIfBYAXlXfdZANZJJDEkuPYLzZ/DNz/PnG+IQ5u4h3gG+0hKU3cmE3cc1kWeSuYWbz+DBS9UeDEar/IRwtnyAPblFy6vbqjsFnoJj5/cRHF8KPcyKTB0d+6SPjaNLkR0+Z7FZr8iuWj/ImzDknpV52J/PhzmQ= 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=WEO4uEuq; 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="WEO4uEuq" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-43675b1155bso21646135e9.2; Fri, 07 Feb 2025 04:15:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930522; x=1739535322; 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=WEO4uEuqnohA2oCarRF6NYDoxLtFmZnzbisva2ffQ31HFMgvfDuwX06N3/xgWQrvkA yFYAJXB6y1VBRue9D7qn6bUDJx1k/OoctqguSH++BSx4ME4ufDm5nERDSqI4OfuZXppJ Xh7JT2srQRmV9Twv2y+3cb5pIpjdzUHb5tHHsYnjeubJ2XDywq0BUmMXngRJaZX8iTKC US8QCYbFF3ii+i/spmOFWLQsnkIqovX+SahTHQBMakAE3o/kATxH/MdCmECf42Sqm8gu Mq2S+4yKAJiE1Y+oUwOt6G3Fsm+WHek8lSqKwA283nWDrwi31NlD16UqiXCi2OFe3hY6 pwjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930522; x=1739535322; 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=xO38oywGsJd9wcBOY4VoCvEQmp3Y4sn4PUVLEqpPvLWVbhu1IjH0h+XFPLV7XJM1oW CGauKEIAaO3X776m4KRDI9NBH/FM5XLU6b9l8EETswi4G4r4IJlQfVyuTxjIFbip811C FZaSyuL49YAgGyGjQ2olk+42WGrSft5/Dd/jmoa/t3zqpb/lEeHBOnkIVncjwQy7cQZ6 tWZ+IDgMEXG9ANFreQKljLhDwj9NkUH/VMYXQbRqvGCGPCgcy1j/HjhWywXKVmk0MGnk V8ohq+sUn9VN/Qk4QybmjVn2KTW5moCjz7QJZGIdZX4Hz03+EA71qJBDgkG6QDbeTEmI RXxA== X-Forwarded-Encrypted: i=1; AJvYcCWclXGrEy4AFbPjrlz99bIgm3AKnHNzxPAXLMPlLbEGBjHYCB6P/78qaejYCNsjTUXIuSJBlL80qW4M5REnVw==@vger.kernel.org X-Gm-Message-State: AOJu0YzlQRwJxmueMKs0laM2e3JHQLKxcdDH4eHWNEFRrP/7NSJg8kGk 5snOh0Zxpp4hYQD8l66/iRztRfvXio091rNOOMOyQ4jDOasVmY+5r6n2Zw== X-Gm-Gg: ASbGncsftidbfSVE9g/otAXFgctNKxA4TP5B2mzE0TBEsh3IH2ABWKYBlUNvqnE5Vku P13B6M8dLY29wd1UQsoenZAhn8HGV/unv+LuWvQqzBCMQzJe+tbZyRkjFSSD/XSvLiazHBE3Pln g6ILDqbXBp5u3bmuH1+Is0bi31UygwqC0KHuR3AQyonJFzmI0iHEBUfI6EIE72m8/MMx5yfSkbX 5eru4/ESHj2vQf6JkI41NR2bdk0dROUjvBYLjgCB0wjelRZH1pvgS5tH89Lvy650MPokxXB/jVj 28xudUIXcdNaDxvPlhs+qdEmU7VhWWm8rw== X-Google-Smtp-Source: AGHT+IHz9GSo007ugyZFbRRbbLa904lr5Ue+7CKUyZhE/OKFd+ni7Ct183hgV4AsUgQ5SjDP5cLjgw== X-Received: by 2002:a05:600c:5114:b0:434:fd15:3adc with SMTP id 5b1f17b1804b1-439249bd4a8mr20891015e9.25.1738930522156; Fri, 07 Feb 2025 04:15:22 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15: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 v4 03/10] tools/net/ynl: support rendering C array members to strings Date: Fri, 7 Feb 2025 12:15:00 +0000 Message-ID: <20250207121507.94221-4-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 Fri Feb 7 12:15:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863281 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 7CD2E1E5B97; Fri, 7 Feb 2025 12:15:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930527; cv=none; b=AtWjsr0awf6pohL+M7UwsM8+Fje3O5lv+4LnNH0hSLdywQh+zR3XaScWN3IVI1IQRChIgNnlyYBdnf8QIFTAM5wGqaRRVHlbug2Lk3O9mF8HabpY5aq5OqQMoS6oPVs40NJSHVDIumVoQ8HbuV6hHN4F2ZrbCIx+4gaDD3norW8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930527; c=relaxed/simple; bh=2jUrTZQQF/dY1/oZi8TPJgdOAi32V8LU2q9+yZHMlR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sq3eSR1sI3rR8idmBowDGNNiTNNU5N9nqsyn5dzKv+DREUGENE4M26AYhzXT0fp0MDrS1I0VC5ijU+iYSpNVa2mazERuA+uSFFh+E5QRIS0yVcpehwWvvsrhNfoOQnmu5NZKAaV9G7ooP0ubVPH/86QjdUCxOFXSdwDU8XF63nE= 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=P6fwobfO; arc=none smtp.client-ip=209.85.128.51 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="P6fwobfO" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so21887625e9.0; Fri, 07 Feb 2025 04:15:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930523; x=1739535323; 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=KsXxvXTWQvNiyd1ztqhpSPJmVs+xSGLNWTfPDCxQEr4=; b=P6fwobfORxDlRaMnz115UFyK2ug4aZQucDAZxTOu6JUaUx5AEut1+ZLGS03kBVqUzE bIZRtBiiYyCNYIFG+oXufu/wrr4scZioKpuGKxNKl0z2LBhAb2pvIS/a0Oyz5Mh42yel SCfjOKnGU2mQXHXqSRDiURLCg8XFC13HlB9Rk3+cxSVGyV7Gy1QWbWxPfCkU2LSyH/eO HyXN4kGfEQP1JxoyAg/C2zbPQ6jv1bRttQdRZJ7aD0JFNG/6zREWsLyz3+dAXMio+qNa KO1d5vGmItW2kt3Pu3Gs6sZE16d70ylsOhk8ETZvrBRyXnuucbcX+iHW/JFdCb/c4pNw Neug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930523; x=1739535323; 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=KsXxvXTWQvNiyd1ztqhpSPJmVs+xSGLNWTfPDCxQEr4=; b=m5EL28a4RRfzHChW0fu8Ht5XhNSAOx5TYTNhipsHoN+yrb+djwRUIwIimK200WjZhG y3RHleuh7wdzbUiYS3rXK4ho8JnXT0lIgnxPxGLUeYO4HG4lamBNxYYqkQXCQngT+JXa mK1zAYxNORRL7R9z+c1SRHAqVY+nsXTd+IQzmYUc3oR7pLHpdWQjFF3NuyNKFaa/21GI y515We1ld6GtTSI2MtWP4sDUSYlgnCAllMuxbp84dcjd63Jh4NvXyW9nnfir4+meesT+ Cr8jPccvXVw+GLhQEaD2yacr3+b4yUNug+ovXKBDq7wNsgiOwd17tg/zBKFKyfhbLS+2 ADIw== X-Forwarded-Encrypted: i=1; AJvYcCXYOLneP7n+XIcD9RAhEzCPBgO6wwx2MTmNDPVRm5Ozy1QVr9YzVKKkLcNLkgJ4Luv06bV1VLcYwih2LCm7pg==@vger.kernel.org X-Gm-Message-State: AOJu0YxybJfoCVNy4ds6U1hEmMyWu70prqRsISxbiVAgs5XNZ6dWWFqt ME9a1ZelSLvQn60arEoNS6XssGx2ktFUxN3Dg6fgcw+CZyctR/dNTgOMYQ== X-Gm-Gg: ASbGncszq8gy0yS9YgSi6ygF7HebABAjHxVG+DCbtjYBMEVoAx0Ru3AKQ9R3fk+96t1 VKJB3WWDBcw3abY262hg0RBdxDB2eiaDBNxgKnxLV4wJmLuJYKiUlqAS1mLZTS5uDqCtTE9XkhJ uqSzb8eolzAymt6O0cUGgHxWXOEdkcWzwXXODbn0IYUbU3CyWcm1g24N0dIFkXRhaR2ZhqZY+/m KoBHYTfjcadP7+PxatiLsbh3kzoyS6ZHqxpwN3YwPLJJ3S81RLn3/qZiPKdTaaHybQ8A5NSGEND 1yfxgHzF3OVkBw1Lj8Itdm1HkD3qSQs+mg== X-Google-Smtp-Source: AGHT+IG6mculr8rc+Lfz50mpKc4EjL+JIZ+I1v7VJoHWHLSd+hWY8C08km8WfNSrTSno3lDc0FC1mw== X-Received: by 2002:a05:600c:4f82:b0:434:f9e1:5cf8 with SMTP id 5b1f17b1804b1-439249d1962mr26582325e9.31.1738930523299; Fri, 07 Feb 2025 04:15:23 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15: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 v4 04/10] tools/net/ynl: accept IP string inputs Date: Fri, 7 Feb 2025 12:15:01 +0000 Message-ID: <20250207121507.94221-5-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 Fri Feb 7 12:15:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863555 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 599931EDA39; Fri, 7 Feb 2025 12:15:27 +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=1738930529; cv=none; b=k+oCwsquFiTPGbdHImwuErgx/L0Adh3Bi0opIyCQfjs99XVVqXFLjHZAxF1aUV2IOfHMi9PFwmSl4fGm19FAfSbacGvfrqXzocHIOwhRKoJ67FA4WiHf9gchR7ITJHpElyfc79OI0K5/V0fuRIqjORZ9hY0kM5Zkh0QB7rg42Hs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930529; c=relaxed/simple; bh=X9eINYij1abDhQD4o22GKAwE4z5ZgnCtWo5oJ7CpFNA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E+EPwjC1GAvHDjpQcVkqzhisPkwVGyFvpkabLp+MgvcU99VsCkkOh9Iw/Aea1qJG6Fhrmi7lZ5jeMiIHI2CYbY6lZ6SNW4m99B/HLW9+bm3qneIzcN3YkWOtaP/S0cuu1Oz+71fZY+vQ/QhR625Nhto2zo4f27yFAnQ5NpqcTWc= 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=FMFJavz2; 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="FMFJavz2" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-43634b570c1so13721895e9.0; Fri, 07 Feb 2025 04:15:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930525; x=1739535325; 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=vK4EKx0QpFzSPEovyIzsmnHNxkclruHqA9dDekWIaVg=; b=FMFJavz2kaZD8BmbAHqWvOiOAjqcFdfaiWESpfLQ2jW3IoH1G9EBXqLb4cIOOSYh5a g7XprQsPiEk5pzHvCS3Ql2QFp9t/Q0aUUc36usBN5Y3vbQfhTFVZ5crw3cFKi2cCcNJN NnliuySzbav/6nwFS1xSL3xbhAjhsXCTqKE32i6B/gEiYTzHGOKeUm7iolkpeoI615V6 Icc73jooJAxXbPRI8lUvN8kxvL347UezXrT2gVq1oVftX2PewnTB/KrWzJOHuxspWJoO r8AcKf4OIO9jVhuYmm2b24c1SCMbJPd+q1Bcqm/QyaAIlL45hkCG9825wLnTouaasFnV lqqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930525; x=1739535325; 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=vK4EKx0QpFzSPEovyIzsmnHNxkclruHqA9dDekWIaVg=; b=t87F4mR97oRLdQf7dcoYLqFOj/Xe/g6unGIdYf+XmS4yJq5caNdVErsjAJ+HcB9xvl le1n0nfDW4tY6oGRcUPLNBJpwTww2BkhK3n8sD1zhhuC8JlvsetiklYSDkrMol4S0hjJ zONUK6Kzq93B9nYRA00ORZ5fadhk4n+RbsE9d8NsfMYBxWesXM4D1IzoKnLV/tfLPCp7 DGcmT6BTHMLnfBsdQYC7b9Ed0rD+VO/5vrkbBWE1l7sI4otBClSy/LO2arfOIuWhipMe ERKen43WptClfZkD9F4EYeIcAFnOXo4NEew+kxSLB3OKT4NmwmMhAgWZjtI00bhXopcE mTDQ== X-Forwarded-Encrypted: i=1; AJvYcCV7v95qJGYQt6clkjkB6f1axxNmJqaw/LBVZi/rEPs7Va1/Ir41sOENXkVn4dkQr0DUtK9B6JvFRC3l87H5mA==@vger.kernel.org X-Gm-Message-State: AOJu0YzNZuJu5FHtqE7ozygZLui6uxGLgUIzJZLo09DaD7NP0e+x6mED cdXT6iXPlHR2h9HF2aeGT/08TT/MeZtoA7h1OuFCV5e56/W8v9FGaYWoew== X-Gm-Gg: ASbGncuyERRdDdrnzZQUvEpRm4fWGbDFjnYUZf8Z6BBa/v1MInLk17GUnu71awNS7Wr olDyq+pO/6roFNWvulurXxGh+Du8I4fTL7TQ4gKdkPGK5se8rZYm7b6Qj+LbmRBENHZR3Ksj2x2 eJWIGXZSij7NCBjSrIKBuO7lybEVhN193ckiO4QaIhZP06TZE8X3nTH2rg0MRJjgVlJjobMLVYR YCDB5NJQ4gsW/Agl/tNdcMD28ngzxIChFKeTLoHQBkXGHOSIKuLIoRc3lmNn1ZfW3QPp+0cjHHJ KtdHekt1/2YYDjXggXNMaG0RQ3rO/kp98Q== X-Google-Smtp-Source: AGHT+IHW6MnJXojVP2W+xl19WFEGAzpupueF2gSXgd/PwMiuauNmAKMwZbuNPp+6UL2ULwcfUdCkvg== X-Received: by 2002:a05:600c:511f:b0:436:aaf:7eb9 with SMTP id 5b1f17b1804b1-439249a8b13mr22912785e9.20.1738930525253; Fri, 07 Feb 2025 04:15:25 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15:24 -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 v4 05/10] tools/net/ynl: add s8, s16 to valid scalars in ynl-gen-c Date: Fri, 7 Feb 2025 12:15:02 +0000 Message-ID: <20250207121507.94221-6-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 Acked-by: Jakub Kicinski --- 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 b22082fd660e..d8fdee24ce25 100755 --- a/tools/net/ynl/pyynl/ynl_gen_c.py +++ b/tools/net/ynl/pyynl/ynl_gen_c.py @@ -1440,7 +1440,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 Fri Feb 7 12:15:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863280 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 81EDC7FD; Fri, 7 Feb 2025 12:15:28 +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=1738930530; cv=none; b=bHdlVNSGzb1wP/MU8ECHq9HhUtoYmxivgEGMSA+SuDOgm8vMQzqDC70hZpbWb3SuACuyhEU66DrR+e+SBUdmlXFZu7V9lwrtoUdheZyWJLE3r1gLfiB2Gdc+8lQs7JMkT/cCDZslxxxOcH1q/SC4PwpXIJ6pZVfoxBlqwSF9Tic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930530; c=relaxed/simple; bh=mqg6oVlWZ9lRgDBEDIBhvqT0sf/xJPxaAUpGR6KqHlQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hWh9kF2oKqjw4FJHKWzkodv9v/WaAojJYV39krvXH3mnO0yaNjgR+QOHTY6XQaosS/h/77S18vP/QW8x23J3DaixcGf2Cm9ZNOnd7/QgQ0aSoC8jnnIXPZZCMljfUD/cGl4gdUX6E2Wvp0vyB4I/tQQDRhYku2jiyQfqquX2z0Y= 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=kQ0IE+lC; 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="kQ0IE+lC" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4368a293339so21625975e9.3; Fri, 07 Feb 2025 04:15:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930526; x=1739535326; 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=6J3x9ECyGCGYGUhtbd3ZOh/doI+iGAkp8K9XPCCmug4=; b=kQ0IE+lCKkhXFt30l48rD8U0lNHTa8inCzKZJ5KqeTTqFZNfmkt65VSJori+Z4i4HJ pvO+qG3bLVNIe1KWMAQc6IFXW808xcExRhpybik4A5NFdS0jOnst4CoI6m/EfiI3ZksM nSeytHa/x/qMFjIno58uF9+86sNSgETXP7NXtihYjgh9Jz3Y939WdPsWdflOqF8Yqp/Q +uwtrbw+jn/wLmDgd0WPe3zw0zhSlcjQkCNHDGEnz8ymv/Gn6+apy2XsUsSGTXUKtblQ ajsmfh77tMO0Ys0NX7OuZDoT+LCtDZ6jZIMiJoWOgLh1y5ld8lGUFSsmdax8PA9jGDbm W1SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930526; x=1739535326; 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=6J3x9ECyGCGYGUhtbd3ZOh/doI+iGAkp8K9XPCCmug4=; b=uUNnPyUziUxFhsgjtuJk6JNoCGA/a+gRT6V2/Cen+4PHXf3FF3xkF75S4q9ZX7KStm 4L7I+hunhbg4gduYzW+JUC3mIjDrq+qTdhzlRxH64jPKANINmAv6HcjZevCs9LaefAK/ TdVVO5gdvRRepPaB6zE3RJH71r9DEwMKl1dcvhep+hz6V/deFNyANa5ICq8ItjXzgnFW EmD8fcrfqhz5xbTR3ZlTbFjaDLHW5WAg22T0LXEd/F1jPAhqzl2vxBb7Ku5E05kD4Ahm 3FlF4VrIGOarsuW0p5zKhv3lpSH0OUACam2j27yLU8sDSw9MKIugsZsreK15zI5afT9Z gb7g== X-Forwarded-Encrypted: i=1; AJvYcCVyVQfBK/+oJo5Bhf8EwgUVe4wv4aPS4G6F/xKsCr2Gf/v4C6NSmWO9r+q60EtqHSslWpElyc8bMmix0p1DeQ==@vger.kernel.org X-Gm-Message-State: AOJu0YyhTi3GooQ6EfX6moLXqL1KNzvhlW1vDhZpyCBshA+6+albziDG ReRFzxHHgbIUMcfK15ISPMnLCMkRnVcaQTcFiOC5Glu6+68/7Xtramfrrw== X-Gm-Gg: ASbGncvrfGA4UjijYj7oDelN5XV3jwsYFns4jC6LMhGjDV/WluJsIozXq1Z9Q+YJZwh +2L7LMXOeXNwM6kTFGeovLWcadsjVsWWLEMgitD1wiumd/aoCA+O5Z2cHVWasga6BtZ0BqgCtl8 aD3d/4Q6HzENyOqnxtWbTrmb9zo5IO50iseoVVBfyXAbjeOqeS0wEZl2b4a47+EJ7nF5dsIywzO TeBFDkUw/5vmtsB2YclcguZWqfB/xTgA/tAIvmQTNMP+mKOMzBQ72mcsBvaxewGlUDsz7+SlnTo /X18AVRVOCtHqiSg1Di2MDrdSjvbqKXJRw== X-Google-Smtp-Source: AGHT+IFQOJnrpZr9ab+5B1imc5GU6/Mf7q/0n2DKhBVYmkW8KvS4WXnGg/qLj+BTtkVK+9lIJJriUQ== X-Received: by 2002:a05:600c:4f47:b0:434:fff1:1ade with SMTP id 5b1f17b1804b1-43924991dfdmr26157965e9.13.1738930526385; Fri, 07 Feb 2025 04:15:26 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15:25 -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 v4 06/10] tools/net/ynl: sanitise enums with leading digits in ynl-gen-c Date: Fri, 7 Feb 2025 12:15:03 +0000 Message-ID: <20250207121507.94221-7-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/net/ynl/pyynl/ynl_gen_c.py b/tools/net/ynl/pyynl/ynl_gen_c.py index d8fdee24ce25..62a6d8c93765 100755 --- a/tools/net/ynl/pyynl/ynl_gen_c.py +++ b/tools/net/ynl/pyynl/ynl_gen_c.py @@ -74,6 +74,8 @@ class Type(SpecAttr): self.c_name = c_lower(self.name) if self.c_name in _C_KW: self.c_name += '_' + if self.c_name[0].isdigit(): + self.c_name = '_' + self.c_name # Added by resolve(): self.enum_name = None From patchwork Fri Feb 7 12:15:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863554 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 436F11F37D1; Fri, 7 Feb 2025 12:15:30 +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=1738930532; cv=none; b=O1bh6FuBNPEkT9lOvWl/D4NDnTiEMVv0Kyg791nbhcEvkmdxwyrnaat2dXdqEXeeKPam8wAs6ib6R3G8aioz1OyMKYFTExsQ4Dqg6N3zBMqAtuowDfcTQVo9Lpejge6Cbv5+N3YOGgWnglYYZMmvhpPcuesOJERMnkKLRigigME= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930532; c=relaxed/simple; bh=LQz/+A9c7Ho+lyWQrdtZ+ix0f8k72Xj8v4u62NQ7h/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=E1NRZfSRqjTqMwkEpnc8bEBePBCh8sOMRj8O9kD73qeIyVPX1DRRFYzJl9Soz2LkObK7qylKoZRYGofXzr8lOS6wd0Ih6neyx+kOkwKWhFCmbGwldVn/yGaV5KLsDNCmeM/ldF210LwdeDY9hKnPjL6ctxXOvBkXeSYKyyn/rOc= 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=LjnYD5xj; 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="LjnYD5xj" Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so21888435e9.0; Fri, 07 Feb 2025 04:15:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930528; x=1739535328; 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=tzpEi1hqY/grqIzyl8Qp9PHG4iGXdiSToBF1VycVE9Q=; b=LjnYD5xjJ6ZqgZpyLwq7d6VgewH0nvaiEEggElCfxT/TPI7lyJRMMeJ9EwWaQsA7Hx KaAjekKt5Xe0cKDKsRsLEzTTgIDnDEqY07Uk0pQ8X2s0W+t6vrQ7N1Oi3yu5HFVrA1nK sR/0BwnjCVV7ZMd9PhNDEPhNKOAe6OmhxYHf15S0hJBNnpYVY4+K5f4dF1NRsOHXbEik 1f2qJbgKnPjdnXy/GEM+7R5Sy6uWDs0FYqCs7fHc3BzsFwYxDaG2B1LxVvnCsO8YXhlD fUg5E99m+GLIFXkEKFeRDy9PNJie14nr/PngLu9wN7oz4nXQv2bWv4NM4gfkRFUygNVD TaMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930528; x=1739535328; 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=tzpEi1hqY/grqIzyl8Qp9PHG4iGXdiSToBF1VycVE9Q=; b=ueIK2UghlQ3VW/nHKnOdrTiL2n7a7oGZ9gS/2Pk2OpPhat4HyzaWHX/VHopjKM5SG5 Am7lnHUe3RVRz0G9zOegBNUkUxep6T/ZM/ePqgam4WVRfpL9Ojvypzi+rWvOuOQKRVcW lapkha/qgB5fHYCINLzwsAElzcPOsokuBwQt4FsDlPamXoOhNcNLAoLYCWwVuI5j9tvm htk/oKcroycrg4/uBP8NYJEpZLK/5tNlvxxE6XRxYMgH1frQh4NVQCaSXwp4tRf5RK63 q8LIbpUzpXMeeisEyW3etqHSjsjXq/pwqz5rP/H4qvmQpmjMG3NdxDvPnJEjKsV1kKmr 8wNg== X-Forwarded-Encrypted: i=1; AJvYcCXD57EK7z+8ocYbpDboKRPjQr0nAg5SLGqxoYsysrnIRkpEOOU2Opdf+zfOZOIBj2xvL9fmVyBZgPXODRabRQ==@vger.kernel.org X-Gm-Message-State: AOJu0YydSvKWaZVHRjDHp7N3FNDeUnbUX9k3UZg4SeHqamIETbRi77Ud /U8l2lIwDHO7TGdzwrnxYdozFxEzRFEKTcnLua/WEH0IDOWAM2pLupZPUw== X-Gm-Gg: ASbGnctUQMXy3Qn9uxzuuE871k/9Sqerk6gW8G6mkEL3Br5XQ392Od/feBnK5hQdtUd 1QUULsa91efWgNKhfPE15HYdlb7bF8/+sO/5yF+SM9OAXiO7y/TdLWB/AJV+3jPGoVuM0lv8wl+ gIMMRGvD61fyh7Iv4HwsQKpmXOXht45pJFs2imodnF2t1CTePtfMhBpm3Yv0drO4ms96Zj2GTKk ovX8QBoZH1nWvW8PxUQXTvZzrJ2wcE4t1gJNLnwBkRELJbkaQGX2jXBOPTPtIWvaifeXDE37xDv FU5VCjYMY+ixs7cMylQVQuGKZtlXcS3jeA== X-Google-Smtp-Source: AGHT+IFZZA2ZBkAxgmxF65fXvox/QXswvjjIr4+NMW7atso1RAmqpeYfLD74ONLj5PwVgqEuevzKYw== X-Received: by 2002:a05:600c:4f47:b0:434:fff1:1ade with SMTP id 5b1f17b1804b1-43924991dfdmr26158585e9.13.1738930527710; Fri, 07 Feb 2025 04:15:27 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15:27 -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 v4 07/10] tools/net/ynl: add indexed-array scalar support to ynl-gen-c Date: Fri, 7 Feb 2025 12:15:04 +0000 Message-ID: <20250207121507.94221-8-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 Acked-by: Jakub Kicinski --- 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 62a6d8c93765..a1427c537030 100755 --- a/tools/net/ynl/pyynl/ynl_gen_c.py +++ b/tools/net/ynl/pyynl/ynl_gen_c.py @@ -688,7 +688,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;'] @@ -890,7 +893,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"]}') @@ -1674,6 +1677,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: @@ -1729,11 +1735,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 Fri Feb 7 12:15:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863279 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 B91E77FD; Fri, 7 Feb 2025 12:15:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930533; cv=none; b=CviRxVN0nPS5W32X9Ty6Mw3E0UUS8nNsZ0NV/Owa9IVISmJvwRBq9wwC/GWQx/y1FeVDj/BdAe/VBgQWLbQhU++eLGNnvvw6+wjMz/Q0krk6Fckx61KNK1CgG5geYX2ca9CWrphJG7pttahGh2n8VgCTrdqW3H1aKNqUx/XFNoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930533; c=relaxed/simple; bh=Ap1q4LgkrLbGyYRLWcKtA1t6kyY/N7ouDJbyAdy3y1c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IISKxVEtZsUoFb2lxwhhheaZsxQEYZlJ9S4xr8kcubNTcbVT/RopdKJyvVDUD7dy46ZvcxFirFj1kOQmCP3+Xhv4idq0XU1usdm/eRuCqffslh34vkfMIKUAtuR5cojB3ujTm86jgO1CDFiE9P9cb6UttZ0hCBNsXnjCh5m3pgU= 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=Z9dxCTo0; arc=none smtp.client-ip=209.85.128.43 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="Z9dxCTo0" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-43624b2d453so23228575e9.2; Fri, 07 Feb 2025 04:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930529; x=1739535329; 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=9N9nv58w02wJpkfqRyDXBfeCG5CiiQvz6kgd+N3dJY8=; b=Z9dxCTo09A5iFXdOFJX21o3zTmNfUnFPlTRgHvbl1ifkEcBId4lfmQv6IuNrV0fKEr /gdwiysWu2F6lm1dSEh/kHcaoAKAU3E2or/uxzE3br7dbtw0yW6GKTos5VVj+BFrZjO3 bMEoggCJbdyv9I5iflpCPwUw0+BJj9wEBErPekK/4SYQvK9vlSX7tZS5RnHnJcal4vn8 Lbb6aTbPPG3gVDhEdv8ydFdF7RRXdDS29Oxh4Z+ud682OT9/Ger9wtb6AC3J7e5vZJZa ZA+LixL/QgQ0SEduLfOmdnjuguqXvBgRCrqmNYqC7WROhMko4ik8/4fjw8U2qhFBcGAA RuDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930529; x=1739535329; 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=9N9nv58w02wJpkfqRyDXBfeCG5CiiQvz6kgd+N3dJY8=; b=TpKzjk9YclDS50MBSATQOCjPDu1lkG/3XALHC70NjVJdm2zDpN0a6XpIMkjbBQ+uJ0 8aVEWgMoTy/q3VtY4gCug6iqba6y7UUfqYRMrBnazKcgGxWCz64uLRVQnQsmvV4uOzqF kqFg8BW7Tt7j4rXVa0jXfIBTH3Ll2E76m2/Wr3ckzex8evufudmj5hT+8M0OlO3J0mMi 6nGp+uodOaKgCKcRClYLk7JF0fFc1ISD69ZSAZ1cypZ05IZD49OBg+HclTq5Beir4AZH 8iJ4iz+Q/t9h+cU1o5fU5EbzR3UllRSv3SAOFYQhV75Vd3dlnoTgYh7DgGE7I41NpUAJ /Lfg== X-Forwarded-Encrypted: i=1; AJvYcCVRHRgh3WQ9PUZM8CCwvJWxGD/Jvlzjv4/6Pp5cpDEDgndUfbllLqy1v00iOyyEysKBOaTikYicKqLxMCjylQ==@vger.kernel.org X-Gm-Message-State: AOJu0Yy2PZwDr3MFWQaszf6esj0j2xY6C9lBCf8EFKD5r7OHJwDrt1K8 RLUKW1tLjGb/Ye3cmPkXfk0Ghcfz2NFqLOmoEjXZviOHbJZMTjQ6Qwj0tw== X-Gm-Gg: ASbGnct5sh6GBxp+CcImxqMg44US4ncEDR5EhXAoA0kIMYy7n7dL9INGl+5OsjowQ+O 1EICCBTECvUK9zS498E9y0OX12DzgIAzrDajZlwm7+AcHjVrEVCKUSODDgDl3RZ8TzA7w8w5Utz 9myoA4Z3J/PnKvZ/6u670tJnRQBZbyoVcZmpuASliMTZ6RV5rSejUF0xzVxp3ZfpLZRj1ZG22wJ ixPQPrt0BOQfN0vzN2uXGD1o34ycIcIVmSdwun+dgY4+R9uWm7otN1jOHILAuf59u/kYasjbHDF HeVjhThTz6fCvxoA+IueZ+JCEEnRi1bAIQ== X-Google-Smtp-Source: AGHT+IF5ggEi+CnbvVSump+njtajj7Rg0JO/out533uPn5e88Q4sy0dM3pLdVxTi7L9e9pM3i25adA== X-Received: by 2002:a05:600c:3503:b0:434:f817:4492 with SMTP id 5b1f17b1804b1-439249cddf9mr31080615e9.31.1738930529363; Fri, 07 Feb 2025 04:15:29 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15:28 -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 v4 08/10] netlink: specs: support nested structs in genetlink legacy Date: Fri, 7 Feb 2025 12:15:05 +0000 Message-ID: <20250207121507.94221-9-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 ed64acf1bef7..c02ed8089746 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -152,6 +152,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 Fri Feb 7 12:15:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863553 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 C86861E0E0F; Fri, 7 Feb 2025 12:15:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930534; cv=none; b=co2Tylqd4ajNYEKdjEk65zof9E/BiQoYpK+Wn3d6+uNCp6gBVygZmfwxFkICt9q+dqpST3Aqg2wpgrmwKO3ZK+PnomiwqIan/1WHwSH0ciDKnMHyJgdRTYus4hfV8vOxDz8gFbQkdOdLX8ZNalfaT80CeH0zDyG5JV13jILZzoo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930534; c=relaxed/simple; bh=hngH+nkRM+69V8gMEYAXSayqQbNSU/kvsOcQdYK01ko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eBa3X3kGTdSnqNw0Whz80CTE0A4volwK9BjeS0Ge10Ljn746FEO2yrwOtw7rm15QIDUY95R9mJa6x1KuV2XHQslHv1EXT2AcVqGtFnEIGO0XsqoOYCZPrS/1yZaV+dGhtsbi1FYqetYqP1FVLw1B2lAyLawK5ldNuFG6PgrsF/E= 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=JFLabzSo; arc=none smtp.client-ip=209.85.128.49 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="JFLabzSo" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-43618283d48so14184125e9.1; Fri, 07 Feb 2025 04:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930531; x=1739535331; 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=tpSnMf/WKCpk42PUpTTHzELsWuR5f0+/8dWnGZMy7ow=; b=JFLabzSo0/KviY6geByaOCgWIxz2xlved+ZjgOfS3YHLyGkqHuXz2liwlmHIXI1ySR Ag25hZlErIMVaRbp3NDHSdPR42BilqIqw+kx2x5R+SIL+DafSDKXNTU7taPor19pydRo Mx++YuQkAuX00S4x903Gu88OZBZXDevOcQCIaqHbYOJB9H3ayDD3XH27sRhoTujMqGV9 nM8oEJ4kDavVWgSgPmaCFMZlWiTvUQPZ8RPvzg53yE8GbRtR00aQ4ISEJZ37uwky9ZsZ v2447SbPHyU1pXUusVf25FZWckRcyk2r51aj0YlvIflL4Vo6GhfPt5nnlF23RdSuZal4 p7kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930531; x=1739535331; 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=tpSnMf/WKCpk42PUpTTHzELsWuR5f0+/8dWnGZMy7ow=; b=JiTubB4SpI9kqk4HGcTaqQQOxICK5/28AE2dtNSfn1WwsSC6844ahiJcuV1qI0fIge xP4qrTb97QOhFMdwwLfALfRYfgWM9eg/WBy1u1Ts/sxHISOlRX3LWqg7BIkp1DsMpT8X 9ns1LpsQK8SpU2zdl0/tErIsRiRlmYS3obXKHAS3MPheG4J+MW2KQq+Kwls9UVZzAGMg pXqRK00r1vJqKrbdTOdwYmcbKURApxW3lLIR3e2pzJuw4qfwk+djSX6y8rUzKydaIRA4 Kfwg88LD7PL98TORdr0jLec7nON+LHvGD8TPjerx7Kx9DsokjyCSCS4Rou6f7MDo0le5 utlw== X-Forwarded-Encrypted: i=1; AJvYcCX7f5qy1knbIKzkKxys0Gtuw5LtIwdi0AFDk46pvOIlZeq8oIhN91bV8xPCuJgZ6kpQzl7kb9EyGGwANCy1EQ==@vger.kernel.org X-Gm-Message-State: AOJu0YwTSuivcEtG7U+ZST/EpigKCri1Gf2E8oiL7g4VQ8mfm+imkOYi PcQ49mF4C43PaaKCkegn3FUux2c7TugCsgL3bwuYsq03HFsFpLXt+Sk0sQ== X-Gm-Gg: ASbGncud+rX0D9+7eWar5Td7GBbJwWaM5N9OXycshUpYV+LZ2TSclAE9V9o9fJx4uUy xdKdcG6bSG2lgkDQl2PmEehHetUQWruRIW4JQSj/Sl64eE25EFj7ac0UgRwXmy8nIZyn4R0n/FL BqSyNqgPuJaGYH6RVMzMZHq9c8BPAVE4j0DTrbS1CZ74olsQMNq0VfZlO2Q0DIs/HM556PePAvr punuzpAG6q+yIyBdWnTFWS7eNu4xlH8IGA+AETio4Y31wdcxURTqFzeNyOfDAis6vF4ar9xgMex Q7BqCCqpxf+t8I3hJI17Tcb8kxyar7X95g== X-Google-Smtp-Source: AGHT+IENGZLfk9FVV7tJZN4PHgSMrIpGttPp3vESEeWtShkguEhGhozneomPuzeoHyvgJ+KnzbvOrw== X-Received: by 2002:a05:600c:3549:b0:435:194:3cdf with SMTP id 5b1f17b1804b1-439249b2a9fmr24129935e9.19.1738930530648; Fri, 07 Feb 2025 04:15:30 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15:29 -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 v4 09/10] netlink: specs: add s8, s16 to genetlink schemas Date: Fri, 7 Feb 2025 12:15:06 +0000 Message-ID: <20250207121507.94221-10-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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 44f2226160ca..96fa1f1522ed 100644 --- a/Documentation/netlink/genetlink-c.yaml +++ b/Documentation/netlink/genetlink-c.yaml @@ -161,7 +161,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 c02ed8089746..a8c5b521937d 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -207,7 +207,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 e43e50dba2e4..40efbbad76ab 100644 --- a/Documentation/netlink/genetlink.yaml +++ b/Documentation/netlink/genetlink.yaml @@ -124,7 +124,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 Fri Feb 7 12:15:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 863278 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 F22501F7098; Fri, 7 Feb 2025 12:15:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930538; cv=none; b=eoZIDc1ZOt96d5LhKB8XsoImAWkoy6sxS1mHX/KUIywCKvM6XQrqpb56dHbAn733JcjSvhNIoCegfA4hZDv95tyPQ2msmdgLrXxeEyyw+SyI2rcYG9eIHNId1zd5LU4UviTXV07o81WFL90wdTjQt4d792ha9zEAfTQBY7FOgb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738930538; c=relaxed/simple; bh=e0RlaLJqm1pN3/NjY+LFbIN8Mpab1ILWURRg/vc1UF0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=azCB2zTnyZqbhkU2IA6vsZwvtq4Xrtw8ki4+0qIWWwLefgZe1MK8ft85nNbEFqklHN3xxERqPpg1/+J6Y0LvrD1nSCnn+5XVfCDbUavibzMSRNcOJKXgvIjnIBMxCu4eT3tCKpsRPXGsqzBG7egTLAE6EhAdSJvA1P6VoLyXE8E= 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=VEmn/4Fz; arc=none smtp.client-ip=209.85.128.49 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="VEmn/4Fz" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso14127725e9.2; Fri, 07 Feb 2025 04:15:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738930533; x=1739535333; 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=ejVqRzPS353PQvkGdzgZu3J1A4EnoRFu8T2SCs/l0Ns=; b=VEmn/4Fzk1ytqUXaLyOea+UJbVI7zULytYq6enH1TnKE5UKEfL+YAc0UeZI8zol1f4 j4SGOCrv9SXSL2Vqrft4QfraEVqn3dO8dap3/qx0JotHLkhMUwRDiNFoRBa7Fi8yKbeY +iqCJPuN5m0Kbfn5J4oH27e3sqg8waNQ8Q0j7jKq51vGE8ifwy6A38jvS010El4W+t5g ZD7orRF6JCX5BQZHZMPfUIsOIqzzH4ECRYE+TC+2ngYPabEsi9SaH5afU3DcVgig2nPm pJ74R6kpZ6V8j7VwaWOUsLR5vr3PhKwYpEDqUxJzwbM9s/8LoBJMXFb2shgdp7AzBaFj ZcGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738930533; x=1739535333; 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=ejVqRzPS353PQvkGdzgZu3J1A4EnoRFu8T2SCs/l0Ns=; b=Rgx5rlgRLQuF5kUZONCaf8NI1h+YDmMY8VtSvE1ArMXI/Ia1RhUpCFiItZZXvBU5dP poqU1bbElNKnLapy8VteENJ6NC+6vSnMZuWbpMpGUDvdeOeRHUJGy8aJ100jtbJ79vLa dddV58vAvefy9U45ZOIJendELAWFllD6wdsFf0kS1tbu1urVGt/uEVQwdG/LOjMc+y8B ZSwjwA69a0vrCP15wwImIqrHumI0AgQaxXy/w5GT+GAYojiwnH7FmkJOi2ITd7Wjrf28 mFHttp6PpyDS/pCWaagbEvT2Xetjk7Ehha1S33fcDaJ6LyPuJMYKRfY+lD8M6s1Gl2n3 ct/Q== X-Forwarded-Encrypted: i=1; AJvYcCXJHAtBFzv1l0Ubl9P4WWNgGfgmrJYklm+Jhl0/qbehJ347zVyVVa+CQJYZHGEa2/8JMmbICxl+Y+7KwBBFgQ==@vger.kernel.org X-Gm-Message-State: AOJu0Yyqkshju/8hp9mrAANPolfYZxht1besDta5/iYcVQj29vMEkzGy uRycCglxLCBguglCjrGFKuI0wHce3DJGSLHECg1PhLx+KpmQERFdSsnZxg== X-Gm-Gg: ASbGncs1qgXEu7Xr6XrR1CFVGrp9MpL4AExpFobOZP/0wM7LufjhHqOCEO0yRG+gP4q pasBSbDY3jM8nJQY8maaw1sKqywpC3bn6bbzutFg/OdpvM3IBj0MoI5b8rE4lngfkD0ahfISQ5k RvP0G05LPfjkeYoDW0akQvAzQASEQR36AaOnEx4WUHT2H2ZOJk8OUvaqmspfTcT4EkBazJLEHDO J5/H0W5XXJCIDQYrXKoUQtiLuCpV412OZFcfgnXY5byO9wMNrkUYBOkRbxCwNVGH/JbbRbBzOWD MG7FgI041v+ebQPFzOhFkkXVgIYqmDz/Ng== X-Google-Smtp-Source: AGHT+IHXaO9zeNOVB40XvlOKx9PAI/xL/ZW6YlJ+g1qzDpCK1gfGEtFErNIvwFUV+wSjdP7DAcNK5w== X-Received: by 2002:a05:600c:198f:b0:436:1b08:4c78 with SMTP id 5b1f17b1804b1-439249ec4fdmr26074655e9.31.1738930532450; Fri, 07 Feb 2025 04:15:32 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac43:c7d9:c802:8ec3]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4391dfc87d2sm51555035e9.26.2025.02.07.04.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2025 04:15:31 -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 v4 10/10] netlink: specs: wireless: add a spec for nl80211 Date: Fri, 7 Feb 2025 12:15:07 +0000 Message-ID: <20250207121507.94221-11-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250207121507.94221-1-donald.hunter@gmail.com> References: <20250207121507.94221-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..30e5c3add528 --- /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-probes + - 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 d027a07c1e2c..f3269ce39e5b 100644 --- a/tools/net/ynl/Makefile.deps +++ b/tools/net/ynl/Makefile.deps @@ -23,6 +23,7 @@ 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_net_shaper:=$(call get_hdr_inc,_LINUX_NET_SHAPER_H,net_shaper.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)