summaryrefslogtreecommitdiff
path: root/drivers/dahdi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dahdi')
-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/Makefile201
-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
15 files changed, 519 insertions, 24 deletions
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/drivers/dahdi/firmware/Makefile b/drivers/dahdi/firmware/Makefile
new file mode 100644
index 0000000..03a9560
--- /dev/null
+++ b/drivers/dahdi/firmware/Makefile
@@ -0,0 +1,201 @@
+#
+# DAHDI
+#
+# Makefile for firmware downloading/installation
+#
+# Copyright (C) 2007-2008, Digium, Inc.
+#
+# Joshua Colp <jcolp@digium.com>
+#
+# This program is free software, distributed under the terms of
+# the GNU General Public License
+#
+
+.PHONY: dist-clean all uninstall have_download install
+
+-include ../menuselect.makeopts ../makeopts
+
+PWD:=$(shell pwd)
+
+OCT6114_064_VERSION:=1.05.01
+OCT6114_128_VERSION:=1.05.01
+TC400M_VERSION:=MR6.12
+VPMADT032_VERSION:=1.07
+
+FIRMWARE_URL:=http://downloads.digium.com/pub/telephony/firmware/releases
+
+# Firmware files should use the naming convention: dahdi-fw-<base name>-<sub name>-<version> or dahdi-fw-<base name>-<version>
+# First example: dahdi-fw-oct6114-064-1.05.01
+# This means this is version 1.05.01 of the oct6114 64 firmware
+# Second example: dahdi-fw-tc400m-MR5.6
+# This means this is version MR5.6 of the tc400m firmware
+
+# Build a list of firmware package filenames we need
+FIRMWARE:=$(MENUSELECT_FIRMWARE:FIRMWARE-OCT6114-064=dahdi-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz)
+FIRMWARE:=$(FIRMWARE:FIRMWARE-OCT6114-128=dahdi-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz)
+FIRMWARE:=$(FIRMWARE:FIRMWARE-TC400M=dahdi-fw-tc400m-$(TC400M_VERSION).tar.gz)
+FIRMWARE:=$(FIRMWARE:FIRMWARE-VPMADT032=dahdi-fw-vpmadt032-$(VPMADT032_VERSION).tar.gz)
+
+# Build a list of object files if hotplug will not be used
+OBJECT_FILES:=$(MENUSELECT_FIRMWARE:FIRMWARE-OCT6114-064=dahdi-fw-oct6114-064.o)
+OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-OCT6114-128=dahdi-fw-oct6114-128.o)
+OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-TC400M=dahdi-fw-tc400m.o)
+OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-VPMADT032=dahdi-fw-vpmadt032.o)
+
+# If "fetch" is used, --continue is not a valid option.
+ifeq ($(WGET),wget)
+WGET_ARGS:=--continue
+endif
+
+all: $(FIRMWARE)
+
+have_download:
+ @if test "$(DOWNLOAD)" = ":" ; then \
+ echo "**************************************************"; \
+ echo "*** ***"; \
+ echo "*** You must have either wget or fetch to be ***"; \
+ echo "*** able to automatically download and install ***"; \
+ echo "*** the requested firmware packages. ***"; \
+ echo "*** ***"; \
+ echo "**************************************************"; \
+ exit 1; \
+ fi
+
+# Download and extract firmware tarballs
+dahdi-fw-oct6114-064-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+ @echo "Attempting to download $@"
+ @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
+ @if test ! -f $@; then exit 1; fi; \
+ (cat $@ | gzip -d | tar -xf -)
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+ @echo "Installing dahdi-fw-oct6114-064.bin to hotplug firmware directories"
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 dahdi-fw-oct6114-064.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
+ rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-*; \
+ touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION); \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ $(INSTALL) -m 644 dahdi-fw-oct6114-064.bin $(DESTDIR)/lib/firmware; \
+ rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-*; \
+ touch $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-064-$(OCT6114_064_VERSION); \
+ fi
+endif
+else
+ @echo "Firmware dahdi-fw-oct6114-064.bin is already installed with required version $(OCT6114_064_VERSION)"
+endif
+
+dahdi-fw-oct6114-128-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+ @echo "Attempting to download $@"
+ @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
+ @if test ! -f $@; then exit 1; fi; \
+ (cat $@ | gzip -d | tar -xf -)
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+ @echo "Installing dahdi-fw-oct6114-128.bin to hotplug firmware directories"
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 dahdi-fw-oct6114-128.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
+ rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-128-*; \
+ touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION); \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ $(INSTALL) -m 644 dahdi-fw-oct6114-128.bin $(DESTDIR)/lib/firmware; \
+ rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-128-*; \
+ touch $(DESTDIR)/lib/firmware/.dahdi-fw-oct6114-128-$(OCT6114_128_VERSION); \
+ fi
+endif
+else
+ @echo "Firmware dahdi-fw-oct6114-128.bin is already installed with required version $(OCT6114_128_VERSION)"
+endif
+
+dahdi-fw-tc400m-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+ @echo "Attempting to download $@"
+ @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
+ @if test ! -f $@; then exit 1; fi; \
+ (cat $@ | gzip -d | tar -xf -)
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+ @echo "Installing dahdi-fw-tc400m.bin to hotplug firmware directories"
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 dahdi-fw-tc400m.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
+ rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-tc400m-*; \
+ touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION); \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ $(INSTALL) -m 644 dahdi-fw-tc400m.bin $(DESTDIR)/lib/firmware; \
+ rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-tc400m-*; \
+ touch $(DESTDIR)/lib/firmware/.dahdi-fw-tc400m-$(TC400M_VERSION); \
+ fi
+endif
+else
+ @echo "Firmware dahdi-fw-tc400m.bin is already installed with required version $(TC400M_VERSION)"
+endif
+
+dahdi-fw-vpmadt032-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-vpmadt032-$(VPMADT032_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.dahdi-fw-vpmadt032-$(VPMADT032_VERSION) ] ); then echo "yes"; else echo "no"; fi),yes)
+ @echo "Attempting to download $@"
+ @if test ! -f $@; then $(DOWNLOAD) $(WGET_ARGS) $(FIRMWARE_URL)/$@; fi;
+ @if test ! -f $@; then exit 1; fi; \
+ (cat $@ | gzip -d | tar -xf -)
+ifeq ($(HOTPLUG_FIRMWARE),yes)
+ @echo "Installing dahdi-fw-vpmadt032.bin to hotplug firmware directories"
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 dahdi-fw-vpmadt032.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
+ rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-vpmadt032-*; \
+ touch $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw-vpmadt032-$(VPMADT032_VERSION); \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ $(INSTALL) -m 644 dahdi-fw-vpmadt032.bin $(DESTDIR)/lib/firmware; \
+ rm -rf $(DESTDIR)/lib/firmware/.dahdi-fw-vpmadt032-*; \
+ touch $(DESTDIR)/lib/firmware/.dahdi-fw-vpmadt032-$(VPMADT032_VERSION); \
+ fi
+endif
+else
+ @echo "Firmware dahdi-fw-vpmadt032.bin is already installed with required version $(VPMADT032_VERSION)"
+endif
+
+# Clean up any downloaded/extracted firmware packages
+dist-clean: clean
+ rm -f dahdi-fw-*.bin
+ rm -f dahdi-fw-*.tar.gz
+
+# Clean up anything we built
+clean:
+ rm -f dahdi-fw-*.o
+
+# Create object files suitable for linking against
+object-build: $(FIRMWARE) $(OBJECT_FILES)
+
+# Install all downloaded firmware images for hotplug usage and build headers for inclusion
+hotplug-install: $(FIRMWARE)
+
+# Uninstall any installed dahdi firmware images from hotplug firmware directories
+hotplug-uninstall:
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ rm -f $(DESTDIR)/usr/lib/hotplug/firmware/dahdi-fw-*.bin; \
+ rm -f $(DESTDIR)/usr/lib/hotplug/firmware/.dahdi-fw*; \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ rm -f $(DESTDIR)/lib/firmware/dahdi-fw-*.bin; \
+ rm -f $(DESTDIR)/lib/firmware/.dahdi-fw*; \
+ fi
+
+# Build object file of an oct6114 064 firmware image for linking
+dahdi-fw-oct6114-064.o: dahdi-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz dahdi-fw-oct6114-064.bin
+ @echo Making firmware object file for dahdi-fw-oct6114-064.bin
+ ../build_tools/make_firmware_object dahdi-fw-oct6114-064.bin $@
+
+# Build object file of an oct6114 128 firmware image for linking
+dahdi-fw-oct6114-128.o: dahdi-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz dahdi-fw-oct6114-128.bin
+ @echo Making firmware object file for dahdi-fw-oct6114-128.bin
+ ../build_tools/make_firmware_object dahdi-fw-oct6114-128.bin $@
+
+# Build object file of a TC400M firmware image for linking
+dahdi-fw-tc400m.o: dahdi-fw-tc400m-$(TC400M_VERSION).tar.gz dahdi-fw-tc400m.bin
+ @echo Making firmware object file for dahdi-fw-tc400m.bin
+ ../build_tools/make_firmware_object dahdi-fw-tc400m.bin $@
+
+# Build object file of a VPMADT032 firmware image for linking
+dahdi-fw-vpmadt032.o: dahdi-fw-vpmadt032-$(VPMADT032_VERSION).tar.gz dahdi-fw-vpmadt032.bin
+ @echo Making firmware object file for dahdi-fw-vpmadt032.bin
+ ../build_tools/make_firmware_object dahdi-fw-vpmadt032.bin $@
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