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

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
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -7,9 +7,12 @@ ifeq ("$(DEBUG)","1")
  CFLAGS += -g -fsanitize=address -fsanitize=leak -static-libasan
endif

YNL_GEN_ARG_ethtool:=--user-header linux/ethtool_netlink.h \
	--exclude-op stats-get

TOOL:=../ynl-gen-c.py

GENS:=devlink handshake fou netdev
GENS:=ethtool devlink handshake fou netdev
SRCS=$(patsubst %,%-user.c,${GENS})
HDRS=$(patsubst %,%-user.h,${GENS})
OBJS=$(patsubst %,%-user.o,${GENS})
@@ -22,11 +25,11 @@ protos.a: $(OBJS)

%-user.h: ../../../../Documentation/netlink/specs/%.yaml $(TOOL)
	@echo -e "\tGEN $@"
	@$(TOOL) --mode user --header --spec $< > $@
	@$(TOOL) --mode user --header --spec $< $(YNL_GEN_ARG_$*) > $@

%-user.c: ../../../../Documentation/netlink/specs/%.yaml $(TOOL)
	@echo -e "\tGEN $@"
	@$(TOOL) --mode user --source --spec $< > $@
	@$(TOOL) --mode user --source --spec $< $(YNL_GEN_ARG_$*) > $@

%-user.o: %-user.c %-user.h
	@echo -e "\tCC $@"
+6353 −0

File added.

Preview size limit exceeded, changes collapsed.

+5531 −0

File added.

Preview size limit exceeded, changes collapsed.