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 0000000000..5df5b039e3 Binary files /dev/null and b/pkg/tinyusb/patches/0004-lib-networking-remove-include-of-lwIP-netif-ethernet.patch differ