Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[gelöst] Fehler beim Kompilieren von fcpci
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
Uli Sing
Apprentice
Apprentice


Joined: 03 May 2010
Posts: 190
Location: MUC

PostPosted: Sat Sep 11, 2010 12:28 pm    Post subject: Reply with quote

This is an updated ebuild for...

ach ja, wir sind ja im deutschen Bereich.

Und außer uns Deutschen interessiert sich im großen weiten gentoo-Universum ohnedies keine Sau (mehr) für ISDN, obwohl man damit auch ohne zugehörigen Anschluss viele schöne Sachen machen kann. :D

Wie dem auch sei: hier ein aktualisiertes ebuild für den 2.6.34er Kernel. Getestet unter amd64 2.6.34-r6. Die nachfolgende diff bitte ins "files" Unterverzeichnis kopieren.


Code:

# fcpci-0.1-r1.ebuild
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-dialup/fcpci/fcpci-0.1-r1.ebuild,v 1.1 2008/01/30 01:36:37 sbriesen Exp $

EAPI=2
inherit eutils rpm linux-mod versionator

DESCRIPTION="AVM kernel 2.6 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
         -> ${P}-0.src-11_2.rpm"

LICENSE="AVM-FC"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""

DEPEND="!net-dialup/fritzcapi"
RDEPEND="${DEPEND} net-dialup/capi4k-utils"

S="${WORKDIR}/fritz"

pkg_setup() {
   linux-mod_pkg_setup

   if ! kernel_is 2 6; then
      die "This package works only with 2.6 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
   
   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

   if kernel_is ge 2 6 31 ; then
      einfo "Registering additional patches for kernels >= 2.6.31"
      PAT="${PAT}67"
   fi

   if kernel_is ge 2 6 34 ; then
      einfo "Registering additional patches for kernels = 2.6.34"
      epatch "${FILESDIR}"/fcpci-linux-2.6.34.diff
   fi

   cd "${S}"
   epatch $(sed -n "s|^Patch[${PAT}]:\s*\(.*\)|../\1|p" ../${PN}.spec)
   
   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
}



[..]/files/fcpci-linux-2.6.34.diff
Code:

--- fritz/src.org/driver.c   2010-07-23 10:39:35.889395137 +0200
+++ fritz/src/driver.c   2010-07-23 10:52:45.712457634 +0200
@@ -48,6 +48,8 @@
 #include "defs.h"
 #include "lib.h"
 #include "driver.h"
+#include <linux/proc_fs.h>
+#include <linux/seq_file.h>
 
 /*---------------------------------------------------------------------------*\
 \*---------------------------------------------------------------------------*/
@@ -220,16 +222,6 @@ static void kill_version (card_t * card)
 } /* 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 +482,33 @@ static char * __kcapi proc_info (struct
 
 /*---------------------------------------------------------------------------*\
 \*---------------------------------------------------------------------------*/
-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,20 +520,29 @@ static int __kcapi ctr_info (
    }
    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,
+};
 
 /*---------------------------------------------------------------------------*\
 \*---------------------------------------------------------------------------*/
@@ -626,7 +621,7 @@ int __kcapi add_card (struct capi_driver
    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);
Back to top
View user's profile Send private message
rcmc_ronny
n00b
n00b


Joined: 15 Oct 2007
Posts: 17

PostPosted: Tue Sep 21, 2010 8:11 am    Post subject: Reply with quote

Hallo,

falls es noch keiner gesehen hat, unter dem folgenden Link gibt es Anpassungen, welche die alten Fritztreiber auch unter 2.6.34 und 2.6.35 zum laufen bringen, bei mir läuft der fxusb_CZ derzeit unter 2.6.35-r5 (wobei ich den immer selbst aktualisiere mit den Patchen :)).

http://www.foehr-it.de/hlp/viewtopic.php?t=364

Ist jedoch nur für User, welche wissen was Sie tun, aber vielleicht kann jemand nen Overlay Ebuild anlegen.

Wie immer wird die Lizenz geändert, daher kann dies leider nicht im Gentoo Portage eingefügt werden.

Ronny
Back to top
View user's profile Send private message
rcmc_ronny
n00b
n00b


Joined: 15 Oct 2007
Posts: 17

PostPosted: Sat Jan 08, 2011 9:28 am    Post subject: Reply with quote

Kleines Update, die Patche funktionieren auch unter 2.6.36 und 2.6.37

Ich habe das Modul soeben erfolgreich unter 2.6.37 ohne Änderungen kompiliert.

Ronny
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum