diff -c -r i4b.orig/Makefile i4b/Makefile
*** i4b.orig/Makefile	Tue May  4 04:41:05 1999
--- i4b/Makefile	Thu Jun  8 08:54:56 2000
***************
*** 19,24 ****
--- 19,28 ----
  SUBDIR      = isdntrace isdndebug isdnd g711conv man isdntest \
  		lib-isdn misc isdntelctl isdnmonitor \
  		isdndecode dtmfdecode
+ .elif (${BSDTYPE} == "OpenBSD")
+ SUBDIR      = isdntrace isdndebug isdnd g711conv man isdntest \
+ 		lib-isdn misc isdntelctl isdnmonitor \
+ 		isdndecode dtmfdecode
  .else
  SUBDIR      = isdntrace isdndebug isdnd g711conv man isdntest \
  		sppp lib-isdn misc isdntelctl isdnmonitor \
diff -c -r i4b.orig/OpenBSD/INSTALLATION i4b/OpenBSD/INSTALLATION
*** i4b.orig/OpenBSD/INSTALLATION	Mon Nov 29 13:13:32 1999
--- i4b/OpenBSD/INSTALLATION	Thu Jul 20 00:30:14 2000
***************
*** 1,9 ****
  --------------------------------------------------------------------------------
  
!                   ISDN4BSD 0.83 installation on OpenBSD 2.5
                    =========================================
  
!                   last edit-date: [Mon Nov 29 12:34:03 1999]
  
  --------------------------------------------------------------------------------
  
--- 1,9 ----
  --------------------------------------------------------------------------------
  
!                   ISDN4BSD 0.83 installation on OpenBSD 2.8
                    =========================================
  
!                   last edit-date: [Wed Jul 20 12:34:03 2000]
  
  --------------------------------------------------------------------------------
  
***************
*** 56,61 ****
--- 56,71 ----
  # isic0 at isapnp?
  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 ?
+ 
  #---------------------------------------------------------------------
  # Active EICON/Diehl Cards: S, SX, SXn, SCOM or QUADRO
  # daic0 at isa? iomem 0xd8000 irq 10
***************
*** 72,80 ****
  # 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
  #---------------------------------------------------------------------
  
  
--- 82,87 ----
***************
*** 94,98 ****
  8) read the isdnd and the isdnd.rc manual pages and have a look at the
     SAMPLE (!!!) setup to be found in etc-isdn directory.
  
- 
  9) setup a customized /etc/isdn/isdnd.rc file and have fun .... 
--- 101,106 ----
  8) read the isdnd and the isdnd.rc manual pages and have a look at the
     SAMPLE (!!!) setup to be found in etc-isdn directory.
  
  9) setup a customized /etc/isdn/isdnd.rc file and have fun .... 
+ 
+ 10) compile and setup userlevel ppp
diff -c -r i4b.orig/OpenBSD/MAKEDEV.i4b i4b/OpenBSD/MAKEDEV.i4b
*** i4b.orig/OpenBSD/MAKEDEV.i4b	Mon Jul 19 08:58:19 1999
--- i4b/OpenBSD/MAKEDEV.i4b	Thu Jun  8 10:58:15 2000
***************
*** 14,31 ****
  OS_VERSION=`uname -r`
  OSRELEASE=`sysctl -n kern.osrelease`
  
! # for OpenBSD 2.5
! i4b_major=55
! i4bctl_major=56
! i4brbch_major=57
! i4btrc_major=58
! i4btel_major=59
  
  if [ "$ARCH" = "i386" -a "$OS" = "OpenBSD" ]
  then
! 	if [ "$OSRELEASE" != "2.5" ]
  	then
! 		echo "$OS != 2.5 not supported!"
  		exit 1
  	fi
  else
--- 14,31 ----
  OS_VERSION=`uname -r`
  OSRELEASE=`sysctl -n kern.osrelease`
  
! # for OpenBSD 2.8
! i4b_major=56
! i4bctl_major=57
! i4brbch_major=58
! i4btrc_major=59
! i4btel_major=60
  
  if [ "$ARCH" = "i386" -a "$OS" = "OpenBSD" ]
  then
! 	if [ "$OSRELEASE" != "2.8" ]
  	then
! 		echo "$OS != 2.8 not supported!"
  		exit 1
  	fi
  else
diff -c -r i4b.orig/OpenBSD/deinstall-openbsd.sh i4b/OpenBSD/deinstall-openbsd.sh
*** i4b.orig/OpenBSD/deinstall-openbsd.sh	Mon Jul 19 08:58:19 1999
--- i4b/OpenBSD/deinstall-openbsd.sh	Thu Jun  8 07:48:16 2000
***************
*** 15,23 ****
  
  if [ "$OS" = "OpenBSD" ]
  then
