summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-06-17 20:22:36 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-06-17 20:22:36 +0000
commitbbc307b2b0b37108190de6ba4743a5d712cc6fc4 (patch)
tree557fa8042cf113919ba6e0e626f3d7f9da099db2
parent5b937d8b8c168e124442874b56a593a587160427 (diff)
commit a bunch of stuff, primarily basic support for allowing drivers/dahdi and include/dahdi to be 'dropped in' to a Linux kernel tree and be part of the buildsystem
also includes a bunch of minor Makefile improvements, and relocating the firmware directory to the directory where the modules live, since that is the only place it is needed still left to do: handle version.h creation when in native-kernel-tree mode, fix up lots of problems left with firmware file handling git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4377 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--Kbuild6
-rw-r--r--Makefile60
-rw-r--r--drivers/dahdi/Kbuild36
-rw-r--r--drivers/dahdi/Kconfig213
-rw-r--r--drivers/dahdi/Makefile2
-rw-r--r--drivers/dahdi/dahdi-base.c2
-rw-r--r--drivers/dahdi/firmware/Makefile (renamed from firmware/Makefile)0
-rw-r--r--drivers/dahdi/wct4xxp/Kbuild4
-rw-r--r--drivers/dahdi/wct4xxp/Makefile2
-rw-r--r--drivers/dahdi/wctc4xxp/Kbuild2
-rw-r--r--drivers/dahdi/wctc4xxp/Makefile2
-rw-r--r--drivers/dahdi/wctdm24xxp/Kbuild2
-rw-r--r--drivers/dahdi/wctdm24xxp/Makefile2
-rw-r--r--drivers/dahdi/wcte12xp/Kbuild2
-rw-r--r--drivers/dahdi/wcte12xp/Makefile2
-rw-r--r--drivers/dahdi/xpp/Kbuild17
-rw-r--r--drivers/dahdi/xpp/Kconfig54
-rw-r--r--include/dahdi/Kbuild4
18 files changed, 366 insertions, 46 deletions
diff --git a/Kbuild b/Kbuild
new file mode 100644
index 0000000..f6a31e9
--- /dev/null
+++ b/Kbuild
@@ -0,0 +1,6 @@
+obj-m += drivers/dahdi/
+header-y += include/dahdi/
+
+# ensure that our local include files can be found by all modules
+
+CFLAGS_MODULE += -I$(DAHDI_INCLUDE)
diff --git a/Makefile b/Makefile
index 126ec4a..5b01d25 100644
--- a/Makefile
+++ b/Makefile
@@ -1,17 +1,31 @@
#
-# Makefile for DAHDI driver modules
+# Makefile for DAHDI Linux kernel modules
#
# Copyright (C) 2001-2008 Digium, Inc.
#
#
+# This Makefile is used both by the kernel build system (to set
+# a number of variables before descending into the real module
+# build directory) and by the top-level 'make' process. We can
+# determine which mode is needed by checking the KBUILD_EXTMOD
+# variable, although on reasonably new kernels the kernel build
+# system won't even use this file, it will just use the Kbuild
+# file directly.
+
+ifdef KBUILD_EXTMOD
+
+include $(src)/Kbuild
+
+else
+
PWD:=$(shell pwd)
-ifeq ($(ARCH),)
+ifndef ARCH
ARCH:=$(shell uname -m | sed -e s/i.86/i386/)
endif
-ifeq ($(DEB_HOST_GNU_TYPE),)
+ifndef DEB_HOST_GNU_TYPE
UNAME_M:=$(shell uname -m)
else
UNAME_M:=$(DEB_HOST_GNU_TYPE)
@@ -55,8 +69,7 @@ endif
MODULE_ALIASES=wcfxs wctdm8xxp wct2xxp
-KMAKE = $(MAKE) -C $(KSRC) ARCH=$(ARCH) SUBDIRS=$(PWD)/drivers/dahdi DAHDI_INCLUDE=$(PWD)/include HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE)
-KMAKE_INST = $(KMAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=dahdi modules_install
+KMAKE = $(MAKE) -C $(KSRC) ARCH=$(ARCH) SUBDIRS=$(PWD) DAHDI_INCLUDE=$(PWD)/include HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE)
ifneq (,$(wildcard $(DESTDIR)/etc/udev/rules.d))
DYNFS=yes
@@ -66,25 +79,25 @@ ROOT_PREFIX=
CHKCONFIG := $(wildcard /sbin/chkconfig)
UPDATE_RCD := $(wildcard /usr/sbin/update-rc.d)
-ifeq (,$(DESTDIR))
- ifneq (,$(CHKCONFIG))
+ifndef DESTDIR
+ ifdef CHKCONFIG
ADD_INITD := $(CHKCONFIG) --add dahdi
else
- ifndef (,$(UPDATE_RCD))
+ ifdef UPDATE_RCD
ADD_INITD := $(UPDATE_RCD) dahdi defaults 15 30
endif
endif
endif
INITRD_DIR := $(firstword $(wildcard /etc/rc.d/init.d /etc/init.d))
-ifneq (,$(INITRD_DIR))
+ifdef INITRD_DIR
INIT_TARGET := $(DESTDIR)$(INITRD_DIR)/dahdi
COPY_INITD := install -D dahdi.init $(INIT_TARGET)
endif
RCCONF_DIR := $(firstword $(wildcard /etc/sysconfig /etc/default))
NETSCR_DIR := $(firstword $(wildcard /etc/sysconfig/network-scripts ))
-ifneq (,$(NETSCR_DIR))
+ifdef NETSCR_DIR
NETSCR_TARGET := $(DESTDIR)$(NETSCR_DIR)/ifup-hdlc
COPY_NETSCR := install -D ifup-hdlc $(NETSCR_TARGET)
endif
@@ -104,16 +117,16 @@ ifeq (no,$(HAS_KSRC))
echo "You do not appear to have the sources for the $(KVERS) kernel installed."
exit 1
endif
- $(KMAKE) modules
+ $(KMAKE) modules DAHDI_BUILD_ALL=m
-version.h:
+include/dahdi/version.h:
@DAHDIVERSION="${DAHDIVERSION}" build_tools/make_version_h > $@.tmp
@if cmp -s $@.tmp $@ ; then :; else \
mv $@.tmp $@ ; \
fi
@rm -f $@.tmp
-prereq: version.h
+prereq: include/dahdi/version.h
stackcheck: checkstack modules
./checkstack kernel/*.ko kernel/*/*.ko
@@ -136,7 +149,7 @@ install-modconf:
install-firmware:
ifeq ($(HOTPLUG_FIRMWARE),yes)
- $(MAKE) -C firmware hotplug-install DESTDIR=$(DESTDIR) HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE)
+ $(MAKE) -C drivers/dahdi/firmware hotplug-install DESTDIR=$(DESTDIR) HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE)
endif
install-include:
@@ -176,28 +189,28 @@ endif
install-udev: devices
uninstall-hotplug:
- $(MAKE) -C firmware hotplug-uninstall DESTDIR=$(DESTDIR)
+ $(MAKE) -C drivers/dahdi/firmware hotplug-uninstall DESTDIR=$(DESTDIR)
uninstall-modules:
@./build_tools/uninstall-modules $(DESTDIR)/lib/modules/$(KVERS) $(ALL_MODULES)
install-modules: # uninstall-modules
- $(KMAKE_INST)
+ $(KMAKE) INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=dahdi modules_install
[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
config:
-ifneq (,$(COPY_INITD))
+ifdef COPY_INITD
$(COPY_INITD)
endif
-ifneq (,$(RCCONF_DIR))
+ifdef RCCONF_DIR
ifeq (,$(wildcard $(DESTDIR)$(RCCONF_DIR)/dahdi))
$(INSTALL) -D -m 644 dahdi.sysconfig $(DESTDIR)$(RCCONF_DIR)/dahdi
endif
endif
-ifneq (,$(COPY_NETSCR))
+ifdef COPY_NETSCR
$(COPY_NETSCR)
endif
-ifneq (,$(ADD_INITD))
+ifdef ADD_INITD
$(ADD_INITD)
endif
@echo "DAHDI has been configured."
@@ -225,11 +238,14 @@ update:
clean:
$(KMAKE) clean
- $(MAKE) -C firmware clean
+ $(MAKE) -C drivers/dahdi/firmware clean
distclean: dist-clean
dist-clean: clean
- @$(MAKE) -C firmware dist-clean
+ @rm -f include/dahdi/version.h
+ @$(MAKE) -C drivers/dahdi/firmware dist-clean
.PHONY: distclean dist-clean clean version.h all install devices modules stackcheck install-udev config update install-modules install-include uninstall-modules
+
+endif # ifdef KBUILD_EXTMOD
diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild
index 5bad0ed..106b8fd 100644
--- a/drivers/dahdi/Kbuild
+++ b/drivers/dahdi/Kbuild
@@ -2,14 +2,38 @@ ifdef ECHO_CAN_NAME
ECHO_CAN_CFLAGS := -DECHO_CAN_FROMENV -DECHO_CAN_$(ECHO_CAN_NAME)
endif
-obj-m := pciradio.o tor2.o wcfxo.o wct1xxp.o wctdm.o wcte11xp.o dahdi.o dahdi_dummy.o dahdi_dynamic.o dahdi_dynamic_eth.o dahdi_dynamic_loc.o dahdi_transcode.o
-obj-m += wct4xxp/ wctc4xxp/ wctdm24xxp/ wcte12xp/ xpp/
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI) += dahdi.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DUMMY) += dahdi_dummy.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DYNAMIC) += dahdi_dynamic.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DYNAMIC_LOC) += dahdi_dynamic_loc.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_DYNAMIC_ETH) += dahdi_dynamic_eth.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_TRANSCODE) += dahdi_transcode.o
-CFLAGS_MODULE += -I$(DAHDI_INCLUDE)
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCT4XXP) += wct4xxp/
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTC4XXP) += wctc4xxp/
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM24XXP) += wctdm24xxp/
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE12XP) += wcte12xp/
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM) += wctdm.o
-EXTRA_CFLAGS += -I$(src)
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCT1XXP) += wct1xxp.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE11XP) += wcte11xp.o
+
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCFXO) += wcfxo.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_TOR2) += tor2.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_PCIRADIO) += pciradio.o
+
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPP) += xpp/
+
+CFLAGS_MODULE += -I$(src)
EXTRA_CFLAGS += $(ECHO_CAN_CFLAGS)
+ifndef HOTPLUG_FIRMWARE
+ifneq (,$(filter y m,$(CONFIG_FW_LOADER)))
+HOTPLUG_FIRMWARE := yes
+export HOTPLUG_FIRMWARE
+endif
+endif
+
# fix typo present in CentOS and RHEL 2.6.9 kernels
BAD_KERNELS_VERS := 22 34 34.0.1 34.0.2
BAD_KERNELS := $(foreach ver,$(BAD_KERNELS_VERS),2.6.9-$(ver).EL 2.6.9-$(ver).ELsmp)
@@ -65,8 +89,8 @@ DAHDIMMX_CONFIG_VARS := $(DAHDIMMX_WHITELIST_$(ARCH):%=CONFIG_%)
# expand them:
DAHDIMMX_CONFIG_VALS := $(strip $(foreach var,$(DAHDIMMX_CONFIG_VARS),$(var)) )
-ifneq (,$(DAHDI_MMX_AUTO))
- ifneq (,$(DAHDIMMX_CONFIG_VALS))
+ifdef DAHDI_MMX_AUTO
+ ifdef DAHDIMMX_CONFIG_VALS
# TODO: make that
CFLAGS_dahdi-base.o += -DCONFIG_DAHDI_MMX
endif
diff --git a/drivers/dahdi/Kconfig b/drivers/dahdi/Kconfig
new file mode 100644
index 0000000..b4aad69
--- /dev/null
+++ b/drivers/dahdi/Kconfig
@@ -0,0 +1,213 @@
+#
+# DAHDI configuration
+#
+
+menuconfig DAHDI
+ tristate "DAHDI support"
+ default m
+ ---help---
+ DAHDI basic infrastructure.
+
+ To compile this driver as a module, choose M here: the
+ module will be called dahdi.
+
+ If unsure, say Y.
+
+if DAHDI
+
+config DAHDI_WCTDM
+ tristate "Digium Wildcard TDM400P Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ This driver provides support for the Digium Wildcard TDM400P.
+
+ To compile this driver as a module, choose M here: the
+ module will be called wctdm.
+
+ If unsure, say Y.
+
+config DAHDI_WCT4XXP
+ tristate "Digium Wildcard dual- and quad-T1/E1/J1 Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ This driver provides support for the following Digium
+ Wildcard products:
+
+ * TE205/206/207/210/211/212P (PCI/PCI-X)
+ * TE220 (PCI-E)
+ * TE405/406/407/410/411/412P (PCI/PCI-X)
+ * TE420 (PCI-E)
+
+ To compile this driver as a module, choose M here: the
+ module will be called wct4xxp.
+
+ If unsure, say Y.
+
+config DAHDI_TRANSCODE
+ tristate "DAHDI transcoding support"
+ default DAHDI
+ ---help---
+ DAHDI transcoding infrastructure.
+
+ To compile this driver as a module, choose M here: the
+ module will be called dahdi_transcode.
+
+ If unsure, say Y.
+
+config DAHDI_WCTC4XXP
+ tristate "Digium Wildcard TC400B Support"
+ depends on DAHDI && DAHDI_TRANSCODE && PCI
+ default DAHDI
+ ---help---
+ This driver provides support for the Digium Wildcard TC400B.
+
+ To compile this driver as a module, choose M here: the
+ module will be called wctc4xxp.
+
+ If unsure, say Y.
+
+config DAHDI_WCTDM24XXP
+ tristate "Digium Wildcard VoiceBus analog card Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ This driver provides support for the following Digium
+ Wildcard products:
+
+ * TDM410P (PCI/PCI-X)
+ * AEX410 (PCI-E)
+ * TDM800P (PCI/PCI-X)
+ * AEX800 (PCI-E)
+ * TDM2400P (PCI/PCI-X)
+ * AEX2400 (PCI-E)
+
+ To compile this driver as a module, choose M here: the
+ module will be called wctdm24xxp.
+
+ If unsure, say Y.
+
+config DAHDI_WCTE12XP
+ tristate "Digium Wildcard VoiceBus digital card Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ This driver provides support for the following Digium
+ Wildcard products:
+
+ * TE120P (PCI/PCI-X)
+ * TE121 (PCI/PCI-X)
+ * TE122 (PCI-E)
+
+ To compile this driver as a module, choose M here: the
+ module will be called wcte12xp.
+
+ If unsure, say Y.
+
+config DAHDI_PCIRADIO
+ tristate "PCI Radio Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ To compile this driver as a module, choose M here: the
+ module will be called pciradio.
+
+ If unsure, say Y.
+
+config DAHDI_DUMMY
+ tristate "Dummy (no hardware) Timing Support"
+ depends on DAHDI
+ default DAHDI
+ ---help---
+ This module provides timing support for applications that
+ use DAHDI conference mixing services, pseudo channels or
+ for other purposes.
+
+ To compile this driver as a module, choose M here: the
+ module will be called dahdi_dummy.
+
+ If unsure, say Y.
+
+config DAHDI_DYNAMIC
+ tristate "Dynamic (virtual) Span Support"
+ depends on DAHDI
+ default DAHDI
+ ---help---
+ This module provides support for virtual spans, which are
+ emulated or provided using various technologies.
+
+ To compile this driver as a module, choose M here: the
+ module will be called dahdi_dynamic.
+
+ If unsure, say Y.
+
+config DAHDI_DYNAMIC_ETH
+ tristate "Ethernet (TDMoE) Span Support"
+ depends on DAHDI && DAHDI_DYNAMIC
+ default DAHDI
+ ---help---
+ This module provides support for spans over Ethernet,
+ using the TDMoE protocol.
+
+ To compile this driver as a module, choose M here: the
+ module will be called dahdi_dynamic_eth.
+
+ If unsure, say Y.
+
+config DAHDI_DYNAMIC_LOC
+ tristate "Local (loopback) Span Support"
+ depends on DAHDI && DAHDI_DYNAMIC
+ default DAHDI
+ ---help---
+ This module provides support for spans in the local system,
+ primarily used for looping and monitoring other spans.
+
+ To compile this driver as a module, choose M here: the
+ module will be called dahdi_dynamic_loc.
+
+ If unsure, say Y.
+
+config DAHDI_TOR2
+ tristate "Tormenta2 quad-port T1/E1 Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ To compile this driver as a module, choose M here: the
+ module will be called tor2.
+
+ If unsure, say Y.
+
+config DAHDI_WCFXO
+ tristate "Digium Wildcard X100P Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ To compile this driver as a module, choose M here: the
+ module will be called wcfxo.
+
+ If unsure, say Y.
+
+config DAHDI_WCT1XXP
+ tristate "Digium Wildcard T100P Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ To compile this driver as a module, choose M here: the
+ module will be called wct1xxp.
+
+ If unsure, say Y.
+
+config DAHDI_WCTE11XP
+ tristate "Digium Wildcard TE110P Support"
+ depends on DAHDI && PCI
+ default DAHDI
+ ---help---
+ To compile this driver as a module, choose M here: the
+ module will be called wcte11xp.
+
+ If unsure, say Y.
+
+source "drivers/dahdi/xpp/Kconfig"
+
+endif # DAHDI
diff --git a/drivers/dahdi/Makefile b/drivers/dahdi/Makefile
index 56453cb..aed8dfc 100644
--- a/drivers/dahdi/Makefile
+++ b/drivers/dahdi/Makefile
@@ -1,4 +1,4 @@
-ifneq ($(KBUILD_EXTMOD),)
+ifdef KBUILD_EXTMOD
# We only get here on kernels 2.6.0-2.6.9 .
# For newer kernels, Kbuild will be included directly by the kernel
# build system.
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index b0fd8c4..fa733de 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -36,7 +36,6 @@
#include "dahdi_config.h"
-#include "../version.h"
#include <linux/kernel.h>
#include <linux/errno.h>
@@ -80,6 +79,7 @@
#define FAST_HDLC_NEED_TABLES
#include "fasthdlc.h"
+#include <dahdi/version.h>
#include <dahdi/kernel.h>
#include <dahdi/user.h>
diff --git a/firmware/Makefile b/drivers/dahdi/firmware/Makefile
index 03a9560..03a9560 100644
--- a/firmware/Makefile
+++ b/drivers/dahdi/firmware/Makefile
diff --git a/drivers/dahdi/wct4xxp/Kbuild b/drivers/dahdi/wct4xxp/Kbuild
index 5d60d8e..37ab74b 100644
--- a/drivers/dahdi/wct4xxp/Kbuild
+++ b/drivers/dahdi/wct4xxp/Kbuild
@@ -1,6 +1,6 @@
-obj-m += wct4xxp.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCT4XXP) += wct4xxp.o
-FIRM_DIR := ../../firmware
+FIRM_DIR := ../firmware
EXTRA_CFLAGS := -I$(src)/.. $(shell $(src)/../oct612x/octasic-helper cflags $(src)/../oct612x) -Wno-undef
diff --git a/drivers/dahdi/wct4xxp/Makefile b/drivers/dahdi/wct4xxp/Makefile
index 5406e07..baaab35 100644
--- a/drivers/dahdi/wct4xxp/Makefile
+++ b/drivers/dahdi/wct4xxp/Makefile
@@ -1,4 +1,4 @@
-ifneq ($(KBUILD_EXTMOD),)
+ifdef KBUILD_EXTMOD
# We only get here on kernels 2.6.0-2.6.9 .
# For newer kernels, Kbuild will be included directly by the kernel
# build system.
diff --git a/drivers/dahdi/wctc4xxp/Kbuild b/drivers/dahdi/wctc4xxp/Kbuild
index de426cf..507cc54 100644
--- a/drivers/dahdi/wctc4xxp/Kbuild
+++ b/drivers/dahdi/wctc4xxp/Kbuild
@@ -1,4 +1,4 @@
-obj-m += wctc4xxp.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTC4XXP) += wctc4xxp.o
FIRM_DIR := ../../firmware
diff --git a/drivers/dahdi/wctc4xxp/Makefile b/drivers/dahdi/wctc4xxp/Makefile
index 6a48fc9..cf5501f 100644
--- a/drivers/dahdi/wctc4xxp/Makefile
+++ b/drivers/dahdi/wctc4xxp/Makefile
@@ -1,4 +1,4 @@
-ifneq ($(KBUILD_EXTMOD),)
+ifdef KBUILD_EXTMOD
# We only get here on kernels 2.6.0-2.6.9 .
# For newer kernels, Kbuild will be included directly by the kernel
# build system.
diff --git a/drivers/dahdi/wctdm24xxp/Kbuild b/drivers/dahdi/wctdm24xxp/Kbuild
index 2176346..4a88de7 100644
--- a/drivers/dahdi/wctdm24xxp/Kbuild
+++ b/drivers/dahdi/wctdm24xxp/Kbuild
@@ -1,4 +1,4 @@
-obj-m += wctdm24xxp.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTDM24XXP) += wctdm24xxp.o
FIRM_DIR := ../../firmware
diff --git a/drivers/dahdi/wctdm24xxp/Makefile b/drivers/dahdi/wctdm24xxp/Makefile
index 56453cb..aed8dfc 100644
--- a/drivers/dahdi/wctdm24xxp/Makefile
+++ b/drivers/dahdi/wctdm24xxp/Makefile
@@ -1,4 +1,4 @@
-ifneq ($(KBUILD_EXTMOD),)
+ifdef KBUILD_EXTMOD
# We only get here on kernels 2.6.0-2.6.9 .
# For newer kernels, Kbuild will be included directly by the kernel
# build system.
diff --git a/drivers/dahdi/wcte12xp/Kbuild b/drivers/dahdi/wcte12xp/Kbuild
index 321d30d..d262480 100644
--- a/drivers/dahdi/wcte12xp/Kbuild
+++ b/drivers/dahdi/wcte12xp/Kbuild
@@ -1,4 +1,4 @@
-obj-m += wcte12xp.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_WCTE12XP) += wcte12xp.o
FIRM_DIR := ../../firmware
diff --git a/drivers/dahdi/wcte12xp/Makefile b/drivers/dahdi/wcte12xp/Makefile
index 56453cb..aed8dfc 100644
--- a/drivers/dahdi/wcte12xp/Makefile
+++ b/drivers/dahdi/wcte12xp/Makefile
@@ -1,4 +1,4 @@
-ifneq ($(KBUILD_EXTMOD),)
+ifdef KBUILD_EXTMOD
# We only get here on kernels 2.6.0-2.6.9 .
# For newer kernels, Kbuild will be included directly by the kernel
# build system.
diff --git a/drivers/dahdi/xpp/Kbuild b/drivers/dahdi/xpp/Kbuild
index f47edf0..3f0774e 100644
--- a/drivers/dahdi/xpp/Kbuild
+++ b/drivers/dahdi/xpp/Kbuild
@@ -5,7 +5,6 @@ else
endif
EXTRA_CFLAGS = $(XPP_LOCAL_CFLAGS) \
- -I$(ZAP_KERNEL) \
-DDEBUG \
-DPOLL_DIGITAL_INPUTS \
-DWITH_ECHO_SUPPRESSION \
@@ -14,7 +13,11 @@ EXTRA_CFLAGS = $(XPP_LOCAL_CFLAGS) \
-g
#
-obj-m += xpp.o xpd_fxs.o xpd_fxo.o xpd_pri.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPP) += xpp.o
+obj-$(CONFIG_DAHDI_XPP_USB) += xpp_usb.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_FXS) += xpd_fxs.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_FXO) += xpd_fxo.o
+obj-$(DAHDI_BUILD_ALL)$(CONFIG_DAHDI_XPD_PRI) += xpd_pri.o
HAS_BRISTUFF := $(shell grep '^[[:space:]]*\#[[:space:]]*define[[:space:]]\+CONFIG_ZAPATA_BRI_DCHANS\>' $(ZAP_KERNEL)/dahdi_config.h)
@@ -26,11 +29,11 @@ ifneq (,$(HAS_BRISTUFF))
obj-m += xpd_bri.o
endif
-xpp-y += xbus-core.o xbus-sysfs.o xbus-pcm.o xframe_queue.o xpp_zap.o xproto.o card_global.o zap_debug.o
-xpd_fxs-y += card_fxs.o
-xpd_fxo-y += card_fxo.o
-xpd_bri-y += card_bri.o
-xpd_pri-y += card_pri.o
+xpp-objs += xbus-core.o xbus-sysfs.o xbus-pcm.o xframe_queue.o xpp_zap.o xproto.o card_global.o zap_debug.o
+xpd_fxs-objs += card_fxs.o
+xpd_fxo-objs += card_fxo.o
+xpd_bri-objs += card_bri.o
+xpd_pri-objs += card_pri.o
ifeq (y,$(PARPORT_DEBUG))
EXTRA_CFLAGS += -DDEBUG_SYNC_PARPORT
diff --git a/drivers/dahdi/xpp/Kconfig b/drivers/dahdi/xpp/Kconfig
new file mode 100644
index 0000000..fa1d57c
--- /dev/null
+++ b/drivers/dahdi/xpp/Kconfig
@@ -0,0 +1,54 @@
+#
+# XPP configuration
+#
+
+menuconfig DAHDI_XPP
+ tristate "Xorcom Astribank Support"
+ depends on DAHDI && USB
+ default DAHDI
+ ---help---
+ Infrastructure support for Xorcom Astribank products.
+
+ To compile this driver as a module, choose M here: the
+ module will be called xpp.
+
+ If unsure, say Y.
+
+if DAHDI_XPP
+
+config DAHDI_XPP_USB
+ tristate
+ depends on DAHDI_XPP
+ default DAHDI_XPP
+
+config DAHDI_XPD_FXS
+ tristate "FXS port Support"
+ depends on DAHDI_XPP
+ default DAHDI_XPP
+ ---help---
+ To compile this driver as a module, choose M here: the
+ module will be called xpd_fxs.
+
+ If unsure, say Y.
+
+config DAHDI_XPD_FXO
+ tristate "FXO port Support"
+ depends on DAHDI_XPP
+ default DAHDI_XPP
+ ---help---
+ To compile this driver as a module, choose M here: the
+ module will be called xpd_fxo.
+
+ If unsure, say Y.
+
+config DAHDI_XPD_PRI
+ tristate "PRI port Support"
+ depends on DAHDI_XPP
+ default DAHDI_XPP
+ ---help---
+ To compile this driver as a module, choose M here: the
+ module will be called xpd_pri.
+
+ If unsure, say Y.
+
+endif # DAHDI_XPP
diff --git a/include/dahdi/Kbuild b/include/dahdi/Kbuild
new file mode 100644
index 0000000..5dfee8c
--- /dev/null
+++ b/include/dahdi/Kbuild
@@ -0,0 +1,4 @@
+header-y += kernel.h
+header-y += user.h
+header-y += wctdm_user.h
+header-y += version.h