[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ISDN cards for OpenBSD 2.8



On Fri, Jan 12, 2001 at 07:04:46PM +0100, Bob Pepin wrote:
> On Fri, Dec 15, 2000 at 06:38:31AM -0600, Carlos López wrote:
> > Hi all.
> > 
> > Where can I find documentation about isdn cards
> > supported by OpenBSD 2.8 ???
> 

just found out that I had already started porting i4b 0.96 to obsd 2.8,
I just can't test it, don't even know if it compiles since I haven't
installed 2.8 yet, and won't do so until I'm sure i4b works for sure
there. It's mostly a port of the original patch for 0.90/2.7, I've
attached the diff. (I trusted the author of the original patch when he
says that syncppp doesn't work yet..)
diff -ur 0.96.orig/Makefile 0.96/Makefile
--- 0.96.orig/Makefile	Wed Mar 15 10:22:58 2000
+++ 0.96/Makefile	Fri Jan 12 19:25:10 2001
@@ -15,7 +15,7 @@
 SUBDIR      = isdntrace isdndebug isdnd g711conv man isdntest \
 		isdntel lib-isdn misc isdntelctl isdnmonitor \
 		isdndecode dtmfdecode ispppcontrol
-.elif (${BSDTYPE} == "BSD/OS")
+.elif (${BSDTYPE} == "BSD/OS" || ${BSDTYPE} == "OpenBSD")
 SUBDIR      = isdntrace isdndebug isdnd g711conv man isdntest \
 		lib-isdn misc isdntelctl isdnmonitor \
 		isdndecode dtmfdecode
diff -ur 0.96.orig/OpenBSD/INSTALLATION 0.96/OpenBSD/INSTALLATION
--- 0.96.orig/OpenBSD/INSTALLATION	Mon Jan 31 15:34:26 2000
+++ 0.96/OpenBSD/INSTALLATION	Fri Jan 12 19:42:43 2001
@@ -1,6 +1,6 @@
 --------------------------------------------------------------------------------
 
-                  ISDN4BSD 0.90 installation on OpenBSD 2.6
+                  ISDN4BSD 0.90 installation on OpenBSD 2.8
                   =========================================
 
                   last edit-date: [Mon Jan 31 15:22:31 2000]
@@ -28,7 +28,7 @@
 4) cd to /usr/src/i4b, and run "make depend", "make" and "make install".
 
 
-5) add the following to your kernel config file in /usr/src/sys/i386/conf:
+5) add the following to your kernel config file in /usr/src/sys/arch/i386/conf:
 
 
 #---------------------------------------------------------------------
@@ -57,6 +57,14 @@
 options DRN_NGO
 # isic0 at isapnp?
 
+# PCI hardware      
+# ELSA              
+option ELSA_QS1PCI  
+#isic0 at pci?     
+# AVM Fritz!Card    
+option AVM_A1_PCI   
+#isic0 at pci?
+
 pseudo-device	"i4b"
 # userland driver to do ISDN tracing
 pseudo-device   "i4btrc"
@@ -69,9 +77,11 @@
 # network driver for IP over raw HDLC ISDN
 option IPR_VJ			# compile support for VJ compression
 pseudo-device   "i4bipr"	2
-# synchronous PPP over ISDN
-pseudo-device	i4bisppp	2
-option SPPP_VJ			# compile support for VJ compression
+
+# synchronous PPP over ISDN (DOESN'T WORK YET FOR OBSD, DON'T USE)
+# pseudo-device  i4bisppp        2
+# option SPPP_VJ                 # compile support for VJ compression
+
 #---------------------------------------------------------------------
 
 
diff -ur 0.96.orig/OpenBSD/MAKEDEV.i4b 0.96/OpenBSD/MAKEDEV.i4b
--- 0.96.orig/OpenBSD/MAKEDEV.i4b	Mon Jan 31 15:34:26 2000
+++ 0.96/OpenBSD/MAKEDEV.i4b	Tue Dec 12 13:56:55 2000
@@ -1,7 +1,7 @@
 #! /bin/sh
 #---------------------------------------------------------------------------
 #
