Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Apr 2006 12:18:01 +0200 (CEST)
From:      Joerg Pulz <Joerg.Pulz@frm2.tum.de>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        Maintainer <chris@forkin.com>
Subject:   ports/95915: comms/vpb-driver: enable support for FreeBSD-6.x and higher
Message-ID:  <200604171018.k3HAI1sd060614@hades.admin.frm2>
Resent-Message-ID: <200604171020.k3HAKFX4036496@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         95915
>Category:       ports
>Synopsis:       comms/vpb-driver: enable support for FreeBSD-6.x and higher
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 17 10:20:14 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Joerg Pulz
>Release:        FreeBSD 6.1-PRERELEASE i386
>Organization:
TU-Munich / ZWE FRM-II
>Environment:
System: FreeBSD hades.admin.frm2 6.1-PRERELEASE FreeBSD 6.1-PRERELEASE #11: Wed Feb 22 19:01:44 CET 2006 root@hades.admin.frm2:/usr/obj/usr/src/sys/HADES i386


	
>Description:
	- comms/vpb-driver is currently only available for FreeBSD between
	  version >= 502000 && < 600000
	- this patch fixes the compilation problems of the kernel module for
	  FreeBSD >= 600000
	- we now install the module in KMODDIR instead of ${LOCALBASE}/lib
	  therefor the pkg-plist and the rcNG startup script where adopted
	- adopt the pkg-message to match reality

	I've tested the port on i386 for FreeBSD version 600104, 600105 and
	700015 for build/install/deinstall problems.
>How-To-Repeat:
	
>Fix:

	- apply the patch

--- comms_vpb-driver.diff begins here ---
Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/comms/vpb-driver/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- Makefile	17 Mar 2006 11:11:43 -0000	1.8
+++ Makefile	17 Apr 2006 10:02:34 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	vpb-driver
 PORTVERSION=	2.4.9
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	comms
 MASTER_SITES=	http://www.voicetronix.com/Downloads/
 
@@ -18,7 +18,11 @@
 USE_RC_SUBR=	vpb.sh
 SUB_FILES+=	pkg-message
 PKGMESSAGE=	${WRKDIR}/pkg-message
-MAKE_ENV+=	KMODDIR=${PREFIX}/lib
+KMODDIR?=	/boot/modules
+MAKE_ENV+=	KMODDIR=${KMODDIR}
+
+PLIST_SUB+=	KMODDIR=${KMODDIR}
+SUB_LIST+=	KMODDIR=${KMODDIR}
 
 SED_SCRIPT=	-e 's,%%PREFIX%%,${PREFIX},g' \
 		-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
@@ -36,8 +40,8 @@
 BROKEN=	Does not compile on sparc64
 .endif
 
-.if ${OSVERSION} < 502000 || ${OSVERSION} >= 600000
-IGNORE=		is not for FreeBSD versions < 502000, or >= 600000
+.if ${OSVERSION} < 502000
+IGNORE=		is not for FreeBSD versions < 502000
 .endif
 
 do-configure:
Index: pkg-plist
===================================================================
RCS file: /home/ncvs/ports/comms/vpb-driver/pkg-plist,v
retrieving revision 1.3
diff -u -r1.3 pkg-plist
--- pkg-plist	16 Mar 2006 10:43:20 -0000	1.3
+++ pkg-plist	17 Apr 2006 10:02:34 -0000
@@ -2,7 +2,7 @@
 etc/vpb/vpbmain_isa.out
 etc/vpb/vpbmain_pci.out
 include/vpbapi.h
-lib/gettext/linker.hints
 lib/libvpb.a
-lib/vpb.ko
 @dirrm etc/vpb
