summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2008-05-21 16:39:13 +0000
committerKevin P. Fleming <kpfleming@digium.com>2008-05-21 16:39:13 +0000
commit0a64510aaa673ebafc3fdf4143f6e8e24252d9ef (patch)
tree4610959d09ef201999a55638b50dd37233fff90b
parenta33ae91627f1dba54d785056ee2ea6541adfc8fa (diff)
rename modules from zt prefixes to dahdi prefixes
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@4319 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--Makefile8
-rw-r--r--drivers/dahdi/Kbuild13
-rw-r--r--drivers/dahdi/dahdi-base.c (renamed from drivers/dahdi/zaptel-base.c)6
-rw-r--r--drivers/dahdi/dahdi_config.h (renamed from drivers/dahdi/zconfig.h)0
-rw-r--r--drivers/dahdi/dahdi_dummy.c (renamed from drivers/dahdi/ztdummy.c)127
-rw-r--r--drivers/dahdi/dahdi_dummy.h (renamed from drivers/dahdi/ztdummy.h)0
-rw-r--r--drivers/dahdi/dahdi_dynamic.c (renamed from drivers/dahdi/ztdynamic.c)0
-rw-r--r--drivers/dahdi/dahdi_dynamic_eth.c (renamed from drivers/dahdi/ztd-eth.c)0
-rw-r--r--drivers/dahdi/dahdi_dynamic_loc.c (renamed from drivers/dahdi/ztd-loc.c)0
-rw-r--r--drivers/dahdi/dahdi_transcode.c (renamed from drivers/dahdi/zttranscode.c)0
-rw-r--r--drivers/dahdi/hpec/hpec_dahdi.h (renamed from drivers/dahdi/hpec/hpec_zaptel.h)0
-rw-r--r--firmware/Makefile201
-rw-r--r--firmware/firmware.xml18
-rw-r--r--include/dahdi/kernel.h2
14 files changed, 359 insertions, 16 deletions
diff --git a/Makefile b/Makefile
index b55b6ed..1f47982 100644
--- a/Makefile
+++ b/Makefile
@@ -146,7 +146,7 @@ prereq: version.h
stackcheck: checkstack modules
./checkstack kernel/*.ko kernel/*/*.ko
-install: all devices install-modules install-firmware
+install: all devices install-modules install-firmware install-include
@echo "###################################################"
@echo "###"
@echo "### Zaptel installed successfully."
@@ -169,8 +169,8 @@ ifeq ($(HOTPLUG_FIRMWARE),yes)
endif
install-include:
- $(INSTALL) -D -m 644 include/dahdi/kernel.h $(DESTDIR)/usr/include/dahdi/kernel.h
- $(INSTALL) -D -m 644 include/dahdi/user.h $(DESTDIR)/usr/include/dahdi/user.h
+ install -D -m 644 include/dahdi/kernel.h $(DESTDIR)/usr/include/dahdi/kernel.h
+ install -D -m 644 include/dahdi/user.h $(DESTDIR)/usr/include/dahdi/user.h
devices:
ifneq (yes,$(DYNFS))
@@ -212,7 +212,7 @@ uninstall-hotplug:
uninstall-modules:
@./build_tools/uninstall-modules $(DESTDIR)/lib/modules/$(KVERS) $(ALL_MODULES)
-install-modules: uninstall-modules
+install-modules: # uninstall-modules
$(KMAKE_INST)
[ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || :
diff --git a/drivers/dahdi/Kbuild b/drivers/dahdi/Kbuild
index 7b1c2f9..84a7372 100644
--- a/drivers/dahdi/Kbuild
+++ b/drivers/dahdi/Kbuild
@@ -2,7 +2,7 @@ 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 zaptel.o ztd-eth.o ztd-loc.o ztdummy.o ztdynamic.o zttranscode.o
+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/
CFLAGS_MODULE += -I$(DAHDI_INCLUDE)
@@ -17,25 +17,25 @@ ifneq (,$(filter $(KVERS),$(BAD_KERNELS)))
EXTRA_CFLAGS+=-Drw_lock_t=rwlock_t
endif
-zaptel-objs := zaptel-base.o
+dahdi-objs := dahdi-base.o
ifeq ($(ARCH),i386)
ifneq ($(wildcard $(src)/hpec/hpec_x86_32.o_shipped),)
HPEC_PRESENT=yes
-zaptel-objs += hpec/hpec_x86_32.o
+dahdi-objs += hpec/hpec_x86_32.o
endif
endif
ifeq ($(ARCH),x86_64)
ifneq ($(wildcard $(src)/hpec/hpec_x86_64.o_shipped),)
HPEC_PRESENT=yes
-zaptel-objs += hpec/hpec_x86_64.o
+dahdi-objs += hpec/hpec_x86_64.o
endif
endif
ifeq ($(HPEC_PRESENT),yes)
EXTRA_CFLAGS += -DECHO_CAN_HPEC -I$(src)/hpec
-$(obj)/zaptel-base.o: $(src)/hpec/hpec_zaptel.h $(src)/hpec/hpec_user.h
+$(obj)/dahdi-base.o: $(src)/hpec/hpec_dahdi.h $(src)/hpec/hpec_user.h
endif
$(obj)/pciradio.o: $(obj)/radfw.h
@@ -52,7 +52,6 @@ $(obj)/radfw.h: $(src)/pciradio.rbt $(obj)/makefw
$(obj)/makefw: $(src)/makefw.c
$(HOSTCC) -o $@ $^
-
# set CONFIG_ZAPTEL_MMX for a number of CPU types.
# Right now this part is not enabled, unless you build with
# ZAPTEL_MMX_AUTO=something .
@@ -69,6 +68,6 @@ ZAPMMX_CONFIG_VALS := $(strip $(foreach var,$(ZAPMMX_CONFIG_VARS),$(var)) )
ifneq (,$(ZAPTEL_MMX_AUTO))
ifneq (,$(ZAPMMX_CONFIG_VALS))
# TODO: make that
- CFLAGS_zaptel-base.o += -DCONFIG_ZAPTEL_MMX
+ CFLAGS_dahdi-base.o += -DCONFIG_ZAPTEL_MMX
endif
endif
diff --git a/drivers/dahdi/zaptel-base.c b/drivers/dahdi/dahdi-base.c
index e86bb84..0408c29 100644
--- a/drivers/dahdi/zaptel-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -35,7 +35,7 @@
*/
-#include "zconfig.h"
+#include "dahdi_config.h"
#include "../version.h"
#include <linux/kernel.h>
@@ -2570,7 +2570,7 @@ static int zt_open(struct inode *inode, struct file *file)
return zt_ctl_open(inode, file);
if (unit == 250) {
if (!zt_transcode_fops)
- request_module("zttranscode");
+ request_module("dahdi_transcode");
if (zt_transcode_fops && zt_transcode_fops->open) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0)
if (zt_transcode_fops->owner) {
@@ -4054,7 +4054,7 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
if (zt_dynamic_ioctl)
return zt_dynamic_ioctl(cmd, data);
else {
- request_module("ztdynamic");
+ request_module("dahdi_dynamic");
if (zt_dynamic_ioctl)
return zt_dynamic_ioctl(cmd, data);
}
diff --git a/drivers/dahdi/zconfig.h b/drivers/dahdi/dahdi_config.h
index 35056e3..35056e3 100644
--- a/drivers/dahdi/zconfig.h
+++ b/drivers/dahdi/dahdi_config.h
diff --git a/drivers/dahdi/ztdummy.c b/drivers/dahdi/dahdi_dummy.c
index ea226ee..3921d46 100644
--- a/drivers/dahdi/ztdummy.c
+++ b/drivers/dahdi/dahdi_dummy.c
@@ -92,8 +92,133 @@
#endif
#include <linux/moduleparam.h>
#endif
-#include "ztdummy.h"
+#include <linux/version.h>
+#if LINUX_VERSION_CODE > KERNEL_VERSION(2,4,19)
+#define USB2420
+#endif
+
+struct ztdummy {
+ struct zt_span span;
+ struct zt_chan chan;
+#ifdef LINUX26
+ unsigned int counter;
+#ifdef USE_RTC
+ spinlock_t rtclock;
+ rtc_task_t rtc_task;
+#endif
+#endif
+};
+
+
+#ifndef LINUX26
+/* Uhci definitions and structures - from file usb-uhci.h */
+#define TD_CTRL_IOC (1 << 24) /* Interrupt on Complete */
+#define USBSTS 2
+
+typedef enum {
+ TD_TYPE, QH_TYPE
+} uhci_desc_type_t;
+
+typedef struct {
+ __u32 link;
+ __u32 status;
+ __u32 info;
+ __u32 buffer;
+} uhci_td_t, *puhci_td_t;
+
+
+typedef struct {
+ __u32 head;
+ __u32 element; /* Queue element pointer */
+} uhci_qh_t, *puhci_qh_t;
+
+typedef struct {
+ union {
+ uhci_td_t td;
+ uhci_qh_t qh;
+ } hw;
+ uhci_desc_type_t type;
+ dma_addr_t dma_addr;
+ struct list_head horizontal;
+ struct list_head vertical;
+ struct list_head desc_list;
+ int last_used;
+} uhci_desc_t, *puhci_desc_t;
+
+typedef struct {
+ struct list_head desc_list; // list pointer to all corresponding TDs/QHs associated with this request
+ dma_addr_t setup_packet_dma;
+ dma_addr_t transfer_buffer_dma;
+ unsigned long started;
+#ifdef USB2420
+ struct urb *next_queued_urb; // next queued urb for this EP
+ struct urb *prev_queued_urb;
+#else
+ urb_t *next_queued_urb;
+ urb_t *prev_queued_urb;
+#endif
+ uhci_desc_t *bottom_qh;
+ uhci_desc_t *next_qh; // next helper QH
+ char use_loop;
+ char flags;
+} urb_priv_t, *purb_priv_t;
+
+struct virt_root_hub {
+ int devnum; /* Address of Root Hub endpoint */
+ void *urb;
+ void *int_addr;
+ int send;
+ int interval;
+ int numports;
+ int c_p_r[8];
+ struct timer_list rh_int_timer;
+};
+
+typedef struct uhci {
+ int irq;
+ unsigned int io_addr;
+ unsigned int io_size;
+ unsigned int maxports;
+ int running;
+
+ int apm_state;
+
+ struct uhci *next; // chain of uhci device contexts
+
+ struct list_head urb_list; // list of all pending urbs
+
+ spinlock_t urb_list_lock; // lock to keep consistency
+
+ int unlink_urb_done;
+ atomic_t avoid_bulk;
+
+ struct usb_bus *bus; // our bus
+
+ __u32 *framelist;
+ dma_addr_t framelist_dma;
+ uhci_desc_t **iso_td;
+ uhci_desc_t *int_chain[8];
+ uhci_desc_t *ls_control_chain;
+ uhci_desc_t *control_chain;
+ uhci_desc_t *bulk_chain;
+ uhci_desc_t *chain_end;
+ uhci_desc_t *td1ms;
+ uhci_desc_t *td32ms;
+ struct list_head free_desc;
+ spinlock_t qh_lock;
+ spinlock_t td_lock;
+ struct virt_root_hub rh; //private data of the virtual root hub
+ int loop_usage; // URBs using bandwidth reclamation
+
+ struct list_head urb_unlinked; // list of all unlinked urbs
+ long timeout_check;
+ int timeout_urbs;
+ struct pci_dev *uhci_pci;
+ struct pci_pool *desc_pool;
+ long last_error_time; // last error output in uhci_interrupt()
+} uhci_t, *puhci_t;
+#endif
static struct ztdummy *ztd;
diff --git a/drivers/dahdi/ztdummy.h b/drivers/dahdi/dahdi_dummy.h
index 25e37c9..25e37c9 100644
--- a/drivers/dahdi/ztdummy.h
+++ b/drivers/dahdi/dahdi_dummy.h
diff --git a/drivers/dahdi/ztdynamic.c b/drivers/dahdi/dahdi_dynamic.c
index 42d6291..42d6291 100644
--- a/drivers/dahdi/ztdynamic.c
+++ b/drivers/dahdi/dahdi_dynamic.c
diff --git a/drivers/dahdi/ztd-eth.c b/drivers/dahdi/dahdi_dynamic_eth.c
index 1795487..1795487 100644
--- a/drivers/dahdi/ztd-eth.c
+++ b/drivers/dahdi/dahdi_dynamic_eth.c
diff --git a/drivers/dahdi/ztd-loc.c b/drivers/dahdi/dahdi_dynamic_loc.c
index 69057a0..69057a0 100644
--- a/drivers/dahdi/ztd-loc.c
+++ b/drivers/dahdi/dahdi_dynamic_loc.c
diff --git a/drivers/dahdi/zttranscode.c b/drivers/dahdi/dahdi_transcode.c
index eaf2f9b..eaf2f9b 100644
--- a/drivers/dahdi/zttranscode.c
+++ b/drivers/dahdi/dahdi_transcode.c
diff --git a/drivers/dahdi/hpec/hpec_zaptel.h b/drivers/dahdi/hpec/hpec_dahdi.h
index 2f90571..2f90571 100644
--- a/drivers/dahdi/hpec/hpec_zaptel.h
+++ b/drivers/dahdi/hpec/hpec_dahdi.h
diff --git a/firmware/Makefile b/firmware/Makefile
new file mode 100644
index 0000000..9c0e126
--- /dev/null
+++ b/firmware/Makefile
@@ -0,0 +1,201 @@
+#
+# Zaptel
+#
+# Makefile for firmware downloading/installation
+#
+# Copyright (C) 2007, 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: zaptel-fw-<base name>-<sub name>-<version> or zaptel-fw-<base name>-<version>
+# First example: zaptel-fw-oct6114-064-1.05.01
+# This means this is version 1.05.01 of the oct6114 64 firmware
+# Second example: zaptel-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=zaptel-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz)
+FIRMWARE:=$(FIRMWARE:FIRMWARE-OCT6114-128=zaptel-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz)
+FIRMWARE:=$(FIRMWARE:FIRMWARE-TC400M=zaptel-fw-tc400m-$(TC400M_VERSION).tar.gz)
+FIRMWARE:=$(FIRMWARE:FIRMWARE-VPMADT032=zaptel-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=zaptel-fw-oct6114-064.o)
+OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-OCT6114-128=zaptel-fw-oct6114-128.o)
+OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-TC400M=zaptel-fw-tc400m.o)
+OBJECT_FILES:=$(OBJECT_FILES:FIRMWARE-VPMADT032=zaptel-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
+zaptel-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/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-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 zaptel-fw-oct6114-064.bin to hotplug firmware directories"
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
+ rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-*; \
+ touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION); \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-oct6114-064.bin $(DESTDIR)/lib/firmware; \
+ rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-*; \
+ touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-064-$(OCT6114_064_VERSION); \
+ fi
+endif
+else
+ @echo "Firmware zaptel-fw-oct6114-064.bin is already installed with required version $(OCT6114_064_VERSION)"
+endif
+
+zaptel-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/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-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 zaptel-fw-oct6114-128.bin to hotplug firmware directories"
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
+ rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-*; \
+ touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION); \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-oct6114-128.bin $(DESTDIR)/lib/firmware; \
+ rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-*; \
+ touch $(DESTDIR)/lib/firmware/.zaptel-fw-oct6114-128-$(OCT6114_128_VERSION); \
+ fi
+endif
+else
+ @echo "Firmware zaptel-fw-oct6114-128.bin is already installed with required version $(OCT6114_128_VERSION)"
+endif
+
+zaptel-fw-tc400m-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-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 zaptel-fw-tc400m.bin to hotplug firmware directories"
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
+ rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-*; \
+ touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION); \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-tc400m.bin $(DESTDIR)/lib/firmware; \
+ rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-*; \
+ touch $(DESTDIR)/lib/firmware/.zaptel-fw-tc400m-$(TC400M_VERSION); \
+ fi
+endif
+else
+ @echo "Firmware zaptel-fw-tc400m.bin is already installed with required version $(TC400M_VERSION)"
+endif
+
+zaptel-fw-vpmadt032-%.tar.gz: have_download
+ifeq ($(shell if ( [ "$(HOTPLUG_FIRMWARE)" = "no" ] ) || ( [ -d $(DESTDIR)/usr/lib/hotplug/firmware ] && ! [ -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION) ] ) || ( [ -d $(DESTDIR)/lib/firmware ] && ! [ -f $(DESTDIR)/lib/firmware/.zaptel-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 zaptel-fw-vpmadt032.bin to hotplug firmware directories"
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/usr/lib/hotplug/firmware; \
+ rm -rf $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-*; \
+ touch $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION); \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ $(INSTALL) -m 644 zaptel-fw-vpmadt032.bin $(DESTDIR)/lib/firmware; \
+ rm -rf $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-*; \
+ touch $(DESTDIR)/lib/firmware/.zaptel-fw-vpmadt032-$(VPMADT032_VERSION); \
+ fi
+endif
+else
+ @echo "Firmware zaptel-fw-vpmadt032.bin is already installed with required version $(VPMADT032_VERSION)"
+endif
+
+# Clean up any downloaded/extracted firmware packages
+dist-clean: clean
+ rm -f zaptel-fw-*.bin
+ rm -f zaptel-fw-*.tar.gz
+
+# Clean up anything we built
+clean:
+ rm -f zaptel-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 zaptel firmware images from hotplug firmware directories
+hotplug-uninstall:
+ if [ -d $(DESTDIR)/usr/lib/hotplug/firmware ]; then \
+ rm -f $(DESTDIR)/usr/lib/hotplug/firmware/zaptel-fw-*.bin; \
+ rm -f $(DESTDIR)/usr/lib/hotplug/firmware/.zaptel-fw*; \
+ fi
+ if [ -d $(DESTDIR)/lib/firmware ]; then \
+ rm -f $(DESTDIR)/lib/firmware/zaptel-fw-*.bin; \
+ rm -f $(DESTDIR)/lib/firmware/.zaptel-fw*; \
+ fi
+
+# Build object file of an oct6114 064 firmware image for linking
+zaptel-fw-oct6114-064.o: zaptel-fw-oct6114-064-$(OCT6114_064_VERSION).tar.gz zaptel-fw-oct6114-064.bin
+ @echo Making firmware object file for zaptel-fw-oct6114-064.bin
+ ../build_tools/make_firmware_object zaptel-fw-oct6114-064.bin $@
+
+# Build object file of an oct6114 128 firmware image for linking
+zaptel-fw-oct6114-128.o: zaptel-fw-oct6114-128-$(OCT6114_128_VERSION).tar.gz zaptel-fw-oct6114-128.bin
+ @echo Making firmware object file for zaptel-fw-oct6114-128.bin
+ ../build_tools/make_firmware_object zaptel-fw-oct6114-128.bin $@
+
+# Build object file of a TC400M firmware image for linking
+zaptel-fw-tc400m.o: zaptel-fw-tc400m-$(TC400M_VERSION).tar.gz zaptel-fw-tc400m.bin
+ @echo Making firmware object file for zaptel-fw-tc400m.bin
+ ../build_tools/make_firmware_object zaptel-fw-tc400m.bin $@
+
+# Build object file of a VPMADT032 firmware image for linking
+zaptel-fw-vpmadt032.o: zaptel-fw-vpmadt032-$(VPMADT032_VERSION).tar.gz zaptel-fw-vpmadt032.bin
+ @echo Making firmware object file for zaptel-fw-vpmadt032.bin
+ ../build_tools/make_firmware_object zaptel-fw-vpmadt032.bin $@
diff --git a/firmware/firmware.xml b/firmware/firmware.xml
new file mode 100644
index 0000000..cedafd1
--- /dev/null
+++ b/firmware/firmware.xml
@@ -0,0 +1,18 @@
+ <category name="MENUSELECT_FIRMWARE" displayname="Binary Firmware Packages" positive_output="yes">
+ <member name="FIRMWARE-OCT6114-064" displayname="Digium VPMOCT064M" >
+ <defaultenabled>yes</defaultenabled>
+ <depend>wct4xxp</depend>
+ </member>
+ <member name="FIRMWARE-OCT6114-128" displayname="Digium VPMOCT128M/VPM450M">
+ <defaultenabled>yes</defaultenabled>
+ <depend>wct4xxp</depend>
+ </member>
+ <member name="FIRMWARE-TC400M" displayname="Digium TC400M" >
+ <defaultenabled>yes</defaultenabled>
+ <depend>wctc4xxp</depend>
+ </member>
+ <member name="FIRMWARE-VPMADT032" displayname="Digium VPMADT032" >
+ <defaultenabled>yes</defaultenabled>
+ <depend>wctdm24xxp</depend>
+ </member>
+ </category>
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 81f7946..7d3d793 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -29,7 +29,7 @@
#define _LINUX_ZAPTEL_H
#ifdef __KERNEL__
-#include "zconfig.h"
+#include "dahdi_config.h"
#include <linux/version.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,18)
#include <linux/config.h>