-#	i4b MAKEDEV script for OpenBSD 2.6
+#	i4b MAKEDEV script for OpenBSD 2.8
 #	----------------------------------
 #
 #	last edit-date: [Mon Jan 31 15:22:49 2000]
@@ -14,7 +14,7 @@
 OS_VERSION=`uname -r`
 OSRELEASE=`sysctl -n kern.osrelease`
 
-# for OpenBSD 2.6
+# for OpenBSD 2.8
 i4b_major=56
 i4bctl_major=57
 i4brbch_major=58
@@ -23,9 +23,9 @@
 
 if [ "$ARCH" = "i386" -a "$OS" = "OpenBSD" ]
 then
-	if [ "$OSRELEASE" != "2.6" ]
+	if [ "$OSRELEASE" != "2.8" ]
 	then
-		echo "$OS != 2.6 not supported!"
+		echo "$OS != 2.8 not supported!"
 		exit 1
 	fi
 else
diff -ur 0.96.orig/OpenBSD/deinstall-openbsd.sh 0.96/OpenBSD/deinstall-openbsd.sh
--- 0.96.orig/OpenBSD/deinstall-openbsd.sh	Mon Jan 31 15:34:26 2000
+++ 0.96/OpenBSD/deinstall-openbsd.sh	Fri Jan 12 19:35:00 2001
@@ -1,7 +1,7 @@
 #!/bin/sh
 #---------------------------------------------------------------------------
 #
-#	i4b OpenBSD 2.6 de-installation script
+#	i4b OpenBSD 2.8 de-installation script
 #	--------------------------------------
 #
 #	last edit-date: [Mon Jan 31 15:23:21 2000]
@@ -15,9 +15,9 @@
 
 if [ "$OS" = "OpenBSD" ]
 then
-	if [ "$OSRELEASE" != "2.6" ]
+	if [ "$OSRELEASE" != "2.8" ]
 	then
-		echo "This script is just for $OS 2.6, exit!"
+		echo "This script is just for $OS 2.8, exit!"
 		exit 1
 	fi
 else
diff -ur 0.96.orig/OpenBSD/files.i4b 0.96/OpenBSD/files.i4b
--- 0.96.orig/OpenBSD/files.i4b	Mon Jan 31 15:34:26 2000
+++ 0.96/OpenBSD/files.i4b	Tue Dec 12 13:59:02 2000
@@ -85,9 +85,16 @@
 file i4b/layer1/i4b_ctx_s0P.c        isic    needs-flag
 file i4b/layer1/i4b_drn_ngo.c        isic    needs-flag
 file i4b/layer1/i4b_avm_a1.c         isic    needs-flag
+file i4b/layer1/i4b_sws.c            isic    needs-flag
 file i4b/layer1/i4b_usr_sti.c        isic    needs-flag
 file i4b/layer1/i4b_isac.c           isic    needs-flag
 file i4b/layer1/i4b_hscx.c           isic    needs-flag
 file i4b/layer1/i4b_l1.c             isic    needs-flag
 file i4b/layer1/i4b_l1fsm.c          isic    needs-flag
 file i4b/layer1/i4b_bchan.c          isic    needs-flag
+
+# PCI devices
+attach isic at pci with pci_isic
+file dev/pci/pci_isic.c			pci_isic
+file i4b/layer1/i4b_elsa_qs1p.c		pci_isic
+file i4b/layer1/i4b_avm_fritz_pci.c	pci_isic
diff -ur 0.96.orig/OpenBSD/install-openbsd.sh 0.96/OpenBSD/install-openbsd.sh
--- 0.96.orig/OpenBSD/install-openbsd.sh	Mon Jan 31 15:34:26 2000
+++ 0.96/OpenBSD/install-openbsd.sh	Fri Jan 12 19:39:16 2001
@@ -1,7 +1,7 @@
 #!/bin/sh
 #---------------------------------------------------------------------------
 #