+@cwd /
+%%KMODDIR%%/vpb.ko
Index: files/patch-FreeBSD-Makefile
===================================================================
RCS file: /home/ncvs/ports/comms/vpb-driver/files/patch-FreeBSD-Makefile,v
retrieving revision 1.1
diff -u -r1.1 patch-FreeBSD-Makefile
--- files/patch-FreeBSD-Makefile	11 Nov 2005 10:06:14 -0000	1.1
+++ files/patch-FreeBSD-Makefile	17 Apr 2006 10:02:34 -0000
@@ -1,8 +1,9 @@
---- FreeBSD/Makefile	Thu Jan  1 10:00:00 1970
-+++ FreeBSD/Makefile	Fri Feb 11 16:21:52 2005
-@@ -0,0 +1,5 @@
+--- FreeBSD/Makefile.orig	Mon Apr 10 09:28:04 2006
++++ FreeBSD/Makefile	Mon Apr 10 09:40:04 2006
+@@ -0,0 +1,6 @@
 +SRCS=vpb.c
 +SRCS+=bus_if.h device_if.h pci_if.h
 +KMOD=vpb
++WERROR=
 +
 +.include <bsd.kmod.mk>
Index: files/patch-FreeBSD-vpb.c
===================================================================
RCS file: /home/ncvs/ports/comms/vpb-driver/files/patch-FreeBSD-vpb.c,v
retrieving revision 1.1
diff -u -r1.1 patch-FreeBSD-vpb.c
--- files/patch-FreeBSD-vpb.c	11 Nov 2005 10:06:14 -0000	1.1
+++ files/patch-FreeBSD-vpb.c	17 Apr 2006 10:02:34 -0000
@@ -1,5 +1,5 @@
---- FreeBSD/vpb.c	Mon May  3 13:49:58 2004
-+++ FreeBSD/vpb.c	Mon Mar 14 10:47:29 2005
+--- FreeBSD/vpb.c.orig	Mon May  3 05:49:58 2004
++++ FreeBSD/vpb.c	Mon Apr 10 09:35:03 2006
 @@ -52,8 +52,6 @@
  #define BLOCK_DELAY  1       /* delay (us) between adjacent blocks           */
  #define SIZE_LCR     128     /* size of 9050 local config reg space in bytes */
@@ -38,7 +38,7 @@
  #include <machine/clock.h>	
  #include <vm/vm.h>	
  #include <vm/pmap.h>	
-@@ -113,26 +115,34 @@
+@@ -113,26 +115,36 @@
  \*---------------------------------------------------------------------------*/
  
  /* Character device entry points */
@@ -71,7 +71,7 @@
 -  nopsize,
 -  D_TTY,
 -  -1
-+#if __FreeBSD_version > 503000
++#if __FreeBSD_version > 502103
 +	.d_version =	D_VERSION,
 +#endif
 +        .d_open =       vpb_open,
@@ -80,7 +80,9 @@
 +        .d_write =      vpb_write,
 +        .d_ioctl =      vpb_ioctl,
 +        .d_name =       "vpb",
++#if __FreeBSD_version < 502103
 +        .d_maj =        CDEV_MAJOR,
++#endif
  };
  
  /* number of valid PCI devices detected */
@@ -89,7 +91,7 @@
  
  /* translated base address of PLX9050 regions */
  static unsigned char  *base0[MAX_V4PCI];
-@@ -144,7 +154,7 @@
+@@ -144,7 +156,7 @@
  static short buf[SIZE_WD];
  
  /* vars */
@@ -98,7 +100,7 @@
  
  static device_method_t vpb_methods[] = {
    /* Device interface */
-@@ -154,15 +164,19 @@
+@@ -154,15 +166,19 @@
    DEVMETHOD(device_shutdown,  vpb_shutdown),
    DEVMETHOD(device_suspend,   vpb_suspend),
    DEVMETHOD(device_resume,    vpb_resume),
@@ -120,7 +122,7 @@
  };
  
  static devclass_t vpb_devclass;
-@@ -173,7 +187,7 @@
+@@ -173,7 +189,7 @@
         open/close/read/write at this point */
  
  static int
@@ -129,7 +131,7 @@
  {
    int err = 0;
  
-@@ -181,7 +195,7 @@
+@@ -181,7 +197,7 @@
  }
  
  static int
@@ -138,7 +140,7 @@
  {
    int err=0;
  
-@@ -189,7 +203,7 @@
+@@ -189,7 +205,7 @@
  }
  
  static int
@@ -147,7 +149,7 @@
  {
    int err = 0;
  
-@@ -197,7 +211,7 @@
+@@ -197,7 +213,7 @@
  }
  
  static int
