aboutsummaryrefslogtreecommitdiff
path: root/net/zaptel12/files
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2004-10-26 14:06:06 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2004-10-26 14:06:06 +0000
commit33f57ea588ed6c094d754fa6d0b579c54d112b6c (patch)
treeb153f1ecf8a92b41e4eec72aa450c56ec0deded9 /net/zaptel12/files
parentc68425a12bf9bed47d64c34a5bb0195899ec5c72 (diff)
downloadports-33f57ea588ed6c094d754fa6d0b579c54d112b6c.tar.gz
ports-33f57ea588ed6c094d754fa6d0b579c54d112b6c.zip
Notes
Diffstat (limited to 'net/zaptel12/files')
-rw-r--r--net/zaptel12/files/patch-wcfxo::wcfxo.c22
-rw-r--r--net/zaptel12/files/patch-wcfxs::wcfxs.c20
-rw-r--r--net/zaptel12/files/patch-zaptel::zaptel.c26
-rw-r--r--net/zaptel12/files/zaptel.sh49
4 files changed, 114 insertions, 3 deletions
diff --git a/net/zaptel12/files/patch-wcfxo::wcfxo.c b/net/zaptel12/files/patch-wcfxo::wcfxo.c
new file mode 100644
index 000000000000..1a2810a58b6d
--- /dev/null
+++ b/net/zaptel12/files/patch-wcfxo::wcfxo.c
@@ -0,0 +1,22 @@
+
+$FreeBSD$
+
+--- wcfxo/wcfxo.c
++++ wcfxo/wcfxo.c
+@@ -267,8 +267,14 @@
+
+ /* Character device entry points */
+ static struct cdevsw wcfxo_cdevsw = {
+-#if __FreeBSD_version >= 502103
+- .d_version = D_VERSION,
++#if __FreeBSD_version < 502103
++#ifdef MAJOR_AUTO
++ .d_maj = MAJOR_AUTO,
++#else
++ .d_maj = 197,
++#endif
++#else
++ .d_version = D_VERSION,
+ #endif
+ .d_name = "wcfxo",
+ .d_open = wcfxo_sys_open,
diff --git a/net/zaptel12/files/patch-wcfxs::wcfxs.c b/net/zaptel12/files/patch-wcfxs::wcfxs.c
new file mode 100644
index 000000000000..bab8faf9d09e
--- /dev/null
+++ b/net/zaptel12/files/patch-wcfxs::wcfxs.c
@@ -0,0 +1,20 @@
+
+$FreeBSD$
+
+--- wcfxs/wcfxs.c
++++ wcfxs/wcfxs.c
+@@ -308,7 +308,13 @@
+
+ /* Character device entry points */
+ static struct cdevsw wcfxs_cdevsw = {
+-#if __FreeBSD_version >= 502103
++#if __FreeBSD_version < 502103
++#ifdef MAJOR_AUTO
++ .d_maj = MAJOR_AUTO,
++#else
++ .d_maj = 198,
++#endif
++#else
+ .d_version = D_VERSION,
+ #endif
+ .d_name = "wcfxs",
diff --git a/net/zaptel12/files/patch-zaptel::zaptel.c b/net/zaptel12/files/patch-zaptel::zaptel.c
new file mode 100644
index 000000000000..a5fc0b4cf7d9
--- /dev/null
+++ b/net/zaptel12/files/patch-zaptel::zaptel.c
@@ -0,0 +1,26 @@
+
+$FreeBSD$
+
+--- zaptel/zaptel.c
++++ zaptel/zaptel.c
+@@ -156,12 +156,17 @@
+ #endif
+
+ static struct cdevsw zt_devsw = {
+-#if __FreeBSD_version >= 502103
++#if __FreeBSD_version < 502103
++#ifdef MAJOR_AUTO
++ .d_maj = MAJOR_AUTO,
++#else
++ .d_maj = ZT_MAJOR,
++#endif
++#else
+ .d_version = D_VERSION,
+ #endif
+ .d_open = ztopen,
+- .d_name = "zaptel",
+- .d_maj = ZT_MAJOR
++ .d_name = "zaptel"
+ };
+
+
diff --git a/net/zaptel12/files/zaptel.sh b/net/zaptel12/files/zaptel.sh
index de95d990364b..29da7fc86ad4 100644
--- a/net/zaptel12/files/zaptel.sh
+++ b/net/zaptel12/files/zaptel.sh
@@ -8,16 +8,59 @@ case "$1" in
/sbin/kldload ${LIBDIR}/zaptel.ko || exit 1
/sbin/kldload ${LIBDIR}/wcfxo.ko || exit 1
/sbin/kldload ${LIBDIR}/wcfxs.ko || exit 1
- if /usr/sbin/devinfo | /usr/bin/grep -q wcfxo
+ if [ ! -d /dev/zap ]
then
+ mkdir -p /dev/zap || exit 1
+ fi
+ if [ ! -c /dev/zap/channel ]
+ then
+ /sbin/mknod /dev/zap/channel c 196 254 || exit 1
+ fi
+ if [ ! -c /dev/zap/ctl ]
+ then
+ /sbin/mknod /dev/zap/ctl c 196 0 || exit 1
+ fi
+ if [ ! -c /dev/zap/pseudo ]
+ then
+ /sbin/mknod /dev/zap/pseudo c 196 255 || exit 1
+ fi
+ if [ ! -c /dev/zap/timer ]
+ then
+ /sbin/mknod /dev/zap/timer c 196 253 || exit 1
+ fi
+ z=" zaptel"
+ if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxo
+ then
+ for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ do
+ if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxo${i}
+ then
+ if [ ! -c /dev/wcfxo${i} ]
+ then
+ /sbin/mknod /dev/wcfxo${i} c 197 ${i} || exit 1
+ fi
+ fi
+ done
${PREFIX}/bin/ztcfg 2> /dev/null
else
- if /usr/sbin/devinfo | /usr/bin/grep -q wcfxs
+ if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxs
then
+ for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+ do
+ if /usr/sbin/pciconf -l | /usr/bin/grep -q ^wcfxs${i}
+ then
+ if [ ! -c /dev/wcfxs${i} ]
+ then
+ /sbin/mknod /dev/wcfxo${i} c 198 ${i} || exit 1
+ fi
+ fi
+ done
${PREFIX}/bin/ztcfg 2> /dev/null
+ else
+ z=""
fi
fi
- echo -n " zaptel"
+ echo -n ${z}
;;
stop)