From patchwork Tue Dec 3 13:06:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13892388 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.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 ABDB81DE2DE; Tue, 3 Dec 2024 13:07:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231228; cv=none; b=LAakDlkzwBqxKCf8ylMVwll+TBib8tHalXdpuhu4FMXblLDBpchlmdlbCrKE1TRuztdQfD0PY747kA5j4ytsr6lGCMFU+0/hEloUP4EJEwvgbfgNYqRgiKgOXjONq/fCrumQy5i1zQN2DzjHL6m6AtB0I0lwAh2Z0BPdSciHSFg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231228; c=relaxed/simple; bh=b+OuBjzpMUI9l/xspfdZouAZ99vEyd/6lgzE8BFjaRo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XhrxGxFqqmpT09hvzo2XTo4yKcB1AApH2zrci7T4Xw1VCDuZGVwT8meZnD+p+Dq40/aKvuc/ZRuEnwHaZlYRyUaIqPEJ5Uy5KsJMkFQSjYOffpYpLW81EZE7rKzue+PtnSF4xSASR9hHzSetW+Aj3i1ydkbzv4je2klyC0+kfY4= 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=mAiXjLvs; arc=none smtp.client-ip=209.85.128.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="mAiXjLvs" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4349fb56260so48072385e9.3; Tue, 03 Dec 2024 05:07:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733231224; x=1733836024; 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=4tHvBgBQosB9RUlL0Gs9gizwfoZ6RRymZBEVfFKRAQI=; b=mAiXjLvs9jvAa1T/xr43PiveUDkjeBvPqKSXHobd8fDKWWiQcIEiXIbqrl1FrmwUo+ 0VBlLzohXAF7xc2msm3Sk9wsBUvU4Qvd5qlJx09r1xNzNwALh16QknKy6hxf0GlHUC4j FeSy1ObfhFm2qon/1CPIfUKY+xud+Kthznq1AlJvjG9aBNA2nR5h+ncDNKRNCpFQTMRc VsNd9vhFHjsACts5MhtcKxpNWEmb7l5RhFVdCxpcHp9ry4pzsmcM+S75MitrsmaPZm3o WGsE8LZOSYfdpo4Z+JdTpIHxp9VPTrLTzsjXofFFz5iLm+fc/uMAKw/HM+PCnpwhNN9i JUDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733231224; x=1733836024; 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=4tHvBgBQosB9RUlL0Gs9gizwfoZ6RRymZBEVfFKRAQI=; b=TJkaDS8g25KHJXTGI7Y2jylL5I+pN/LHfCZcKjXgQoGva8PXFXUOQKaYzaj3dc6nFl S8UEw3ZJVjy9TqfRtVQ7V0+1DOrhAA34hmNZaQaRLtLgD1Xu4a57BSbRg3Gqb7A6cIsz R3e4sW8ZGF5kXnExAh7wA9AEee9W2k9lLkwgGp1Sm25CtDckNjDsD0x6mQfq9dA+f1Tz kz4HK+yV8iGCzhqDOymx8F2bV7vq7ZCwsFHORo6geHdjezNQC07X1Y0dQUFWhVKxbHZM BbIb4VC9zHJC1npazLVzypwl621Opg9+ev7KChaxGOZOycaGd6sdZDeDQc7Dnk+/mGNc b8VQ== X-Forwarded-Encrypted: i=1; AJvYcCWSf6GRID0af7yE05icLTu4S1hbLmDRqIN7Ymux2WT2cbPDnsF0kcfq+tJ4QopiQ27l517tCxH4wBOU4C53GA==@vger.kernel.org X-Gm-Message-State: AOJu0YwFw+qbhK4i8OiKrK3L5janFZQPWA6brwIoUeqYnkXLjWn4gBHx 866ORMleZuQYAe9YIOFhXlvqN2WqMF1Pe0vT+7a2Z0A+cqsb4oXkrDQ+Mw== X-Gm-Gg: ASbGncs9qcNlF14bv9qMjuG32XNJv+K6KRD66Dbx1kNLQD0RfQ4JtMDll5XT1BshQNc 7cX1JNe7DaF1RlGpYxGhcnFPtaW4TkaKygx7ZrjCOzeSVJPunj1bmDDkhuZ5Rfzo+J5YLbehvqe N1AO3jhox9MJ0feXBke4mESN9nm53GVTBL7NaWXmmNBhiSSO1+KaP+UgDjPSWbtlGDwSLToyeh6 byZNVBB+HA8xH/RQd0b+AS1yLzCTbGS2Z4WIIkvG/311BcFMLjA5TbZ+YBJ73Wt6ZU= X-Google-Smtp-Source: AGHT+IFzDNElEv5ciaPWgfVf4UwNWlq8eZFqOBaRXKey7CJyRqR8LmVw28W55DfK/uKjRK6WsWV4/A== X-Received: by 2002:a05:600c:1d86:b0:434:9e17:18e4 with SMTP id 5b1f17b1804b1-434d0905301mr22480045e9.0.1733231223495; Tue, 03 Dec 2024 05:07:03 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:6140:2ef3:aaa:55ca]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7e4d42sm219142365e9.37.2024.12.03.05.07.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 05:07:03 -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 v1 1/7] tools/net/ynl: remove extraneous plural from variable names Date: Tue, 3 Dec 2024 13:06:49 +0000 Message-ID: <20241203130655.45293-2-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241203130655.45293-1-donald.hunter@gmail.com> References: <20241203130655.45293-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/lib/ynl.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index 01ec01a90e76..dbc7a0a6ae68 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/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 Tue Dec 3 13:06:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13892389 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 BC2221EE039; Tue, 3 Dec 2024 13:07:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231229; cv=none; b=Q75aHQSNH5nlHOpZl/mKm47otaXPSCBVASLx5xLrx/oXpRKobt2o2P2PpgD0/Ddu9XHDeObaVxtDeHtQIzBmT3bYnvBsExKTE07KatC/yONycqUF8rqXELLWlvwh2sHk1bIle/HHLEtyzmqDJD1hYKu5gTn2cvPv8ZdZGbamftI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231229; c=relaxed/simple; bh=yuzXuqy2BaLA+Uhi8hRYFXu6LIoO/lrOwNGMwxjrVEo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dp4YY5IelW4znY9t7vX4ZFujybISnQsOBpZl4DsWU3oQf6f/3LXLN6sk+8jOVhozZfVpHloSVA5Nxbz8RNIPixTU+jEQH3G173DB+RSUeZlDEAuUueTnRC1TZjVRHE0b+yxk0xNo4W4Y5DKE67tNmfSmW4g3Fx0FwliqcRkjYXY= 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=FtZBHbgg; arc=none smtp.client-ip=209.85.128.44 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="FtZBHbgg" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4349e1467fbso48140125e9.1; Tue, 03 Dec 2024 05:07:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733231225; x=1733836025; 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=BmXxbD9V59NvLKwy5cyKdu57L2KQNure18tEYHT0lFs=; b=FtZBHbggLuE9hWZCukLwOV4mO0W5yehsmRVuOzVbWOoKjzrRujpCNGgtS3PM7Mfuul 3HBOXHAXbIsMR09i2CZD6EbhJP9jemxSDaCl8LZ2Rn1Mf5GhRAiNpSHqMwcjRuu9EG+3 EdmMb57Km5YCU5bmwHqMAojWPClfMpB5ewHBspb8qxkVtjtc3as7F1GD6IJ/r0hPg83k W1xV8sQSDo0ksXpyTnja6FZ+MhZjCcEf321jCUAQ2DcJCJHyYzKSLTKiwgK85KIi5YWC HmixvB68hoNhNT5GEeeS5kHLxlr497SO/6MrgK4ndgYxaT8k7xkQ9SrZz6TRNsHkH+FC Qz1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733231225; x=1733836025; 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=BmXxbD9V59NvLKwy5cyKdu57L2KQNure18tEYHT0lFs=; b=P8sx/6kR5CR9qAYH3F0DbN8tlsJ7siDrY4V4LKfySGByXpctCa3fIoBIN+wnyZMxUX bxUV6yn8GDP7VEZIn9uKSgorz1/2xQnTkg8JGGSIVRkVAYfuQCWsKopCzEmXFDAxti2l jykgGDvlyKS4LSZ82zCvzZMkdxruW4g1U3sS62veFVPE28z+M9DApSLQ4LMYXMFp+YGp VgB+xtTW2XXGYFQjE08LGTjuTOYlodtRv7QxA0U4MDwfu63bmODq12Ft1Kg+8KBwP4P6 h9rPBJKJ5fDmY/jDIychWMFtGggrk+uSz9DKWZmoJMfzpz/FkhIVDQDvsnFWiWik3Mkv 4yTA== X-Forwarded-Encrypted: i=1; AJvYcCW68mMmXXFJ+pXxlNtgOQkF5dyAvzfUmn2iRfU4Bnc/1BctA5DZK+UJCbTi70ysoESqcWMcl/3P+lYxOfitDA==@vger.kernel.org X-Gm-Message-State: AOJu0YxoyjU0hKcRKdnzjC/4nqQIYi2XeiSABoXsT6nE+UynY4iKYPsC QCF++g/r9tQFF8TNWODkuxmllddZghHdonehGFtQ6leJpqvavLGhbESa8A== X-Gm-Gg: ASbGncuQ0WbAXW1djT6YYb/G9fsgsd1W6InNQgArNpKW7VqtZ3fCW4lU3XiOfoUhSSV D7tMGcuMzwtdOK1+tiSW2plgyUWC2VZNIHOwMCB6xL2y4j7jAXIDSqkwfgsQlZ5AFGGsqnOcAzC o0XJAkMdN8TzgIg5PnbPTeESsPuP9nmftV3hqM8E4FT3T2GHFcsRTErWzBhSWFlNb0X23nO18Bp Jr/VVns5KiV6KOAmDM0ZBU5vnkp+ZnDEfSKcS/hZgu5lByw+OgLxhHSqMP5HgJyfmE= X-Google-Smtp-Source: AGHT+IE5ZZ2tBelQCb+cLoNbhTP1TbRBwi87+rDkodFTFJOuv8fgBz179LlU7+mbTye78HiDiV6beQ== X-Received: by 2002:a05:600c:6016:b0:434:a525:7257 with SMTP id 5b1f17b1804b1-434d0a06603mr16236245e9.21.1733231224505; Tue, 03 Dec 2024 05:07:04 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:6140:2ef3:aaa:55ca]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7e4d42sm219142365e9.37.2024.12.03.05.07.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 05:07:04 -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 v1 2/7] tools/net/ynl: support decoding indexed arrays as enums Date: Tue, 3 Dec 2024 13:06:50 +0000 Message-ID: <20241203130655.45293-3-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241203130655.45293-1-donald.hunter@gmail.com> References: <20241203130655.45293-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/lib/ynl.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index dbc7a0a6ae68..0d39a83574d5 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/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 Tue Dec 3 13:06:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13892390 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.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 705871EF088; Tue, 3 Dec 2024 13:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231230; cv=none; b=Mh2Wv0lV+h91gsJhMTrc6i1DYvffKvWQBlbSmm6r8HU9hL4s6eRSSbUar4OIX6Zc/WpFOqJtyMYvJm97rqgeQcis4Mqtstt551WHOU982egxFW1dhoIfeFKN3oi5Vi5ntnos6TK0/UnbUD0YnFPHG+2XKAxLcV16DmamY1xBsfA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231230; c=relaxed/simple; bh=Zbvud21fvPTfsWLg0fKDiceEnRnQedaZmCmnDlvhCrE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JjvzQlc/nfKLL7AwWrFmdSgQo8lYhv3KyadiPdAZbTf0rT0HzW/Wd8pUQGM2SiwLFshG1Eyb/CVPe6CpDjmaMNQ7Zb+6c7aynvAenBU8/bEZ1wIGMd26eGKrPap+ex4zhk2lV65f/N2wDwEgavrSEnn9tEUJdIsp5fVarU4Rxq0= 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=nnJTXHgE; arc=none smtp.client-ip=209.85.167.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="nnJTXHgE" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-53de880c77eso6495077e87.1; Tue, 03 Dec 2024 05:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733231226; x=1733836026; 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=buXVk8Hv0kt/O2Pm0xs8UjTJcv25AHmCbOmE4In2eHw=; b=nnJTXHgEBkcPpL/NveQyG9A2lFFoUNLIFxWfTG5TGu4oWst8bORT7DLDKDdJnJjhVn emHWYjhUZX6dPaZIsF2YH/CzOFqA1AgSe7qUOZInzxKvUWcN5fo0j5M9KNtMrPXNi4jc Af2KYQeUK7JYSVjy4fRBq6Uld/XKgz9wIH9eZfxAQYvx3bxk48rfX9kiwRAdd3X/mqir MPQ3xtQ03G8u48Ai5/bWP6GSeohNNsB3YC0V+WCX+pEH7/o4nhTpXwHpuM9S+kiAclCL QIE3rlAVe9mUB1yicMI1ajye+mACMbUMC1IoqehgFYmXKNq1mxw8PuuL7UXGzQHtb0AC lf7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733231226; x=1733836026; 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=buXVk8Hv0kt/O2Pm0xs8UjTJcv25AHmCbOmE4In2eHw=; b=MW/KR2HiLjso/VHiC9NnRtt6avW+hQeRpy+WQpqVBU+Cah/8HHMznCyoGcurUdxSSa d445XZ5CI7SjnrMcKVyO7gtxe6kIZshcJZ3JsrUJgV0mIK+DZxy8FgdcJos5Kzx+9dpd v/W7NIXwovMuKvd5Wy+Yvo4E87ySQ9Rk/SAD+xsH6P+iix6KzKneZbx4zIoZyN0LvT3s Wy6GMw92G6K+rbwmOufqsfrbMcFKZ+A/OKMeRAR1VtgyrI66z8YRhQkXZ3BH6k8eWXsd YDbaiJAam0CH2EcClN0dVIdQtu+aPgUjGvXtr9bZ01vqblH6GbmP4T1XTFfzBYSlkZDj 6moA== X-Forwarded-Encrypted: i=1; AJvYcCXEx13yv+lWH1LrrCHQdOISzTAD4PQmE085pY6yszCLQWpWu2HxjD0r8dw7toPYFV0ofAJtB68gDWEzT/pB/g==@vger.kernel.org X-Gm-Message-State: AOJu0Yz1hgLWWF1KOFSHqKlZB7VpnctI6yumifGiaRqXYTys9OTOC8Ej DYFEjheUB3F7fKLfvgMrvrq8+vJsCJTugFWeZcVCbqdW6Ki+r5Ee5DyIVA== X-Gm-Gg: ASbGncsEQ6chnWP0ImgNj9o9Hs5PtGg9/YjIukqVAYxFlPt5+3I+QxT/4aUQHNmk2ZT TS4jsO6abcUqx4mxNbWruj7GJh7grW4u7GHyDkSBMmzC2FNAf/r3uhWIjJbJ72VKzKEvdDUglpr NMyOXqPs+Rq/DSPgmaV/6RKC7jr5NJSrFbI0zK2nhCwKW+TZq+slSKgRwgp7NkxGNyhx70paur5 qG+mwYQwnLKYF3N8b81b/3Ru+3X5TAeHp4EFYFhtDDOgLrPesMxa9yuet2LXHHLfgA= X-Google-Smtp-Source: AGHT+IGukEgpLiClvbipukCEB+/pOxRsxzkUlGv3sUB/RCeIp9AAjngYO2qZNgD+rM2ofsjn5bR14w== X-Received: by 2002:a05:6512:128b:b0:539:8a9a:4e63 with SMTP id 2adb3069b0e04-53e12a21812mr1352431e87.42.1733231225687; Tue, 03 Dec 2024 05:07:05 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:6140:2ef3:aaa:55ca]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7e4d42sm219142365e9.37.2024.12.03.05.07.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 05:07:05 -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 v1 3/7] tools/net/ynl: support decoding C arrays as enums Date: Tue, 3 Dec 2024 13:06:51 +0000 Message-ID: <20241203130655.45293-4-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241203130655.45293-1-donald.hunter@gmail.com> References: <20241203130655.45293-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 enum names. Signed-off-by: Donald Hunter Acked-by: Jakub Kicinski --- tools/net/ynl/lib/ynl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index 0d39a83574d5..f07a8404f71a 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -627,6 +627,8 @@ 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] else: decoded = attr.as_bin() if attr_spec.display_hint: From patchwork Tue Dec 3 13:06:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13892391 X-Patchwork-Delegate: johannes@sipsolutions.net 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 EA3D71EF0A6; Tue, 3 Dec 2024 13:07:08 +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=1733231230; cv=none; b=Fea18d8FJGoM5o1jl/uOMybQJnz/uVF8IP1sHZyuPexvnaOr6l/LjkYdVaQvwXmuqk+4rHwjP2FkexXjOOInbYjA28B26nhdgZjS2nU0uObtJ5E2am0FqpSG8f/t2Rs/9LToV1gfYvTKidAdWV+hUSqsp8+UUarMPrawGdp61Vg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231230; c=relaxed/simple; bh=/th2kGAZt5cmo5dEZAACW8w5HCDVZo5w3KMydreyFps=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ipiarlAbrsYuw7Mlc/YP89WlZkdELXXl0mysbk4fzJJR0Lpkot4FleI2fYE6LUy6uw2yhxg+5E/ck2v5B/VwKN8peSI5Trfof+BXHOsyPPs9YkBVx6qFOfr8HYkyMyYHNkYTiadF+0VrgCadWSNCPeZ147gQ0obfHNpHUt8XYts= 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=KiFKfopM; 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="KiFKfopM" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-434ab114753so46350275e9.0; Tue, 03 Dec 2024 05:07:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733231227; x=1733836027; 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=hL/lnk713PNE2uSEhyWxLL0gcbzFSyduE70wmvc/Bc4=; b=KiFKfopMq0joGx9cqrUR4IU6TosuK6KOPsNbDUfitx74KxXS4eFgsTOfArQTtUSZB4 WDLqD3CD08VkNS5uUd2wZXN//fnGDyD3XrxMHB5qc96ckloLcItZVd8DnX0KhQM/3iZ+ RQ5M06+lWt92DCzVszCYtPwgf+v7mrNq5mBz2NdzCd/O5Wcwj+iVeHK9xUerE/9osqwa uUcm3Lat3GezZBPhwAeyPL/zcMOQHW+b0BFLIegva6kq2UDt0BWn5cHLomx6tDpVyap5 kZyOrHQGv3rq4yCglx05erljoS0xPONXqzO584UYCOb6EVfbZ5EO7gxRojXy44rZhOJ8 GQDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733231227; x=1733836027; 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=hL/lnk713PNE2uSEhyWxLL0gcbzFSyduE70wmvc/Bc4=; b=gTcm2I09BjexJQNY8kr2HyBqln6lghTe3sddMmnJsEYt6zNO92GXrZ0beSaa99zRqz Hwy6lL+5VBnte5t8G+B55IkfZbMOgxu7vJtHey9uhadA/k/SrVK/m37vFRcieUhwEKiB jpiu3wHmt2oU8qAUTOW21S/RU7u8UzZVVtIU1vYgInU5K721JNGRMYkuCw74Iz8BAHY/ bqaWzwTLcHamnbNRLjrkMw74jjTD0rcV0BY+FvdrOmgrYtILxS172UMNca1Ddk35oXDX tQA98paiMxZZVR98SVcWVlD5IRBLTTxfrRVzpplOa4xNYxutECQRONHpc9O1tY4hEEuD X4Ww== X-Forwarded-Encrypted: i=1; AJvYcCVVcCCOVMAlI/AQmlrWRWhB9u7/czgIZVqbODK/akaPuoSTvPsBlmuvgObaSSlw5UggjxvLMyQVoT/4SF3jUw==@vger.kernel.org X-Gm-Message-State: AOJu0YyjOMs7JAcYUtHKn6hHR+fvCNRuGBELW6JpWEjTQZ0Blq6/+6tp +4RUKTT/bVHZbDHgTAu5ayITo84jE+flOzJ7ZehjaiT7CcW1IKxiRPqfHw== X-Gm-Gg: ASbGncvIItBpafO2mn1h7jc2fXDEG5OX0hf6yp+pQAXnDDwIPRTbK+FqNWEOLkvtP+D fNHBYbwrqkNP+ae/Wk0KeePxQTRkPaCGds1Gii1alKS09hk2258gqSr21AcTOBcCQXyOGGfjthU t9MuNBzRVW75y9f4NO/d6WuGq7wdfEGtZiYS6mS3X+Euq07v136jcuWg6q3zYsKLAZufF85H2j9 IkdRvchneJ/PrnyMVsOMAKc/nqwBCeb3fW5yJNHLX7UxI0u4RIkFbztFXmdh8NCdmM= X-Google-Smtp-Source: AGHT+IHSV2OrTQH4kHHU3TFmmXH+WxpM/zxQRNKGfEXwvciRric06KDfd1lbJc2ZKaprl1yletyCag== X-Received: by 2002:a05:600c:4e8a:b0:426:616e:db8d with SMTP id 5b1f17b1804b1-434d09c8d82mr21859375e9.15.1733231226705; Tue, 03 Dec 2024 05:07:06 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:6140:2ef3:aaa:55ca]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7e4d42sm219142365e9.37.2024.12.03.05.07.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 05:07:06 -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 v1 4/7] tools/net/ynl: accept IP string inputs Date: Tue, 3 Dec 2024 13:06:52 +0000 Message-ID: <20241203130655.45293-5-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241203130655.45293-1-donald.hunter@gmail.com> References: <20241203130655.45293-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 --- tools/net/ynl/lib/ynl.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index f07a8404f71a..c861c1a7d933 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/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.display_hint, attr_spec['type']) + 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.display_hint, attr['type']) + else: + attr_payload = bytes.fromhex(value) elif isinstance(value, dict) and attr.struct_name: attr_payload = self._encode_struct(attr.struct_name, value) else: @@ -899,6 +904,17 @@ class YnlFamily(SpecFamily): formatted = raw return formatted + def _from_string(self, string, display_hint, type): + if display_hint in ['ipv4', 'ipv6']: + ip = ipaddress.ip_address(string) + if type == 'binary': + raw = ip.packed + else: + raw = int(ip) + else: + raw = string + return raw + def handle_ntf(self, decoded): msg = dict() if self.include_raw: From patchwork Tue Dec 3 13:06:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13892392 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 F19A31F12E7; Tue, 3 Dec 2024 13:07:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231231; cv=none; b=bVti9jyhxVs1vmNqO/wegTW/zPeT0zbqodTp+3i4cQ46uFH/1bKBd3CAZXV7F41judVMMWCqHlpsbtz1SWjQF0rfP6ryLE8eHCYRYCnLjI3b3GthS3Cadv3fmkm1KDdP0CuwB5adhTa2OkVo/KV4Y+hE4BtOHg5hO5zlF+g9OGw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231231; c=relaxed/simple; bh=nb4TcqyFwFrNECk7GrgbMSfs99F2H/Occac10+u1JeU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=CWaoku22eOmjMa+aqx66A9wrfEWQsNBorMCI6N5r0BbtQ6hteOyjyjflvdnSKB6Kancg0L8ybUxM/ZXuH9uatjTE4Gbs13xwBOqbtecb9LMwo0/XISMgDTEyY5fVkS2BcERQ+miMVQA3SUvetxm7wGlpFmqTN/ajb9fkvrFYJN8= 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=MoTcw6yl; arc=none smtp.client-ip=209.85.128.41 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="MoTcw6yl" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-434a736518eso68085955e9.1; Tue, 03 Dec 2024 05:07:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733231228; x=1733836028; 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=lBYNNBlClnEKzYwKe7q3SzjpvqA3u6IY9nr+3g23W18=; b=MoTcw6ylJJHAeLLWreDnZDhbGdCMKyL9ccYdLMiWNJ/F45Iu46UA0PGZJOyIGhWGDP SMCBKUae114FNP3Fm0N3JH1gEMah6I0lUxlvx94tmh5np3PCK0hoRlJ3h2u9s0ic0TqN y2uiOfyE36fWYPKkyXSmxHVIP+5aShJrvR9WfQK8AZTO/xlHDqxE35RYT9Jr5MvNTnKh +GJhepZt8oGa+Obz5N5sgy9ftphIbUy97QJpZbTYudQP1bn3j/EIQ4wgRzOr02e4S9iI shmsZO6aEQe/C3Ygl99m+QWGO1I4zE1l3uaUciHvTQPqnBREqeSYnBHc9MYhAVfXqIOe lr/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733231228; x=1733836028; 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=lBYNNBlClnEKzYwKe7q3SzjpvqA3u6IY9nr+3g23W18=; b=dsPZgYTUM+a8xf8c8UG4dP+EYsBKZQihspbWBwxtx0zIZw+ObxD6674Jyl2hIw2gSf fX4v4PtVe77vs5/r+t7O1uQA7EpEy0eMWIc/vstDzs0PVhwvW1/udl/SJKS2NS6Cz/d+ GsSqIENsX+NKE9D/CuyP3Hrqx7HoXjcAsApBTjyBDeGyrETldXIbN5JPGVymue5QSpdZ jT/n6yeV2cn37cY2bS5Azpyfmx1kQmOIwOn9+EpcmDDiZeFLT6CfxFovMj3ho2X6/nkQ FMrPx/RKvbkIOGZsEq1engr8dAkJ7Z1dfCx9xJlqa5OoWtR1HAYBB9n2NftkInQmfFEc 9EFw== X-Forwarded-Encrypted: i=1; AJvYcCVJ7WduWFoy2CpQ/TT/S10UDTx7yGHQzU35n9kduuXG2zseJahjBNHNIev3QexDZOJmRaJXX8CTumxmZ5WQaQ==@vger.kernel.org X-Gm-Message-State: AOJu0YxXyW7UThmPguT0LEI3ecD7y+i+4Run0jTjzMQnvy1TedlsAzOt w9dzeQIMJL+u1VGcZMHJk83f7L9f7gmqxi60D+WZHkKwqMtpOdZ/p4A0eQ== X-Gm-Gg: ASbGncv3mW5JtuZ/1XFKkc+eiYQVVusaVxUQONqV8eAb6cLUO7/LwZqGiT03WQ4GXI2 U/XAI1/Xb+SWGhH1ok3wHzlBF326LM0xw4buuWowA0+kpp8gJWt/cgdTkCvtVAy7z6qorFbj3PK UVRKcU5HKBkFgeIf/PDODeJM0QWrn6rdmI4ubpXxM+ND2S3EkKQ/IFgS7WlNfGWLQflzBvpkPQA D44ShCIZ7CsQIBiTkGHexUD5mgfzR0srkahQE/h9m+s48p4mWYPYLZP59f9JVfCL2o= X-Google-Smtp-Source: AGHT+IGBpYcYzxJv/oZEOoDXCN6RQrjEPetJyybHrkPFJgd5/RsASHj2WLnzP194S5AJLiVt8KM1kw== X-Received: by 2002:a05:600c:6b71:b0:432:d735:cc71 with SMTP id 5b1f17b1804b1-434d0a0e3c4mr21544235e9.25.1733231227834; Tue, 03 Dec 2024 05:07:07 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:6140:2ef3:aaa:55ca]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7e4d42sm219142365e9.37.2024.12.03.05.07.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 05:07:07 -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 v1 5/7] netlink: specs: support nested structs in genetlink legacy Date: Tue, 3 Dec 2024 13:06:53 +0000 Message-ID: <20241203130655.45293-6-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241203130655.45293-1-donald.hunter@gmail.com> References: <20241203130655.45293-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 8db0e22fa72c..f8be52e7793b 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -148,6 +148,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 Tue Dec 3 13:06:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13892393 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 5A9201F1319; Tue, 3 Dec 2024 13:07:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231233; cv=none; b=bEplvRVLfJgEOndeeGKxWYfEEagDg58LDc6bpc+Ke8YgzoB2hog0KUYiV61XvJGVjLPebJ3iFntfaAOt8hPxUEww/X7naXGBCrnNHyYTHBYKaU0UHXXwvrFIayO1VVOqBictjh40dE7vUww7MkPEGqf67lJLCrwQ50vOOYzv8Vo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231233; c=relaxed/simple; bh=gYFiLhOxPkA0x0nKHe+w5/cQnq26kaDaguojzF3mZ5k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tR/rsZp3A+6YLDCuwgPXe6xbNUC8eFhx1+v3eZXrpzHBRbQx2GKzn9Cy+EqPCjeKDXf09pFMRn+8m9DR+ehLADINGADU2MTyP0JvzDAHashWLaEb/B3WKXDWobSmAHhRxvXorM25VHG24JblAFuSZiUL8JKkbdr6h9hc9ApSDKg= 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=T8O3LikZ; arc=none smtp.client-ip=209.85.221.48 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="T8O3LikZ" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-385d6e36de7so4724258f8f.0; Tue, 03 Dec 2024 05:07:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733231229; x=1733836029; 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=/bpKZShdoezXsC+X6a595d2PApM2wBX2FBj3mwqdO28=; b=T8O3LikZN/Ef4iBlZ19PlFWkpR+vYpsy0l8yI17ksyDi9lz2ZtR14iQa/aDNE29NlN GBFHxcHO3AYr+e5f/JIg5yh7Xm2uc/U7ZCB9f2ktW3cZe0rjojPqRQVULKMioaRXEEuK EfXt5jU5UtxS/wi76f20HDwv3Mc1JRIlZua18Htbn+pmbimKZy56WCAzs8UtXG89xb3O V3Auwp5s8qPQInAks3EoLLww/9uOTcR/hVjn0NPYbeLNANvzDyhKS/nOYdY7s9n5sBoC 2uSdux7U85rqYol3YW6S9aR319mmP2P1VjG1haLG7Jb9Jwhqi1pFvexHWifvFPyEntyT cYKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733231229; x=1733836029; 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=/bpKZShdoezXsC+X6a595d2PApM2wBX2FBj3mwqdO28=; b=evBzlCEm7SahaqEGqUskcGDe0uM7rjSVV37khy+W4ShgoF7q/jc8VQB28qjxyf/BRq qC0s6+/BGSKN4eCnpcoTFknDCesxNBpovb6Glr5GFsaib/BmaaCUy3ElgLtvl/OfllwI 9VZQoACcscaQQt7g2tDO19czh6ZcPe+YuWW/JYamRR9pfTy7yBZPdPyEDZ/q69uzOktr gTO6j44K/wujNOMYqzwLpj/FzpcS5K8xpqL7uL0aL+rlaRvaa6oydWlyZPGywwpwUNue eneaOQsDTC4BQMkP267tV4BeTjfbrlVjtpo54N0Ann/4IPOC9PO8+opa7rubhHvb0Pqh 281w== X-Forwarded-Encrypted: i=1; AJvYcCW8fgssEv+FWKp2/iyxiK8LAz1okFjQQ7cdhCsr6UzHEWex/e5p8ONvO0uShDKFnVMLrgezuLghCMALSrOLhA==@vger.kernel.org X-Gm-Message-State: AOJu0YyzACvRMkHOGmhGpZ2d/sXJuzZxXF1+zgKXPJPxphxoj2ivCJow I+oYP+w6RDvlnLJCk8LKP64TYFdDgmOzN1Au87wXk7lkxk7w3zkrDLWzlw== X-Gm-Gg: ASbGncsmTADqPA6YuLmnxRBx1kZ5UtJzd82m+bM4MhPoQjyHUoWGK/lOayOdAEj8dGu eiTpI4HxAvq/fvk/KKHlsEwPlPymiVo1IfLl2qvtV0HPbSZUuRYnmyREUjFb391Guiz2ndn70Zo fUi8vy4zTJjFOCdNLDxkAZt7/CY1lqOWPkxp24d2ixNmDzw6IVYlO+8izRUJWxuQj4lBQBzV2Zl Bdy64o/5X+sgnHptfqI4Fp3CSEV7FiSWxNAWiYMd5RbLahlhqNqKYwMDM13YQVprZU= X-Google-Smtp-Source: AGHT+IGT2e1WnoGquvUF3C/VGLlQC+U87oREyJDHons73U2Xm2WclvKtjBLv9DcY46Zm39J28Qpzsg== X-Received: by 2002:a05:6000:2c6:b0:385:ebaf:3824 with SMTP id ffacd0b85a97d-385fd3f2d22mr2508811f8f.27.1733231228926; Tue, 03 Dec 2024 05:07:08 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:6140:2ef3:aaa:55ca]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7e4d42sm219142365e9.37.2024.12.03.05.07.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 05:07:08 -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 v1 6/7] netlink: specs: add s8, s16 to genetlink schemas Date: Tue, 3 Dec 2024 13:06:54 +0000 Message-ID: <20241203130655.45293-7-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241203130655.45293-1-donald.hunter@gmail.com> References: <20241203130655.45293-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 4f803eaac6d8..473c50b73522 100644 --- a/Documentation/netlink/genetlink-c.yaml +++ b/Documentation/netlink/genetlink-c.yaml @@ -157,7 +157,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 f8be52e7793b..68462c6d7cca 100644 --- a/Documentation/netlink/genetlink-legacy.yaml +++ b/Documentation/netlink/genetlink-legacy.yaml @@ -203,7 +203,7 @@ properties: type: &attr-type description: The netlink attribute type enum: [ unused, pad, flag, binary, bitfield32, - uint, sint, u8, u16, u32, u64, s32, s64, + uint, sint, u8, u16, u32, u64, s8, s16, s32, s64, string, nest, indexed-array, nest-type-value ] doc: description: Documentation of the attribute. diff --git a/Documentation/netlink/genetlink.yaml b/Documentation/netlink/genetlink.yaml index b036227b46f1..11c1592d49be 100644 --- a/Documentation/netlink/genetlink.yaml +++ b/Documentation/netlink/genetlink.yaml @@ -123,7 +123,7 @@ properties: type: string type: &attr-type enum: [ unused, pad, flag, binary, - uint, sint, u8, u16, u32, u64, s32, s64, + uint, sint, u8, u16, u32, u64, s8, s16, s32, s64, string, nest, indexed-array, nest-type-value ] doc: description: Documentation of the attribute. From patchwork Tue Dec 3 13:06:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13892394 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 403331F427E; Tue, 3 Dec 2024 13:07:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231236; cv=none; b=e//r0hDA0NsiSt+Q9STAO2y8pmfAdgC42hI2rPqRSp9rAymI+GEAG06lXaJi4euUjeG0G7mshVSlKF52iLQ1GjDQwhInKN9pRUAy3EgiYB6ioYM6a+QY4axu+9lNkq4Li3RBHY92NmmwpSYjyKq0E4eJ5McLJqPNlV+osJ+K9w8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733231236; c=relaxed/simple; bh=K/FqCq7g6EhAhorLpjsjeaQoMRD4/prtZPirn0E1Mvk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rPAihnOXT5IsXAVxtCpzKKnpwg3rkp91RIZGLL3BNuky6N2effjKXrAmtOtMC8mO8ioybAe3mKRzJDeRHmCQZYUOTbWgJEsSgQ8hJWwhFnX2mShbJp3wPmYbNX7afJRE9+8i9/mLSUjb/mJf224qHygiVNyBTOsMRZYA9vySruE= 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=K5yFlQMx; arc=none smtp.client-ip=209.85.128.44 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="K5yFlQMx" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-434aabd688fso35502465e9.3; Tue, 03 Dec 2024 05:07:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733231231; x=1733836031; 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=BIGUsaxc1kniQIUGCLJXlSbVgIskHyY7fhwT5YQn2uE=; b=K5yFlQMxZwM051iV9pydesafw93GoPSvtaXmnLzwEvmQPXfUDIE6OQ5s0RdBovUFzW 7P2d31Pdx27vNsjQ6fa7RjyOGZ8Xb2tmRWXJ2fvD1KfMqlrKXZ1P0Kv/zKSkpspWILl0 Y07K2ffkH3o8J1Sb+IbbE1jkNYpicJ7Cijph3CZvwlGL3t8UUNpe2KhEskWkMukETBW/ OKzKsUaz9Yiy1cKztfxb7s8JTvCUIvzqmFCJDDTiznfYvN5QXaUs0qC5nXvEtkF2eDYJ FWKXd+iM5vU8Vnq3oMqjRDhP/cR8MR1F1PpeV9sLRJEL7YePW0/zy640Vu+wNPvIhpwr UGkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733231231; x=1733836031; 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=BIGUsaxc1kniQIUGCLJXlSbVgIskHyY7fhwT5YQn2uE=; b=qrS+S17qSPt07ScDdxAY9LASMj2G94itHaINJnkkP9n7xJuz+HuWOfXKpngebNmpuq hrCKaYRWuAI4Mm/fDHhZbvURoFv0NmmbZPxNKvK5k/mWxZ0g250V+enYXyA4LfjA31Uw WC5MmSEhRRnEicLMAcApMTSvnLLpuT24KNMnDBh7aeeSFKj3vlSTO9wHRMaQXWf0vdKx IIjUi4Chux66kCaKBlnT/tw7tCsSAQSVSUBhkkvOQ1hrS4+y4YSIho5OXJHTRi3WsK/Z 9ym1PS1KRv0TY8Y44lMO7/JEKebvi9nAJyBWVkm1jVqNw0gU63qLlf4zHvtCMw24k932 by1A== X-Forwarded-Encrypted: i=1; AJvYcCV2eUoWltUPQI5nfwVvU5oTyIbV6mf+0KC0BjudzBjdNY+6xGOUhmP3JmgPdXCwBtCwWZqCoB2ju6ZD0p+Daw==@vger.kernel.org X-Gm-Message-State: AOJu0YwiWsFrb2YGo9/iIK305NnfkbvFoRGrbMGfzFBKpVehJsdZGLa5 cnDPnBH9I2rnpeu1WbRSJZevPm5EaJiee+f7gixbOT7xVL8pJJWpGiAdww== X-Gm-Gg: ASbGnctMqM6N4gbLSGNxHcDj+EEDnIAY4WSlnNc5i8X3mM0CL/uC6q5h9ibPpTk0ZOm EWJONglcD9sQJ7LCIYfXUTlTJ0vpy4NUEsoX9GtCRQXGV68Hjz/x5eSAL8TD0r0qlnTeP9UhU0A qSh49mCarzHsEki9O0Q5LMpOx3E0ukDnRfuUuseU77c+QZ6Q1sFSlLZGrD44cLCdu/dvz1MEjYE 2roJCHD1XxPJb+oajsXy+u7ZJRwW+KYeOVfOTsAIV0XHw/1MPAGxxgdBd/IEiuTU5k= X-Google-Smtp-Source: AGHT+IF/XkLi9GfBNI6tIeWjXx0E7hiJyMvv7Smz9ky/Dm6c9+F5gczHzCH2Mppa3N8H0NSabtf04A== X-Received: by 2002:a05:600c:3b8d:b0:431:6153:a258 with SMTP id 5b1f17b1804b1-434d3fa051emr1188115e9.13.1733231230349; Tue, 03 Dec 2024 05:07:10 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:6140:2ef3:aaa:55ca]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7e4d42sm219142365e9.37.2024.12.03.05.07.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 05:07:09 -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 v1 7/7] netlink: specs: wireless: add a spec for nl80211 Date: Tue, 3 Dec 2024 13:06:55 +0000 Message-ID: <20241203130655.45293-8-donald.hunter@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20241203130655.45293-1-donald.hunter@gmail.com> References: <20241203130655.45293-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 and get-interface. ./tools/net/ynl/cli.py \ --spec Documentation/netlink/specs/nl80211.yaml \ --dump get-wiphy ./tools/net/ynl/cli.py \ --spec Documentation/netlink/specs/nl80211.yaml \ --dump get-interface Signed-off-by: Donald Hunter --- Documentation/netlink/specs/nl80211.yaml | 1775 ++++++++++++++++++++++ 1 file changed, 1775 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..06e54233bb6a --- /dev/null +++ b/Documentation/netlink/specs/nl80211.yaml @@ -0,0 +1,1775 @@ +# 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: nl80211-commands + type: enum + entries: + - unspec + - get-wiphy + - set-wiphy + - new-wiphy + - del-wiphy + - get-interface + - set-interface + - new-interface + - del-interface + - get-key + - set-key + - new-key + - del-key + - get-beacon + - set-beacon + - new-beacon + - del-beacon + - get-station + - set-station + - new-station + - del-station + - get-mpath + - set-mpath + - new-mpath + - del-mpath + - set-bss + - set-reg + - req-set-reg + - get-mesh-config + - set-mesh-config + - set-mgmt-extra-ie + - get-reg + - get-scan + - trigger-scan + - new-scan-results + - scan-aborted + - reg-change + - authenticate + - associate + - deauthenticate + - disassociate + - michael-mic-failure + - reg-beacon-hint + - join-ibss + - leave-ibss + - testmode + - connect + - roam + - disconnect + - set-wiphy-netns + - get-survey + - new-survey-results + - set-pmksa + - del-pmksa + - flush-pmksa + - remain-on-channel + - cancel-remain-on-channel + - set-tx-bitrate-mask + - register-action + - action + - action-tx-status + - set-power-save + - get-power-save + - set-cqm + - notify-cqm + - set-channel + - set-wds-peer + - frame-wait-cancel + - join-mesh + - leave-mesh + - unprot-deauthenticate + - unprot-disassociate + - new-peer-candidate + - get-wowlan + - set-wowlan + - start-sched-scan + - stop-sched-scan + - sched-scan-results + - sched-scan-stopped + - set-rekey-offload + - pmksa-candidate + - tdls-oper + - tdls-mgmt + - unexpected-frame + - probe-client + - register-beacons + - unexpected-4-addr-frame + - set-noack-map + - ch-switch-notify + - start-p2p-device + - stop-p2p-device + - conn-failed + - set-mcast-rate + - set-mac-acl + - radar-detect + - get-protocol-features + - update-ft-ies + - ft-event + - crit-protocol-start + - crit-protocol-stop + - get-coalesce + - set-coalesce + - channel-switch + - vendor + - set-qos-map + - add-tx-ts + - del-tx-ts + - get-mpp + - join-ocb + - leave-ocb + - ch-switch-started-notify + - tdls-channel-switch + - tdls-cancel-channel-switch + - wiphy-reg-change + - abort-scan + - start-nan + - stop-nan + - add-nan-function + - del-nan-function + - change-nan-config + - nan-match + - set-multicast-to-unicast + - update-connect-params + - set-pmk + - del-pmk + - port-authorized + - reload-regdb + - external-auth + - sta-opmode-changed + - control-port-frame + - get-ftm-responder-stats + - peer-measurement-start + - peer-measurement-result + - peer-measurement-complete + - notify-radar + - update-owe-info + - probe-mesh-link + - set-tid-config + - unprot-beacon + - control-port-frame-tx-status + - set-sar-specs + - obss-color-collision + - color-change-request + - color-change-started + - color-change-aborted + - color-change-completed + - set-fils-aad + - assoc-comeback + - add-link + - remove-link + - add-link-sta + - modify-link-sta + - remove-link-sta + - set-hw-timestamp + - links-removed + - set-tid-to-link-mapping + - + name: feature-flags + type: flags + entries: + - sk-tx-status + - ht-ibss + - inactivity-timer + - cell-base-reg-hints + - p2p-device-needs-channel + - sae + - low-priority-scan + - scan-flush + - ap-scan + - vif-txpower + - need-obss-scan + - p2p-go-ctwin + - p2p-go-oppps + - reserved + - advertise-chan-limits + - full-ap-client-state + - userspace-mpm + - active-monitor + - ap-mode-chan-width-change + - ds-param-set-ie-in-probes + - wfa-tpc-ie-in-proves + - quiet + - tx-power-insertion + - ackto-estimation + - static-smps + - dynamic-smps + - supports-wmm-admission + - mac-on-create + - tdls-channel-switch + - scan-random-mac-addr + - sched-scan-random-mac-addr + - no-random-mac-addr + - + name: ieee80211-mcs-info + type: struct + members: + - + name: rx-mask + type: binary + len: 10 + - + name: rx-highest + type: u16 + byte-order: little-endian + - + name: tx-params + type: u8 + - + name: reserved + type: binary + len: 3 + - + name: ieee80211-vht-mcs-info + type: struct + members: + - + name: rx-mcs-map + type: u16 + byte-order: little-endian + - + name: rx-highest + type: u16 + byte-order: little-endian + - + name: tx-mcs-map + type: u16 + byte-order: little-endian + - + name: tx-highest + type: u16 + byte-order: little-endian + - + name: ieee80211-ht-cap + type: struct + members: + - + name: cap-info + type: u16 + byte-order: little-endian + - + name: ampdu-params-info + type: u8 + - + name: mcs + type: binary + struct: ieee80211-mcs-info + - + name: extended-ht-cap-info + type: u16 + byte-order: little-endian + - + name: tx-bf-cap-info + type: u32 + byte-order: little-endian + - + name: antenna-selection-info + type: u8 + - + name: nl80211-channel-type + type: enum + entries: + - no-ht + - ht20 + - ht40minus + - ht40plus + - + name: nl80211-sta-flag-update + type: struct + members: + - + name: mask + type: u32 + - + name: set + type: u32 + - + name: wlan-cipher-suites + type: enum + entries: + - + name: use-group + value: 0xfac00 + - + name: wep40 + value: 0xfac01 + - + name: tkip + value: 0xfac02 + - + name: reserved + value: 0xfac03 + - + name: ccmp + value: 0xfac04 + - + name: wep104 + value: 0xfac05 + - + name: aes-cmac + value: 0xfac06 + - + name: gcmp + value: 0xfac08 + - + name: gcmp-256 + value: 0xfac09 + - + name: ccmp-256 + value: 0xfac0a + - + name: bip-gmac-128 + value: 0xfac0b + - + name: bip-gmac-256 + value: 0xfac0c + - + name: bip-cmac-256 + value: 0xfac0d + - + name: sms4 + value: 0x147201 + +attribute-sets: + - + name: nl80211-attrs + 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: nl80211-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: nl80211-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 + enum: wlan-cipher-suites + - + 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: nl80211-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: binary # TODO: nest + - + name: rx-frame-types + type: binary # TODO: nest + - + 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-attrs + - + 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 + - + 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-4-way-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 + - + 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: binary # TODO: nest + - + 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: wiphy-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: binary + - + name: 6ghz + type: binary + - + name: s1ghz + type: binary + - + name: lc + type: binary + - + name: band-attrs + 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: binary + - + 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 + attributes: + - + name: rate + type: u32 + - + name: 2ghz-shortpreamble + type: flag + - + name: frequency-attrs + attributes: + - + name: freq + type: u32 + - + name: disabled + type: flag + - + name: no-ir + type: flag + - + name: no-ibss + 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: binary + - + 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-attrs + attributes: + - + name: limits + type: indexed-array + sub-type: nest + nested-attributes: iface-limit-attrs + - + 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-attrs + attributes: + - + name: max + type: u32 + - + name: types + type: nest + nested-attributes: supported-iftypes + - + name: supported-iftypes + 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 + 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: txq-stats + type: u32 + - + name: wowlan-triggers-attrs + 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 + attribute-set: nl80211-attrs + do: + request: + value: 1 + attributes: + - wiphy + reply: + value: 3 + dump: + request: + attributes: + - wiphy + - + 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 + dump: + request: + attributes: + - ifname + +mcast-groups: + list: + - + name: config + - + name: scan + - + name: regulatory + - + name: mlme + - + name: vendor + - + name: nan + - + name: testmode