[OpenWrt-Devel] [PATCH v2] kernel: Fix USB gadget modules for v3.18

Owen Kirby osk at exegin.com
Thu Feb 19 17:41:57 EST 2015


An update for for the previous patch that should also retain
compatibility with kernel version 3.14 and earlier. This has
been tested to build working packages for the at91 target at
versions 3.14 and 3.18. It also compiles successfully for
version 3.13 on the omap target, but I can't test that it works
without hardware. The USB gadget drivers have gone through the
following changes:

3.8 and earlier:
	g_ether and g_serial were monolithic drivers.

3.10:
	g_ether is a monolithic driver.
	g_serial is split into gadget + function drivers.

3.13 and 3.14:
	g_serial is split into gadget + function drivers.
	g_ether is split into gadget + function drivers.
	u_rndis.ko only existed for version 3.13

3.18 and 3.19:
	g_serial and g_ether are split into gadget + function drivers.
	gadgets and functions are moved into separate subdirectories.

Signed-off-by: Owen Kirby <osk at exegin.com>
---
 package/kernel/linux/modules/usb.mk | 42 ++++++++++++++++++++++---------------
 target/linux/generic/config-3.18    |  1 +
 2 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/package/kernel/linux/modules/usb.mk b/package/kernel/linux/modules/usb.mk
index 6faa437..4d89374 100644
--- a/package/kernel/linux/modules/usb.mk
+++ b/package/kernel/linux/modules/usb.mk
@@ -254,19 +254,22 @@ define KernelPackage/usb-eth-gadget
 	CONFIG_USB_ETH_RNDIS=y \
 	CONFIG_USB_ETH_EEM=n
   DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
-ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/gadget/u_ether.ko),)
+ifeq ($(CONFIG_LINUX_3_8)$(CONFIG_LINUX_3_10),)
   FILES:= \
-	$(LINUX_DIR)/drivers/usb/gadget/u_ether.ko \
-	$(LINUX_DIR)/drivers/usb/gadget/usb_f_ecm.ko \
-	$(LINUX_DIR)/drivers/usb/gadget/usb_f_ecm_subset.ko \
-	$(LINUX_DIR)/drivers/usb/gadget/usb_f_rndis.ko \
-	$(LINUX_DIR)/drivers/usb/gadget/g_ether.ko
-  ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/gadget/u_rndis.ko),)
-    FILES+=$(LINUX_DIR)/drivers/usb/gadget/u_rndis.ko
-  endif
+	$(LINUX_DIR)/drivers/usb/gadget/function/u_ether.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ecm.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_ecm_subset.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_rndis.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/legacy/g_ether.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/u_ether.ko at lt3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/u_rndis.ko at lt3.14 \
+	$(LINUX_DIR)/drivers/usb/gadget/usb_f_ecm.ko at lt3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/usb_f_ecm_subset.ko at lt3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/usb_f_rndis.ko at lt3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/g_ether.ko at lt3.18
   AUTOLOAD:=$(call AutoLoad,52,usb_f_ecm g_ether)
 else
-  FILES:=$(LINUX_DIR)/drivers/usb/gadget/g_ether.ko
+  FILES:= $(LINUX_DIR)/drivers/usb/gadget/g_ether.ko
   AUTOLOAD:=$(call AutoLoad,52,g_ether)
 endif
   $(call AddDepends/usb)
@@ -283,16 +286,21 @@ define KernelPackage/usb-serial-gadget
   TITLE:=USB Serial Gadget support
   KCONFIG:=CONFIG_USB_G_SERIAL
   DEPENDS:=+kmod-usb-gadget +kmod-usb-lib-composite
-ifneq ($(wildcard $(LINUX_DIR)/drivers/usb/gadget/u_serial.ko),)
+ifeq ($(CONFIG_LINUX_3_8),)
   FILES:= \
-	$(LINUX_DIR)/drivers/usb/gadget/u_serial.ko \
-	$(LINUX_DIR)/drivers/usb/gadget/usb_f_acm.ko \
-	$(LINUX_DIR)/drivers/usb/gadget/usb_f_obex.ko \
-	$(LINUX_DIR)/drivers/usb/gadget/usb_f_serial.ko \
-	$(LINUX_DIR)/drivers/usb/gadget/g_serial.ko
+	$(LINUX_DIR)/drivers/usb/gadget/function/u_serial.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_acm.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_obex.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/function/usb_f_serial.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/legacy/g_serial.ko at ge3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/u_serial.ko at lt3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/usb_f_acm.ko at lt3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/usb_f_obex.ko at lt3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/usb_f_serial.ko at lt3.18 \
+	$(LINUX_DIR)/drivers/usb/gadget/g_serial.ko at lt3.18
   AUTOLOAD:=$(call AutoLoad,52,usb_f_acm g_serial)
 else
-  FILES:=$(LINUX_DIR)/drivers/usb/gadget/g_serial.ko
+  FILES:= $(LINUX_DIR)/drivers/usb/gadget/g_serial.ko
   AUTOLOAD:=$(call AutoLoad,52,g_serial)
 endif
   $(call AddDepends/usb)
diff --git a/target/linux/generic/config-3.18 b/target/linux/generic/config-3.18
index e8ae342..7ad0efc 100644
--- a/target/linux/generic/config-3.18
+++ b/target/linux/generic/config-3.18
@@ -4055,6 +4055,7 @@ CONFIG_USB_EZUSB=y
 # CONFIG_USB_GADGET_DEBUG_FS is not set
 CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
 CONFIG_USB_GADGET_VBUS_DRAW=2
+# CONFIG_USB_GADGET_XILINX is not set
 # CONFIG_USB_GL860 is not set
 # CONFIG_USB_GOKU is not set
 # CONFIG_USB_GPIO_VBUS is not set
-- 
1.9.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list