! 	if [ "$OSRELEASE" != "2.5" ]
  	then
! 		echo "This script is just for $OS 2.5, exit!"
  		exit 1
  	fi
  else
--- 15,23 ----
  
  if [ "$OS" = "OpenBSD" ]
  then
! 	if [ "$OSRELEASE" != "2.8" ]
  	then
! 		echo "This script is just for $OS 2.8, exit!"
  		exit 1
  	fi
  else
diff -c -r i4b.orig/OpenBSD/files.i4b i4b/OpenBSD/files.i4b
*** i4b.orig/OpenBSD/files.i4b	Mon Jul 19 08:58:19 1999
--- i4b/OpenBSD/files.i4b	Thu Jun 29 07:11:00 2000
***************
*** 15,31 ****
  
  define isdn		# the ISDN subsystem
  define passive_isdn	# files needed by passive cards
! define sppp		# synchronous PPP support
  
  pseudo-device i4btrc:		isdn
  pseudo-device i4brbch:		isdn
  pseudo-device i4btel:		isdn
  pseudo-device i4bipr: 		isdn
! pseudo-device i4bisppp:		isdn, sppp
  pseudo-device i4bctl:		isdn
  pseudo-device i4b:		isdn
  
! file i4b/sppp/if_spppsubr.c 		sppp
  
  file i4b/driver/i4b_ctl.c		i4bctl		needs-flag
  file i4b/driver/i4b_isppp.c 		i4bisppp	needs-count
--- 15,31 ----
  
  define isdn		# the ISDN subsystem
  define passive_isdn	# files needed by passive cards
! define isppp		# synchronous PPP support
  
  pseudo-device i4btrc:		isdn
  pseudo-device i4brbch:		isdn
  pseudo-device i4btel:		isdn
  pseudo-device i4bipr: 		isdn
! pseudo-device i4bisppp:		isdn, isppp
  pseudo-device i4bctl:		isdn
  pseudo-device i4b:		isdn
  
! file i4b/sppp/if_spppsubr.c 		isppp
  
  file i4b/driver/i4b_ctl.c		i4bctl		needs-flag
  file i4b/driver/i4b_isppp.c 		i4bisppp	needs-count
***************
*** 85,93 ****
--- 85,101 ----
  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 -c -r i4b.orig/OpenBSD/install-openbsd.sh i4b/OpenBSD/install-openbsd.sh
*** i4b.orig/OpenBSD/install-openbsd.sh	Mon Jul 19 08:58:19 1999
--- i4b/OpenBSD/install-openbsd.sh	Thu Jul 20 00:31:00 2000
***************
*** 15,23 ****
  
  if [ "$OS" = "OpenBSD" ]
  then
! 	if [ "$OSRELEASE" != "2.5" ]
  	then
! 		echo "This script is just for $OS 2.5, exit!"
  		exit 1
  	fi
  else
--- 15,23 ----
  
  if [ "$OS" = "OpenBSD" ]
  then
! 	if [ "$OSRELEASE" != "2.8" ]
  	then
! 		echo "This script is just for $OS 2.8, exit!"
  		exit 1
  	fi
  else
***************
*** 68,73 ****
--- 68,74 ----
  ( 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 )
  
  # ---------------------------------------------------------------------------- 
***************
*** 81,112 ****
  	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-DIST25	Thu Apr  8 16:47:42 1999
- --- files	Mon Jul 19 11:05:51 1999
- ***************
- *** 399,405 ****
-   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
- --- 399,405 ----
-   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...
--- 82,87 ----
diff -c -r i4b.orig/OpenBSD/sys-patch.i386 i4b/OpenBSD/sys-patch.i386
*** i4b.orig/OpenBSD/sys-patch.i386	Mon Jul 19 08:58:19 1999
--- i4b/OpenBSD/sys-patch.i386	Fri Jun 16 09:00:07 2000
***************
*** 54,68 ****
  mv conf.c conf.c-BACKUP
  cp conf.c-BACKUP conf.c
  
! echo "patching $DST/arch/i386/i386/conf.c (see /tmp/patch-cons.c.out) ...."
  
! patch << 'END_OF_PATCH' >/tmp/patch-cons.c.out 2>&1
! *** conf.c-DIST25	Thu Mar 25 00:03:08 1999
! --- conf.c	Sat Jul 17 05:06:16 1999
  ***************
! *** 132,137 ****
! --- 132,172 ----
!           dev_init(c,n,mmap) }
    
    
  + /*********** ISDN4BSD ADDON ***********/
--- 54,68 ----
  mv conf.c conf.c-BACKUP
  cp conf.c-BACKUP conf.c
  
! echo "patching $DST/arch/i386/i386/conf.c (see /tmp/patch-conf.c.out) ...."
  
