From b5f482b80599f05a871ded1369fbef1bc91046bf Mon Sep 17 00:00:00 2001 From: Dennis Freise Date: Sun, 28 Aug 2011 03:38:03 +0200 Subject: Add missing files --- net-dialup/fcpci/fcpci-0.1-r6.ebuild | 72 +++++++++++++ net-dialup/fcpci/files/fcpci-kernel-2.6.34.patch | 126 +++++++++++++++++++++++ net-dialup/fcpci/files/fcpci-kernel-2.6.39.patch | 24 +++++ 3 files changed, 222 insertions(+) create mode 100644 net-dialup/fcpci/fcpci-0.1-r6.ebuild create mode 100644 net-dialup/fcpci/files/fcpci-kernel-2.6.34.patch create mode 100644 net-dialup/fcpci/files/fcpci-kernel-2.6.39.patch diff --git a/net-dialup/fcpci/fcpci-0.1-r6.ebuild b/net-dialup/fcpci/fcpci-0.1-r6.ebuild new file mode 100644 index 0000000..b6578e3 --- /dev/null +++ b/net-dialup/fcpci/fcpci-0.1-r6.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +inherit eutils rpm linux-mod + +DESCRIPTION="AVM kernel 2.6/3.0 modules for Fritz!Card PCI" +HOMEPAGE="http://opensuse.foehr-it.de/" +SRC_URI="http://opensuse.foehr-it.de/rpms/11_2/src/${P}-0.src.rpm" + +LICENSE="AVM-FC" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="" + +DEPEND="!net-dialup/fritzcapi" +RDEPEND="${DEPEND} net-dialup/capi4k-utils" + +RESTRICT="primaryuri" + +S="${WORKDIR}/fritz" + +pkg_setup() { + linux-mod_pkg_setup + + if ! kernel_is ge 2 6 ; then + die "This package works only with 2.6/3.0 kernel!" + fi + + BUILD_TARGETS="all" + BUILD_PARAMS="KDIR=${KV_DIR} LIBDIR=${S}/src" + MODULE_NAMES="${PN}(net:${S}/src)" +} + +src_unpack() { + local BIT="" PAT="012345" + if use amd64; then + BIT="64bit-" PAT="1234" + fi + + if kernel_is ge 2 6 31 ; then + PAT="${PAT}67" + fi + + rpm_unpack "${A}" || die "failed to unpack ${A} file" + DISTDIR="${WORKDIR}" unpack ${PN}-suse[0-9][0-9]-${BIT}[0-9].[0-9]*-[0-9]*.tar.gz + + cd "${S}" + epatch $(sed -n "s|^Patch[${PAT}]:\s*\(.*\)|../\1|p" ../${PN}.spec) + + if kernel_is ge 2 6 34 ; then + epatch "${FILESDIR}"/fcpci-kernel-2.6.34.patch + fi + + if kernel_is ge 2 6 39 ; then + epatch "${FILESDIR}"/fcpci-kernel-2.6.39.patch + fi + + convert_to_m src/Makefile + + for i in lib/*-lib.o; do + einfo "Localize symbols in ${i##*/} ..." + objcopy -L memcmp -L memcpy -L memmove -L memset -L strcat \ + -L strcmp -L strcpy -L strlen -L strncmp -L strncpy "${i}" + done +} + +src_install() { + linux-mod_src_install + dodoc CAPI*.txt + dohtml *.html +} diff --git a/net-dialup/fcpci/files/fcpci-kernel-2.6.34.patch b/net-dialup/fcpci/files/fcpci-kernel-2.6.34.patch new file mode 100644 index 0000000..ea20ac5 --- /dev/null +++ b/net-dialup/fcpci/files/fcpci-kernel-2.6.34.patch @@ -0,0 +1,126 @@ +--- fritz/src/driver.c.orig 2010-12-09 16:47:24.552314553 +0100 ++++ fritz/src/driver.c 2010-12-09 16:53:16.040981703 +0100 +@@ -48,6 +48,8 @@ + #include "defs.h" + #include "lib.h" + #include "driver.h" ++#include ++#include + + /*---------------------------------------------------------------------------*\ + \*---------------------------------------------------------------------------*/ +@@ -220,16 +220,6 @@ + } /* kill_version */ + + /*---------------------------------------------------------------------------*\ +-\*---------------------------------------------------------------------------*/ +-static void pprintf (char * page, int * len, const char * fmt, ...) { +- va_list args; +- +- va_start (args, fmt); +- *len += vsprintf (page + *len, fmt, args); +- va_end (args); +-} /* pprintf */ +- +-/*---------------------------------------------------------------------------*\ + \*-C-------------------------------------------------------------------------*/ + static inline int in_critical (void) { + +@@ -490,39 +480,33 @@ + + /*---------------------------------------------------------------------------*\ + \*---------------------------------------------------------------------------*/ +-static int __kcapi ctr_info ( +- char * page, +- char ** start, +- off_t ofs, +- int count, +- int * eof, +- struct capi_ctr * ctrl +-) { ++static int __kcapi ctr_info (struct seq_file *m, void *v) ++{ ++ struct capi_ctr *ctrl = m->private; + card_t * card; + char * temp; + unsigned char flag; +- int len = 0; + + assert (ctrl != NULL); + card = (card_t *) ctrl->driverdata; + assert (card != NULL); +- pprintf (page, &len, "%-16s %s\n", "name", SHORT_LOGO); +- pprintf (page, &len, "%-16s 0x%04x\n", "io", card->base); +- pprintf (page, &len, "%-16s %d\n", "irq", card->irq); ++ seq_printf(m, "%-16s %s\n", "name", SHORT_LOGO); ++ seq_printf(m, "%-16s 0x%04x\n", "io", card->base); ++ seq_printf(m, "%-16s %d\n", "irq", card->irq); + temp = card->version ? card->string[1] : "A1"; +- pprintf (page, &len, "%-16s %s\n", "type", temp); ++ seq_printf(m, "%-16s %s\n", "type", temp); + temp = card->version ? card->string[0] : "-"; + #if defined (__fcclassic__) || defined (__fcpcmcia__) +- pprintf (page, &len, "%-16s 0x%04x\n", "revision", card->info); ++ seq_printf(m, "%-16s 0x%04x\n", "revision", card->info); + #elif defined (__fcpci__) +- pprintf (page, &len, "%-16s %d\n", "class", card_id); ++ seq_printf(m, "%-16s %d\n", "class", card_id); + #endif +- pprintf (page, &len, "%-16s %s\n", "ver_driver", temp); +- pprintf (page, &len, "%-16s %s\n", "ver_cardtype", SHORT_LOGO); ++ seq_printf(m, "%-16s %s\n", "ver_driver", temp); ++ seq_printf(m, "%-16s %s\n", "ver_cardtype", SHORT_LOGO); + + flag = ((unsigned char *) (ctrl->profile.manu))[3]; + if (flag) { +- pprintf(page, &len, "%-16s%s%s%s%s%s%s%s\n", "protocol", ++ seq_printf(m, "%-16s%s%s%s%s%s%s%s\n", "protocol", + (flag & 0x01) ? " DSS1" : "", + (flag & 0x02) ? " CT1" : "", + (flag & 0x04) ? " VN3" : "", +@@ -534,21 +518,29 @@ + } + flag = ((unsigned char *) (ctrl->profile.manu))[5]; + if (flag) { +- pprintf(page, &len, "%-16s%s%s%s%s\n", "linetype", ++ seq_printf(m, "%-16s%s%s%s%s\n", "linetype", + (flag & 0x01) ? " point to point" : "", + (flag & 0x02) ? " point to multipoint" : "", + (flag & 0x08) ? " leased line without D-channel" : "", + (flag & 0x04) ? " leased line with D-channel" : "" + ); + } +- if (len < ofs) { +- return 0; +- } +- *eof = 1; +- *start = page - ofs; +- return ((count < len - ofs) ? count : len - ofs); ++ return 0; + } /* ctr_info */ + ++static int ctr_proc_open(struct inode *inode, struct file *file) ++{ ++ return single_open(file, ctr_info, PDE(inode)->data); ++} ++ ++const struct file_operations ctr_proc_fops = { ++ .owner = THIS_MODULE, ++ .open = ctr_proc_open, ++ .read = seq_read, ++ .llseek = seq_lseek, ++ .release = single_release, ++}; ++ + /*---------------------------------------------------------------------------*\ + \*---------------------------------------------------------------------------*/ + static void __kcapi reset_ctrl (struct capi_ctr * ctrl) { +@@ -626,7 +618,7 @@ + ctrl->release_appl = release_appl; + ctrl->send_message = send_msg; + ctrl->procinfo = proc_info; +- ctrl->ctr_read_proc = ctr_info; ++ ctrl->proc_fops = &ctr_proc_fops; + if (0 != (res = attach_capi_ctr (ctrl))) { + dec_use_count (); + stop (card); diff --git a/net-dialup/fcpci/files/fcpci-kernel-2.6.39.patch b/net-dialup/fcpci/files/fcpci-kernel-2.6.39.patch new file mode 100644 index 0000000..ecc4852 --- /dev/null +++ b/net-dialup/fcpci/files/fcpci-kernel-2.6.39.patch @@ -0,0 +1,24 @@ +--- fritz/src/driver.c~ 2011-06-15 21:18:25.792662667 +0200 ++++ fritz/src/driver.c 2011-06-15 21:22:15.307420952 +0200 +@@ -101,7 +101,8 @@ + static unsigned long crit_flags; + static atomic_t scheduler_enabled = ATOMIC_INIT (0); + static atomic_t scheduler_id = ATOMIC_INIT (-1); +-static spinlock_t sched_lock = SPIN_LOCK_UNLOCKED; ++//static spinlock_t sched_lock = SPIN_LOCK_UNLOCKED; ++static DEFINE_SPINLOCK(sched_lock); + #if !defined (__fcclassic__) + static int card_id = 0; + #endif +--- fritz/src/tools.c~ 2011-06-15 21:18:32.336741325 +0200 ++++ fritz/src/tools.c 2011-06-15 21:22:23.899524196 +0200 +@@ -529,7 +529,8 @@ + ERROR("Could not allocate lock structure!!!\n"); + return 0; + } +- tmp->lock = SPIN_LOCK_UNLOCKED; ++// tmp->lock = SPIN_LOCK_UNLOCKED; ++ spin_lock_init(&tmp->lock); + *plock = tmp; + return 1; + } /* lock_init */ -- cgit v1.2.3-65-gdbad