summaryrefslogtreecommitdiff
path: root/drivers/dahdi
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 /drivers/dahdi
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
Diffstat (limited to 'drivers/dahdi')
-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
10 files changed, 135 insertions, 11 deletions
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