! patch << 'END_OF_PATCH' >/tmp/patch-conf.c.out 2>&1
! *** conf.c.orig	Fri Jun  9 10:54:49 2000
! --- conf.c	Fri Jun  9 10:56:12 2000
  ***************
! *** 136,141 ****
! --- 136,176 ----
!   	(dev_type_stop((*))) enodev, 0, seltrue, (dev_type_mmap((*))) enodev }
    
    
  + /*********** ISDN4BSD ADDON ***********/
***************
*** 76,83 ****
  + /* open, close, read, write */
  + #define	cdev_i4brbch_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 }
  + 
  + /* open, close, read, write */
  + #define	cdev_i4btel_init(c,n) { \
--- 76,83 ----
  + /* open, close, read, write */
  + #define	cdev_i4brbch_init(c,n) { \
  + 	dev_init(c,n,open), dev_init(c,n,close), dev_init(c,n,read), \
! + 	dev_init(c,n,write), dev_init(c,n,ioctl), (dev_type_stop((*))) enodev, \
! + 	0, dev_init(c,n,select), (dev_type_mmap((*))) enodev }
  + 
  + /* open, close, read, write */
  + #define	cdev_i4btel_init(c,n) { \
***************
*** 104,111 ****
    #define	mmwrite	mmrw
    cdev_decl(mm);
  ***************
! *** 204,209 ****
! --- 239,254 ----
    #error vt and pc are mutually exclusive.  Sorry.
    #endif
    
--- 104,111 ----
    #define	mmwrite	mmrw
    cdev_decl(mm);
  ***************
! *** 219,224 ****
! --- 254,269 ----
    #error vt and pc are mutually exclusive.  Sorry.
    #endif
    
***************
*** 123,149 ****
    struct cdevsw	cdevsw[] =
    {
  ***************
! *** 278,283 ****
! --- 323,339 ----
!   	cdev_midi_init(NMIDI,midi),	/* 52: MIDI I/O */
    	cdev_midi_init(NSEQUENCER,sequencer),	/* 53: sequencer I/O */
    	cdev_disk_init(NRAID,raid),	/* 54: RAIDframe disk driver */
! + 
! + /* i4b character devices */
! + 
! + 	cdev_i4b_init(NI4B, i4b),		/* 55: i4b main device */
! + 	cdev_i4bctl_init(NI4BCTL, i4bctl),	/* 56: i4b control device */
! + 	cdev_i4brbch_init(NI4BRBCH, i4brbch),	/* 57: i4b raw b-channel access */
! + 	cdev_i4btrc_init(NI4BTRC, i4btrc),	/* 58: i4b trace device */
! + 	cdev_i4btel_init(NI4BTEL, i4btel),	/* 59: i4b phone device */
! + 
! + /* end i4b character devices */
! + 
!   };
!   int	nchrdev = sizeof(cdevsw) / sizeof(cdevsw[0]);
!   
  END_OF_PATCH
! 
  echo "leave script sys-patch.i386"
! 
  exit 0
