Commit 2d7be507 authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

tools: ynl: generate code for the ethtool family

Generate the protocol code for ethtool. Skip the stats
for now, they are the only outlier in terms of complexity.
Stats are a sort-of semi-polymorphic (attr space of a nest
depends on value of another attr) or a type-value-scalar,
depending on how one wants to look at it...
A challenge for another time.
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 68335713
...@@ -7,9 +7,12 @@ ifeq ("$(DEBUG)","1") ...@@ -7,9 +7,12 @@ ifeq ("$(DEBUG)","1")
CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
endif endif
YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \
--exclude-op stats-get
TOOL:=../ynl-gen-c.py TOOL:=../ynl-gen-c.py
GENS:=devlink handshake fou netdev GENS:=ethtool devlink handshake fou netdev
SRCS=$(patsubst %,%-user.c,${GENS}) SRCS=$(patsubst %,%-user.c,${GENS})
HDRS=$(patsubst %,%-user.h,${GENS}) HDRS=$(patsubst %,%-user.h,${GENS})
OBJS=$(patsubst %,%-user.o,${GENS}) OBJS=$(patsubst %,%-user.o,${GENS})
...@@ -22,11 +25,11 @@ protos.a: $(OBJS) ...@@ -22,11 +25,11 @@ protos.a: $(OBJS)
%-user.h: ../../../../Documentation/netlink/specs/%.yaml $(TOOL) %-user.h: ../../../../Documentation/netlink/specs/%.yaml $(TOOL)
@echo -e "\tGEN $@" @echo -e "\tGEN $@"
@$(TOOL) --mode user --header --spec $< > $@ @$(TOOL) --mode user --header --spec $< $(YNL_GEN_ARG_$*) > $@
%-user.c: ../../../../Documentation/netlink/specs/%.yaml $(TOOL) %-user.c: ../../../../Documentation/netlink/specs/%.yaml $(TOOL)
@echo -e "\tGEN $@" @echo -e "\tGEN $@"
@$(TOOL) --mode user --source --spec $< > $@ @$(TOOL) --mode user --source --spec $< $(YNL_GEN_ARG_$*) > $@
%-user.o: %-user.c %-user.h %-user.o: %-user.c %-user.h
@echo -e "\tCC $@" @echo -e "\tCC $@"
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment