home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / bsd / 11855 < prev    next >
Encoding:
Text File  |  1993-01-27  |  2.5 KB  |  74 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: 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
  3. From: dmuntz@quip.eecs.umich.edu (Dan Muntz)
  4. Subject: [386BSD] RT 4-port patch for cgd's com.c
  5. Message-ID: <1993Jan26.164718.4632@zip.eecs.umich.edu>
  6. Sender: news@zip.eecs.umich.edu (Mr. News)
  7. Organization: University of Michigan EECS Dept., Ann Arbor, MI
  8. Date: Tue, 26 Jan 1993 16:47:18 GMT
  9. Lines: 63
  10.  
  11.  
  12. Here is the patch to apply to the latest com.c from cgd to add support
  13. for the RT 4-port serial card.  This patch fixes a small bug in the
  14. previous one which isn't evident when the 4-port card is used in conjunction
  15. with a standard pc serial card.  When the 4-port card is the only card
  16. in the system, it must be configured as ports 0-3.  This may also apply
  17. to standard serial cards, but I haven't tested this (i.e., it seems necessary
  18. to have an actual device at com00 (maj. 8 min. 0) for higher ports to work).
  19. My kernel configuration for the RT card looks like this:
  20.  
  21. device          com0    at isa? port 0x1230 tty irq 10 vector comintr
  22. device          com1    at isa? port 0x1238 tty irq 10 vector comintr
  23. device          com2    at isa? port 0x1240 tty irq 10 vector comintr
  24. device          com3    at isa? port 0x1248 tty irq 10 vector comintr
  25.  
  26.   -Dan
  27.    dmuntz@eecs.umich.edu
  28.  
  29. *** /usr/sys/i386/isa/com.c.cgd    Tue Jan 26 11:31:15 1993
  30. --- /usr/sys/i386/isa/com.c    Tue Jan 26 11:32:44 1993
  31. ***************
  32. *** 163,168 ****
  33. --- 163,185 ----
  34.   int comprobe(dev)
  35.   struct isa_device *dev;
  36.   {
  37. +     /* reset interrupts if we're an RT card (only once per card) */
  38. +     if ((dev->id_iobase >= 0x1230) && 
  39. +         ((dev->id_iobase & 0x00000fff) == 0x00000230)) {
  40. +         switch (ffs(dev->id_irq)-1) {
  41. +             case  9: outb(0x2f2,0); 
  42. +                  printf("resetting irq 9\n"); 
  43. +                  break;
  44. +             case 10: outb(0x6f2,0);
  45. +                  printf("resetting irq 10\n");
  46. +                  break;
  47. +             case 11: outb(0x6f3,0);
  48. +                  printf("resetting irq 11\n");
  49. +                  break;
  50. +             default: printf("irq unsupported by RT card\n");
  51. +         }
  52. +     }
  53.       /* force access to id reg */
  54.       outb(dev->id_iobase+com_cfcr, 0);
  55.       outb(dev->id_iobase+com_iir, 0);
  56. ***************
  57. *** 575,580 ****
  58. --- 592,605 ----
  59.       register int i,j;
  60.       register u_char code;
  61.       register char possiblymoreirqs;
  62. +     /* reset interrupt 9,10,11 if that's the origin of this one */
  63. +     switch (ffs(com_irq[unit])-1) {
  64. +         case  9: outb(0x2f2,0); break;
  65. +         case 10: outb(0x6f2,0); break;
  66. +         case 11: outb(0x6f3,0); break;
  67. +         default: ;
  68. +     }
  69.   
  70.   /* printf ("%d\n",unit); XXX */
  71.       do {
  72.