summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Knoblich <stkn@gentoo.org>2005-07-29 01:12:44 +0000
committerStefan Knoblich <stkn@gentoo.org>2005-07-29 01:12:44 +0000
commit630d3b4c593f9e70ba0d31de569401fd11af9ea3 (patch)
tree04ece3cd6572029fa2892316c7fa0b416d39242f /net-misc/zaptel
parentAdded local useflag rtc for net-misc/zaptel (diff)
downloadgentoo-2-630d3b4c593f9e70ba0d31de569401fd11af9ea3.tar.gz
gentoo-2-630d3b4c593f9e70ba0d31de569401fd11af9ea3.tar.bz2
gentoo-2-630d3b4c593f9e70ba0d31de569401fd11af9ea3.zip
Version bump and cleanup
(Portage version: 2.0.51.19)
Diffstat (limited to 'net-misc/zaptel')
-rw-r--r--net-misc/zaptel/ChangeLog11
-rw-r--r--net-misc/zaptel/files/digest-zaptel-1.0.9_p13
-rw-r--r--net-misc/zaptel/files/zaptel-1.0.0-modulesd.diff43
-rw-r--r--net-misc/zaptel/files/zaptel-1.0.1-modulesd.diff41
-rw-r--r--net-misc/zaptel/files/zaptel-1.0.1-skbuff.diff15
-rw-r--r--net-misc/zaptel/files/zaptel-1.0.9-gentoo.diff103
-rw-r--r--net-misc/zaptel/files/zaptel-1.0.9-rtc.patch170
-rw-r--r--net-misc/zaptel/files/zaptel-bristuff-0.2.0-RC8l.patch174
-rw-r--r--net-misc/zaptel/files/zaptel-install_prefix-typo.patch11
-rw-r--r--net-misc/zaptel/files/zaptel-mkdir-usrincludelinux.patch11
-rw-r--r--net-misc/zaptel/zaptel-1.0.9_p1.ebuild236
11 files changed, 696 insertions, 122 deletions
diff --git a/net-misc/zaptel/ChangeLog b/net-misc/zaptel/ChangeLog
index 8c710ff265e2..c5e23edf9a62 100644
--- a/net-misc/zaptel/ChangeLog
+++ b/net-misc/zaptel/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for net-misc/zaptel
# Copyright 2000-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.53 2005/07/25 23:49:43 stkn Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/ChangeLog,v 1.54 2005/07/29 01:12:43 stkn Exp $
+
+*zaptel-1.0.9_p1 (28 Jul 2005)
+
+ 28 Jul 2005; <stkn@gentoo.org> +files/zaptel-bristuff-0.2.0-RC8l.patch,
+ -files/zaptel-1.0.0-modulesd.diff, -files/zaptel-1.0.1-modulesd.diff,
+ -files/zaptel-1.0.1-skbuff.diff, +files/zaptel-1.0.9-gentoo.diff,
+ +files/zaptel-1.0.9-rtc.patch, -files/zaptel-install_prefix-typo.patch,
+ -files/zaptel-mkdir-usrincludelinux.patch, +zaptel-1.0.9_p1.ebuild:
+ Version bump and unused files cleanup.
26 Jul 2005; <stkn@gentoo.org> files/zaptel.devfsd:
Updated devfsd rules file, fixes incorrect permissions on span subdirectories.
diff --git a/net-misc/zaptel/files/digest-zaptel-1.0.9_p1 b/net-misc/zaptel/files/digest-zaptel-1.0.9_p1
new file mode 100644
index 000000000000..5bf41cd1aaf4
--- /dev/null
+++ b/net-misc/zaptel/files/digest-zaptel-1.0.9_p1
@@ -0,0 +1,3 @@
+MD5 f29205a100d2f7bede64aaf039577677 zaptel-1.0.9.1.tar.gz 326603
+MD5 1ec812a912de461b6847c64a88b70d1e bristuff-0.2.0-RC8l.tar.gz 141245
+MD5 717f869f45ec20ceda216285cd90455a zaphfc_0.2.0-RC8j_florz-8.diff.gz 10559
diff --git a/net-misc/zaptel/files/zaptel-1.0.0-modulesd.diff b/net-misc/zaptel/files/zaptel-1.0.0-modulesd.diff
deleted file mode 100644
index 3c9d2f8de4d1..000000000000
--- a/net-misc/zaptel/files/zaptel-1.0.0-modulesd.diff
+++ /dev/null
@@ -1,43 +0,0 @@
---- Makefile.orig 2004-05-03 01:10:37.392241008 +0200
-+++ Makefile 2004-05-03 01:11:30.235207656 +0200
-@@ -33,7 +33,8 @@
- INSTALL_PREFIX=
-
- BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
--MODCONF=$(shell if [ -d $(INSTALL_PREFIX)/etc/modprobe.d ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(INSTALL_PREFIX)/etc/modutils ]; then echo "$(INSTALL_PREFIX)/etc/modutils/zaptel"; elif [ -f $(INSTALL_PREFIX)/etc/modprobe.conf ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.conf"; elif [ -f $(INSTALL_PREFIX)/etc/modules.conf ]; then echo "$(INSTALL_PREFIX)/etc/modules.conf"; else echo $(INSTALL_PREFIX)/etc/conf.modules ; fi)
-+# Patch for Gentoo, uses modules.d
-+MODCONF=$(INSTALL_PREFIX)/etc/modules.d/zaptel
-
- ifeq (${BUILDVER},linux24)
- #We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4
-@@ -272,6 +273,7 @@
- install -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include
- ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
- /sbin/ldconfig
-+ mkdir -p $(INSTALL_PREFIX)/etc/modules.d
- if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
- cat $(MODCONF).bak | grep -v "alias char-major-250" | \
- grep -v "post-install torisa /sbin/ztcfg" | \
-@@ -296,10 +298,6 @@
- fi; \
- done
-
-- if [ -d /etc/modutils ]; then \
-- /sbin/update-modules ; \
-- fi
-- -/sbin/depmod -a
- [ -f $(INSTALL_PREFIX)/etc/zaptel.conf ] || install -m 644 zaptel.conf.sample $(INSTALL_PREFIX)/etc/zaptel.conf
-
- config:
---- Makefile.orig 2004-05-03 01:16:52.352238424 +0200
-+++ Makefile 2004-05-03 01:17:09.821582680 +0200
-@@ -64,8 +64,7 @@
-
- linux26:
- linux26: prereq $(BINS)
-- @if ! [ -d /usr/src/linux-2.6 ]; then echo "Link /usr/src/linux-2.6 to your kernel sources first!"; exit 1 ; fi
-- make -C /usr/src/linux-2.6 SUBDIRS=$(PWD) modules
-+ make -C /usr/src/linux SUBDIRS=$(PWD) modules
-
- obj-m := $(MODULESO)
-
diff --git a/net-misc/zaptel/files/zaptel-1.0.1-modulesd.diff b/net-misc/zaptel/files/zaptel-1.0.1-modulesd.diff
deleted file mode 100644
index 316c3cd61681..000000000000
--- a/net-misc/zaptel/files/zaptel-1.0.1-modulesd.diff
+++ /dev/null
@@ -1,41 +0,0 @@
---- Makefile.orig 2004-10-02 18:18:32.384754608 -0400
-+++ Makefile 2004-10-02 18:19:41.581235144 -0400
-@@ -37,7 +37,8 @@
- CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
-
- BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
--MODCONF=$(shell if [ -d $(INSTALL_PREFIX)/etc/modprobe.d ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(INSTALL_PREFIX)/etc/modutils ]; then echo "$(INSTALL_PREFIX)/etc/modutils/zaptel"; elif [ -f $(INSTALL_PREFIX)/etc/modprobe.conf ]; then echo "$(INSTALL_PREFIX)/etc/modprobe.conf"; elif [ -f $(INSTALL_PREFIX)/etc/modules.conf ]; then echo "$(INSTALL_PREFIX)/etc/modules.conf"; else echo $(INSTALL_PREFIX)/etc/conf.modules ; fi)
-+# Patch for Gentoo, uses modules.d
-+MODCONF=$(INSTALL_PREFIX)/etc/modules.d/zaptel
-
- ifeq (${BUILDVER},linux24)
- #We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4
-@@ -72,8 +73,7 @@
-
- linux26:
- linux26: prereq $(BINS)
-- @if ! [ -d /usr/src/linux-2.6 ]; then echo "Link /usr/src/linux-2.6 to your kernel sources first!"; exit 1 ; fi
-- make -C /usr/src/linux-2.6 SUBDIRS=$(PWD) modules
-+ make -C /usr/src/linux SUBDIRS=$(PWD) modules
-
- obj-m := $(MODULESO) ztdummy.o
-
-@@ -285,6 +285,7 @@
- install -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include
- ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
- /sbin/ldconfig
-+ mkdir -p $(INSTALL_PREFIX)/etc/modules.d
- if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
- cat $(MODCONF).bak | grep -v "alias char-major-250" | \
- grep -v "post-install torisa /sbin/ztcfg" | \
-@@ -309,10 +310,6 @@
- fi; \
- done
-
-- if [ -d /etc/modutils ]; then \
-- /sbin/update-modules ; \
-- fi
-- -/sbin/depmod -a
- [ -f $(CONFIG_FILE) ] || install -m 644 zaptel.conf.sample $(CONFIG_FILE)
-
- config:
diff --git a/net-misc/zaptel/files/zaptel-1.0.1-skbuff.diff b/net-misc/zaptel/files/zaptel-1.0.1-skbuff.diff
deleted file mode 100644
index 5844aaf7b237..000000000000
--- a/net-misc/zaptel/files/zaptel-1.0.1-skbuff.diff
+++ /dev/null
@@ -1,15 +0,0 @@
---- zaptel-1.0.1-orig/ztd-eth.c 2004-08-16 13:27:12.000000000 -0400
-+++ zaptel/ztd-eth.c 2004-10-12 23:36:01.000000000 -0400
-@@ -86,7 +86,11 @@
- struct zt_span *span;
- struct ztdeth_header *zh;
- zh = (struct ztdeth_header *)skb->nh.raw;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,9)
-+ span = ztdeth_getspan(eth_hdr(skb)->h_source, zh->subaddr);
-+#else
- span = ztdeth_getspan(skb->mac.ethernet->h_source, zh->subaddr);
-+#endif
- if (span) {
- skb_pull(skb, sizeof(struct ztdeth_header));
- zt_dynamic_receive(span, (unsigned char *)skb->data, skb->len);
-
diff --git a/net-misc/zaptel/files/zaptel-1.0.9-gentoo.diff b/net-misc/zaptel/files/zaptel-1.0.9-gentoo.diff
new file mode 100644
index 000000000000..da388ecff467
--- /dev/null
+++ b/net-misc/zaptel/files/zaptel-1.0.9-gentoo.diff
@@ -0,0 +1,103 @@
+--- zaptel-1.0.9.1/Makefile.orig 2005-07-25 14:42:56.000000000 +0000
++++ zaptel-1.0.9.1/Makefile 2005-07-26 01:10:55.000000000 +0000
+@@ -13,13 +13,13 @@
+ # (assuming He's running Linux -- which we all know He must).
+ #
+ HOSTCC=gcc
+-KINCLUDES=$(shell if [ -d /usr/src/linux-2.4/include ]; then echo /usr/src/linux-2.4/include ; else echo /usr/src/linux/include ; fi)
++KINCLUDES=/usr/src/linux/include
+
+-CFLAGS+=-I. -O4 -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
++CFLAGS+=-I. -g -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
+ CFLAGS+=$(shell if uname -m | grep -q ppc; then echo "-fsigned-char"; fi)
+ CFLAGS+=$(shell if uname -m | grep -q x86_64; then echo "-m64"; fi)
+ LCFLAGS=-fPIC $(CFLAGS) -DBUILDING_TONEZONE
+-KFLAGS+=-I/usr/src/linux-2.4/include -O6
++KFLAGS+=-I/usr/src/linux/include -O6
+ KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I/usr/src/linux/drivers/net \
+ -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I/usr/src/linux/drivers/net/wan -I /usr/src/linux/include -I/usr/src/linux/include/net
+ KFLAGS+=$(shell if [ -f $(KINCLUDES)/linux/modversions.h ] ; then echo "-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h" ; fi)
+@@ -38,8 +38,8 @@
+ CONFIG_FILE=$(INSTALL_PREFIX)/etc/zaptel.conf
+ CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\"
+
+-BUILDVER=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
+-MODCONF=$(shell if [ -d $(ROOT_PREFIX)/etc/modprobe.d ]; then echo "$(ROOT_PREFIX)/etc/modprobe.d/zaptel"; elif [ -d $(ROOT_PREFIX)/etc/modutils ]; then echo "$(ROOT_PREFIX)/etc/modutils/zaptel"; elif [ -f $(ROOT_PREFIX)/etc/modprobe.conf ]; then echo "$(ROOT_PREFIX)/etc/modprobe.conf"; elif [ -f $(ROOT_PREFIX)/etc/modules.conf ]; then echo "$(ROOT_PREFIX)/etc/modules.conf"; else echo $(ROOT_PREFIX)/etc/conf.modules ; fi)
++BUILDVER?=$(shell if uname -r | grep -q ^2.6; then echo "linux26"; else echo "linux24"; fi)
++MODCONF=$(INSTALL_PREFIX)/etc/modules.d/zaptel
+
+ ifeq (${BUILDVER},linux24)
+ #We only support DEVFS in linux 2.4 kernels, since its considered obsolete post 2.4
+@@ -58,7 +58,7 @@
+ TZOBJS=zonedata.lo tonezone.lo
+ LIBTONEZONE=libtonezone.so.1.0
+ MODULES=zaptel tor2 torisa wcusb wcfxo wcfxs \
+- ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp # ztdummy
++ ztdynamic ztd-eth wct1xxp wct4xxp wcte11xp ztdummy
+ #MODULES+=wcfxsusb
+
+ MODULESO=$(shell for x in $(MODULES); do echo "$$x.o "; done )
+@@ -71,7 +71,7 @@
+ PRIMARY=torisa
+ #PRIMARY=wcfxo
+ PWD=$(shell pwd)
+-KERNEL_SOURCE?=/lib/modules/`uname -r`/build
++KERNEL_SOURCE?=/usr/src/linux
+
+ all: $(BUILDVER) $(LIBTONEZONE)
+
+@@ -262,7 +262,7 @@
+ @echo "**** If you are running udev, read README.udev"
+ endif
+
+-install: all devices
++install: devices
+ install -D -m 755 ztcfg $(INSTALL_PREFIX)/sbin/ztcfg
+ if [ -f sethdlc-new ]; then \
+ install -D -m 755 sethdlc-new $(INSTALL_PREFIX)/sbin/sethdlc; \
+@@ -286,44 +286,23 @@
+ fi; \
+ fi
+ install -D -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE)
+- if [ -x /usr/sbin/sestatus ] && (/usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled") ; then restorecon -v $(INSTALL_PREFIX)/usr/lib/$(LIBTONEZONE); fi
+ install -D -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux/zaptel.h
+ install -D -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux/torisa.h
+ install -D -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include/tonezone.h
+ ( cd $(INSTALL_PREFIX)/usr/lib ; rm -f libtonezone.so ; ln -sf $(LIBTONEZONE) libtonezone.so )
+- [ `id -u` = 0 ] && /sbin/ldconfig || :
+- if [ -f $(MODCONF) ]; then mv -f $(MODCONF) $(MODCONF).bak ; fi
+- cat $(MODCONF).bak | grep -v "alias char-major-250" | \
+- grep -v "post-install torisa /sbin/ztcfg" | \
+- grep -v "post-install wcfxsusb /sbin/ztcfg" | \
+- grep -v "post-install wcfxs /sbin/ztcfg" > $(MODCONF) || true
++ if [ ! -d `dirname $(MODCONF)` ]; then install -d -m 755 `dirname $(MODCONF)` ; fi
+ if ! grep "options torisa" $(MODCONF); then \
+ echo "options torisa base=$(BASEADDR)" >> $(MODCONF); \
+ fi
+ if ! grep "alias char-major-196" $(MODCONF); then \
+ echo "alias char-major-196 $(PRIMARY)" >> $(MODCONF); \
+ fi
+- for x in $(MODULES); do \
+- if ! grep "post-install $$x" $(MODCONF); then \
+- if ! grep "install $$x " $(MODCONF); then \
+- if [ "$$x" != "zaptel" ] ; then \
+- if [ -f zaptel.ko ]; then echo "install $$x /sbin/modprobe --ignore-install $$x && /sbin/ztcfg" >> $(MODCONF); \
+- else echo "post-install $$x /sbin/ztcfg" >> $(MODCONF); \
+- fi; \
+- fi; \
+- fi; \
+- fi; \
+- done
+ if ! grep "alias wctdm" $(MODCONF); then \
+ echo "alias wctdm wcfxs" >> $(MODCONF); \
+ fi
+ if ! grep "alias wct2xxp" $(MODCONF); then \
+ echo "alias wct2xxp wct4xxp" >> $(MODCONF); \
+ fi
+- if [ -d /etc/modutils ]; then \
+- /sbin/update-modules ; \
+- fi
+- [ `id -u` = 0 ] && /sbin/depmod -a || :
+ [ -f $(CONFIG_FILE) ] || install -D -m 644 zaptel.conf.sample $(CONFIG_FILE)
+
+ config:
diff --git a/net-misc/zaptel/files/zaptel-1.0.9-rtc.patch b/net-misc/zaptel/files/zaptel-1.0.9-rtc.patch
new file mode 100644
index 000000000000..a3adaa111c79
--- /dev/null
+++ b/net-misc/zaptel/files/zaptel-1.0.9-rtc.patch
@@ -0,0 +1,170 @@
+Index: ztdummy.c
+===================================================================
+RCS file: /usr/cvsroot/zaptel/ztdummy.c,v
+retrieving revision 1.4.2.4
+diff -u -r1.4.2.4 ztdummy.c
+--- ztdummy.c 21 Jan 2005 05:05:18 -0000 1.4.2.4
++++ ztdummy.c 21 May 2005 21:53:28 -0000
+@@ -6,6 +6,7 @@
+ * Written by Robert Pleh <robert.pleh@hermes.si>
+ * 2.6 version by Tony Hoyle
+ * Unified by Mark Spencer <markster@digium.com>
++ * Converted to use RTC on i386 by Tony Mountifield <tony@softins.co.uk>
+ *
+ * Copyright (C) 2002, Hermes Softlab
+ * Copyright (C) 2004, Digium, Inc.
+@@ -38,6 +39,15 @@
+ # error "This kernel is too old: not supported by this file"
+ #endif
+
++/*
++ * NOTE: (only applies to kernel 2.6)
++ * If using an i386 architecture without a PC real-time clock,
++ * the #define USE_RTC should be commented out.
++ */
++#if defined(__i386__) || defined(__x86_64__)
++#define USE_RTC
++#endif
++
+ #include <linux/kernel.h>
+ #include <linux/errno.h>
+ #include <linux/module.h>
+@@ -54,6 +64,9 @@
+ #include <asm/io.h>
+ #endif
+ #ifdef LINUX26
++#ifdef USE_RTC
++#include <linux/rtc.h>
++#endif
+ #include <linux/moduleparam.h>
+ #endif
+ #include "ztdummy.h"
+@@ -77,8 +90,10 @@
+ static int debug = 0;
+
+ #ifdef LINUX26
++#ifndef USE_RTC
+ /* New 2.6 kernel timer stuff */
+ static struct timer_list timer;
++#endif
+ #else
+ #if LINUX_VERSION_CODE < VERSION_CODE(2,4,5)
+ # error "This kernel is too old: not supported by this file"
+@@ -103,6 +118,28 @@
+
+
+ #ifdef LINUX26
++#ifdef USE_RTC
++/* rtc_interrupt - called at 1024Hz from hook in RTC handler */
++static void rtc_interrupt(void *private_data)
++{
++ struct ztdummy *ztd = private_data;
++ unsigned int ticks;
++
++ atomic_inc(&ztd->ticks);
++ ticks = atomic_read(&ztd->ticks);
++ if (ticks == 42 || ticks == 85) {
++ /* skip it */
++ } else if (ticks >= 128) {
++ /* skip and restart count */
++ atomic_set(&ztd->ticks, 0);
++ } else {
++ /* zaptel timing - called in 125 of every 128 interrupts = 1000Hz */
++ zt_receive(&ztd->span);
++ zt_transmit(&ztd->span);
++ }
++}
++#else
++/* use kernel system tick timer if PC architecture RTC is not available */
+ static void ztdummy_timer(unsigned long param)
+ {
+ zt_receive(&ztd->span);
+@@ -110,6 +147,7 @@
+ timer.expires = jiffies + 1;
+ add_timer(&timer);
+ }
++#endif
+ #else
+ static void ztdummy_interrupt(int irq, void *dev_id, struct pt_regs *regs)
+ {
+@@ -150,7 +188,11 @@
+
+ int init_module(void)
+ {
+-#ifndef LINUX26
++#ifdef LINUX26
++#ifdef USE_RTC
++ int err;
++#endif
++#else
+ int irq;
+ spinlock_t mylock = SPIN_LOCK_UNLOCKED;
+
+@@ -180,10 +222,25 @@
+ }
+
+ #ifdef LINUX26
++#ifdef USE_RTC
++ atomic_set(&ztd->ticks, 0);
++ ztd->rtc_task.func = rtc_interrupt;
++ ztd->rtc_task.private_data = ztd;
++ err = rtc_register(&ztd->rtc_task);
++ if (err < 0) {
++ printk("ztdummy: Unable to register zaptel rtc driver\n");
++ zt_unregister(&ztd->span);
++ kfree(ztd);
++ return err;
++ }
++ rtc_control(&ztd->rtc_task, RTC_IRQP_SET, 1024); /* 1024 Hz */
++ rtc_control(&ztd->rtc_task, RTC_PIE_ON, 0);
++#else
+ init_timer(&timer);
+ timer.function = ztdummy_timer;
+ timer.expires = jiffies + 1;
+ add_timer(&timer);
++#endif
+ #else
+ irq=s->irq;
+ spin_lock_irq(&mylock);
+@@ -214,7 +271,12 @@
+ void cleanup_module(void)
+ {
+ #ifdef LINUX26
++#ifdef USE_RTC
++ rtc_control(&ztd->rtc_task, RTC_PIE_OFF, 0);
++ rtc_unregister(&ztd->rtc_task);
++#else
+ del_timer(&timer);
++#endif
+ #else
+ free_irq(s->irq, ztd); /* disable interrupts */
+ #endif
+Index: ztdummy.h
+===================================================================
+RCS file: /usr/cvsroot/zaptel/ztdummy.h,v
+retrieving revision 1.2
+diff -u -r1.2 ztdummy.h
+--- ztdummy.h 24 Feb 2003 06:00:31 -0000 1.2
++++ ztdummy.h 21 May 2005 21:53:28 -0000
+@@ -32,9 +32,16 @@
+ struct ztdummy {
+ struct zt_span span;
+ struct zt_chan chan;
++#ifdef LINUX26
++#ifdef USE_RTC
++ atomic_t ticks;
++ 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
+@@ -141,3 +148,4 @@
+ struct pci_pool *desc_pool;
+ long last_error_time; // last error output in uhci_interrupt()
+ } uhci_t, *puhci_t;
++#endif
diff --git a/net-misc/zaptel/files/zaptel-bristuff-0.2.0-RC8l.patch b/net-misc/zaptel/files/zaptel-bristuff-0.2.0-RC8l.patch
new file mode 100644
index 000000000000..3b2037261d5c
--- /dev/null
+++ b/net-misc/zaptel/files/zaptel-bristuff-0.2.0-RC8l.patch
@@ -0,0 +1,174 @@
+diff -ur zaptel-1.0.9.orig/zaptel.c zaptel-1.0.9/zaptel.c
+--- zaptel-1.0.9.orig/zaptel.c 2005-06-15 23:31:22.000000000 +0200
++++ zaptel-1.0.9/zaptel.c 2005-07-03 13:36:31.000000000 +0200
+@@ -4851,11 +4851,40 @@
+ *(txb++) = fasthdlc_tx_run_nocheck(&ms->txhdlc);
+ }
+ bytes -= left;
++#ifdef CONFIG_ZAPATA_BRI_DCHANS
++ } else if (ms->flags & ZT_FLAG_BRIDCHAN) {
++ /*
++ * Let's get this right, we want to transmit complete frames only.
++ * The card driver will do the dirty HDLC work for us.
++ * txb (transmit buffer) is supposed to be big enough to store one frame
++ * we will make this as big as the D fifo (1KB or 2KB)
++ */
++
++ /* there are 'left' bytes in the user buffer left to transmit */
++ left = ms->writen[ms->outwritebuf] - ms->writeidx[ms->outwritebuf] - 2;
++ if (left > ms->maxbytes2transmit) {
++ memcpy(txb, buf + ms->writeidx[ms->outwritebuf], ms->maxbytes2transmit);
++ ms->writeidx[ms->outwritebuf] += ms->maxbytes2transmit;
++ txb += ms->maxbytes2transmit;
++ ms->bytes2transmit = ms->maxbytes2transmit;
++ ms->eoftx = 0;
++ } else {
++ memcpy(txb, buf + ms->writeidx[ms->outwritebuf], left);
++ ms->writeidx[ms->outwritebuf] += left + 2;
++ txb += left;
++ ms->bytes2transmit = left;
++ ms->eoftx = 1;
++ }
++ bytes = 0;
++#endif
+ } else {
+ memcpy(txb, buf + ms->writeidx[ms->outwritebuf], left);
+ ms->writeidx[ms->outwritebuf]+=left;
+ txb += left;
+ bytes -= left;
++#if defined(CONFIG_ZAPATA_BRI_DCHANS)
++ ms->bytes2transmit=ZT_CHUNKSIZE;
++#endif
+ }
+ /* Check buffer status */
+ if (ms->writeidx[ms->outwritebuf] >= ms->writen[ms->outwritebuf]) {
+@@ -4900,6 +4929,17 @@
+ /* Transmit a flag if this is an HDLC channel */
+ if (ms->flags & ZT_FLAG_HDLC)
+ fasthdlc_tx_frame_nocheck(&ms->txhdlc);
++#if defined(CONFIG_ZAPATA_BRI_DCHANS)
++ if(ms->flags & ZT_FLAG_BRIDCHAN) {
++ // if (ms->bytes2transmit > 0) {
++ // txb += 2;
++ // ms->bytes2transmit -= 2;
++ bytes=0;
++ ms->eoftx = 1;
++// printk(KERN_CRIT "zaptel EOF(%d) bytes2transmit %d\n",ms->eoftx,ms->bytes2transmit);
++ // }
++ }
++#endif
+ #ifdef CONFIG_ZAPATA_NET
+ if (ms->flags & ZT_FLAG_NETDEV)
+ netif_wake_queue(ztchan_to_dev(ms));
+@@ -4910,7 +4950,7 @@
+ tasklet_schedule(&ms->ppp_calls);
+ }
+ #endif
+- }
++ }
+ } else if (ms->curtone && !(ms->flags & ZT_FLAG_PSEUDO)) {
+ left = ms->curtone->tonesamples - ms->tonep;
+ if (left > bytes)
+@@ -4948,8 +4988,17 @@
+ } else if (ms->flags & ZT_FLAG_CLEAR) {
+ /* Clear channels should idle with 0xff for the sake
+ of silly PRI's that care about idle B channels */
++#if defined(CONFIG_ZAPATA_BRI_DCHANS)
++ // ms->bytes2transmit=0;
++#endif
+ memset(txb, 0xff, bytes);
+ bytes = 0;
++#if defined(CONFIG_ZAPATA_BRI_DCHANS)
++ } else if(ms->flags & ZT_FLAG_BRIDCHAN) {
++ // ms->bytes2transmit = ZT_CHUNKSIZE - bytes;
++ bytes = 0;
++ if (ms->bytes2transmit > 0) printk(KERN_CRIT "bytes2transmit %d\n",ms->bytes2transmit);
++#endif
+ } else {
+ memset(txb, ZT_LIN2X(0, ms), bytes); /* Lastly we use silence on telephony channels */
+ bytes = 0;
+@@ -5648,6 +5697,13 @@
+ int left, x;
+
+ int bytes = ZT_CHUNKSIZE;
++#if defined(CONFIG_ZAPATA_BRI_DCHANS)
++ if (ms->flags & ZT_FLAG_BRIDCHAN) {
++ bytes = ms->bytes2receive;
++ if (bytes < 1) return;
++// printk(KERN_CRIT "bytes2receive %d\n",ms->bytes2receive);
++ }
++#endif
+
+ while(bytes) {
+ #if defined(CONFIG_ZAPATA_NET) || defined(CONFIG_ZAPATA_PPP)
+@@ -5706,6 +5762,19 @@
+ }
+ }
+ }
++#ifdef CONFIG_ZAPATA_BRI_DCHANS
++ } else if (ms->flags & ZT_FLAG_BRIDCHAN) {
++ memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
++ rxb += left;
++ ms->readidx[ms->inreadbuf] += left;
++ bytes -= left;
++ if (ms->eofrx == 1) {
++ eof=1;
++ }
++// printk(KERN_CRIT "receiving %d bytes\n",ms->bytes2receive);
++ ms->bytes2receive = 0;
++ ms->eofrx = 0;
++#endif
+ } else {
+ /* Not HDLC */
+ memcpy(buf + ms->readidx[ms->inreadbuf], rxb, left);
+diff -ur zaptel-1.0.9.orig/zaptel.h zaptel-1.0.9/zaptel.h
+--- zaptel-1.0.9.orig/zaptel.h 2005-06-15 23:31:22.000000000 +0200
++++ zaptel-1.0.9/zaptel.h 2005-07-03 13:36:31.000000000 +0200
+@@ -956,6 +956,13 @@
+ int do_ppp_error;
+ struct sk_buff_head ppp_rq;
+ #endif
++#ifdef CONFIG_ZAPATA_BRI_DCHANS
++ int bytes2receive;
++ int maxbytes2transmit; /* size of the tx buffer in the card driver */
++ int bytes2transmit;
++ int eofrx;
++ int eoftx;
++#endif
+ spinlock_t lock;
+ char name[40]; /* Name */
+ /* Specified by zaptel */
+@@ -1030,7 +1037,7 @@
+ int txbufpolicy; /* Buffer policy */
+ int rxbufpolicy; /* Buffer policy */
+ int txdisable; /* Disable transmitter */
+- int rxdisable; /* Disable receiver */
++ int rxdisable; /* Disable receiver */
+
+
+ /* Tone zone stuff */
+@@ -1193,6 +1200,10 @@
+ #define ZT_FLAG_T1PPP (1 << 15)
+ #define ZT_FLAG_SIGFREEZE (1 << 16) /* Freeze signalling */
+
++#if defined(CONFIG_ZAPATA_BRI_DCHANS)
++#define ZT_FLAG_BRIDCHAN (1 << 17)
++#endif
++
+ struct zt_span {
+ spinlock_t lock;
+ void *pvt; /* Private stuff */
+diff -ur zaptel-1.0.9.orig/zconfig.h zaptel-1.0.9/zconfig.h
+--- zaptel-1.0.9.orig/zconfig.h 2005-01-02 01:19:57.000000000 +0100
++++ zaptel-1.0.9/zconfig.h 2005-07-03 13:36:31.000000000 +0200
+@@ -127,4 +127,10 @@
+ */
+ /* #define TDM_REVH_MATCHALL */
+
++/*
++ * Uncomment the following for BRI D channels
++ *
++ */
++#define CONFIG_ZAPATA_BRI_DCHANS
++
+ #endif
diff --git a/net-misc/zaptel/files/zaptel-install_prefix-typo.patch b/net-misc/zaptel/files/zaptel-install_prefix-typo.patch
deleted file mode 100644
index a9e8571d643d..000000000000
--- a/net-misc/zaptel/files/zaptel-install_prefix-typo.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- zaptel/Makefile.orig 2003-10-10 11:32:53.000000000 -0400
-+++ zaptel/Makefile 2003-10-10 11:41:21.000000000 -0400
-@@ -251,7 +251,7 @@
- install -m 644 $$x $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc ; \
- done
- if ! [ -f wcfxsusb.o ]; then \
-- rm -f $(INTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.o; \
-+ rm -f $(INSTALL_PREFIX)/lib/modules/`uname -r`/misc/wcfxsusb.o; \
- fi
- mkdir -p $(INSTALL_PREFIX)/usr/lib
- install -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib
diff --git a/net-misc/zaptel/files/zaptel-mkdir-usrincludelinux.patch b/net-misc/zaptel/files/zaptel-mkdir-usrincludelinux.patch
deleted file mode 100644
index c49fbac14af9..000000000000
--- a/net-misc/zaptel/files/zaptel-mkdir-usrincludelinux.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- zaptel/Makefile.orig 2003-10-10 11:42:59.000000000 -0400
-+++ zaptel/Makefile 2003-10-10 11:48:33.000000000 -0400
-@@ -255,6 +255,8 @@
- fi
- mkdir -p $(INSTALL_PREFIX)/usr/lib
- install -m 755 $(LIBTONEZONE) $(INSTALL_PREFIX)/usr/lib
-+
-+ mkdir -p $(INSTALL_PREFIX)/usr/include/linux
- install -m 644 zaptel.h $(INSTALL_PREFIX)/usr/include/linux
- install -m 644 torisa.h $(INSTALL_PREFIX)/usr/include/linux
- install -m 644 tonezone.h $(INSTALL_PREFIX)/usr/include
diff --git a/net-misc/zaptel/zaptel-1.0.9_p1.ebuild b/net-misc/zaptel/zaptel-1.0.9_p1.ebuild
new file mode 100644
index 000000000000..0c36d6c25694
--- /dev/null
+++ b/net-misc/zaptel/zaptel-1.0.9_p1.ebuild
@@ -0,0 +1,236 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/zaptel/zaptel-1.0.9_p1.ebuild,v 1.1 2005/07/29 01:12:44 stkn Exp $
+
+IUSE="devfs26 bri florz rtc"
+
+inherit toolchain-funcs eutils linux-mod
+
+BRI_VERSION="0.2.0-RC8l"
+FLORZ_VERSION="0.2.0-RC8j_florz-8"
+
+MY_PV="${PV/_p/.}"
+
+DESCRIPTION="Drivers for Digium and ZapataTelephony cards"
+HOMEPAGE="http://www.asterisk.org"
+SRC_URI="ftp://ftp.asterisk.org/pub/telephony/zaptel/zaptel-${MY_PV}.tar.gz
+ bri? ( http://www.junghanns.net/asterisk/downloads/bristuff-${BRI_VERSION}.tar.gz )
+ florz? ( http://zaphfc.florz.dyndns.org/zaphfc_${FLORZ_VERSION}.diff.gz )"
+
+SLOT="0"
+LICENSE="GPL-2"
+KEYWORDS="~x86 ~ppc ~amd64"
+
+DEPEND="virtual/libc
+ virtual/linux-sources
+ >=dev-libs/newt-0.50.0"
+
+S="${WORKDIR}/${PN}-${MY_PV}"
+
+pkg_setup() {
+ linux-mod_pkg_setup
+
+ # show an nice warning message about zaptel not supporting devfs on 2.6
+ if kernel_is 2 6 && linux_chkconfig_present DEVFS_FS ; then
+ echo
+ einfo "You're using a 2.6 kernel with DEVFS."
+ einfo "The Zaptel drivers won't work unless you either:"
+ einfo " * switch to udev"
+ einfo " * write a script that re-creates the necessary device nodes for you"
+ einfo " * enable the devfs26 useflag (see below)"
+ einfo ""
+ einfo "There's an experimental patch which adds devfs support when using linux-2.6, but:"
+ einfo " 1. It disables udev support to avoid conflicts"
+ ewarn " 2. It is not supported by Digium / the Asterisk project!"
+ einfo ""
+ einfo "If you're still interested, abort now (ctrl+c) and enable the devfs26 USE-flag"
+ einfo "Feedback and bug-reports should go to: stkn@gentoo.org"
+ einfo "You have been warned!"
+ echo
+ einfo "Sleeping 20 Seconds..."
+ epause 20
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+
+ cd ${S}
+ # patch makefile(s) for gentoo
+ epatch ${FILESDIR}/${PN}-1.0.9-gentoo.diff
+
+ # devfs support
+ if use devfs26; then
+ einfo "Enabling experimental devfs support for linux-2.6..."
+ epatch ${FILESDIR}/${PN}-1.0.4-experimental-devfs26.diff
+
+ # disable udev
+ sed -i -e "s:#define[\t ]\+\(CONFIG_ZAP_UDEV\):#undef \1:" \
+ zconfig.h
+ fi
+
+ # apply patch for gcc-3.4.x if that's the compiler in use...
+ # fixes (#76707)
+ if use x86 && [[ `gcc-fullversion` = "3.4.3" ]]; then
+ epatch ${FILESDIR}/${PN}-1.0.4-gcc34.patch
+ fi
+
+ # try to apply bristuff patch
+ if use bri; then
+ einfo "Patching zaptel w/ BRI stuff (${BRI_VERSION})"
+ epatch ${FILESDIR}/zaptel-bristuff-${BRI_VERSION}.patch
+
+ cd ${WORKDIR}/bristuff-${BRI_VERSION}
+
+ if use florz; then
+ einfo "Using florz patches (${FLORZ_VERSION}) for zaphfc"
+
+ epatch ${WORKDIR}/zaphfc_${FLORZ_VERSION}.diff
+ fi
+
+ # patch includes
+ sed -i -e "s:^#include.*zaptel\.h.*:#include <zaptel.h>:" \
+ qozap/qozap.c \
+ zaphfc/zaphfc.c \
+ cwain/cwain.c
+
+ # patch makefiles
+ sed -i -e "s:^ZAP[\t ]*=.*:ZAP=-I${S}:" \
+ -e "s:^MODCONF=.*:MODCONF=/etc/modules.d/zaptel:" \
+ -e "s:linux-2.6:linux:g" \
+ qozap/Makefile \
+ zaphfc/Makefile \
+ cwain/Makefile
+
+ sed -i -e "s:^\(CFLAGS+=-I. \).*:\1 \$(ZAP):" \
+ zaphfc/Makefile
+ fi
+
+ # replace `uname -r` with ${KV_FULL} in all Makefiles
+ find ${WORKDIR} -iname "Makefile" -exec sed -i -e "s:\`uname -r\`:${KV_FULL}:g" {} \;
+
+ cd ${S}
+ #######################################################################
+ # apply other patches here,
+ # make sure they work with things that have been added before!
+ #
+
+ # apply x86 rtc patch for ztdummy (http://bugs.digium.com/view.php?id=4301)
+ # this won't have any effect on non-x86 systems...
+ if use rtc; then
+ if use x86 || use amd64; then
+ epatch ${FILESDIR}/${PN}-1.0.9-rtc.patch
+ else
+ ewarn "RTC is unsupported on your arch, skipping patch"
+ fi
+ fi
+}
+
+src_compile() {
+ make ARCH=$(tc-arch-kernel) KERNEL_SOURCE=/usr/src/linux || die
+
+ if use bri; then
+ cd ${WORKDIR}/bristuff-${BRI_VERSION}
+ make ARCH=$(tc-arch-kernel) -C qozap || die
+ make ARCH=$(tc-arch-kernel) -C zaphfc || die
+ make ARCH=$(tc-arch-kernel) -C cwain || die
+ fi
+}
+
+src_install() {
+ make INSTALL_PREFIX=${D} install || die
+
+ dodoc ChangeLog README README.udev README.Linux26 README.fxsusb zaptel.init
+ dodoc zaptel.conf.sample LICENSE zaptel.sysconfig
+
+ # additional tools
+ dobin ztmonitor ztspeed zttest
+
+ if use bri; then
+ einfo "Installing bri"
+ cd ${WORKDIR}/bristuff-${BRI_VERSION}
+
+ insinto /lib/modules/${KV_FULL}/misc
+ doins qozap/qozap.${KV_OBJ}
+ doins zaphfc/zaphfc.${KV_OBJ}
+ doins cwain/cwain.${KV_OBJ}
+
+ # install example configs for octoBRI and quadBRI
+ insinto /etc
+ doins qozap/zaptel.conf.octoBRI
+ newins qozap/zaptel.conf zaptel.conf.quadBRI
+ newins zaphfc/zaptel.conf zaptel.conf.zaphfc
+
+ insinto /etc/asterisk
+ doins qozap/zapata.conf.octoBRI
+ newins qozap/zapata.conf zapata.conf.quadBRI
+ newins zaphfc/zapata.conf zapata.conf.zaphfc
+
+ docinto bristuff
+ dodoc CHANGES INSTALL
+
+ docinto bristuff/qozap
+ dodoc qozap/LICENSE qozap/TODO qozap/*.conf*
+
+ docinto bristuff/zaphfc
+ dodoc zaphfc/LICENSE zaphfc/*.conf
+
+ docinto bristuff/cwain
+ dodoc cwain/TODO cwain/LICENSE
+ fi
+
+ # install init script
+ newinitd ${FILESDIR}/zaptel.rc6 zaptel
+ newconfd ${FILESDIR}/zaptel.confd zaptel
+
+ # install devfsd rule file
+ insinto /etc/devfs.d
+ newins ${FILESDIR}/zaptel.devfsd zaptel
+
+ # install udev rule file
+ insinto /etc/udev/rules.d
+ newins ${FILESDIR}/zaptel.udevd 10-zaptel.rules
+
+ # fix permissions if there's no udev / devfs around
+ if [[ -d ${D}/dev/zap ]]; then
+ chown -R root:dialout ${D}/dev/zap
+ chmod -R u=rwX,g=rwX,o= ${D}/dev/zap
+ fi
+}
+
+pkg_postinst() {
+ linux-mod_pkg_postinst
+
+ if use devfs26; then
+ ewarn "*** Warning! ***"
+ ewarn "Devfs support for linux-2.6 is experimental and not"
+ ewarn "supported by digium or the asterisk project!"
+ echo
+ ewarn "Send bug-reports to: stkn@gentoo.org"
+ fi
+
+ echo
+ einfo "Use the /etc/init.d/zaptel script to load zaptel.conf settings on startup!"
+ echo
+
+ if use bri; then
+ einfo "Bristuff configs have been merged as:"
+ einfo ""
+ einfo "${ROOT}etc/"
+ einfo " zaptel.conf.zaphfc"
+ einfo " zaptel.conf.quadBRI"
+ einfo " zaptel.conf.octoBRI"
+ einfo ""
+ einfo "${ROOT}etc/asterisk/"
+ einfo " zapata.conf.zaphfc"
+ einfo " zapata.conf.quadBRI"
+ einfo " zapata.conf.octoBRI"
+ echo
+ fi
+
+ # fix permissions if there's no udev / devfs around
+ if [[ -d ${ROOT}/dev/zap ]]; then
+ chown -R root:dialout ${ROOT}/dev/zap
+ chmod -R u=rwX,g=rwX,o= ${ROOT}/dev/zap
+ fi
+}