From patchwork Tue Feb 11 12:01:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969601 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3EA491FA165; Tue, 11 Feb 2025 12:01:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275304; cv=none; b=rCNguLuMK/8ceVV1Fv2mnTDx4FLBoQ5IPcFoQurBS95jWrmZofYwsq5ophGrAmVvo1JuLtBAqOZrBR0ETa0UJAxpvIG/YaGfV9w6QZQ4pU+TZTaLnhoC9LHdgVleZ2d8vg8zT9OFB1TRD3UiaQDGFbGMFNOMrdGwsX1MuJhqUKQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275304; c=relaxed/simple; bh=WSmza9m5lqfjaJbkYShhNi8pvsDhRW/0u6ShwBBGN1E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AmAZ4s8LXBZYXs/jnTxfXVEXFFtgCNLI4nuORCG69e+0qe0lT236pano5aItzTNAqQrhhtjfg1Y5vP7NhmaUtUrBLShzaVvTKVaLSx/4SKOLknWVryhI8Sra7pzn0n4a3jwkrOA8dTaN1Lip+eYfhtna48okLcBdDSWbECsr0q0= 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=bXOf4ZT+; arc=none smtp.client-ip=209.85.221.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bXOf4ZT+" Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-38dd011ff8bso3109713f8f.0; Tue, 11 Feb 2025 04:01:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275301; x=1739880101; 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=bXOf4ZT+yotJHyzi+8yNfLEcZAzHy3FaozWmsTRIXpSSv4SVbu2ZkaTkMFE1SLlAk+ 7k8U8c8ZHtVVi+XBKTmpy+386/WRjEN7UvTMfe+P2OnBG14G1SLFB4Fwn8UOinO2QUuU YUOxwqS7nJnFnvR7EqS5rn0bwmpNewOsHJ5gRhtxCtzOprDbmEUkeopcRFXxGM/e0uvE lXP/bpgRhcT49nKo9kxSWKXUpFMMxYMlad4rahCGLADrX21OA+Qykzg0E5m84uUmghaN y/7r6HLDk6Roy7c31U/q16NSftnhSZWq56WBNW8Nsqp1w2BF5NjQfIapZYY6orlwrJWI 8xzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275301; x=1739880101; 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=HBA0O3YfY5oYan5n+57oEA/6nmMSXZ3QNkSsTptVeqDvTVUzSNd8jMuaorwx51p2WG F9uKIrhyGSibyrHH2BgVIMpGG15W2Xi5kKYTssSKi95tMvjfUDixxBs8y2QKJSFN/4hG pZ9hPAjx/2suRUIinUzp6cK7TroBqEEg/YVGTKZKDXwZZvePwxLbuCi68kRD6+3plJir ILg+ROGPbMAFhGw2an20fiVPI+BgfwBA2HZag7ZhcD1VjrxA13uvNzfEoc2ZysF/D7Ok eCYBTLJju3Awe52ZUk2OGec0NNIkNKiUHKaa192aP/Gq3UlzVQnx0efOxilhTcHC+/d+ /+ZA== X-Forwarded-Encrypted: i=1; AJvYcCU6MN4ANbswJFY7hJrYZoIuEe8YbPsDxoalPEsiTjHXUBcL5lUNtsOkZePBJPv1QfAOyN/6cGPwqY55ZczgGA==@vger.kernel.org X-Gm-Message-State: AOJu0Yw9cmHSo2QH+GyKs8Vipz0yiOl+/KGu4/TsNldWm6SfLGyNdwBt DBWklzL4mihRScL9GQ9iXd089yFQ6wUgTmgoGcVFgRfuKZpJyGVHl8LRtg== X-Gm-Gg: ASbGncv3BXlbVrKegsVkCeeJDS2l6jmzxlt1AXwZpwJEP/A3qlavKB27jlBEi08FYyo PNpNysQZ5z+tHKvPNqbGyh20azX7WhGPIpkcmzvZrQ8uqTo2hSQZvMvkwPynux/HMf69Wdj9XY3 TUnzG17JBW7GyZ2fmlexzgGO8payOrTr8UWuvrqQxSSRlFe86gw5xOyW5B6jgOGltxl4eO98vkA 1+2uyBSdeKKDyVY9pJgnYCkYCAgVYBKou5fEoctYolK5kbQjAnl3TkVeEX81hC1B+3LORydha61 vXlFgw5/CjVKRDdLYUkh4ZujZQZJ8irAbw== X-Google-Smtp-Source: AGHT+IGat1/KySXHMoSlk+TobooD3C5IR62D68go2AuCGpWimmB0odeotXUOZUvr0qV4o1Y8gRgtyg== X-Received: by 2002:a05:6000:2c3:b0:38d:dbbc:3b07 with SMTP id ffacd0b85a97d-38ddbbc3d28mr8109398f8f.2.1739275300557; Tue, 11 Feb 2025 04:01:40 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:39 -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 v5 01/10] tools/net/ynl: remove extraneous plural from variable names Date: Tue, 11 Feb 2025 12:01:18 +0000 Message-ID: <20250211120127.84858-2-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969602 X-Patchwork-Delegate: johannes@sipsolutions.net 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 519851FC7D8; Tue, 11 Feb 2025 12:01:44 +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=1739275306; cv=none; b=C2DZFSqFykc6QUC4QDuOPkWyM6fh3lKbBPA+Pm88nbTeQdF8Y5K6djLzjZTyA3B8pOTt2Sjf2lQQHpiCyIzBIEcxRpdwhKQpfGD6Nt47fw2yXDZKbiSmwmQdpWBveNp4PCAoQaIUmeH7aESdZu5pEHBExXodv90giEa0zs86zgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275306; c=relaxed/simple; bh=MIEBxlmM/JehrSUbCdGYuUJVphACPYc5J2/hOlFW8bs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VJB1zf47h+IDDn5j7o48CR7qO6x9NEMBUPoR178b0iQWrnZryP8lJlHBvrZ5lZYiIjvmbCXeQz+CPxbdfUrDlO6kJn/O/JKiCNIjd7p9TB3I2HNaScEc9AgSrzAbZiIRo5DKQYSi6STmz93cD9/LD2FnV0wIyo2Y5VPa8eZ701I= 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=b7UzVs9C; 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="b7UzVs9C" Received: by mail-wr1-f51.google.com with SMTP id ffacd0b85a97d-38ddc36b81dso1538527f8f.1; Tue, 11 Feb 2025 04:01:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275302; x=1739880102; 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=b7UzVs9CC0h2XflcXseq3OSOF3joSDOOs8xnWqygQmmMmOc8bIfz6TabvGAgkeEQIZ 8XqheRs3e+jNJryjtNCiMGv4nR8AplpKE514yMiILzut/M6ZleHz610rqMxs/bEYO5gT N1L8qLFML8u43S9Eo5O4rz2KVc00zq/SSUPB74mm/pcoqSTn6FsFdotpIKqPRQAdn9Bt 6pxpyhQX0Oxnn0dDiCHwFLI7aIO+NP/DSvIdmjySWvlAIZhBvWIy9XRlM6+TOJ+QiYPS kYqlrFeUZxi6R7NU/tiQYGn6m6bfjz6Hb7gxNOLAo8bhFqyyHr23GMh/sBfrC7tR5RKI +pUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275302; x=1739880102; 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=LPlNLIB+m8DN3Ryx8Q4tHCyOWDaVl07oMTu1MnMvQ6FvGJAWvCC69hggNiPaTqZA4Q +qZLyGWKhTEUgINvS0ETn1vBNRHkax5MSyGrIMAHVNNr6wlnHuWprx/bX1Evy/hAc26n ZrQ8BkPAKPR+R6qozhU9RIheETsda/0JHQzLWeMffBkNh0PSoiBwg99e+ALkKvNn6JrD q/Jrq5606r5Y8rvT4jkU0GwD4Ugd1w1bhSJ6BpfWr8NnEvKiXZQfSNmY4iQGgy9/ZgZs iuTATpSSYuA/8I2ToK2f9B0lSz2W311BWWxbUbBcTG9MixVGKBiS1q2UfH2EKPZZB8yt uKyw== X-Forwarded-Encrypted: i=1; AJvYcCUA2NmQgipcheTQCVCOz9BVY2XEuO5/4BZXUMn0ZahGvRJMcwyZJ+daJjtfprIEjjFWPBcECqJKmXgLBcfiXQ==@vger.kernel.org X-Gm-Message-State: AOJu0YwuhzzvAWu3CFMtHpOBo6zIr84CZoxSrdsUHiCWUSpQHu1fUAXK S/W9Wqfey/5no90fIYPhj4SneXLMh/8Ig1yeGDTCPmwZ3MVD9qIyOO/ohQ== X-Gm-Gg: ASbGnctStyAP1pwnotMkuYolhvIm4rvPMh3h0I6fZHfgHA0YRj94pRonjmT76l9kOPX +cWREVYpt9zsZACiy/MLF3XUIrZ6vTUmiD3zQKUamHQrlcyzNPSsAULn1trM3pIEas++E9QJqml uGYioghUrK0MG7Z9TdVn83/mJfNJlAWBFqAdtUcbdZ+pwgI388+lNbi7Rpi25J5mDes1f8de14/ 8td/71L09LuOE5KDdDsagj65q83ZWPMQZMu5/byKaQzkoUH1jrhCxyO18czVSVnlL22GFRdfFGh KzMWtae0+Dn4bRbPDE4TdcfhAYtAyEpl+g== X-Google-Smtp-Source: AGHT+IFB8cpnkDjjl3jOAGmdmTyeh9BTEj6B0xy/hVWXsrpCvIxsZRgcOFilil7WV45A5iWxqhA+DA== X-Received: by 2002:a5d:64a9:0:b0:38d:d8c0:1fa1 with SMTP id ffacd0b85a97d-38de43c6f6bmr2504479f8f.18.1739275302018; Tue, 11 Feb 2025 04:01:42 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:41 -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 v5 02/10] tools/net/ynl: support decoding indexed arrays as enums Date: Tue, 11 Feb 2025 12:01:19 +0000 Message-ID: <20250211120127.84858-3-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:20 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969603 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 5F3B61FDE3B; Tue, 11 Feb 2025 12:01:45 +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=1739275308; cv=none; b=HnBGT+CRC6u3U4ieQC7rfIR5v64F3ROq5ogciyn4K9/bcnNoYNGB2Nf0hMluXpNDKLoHodo+ZNUZoxDR1SnrngmUHj7000DXHWU89XxUn1JQ02OARbJWBZyrprvT/ZniHRxdj3I08ngd+Q95jOXEiu/Slby209EhqA9exF2ba5A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275308; c=relaxed/simple; bh=1sXRpKRdwQWU3PDhHFw9zXhzGGi7++rZDL+a2/5+euE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BW+pVcTUf+tILv3foN+gAkf9q9aufPG4oFVUMMcwBPGjnnUmYQhzchgnij9R8qGO7HhEOweCIdgg3ei7Z571NurekzLT8JylGoJCzpjQ+O5B20avj1F9gTC3T9hNCTPN94t82sTO/k2ANvHcR2UGMjM26gTUm7MQGl29zn97X8g= 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=QuCy/ZIu; 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="QuCy/ZIu" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43932b9b09aso31877245e9.3; Tue, 11 Feb 2025 04:01:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275303; x=1739880103; 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=QuCy/ZIuemjpuK0E2p25n+LD7ND0x7IUmMUNuGSZxbTAVvIKtAh8aY3LY1JDsYalcG za1T9yhygMpD/W21jDjhTyWCToJJNbiT+fsrKRAmkrsbApNE8Ly7A3/xKaxiB0hBXNiu AGHwaOpE2rJ0S4ZunUi3Wg9J/KvU1d5/aVXuvim650kj1IX4SBk9qwp3NxP6sWrORhOk L97/jtROi7bStn8/RANAygH9womlztxt0K26WmMZABDONCXY19jamw2PdmjueNff30am KWc3SdLJiOGgHvKnwXySQZKLJgQFssTQ28UgRjdbhqEMeaAyFkzSySgijxuHMo9BAdQe QkiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275303; x=1739880103; 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=u+YFVZXbYHJqsxzm2I7R6UWA9K4opNrWPUqnprg3jHLDU25rQqBBR/mI6bIk8mC9Do o/KzudGoJPjEsY5x9xlgOBQQZWc9vkQpQaqJ45AL6a2N9zxgLAs8+Rv/wtV0Z+pF4jSp OZxNSEQrwL1W1APva6isCxEZIqzPiXwiR+Z5jvxAoueOGXm6WCC4VOes/XYpX9p6PRgg MdKurXoj7295pdzRbV0qOlNzoaXGFNtHaclLdrWpwJCp1iAdJgcV8m8Sw+lWZi19An7o wszWTuRb2bkiV63cVfaEEuhUnO3/iM/ByACaZ2IvEscg1ehEiFHJ7SVUdYpCqAf1N0ll KTCg== X-Forwarded-Encrypted: i=1; AJvYcCXAh73F39k+AhXDs2YI2XLr4Vm+Bj8wFqIx8Wkl6JBN9ufRG7EkKSS1xgk5vluhTmlb3zWLmq/N/i5GpbK86Q==@vger.kernel.org X-Gm-Message-State: AOJu0YwJgqr3J5h2OcSiuUwaWJI7HCfVSUFlz1+L87rvK2oN3hgxs3Db 2vm0llDb3GgmwtOZesc7CImGmTDYyUSMWgR83/kQ0DwMd2lb2lpuvzxkmw== X-Gm-Gg: ASbGncs8KrsPb4u++2pXNisEhC4dT0L9aUQZ03063pT+KiYb+QlfR0IhB9w1244RIDu DEbVj5io4yimnRDQ5xu4lsc72tGpPTefruS83J42AIYVHx4uBC7Y8wJ2NHliXzveCFhw6dXX7gH 8pJBEuYXQVWrCfeIIRymuNhE7nsweQU3SaG17ho+u3xuYlJLqKKez46bWep0JnoYPfz/aMMKaTP arKpn4vQQ+JmzIc99/OLw3iOUJO9lfPKbNruXYp1FzJQ9R0aXlVkGVA8ol8XOoqHOwvlqYSWtEo FharWy/lDu6iVUq9r2W8E8N+IxqxcPiymQ== X-Google-Smtp-Source: AGHT+IFH1+wcinOe+AK4yhfhykoikJm3E5IhoPWLH5ipxJg2h/X8+O8J3+RAvwpNj/qdYlBpqgS5Ng== X-Received: by 2002:a5d:47a9:0:b0:38d:d9e4:9ba0 with SMTP id ffacd0b85a97d-38dd9e49cccmr8900314f8f.25.1739275303239; Tue, 11 Feb 2025 04:01:43 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:42 -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 v5 03/10] tools/net/ynl: support rendering C array members to strings Date: Tue, 11 Feb 2025 12:01:20 +0000 Message-ID: <20250211120127.84858-4-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969604 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 76BEF1FC7F5; Tue, 11 Feb 2025 12:01:46 +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=1739275308; cv=none; b=FaQUGQfhffU4OFaNCTO4IKOxb/I/37UafS2R8MkiuqAfWkB5tlINANp/JRmn0mPCn3x55lwLjCUbxWh1c2zXDfd9bQcsZb72Gks+N3sDAaqfBa8VT32OwOquhXHhUmwwDNgIPrJ5KZdumts8Gedhjx0rJKJJyeHRHmaUs20PLYo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275308; c=relaxed/simple; bh=2jUrTZQQF/dY1/oZi8TPJgdOAi32V8LU2q9+yZHMlR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=n5FlpElOmYyPfgQimJ+JdU8n+zxifjX55fQ4P83FemMq8XwB5FrE0zRWf0wJZ0YHfsOy2F7HBzhwUMGrX4lmqcpQilYAoqucebDytuj1aLzgWgMFnzRbM9dwzWrdwnxBC8kxjoMZzi4lsoCX6HWmzcHBDkewkr8MRfAi6luN34Q= 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=k1kcC7oz; 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="k1kcC7oz" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-43946b5920cso12637105e9.1; Tue, 11 Feb 2025 04:01:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275304; x=1739880104; 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=k1kcC7ozXiBI1m7YBgLAv1yPB94pCwNnlq8WLz+rALN+5K0OZipEgAeelz6L33TEth +xF5uoKTjInEGYXBbtHvt5PNvLEhusGvBVzK/efEQQvt4w0kaI0OgpXdwmqVOiiESGKx 2//4oZSvgDnAlpOab+KU02TwdrsJN8njcuiezuKeUYy+KHKI+/H4i3711jlvq4V0KVAy KvItCgQpk/83CguvcvV3rczp7J7cC+zJj36LpL2T2cEs6wqV4khyMIrt8rV3Rbl3X8o3 tByjRzkd8owqPSPvQx6fOCdDjIowm6U+ImearHhsw+iTqeh0Xdze90HnDRM+fFwlm2iG ygNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275304; x=1739880104; 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=o7LoloJ7S6Cl++hu0dlGvRSrfTVQc//6mNScakOKWHeP2VjampwUJnx/Kyq0OjLZSA dJnP3625cWuGF5basGfrtxv1W/u2EXhRC/n4Q/14Ncyhi+dxzIOvhX6dP/kTMT4SiZPZ yqm/D7VP1RvgGGofqtNuhaOmBGzLPho5s7htF4S1pMZLMATJFJaPyfhnPsd+iKVLScrf mYrraORq/QiOOuQI0+za2cSq5fpWCctMm+KmBPbwqZX480UbaXbwdPTp7TeXwPFayfYz spslI+P6FwKd3SyKD1+VS7a22JsrJUgNWUB1gyeg01xE3qnnBXJ2zt73wWD/z9i+UEt2 CzmA== X-Forwarded-Encrypted: i=1; AJvYcCXK897q8wd3LbHLFGJW4fwRle1lYPWf6xs2k//kK0AQNEEECcwdbLrzl9SoMtv7PCCIRq19Kab7eAxfMc6HRg==@vger.kernel.org X-Gm-Message-State: AOJu0YznMpHMq8seoPbSkMuWCo+tPuMdlZuhsDH5Qmmm15i2ohWsu+6O flcT3pCoN0mVwn0K/IURjj/wtsLDRFYUAKvFqFlpkYLP8wIQSthh8WwgTg== X-Gm-Gg: ASbGncvRMSShOoFpSFiEHlarz2J2xlmA3JcgFWP5OV/kQFUO3cH+OhzqEBnX+1pczdu fR49qQxMbDfktBjY1WHfYHl3nue6a3qfHgsfPjaYybXnZpbUTVMcNFCuif43IRnuLgD7HhohQU+ eSrVECG7/qNgChRTZW3Pc+nu44hkAfGnU62mfJXccOvwrFJIQAf8LHitLRb6ax6I0gFQOgubL08 i1Vng7wsHG8QTzXfG9Q636UsgqVNWEy0Ogrp7Ut4i1vHrCsbhs56cyR7FuQF4YC5WFjxokKzti+ dVq0CPdbAeCSTWemIkHhN7W3paNkwv6duQ== X-Google-Smtp-Source: AGHT+IFAVvqmkoySfCHtxyiM9FO/O/CnlCZxtZp8+dic/TRxQf0xsFe9RzZg1RxJFXpNO6c0Wke7dA== X-Received: by 2002:a05:600c:3593:b0:439:54f2:70c4 with SMTP id 5b1f17b1804b1-43954f27235mr15647845e9.9.1739275304285; Tue, 11 Feb 2025 04:01:44 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:43 -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 v5 04/10] tools/net/ynl: accept IP string inputs Date: Tue, 11 Feb 2025 12:01:21 +0000 Message-ID: <20250211120127.84858-5-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969605 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 6A6A01FAC3B; Tue, 11 Feb 2025 12:01:47 +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=1739275309; cv=none; b=i7fVmCAm34685F/+IQ3nbjsYf2Idunn03DJytXjTKZZdHeKXIUAbz0SYxG+iUj5FO50eZaxX6ixr8NIsBIOMAE/1yexyoSwlK2yxNJ9kQi2CkIPxQSyEoFJoFfOgcGdbkJ5hjkdXNyb4yPkfJ7HmeWPCu3tWSYDSValAYhfA1Pg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275309; c=relaxed/simple; bh=X9eINYij1abDhQD4o22GKAwE4z5ZgnCtWo5oJ7CpFNA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZLlH/vfdSy6+7fZyrfKEUnjj+maBebRVosZd3yMriStrCUxfCHd79LG5fDaZH8RTgJ3SxFKifFJkFYwVuq6cPk3JNAzbqcvKMqqtISslcSOVSZdZqQ4LZZNoXMm7TEJCVOnv/YEwQHYJX4g+bRUJX+7iJtovzHMe2g9G+azpIrU= 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=BKOO4ioG; 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="BKOO4ioG" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4394345e4d5so15431795e9.0; Tue, 11 Feb 2025 04:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275305; x=1739880105; 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=BKOO4ioGzyvt87z9XjhdPWF5DvJTmfWbvOO6BifuC/5494UJ7yyxwfD5+Reo2GGlNO VFD4DJcffw8KDh0/fFdTdR95FBvSbX4ebbkHUCbEaNWMKbhIe8QZTUaDHLDydaOrF9N1 8/as6rRzLo3GJAg4f5R+kf1jafQuaV6w8bPH7XNv/A+6qrA72cIh+sRHpBqDUZX4Pifu sGk4sYDfl09y3pithTnqZedY2aqvY+hk69ubclWDapqbHUKlr+2c57TfjsTntCCw1Llq vg2FZmqspqaE3WI5rvaoHLYtrd7GsAk6QAw2xxs/IfLMpy2/kCqjHyv3RGGGw4/QnJe1 3UbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275305; x=1739880105; 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=t5H3umaMVd75YdmPcX9h6G4jpVvfuaT+x0io5mWnhKcnZM/LfBefZSN8IIw9gqvIkV A6ldEADhNf0Sen+zr7lbKZ241CXk7UVr393guPXz5rGqLeNUlfWAlp/hYLjKdlAsQjsr VU3Dfd5njbu77FSKqBTooP+s1BNPc0+ZjTENTXgqPN44sAx9uBzHR3ouD0APEylVwHOc cK98T1KWU+Mynr6mPMh61B+NiIXybx0L6tHrvCYs1Xqz+G9Umio44VUc6mSeXrLcM/RU eyCUQEZjk6soKAroboJVvTwaWq38e7DfRn+IoYGrWzAJDXgjAlatWp3PF6MpdplR5zdO WHhA== X-Forwarded-Encrypted: i=1; AJvYcCV08+YG1z/pPwrcMPWtdmh0Ej95l9c/yGj7rSCM7JbqNdSPqcgB2/J4iHBE7jabXy0HZep7uW5e/fpVdHbPAw==@vger.kernel.org X-Gm-Message-State: AOJu0YwLkH3XGoV4Y8Y3lw3jLe8iZNz6W8quaCsFuD4gu8iNiyRfdXdg ves//O0zD+eSNO6ODIEIx4CUBs4RDcZaggMg6zXez5gXqo4SettF04adHw== X-Gm-Gg: ASbGncssPUcxVc/ixv23PiRdzDLNEH0TEh2PFI0RqsncTs5i+sEhaqEJr+KBLlo5Iiq WdgSWeDK/SvaRHjHIaCwJwGW3kVyVa9DfJv0QpkUcSx0/dXv0S0uonW6/2kKDer4YAC8milQubS mxW9TN5+OWSjJwYIgv91ymJey6m+hUtQcWTntj6VX/Gp7CBJu8a3UzhQV+JizULSu05k9eK13LR vymPUzXVSJo1bLIqeUiKEvuUN/ThjIwzQB2REMsVv5oH69JVMqhhJMCMPXEQnnvx0sVZHn8LMz4 26v+IXdGKmA+JHw7G5pa4s/DvXHzq00y3Q== X-Google-Smtp-Source: AGHT+IGs8lV7qlxTvOWv7qiI4peYrnEgyMDaAYVrmBbNIP1y2YGvlGBA1jLheec5QHZSHTjEvHCJ0w== X-Received: by 2002:a05:600c:450b:b0:439:4a9d:aecf with SMTP id 5b1f17b1804b1-4394a9db33bmr40246325e9.25.1739275305393; Tue, 11 Feb 2025 04:01:45 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:44 -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 v5 05/10] tools/net/ynl: add s8, s16 to valid scalars in ynl-gen-c Date: Tue, 11 Feb 2025 12:01:22 +0000 Message-ID: <20250211120127.84858-6-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969606 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.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 D3F6A211472; Tue, 11 Feb 2025 12:01:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275310; cv=none; b=Sl1RFDH3P8jSJZIjni9ZLZhBAEkg7dVFNnKHUosHoYlSygoEU6SpuD7VdA2v84jc8H7zSCd1XinJao6tAiWbJMGRnhTyy9na7d469NwxSco5gCD6aoE5ibdwukq/U8DRrxFHQs9juqhnj/BwM3EN8zuzRn+G9p+QqvCbcFa8t1s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275310; c=relaxed/simple; bh=mqg6oVlWZ9lRgDBEDIBhvqT0sf/xJPxaAUpGR6KqHlQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KaPANHFnnRBpywLdzSMbc56uw32U0GzCyKoeWfBj8ATgqqM69P76M8BTIIAs4ha2VviQ1IPtFQtEfR6MlV9s53pHKoiGD5YQuzaWXF3Us7YqfWrOvb+awtI2BFlJyuemV54FMmSWmJPnOOD0eW/fmRP12hg6BFNRc7cAmGKpRXE= 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=LmAVMfCT; arc=none smtp.client-ip=209.85.128.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="LmAVMfCT" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso37753415e9.3; Tue, 11 Feb 2025 04:01:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275307; x=1739880107; 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=LmAVMfCTVfShh6cGkH5XTwKz5t+TKA+rdMqTPw9a8/vwKAF964NnDLLWaLG36cYDLw GiTwwkQmtHR8POTDYRMiZDPzmMObEVt4nYkKbOhqkmRMbcArTCgavotWIgp4SoX6/c/G 0qdVav238ldWXzAGG3jB/8n06GnepRkkAkR8pwHssa1mUIVxk8woyuUHIynxgDxUAxhs SwXXLXt9PvvR1P4xoG2C1LXepdco5F6IRxJ9MDUm/jXWumfyb3yo3Q+Q7T7VpwNkBTv/ cTWqrfjDwLZOb8NJ9OTwAeMeYKPVS3dbr9mRJ5bO8jG01kxzWOHM49DIuSpFzbfm6KQl kfPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275307; x=1739880107; 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=VCk4j5hOsfItzpLmzktPj9hEpapiiG9ExFjzOy9aoIXInYj4eSmE7zAdQU5KPidlcs i4qrWcZfqOoH2BbNxapoY+lYrgspNraxpHN5vEaGecq/BwWtZHR3J3lo6ZiJEftzLDW3 7rcqor+WZuXWZZuRPz8T11JEyijEbkOnn2LMahEpYAd4sKeSGOQBu1VpXVHp0P+vcyA+ XAeVGkyKVzxwjdHgjkBebk4AHWUmanEAh5Ua+CO7kwW86pkusEVjt/JP/GR/dpZtrTSU zchgsAxYktGfL6UiVvou473VNwnCg+ausYf2oJiG6ih6JnJFv47bN3IznEJem4Rzf9UF /BUg== X-Forwarded-Encrypted: i=1; AJvYcCV87n9SlXBlIAiT9wejL/YfLx1xM2/Ll8v8WtAGneS1n7WOtBOmwTgrzgGlD9iN0lIS5MTSARV9mMhpDmZEyQ==@vger.kernel.org X-Gm-Message-State: AOJu0YxS8j5bo4xFazC0/+QtO/LKEndRIztXoXIsdfGMrTtKYEJKOaHn tk6gsgpp2DY2Z6Gbi/CHeeycjjMtOkYtg4A11ADEuSRxbH4nbaXI3U3BHQ== X-Gm-Gg: ASbGnct0lblg26RACCUVnQq5glKqJsau+3K0Ie/0MtfqucF3HUw9WGze/ffpnxnRLwb VwFU23oIQvVm4IKdBHURZMEtJDc3M0HdBIytVn4g9VVaiRIYE0JoUhG9EDEmZVmVspBDCWtZJ1P MSQCNi3Kce841donatRZILQSnOiIwjPpwPjl2yVdgqWQ5mi7w0ord3MrmGEJGuRRhMvET35KF33 gNYEbW7uRazO8NpcCQWekIw5YyvmwWHB1uTgaY5XS4BBY23LfI47/uf0T9XVm48rK4Wz9G/AA7R qtmnQyHOmzRdjbDf6OdcHmQ1Rm9RcYW/4Q== X-Google-Smtp-Source: AGHT+IF5ED8LUt8ksZHcsMG+E4ylaFj53X2mAYHM8w/ij6R7iGPxS0orLl7Yc80u7oxaEdy2AmDDEg== X-Received: by 2002:a05:600c:a0d:b0:439:4355:2f69 with SMTP id 5b1f17b1804b1-4394355322dmr77987615e9.6.1739275306586; Tue, 11 Feb 2025 04:01:46 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:45 -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 v5 06/10] tools/net/ynl: sanitise enums with leading digits in ynl-gen-c Date: Tue, 11 Feb 2025 12:01:23 +0000 Message-ID: <20250211120127.84858-7-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969607 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.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 EBFD31FA14B; Tue, 11 Feb 2025 12:01:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275311; cv=none; b=hKANBTpGevZf0QwmvCsZJLw6DrarvQy/xlmvTdBERdTex9hWzPAV/r9QaKZpiSL/2Yhl0Zi8v9jTRdmDuRWWxG/Lsbhsh3196vbmZ2f8MdQit483N+oo5GaKGGn4aMKq7i+8bGIduIgWV4i8JipfqFPG2VCK2Ea5Mq/E9BsuwNU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275311; c=relaxed/simple; bh=LQz/+A9c7Ho+lyWQrdtZ+ix0f8k72Xj8v4u62NQ7h/k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=c7ukE97uykRCJSyxknYy/6PgkjOAdRye5tWegGXnosAFmkrakSjPIumK5uCLqtvDTJstoUniPu5QFYpgPDWq5OS18AWPGArrHYRAdqsnP8d6ngU/fKLaMqpQpONJ4rt7n0Ke8Py5PAOVzh15vYGLokZ7YLnYkVepgpKK+wxGiow= 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=IDJr9eAx; arc=none smtp.client-ip=209.85.221.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="IDJr9eAx" Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-38dcae0d6dcso2346047f8f.1; Tue, 11 Feb 2025 04:01:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275308; x=1739880108; 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=IDJr9eAxlMo+HcSifUGM3IDmSemLkJ93jpCmVzlKbwO1YCywegR47hzKL4YLmZ+H04 vNJyWEAva7N6ZgZcNkPih7zCWuqnuOtD1xCB2LNb8O5lPeXfuCDf9uj+nn9cXxupCKfZ qXn5ZkvdzQJXW91iP3j9jvv+JsirEmp0jtZyrdrr5oGITq28YDmv8a7SQimr+44p+3Ij /vkmk9FivWcRlrBBJB1c8daNL9S9vgGwpTTNY21BcVF7nR9MWiWfG1bgNSeTUm1Tmo+O 3gDak/svwwWiqXRMeBaNVYS9S5IuhPQ9ZjTmxyry4DRfWhNk56J6MKejTLbbh8zUUYhN OfUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275308; x=1739880108; 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=DCa0ZlbwmEhHPtlHx1bwTq5y003xy46OXX3dCZ4I5TvTMTfpdDpp47+kf2hWN58D8Z 6KqgmFZBR5tQW/p3NhWRt2P44ivrE2F3847G1XKioMjbNjrjhjj8Fhj6xanUve7MC79I l0zeZG1O+XZaISxhbIbQf1dD7Qx0T3e9qczbIyW+0Vtn15Z6vRNPC+b1bMNWoNnah1t9 8i2QmM8MYX41I3EDDkWDzmjHlt0WJFikaoMR0JcR1MFKJSOdhLaBamsTA/7CNPz4Gv4L OoRASb89MLwtdrSqclbZg22FdYPhrWmx09gc8coK1HNXISA4l7exePPMssrLyJthv5GN WJMA== X-Forwarded-Encrypted: i=1; AJvYcCVdU3CNWIHw5ydirB3PmXN9uRl7ai6UsxobDSD4rg5V/LKy/j2TexT+1NE34QMw3FuLGQWBohaOruqnLQK3UQ==@vger.kernel.org X-Gm-Message-State: AOJu0YzZlbX1e45TIjuRJU2TFm8ifiiZxKZjSOdXyY0oxdsTknencRU6 2/BCTD+sxuHS3y5NMn3aXmY0cxWYrFHcO7nm6utO4mzO3B7PiqTbCFn0VQ== X-Gm-Gg: ASbGncv2KOABCtjHqOYZHNUWuMRoIW399pYbvbXSS1ZkVVU0V4BUZFJBWgtJr0dtolY EXRnTmheLbFoypiW0/Ikth+LUCWLMJYGpe3mN4hVosZ1aBz1RT9D7fDJ9Kwzb9Y1caFSsd4X2O1 erq69v/Ve8Rh/6ia3JIousffgHYIQUQufrWjrhBdx9SJC615ZiKS6uw2yf2aMzoXInBNOg/6pQ+ Ovi4yGxBgpSiZPn6Tb9QkRQrc4Nyxvt7tNfCuvcVsbFvBjGPRjC3OwPeqyKhsO/TMGyS2O3ouL0 X2FUlbq5HqVF4mOPi5YhZhafN0EwglrbEA== X-Google-Smtp-Source: AGHT+IFdbe/RWCZlGMsp83KMtKL6ldVm3MVZKs8DhYoQ6yB5uerkkz5DqDykDYCZSpmY+dbsiJYJnQ== X-Received: by 2002:a05:6000:1865:b0:38d:bf57:f371 with SMTP id ffacd0b85a97d-38dc9373270mr15098116f8f.48.1739275307683; Tue, 11 Feb 2025 04:01:47 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:47 -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 v5 07/10] tools/net/ynl: add indexed-array scalar support to ynl-gen-c Date: Tue, 11 Feb 2025 12:01:24 +0000 Message-ID: <20250211120127.84858-8-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:25 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969608 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.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 E170321A424; Tue, 11 Feb 2025 12:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275312; cv=none; b=BOfBkCVhjVtjCS58g85w8P69X7CEHgWuVvN9+wzsrWd/ngL0+nEDK2OcgV1Ih7VGNshq7gmQbw0BoAlr6nev/Ybw3hAqdNGSku3yOghrSE6GeKddP4PWaiXR7QMyYWLlev9y13Q49ScHaHPJhl35Vhoemr+744IbqhA7PRmxuHk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275312; c=relaxed/simple; bh=Ap1q4LgkrLbGyYRLWcKtA1t6kyY/N7ouDJbyAdy3y1c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RYfqnKhSXxiQwGbK1AZrzNnrKSBL7VSkTZpNaI1uEobnP2xf6Zkuvz7kHRaNnwGsWFmlwpqeuRhVP55Eff7L0PuIktw0WjuZu3naMPnJ8bT7zhk85TPq47UnzOPqqYB6iPxH5XdkJaF5AMrAsRQa509W1Uv7dgBbiC3qyWKUuMM= 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=UB2qmMx1; arc=none smtp.client-ip=209.85.221.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="UB2qmMx1" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-38dd91c313bso1431242f8f.3; Tue, 11 Feb 2025 04:01:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275309; x=1739880109; 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=UB2qmMx1Vboi6B/MlebjV5Fw5lbXfxS6t9P12rl5VqgNbWXLrO0AI7+uMshNTBX/2A F0tFQx8kAszdHbxIP+yzVlfNMxzZv4RoaURtvmkOOC0VV9QEYFcfjk8LcK78TxC2lTg2 hiyme57GzVVZgml1GPcpKsnIpS8u7p9aQwmxOgy5cewyThCvoQmfz+IySERubmjHThsL jaCm4wRt9aqdmQKvO+fHBQBko2InuDhccHppgEuX29g0+LKyB0yrZEAljoLNWkKtvxLQ Ha/W0YpxAyb/8Tvr2w9+ZMI4R3WOnQf89sBZi2j8a2H4mXrSGhYZsiHhfSnlm4G9s3qF UQvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275309; x=1739880109; 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=Fc9D9dn+TccAnHCm+PApnndxhTyncIPRGuYpWC3EMLhWwRPJ5CchraWxN4iczrTUPe U50yOc2TG1nyc8y6CzzR2yAurgw9SAAjUCn4MTOmtdefEECLI62Df4FSNYh0h6ntFblf bPvPxag3VVd5WqSeYH0OBFeXOnZ2BGct38V6ozM1PEcy4HEuJWRQJa6XXt0W7Ts6iaij TIfGR2Npz7pm9cKflVuDNA69c4/ER0D0cFEBIwHbZrPFdfbgJ2fdycVvfHH+IJ20PppW 72nxNSQk3eikkaKYjrhNv8ytrI73RPhIDHe72JQf6/OYCeD8Wptcr8Qv/Hz2fBW4xeW5 dPyg== X-Forwarded-Encrypted: i=1; AJvYcCXCCptEDPXr+ULPJYRq0VJi4S/hsEWuME1Mh96rQw3tiPxupkSiWWewc4C/AsfFHgpxMVhX5Jpqx0gFT75BNg==@vger.kernel.org X-Gm-Message-State: AOJu0YxIfLDCr/oZeTtxgCwKlWfA1BsCPSVrkEaLkcso364xkIYB8Nwl ppx6hmE4CkWjSMoXE6gq3LH8lnfSPDqedTChtUlLEFiltQgSTSRXsheXdg== X-Gm-Gg: ASbGnctY7bt3KGSWP0/OXiufa3Bh+izn5PhoaUBvKpKtTqVKWsmAjUIFJhhfc7pQIuw 6SdlxZxPclWA6xRRJwRDxsFE79SAVTo3h9ZYhP5Aeci4WahRVPRhZv69gs7Gxm2qr/cHJBiEk7D kP3zqM1gFmX7TQfA4WXbtuan1uUZnMlBmP+mZ1WnM7JIes+/3LU15B0W9kaj2SdEZKU8CZtfopK 3y0BHDf6Sf+2OPs+U931z9JCwWycxVM126qvunkH05YhYTqALAqdadxcCI52pxPu4DdUMljS/Zm MUVoXkCOMUE5Ac1s1djnrmsUMtc4UJLjJg== X-Google-Smtp-Source: AGHT+IGoxsW7NNJKPkOMXlVtFVClrvSB7fBX6qtHIsoTsQ7Fc16KZ+dBnpUEqaz2LtZmEkVproYa7Q== X-Received: by 2002:a05:6000:1862:b0:38d:de34:32ed with SMTP id ffacd0b85a97d-38de41be586mr2862212f8f.34.1739275308848; Tue, 11 Feb 2025 04:01:48 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:48 -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 v5 08/10] netlink: specs: support nested structs in genetlink legacy Date: Tue, 11 Feb 2025 12:01:25 +0000 Message-ID: <20250211120127.84858-9-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969609 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.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 0C91521D5A7; Tue, 11 Feb 2025 12:01:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275313; cv=none; b=dKlH3Gxi4BjTRi09bOAf7t4HQ+telfBFL7Ga3qs9BICmCUuJ2XZMzX9rtFkkHgY91Qtc3mkpnW1iEWd+bDVaEh0+Dca9DDCyiePd7Ab3IKwhsCe6DVB3dUI6BgMYnKfYwugfJFWIX1Ey8Nf3N/tBQNF03XR2uqN0iqCcoP+lGXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275313; c=relaxed/simple; bh=hngH+nkRM+69V8gMEYAXSayqQbNSU/kvsOcQdYK01ko=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k/qKTTyImMiIYDX3Nxpzhe886Njn84BJGzTbSK27ouncREFibcQbS3Zx49C7HMI4PWeT3tq6MX4ks6RRSDUq5pmbTIAvRkXUcseAcsKErvSarUYRN73zMARsQxNC2DiT1dr4PZFQXNhGtRqn+dt63jXyMZp1IYSywQ6kNGCxer8= 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=B4zDk/jr; arc=none smtp.client-ip=209.85.221.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="B4zDk/jr" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-38dc6d9b292so2292094f8f.2; Tue, 11 Feb 2025 04:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275310; x=1739880110; 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=B4zDk/jrwUlW8ZyUpy+1kY0qG2nTiZlexVTkXnAPfAriCgs3UQbWsbKPEAKa8kSnRP Bqb98YkVQbYtAD78aCK0w2VU701DvuXHHjM+uxkHgFq4REbJmqCy8o31+OgbQcKT1SZs bI7ItRTB1hgKuEnvUj7VIEpH0cxF8ycz1G+s0BX1lXxn13O+zl6Sf5zPg0/9kDIj30FP 0BdSrWkRMIUpa4OqdSdeQS9BBk4rGxTXKFkagxITzLxRhEQoA7baONebi7PCmQEgswii d6Iu7JVzrsUiOxnaMkjaLmMx/sOqarS/h4YbZ8NoEuJ01cFWMWDMyVc7bVzcWx1mXYzt 55bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275310; x=1739880110; 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=lPO2EQIUIkFS1spQEVQyk6m1GPCQLX2bhHqucIRDUCo2+aykmpar0Kir3zppNidvov 4OpZa2DkxSASSmCLAXB4ML89q6O7cxTXCVU+5UdSYjsLdlDWTfJYf+KuxtYwG1SjI5n6 gOo/kCr/nAEsPM8z4+Q0MfBL8C+ClCAFzYesQHvtjliiKKkRxZUbOqbWMSZWsxB3sRAC Z9i1H7biPUfGwTvqmHnag7M6hcx6bVCOCusPSjSVOtf6QpZnFo2NRnswOUz9HcSscYOW qAQZ1zeoaFYJH7f2eOuIQISwu1OZ17SgRiQXIue7DQYjtEOKpwNN4zN/AUeQI23J0he9 XRTA== X-Forwarded-Encrypted: i=1; AJvYcCUF+40h9iXw+qr6wYCPBnbZ/qlsInnDk6EOMGrR9SIzdNNPjI7B7VQwgJF+qfpPYwb9Py9d3CDmtXrEOitG+A==@vger.kernel.org X-Gm-Message-State: AOJu0Yxn/QYHDhIzRbvkFBOZJHZFe3te3AKLDpS1GHDqpJpt+xuwlC70 NDS1okXymqXEauPfkS7ID4O+2zAbN/4wg6wge8SxesitmN3FsjmAkubXuw== X-Gm-Gg: ASbGncvXO6w03S4kpJIK3yXMoUq4MmnDCfVMW+bN36aM0U17AQDC8gZdD+gOUHKeobs bEzbq2TtVUYcnn6cL1JB4mH84fhkmnyZWoLnMAUxBVLycBJb+U8xhKGe4NGY9qchjCUKHv/08Kv HSP3A9ZFl7Ntg1oAl+Xv7lB3PjC7hW3tNaBzkW7QkZb3g5LoFToOYb8G6/vQA77nHT5hkQufwRB WW0UZIZwFwk67V8SFiSa/qbA1Dwe0197tbpxzM7lzvLOzbjaRAFBCvzHVKFSRKEF1fkFCo/8chW DOpa2UgJAZOYsaijnL7VNXLP3+jFXvtA5A== X-Google-Smtp-Source: AGHT+IFl7qxo+QvC/sZKDIPHcPXMj4RoHPI+XMMI3LS7mw9RUxqCFTTOF3580dlJbdybp4/K9r4k2Q== X-Received: by 2002:a5d:59ae:0:b0:38d:d8e0:a9a1 with SMTP id ffacd0b85a97d-38de419486amr2914863f8f.29.1739275309962; Tue, 11 Feb 2025 04:01:49 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:49 -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 v5 09/10] netlink: specs: add s8, s16 to genetlink schemas Date: Tue, 11 Feb 2025 12:01:26 +0000 Message-ID: <20250211120127.84858-10-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Tue Feb 11 12:01:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Donald Hunter X-Patchwork-Id: 13969610 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.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 0A5BB2206B5; Tue, 11 Feb 2025 12:01:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275317; cv=none; b=VhHX2tF50wHHbQcvqmeMJHcRQRrFeDSJiv3IKFq8FbRmzlm2+K1pn1QiEqS4MBlsvR8q0/NaQg3kmzHe+/gh4chRKUmGqtN1gx3hSwH8xFOSvbFcvosEuvlfic2d7Vg5/UmU9Qg8LepT0Yu5fgBZTJOWgKLNfCHcFOMkHQcGQ2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739275317; c=relaxed/simple; bh=5h3d+hDFZgiBzzKkkNO3eYJz7i3ksjWKPp/oakZoF7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R414mJHsni0c7GEcRJAXHF2kjaFrFteL755L+uqypD+tDAC3Cp00IdjRym8i8k9X6Ayo9vU8HCPtGKX0tWF+MsKhsmhj1crmzvYdMRXYjZXl+GLua9UsAwNmJdZkuEMFZmGI2jMUXrOmfx9ZRxKvHw55xkZBpFRBtZSKW9LByYc= 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=jooJYfwC; arc=none smtp.client-ip=209.85.221.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="jooJYfwC" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-38dc9eba8a1so3428798f8f.1; Tue, 11 Feb 2025 04:01:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739275312; x=1739880112; 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=cR78AkxIa2Az7+jLUIlRk9lQTkKC8dZbc8Nu2FqeNnc=; b=jooJYfwCU8bpOo/COtCslTJj0nEi01kSH0iZaZ6rqSsqMBDjY0eD52FIQd++OUUeSe k4DAa66K4nLyZ+5/gI0fU+f2Qn40TEzpdqzUmdvXIOlBwHexq+bCzYz696VuSpnBGoEz pZ/XY6EByJNB/6AE6nowRiXDxgP/T/96rZ6GzHy2evXLqr2c13Y1uhncUa4SAwoUOR1k izgQBQljG1YHtRZDRv64TeYcCqKMk6iIY15pD9jq4lRJk++xOcVYbkylqQ+8oQfjA9rc lEo4LAhEpZrB5trF1kdfexQSfcHz/YilQGwpe77PeNOdrYDXtqtl9a7JxeFnS4dLfhxv kR4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739275312; x=1739880112; 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=cR78AkxIa2Az7+jLUIlRk9lQTkKC8dZbc8Nu2FqeNnc=; b=OeShEM3MEhxsf4isVJdHYpL/c8blg9FG7n8YM23rXd0hnqUFpxad0LZhvv2MjEOo1C bXCy195ncah2fyVN7wx1ZnFE3A3RwPSltmsBCb0oyJvFG6/oSafmCH9dU7Etp1JNXcVl JlFoe8akT8x+hXG/uRGAhaP5BZzfR/J4xyoNWImpbHs3i2IdXtQG3I5lTpSSiKL9hYpT iwO+kwmJ3x85evDhAFbyZfEOGwC4NoWu0WzDgXy6FXIjTjw5PiZsgxxYNpbUAVOwmLmH SAPVYufVZEIh+7peRn2mWHjgh6LugceSInuxU7S9okmVPhRvzVOufeVP91SGLwiuDQLF KW7w== X-Forwarded-Encrypted: i=1; AJvYcCUbVmKV9bk8Js1whRt//WSr1NOsZM80H6RbcWg1NFKkackZ8dkuuQ0cL3HSKqMJvH/ZCkqwRttHAZsL/LBdRA==@vger.kernel.org X-Gm-Message-State: AOJu0YxV89J6NQeQMndgqoRiO99KYDeXB7+7ssJzS+X+20VSpIRiIY1V U3N9TwbjcpuvMwQouMBLjR4G2Z0T1bxSRagApBQT6SxjspSaKGeb7aziEQ== X-Gm-Gg: ASbGnctLM8DJtisy57c/4Y/acsoVkoh2JHBklW+qvsq7BoTQrTJJSoCWJpe474SoYE0 qRZk70zrbvAbZLXNb2jqLjw6MKFAlKp6BRUYpcw2H0UG8O+GyYaTo0CqSfGBa3+08QiuofoVH+2 rihoIWQ31WwIiyC6uYvC5rCLXJaZAIlDgwwhsqtIoH5CMNb8to9sIZMXzkMCx/DKfmWbldyXya0 Zd4RP9T+b4GciH+IBMw/AEDhHlI3Iggn5yv9sCKsAjhl1dbFzajWjAInGkPhzkLpPBG3bafpkVf 9nPulq34v5o0YbcVD8xPNAPfdbLhcVe+xQ== X-Google-Smtp-Source: AGHT+IHSCYuAx911i65Wa/bhjFfYraBmUr0//nvn3VkY/9Q6cMRGNt29yeI/+/J71dDcXnpLJqM1zQ== X-Received: by 2002:a5d:6da8:0:b0:38d:e57e:d21 with SMTP id ffacd0b85a97d-38de57e0e7dmr1750312f8f.30.1739275311340; Tue, 11 Feb 2025 04:01:51 -0800 (PST) Received: from imac.lan ([2a02:8010:60a0:0:ac07:4372:f96c:546e]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38dc933ff9fsm12466658f8f.96.2025.02.11.04.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2025 04:01:50 -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 v5 10/10] netlink: specs: wireless: add a spec for nl80211 Date: Tue, 11 Feb 2025 12:01:27 +0000 Message-ID: <20250211120127.84858-11-donald.hunter@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250211120127.84858-1-donald.hunter@gmail.com> References: <20250211120127.84858-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 Acked-by: Johannes Berg --- 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..1ec49c3562cd --- /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: iftype-attrs + - + name: rx-frame-types + type: nest + nested-attributes: 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: 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)