-#	i4b OpenBSD 2.6 installation script
+#	i4b OpenBSD 2.8 installation script
 #	-----------------------------------
 #
 #	last edit-date: [Mon Jan 31 15:23:50 2000]
@@ -15,9 +15,9 @@
 
 if [ "$OS" = "OpenBSD" ]
 then
-	if [ "$OSRELEASE" != "2.6" ]
+	if [ "$OSRELEASE" != "2.8" ]
 	then
-		echo "This script is just for $OS 2.6, exit!"
+		echo "This script is just for $OS 2.8, exit!"
 		exit 1
 	fi
 else
@@ -68,45 +68,47 @@
 ( cd $DST/dev/isa && ln -s $SRC/diehl/isadaic.c . )
 ( cd $DST/dev/ic && ln -s $SRC/diehl/daic*.[hc] . )
 ( cd $DST/dev/isa && ln -s $SRC/layer1/isapnp_isic.c . )
+( cd $DST/dev/pci && ln -s /usr/src/i4b/layer1/pci_isic.c )
 ( cd $DST/dev/microcode && mkdir daic && cd daic && ln -s $SRC/diehl/microcode/* . && make )
 
 # ---------------------------------------------------------------------------- 
 # machine independent config file changes...
 # ---------------------------------------------------------------------------- 
+# disabled because syncppp doesn't work yet anyway
 
-cd $DST/conf || exit 1
+#  cd $DST/conf || exit 1
 
-if [ -e files-BACKUP ]
-then
-	echo "Error: $DST/conf/files-BACKUP already exist, exit!"
-	exit 1
-fi
-mv files files-BACKUP
-cp files-BACKUP files
-
-echo "patching $DST/conf/files (output in /tmp/files-patch.out) ...."
-
-patch << 'END_OF_PATCH' >/tmp/files-patch.out 2>&1
-*** files.orig	Sun Jan 30 14:51:03 2000
---- files	Sun Jan 30 14:53:28 2000
-***************
-*** 431,437 ****
-  file net/raw_usrreq.c
-  file net/route.c
-  file net/rtsock.c
-! file net/slcompress.c			sl | ppp | strip
-  file net/if_enc.c			inet & ipsec
-  file netccitt/ccitt_proto.c		ccitt
-  file netccitt/hd_debug.c		hdlc
---- 431,437 ----
-  file net/raw_usrreq.c
-  file net/route.c
-  file net/rtsock.c
-! file net/slcompress.c			sl | ppp | strip | i4bipr | i4bisppp
-  file net/if_enc.c			inet & ipsec
-  file netccitt/ccitt_proto.c		ccitt
-  file netccitt/hd_debug.c		hdlc
-END_OF_PATCH
+#  if [ -e files-BACKUP ]
+#  then
+#  	echo "Error: $DST/conf/files-BACKUP already exist, exit!"
+#  	exit 1
+#  fi
+#  mv files files-BACKUP
+#  cp files-BACKUP files
+
+#  echo "patching $DST/conf/files (output in /tmp/files-patch.out) ...."
+
+#  patch << 'END_OF_PATCH' >/tmp/files-patch.out 2>&1
+#  *** files.orig	Sun Jan 30 14:51:03 2000
+#  --- files	Sun Jan 30 14:53:28 2000
+#  ***************
+#  *** 431,437 ****
+#    file net/raw_usrreq.c
+#    file net/route.c
+#    file net/rtsock.c
+#  ! file net/slcompress.c			sl | ppp | strip
+#    file net/if_enc.c			inet & ipsec
+#    file netccitt/ccitt_proto.c		ccitt
+#    file netccitt/hd_debug.c		hdlc
+#  --- 431,437 ----
+#    file net/raw_usrreq.c
+#    file net/route.c
+#    file net/rtsock.c
+#  ! file net/slcompress.c			sl | ppp | strip | i4bipr | i4bisppp
+#    file net/if_enc.c			inet & ipsec
+#    file netccitt/ccitt_proto.c		ccitt
+#    file netccitt/hd_debug.c		hdlc
+#  END_OF_PATCH
 
 # ---------------------------------------------------------------------------- 
 # machine (architecture) specific patches follow...
diff -ur 0.96.orig/OpenBSD/sys-patch.i386 0.96/OpenBSD/sys-patch.i386
--- 0.96.orig/OpenBSD/sys-patch.i386	Mon Jan 31 15:34:26 2000
+++ 0.96/OpenBSD/sys-patch.i386	Tue Dec 12 14:07:05 2000
@@ -82,8 +82,8 @@
 + /* open, close, read, write */
 + #define	cdev_i4btel_init(c,n) { \
 + 	dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
-+ 	dev_init(c,n,write), (dev_type_ioctl((*))) enodev, (dev_type_stop((*))) enodev, \
-+ 	0, (dev_type_select((*))) enodev, (dev_type_mmap((*))) enodev, D_TTY }
++ 	dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
++ 	0, dev_init(c,n,select), (dev_type_mmap((*))) enodev, D_TTY }
 + 
 + /* open, close, read, ioctl */
 + #define cdev_i4btrc_init(c,n) { \