--- 123,157 ----
    struct cdevsw	cdevsw[] =
    {
  ***************
! *** 294,306 ****
    	cdev_midi_init(NSEQUENCER,sequencer),	/* 53: sequencer I/O */
    	cdev_disk_init(NRAID,raid),	/* 54: RAIDframe disk driver */
!   	cdev_wdt_init(NWDT,wdt),	/* 55: WDT50x watchdog timer */
! ! 	/* The following slots are reserved for isdn4bsd. */
! ! 	cdev_notdef(),			/* 56: i4b main device */
! ! 	cdev_notdef(),			/* 57: i4b control device */
! ! 	cdev_notdef(),			/* 58: i4b raw b-channel access */
! ! 	cdev_notdef(),			/* 59: i4b trace device */
! ! 	cdev_notdef(),			/* 60: i4b phone device */
! ! 	/* End of reserved slots for isdn4bsd. */
!   	cdev_usb_init(NUSB,usb),	/* 61: USB controller */
!   	cdev_usbdev_init(NUHID,uhid),	/* 62: USB generic HID */
!   	cdev_ugen_init(NUGEN,ugen),	/* 63: USB generic driver */
! --- 339,349 ----
!   	cdev_midi_init(NSEQUENCER,sequencer),	/* 53: sequencer I/O */
!   	cdev_disk_init(NRAID,raid),	/* 54: RAIDframe disk driver */
!   	cdev_wdt_init(NWDT,wdt),	/* 55: WDT50x watchdog timer */
! ! 	cdev_i4b_init(NI4B, i4b),               /* 56: i4b main device */
! ! 	cdev_i4bctl_init(NI4BCTL, i4bctl),      /* 57: i4b control device */
! ! 	cdev_i4brbch_init(NI4BRBCH, i4brbch),   /* 58: i4b raw b-channel access */
! ! 	cdev_i4btrc_init(NI4BTRC, i4btrc),      /* 59: i4b trace device */
! ! 	cdev_i4btel_init(NI4BTEL, i4btel),      /* 60: i4b phone device */
!   	cdev_usb_init(NUSB,usb),	/* 61: USB controller */
!   	cdev_usbdev_init(NUHID,uhid),	/* 62: USB generic HID */
!   	cdev_ugen_init(NUGEN,ugen),	/* 63: USB generic driver */
  END_OF_PATCH
!  
  echo "leave script sys-patch.i386"
!   
  exit 0
+ 
Only in i4b/dtmfdecode: dtmfdecode.cat1
Only in i4b/g711conv: g711conv.cat1
Only in i4b/isdnd: isdnd.acct.cat5
Only in i4b/isdnd: isdnd.cat8
Only in i4b/isdnd: isdnd.rates.cat5
Only in i4b/isdnd: isdnd.rc.cat5
Only in i4b/isdndebug: isdndebug.cat8
Only in i4b/isdndecode: isdndecode.cat8
Only in i4b/isdnmonitor: isdnmonitor.cat8
Only in i4b/isdntelctl: isdntelctl.cat8
Only in i4b/isdntest: isdntest.cat8
Only in i4b/isdntrace: isdntrace.cat8
Only in i4b: isdntrace0
diff -c -r i4b.orig/layer1/i4b_avm_fritz_pci.c i4b/layer1/i4b_avm_fritz_pci.c
*** i4b.orig/layer1/i4b_avm_fritz_pci.c	Tue Dec  7 04:58:56 1999
--- i4b/layer1/i4b_avm_fritz_pci.c	Thu Jun 29 08:37:27 2000
***************
*** 1335,1341 ****
--- 1335,1346 ----
  		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 -c -r i4b.orig/layer1/pci_isic.c i4b/layer1/pci_isic.c
*** i4b.orig/layer1/pci_isic.c	Sat Nov 27 14:15:59 1999
--- i4b/layer1/pci_isic.c	Thu Jul 20 00:41:37 2000
***************
*** 77,91 ****
  #include <i4b/include/i4b_global.h>
  #include <i4b/include/i4b_l1l2.h>
  
! static int pci_isic_match __P((struct device *, struct cfdata *, void *));
  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));
  
  static void isic_pciattach __P((struct pci_l1_softc *psc, struct pci_attach_args *pa));
  
  struct cfattach pci_isic_ca = {
  	sizeof(struct pci_l1_softc), pci_isic_match, pci_isic_attach
  };
  
  
  static const struct isic_pci_product {
--- 77,105 ----
  #include <i4b/include/i4b_global.h>
  #include <i4b/include/i4b_l1l2.h>
  
! #ifdef __OpenBSD__
! static int pci_isic_match __P((struct device *, void *, void *));
  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));
  
+ #ifdef ELSA_QS1PCI
  static void isic_pciattach __P((struct pci_l1_softc *psc, struct pci_attach_args *pa));
+ #endif
  
  struct cfattach pci_isic_ca = {
  	sizeof(struct pci_l1_softc), pci_isic_match, pci_isic_attach
  };
+ #else
+ static int pci_isic_match __P((struct device *, struct cfdata *, void *));
+ 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));
+ 
+ static void isic_pciattach __P((struct pci_l1_softc *psc, struct pci_attach_args *pa));
+ 
+ struct cfattach pci_isic_ca = {
+         sizeof(struct pci_l1_softc), pci_isic_match, pci_isic_attach
+ };
+ #endif
  
  
  static const struct isic_pci_product {
***************
*** 144,150 ****
--- 158,168 ----
  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;
***************
*** 182,187 ****
--- 200,207 ----
  	if (prod->pciattach) prod->pciattach(psc, pa);
  }
  
+ #ifdef __OpenBSD__
+ #ifdef ELSA_QS1PCI
  /*---------------------------------------------------------------------------*
   *	isic - pci device driver attach routine
   *---------------------------------------------------------------------------*/
***************
*** 325,331 ****
  		return;
  	}
  	intrstr = pci_intr_string(pc, ih);
! 	psc->sc_ih = pci_intr_establish(pc, ih, IPL_NET, isicintr, sc);
  	if (psc->sc_ih == NULL) {
  		printf("%s: couldn't establish interrupt",
  		    sc->sc_dev.dv_xname);
--- 345,356 ----
  		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);
***************
*** 336,339 ****
--- 361,366 ----
  	}
  	printf("%s: interrupting at %s\n", sc->sc_dev.dv_xname, intrstr);
  }
+ #endif
+ #endif
  
Only in i4b/layer1: pci_isic.c.orig
