*BSD News Article 28735


Return to BSD News archive

Newsgroups: comp.os.386bsd.development
Path: sserve!newshost.anu.edu.au!munnari.oz.au!mel.dit.csiro.au!its.csiro.au!dmssyd.syd.dms.CSIRO.AU!metro!news.cs.su.oz.au!harbinger.cc.monash.edu.au!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!gatech!swrinde!news.dell.com!obiwan!bob
From: bob@obiwan.uucp (Bob Willcox)
Subject: Re: multi-port serial card support?
References: <1994Mar8.175010.24603@pegasus.com> <CMq4I9.1LG@obiwan.uucp>
Organization: Bob's Place, Austin TX
Date: Mon, 21 Mar 1994 01:57:31 GMT
Message-ID: <CMzs49.KIo@obiwan.uucp>
Lines: 157

I had a couple of requests for these diffs to sio.c to support the
BocaBoard multi-port cards so I thought I might as well go ahead
and post them.

What follows are a set of diffs for 1.0.2 ant then the diffs for
1.1-BETA.  I have successfully applied the 1.1-BETA diffs to my
-current level system as well.  Note that the 1.0.2 diffs have not
been tested.  I synthesized them from the 1.1-BETA version and
parts of the (significantly hacked) sio driver that I am running
on my 1.0.2 system.

Use at your own risk and be sure to have a backup of your kernel
before running with these changes.

*-------------------- FreeBSD 1.0.2 sio.c diff start -----------------------*
*** sio.c	Fri Oct 15 18:46:04 1993
--- /tmp/sio.c	Sun Mar 20 19:26:00 1994
***************
*** 83,88 ****
--- 83,89 ----
   */
  #define COM_ISMULTIPORT(dev) ((dev)->id_flags & 0x01)
  #define COM_MPMASTER(dev)    (((dev)->id_flags >> 8) & 0x0ff)
+ #define COM_NOMASTER(dev)    ((dev)->id_flags & 0x04)
  #endif /* COM_MULTIPORT */
  
  #define	com_scr		7	/* scratch register for 16450-16550 (R/W) */
***************
*** 486,495 ****
  	}
  #ifdef COM_MULTIPORT
  	if (COM_ISMULTIPORT(isdp)) {
! 		struct isa_device *masterdev;
  
! 		com->multiport = TRUE;
! 		printf(" (multiport)");
  
  		/* set the master's common-interrupt-enable reg.,
  		 * as appropriate. YYY See your manual
--- 487,498 ----
  	}
  #ifdef COM_MULTIPORT
  	if (COM_ISMULTIPORT(isdp)) {
! 	    com->multiport = TRUE;
! 	    printf(" (multiport)");
  
! 	    /* Note: some cards have no master port (e.g., BocaBoards) */
! 	    if (!COM_NOMASTER(isdp)) {
! 		struct isa_device *masterdev;
  
  		/* set the master's common-interrupt-enable reg.,
  		 * as appropriate. YYY See your manual
***************
*** 500,505 ****
--- 503,509 ----
  		masterdev = find_isadev(isa_devtab_tty, &siodriver,
  					COM_MPMASTER(isdp));
  		outb(masterdev->id_iobase+com_scr, 0x80);
+ 	    }
  	}
  	else
  		com->multiport = FALSE;
***************
*** 1491,1497 ****
  		/* YYY maybe your card doesn't want IENABLE to be reset? */
  		if(com->multiport)
  			outb(com->modem_ctl_port,
! 			     com->mcr_image = bits);
  		else
  #endif /* COM_MULTIPORT */
  			outb(com->modem_ctl_port,
--- 1495,1501 ----
  		/* YYY maybe your card doesn't want IENABLE to be reset? */
  		if(com->multiport)
  			outb(com->modem_ctl_port,
! 			    com->mcr_image = bits | (com->mcr_image & MCR_IENABLE));
  		else
  #endif /* COM_MULTIPORT */
  			outb(com->modem_ctl_port,
*-------------------- FreeBSD 1.0.2 sio.c diff end   -----------------------*

*------------------- FreeBSD 1.1-BETA sio.c diff start ---------------------*
*** sio.c.orig	Fri Mar 18 17:48:41 1994
--- sio.c	Fri Mar 18 17:48:50 1994
***************
*** 31,37 ****
   * SUCH DAMAGE.
   *
   *	from: @(#)com.c	7.5 (Berkeley) 5/16/91
!  *	$Id: sio.c,v 1.1 1994/03/08 22:42:01 bob Exp $
   */
  
  #include "sio.h"
--- 31,37 ----
   * SUCH DAMAGE.
   *
   *	from: @(#)com.c	7.5 (Berkeley) 5/16/91
!  *	$Id: sio.c,v 1.2 1994/03/08 22:43:34 bob Exp $
   */
  
  #include "sio.h"
***************
*** 82,87 ****
--- 82,88 ----
   */
  #define COM_ISMULTIPORT(dev) ((dev)->id_flags & 0x01)
  #define COM_MPMASTER(dev)    (((dev)->id_flags >> 8) & 0x0ff)
+ #define COM_NOMASTER(dev)    ((dev)->id_flags & 0x04)
  #endif /* COM_MULTIPORT */
  #define COM_NOFIFO(dev) ((dev)->id_flags & 0x02)
  
***************
*** 487,496 ****
  
  #ifdef COM_MULTIPORT
  	if (COM_ISMULTIPORT(isdp)) {
! 		struct isa_device *masterdev;
  
! 		com->multiport = TRUE;
! 		printf(" (multiport)");
  
  		/* set the master's common-interrupt-enable reg.,
  		 * as appropriate. YYY See your manual
--- 488,499 ----
  
  #ifdef COM_MULTIPORT
  	if (COM_ISMULTIPORT(isdp)) {
! 	    com->multiport = TRUE;
! 	    printf(" (multiport)");
  
! 	    /* Note: some cards have no master port (e.g., BocaBoards) */
! 	    if (!COM_NOMASTER(isdp)) {
! 		struct isa_device *masterdev;
  
  		/* set the master's common-interrupt-enable reg.,
  		 * as appropriate. YYY See your manual
***************
*** 501,506 ****
--- 504,511 ----
  		masterdev = find_isadev(isa_devtab_tty, &siodriver,
  					COM_MPMASTER(isdp));
  		outb(masterdev->id_iobase + com_scr, 0x80);
+ 	    }
+ 
  	} else
  		com->multiport = FALSE;
  #endif /* COM_MULTIPORT */
*------------------- FreeBSD 1.1-BETA sio.c diff end   ---------------------*

-- 
Bob Willcox                ...!{rutgers|ames}!cs.utexas.edu!uudell!obiwan!bob
Phone: 512 258-4224 (home)
       512 838-3914 (work)
-- 
Bob Willcox                ...!{rutgers|ames}!cs.utexas.edu!uudell!obiwan!bob
Phone: 512 258-4224 (home)
       512 838-3914 (work)