*BSD News Article 10384


Return to BSD News archive

Received: by minnie.vk1xwt.ampr.org with NNTP
	id AA30 ; Wed, 27 Jan 93 13:11:15 EST
Newsgroups: comp.unix.bsd
Path: sserve!manuel.anu.edu.au!munnari.oz.au!spool.mu.edu!caen!umeecs!quip.eecs.umich.edu!dmuntz
From: dmuntz@quip.eecs.umich.edu (Dan Muntz)
Subject: [386BSD] RT 4-port patch for cgd's com.c
Message-ID: <1993Jan26.164718.4632@zip.eecs.umich.edu>
Sender: news@zip.eecs.umich.edu (Mr. News)
Organization: University of Michigan EECS Dept., Ann Arbor, MI
Date: Tue, 26 Jan 1993 16:47:18 GMT
Lines: 63


Here is the patch to apply to the latest com.c from cgd to add support
for the RT 4-port serial card.  This patch fixes a small bug in the
previous one which isn't evident when the 4-port card is used in conjunction
with a standard pc serial card.  When the 4-port card is the only card
in the system, it must be configured as ports 0-3.  This may also apply
to standard serial cards, but I haven't tested this (i.e., it seems necessary
to have an actual device at com00 (maj. 8 min. 0) for higher ports to work).
My kernel configuration for the RT card looks like this:

device          com0    at isa? port 0x1230 tty irq 10 vector comintr
device          com1    at isa? port 0x1238 tty irq 10 vector comintr
device          com2    at isa? port 0x1240 tty irq 10 vector comintr
device          com3    at isa? port 0x1248 tty irq 10 vector comintr

  -Dan
   dmuntz@eecs.umich.edu

*** /usr/sys/i386/isa/com.c.cgd	Tue Jan 26 11:31:15 1993
--- /usr/sys/i386/isa/com.c	Tue Jan 26 11:32:44 1993
***************
*** 163,168 ****
--- 163,185 ----
  int comprobe(dev)
  struct isa_device *dev;
  {
+ 	/* reset interrupts if we're an RT card (only once per card) */
+ 	if ((dev->id_iobase >= 0x1230) && 
+ 		((dev->id_iobase & 0x00000fff) == 0x00000230)) {
+ 		switch (ffs(dev->id_irq)-1) {
+ 			case  9: outb(0x2f2,0); 
+ 				 printf("resetting irq 9\n"); 
+ 				 break;
+ 			case 10: outb(0x6f2,0);
+ 				 printf("resetting irq 10\n");
+ 				 break;
+ 			case 11: outb(0x6f3,0);
+ 				 printf("resetting irq 11\n");
+ 				 break;
+ 			default: printf("irq unsupported by RT card\n");
+ 		}
+ 	}
+ 
  	/* force access to id reg */
  	outb(dev->id_iobase+com_cfcr, 0);
  	outb(dev->id_iobase+com_iir, 0);
***************
*** 575,580 ****
--- 592,605 ----
  	register int i,j;
  	register u_char code;
  	register char possiblymoreirqs;
+ 
+ 	/* reset interrupt 9,10,11 if that's the origin of this one */
+ 	switch (ffs(com_irq[unit])-1) {
+ 		case  9: outb(0x2f2,0); break;
+ 		case 10: outb(0x6f2,0); break;
+ 		case 11: outb(0x6f3,0); break;
+ 		default: ;
+ 	}
  
  /* printf ("%d\n",unit); XXX */
  	do {