🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.bsd
Article #5686

[386BSD] RT 4-port patch for cgd's com.c

#5686
From: Dan Muntz
Date: Tue, 26 Jan 1993 16:47
63 lines
2666 bytes
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 {
Technical Details
Message-ID: <1993Jan26.164718.4632@zip.eecs.umich.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!zaphod.mps.ohio-state.edu!howland.reston.ans.net!spool.mu.edu!caen!umeecs!quip.eecs.umich.edu!dmuntz

Show Full Headers
Complete Article Headers
Newsgroups: comp.unix.bsd
Path: arc1-ca.pugleaf.net!sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!zaphod.mps.ohio-state.edu!howland.reston.ans.net!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