From 5b6a88e0702b1a545a009df416843950a86aebaa Mon Sep 17 00:00:00 2001 From: Gunar Schorcht Date: Sun, 13 Nov 2022 13:19:03 +0100 Subject: [PATCH] pkg/tinyusb: enable network device class in makefiles --- pkg/tinyusb/Makefile | 11 +++++----- pkg/tinyusb/Makefile.dep | 20 ++++++++++++++---- pkg/tinyusb/Makefile.include | 10 ++++++++- pkg/tinyusb/Makefile.lib_networking | 5 +++++ ...emove-include-of-lwIP-netif-ethernet.patch | Bin 0 -> 837 bytes 5 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 pkg/tinyusb/Makefile.lib_networking create mode 100644 pkg/tinyusb/patches/0004-lib-networking-remove-include-of-lwIP-netif-ethernet.patch diff --git a/pkg/tinyusb/Makefile b/pkg/tinyusb/Makefile index f2b183a67a..d76ffa3822 100644 --- a/pkg/tinyusb/Makefile +++ b/pkg/tinyusb/Makefile @@ -8,10 +8,11 @@ PKG_LICENSE=MIT include $(RIOTBASE)/pkg/pkg.mk PSRC = $(PKG_SOURCE_DIR)/src +PLIB = $(PKG_SOURCE_DIR)/lib .PHONY: all -all: $(filter tinyusb_% stdio_tinyusb_cdc_acm,$(USEMODULE)) +all: $(filter tinyusb_% stdio_tinyusb_cdc_acm,$(filter-out tinyusb_class_net_%,$(USEMODULE))) $(QQ)"$(MAKE)" -C $(PSRC) -f $(RIOTBASE)/Makefile.base MODULE=tinyusb stdio_tinyusb_cdc_acm: @@ -50,10 +51,7 @@ tinyusb_class_midi: tinyusb_class_msc: $(QQ)"$(MAKE)" -C $(PSRC)/class/msc -f $(RIOTBASE)/Makefile.base MODULE=$@ -tinyusb_class_net_ecm_rndis: - $(QQ)"$(MAKE)" -C $(PSRC)/class/net -f $(RIOTBASE)/Makefile.base MODULE=$@ - -tinyusb_class_net_ncm: +tinyusb_class_net: $(QQ)"$(MAKE)" -C $(PSRC)/class/net -f $(RIOTBASE)/Makefile.base MODULE=$@ tinyusb_class_usbtmc: @@ -74,6 +72,9 @@ tinyusb_device: tinyusb_host: $(QQ)"$(MAKE)" -C $(PSRC)/host -f $(RIOTBASE)/Makefile.base MODULE=$@ +tinyusb_lib_networking: + $(QQ)"$(MAKE)" -C $(PLIB)/networking -f $(RIOTPKG)/$(PKG_NAME)/Makefile.lib_networking + tinyusb_portable_espressif: $(QQ)"$(MAKE)" -C $(PSRC)/portable/espressif/esp32sx -f $(RIOTBASE)/Makefile.base MODULE=$@ diff --git a/pkg/tinyusb/Makefile.dep b/pkg/tinyusb/Makefile.dep index d772ece099..d16371e55c 100644 --- a/pkg/tinyusb/Makefile.dep +++ b/pkg/tinyusb/Makefile.dep @@ -30,6 +30,21 @@ ifneq (,$(filter tinyusb_dfu,$(USEMODULE))) endif endif +ifneq (,$(filter tinyusb_class_net_%,$(USEMODULE))) + USEMODULE += tinyusb_class_net +endif + +ifneq (,$(filter tinyusb_netdev,$(USEMODULE))) + USEMODULE += luid + USEMODULE += netdev_eth + USEMODULE += tinyusb_class_net + USEMODULE += tinyusb_device +endif + +ifneq (,$(filter tinyusb_class_net_rndis,$(USEMODULE))) + USEMODULE += tinyusb_lib_networking +endif + ifeq (,$(filter tinyusb_class_%,$(USEMODULE))) $(error At least one tinyusb_class_* module has to be enabled) endif @@ -60,10 +75,7 @@ endif ifneq (,$(filter tinyusb_class_midi,$(USEMODULE))) USEMODULE += tinyusb_device endif -ifneq (,$(filter tinyusb_class_net_ecm_rndis,$(USEMODULE))) - USEMODULE += tinyusb_device -endif -ifneq (,$(filter tinyusb_class_net_ncm,$(USEMODULE))) +ifneq (,$(filter tinyusb_class_net,$(USEMODULE))) USEMODULE += tinyusb_device endif ifneq (,$(filter tinyusb_class_usbtmc,$(USEMODULE))) diff --git a/pkg/tinyusb/Makefile.include b/pkg/tinyusb/Makefile.include index bf64577352..bcf048baae 100644 --- a/pkg/tinyusb/Makefile.include +++ b/pkg/tinyusb/Makefile.include @@ -1,3 +1,7 @@ +PSEUDOMODULES += tinyusb_class_net_cdc_ecm +PSEUDOMODULES += tinyusb_class_net_cdc_ncm +PSEUDOMODULES += tinyusb_class_net_rndis + INCLUDES += -I$(RIOTBASE)/pkg/tinyusb/contrib INCLUDES += -I$(RIOTBASE)/pkg/tinyusb/contrib/include INCLUDES += -I$(RIOTBASE)/pkg/tinyusb/hw/include @@ -30,10 +34,14 @@ else $(error CPU $(CPU) or CPU family $(CPU_FAM) not supported) endif -ifneq (,$(filter tinyusb_class_net_ecm_rndis,$(USEMODULE))) +ifneq (,$(filter tinyusb_class_net tinyusb_lib_networking,$(USEMODULE))) INCLUDES += -I$(PKGDIRBASE)/tinyusb/lib/networking endif ifneq (,$(filter tinyusb_dfu,$(USEMODULE))) INCLUDES += -I$(RIOTBASE)/pkg/tinyusb/dfu/include endif + +ifneq (,$(filter tinyusb_netdev,$(USEMODULE))) + INCLUDES += -I$(RIOTBASE)/pkg/tinyusb/netdev/include +endif diff --git a/pkg/tinyusb/Makefile.lib_networking b/pkg/tinyusb/Makefile.lib_networking new file mode 100644 index 0000000000..e9ade16826 --- /dev/null +++ b/pkg/tinyusb/Makefile.lib_networking @@ -0,0 +1,5 @@ +MODULE = tinyusb_lib_networking + +SRC = rndis_reports.c + +include $(RIOTBASE)/Makefile.base diff --git a/pkg/tinyusb/patches/0004-lib-networking-remove-include-of-lwIP-netif-ethernet.patch b/pkg/tinyusb/patches/0004-lib-networking-remove-include-of-lwIP-netif-ethernet.patch new file mode 100644 index 0000000000000000000000000000000000000000..5df5b039e3c645c3c724dab31f4fee7292a3abad GIT binary patch literal 837 zcmaiyT~FIE6o&8pD_(UsK*@*G(3A?HZWLHGD2Q~snWoCIPa2P4S58_sX+M4r`w;6k zVcAh^zvp?6&hdq_4^Zkji<6X;ECva2k;s&1@<wvIlJ(fF)lYoIOMXjPF5{WR^5Km{M?6z+EX?aEse3LHizIb=634=Ndi6`r=B=M zKjv}F@=fuXWIM*k+t-V;w@9P(6KY*Vp7Chiy*8^c96i`AK^s|b6v39LA7{7l5?w~r zR^8rLS2$Ow%s$ z7kya2-^YtylL>+WKg`hg-ytRwhF8BTdeXGcS30atpB?sOEt;llM7NfTwpvnH^`1+9 z)Nt)=Yo)Eb%iuS(x7!~d>0=d@+7RyM(^u?oo)1 za{g&yk0;lKZleaJb$Fk@2`=(|97MYoAI|5~o4Y4yZ=uasuk8KTVm>>=mW=X5BOa*3 N`3A5g