diff options
author | Stefan Briesenick <sbriesen@gentoo.org> | 2008-02-12 08:13:05 +0000 |
---|---|---|
committer | Stefan Briesenick <sbriesen@gentoo.org> | 2008-02-12 08:13:05 +0000 |
commit | 2cf5251c3b348ca9da37c85fac27f032cfc73c45 (patch) | |
tree | f10826bf165731ed15500b32ed16c8eb3f1b1ef5 /net-dialup | |
parent | Remove 2.6.23-r10 as tuxonice requires resync for >2.6.23.14 (bug #209755), a... (diff) | |
download | gentoo-2-2cf5251c3b348ca9da37c85fac27f032cfc73c45.tar.gz gentoo-2-2cf5251c3b348ca9da37c85fac27f032cfc73c45.tar.bz2 gentoo-2-2cf5251c3b348ca9da37c85fac27f032cfc73c45.zip |
version bump + kernel 2.6.24 patches (solving bug #207891).
(Portage version: 2.1.4.1)
Diffstat (limited to 'net-dialup')
-rw-r--r-- | net-dialup/misdn/ChangeLog | 10 | ||||
-rw-r--r-- | net-dialup/misdn/files/misdn-2.6.24.diff | 331 | ||||
-rw-r--r-- | net-dialup/misdn/misdn-1.1.7.2.ebuild | 216 |
3 files changed, 555 insertions, 2 deletions
diff --git a/net-dialup/misdn/ChangeLog b/net-dialup/misdn/ChangeLog index 9506cdb3b96a..a7d8ab927ed3 100644 --- a/net-dialup/misdn/ChangeLog +++ b/net-dialup/misdn/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for net-dialup/misdn -# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-dialup/misdn/ChangeLog,v 1.26 2007/11/12 19:14:08 genstef Exp $ +# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/misdn/ChangeLog,v 1.27 2008/02/12 08:13:04 sbriesen Exp $ + +*misdn-1.1.7.2 (12 Feb 2008) + + 12 Feb 2008; Stefan Briesenick <sbriesen@gentoo.org> + +files/misdn-2.6.24.diff, +misdn-1.1.7.2.ebuild: + version bump + kernel 2.6.24 patches (solving bug #207891). *misdn-1.1.7 (12 Nov 2007) diff --git a/net-dialup/misdn/files/misdn-2.6.24.diff b/net-dialup/misdn/files/misdn-2.6.24.diff new file mode 100644 index 000000000000..66c9f8265237 --- /dev/null +++ b/net-dialup/misdn/files/misdn-2.6.24.diff @@ -0,0 +1,331 @@ +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/app_plci.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/app_plci.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/app_plci.c 2008-01-18 10:24:49.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/app_plci.c 2008-02-05 23:06:46.000000000 +0100 +@@ -825,6 +825,7 @@ + cmsg->LLC = &p[qi->llc.off + 1]; + if (qi->hlc.off) + cmsg->HLC = &p[qi->hlc.off + 1]; ++#ifdef CAPIUTIL_VERSION + #if CAPIUTIL_VERSION > 1 + /* ETS 300 092 Annex B */ + if (qi->calling_nr.repeated) { +@@ -834,6 +835,7 @@ + int_error(); + } + #endif ++#endif + // all else set to default + } + if (mISDN_FsmEvent(&aplci->plci_m, EV_PI_CONNECT_IND, cmsg)) +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/avm_fritz.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/avm_fritz.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/avm_fritz.c 2008-01-18 10:24:49.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/avm_fritz.c 2008-02-05 23:06:46.000000000 +0100 +@@ -689,7 +689,11 @@ + } + + static irqreturn_t ++#ifdef OLD_IRQ_CALL + avm_fritz_interrupt(int intno, void *dev_id, struct pt_regs *regs) ++#else ++avm_fritz_interrupt(int intno, void *dev_id) ++#endif + { + fritzpnppci *fc = dev_id; + u_char val; +@@ -722,7 +726,11 @@ + } + + static irqreturn_t ++#ifdef OLD_IRQ_CALL + avm_fritzv2_interrupt(int intno, void *dev_id, struct pt_regs *regs) ++#else ++avm_fritzv2_interrupt(int intno, void *dev_id) ++#endif + { + fritzpnppci *fc = dev_id; + u_char val; +@@ -876,7 +884,7 @@ + static int init_card(fritzpnppci *fc) + { + int cnt = 3; +- u_int shared = SA_SHIRQ; ++ u_int shared = __IRQF_SHARED; + u_long flags; + u_char *id = "AVM Fritz!PCI"; + +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/core.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/core.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/core.c 2007-12-17 16:29:59.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/core.c 2008-02-05 23:06:46.000000000 +0100 +@@ -759,9 +759,11 @@ + int + mISDNInit(void) + { +- DECLARE_MUTEX_LOCKED(sem); ++ struct semaphore sem; + int err; + ++ init_MUTEX_LOCKED(&sem); ++ + printk(KERN_INFO "Modular ISDN Stack core version (%s) revision (%s)\n", mISDN_core_version, mISDN_core_revision); + core_debug = debug; + #ifdef MISDN_MEMDEBUG +@@ -801,7 +803,8 @@ + } + + void mISDN_cleanup(void) { +- DECLARE_MUTEX_LOCKED(sem); ++ struct semaphore sem; ++ init_MUTEX_LOCKED(&sem); + + free_mISDNdev(); + if (!list_empty(&mISDN_objectlist)) { +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/dsp_core.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/dsp_core.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/dsp_core.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/dsp_core.c 2008-02-05 23:10:32.000000000 +0100 +@@ -1005,8 +1005,10 @@ + /* fill mISDN object (dsp_obj) */ + memset(&dsp_obj, 0, sizeof(dsp_obj)); + #ifdef MODULE ++#ifdef SET_MODULE_OWNER + SET_MODULE_OWNER(&dsp_obj); + #endif ++#endif + spin_lock_init(&dsp_obj.lock); + dsp_obj.name = DSPName; + dsp_obj.BPROTO.protocol[3] = ISDN_PID_L3_B_DSP; +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/hfc_multi.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/hfc_multi.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/hfc_multi.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/hfc_multi.c 2008-02-05 23:06:46.000000000 +0100 +@@ -119,7 +119,7 @@ + #define bugtest \ + if (hc->irq) free_irq(hc->irq, hc); \ + hc->irq = 0; \ +- if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, SA_SHIRQ, "HFC-multi", hc)) { \ ++ if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, __IRQF_SHARED, "HFC-multi", hc)) { \ + printk(KERN_WARNING "mISDN: Could not get interrupt %d.\n", hc->pci_dev->irq); \ + hc->irq = hc->pci_dev->irq; } + #endif +@@ -1930,7 +1930,11 @@ + } + + static irqreturn_t ++#ifdef OLD_IRQ_CALL + hfcmulti_interrupt(int intno, void *dev_id, struct pt_regs *regs) ++#else ++hfcmulti_interrupt(int intno, void *dev_id) ++#endif + { + #ifdef IRQCOUNT_DEBUG + static int iq1=0,iq2=0,iq3=0,iq4=0,iq5=0,iq6=0,iqcnt=0; +@@ -3294,7 +3298,7 @@ + disable_hwirq(hc); + spin_unlock_irqrestore(&hc->lock, flags); + +- if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, SA_SHIRQ, "HFC-multi", hc)) { ++ if (request_irq(hc->pci_dev->irq, hfcmulti_interrupt, __IRQF_SHARED, "HFC-multi", hc)) { + printk(KERN_WARNING "mISDN: Could not get interrupt %d.\n", hc->pci_dev->irq); + return(-EIO); + } +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/hfc_pci.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/hfc_pci.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/hfc_pci.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/hfc_pci.c 2008-02-05 23:06:46.000000000 +0100 +@@ -1034,7 +1034,11 @@ + } + + static irqreturn_t ++#ifdef OLD_IRQ_CALL + hfcpci_interrupt(int intno, void *dev_id, struct pt_regs *regs) ++#else ++hfcpci_interrupt(int intno, void *dev_id) ++#endif + { + hfc_pci_t *hc = dev_id; + u_char exval; +@@ -1693,7 +1697,7 @@ + spin_lock_irqsave(&hc->lock, flags); + disable_hwirq(hc); + spin_unlock_irqrestore(&hc->lock, flags); +- if (request_irq(hc->irq, hfcpci_interrupt, SA_SHIRQ, "HFC PCI", hc)) { ++ if (request_irq(hc->irq, hfcpci_interrupt, __IRQF_SHARED, "HFC PCI", hc)) { + printk(KERN_WARNING "mISDN: couldn't get interrupt %d\n", hc->irq); + return(-EIO); + } +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/hfcs_mini.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/hfcs_mini.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/hfcs_mini.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/hfcs_mini.c 2008-02-05 23:06:46.000000000 +0100 +@@ -983,7 +983,11 @@ + /* Interrupt handler */ + /*********************/ + static irqreturn_t ++#ifdef OLD_IRQ_CALL + hfcsmini_interrupt(int intno, void *dev_id, struct pt_regs *regs) ++#else ++hfcsmini_interrupt(int intno, void *dev_id) ++#endif + { + __u8 fifo_irq, misc_irq; + hfcsmini_hw *hw = dev_id; +@@ -1587,7 +1591,7 @@ + printk(KERN_WARNING "%s %s: requesting IRQ %d\n", + hw->card_name, __FUNCTION__, hw->irq); + +- if (request_irq(hw->irq, hfcsmini_interrupt, SA_SHIRQ, "HFC-S mini", hw)) { ++ if (request_irq(hw->irq, hfcsmini_interrupt, __IRQF_SHARED, "HFC-S mini", hw)) { + printk(KERN_WARNING "%s %s: couldn't get interrupt %d\n", + hw->card_name, __FUNCTION__, hw->irq); + +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/hfcs_usb.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/hfcs_usb.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/hfcs_usb.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/hfcs_usb.c 2008-02-05 23:06:46.000000000 +0100 +@@ -1109,17 +1109,13 @@ + { + int k; + +- spin_lock_init(&urb->lock); +- urb->dev = dev; +- urb->pipe = pipe; +- urb->complete = complete; ++ usb_fill_bulk_urb(urb, dev, pipe, buf, packet_size * num_packets, complete, context); ++ + urb->number_of_packets = num_packets; +- urb->transfer_buffer_length = packet_size * num_packets; +- urb->context = context; +- urb->transfer_buffer = buf; + urb->transfer_flags = URB_ISO_ASAP; + urb->actual_length = 0; + urb->interval = interval; ++ + for (k = 0; k < num_packets; k++) { + urb->iso_frame_desc[k].offset = packet_size * k; + urb->iso_frame_desc[k].length = packet_size; +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/netjet.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/netjet.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/netjet.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/netjet.c 2008-02-05 23:06:46.000000000 +0100 +@@ -1463,7 +1463,11 @@ + } + + static irqreturn_t ++#ifdef OLD_IRQ_CALL + nj_interrupt(int intno, void *dev_id, struct pt_regs *regs) ++#else ++nj_interrupt(int intno, void *dev_id) ++#endif + { + netjet_t *card = dev_id; + u_int8_t val, s1val, s0val; +@@ -1544,7 +1548,7 @@ + nj_disable_hwirq(card); + spin_unlock_irqrestore(&card->lock, flags); + +- if (request_irq(card->irq, nj_interrupt, SA_SHIRQ, "NETjet", card)) { ++ if (request_irq(card->irq, nj_interrupt, __IRQF_SHARED, "NETjet", card)) { + printk(KERN_WARNING "mISDN: couldn't get interrupt %d\n", + card->irq); + return (-EIO); +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/sedl_fax.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/sedl_fax.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/sedl_fax.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/sedl_fax.c 2008-02-05 23:06:46.000000000 +0100 +@@ -338,7 +338,7 @@ + { + int cnt = 3; + u_long flags; +- u_int shared = SA_SHIRQ; ++ u_int shared = __IRQF_SHARED; + void *irq_func = speedfax_pci_interrupt; + + if (sf->subtyp == SEDL_SPEEDFAX_ISA) { +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/stack.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/stack.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/stack.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/stack.c 2008-02-05 23:06:46.000000000 +0100 +@@ -786,9 +786,11 @@ + static int + delete_stack(mISDNstack_t *st) + { +- DECLARE_MUTEX_LOCKED(sem); ++ struct semaphore sem; + u_long flags; + ++ init_MUTEX_LOCKED(&sem); ++ + if (core_debug & DEBUG_CORE_FUNC) + printk(KERN_DEBUG "%s: st(%p:%08x)\n", __FUNCTION__, st, st->id); + mISDN_unregister_sysfs_st(st); +@@ -1198,7 +1200,8 @@ + hhe->addr = st->id; + + if (wait) { +- DECLARE_MUTEX_LOCKED(sem); ++ struct semaphore sem; ++ init_MUTEX_LOCKED(&sem); + + hhe->data[0] = &sem; + _queue_message(st, skb); +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/w6692.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/w6692.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/w6692.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/w6692.c 2008-02-05 23:06:46.000000000 +0100 +@@ -855,7 +855,11 @@ + } + + static irqreturn_t ++#ifdef OLD_IRQ_CALL + w6692_interrupt(int intno, void *dev_id, struct pt_regs *regs) ++#else ++w6692_interrupt(int intno, void *dev_id) ++#endif + { + w6692pci *card = dev_id; + u_char ista; +@@ -994,7 +998,7 @@ + spin_lock_irqsave(&card->lock, flags); + disable_hwirq(card); + spin_unlock_irqrestore(&card->lock, flags); +- if (request_irq(card->irq, w6692_interrupt, SA_SHIRQ, "w6692", card)) { ++ if (request_irq(card->irq, w6692_interrupt, __IRQF_SHARED, "w6692", card)) { + printk(KERN_WARNING "mISDN: couldn't get interrupt %d\n", card->irq); + return(-EIO); + } +diff -Naur mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/xhfc_su.c mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/xhfc_su.c +--- mISDN-1_1_7_2.orig/drivers/isdn/hardware/mISDN/xhfc_su.c 2008-01-18 10:24:50.000000000 +0100 ++++ mISDN-1_1_7_2/drivers/isdn/hardware/mISDN/xhfc_su.c 2008-02-05 23:06:46.000000000 +0100 +@@ -1103,7 +1103,11 @@ + /* Interrupt handler */ + /*********************/ + static irqreturn_t ++#ifdef OLD_IRQ_CALL + xhfc_interrupt(int intno, void *dev_id, struct pt_regs *regs) ++#else ++xhfc_interrupt(int intno, void *dev_id) ++#endif + { + xhfc_pi *pi = dev_id; + xhfc_t * xhfc = NULL; +@@ -2031,7 +2035,7 @@ + } + + /* init interrupt engine */ +- if (request_irq(pi->irq, xhfc_interrupt, SA_SHIRQ, "XHFC", pi)) { ++ if (request_irq(pi->irq, xhfc_interrupt, __IRQF_SHARED, "XHFC", pi)) { + printk(KERN_WARNING "%s %s: couldn't get interrupt %d\n", + pi->name, __FUNCTION__, pi->irq); + pi->irq = 0; +diff -Naur mISDN-1_1_7_2.orig/include/linux/isdn_compat.h mISDN-1_1_7_2/include/linux/isdn_compat.h +--- mISDN-1_1_7_2.orig/include/linux/isdn_compat.h 2008-01-18 10:25:33.000000000 +0100 ++++ mISDN-1_1_7_2/include/linux/isdn_compat.h 2008-02-05 23:06:46.000000000 +0100 +@@ -128,6 +128,17 @@ + #define MISDN_COMPAT_KMEMCACHE + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ++#define OLD_IRQ_CALL ++#else ++#undef OLD_IRQ_CALL ++#endif ++ ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) ++#define __IRQF_SHARED SA_SHIRQ ++#else ++#define __IRQF_SHARED IRQF_SHARED ++#endif + + + #endif /* __KERNEL__ */ diff --git a/net-dialup/misdn/misdn-1.1.7.2.ebuild b/net-dialup/misdn/misdn-1.1.7.2.ebuild new file mode 100644 index 000000000000..7a6263d9be32 --- /dev/null +++ b/net-dialup/misdn/misdn-1.1.7.2.ebuild @@ -0,0 +1,216 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-dialup/misdn/misdn-1.1.7.2.ebuild,v 1.1 2008/02/12 08:13:04 sbriesen Exp $ + +inherit eutils linux-mod + +MY_P="mISDN-${PV//./_}" + +DESCRIPTION="mISDN is the new ISDN stack of the linux kernel 2.6" +HOMEPAGE="http://www.misdn.org/" +SRC_URI="http://www.misdn.org/downloads/releases/${MY_P}.tar.gz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86 ~amd64 ~ppc" + +DEPEND="" +RDEPEND="net-dialup/capi4k-utils + dev-libs/libxslt + sys-devel/bc" + +# list of echo canceller use flags, +# first active in this list is selected (=order does matter) +MISDN_EC_FLAGS=("ecmg2" "eckb1" "ecmark2") + +# list of card modules +MISDN_MODULES=("avmfritz" "hfcpci" "hfcmulti" "hfcsusb" "hfcsmini" "xhfc" "sedlfax" "w6692pci" "netjetpci") +MISDN_KCONFIG=("AVM_FRITZ" "HFCPCI" "HFCMULTI" "HFCUSB" "HFCMINI" "XHFC" "SPEEDFAX" "W6692" "NETJET") + +IUSE="ecaggressive ${MISDN_EC_FLAGS[*]}" +for i in ${MISDN_MODULES[@]}; do IUSE="${IUSE} misdn_cards_${i}"; done + +MY_S="${WORKDIR}/${MY_P}" +S="${MY_S}/drivers/isdn/hardware/mISDN" + + +### Begin: Helper functions + +select_echo_cancel() { + local i myEC=${MISDN_EC_FLAGS[0]} + for i in ${MISDN_EC_FLAGS[*]}; do + if use ${i}; then + myEC=$(echo "${i}" | sed -e "s:^ec\(.*\):\U\1\E:") + break; + fi + done + echo "${myEC}" | sed -e "s:^ec\(.*\):\U\1\E:" +} + +dsp_enable() { + local i + for i in "${@}"; do + sed -i -e "s:.*\(#include.*dsp_${i}\):\1:m" dsp.h + done +} + +dsp_disable() { + local i + for i in "${@}"; do + sed -i -e "s:.*\(#include.*dsp_${i}\)://\1:m" dsp.h + done +} + +### End: Helper functions + +#CONFIG_I4L_CAPI_LAYER -> I4LmISDN +#CONFIG_MISDN_MEMDEBUG -> memdbg +#CONFIG_MISDN_NETDEV -> netdev + +# def SYSFS_SUPPORT + +pkg_setup() { + local USERCARD CARD EC NUM=0 + + CONFIG_CHECK="ISDN_CAPI ISDN_CAPI_CAPI20 ISDN_CAPI_CAPIFS_BOOL" + kernel_is ge 2 6 24 && CONFIG_CHECK="${CONFIG_CHECK} PCI_LEGACY" + linux-mod_pkg_setup + + # base modules + BUILD_TARGETS="modules" + BUILD_PARAMS="-C ${KV_DIR} SUBDIRS=${S} MINCLUDES=${MY_S}/include CONFIG_MISDN_DRV=m" + MODULE_NAMES="mISDN_core(net:) mISDN_isac(net:) mISDN_l1(net:) mISDN_l2(net:) + mISDN_x25dte(net:) l3udss1(net:) mISDN_capi(net:) mISDN_dtmf(net:)" + + # extra modules + BUILD_PARAMS="${BUILD_PARAMS} CONFIG_MISDN_DSP=m CONFIG_MISDN_LOOP=m CONFIG_MISDN_DEBUGTOOL=m" + MODULE_NAMES="${MODULE_NAMES} mISDN_dsp(net:) mISDN_loop(net:) mISDN_debugtool(net:)" + + # check if multiple echo cancellers have been selected + EC_SELECTED=$(select_echo_cancel) + for EC in ${MISDN_EC_FLAGS}; do + use ${EC} && : $((NUM++)) + done + if [ ${NUM} -gt 1 ]; then + # multiple flags are active, only the first in the MISDN_EC_FLAGS + # list will be used, make sure the user knows about this + ewarn "Multiple echo canceller flags are active but only one will be used!" + ewarn "Selected: ${EC_SELECTED}" + else + elog "Selected echo canceller: ${EC_SELECTED}" + fi + + # Check existence of user selected cards + if [ -n "${MISDN_CARDS}" ]; then + for USERCARD in ${MISDN_CARDS}; do + for ((CARD=0; CARD < ${#MISDN_MODULES[*]}; CARD++)); do + if [ "${USERCARD}" = "${MISDN_MODULES[CARD]}" ]; then + MODULE_NAMES="${MODULE_NAMES} ${MISDN_MODULES[CARD]}(net:)" + BUILD_PARAMS="${BUILD_PARAMS} CONFIG_MISDN_${MISDN_KCONFIG[CARD]}=m" + continue 2 + fi + done + die "Module ${USERCARD} not present in ${P}" + done + else + elog "You can control the modules which are built with the variable" + elog "MISDN_CARDS which should contain a blank separated list" + elog "of a selection from the following cards:" + elog " ${MISDN_MODULES[*]}" + # enable everything + for ((CARD=0; CARD < ${#MISDN_MODULES[*]}; CARD++)); do + MODULE_NAMES="${MODULE_NAMES} ${MISDN_MODULES[CARD]}(net:)" + BUILD_PARAMS="${BUILD_PARAMS} CONFIG_MISDN_${MISDN_KCONFIG[CARD]}=m" + done + fi +} + +src_unpack() { + unpack ${A} + + # mostly backported from mISDN-git, so it should + # not be needed anymore next version ;-) + epatch "${FILESDIR}/misdn-2.6.24.diff" + + cd "${S}" + sed -i -e "s:^\(CFLAGS\):EXTRA_\1:g" "Makefile" + + sed -i -e "s:^\(USER=\).*:\1root:" \ + -e "s:^\(GROUP=\).*:\1uucp:" \ + "${MY_S}/misdn-init" + + sed -i -e "s:^\(DEVNODE_user=\).*:\1'root':" \ + -e "s:^\(DEVNODE_group=\).*:\1'uucp':" \ + -e "s:^\(DEVNODE_mode=\).*:\1'0660':" \ + "${MY_S}/config/mISDN" + + if use ecaggressive; then + sed -i -e "s:.*\(#define.*AGGRESSIVE_SUPPRESSOR\):\1:m" dsp.h + fi + + case "${EC_SELECTED}" in + MG2) + dsp_enable mg2ec + dsp_disable kb1ec mec2 + ;; + KB1) + dsp_enable kb1ec + dsp_disable mg2ec mec2 + ;; + MARK2) + dsp_enable mec2 + dsp_disable mg2ec kb1ec + ;; + esac +} + +src_install() { + linux-mod_src_install + + insinto /usr/include/linux + doins "${MY_S}/include/linux/"*.h + + dodir /etc/udev/rules.d + echo 'KERNEL=="obj-*", NAME="mISDN", GROUP="uucp", MODE="0660"' \ + > "${D}etc/udev/rules.d/53-${PN}.rules" + + insinto /etc/modules.d + newins "${MY_S}/mISDN.modprobe.d" ${PN} + dosbin "${MY_S}/misdn-init" + dodoc "${MY_S}/README.misdn-init" + +# insinto /etc +# doins "${MY_S}/config/mISDN.conf" + insinto /usr/lib/mISDN + doins "${MY_S}/config/"*.xsl + dosbin "${MY_S}/config/mISDN" + dodoc "${MY_S}/config/README.mISDN" + + dodoc Kconfig.v2.6 "${FILESDIR}/README.hfcmulti" +} + +pkg_preinst() { + # save old config, in case portage will remove it + if [ -e "${ROOT}etc/misdn-init.conf" ]; then + cp -pf "${ROOT}etc/misdn-init.conf" "${ROOT}etc/misdn-init.conf.pkginst" + fi +} + +pkg_postinst() { + linux-mod_pkg_postinst + + # restore old config, in case portage removed it + if [ -e "${ROOT}etc/misdn-init.conf.pkginst" ]; then + if [ -e "${ROOT}etc/misdn-init.conf" ]; then + rm -f "${ROOT}etc/misdn-init.conf.pkginst" + else + mv -f "${ROOT}etc/misdn-init.conf.pkginst" "${ROOT}etc/misdn-init.conf" + fi + fi + + ewarn + ewarn "This driver is still under heavy development" + ewarn "Please report ebuild related bugs / wishes to http://bugs.gentoo.org" + ewarn "Please report driver bugs to the mISDN mailing-list:" + ewarn " https://www.isdn4linux.de/mailman/listinfo/isdn4linux" +} |