diff -ur 0.96.orig/layer1/i4b_avm_fritz_pci.c 0.96/layer1/i4b_avm_fritz_pci.c
--- 0.96.orig/layer1/i4b_avm_fritz_pci.c	Mon Aug 28 09:24:58 2000
+++ 0.96/layer1/i4b_avm_fritz_pci.c	Tue Dec 12 14:16:34 2000
@@ -1366,7 +1366,12 @@
 		return;
 	}
 	intrstr = pci_intr_string(pc, ih);
+#ifdef __OpenBSD__
+	psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, avma1pp_intr, 
+					sc, sc->sc_dev.dv_xname);
+#else
 	psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, avma1pp_intr, sc);
+#endif
 	if (psc->sc_ih == NULL) {
 		printf("%s: couldn't establish interrupt",
 		    sc->sc_dev.dv_xname);
diff -ur 0.96.orig/layer1/pci_isic.c 0.96/layer1/pci_isic.c
--- 0.96.orig/layer1/pci_isic.c	Thu Aug 24 13:48:57 2000
+++ 0.96/layer1/pci_isic.c	Tue Dec 12 14:31:55 2000
@@ -81,7 +81,11 @@
 #include <i4b/include/i4b_global.h>
 #include <i4b/include/i4b_l1l2.h>
 
+#ifdef __OpenBSD__
+static int pci_isic_match __P((struct device *, void *, void *));
+#else
 static int pci_isic_match __P((struct device *, struct cfdata *, void *));
+#endif
 static void pci_isic_attach __P((struct device *, struct device *, void *));
 static const struct isic_pci_product * find_matching_card __P((struct pci_attach_args *pa));
 
@@ -148,7 +152,11 @@
 static int
 pci_isic_match(parent, match, aux)
 	struct device *parent;
+#ifdef __OpenBSD__
+	void *match;
+#else
 	struct cfdata *match;
+#endif
 	void *aux;
 {
 	struct pci_attach_args *pa = aux;
@@ -334,7 +342,11 @@
 		return;
 	}
 	intrstr = pci_intr_string(pc, ih);
+#ifdef __OpenBSD__
+	psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, isicintr, sc, sc->sc_dev.dv_xname);
+#else
 	psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, isicintr, sc);
+#endif
 	if (psc->sc_ih == NULL) {
 		printf("%s: couldn't establish interrupt",
 		    sc->sc_dev.dv_xname);

Visit your host, monkey.org