dfa464b4 | 14-Apr-2025 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl-gen: move local vars after the opening bracket
The "function writing helper" tries to put local variables between prototype and the opening bracket. Clearly wrong, but up until now nothin
tools: ynl-gen: move local vars after the opening bracket
The "function writing helper" tries to put local variables between prototype and the opening bracket. Clearly wrong, but up until now nothing actually uses it to write local vars so it wasn't noticed.
Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20250414211851.602096-3-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
882e7b13 | 10-Apr-2025 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl-gen: use family c-name in notifications
Family names may include dashes. Fix notification handling code gen to the c-compatible name.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
tools: ynl-gen: use family c-name in notifications
Family names may include dashes. Fix notification handling code gen to the c-compatible name.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250410014658.782120-12-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
e8025e72 | 10-Apr-2025 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl-gen: consider dump ops without a do "type-consistent"
If the type for the response to do and dump are the same we don't generate it twice. This is called "type_consistent" in the generato
tools: ynl-gen: consider dump ops without a do "type-consistent"
If the type for the response to do and dump are the same we don't generate it twice. This is called "type_consistent" in the generator. Consider operations which only have dump to also be consistent. This removes unnecessary "_dump" from the names. There's a number of GET ops in classic Netlink which only have dump handlers.
Make sure we output the "onesided" types, normally if the type is consistent we only output it when we render the do structures.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20250410014658.782120-11-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
7e8ba0c7 | 10-Apr-2025 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl: don't use genlmsghdr in classic netlink
Make sure the codegen calls the right YNL lib helper to start the request based on family type. Classic netlink request must not include the genl
tools: ynl: don't use genlmsghdr in classic netlink
Make sure the codegen calls the right YNL lib helper to start the request based on family type. Classic netlink request must not include the genl header.
Conversely don't expect genl headers in the responses.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Reviewed-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250410014658.782120-10-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
e0a7903c | 10-Apr-2025 |
Jakub Kicinski <kuba@kernel.org> |
tools: ynl-gen: don't consider requests with fixed hdr empty
C codegen skips generating the structs if request/reply has no attrs. In such cases the request op takes no argument and return int (rath
tools: ynl-gen: don't consider requests with fixed hdr empty
C codegen skips generating the structs if request/reply has no attrs. In such cases the request op takes no argument and return int (rather than response struct). In case of classic netlink a lot of information gets passed using the fixed struct, however, so adjust the logic to consider a request empty only if it has no attrs _and_ no fixed struct.
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Link: https://patch.msgid.link/20250410014658.782120-9-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
9fcfc1e2 | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: add indexed-array scalar support to ynl-gen-c
Extend ynl-gen-c.py with support for indexed-array that has a scalar sub-type.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Li
tools/net/ynl: add indexed-array scalar support to ynl-gen-c
Extend ynl-gen-c.py with support for indexed-array that has a scalar sub-type.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-8-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
16cd1a52 | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: sanitise enums with leading digits in ynl-gen-c
Turn attribute names with leading digits into valid C names by prepending an underscore, e.g. 5ghz -> _5ghz
Signed-off-by: Donald Hunt
tools/net/ynl: sanitise enums with leading digits in ynl-gen-c
Turn attribute names with leading digits into valid C names by prepending an underscore, e.g. 5ghz -> _5ghz
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-7-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
8798892b | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: add s8, s16 to valid scalars in ynl-gen-c
Add the missing s8 and s16 scalar types to the list of recognised scalars in ynl-gen-c.
Signed-off-by: Donald Hunter <donald.hunter@gmail.co
tools/net/ynl: add s8, s16 to valid scalars in ynl-gen-c
Add the missing s8 and s16 scalar types to the list of recognised scalars in ynl-gen-c.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-6-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
c578bc3a | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: accept IP string inputs
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
tools/net/ynl: accept IP string inputs
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 <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-5-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
569a5d63 | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: support rendering C array members to strings
The nl80211 family encodes the list of supported ciphers as a C array of u32 values. Add support for translating arrays of scalars into st
tools/net/ynl: support rendering C array members to strings
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 <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-4-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
678d8ddd | 11-Feb-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: support decoding indexed arrays as enums
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
tools/net/ynl: support decoding indexed arrays as enums
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 <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250211120127.84858-3-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|
b1b62d6d | 11-Jan-2025 |
Donald Hunter <donald.hunter@gmail.com> |
tools/net/ynl: ethtool: support spec load from install location
Replace hard-coded paths for spec and schema with lookup functions so that ethtool.py will work in-tree or when installed.
Signed-off
tools/net/ynl: ethtool: support spec load from install location
Replace hard-coded paths for spec and schema with lookup functions so that ethtool.py will work in-tree or when installed.
Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250111154803.7496-2-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
show more ...
|