et131x: use the in-kernel staging driver on 2.6.31 instead of the external sources
authorFelix Fietkau <nbd@openwrt.org>
Mon, 5 Oct 2009 20:14:49 +0000 (20:14 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 5 Oct 2009 20:14:49 +0000 (20:14 +0000)
SVN-Revision: 17932

net/et131x/Makefile

index 1863acc1e9d1b2f8c69184de2384879965e444e4..4c909ad95f4a3254078d5e6f091eda8509412c3a 100644 (file)
@@ -11,11 +11,20 @@ PKG_MD5SUM:=9496422c7d218f27bae1be42a04d122e
 
 include $(INCLUDE_DIR)/package.mk
 
+ifeq ($(CONFIG_LINUX_2_6_31),)
+  MODULE:=$(PKG_BUILD_DIR)/et131x.$(LINUX_KMOD_SUFFIX)
+else
+  MODULE:=$(LINUX_DIR)/drivers/staging/et131x/et131x.$(LINUX_KMOD_SUFFIX)
+endif
+
 define KernelPackage/et131x
   SUBMENU:=Network Devices
   TITLE:=Agere ET131x Gigabit Ethernet driver
   URL:=http://sourceforge.net/projects/et131x
-  FILES:=$(PKG_BUILD_DIR)/et131x.$(LINUX_KMOD_SUFFIX)
+  FILES:=$(MODULE)
+  KCONFIG:= \
+       CONFIG_ET131X=m \
+       CONFIG_ET131X_DEBUG=n
   DEPENDS:=@LINUX_2_6 @PCI_SUPPORT
   AUTOLOAD:=$(call AutoLoad,70,et131x)
 endef
@@ -24,14 +33,26 @@ define KernelPackage/et131x/description
   This package contains the et131x kernel module.
 endef
 
-define Build/Compile
+ifeq ($(CONFIG_LINUX_2_6_31),)
+  define Build/Compile
        $(MAKE) -C "$(LINUX_DIR)" \
                ARCH="$(LINUX_KARCH)" \
                CROSS_COMPILE="$(TARGET_CROSS)" \
                SUBDIRS="$(PKG_BUILD_DIR)" \
                $(PKG_EXTRA_KCONFIG) \
                EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS)"
-endef
+  endef
+else
+  define Build/Prepare
+    # nothing to do
+  endef
+  define Build/Configure
+    # nothing to do
+  endef
+  define Build/Compile
+    # nothing to do
+  endef
+endif
 
 $(eval $(call KernelPackage,et131x))