Bug 77471 - New port: Device driver for Voicetronix OpenLine4 Telephony HW
Summary: New port: Device driver for Voicetronix OpenLine4 Telephony HW
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Sam Lawrance
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-14 00:00 UTC by Chris Forkin
Modified: 2005-11-11 10:17 UTC (History)
0 users

See Also:


Attachments
disclaimer.txt (505 bytes, text/plain)
2005-03-13 23:20 UTC, Chris Forkin
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Forkin 2005-02-14 00:00:46 UTC
	Fix for the opensource Voicetronix OpenLine4 PCI telephony hardware
	to support current FreeBSD RELENG_5 releases. This now allows Asterisk
	to use the Voicetronix hardware on FreeBSD.

Fix: 

------------=_1108339180-67400-247
Content-Type: text/plain; name="disclaimer.txt"
Content-Disposition: inline; filename="disclaimer.txt"
Content-Transfer-Encoding: 7bit
MIME-Version: 1.0
X-Mailer: MIME-tools 5.414 (Entity 5.414)

=========================== Disclaimer ===========================
All E-mail correspondence is scanned with:
 + ClamAV (see http://www.clamav.net)
 + MIMEDefang (see http://www.mimedefang.org/)
 + SpamAssassin (see http://spamassassin.apache.org/)
We can however not guarantee that it is virus free and therefore
accept no responsibility for any damage caused by the contents of
this email. forkin.com has implemented SPF to assist
in identifying SPAM (see http://spf.pobox.com/).
  postmaster@forkin.com

------------=_1108339180-67400-247----eT4tXoj0ybPHPWBLaXCwy5Dmrt7OIjUQLyBScaW8Ge5vQX18
Content-Type: text/plain; name="file.shar"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.shar"

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	vpb-driver
#	vpb-driver/files
#	vpb-driver/files/patch-FreeBSD-Makefile
#	vpb-driver/files/patch-FreeBSD-vpb.c
#	vpb-driver/files/patch-Makefile
#	vpb-driver/files/patch-src-comm.cpp
#	vpb-driver/files/patch-src-playrec.cpp
#	vpb-driver/files/patch-src-vpbapi.cpp
#	vpb-driver/files/patch-src-vpbapi.h
#	vpb-driver/files/patch-src-vpbdial.cpp
#	vpb-driver/files/patch-src-vpbreg.cpp
#	vpb-driver/files/vpb.sh
#	vpb-driver/Makefile
#	vpb-driver/distinfo
#	vpb-driver/pkg-descr
#	vpb-driver/pkg-message
#	vpb-driver/pkg-plist
#
echo c - vpb-driver
mkdir -p vpb-driver > /dev/null 2>&1
echo c - vpb-driver/files
mkdir -p vpb-driver/files > /dev/null 2>&1
echo x - vpb-driver/files/patch-FreeBSD-Makefile
sed 's/^X//' >vpb-driver/files/patch-FreeBSD-Makefile << 'END-of-vpb-driver/files/patch-FreeBSD-Makefile'
X--- FreeBSD/Makefile	Thu Jan  1 10:00:00 1970
X+++ FreeBSD/Makefile	Fri Feb 11 16:21:52 2005
X@@ -0,0 +1,5 @@
X+SRCS=vpb.c
X+SRCS+=bus_if.h device_if.h pci_if.h
X+KMOD=vpb
X+
X+.include <bsd.kmod.mk>
END-of-vpb-driver/files/patch-FreeBSD-Makefile
echo x - vpb-driver/files/patch-FreeBSD-vpb.c
sed 's/^X//' >vpb-driver/files/patch-FreeBSD-vpb.c << 'END-of-vpb-driver/files/patch-FreeBSD-vpb.c'
X--- FreeBSD/vpb.c	Mon May  3 13:49:58 2004
X+++ FreeBSD/vpb.c	Mon Feb 14 10:01:54 2005
X@@ -52,8 +52,6 @@
X #define BLOCK_DELAY  1       /* delay (us) between adjacent blocks           */
X #define SIZE_LCR     128     /* size of 9050 local config reg space in bytes */
X 
X-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
X-
X #define EEPROM_SIZE  64
X #define EEPROM_CS    25		/* Chip select bit */
X #define EEPROM_CLK   24
X@@ -68,16 +66,20 @@
X 
X #include <sys/types.h>
X #include <sys/module.h>
X-#include <sys/systm.h>  /* uprintf                               */
X+#include <sys/systm.h>		/* uprintf                               */
X #include <sys/errno.h>
X-#include <sys/param.h>  /* defines used in kernel.h              */
X-#include <sys/kernel.h> /* types used in module initialization   */
X-#include <sys/conf.h>   /* cdevsw struct                         */
X-#include <sys/uio.h>    /* uio struct                            */
X+#include <sys/param.h>		/* defines used in kernel.h              */
X+#include <sys/kernel.h>		/* types used in module initialization   */
X+#include <sys/conf.h>		/* cdevsw struct                         */
X+#include <sys/uio.h>		/* uio struct                            */
X #include <sys/malloc.h>
X-#include <sys/bus.h>    /* structs, prototypes for pci bus stuff */
X-#include <pci/pcivar.h> /* For get_pci macros!                   */
X-#include <sys/vpbio.h>	/* IOCTL definitions                     */
X+#include <sys/bus.h>    	/* structs, prototypes for pci bus stuff */
X+#if __FreeBSD_version > 500000
X+#include <dev/pci/pcivar.h>	/* For get_pci macros!                   */
X+#else
X+#include <pci/pcivar.h>		/* For get_pci macros!                   */
X+#endif
X+#include "vpbio.h"		/* IOCTL definitions                     */
X #include <machine/clock.h>	
X #include <vm/vm.h>	
X #include <vm/pmap.h>	
X@@ -113,26 +115,25 @@
X \*---------------------------------------------------------------------------*/
X 
X /* Character device entry points */
X-
X+#if __FreeBSD_version > 500000
X+#define D_THREAD_T	thread
X+#define CDEV_MAJOR MAJOR_AUTO	/* reserved for local use */
X+#else
X+#define D_THREAD_T	proc
X+#define CDEV_MAJOR 33		/* reserved for lkms */
X+#endif
X static struct cdevsw vpb_cdevsw = {
X-  vpb_open,
X-  vpb_close,
X-  vpb_read,
X-  vpb_write,
X-  vpb_ioctl,
X-  nopoll,
X-  nommap,
X-  nostrategy,
X-  "vpb",
X-  201,                   /* reserved for local use */
X-  nodump,
X-  nopsize,
X-  D_TTY,
X-  -1
X+        .d_open =       vpb_open,
X+        .d_close =      vpb_close,
X+        .d_read =       vpb_read,
X+        .d_write =      vpb_write,
X+        .d_ioctl =      vpb_ioctl,
X+        .d_name =       "vpb",
X+        .d_maj =        CDEV_MAJOR,
X };
X 
X /* number of valid PCI devices detected */
X-static int numPCI; 
X+static int numPCI=0; 
X 
X /* translated base address of PLX9050 regions */
X static unsigned char  *base0[MAX_V4PCI];
X@@ -144,7 +145,7 @@
X static short buf[SIZE_WD];
X 
X /* vars */
X-static dev_t sdev;
X+static dev_t sdev[MAX_V4PCI] ={ 0 }; /* replace with dynamic allocation! */
X 
X static device_method_t vpb_methods[] = {
X   /* Device interface */
X@@ -154,15 +155,19 @@
X   DEVMETHOD(device_shutdown,  vpb_shutdown),
X   DEVMETHOD(device_suspend,   vpb_suspend),
X   DEVMETHOD(device_resume,    vpb_resume),
X-
X   { 0, 0 }
X };
X 
X+struct vpb_softc {
X+   u_int32_t unit;
X+   dev_t dev;
X+};
X+
X static driver_t vpb_driver = {
X   "vpb",
X   vpb_methods,
X   0,
X-  /*  sizeof(struct vpb_softc), */
X+  /* sizeof(struct vpb_softc), */
X };
X 
X static devclass_t vpb_devclass;
X@@ -173,7 +178,7 @@
X        open/close/read/write at this point */
X 
X static int
X-vpb_open(dev_t dev, int oflags, int devtype, struct proc *p)
X+vpb_open(dev_t dev, int oflags, int devtype, struct D_THREAD_T *td)
X {
X   int err = 0;
X 
X@@ -181,7 +186,7 @@
X }
X 
X static int
X-vpb_close(dev_t dev, int fflag, int devtype, struct proc *p)
X+vpb_close(dev_t dev, int fflag, int devtype, struct D_THREAD_T *td)
X {
X   int err=0;
X 
X@@ -205,7 +210,7 @@
X }
X 
X static int
X-vpb_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr)
X+vpb_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct D_THREAD_T *td)
X {	
X   VPB_DATA *vpb_data;  /* ioctl parameters from user space */
X   short    *data;      /* user space address of data       */
X@@ -318,8 +323,14 @@
X   int         subsystem;
X   char        *s; 
X 
X+  if(numPCI >= MAX_V4PCI) {
X+    return ENXIO;
X+  }
X+
X+  /* struct vpb_softc *sc = (struct vpb_softc *)device_get_softc(dev); */
X   if ((pci_get_vendor(dev) == 0x10b5) && (pci_get_device(dev) == 0x9050)) {
X 
X+    /* bzero(sc, sizeof(struct vpb_softc)); */
X     /* check that subsytem ID & Subsytem Vendor matches */
X     subsystem = pci_read_config(dev, 0x2c, 4);
X     s = (char*)&subsystem;
X@@ -327,7 +338,7 @@
X     if ((s[3] == 'V') && (s[2] == '4') && (s[1] == 'V') && (s[0] == 'T')) {
X       
X       printf("V4PCI %d found!\n", numPCI);
X-      device_set_desc(dev, "Voicetronix V4PCI Computer Telephony Card");
X+      device_set_desc_copy(dev, "Voicetronix V4PCI Computer Telephony Card");
X       return 0;
X     }
X   }
X@@ -341,13 +352,16 @@
X vpb_attach(device_t dev)
X {
X   vm_offset_t paddr;
X+  /* int         unit; */
X 
X-  sdev = make_dev(&vpb_cdevsw,
X+  /* unit = device_get_unit(dev); */
X+  sdev[numPCI] = make_dev(&vpb_cdevsw,
X 		  0,
X 		  UID_ROOT,
X 		  GID_WHEEL,
X 		  0600,
X-		  "vpb");
X+		  "vpb%d",
X+		  numPCI);
X 
X   /* OK, V4PCI found, so map address regions..... */
X   paddr = (vm_offset_t)pci_read_config(dev, PCI_BASE_ADDR0, 4) & ~0xf;
X@@ -357,7 +371,9 @@
X   base2[numPCI] = pmap_mapdev(paddr, sizeof(short)*SIZE_WD);
X 
X   /* set wait-states */
X-  *(base0[0]+0x28) = 0x00440422;     
X+  /* ((unsigned int)*(base0[0]+0x28)) = 0x00440422; */
X+  /* now adding 1 wait-state to Write cycle hold */
X+  ((unsigned int)*(base0[0]+0x28)) = 0x070440422;     
X 
X   numPCI++;
X 
X@@ -369,6 +385,11 @@
X static int
X vpb_detach(device_t dev)
X {
X+  if(numPCI>0 && sdev[numPCI-1]!=NULL) {
X+    destroy_dev(sdev[numPCI-1]);
X+    sdev[numPCI-1]=NULL;
X+    numPCI--;
X+  }
X   return 0;
X }
X 
X@@ -491,4 +512,4 @@
X         cntrl &= 1;
X         return(cntrl);
X }
X-                               
X+
END-of-vpb-driver/files/patch-FreeBSD-vpb.c
echo x - vpb-driver/files/patch-Makefile
sed 's/^X//' >vpb-driver/files/patch-Makefile << 'END-of-vpb-driver/files/patch-Makefile'
X--- Makefile	Thu Nov  4 07:33:22 2004
X+++ Makefile	Fri Feb 11 16:55:17 2005
X@@ -26,8 +26,8 @@
X KERNEL_OLD := $(shell if [ -f $(KERNEL_LOCATION)/Rules.make ]; then echo 1; else echo 0; fi)
X 
X # FreeBSD users: Please change this line to 'OS = FreeBSD'
X-OS = linux
X-#OS = FreeBSD
X+#OS = linux
X+OS = FreeBSD
X export OS
X 
X all:
X@@ -37,20 +37,29 @@
X 	cd vpb-detect; make
X else
X 	echo FREEBSD
X-	cd src; gmake
X+	cd src && gmake
X+	cd FreeBSD && make
X endif
X 
X install: all
X+ifeq ($(OS),linux)
X 	mkdir -p $(root)/etc/vpb
X 	cp -f firmware/vpbmain_isa.out $(root)/etc/vpb
X 	cp -f firmware/vpbmain_pci.out $(root)/etc/vpb
X 	cp -f firmware/vlcmain.out $(root)/etc/vpb
X 	cp -f src/libvpb.a $(root)/usr/local/lib
X 	cp -f src/vpbapi.h $(root)/usr/include
X-ifneq ($(OS),linux)
X-	cp -f FreeBSD/vpb.c /sys/pci
X-	cp -f FreeBSD/vpbio.h /sys/sys
X-else
X+endif
X+ifeq ($(OS),FreeBSD)
X+	mkdir -p $(PREFIX)/etc/vpb
X+	cp -f firmware/vpbmain_isa.out $(PREFIX)/etc/vpb
X+	cp -f firmware/vpbmain_pci.out $(PREFIX)/etc/vpb
X+	cp -f firmware/vlcmain.out $(PREFIX)/etc/vpb
X+	cp -f src/libvpb.a $(PREFIX)/lib
X+	cp -f src/vpbapi.h $(PREFIX)/include
X+	cd FreeBSD && make install
X+endif
X+ifeq ($(OS),linux)
X 	cp -f vpb-detect/vpbscan /usr/sbin
X 	cp -f vpb-detect/vpbconf /usr/sbin	
X ifeq ($(KERNEL_OLD), 1)
END-of-vpb-driver/files/patch-Makefile
echo x - vpb-driver/files/patch-src-comm.cpp
sed 's/^X//' >vpb-driver/files/patch-src-comm.cpp << 'END-of-vpb-driver/files/patch-src-comm.cpp'
X--- src/comm.cpp	Sat Feb 12 10:17:24 2005
X+++ src/comm.cpp	Sat Feb 12 10:19:24 2005
X@@ -44,7 +44,7 @@
X #include "generic.h"
X #include "vpbapi.h"
X //#include "pci.h"
X-#ifdef linux
X+#if defined(linux) || defined(__FreeBSD__)
X #include "hostdsp.h"
X #endif
X 
X@@ -524,7 +524,7 @@
X 	}
X 
X 	// Start "DSP" (simulated by thread)
X-	#ifdef linux
X+        #if defined(linux) || defined(__FreeBSD__)
X 	printf("Starting host DSP![%d]\n",numvpb);
X 	HostDSPOpen(numvpb, vr);
X 	#endif
X@@ -557,7 +557,7 @@
X 		delete hip;
X 	}
X 	else {
X-		#ifdef linux
X+                #if defined(linux) || defined(__FreeBSD__)
X 		mprintf("Closing Host DSP\n");
X 		HostDSPClose();
X 		#endif
END-of-vpb-driver/files/patch-src-comm.cpp
echo x - vpb-driver/files/patch-src-playrec.cpp
sed 's/^X//' >vpb-driver/files/patch-src-playrec.cpp << 'END-of-vpb-driver/files/patch-src-playrec.cpp'
X--- src/playrec.cpp	Sat Feb 12 10:21:11 2005
X+++ src/playrec.cpp	Sat Feb 12 10:22:27 2005
X@@ -239,7 +239,7 @@
X 	record = new RECORD[numch];
X         v4numch = numch;              // used by playrec_close
X 
X-	#ifdef __linux__
X+	#if defined(__linux__) || defined(__FreeBSD__)
X 	extern int	vpb_pconf[MAX_BOARDS][BANKB];
X 	#endif
X 	
X@@ -259,7 +259,7 @@
X 			bd = i/6;
X 			ch = i%6;
X 		}
X-		#ifdef __linux__
X+	        #if defined(__linux__) || defined(__FreeBSD__)
X 		if (vpb_pconf[bd][ch] == 1){
X 			mprintf("Got Station port...\n");
X 		}
X@@ -305,7 +305,7 @@
X 		//	mprintf("This is what we got from the sttuct [%f]\n",vr->defRecordGainDown);
X 		//	mprintf("And this is what we puyt in the local[%f]\n",record[i].rgaindown);
X 			
X-			#ifdef __linux__
X+	                #if defined(__linux__) || defined(__FreeBSD__)
X 			if (vpb_pconf[bd][ch] == 1){
X 				play[i].hw_gain = vr->defSPlayGain;
X 				record[i].hw_gain = vr->defSRecordGain;
X@@ -319,7 +319,7 @@
X 				record[i].hw_gain = vr->defRecordGain;
X 				play[i].sw_gain = 0;
X 				record[i].sw_gain = 0;
X-			#ifdef __linux__
X+	                #if defined(__linux__) || defined(__FreeBSD__)
X 			}
X 			#endif
X 			play[i].total_gain = play[i].hw_gain + play[i].sw_gain;
X@@ -463,7 +463,7 @@
X         play[handle].terminate = 0;
X 	if (vpbreg_get_model() == VPB_V12PCI) {
X //		#ifndef WIN32
X-		#ifdef linux
X+	        #if defined(__linux__) || defined(__FreeBSD__)
X 		HostDSPSetupPlay(handle);
X 		#endif
X 	}
END-of-vpb-driver/files/patch-src-playrec.cpp
echo x - vpb-driver/files/patch-src-vpbapi.cpp
sed 's/^X//' >vpb-driver/files/patch-src-vpbapi.cpp << 'END-of-vpb-driver/files/patch-src-vpbapi.cpp'
X--- src/vpbapi.cpp	Sat Feb 12 09:56:53 2005
X+++ src/vpbapi.cpp	Sat Feb 12 09:58:34 2005
X@@ -516,7 +516,7 @@
X 		   Comm   *c);
X 
X static jmp_buf env;
X-#ifdef linux
X+#if defined(linux) || defined(__FreeBSD__)
X static int check_3dnow();
X static int check_sse();
X #endif
X@@ -3689,7 +3689,7 @@
X 	
X 	return(VPB_OK);
X }
X-#ifdef linux
X+#if defined(linux) || defined(__FreeBSD__)
X /*---------------------------------------------------------------------------*\
X 
X 	FUNCTION: vpb_hostecho_opt
END-of-vpb-driver/files/patch-src-vpbapi.cpp
echo x - vpb-driver/files/patch-src-vpbapi.h
sed 's/^X//' >vpb-driver/files/patch-src-vpbapi.h << 'END-of-vpb-driver/files/patch-src-vpbapi.h'
X--- src/vpbapi.h	Sat Feb 12 10:00:47 2005
X+++ src/vpbapi.h	Sat Feb 12 10:01:56 2005
X@@ -150,7 +150,7 @@
X 
X \*-------------------------------------------------------------------------*/
X 
X-#ifdef linux
X+#if defined(linux) || defined(__FreeBSD__)
X int WINAPI vpb_set_station_sync(int handle, int state);
X int WINAPI vpb_ring_station_async(int handle, int state, int one_ring);
X int WINAPI vpb_user_ring_station_sync(int handle, int state);
END-of-vpb-driver/files/patch-src-vpbapi.h
echo x - vpb-driver/files/patch-src-vpbdial.cpp
sed 's/^X//' >vpb-driver/files/patch-src-vpbdial.cpp << 'END-of-vpb-driver/files/patch-src-vpbdial.cpp'
X--- src/vpbdial.cpp	Sat Feb 12 10:19:55 2005
X+++ src/vpbdial.cpp	Sat Feb 12 10:20:54 2005
X@@ -496,7 +496,7 @@
X 	
X 	if (vpbreg_get_model() == VPB_V12PCI) {
X //		#ifndef WIN32  
X-		#ifdef linux
X+		#if defined(linux) || defined(__FreeBSD__)
X 		HostDSPSetupPlay(chdev);
X 		#endif
X 	}
X@@ -927,7 +927,7 @@
X 	maphndletodev(chdev, &b, &ch);
X 	if (vpbreg_get_model() == VPB_V12PCI) {
X //		#ifndef WIN32
X-		#ifdef linux
X+		#if defined(linux) || defined(__FreeBSD__)
X 		HostDSPSetupPlay(chdev);
X 		#endif
X 	}
END-of-vpb-driver/files/patch-src-vpbdial.cpp
echo x - vpb-driver/files/patch-src-vpbreg.cpp
sed 's/^X//' >vpb-driver/files/patch-src-vpbreg.cpp << 'END-of-vpb-driver/files/patch-src-vpbreg.cpp'
X--- src/vpbreg.cpp	Sat Feb 12 09:50:04 2005
X+++ src/vpbreg.cpp	Sat Feb 12 09:50:59 2005
X@@ -94,9 +94,9 @@
X 
X // path and name of firmware file
X 
X-#define	FIRMWARE_FILE_ISA	"/etc/vpb/vpbmain_isa.out"	
X-#define	FIRMWARE_FILE_ISA_VPB8L	"/etc/vpb/vlcmain.out"	
X-#define	FIRMWARE_FILE_PCI	"/etc/vpb/vpbmain_pci.out"	
X+#define	FIRMWARE_FILE_ISA	"%%PREFIX%%/etc/vpb/vpbmain_isa.out"	
X+#define	FIRMWARE_FILE_ISA_VPB8L	"%%PREFIX%%/etc/vpb/vlcmain.out"	
X+#define	FIRMWARE_FILE_PCI	"%%PREFIX%%/etc/vpb/vpbmain_pci.out"	
X 
X /*-------------------------------------------------------------------------*\
X 
END-of-vpb-driver/files/patch-src-vpbreg.cpp
echo x - vpb-driver/files/vpb.sh
sed 's/^X//' >vpb-driver/files/vpb.sh << 'END-of-vpb-driver/files/vpb.sh'
X#!/bin/sh
X#
X# $FreeBSD$
X#
X
X# PROVIDE: vpb-driver
X# REQUIRE: NETWORKING
X# KEYWORD: FreeBSD shutdown
X#	we load the vpb-driver after the network is fully loaded
X#       (for VOIP?)
X
X#
X# Add the following lines to /etc/rc.conf to enable exim:
X#
X#vpb_driver_enable="YES"
X#
X
X. %%RC_SUBR%%
X
Xname=vpb_driver
Xrcvar=`set_rcvar`
X
Xrequired_dirs=%%LOGDIR%%
Xvpb_module=/boot/kernel/vpb.ko
Xrequired_files=${vpb_module}
X
Xstart_cmd=start_cmd
Xstop_cmd=stop_cmd
X
Xextra_commands="reload"
X
Xstart_cmd()
X{
X  kldload ${vpb_module}
X}
X
Xstop_cmd()
X{
X  kldunload vpb
X}
X
X# read settings, set default values
Xload_rc_config $name
X: ${vpb_driver_enable="NO"}
X
Xrun_rc_command "$1"
END-of-vpb-driver/files/vpb.sh
echo x - vpb-driver/Makefile
sed 's/^X//' >vpb-driver/Makefile << 'END-of-vpb-driver/Makefile'
X# New ports collection makefile for:	vpb-driver
X# Date created:				11 Feb 2005
X# Whom:					Chris Forkin <chris@forkin.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	vpb-driver
XPORTVERSION=	2.4.0
XCATEGORIES=	misc
XMASTER_SITES=	http://www.voicetronix.com/Downloads/
X
XMAINTAINER=	chris@forkin.com
XCOMMENT=	Device-driver for the Voicetronix OpenLine4 PCI telephony cards
X
XUSE_GMAKE=	yes
XUSE_REINPLACE=	yes
X
XSED_SCRIPT=	-e 's,%%PREFIX%%,${PREFIX},g' \
X		-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
X		-e 's,%%DATADIR%%,${DATADIR},g' \
X		-e 's,%%EXAMPLESDIR%%,${EXAMPLESDIR},g' \
X		-e 's,%%RC_SUBR%%,${RC_SUBR},g' \
X
X.include <bsd.port.pre.mk>
X
Xcheck-sanity:
X.if ${OSVERSION} < 502000
X# uses new device driver code
X	@${ECHO} "This port has only been tested on FreeBSD releases >= 502000 (this release is ${OSVERSION})"
X	@exit 1
X.endif
X
Xdo-configure:
X	@${REINPLACE_CMD} -E ${SED_SCRIPT} ${WRKSRC}/src/vpbreg.cpp
X
Xpost-install:
X	@${CP} ${FILESDIR}/vpb.sh ${PREFIX}/etc/rc.d/vpb.sh.sample
X	@${REINPLACE_CMD} -E ${SED_SCRIPT} ${PREFIX}/etc/rc.d/vpb.sh.sample
X	@${RM} -f ${PREFIX}/etc/rc.d/vpb.sh.sample.bak 2>/dev/null
X
X.include <bsd.port.post.mk>
END-of-vpb-driver/Makefile
echo x - vpb-driver/distinfo
sed 's/^X//' >vpb-driver/distinfo << 'END-of-vpb-driver/distinfo'
XMD5 (vpb-driver-2.4.0.tar.gz) = 6c64be7c42b1ca865fa5972a44ecf144
XSIZE (vpb-driver-2.4.0.tar.gz) = 838391
END-of-vpb-driver/distinfo
echo x - vpb-driver/pkg-descr
sed 's/^X//' >vpb-driver/pkg-descr << 'END-of-vpb-driver/pkg-descr'
XA device-driver for the Voicetronix OpenLine4 PCI telephony card.
XThe OpenLine4 PCI telephony card can be used in conjunction with
Xasterisk (http://www.asterisk.org) to create a PC based PBX (private
Xbranch exchange).
X
XWWW: http://www.voicetronix.com.au/vpb4_4pci.htm
X
X- Chris Forkin
Xchris@forkin.com
END-of-vpb-driver/pkg-descr
echo x - vpb-driver/pkg-message
sed 's/^X//' >vpb-driver/pkg-message << 'END-of-vpb-driver/pkg-message'
X-------------------------------------------------------------------------------
XIMPORTANT INFORMATION!
X
XTo load(use) the driver, run (as root):
X
X# kldload /boot/kernel/vpb.ko
X
XTo unload it:
X
X# kldunload vpb
X
XYou can also automatically load the driver by adding it to loader.conf(5).
XAlternatively you can copy the provided sample script
X
X${PREFIX}/etc/rc.d/vpb.sh.sample
X
Xto
X
X${PREFIX}/etc/rc.d/vpb.sh
X
Xand add
X
Xvpb_driver_enable="YES"
X
Xto your /etc/rc.conf file.
X
XThis port is based on the original driver for FreeBSD RELENG_4 by Voicetronix.
XI have updated the driver to compile as a kernel loadable module and added
Xthe port infrastructure. Should you have issues with the above, please report
Xthem to me. Problems related to the driver itself (vpb.c) and or the library
X(libvpb.a) should also be directed to Voicetronix as the original authors
Xand code owners.
X
X-Chris
X-------------------------------------------------------------------------------
END-of-vpb-driver/pkg-message
echo x - vpb-driver/pkg-plist
sed 's/^X//' >vpb-driver/pkg-plist << 'END-of-vpb-driver/pkg-plist'
Xetc/rc.d/vpb.sh.sample
Xetc/vpb/vlcmain.out
Xetc/vpb/vpbmain_isa.out
Xetc/vpb/vpbmain_pci.out
Xinclude/vpbapi.h
Xlib/libvpb.a
X@dirrm etc/vpb
X@unexec rm -f /boot/kernel/vpb.ko 2>/dev/null || true
END-of-vpb-driver/pkg-plist
exit
How-To-Repeat: 	not applicable
Comment 1 Chris Forkin 2005-03-13 23:20:53 UTC
Hi,
I missed a compile problem in the original submission and also
fixed an error that occurs when you attempt to deploy this on
the latest RELENG_5 release.
Regards, Chris.
--------<cut here>--------
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	vpb-driver
#	vpb-driver/files
#	vpb-driver/files/patch-FreeBSD-Makefile
#	vpb-driver/files/patch-FreeBSD-vpb.c
#	vpb-driver/files/patch-Makefile
#	vpb-driver/files/patch-src-comm.cpp
#	vpb-driver/files/patch-src-vpbapi.cpp
#	vpb-driver/files/patch-src-vpbapi.h
#	vpb-driver/files/patch-src-vpbreg.cpp
#	vpb-driver/files/vpb.sh
#	vpb-driver/Makefile
#	vpb-driver/distinfo
#	vpb-driver/pkg-descr
#	vpb-driver/pkg-message
#	vpb-driver/pkg-plist
#
echo c - vpb-driver
mkdir -p vpb-driver > /dev/null 2>&1
echo c - vpb-driver/files
mkdir -p vpb-driver/files > /dev/null 2>&1
echo x - vpb-driver/files/patch-FreeBSD-Makefile
sed 's/^X//' >vpb-driver/files/patch-FreeBSD-Makefile << 'END-of-vpb-driver/files/patch-FreeBSD-Makefile'
X--- FreeBSD/Makefile	Thu Jan  1 10:00:00 1970
X+++ FreeBSD/Makefile	Fri Feb 11 16:21:52 2005
X@@ -0,0 +1,5 @@
X+SRCS=vpb.c
X+SRCS+=bus_if.h device_if.h pci_if.h
X+KMOD=vpb
X+
X+.include <bsd.kmod.mk>
END-of-vpb-driver/files/patch-FreeBSD-Makefile
echo x - vpb-driver/files/patch-FreeBSD-vpb.c
sed 's/^X//' >vpb-driver/files/patch-FreeBSD-vpb.c << 'END-of-vpb-driver/files/patch-FreeBSD-vpb.c'
X--- FreeBSD/vpb.c	Mon May  3 13:49:58 2004
X+++ FreeBSD/vpb.c	Sun Mar 13 11:56:37 2005
X@@ -52,8 +52,6 @@
X #define BLOCK_DELAY  1       /* delay (us) between adjacent blocks           */
X #define SIZE_LCR     128     /* size of 9050 local config reg space in bytes */
X 
X-#define MIN(a,b) (((a) < (b)) ? (a) : (b))
X-
X #define EEPROM_SIZE  64
X #define EEPROM_CS    25		/* Chip select bit */
X #define EEPROM_CLK   24
X@@ -68,16 +66,20 @@
X 
X #include <sys/types.h>
X #include <sys/module.h>
X-#include <sys/systm.h>  /* uprintf                               */
X+#include <sys/systm.h>		/* uprintf                               */
X #include <sys/errno.h>
X-#include <sys/param.h>  /* defines used in kernel.h              */
X-#include <sys/kernel.h> /* types used in module initialization   */
X-#include <sys/conf.h>   /* cdevsw struct                         */
X-#include <sys/uio.h>    /* uio struct                            */
X+#include <sys/param.h>		/* defines used in kernel.h              */
X+#include <sys/kernel.h>		/* types used in module initialization   */
X+#include <sys/conf.h>		/* cdevsw struct                         */
X+#include <sys/uio.h>		/* uio struct                            */
X #include <sys/malloc.h>
X-#include <sys/bus.h>    /* structs, prototypes for pci bus stuff */
X-#include <pci/pcivar.h> /* For get_pci macros!                   */
X-#include <sys/vpbio.h>	/* IOCTL definitions                     */
X+#include <sys/bus.h>    	/* structs, prototypes for pci bus stuff */
X+#if __FreeBSD_version > 500000
X+#include <dev/pci/pcivar.h>	/* For get_pci macros!                   */
X+#else
X+#include <pci/pcivar.h>		/* For get_pci macros!                   */
X+#endif
X+#include "vpbio.h"		/* IOCTL definitions                     */
X #include <machine/clock.h>	
X #include <vm/vm.h>	
X #include <vm/pmap.h>	
X@@ -113,26 +115,31 @@
X \*---------------------------------------------------------------------------*/
X 
X /* Character device entry points */
X-
X+#if __FreeBSD_version > 500000
X+#if __FreeBSD_version > 503000
X+#define DEV_T		struct cdev*
X+#else
X+#define DEV_T		dev_t
X+#endif
X+#define D_THREAD_T	thread
X+#define CDEV_MAJOR MAJOR_AUTO	/* reserved for local use */
X+#else
X+#define DEV_T		dev_t
X+#define D_THREAD_T	proc
X+#define CDEV_MAJOR 33		/* reserved for lkms */
X+#endif
X static struct cdevsw vpb_cdevsw = {
X-  vpb_open,
X-  vpb_close,
X-  vpb_read,
X-  vpb_write,
X-  vpb_ioctl,
X-  nopoll,
X-  nommap,
X-  nostrategy,
X-  "vpb",
X-  201,                   /* reserved for local use */
X-  nodump,
X-  nopsize,
X-  D_TTY,
X-  -1
X+        .d_open =       vpb_open,
X+        .d_close =      vpb_close,
X+        .d_read =       vpb_read,
X+        .d_write =      vpb_write,
X+        .d_ioctl =      vpb_ioctl,
X+        .d_name =       "vpb",
X+        .d_maj =        CDEV_MAJOR,
X };
X 
X /* number of valid PCI devices detected */
X-static int numPCI; 
X+static int numPCI=0; 
X 
X /* translated base address of PLX9050 regions */
X static unsigned char  *base0[MAX_V4PCI];
X@@ -144,7 +151,7 @@
X static short buf[SIZE_WD];
X 
X /* vars */
X-static dev_t sdev;
X+static DEV_T sdev[MAX_V4PCI] ={ 0 }; /* replace with dynamic allocation! */
X 
X static device_method_t vpb_methods[] = {
X   /* Device interface */
X@@ -154,15 +161,19 @@
X   DEVMETHOD(device_shutdown,  vpb_shutdown),
X   DEVMETHOD(device_suspend,   vpb_suspend),
X   DEVMETHOD(device_resume,    vpb_resume),
X-
X   { 0, 0 }
X };
X 
X+struct vpb_softc {
X+   u_int32_t unit;
X+   DEV_T dev;
X+};
X+
X static driver_t vpb_driver = {
X   "vpb",
X   vpb_methods,
X   0,
X-  /*  sizeof(struct vpb_softc), */
X+  /* sizeof(struct vpb_softc), */
X };
X 
X static devclass_t vpb_devclass;
X@@ -173,7 +184,7 @@
X        open/close/read/write at this point */
X 
X static int
X-vpb_open(dev_t dev, int oflags, int devtype, struct proc *p)
X+vpb_open(DEV_T dev, int oflags, int devtype, struct D_THREAD_T *td)
X {
X   int err = 0;
X 
X@@ -181,7 +192,7 @@
X }
X 
X static int
X-vpb_close(dev_t dev, int fflag, int devtype, struct proc *p)
X+vpb_close(DEV_T dev, int fflag, int devtype, struct D_THREAD_T *td)
X {
X   int err=0;
X 
X@@ -189,7 +200,7 @@
X }
X 
X static int
X-vpb_read(dev_t dev, struct uio *uio, int ioflag)
X+vpb_read(DEV_T dev, struct uio *uio, int ioflag)
X {
X   int err = 0;
X 
X@@ -197,7 +208,7 @@
X }
X 
X static int
X-vpb_write(dev_t dev, struct uio *uio, int ioflag)
X+vpb_write(DEV_T dev, struct uio *uio, int ioflag)
X {
X   int err = 0;
X 
X@@ -205,7 +216,7 @@
X }
X 
X static int
X-vpb_ioctl(dev_t dev, u_long cmd, caddr_t arg, int flag, struct proc *pr)
X+vpb_ioctl(DEV_T dev, u_long cmd, caddr_t arg, int flag, struct D_THREAD_T *td)
X {	
X   VPB_DATA *vpb_data;  /* ioctl parameters from user space */
X   short    *data;      /* user space address of data       */
X@@ -318,8 +329,14 @@
X   int         subsystem;
X   char        *s; 
X 
X+  if(numPCI >= MAX_V4PCI) {
X+    return ENXIO;
X+  }
X+
X+  /* struct vpb_softc *sc = (struct vpb_softc *)device_get_softc(dev); */
X   if ((pci_get_vendor(dev) == 0x10b5) && (pci_get_device(dev) == 0x9050)) {
X 
X+    /* bzero(sc, sizeof(struct vpb_softc)); */
X     /* check that subsytem ID & Subsytem Vendor matches */
X     subsystem = pci_read_config(dev, 0x2c, 4);
X     s = (char*)&subsystem;
X@@ -327,7 +344,7 @@
X     if ((s[3] == 'V') && (s[2] == '4') && (s[1] == 'V') && (s[0] == 'T')) {
X       
X       printf("V4PCI %d found!\n", numPCI);
X-      device_set_desc(dev, "Voicetronix V4PCI Computer Telephony Card");
X+      device_set_desc_copy(dev, "Voicetronix V4PCI Computer Telephony Card");
X       return 0;
X     }
X   }
X@@ -341,13 +358,16 @@
X vpb_attach(device_t dev)
X {
X   vm_offset_t paddr;
X+  /* int         unit; */
X 
X-  sdev = make_dev(&vpb_cdevsw,
X+  /* unit = device_get_unit(dev); */
X+  sdev[numPCI] = make_dev(&vpb_cdevsw,
X 		  0,
X 		  UID_ROOT,
X 		  GID_WHEEL,
X 		  0600,
X-		  "vpb");
X+		  "vpb%d",
X+		  numPCI);
X 
X   /* OK, V4PCI found, so map address regions..... */
X   paddr = (vm_offset_t)pci_read_config(dev, PCI_BASE_ADDR0, 4) & ~0xf;
X@@ -357,7 +377,9 @@
X   base2[numPCI] = pmap_mapdev(paddr, sizeof(short)*SIZE_WD);
X 
X   /* set wait-states */
X-  *(base0[0]+0x28) = 0x00440422;     
X+  /* ((unsigned int)*(base0[0]+0x28)) = 0x00440422; */
X+  /* now adding 1 wait-state to Write cycle hold */
X+  ((unsigned int)*(base0[0]+0x28)) = 0x070440422;     
X 
X   numPCI++;
X 
X@@ -369,6 +391,11 @@
X static int
X vpb_detach(device_t dev)
X {
X+  if(numPCI>0 && sdev[numPCI-1]!=NULL) {
X+    destroy_dev(sdev[numPCI-1]);
X+    sdev[numPCI-1]=NULL;
X+    numPCI--;
X+  }
X   return 0;
X }
X 
X@@ -491,4 +518,4 @@
X         cntrl &= 1;
X         return(cntrl);
X }
X-                               
X+
END-of-vpb-driver/files/patch-FreeBSD-vpb.c
echo x - vpb-driver/files/patch-Makefile
sed 's/^X//' >vpb-driver/files/patch-Makefile << 'END-of-vpb-driver/files/patch-Makefile'
X--- Makefile	Thu Nov  4 07:33:22 2004
X+++ Makefile	Fri Feb 11 16:55:17 2005
X@@ -26,8 +26,8 @@
X KERNEL_OLD := $(shell if [ -f $(KERNEL_LOCATION)/Rules.make ]; then echo 1; else echo 0; fi)
X 
X # FreeBSD users: Please change this line to 'OS = FreeBSD'
X-OS = linux
X-#OS = FreeBSD
X+#OS = linux
X+OS = FreeBSD
X export OS
X 
X all:
X@@ -37,20 +37,29 @@
X 	cd vpb-detect; make
X else
X 	echo FREEBSD
X-	cd src; gmake
X+	cd src && gmake
X+	cd FreeBSD && make
X endif
X 
X install: all
X+ifeq ($(OS),linux)
X 	mkdir -p $(root)/etc/vpb
X 	cp -f firmware/vpbmain_isa.out $(root)/etc/vpb
X 	cp -f firmware/vpbmain_pci.out $(root)/etc/vpb
X 	cp -f firmware/vlcmain.out $(root)/etc/vpb
X 	cp -f src/libvpb.a $(root)/usr/local/lib
X 	cp -f src/vpbapi.h $(root)/usr/include
X-ifneq ($(OS),linux)
X-	cp -f FreeBSD/vpb.c /sys/pci
X-	cp -f FreeBSD/vpbio.h /sys/sys
X-else
X+endif
X+ifeq ($(OS),FreeBSD)
X+	mkdir -p $(PREFIX)/etc/vpb
X+	cp -f firmware/vpbmain_isa.out $(PREFIX)/etc/vpb
X+	cp -f firmware/vpbmain_pci.out $(PREFIX)/etc/vpb
X+	cp -f firmware/vlcmain.out $(PREFIX)/etc/vpb
X+	cp -f src/libvpb.a $(PREFIX)/lib
X+	cp -f src/vpbapi.h $(PREFIX)/include
X+	cd FreeBSD && make install
X+endif
X+ifeq ($(OS),linux)
X 	cp -f vpb-detect/vpbscan /usr/sbin
X 	cp -f vpb-detect/vpbconf /usr/sbin	
X ifeq ($(KERNEL_OLD), 1)
END-of-vpb-driver/files/patch-Makefile
echo x - vpb-driver/files/patch-src-comm.cpp
sed 's/^X//' >vpb-driver/files/patch-src-comm.cpp << 'END-of-vpb-driver/files/patch-src-comm.cpp'
X--- src/comm.cpp	Fri Aug 20 23:30:55 2004
X+++ src/comm.cpp	Mon Mar 14 09:42:07 2005
X@@ -840,6 +840,7 @@
X 
X //	GenericEnterCriticalSection(&PutMessageSect);
X 
X+#ifndef __FreeBSD__
X         switch (v->reg->model) 
X 	{
X 	    case VPB_V12PCI:
X@@ -852,6 +853,9 @@
X 		hip->WriteIic(board, addr, length, buf);	
X 		break;
X 	}
X+#else
X+	hip->WriteIic(board, addr, length, buf);	
X+#endif
X 	
X //	CheckForAssert(board);
X //	GenericLeaveCriticalSection(&PutMessageSect);
X@@ -879,6 +883,7 @@
X 
X //	GenericEnterCriticalSection(&PutMessageSect);
X 
X+#ifndef __FreeBSD__
X         switch  (v->reg->model) 
X 	{
X 	    case VPB_V12PCI:
X@@ -891,6 +896,9 @@
X 		hip->ReadIic(board, addr, length, buf);	
X 		break;
X 	}
X+#else
X+	hip->ReadIic(board, addr, length, buf);	
X+#endif
X 	
X //	CheckForAssert(board);
X //	GenericLeaveCriticalSection(&PutMessageSect);
END-of-vpb-driver/files/patch-src-comm.cpp
echo x - vpb-driver/files/patch-src-vpbapi.cpp
sed 's/^X//' >vpb-driver/files/patch-src-vpbapi.cpp << 'END-of-vpb-driver/files/patch-src-vpbapi.cpp'
X--- src/vpbapi.cpp	Sat Feb 12 09:56:53 2005
X+++ src/vpbapi.cpp	Sat Feb 12 09:58:34 2005
X@@ -516,7 +516,7 @@
X 		   Comm   *c);
X 
X static jmp_buf env;
X-#ifdef linux
X+#if defined(linux) || defined(__FreeBSD__)
X static int check_3dnow();
X static int check_sse();
X #endif
X@@ -3689,7 +3689,7 @@
X 	
X 	return(VPB_OK);
X }
X-#ifdef linux
X+#if defined(linux) || defined(__FreeBSD__)
X /*---------------------------------------------------------------------------*\
X 
X 	FUNCTION: vpb_hostecho_opt
END-of-vpb-driver/files/patch-src-vpbapi.cpp
echo x - vpb-driver/files/patch-src-vpbapi.h
sed 's/^X//' >vpb-driver/files/patch-src-vpbapi.h << 'END-of-vpb-driver/files/patch-src-vpbapi.h'
X--- src/vpbapi.h	Sat Feb 12 10:00:47 2005
X+++ src/vpbapi.h	Sat Feb 12 10:01:56 2005
X@@ -150,7 +150,7 @@
X 
X \*-------------------------------------------------------------------------*/
X 
X-#ifdef linux
X+#if defined(linux) || defined(__FreeBSD__)
X int WINAPI vpb_set_station_sync(int handle, int state);
X int WINAPI vpb_ring_station_async(int handle, int state, int one_ring);
X int WINAPI vpb_user_ring_station_sync(int handle, int state);
END-of-vpb-driver/files/patch-src-vpbapi.h
echo x - vpb-driver/files/patch-src-vpbreg.cpp
sed 's/^X//' >vpb-driver/files/patch-src-vpbreg.cpp << 'END-of-vpb-driver/files/patch-src-vpbreg.cpp'
X--- src/vpbreg.cpp	Sat Feb 12 09:50:04 2005
X+++ src/vpbreg.cpp	Sat Feb 12 09:50:59 2005
X@@ -94,9 +94,9 @@
X 
X // path and name of firmware file
X 
X-#define	FIRMWARE_FILE_ISA	"/etc/vpb/vpbmain_isa.out"	
X-#define	FIRMWARE_FILE_ISA_VPB8L	"/etc/vpb/vlcmain.out"	
X-#define	FIRMWARE_FILE_PCI	"/etc/vpb/vpbmain_pci.out"	
X+#define	FIRMWARE_FILE_ISA	"%%PREFIX%%/etc/vpb/vpbmain_isa.out"	
X+#define	FIRMWARE_FILE_ISA_VPB8L	"%%PREFIX%%/etc/vpb/vlcmain.out"	
X+#define	FIRMWARE_FILE_PCI	"%%PREFIX%%/etc/vpb/vpbmain_pci.out"	
X 
X /*-------------------------------------------------------------------------*\
X 
END-of-vpb-driver/files/patch-src-vpbreg.cpp
echo x - vpb-driver/files/vpb.sh
sed 's/^X//' >vpb-driver/files/vpb.sh << 'END-of-vpb-driver/files/vpb.sh'
X#!/bin/sh
X#
X# $FreeBSD$
X#
X
X# PROVIDE: vpb-driver
X# REQUIRE: NETWORKING
X# KEYWORD: FreeBSD shutdown
X#	we load the vpb-driver after the network is fully loaded
X#       (for VOIP?)
X
X#
X# Add the following lines to /etc/rc.conf to enable exim:
X#
X#vpb_driver_enable="YES"
X#
X
X. %%RC_SUBR%%
X
Xname=vpb_driver
Xrcvar=`set_rcvar`
X
Xrequired_dirs=%%LOGDIR%%
Xvpb_module=/boot/kernel/vpb.ko
Xrequired_files=${vpb_module}
X
Xstart_cmd=start_cmd
Xstop_cmd=stop_cmd
X
Xextra_commands="reload"
X
Xstart_cmd()
X{
X  kldload ${vpb_module}
X}
X
Xstop_cmd()
X{
X  kldunload vpb
X}
X
X# read settings, set default values
Xload_rc_config $name
X: ${vpb_driver_enable="NO"}
X
Xrun_rc_command "$1"
END-of-vpb-driver/files/vpb.sh
echo x - vpb-driver/Makefile
sed 's/^X//' >vpb-driver/Makefile << 'END-of-vpb-driver/Makefile'
X# New ports collection makefile for:	vpb-driver
X# Date created:				11 Feb 2005
X# Whom:					Chris Forkin <chris@forkin.com>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	vpb-driver
XPORTVERSION=	2.4.0
XPORTREVISION=	1
XCATEGORIES=	misc
XMASTER_SITES=	http://www.voicetronix.com/Downloads/
X
XMAINTAINER=	chris@forkin.com
XCOMMENT=	Device-driver for the Voicetronix OpenLine4 PCI telephony cards
X
XUSE_GMAKE=	yes
XUSE_REINPLACE=	yes
X
XSED_SCRIPT=	-e 's,%%PREFIX%%,${PREFIX},g' \
X		-e 's,%%DOCSDIR%%,${DOCSDIR},g' \
X		-e 's,%%DATADIR%%,${DATADIR},g' \
X		-e 's,%%EXAMPLESDIR%%,${EXAMPLESDIR},g' \
X		-e 's,%%RC_SUBR%%,${RC_SUBR},g' \
X
X.include <bsd.port.pre.mk>
X
Xcheck-sanity:
X.if ${OSVERSION} < 502000
X# uses new device driver code
X	@${ECHO} "This port has only been tested on FreeBSD releases >= 502000 (this release is ${OSVERSION})"
X	@exit 1
X.endif
X
Xdo-configure:
X	@${REINPLACE_CMD} -E ${SED_SCRIPT} ${WRKSRC}/src/vpbreg.cpp
X
Xpost-install:
X	@${CP} ${FILESDIR}/vpb.sh ${PREFIX}/etc/rc.d/vpb.sh.sample
X	@${REINPLACE_CMD} -E ${SED_SCRIPT} ${PREFIX}/etc/rc.d/vpb.sh.sample
X	@${RM} -f ${PREFIX}/etc/rc.d/vpb.sh.sample.bak 2>/dev/null
X
X.include <bsd.port.post.mk>
END-of-vpb-driver/Makefile
echo x - vpb-driver/distinfo
sed 's/^X//' >vpb-driver/distinfo << 'END-of-vpb-driver/distinfo'
XMD5 (vpb-driver-2.4.0.tar.gz) = 6c64be7c42b1ca865fa5972a44ecf144
XSIZE (vpb-driver-2.4.0.tar.gz) = 838391
END-of-vpb-driver/distinfo
echo x - vpb-driver/pkg-descr
sed 's/^X//' >vpb-driver/pkg-descr << 'END-of-vpb-driver/pkg-descr'
XA device-driver for the Voicetronix OpenLine4 PCI telephony card.
XThe OpenLine4 PCI telephony card can be used in conjunction with
Xasterisk (http://www.asterisk.org) to create a PC based PBX (private
Xbranch exchange).
X
XWWW: http://www.voicetronix.com.au/vpb4_v4pci.htm
X
X- Chris Forkin
Xchris@forkin.com
END-of-vpb-driver/pkg-descr
echo x - vpb-driver/pkg-message
sed 's/^X//' >vpb-driver/pkg-message << 'END-of-vpb-driver/pkg-message'
X-------------------------------------------------------------------------------
XIMPORTANT INFORMATION!
X
XTo load(use) the driver, run (as root):
X
X# kldload /boot/kernel/vpb.ko
X
XTo unload it:
X
X# kldunload vpb
X
XYou can also automatically load the driver by adding it to loader.conf(5).
XAlternatively you can copy the provided sample script
X
X${PREFIX}/etc/rc.d/vpb.sh.sample
X
Xto
X
X${PREFIX}/etc/rc.d/vpb.sh
X
Xand add
X
Xvpb_driver_enable="YES"
X
Xto your /etc/rc.conf file.
X
XThis port is based on the original driver for FreeBSD RELENG_4 by Voicetronix.
XI have updated the driver to compile as a kernel loadable module and added
Xthe port infrastructure. Should you have issues with the above, please report
Xthem to me. Problems related to the driver itself (vpb.c) and or the library
X(libvpb.a) should also be directed to Voicetronix as the original authors
Xand code owners.
X
X-Chris
X-------------------------------------------------------------------------------
END-of-vpb-driver/pkg-message
echo x - vpb-driver/pkg-plist
sed 's/^X//' >vpb-driver/pkg-plist << 'END-of-vpb-driver/pkg-plist'
Xetc/rc.d/vpb.sh.sample
Xetc/vpb/vlcmain.out
Xetc/vpb/vpbmain_isa.out
Xetc/vpb/vpbmain_pci.out
Xinclude/vpbapi.h
Xlib/libvpb.a
X@dirrm etc/vpb
X@unexec rm -f /boot/kernel/vpb.ko 2>/dev/null || true
END-of-vpb-driver/pkg-plist
exit

--------<cut here>--------
Comment 2 Tilman Keskinoz freebsd_committer 2005-04-21 15:25:28 UTC
Class Changed
From-To: maintainer-update->change-request

New ports PRs are change-requests
Comment 3 Sam Lawrance freebsd_committer 2005-11-10 12:53:43 UTC
Responsible Changed
From-To: freebsd-ports-bugs->lawrance

Take
Comment 4 Sam Lawrance freebsd_committer 2005-11-10 23:48:06 UTC
State Changed
From-To: open->feedback

I can't build it in a chroot'ed 5.x environment.  Any ideas? 

cc -O -pipe   -D_KERNEL -DKLD_MODULE -nostdinc -I-   -I. -I@ -I@/contrib/altq -I/usr/include -finline-limit=8000 -fno-common  -mno-align-long-strings -mpreferred-stack-boundary=2  -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions -std=c99 -c vpb.c 
vpb.c:182: error: conflicting types for 'vpb_open' 
vpb.c:94: error: previous declaration of 'vpb_open' was here 
vpb.c:182: error: conflicting types for 'vpb_open' 
vpb.c:94: error: previous declaration of 'vpb_open' was here 
vpb.c:190: error: conflicting types for 'vpb_close' 
vpb.c:95: error: previous declaration of 'vpb_close' was here 
vpb.c:190: error: conflicting types for 'vpb_close' 
vpb.c:95: error: previous declaration of 'vpb_close' was here 
vpb.c:198: error: conflicting types for 'vpb_read' 
vpb.c:96: error: previous declaration of 'vpb_read' was here 
vpb.c:198: error: conflicting types for 'vpb_read' 
vpb.c:96: error: previous declaration of 'vpb_read' was here 
vpb.c:206: error: conflicting types for 'vpb_write' 
vpb.c:97: error: previous declaration of 'vpb_write' was here 
vpb.c:206: error: conflicting types for 'vpb_write' 
vpb.c:97: error: previous declaration of 'vpb_write' was here 
vpb.c:214: error: conflicting types for 'vpb_ioctl' 
vpb.c:98: error: previous declaration of 'vpb_ioctl' was here 
vpb.c:214: error: conflicting types for 'vpb_ioctl' 
vpb.c:98: error: previous declaration of 'vpb_ioctl' was here 
vpb.c: In function `vpb_attach': 
vpb.c:364: warning: assignment makes integer from pointer without a cast 
vpb.c:376: warning: use of cast expressions as lvalues is deprecated 
vpb.c: In function `vpb_detach': 
vpb.c:388: warning: comparison between pointer and integer 
vpb.c:389: warning: passing arg 1 of `destroy_dev' makes pointer from integer without a cast 
vpb.c:390: warning: assignment makes integer from pointer without a cast 
vpb.c: At top level: 
vpb.c:94: warning: 'vpb_open' used but never defined 
vpb.c:95: warning: 'vpb_close' used but never defined 
vpb.c:96: warning: 'vpb_read' used but never defined 
vpb.c:97: warning: 'vpb_write' used but never defined 
vpb.c:98: warning: 'vpb_ioctl' used but never defined 
vpb.c:182: warning: 'vpb_open' defined but not used 
vpb.c:190: warning: 'vpb_close' defined but not used 
vpb.c:198: warning: 'vpb_read' defined but not used 
vpb.c:206: warning: 'vpb_write' defined but not used 
vpb.c:214: warning: 'vpb_ioctl' defined but not used 
*** Error code 1 

Stop in /vpb-driver/work/vpb-driver-2.4.0/FreeBSD. 
gmake: *** [all] Error 1 
*** Error code 2 

Stop in /vpb-driver.
Comment 5 Sam Lawrance freebsd_committer 2005-11-11 10:11:17 UTC
State Changed
From-To: feedback->closed

The new version you sent was committed.  Thanks! 

Some small changes.  If any of these aren't acceptable, just mail 
me with an alternative - 

- Set USE_RC_SUBR=vpb.sh and move files/vpb.sh to vpb.sh.in.  USE_RC_SUBR 
does the %%PREFIX%% substitutions etc for us :-) 

- Set KMODDIR to %{PREFIX}/lib to install vpb.ko there.  Adjust vpb.sh.in 
accordingly.  Add vpb.ko to the pkg-plist. 

- Move pkg-message to files/pkg-message.in and add it to SUB_FILES so the 
messages is printed with PREFIX substituted. 

- Remove the check-sanity target and use IGNORE instead (ports should 
not exit with error status).  Also add OSVERSION >= 600000 to the 
IGNORE condition, since it does not build there.