1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-24 04:33:24 +00:00

- fix the build for FreeBSD >= 600000

- we now install the module in KMODDIR instead of ${LOCALBASE}/lib
therefor the pkg-plist and the rc.d startup script where adapted
- adapt the pkg-message to match reality

PR:		ports/95915
Submitted by:	Joerg Pulz <Joerg.Pulz@frm2.tum.de>
This commit is contained in:
Ion-Mihai Tetcu 2006-06-17 21:16:13 +00:00
parent b86f9f257b
commit d8d1209c77
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=165664
6 changed files with 41 additions and 38 deletions

View File

@ -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_GMAKE= yes
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 @@ IGNORE= requires kernel source (/usr/src/sys) to build
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:

View File

@ -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>

View File

@ -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);
}

View File

@ -3,25 +3,21 @@ IMPORTANT INFORMATION!
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
%%PREFIX%%/etc/rc.d/vpb.sh.sample
to
%%PREFIX%%/etc/rc.d/vpb.sh
and add
Alternatively you can add
vpb_driver_enable="YES"
to your /etc/rc.conf file.
to your /etc/rc.conf file or
vpb_load="YES"
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

View File

@ -21,7 +21,7 @@ name=vpb_driver
rcvar=`set_rcvar`
required_dirs=
vpb_module=%%PREFIX%%/lib/vpb.ko
vpb_module=%%KMODDIR%%/vpb.ko
required_files=${vpb_module}
start_cmd=start_cmd

View File

@ -2,7 +2,7 @@ etc/vpb/vlcmain.out
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