@@ -156,7 +158,7 @@
  {
    int err = 0;
  
-@@ -205,7 +219,7 @@
+@@ -205,7 +221,7 @@
  }
  
  static int
@@ -165,7 +167,7 @@
  {	
    VPB_DATA *vpb_data;  /* ioctl parameters from user space */
    short    *data;      /* user space address of data       */
-@@ -318,8 +332,14 @@
+@@ -318,8 +334,14 @@
    int         subsystem;
    char        *s; 
  
@@ -180,7 +182,7 @@
      /* check that subsytem ID & Subsytem Vendor matches */
      subsystem = pci_read_config(dev, 0x2c, 4);
      s = (char*)&subsystem;
-@@ -327,7 +347,7 @@
+@@ -327,7 +349,7 @@
      if ((s[3] == 'V') && (s[2] == '4') && (s[1] == 'V') && (s[0] == 'T')) {
        
        printf("V4PCI %d found!\n", numPCI);
@@ -189,7 +191,7 @@
        return 0;
      }
    }
-@@ -341,13 +361,16 @@
+@@ -341,13 +363,16 @@
  vpb_attach(device_t dev)
  {
    vm_offset_t paddr;
@@ -208,7 +210,7 @@
  
    /* OK, V4PCI found, so map address regions..... */
    paddr = (vm_offset_t)pci_read_config(dev, PCI_BASE_ADDR0, 4) & ~0xf;
-@@ -357,7 +380,9 @@
+@@ -357,7 +382,9 @@
    base2[numPCI] = pmap_mapdev(paddr, sizeof(short)*SIZE_WD);
  
    /* set wait-states */
@@ -219,7 +221,7 @@
  
    numPCI++;
  
-@@ -369,6 +394,11 @@
+@@ -369,6 +396,11 @@
  static int
  vpb_detach(device_t dev)
  {
@@ -231,7 +233,7 @@
    return 0;
  }
  
-@@ -491,4 +521,4 @@
+@@ -491,4 +523,4 @@
          cntrl &= 1;
          return(cntrl);
  }
Index: files/pkg-message.in
===================================================================
RCS file: /home/ncvs/ports/comms/vpb-driver/files/pkg-message.in,v
retrieving revision 1.1
diff -u -r1.1 pkg-message.in
--- files/pkg-message.in	11 Nov 2005 10:06:14 -0000	1.1
+++ files/pkg-message.in	17 Apr 2006 10:02:34 -0000
@@ -3,25 +3,21 @@
 
 To load(use) the driver, run (as root):
 
-	# kldload %%PREFIX%%/lib/vpb.ko
+	# kldload %%KMODDIR%%/vpb.ko
 
 To unload it:
 
 	# kldunload vpb
 
-Alternatively you can copy the provided sample script
+Alternatively you can add
 
-	%%PREFIX%%/etc/rc.d/vpb.sh.sample
-
-to
-
-	%%PREFIX%%/etc/rc.d/vpb.sh
+	vpb_driver_enable="YES"
 
-and add
+to your /etc/rc.conf file or
 
-	vpb_driver_enable="YES"
+	vpb_load="YES"
 
-to your /etc/rc.conf file.
+to your /boot/loader.conf file.
 
 This port is based on the original driver for FreeBSD RELENG_4 by Voicetronix.
 I have updated the driver to compile as a kernel loadable module and added
Index: files/vpb.sh.in
===================================================================
RCS file: /home/ncvs/ports/comms/vpb-driver/files/vpb.sh.in,v
retrieving revision 1.2
diff -u -r1.2 vpb.sh.in
--- files/vpb.sh.in	20 Feb 2006 20:46:50 -0000	1.2
+++ files/vpb.sh.in	17 Apr 2006 10:02:34 -0000
@@ -21,7 +21,7 @@
 rcvar=`set_rcvar`
 
 required_dirs=
-vpb_module=%%PREFIX%%/lib/vpb.ko
+vpb_module=%%KMODDIR%%/vpb.ko
 required_files=${vpb_module}
 
 start_cmd=start_cmd
--- comms_vpb-driver.diff ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604171018.k3HAI1sd060614>