From nobody  Tue Jan 19 08:03:22 1999
Received: (from nobody@localhost)
          by hub.freebsd.org (8.8.8/8.8.8) id IAA03128;
          Tue, 19 Jan 1999 08:03:22 -0800 (PST)
          (envelope-from nobody)
Message-Id: <199901191603.IAA03128@hub.freebsd.org>
Date: Tue, 19 Jan 1999 08:03:22 -0800 (PST)
From: N/A
To: freebsd-gnats-submit@freebsd.org
Subject: ed(4) irq config enhancement
X-Send-Pr-Version: www-1.0

>Number:         9570
>Category:       kern
>Synopsis:       [ed] [patch] ed(4) irq config enhancement
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dfr
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 19 08:10:01 PST 1999
>Closed-Date:    
>Last-Modified:  Sun Oct 23 21:06:19 GMT 2005
>Originator:     Juha Nurmela
>Release:        3.0-CURRENT
>Organization:
ACME Inc.
>Environment:
FreeBSD pena.oh5nxo.ampr.org
3.0-CURRENT FreeBSD 3.0-CURRENT #8:
Fri Jan 15 20:38:02 EET 1999
junki@pena.oh5nxo.ampr.org:/usr/src/sys/compile/PENA
i386
>Description:
SMC 8013 has 2 jumper configurable i/o addresses, and third "soft" one
which requires proprietary (msdos) software to configure.
Unfortunately there is no msdos here, and never will be (odd HW...).
Two i/o possibilities are still enough to choose from,
and the memory address is set on-the-fly by the driver, very good.
That leaves IRQ as a problem, i cannot use the two default jumpered
irqs.  I suggest that the irq would be reset by the driver like the
memaddr is already done, autoconf time.

If config said irq?, then the driver would use what the card reports,
and if it said irq 11, then the driver would make irq 11 en force.
config flags might be used also, for compatibility.

I don't know how clone-8013 cards behave, when iptr-bits are
changed directly, without the softconfig.exe program.
Real smc works okay. Too bad the iptr-bits don't stick thru reboots.

ed0 at 0x280-0x29f irq 11 maddr 0xd0000 msize 16384 on isa
ed0: address 00:00:c0:af:90:63, type WD8013EPC (16 bit)
>How-To-Repeat:
no problem here, just a suggestion.
>Fix:
/sys/i386/isa/if_ed.c, about line 629

 if ((sc->type & ED_WD_SOFTCONFIG) && (!sc->is790)) {
! here on...

    if (isa_dev->id_irq <= 0) {
      /*
       * If no interrupt specified (or "?"), use what the board tells us.
       * Assemble together the encoded interrupt number.
       */
      iptr = (inb(isa_dev->id_iobase + ED_WD_ICR) & ED_WD_ICR_IR2) |
          ((inb(isa_dev->id_iobase + ED_WD_IRR) &
            (ED_WD_IRR_IR0 | ED_WD_IRR_IR1)) >> 5);

      isa_dev->id_irq = ed_intr_mask[iptr];
    } else {
      /*
       * Interrupt _is_ specified, override.
       */
      for (iptr = 0; ed_intr_mask[iptr] != isa_dev->id_irq; iptr++)

        if (iptr >= sizeof(ed_intr_mask) / sizeof(ed_intr_mask[0])) {
          printf("ed%d: Impossible irq in kernel config\n",
            isa_dev->id_unit);
          return (0);
        }

      /*
       * '51 could do this nicely...
       */
      outb(isa_dev->id_iobase + ED_WD_ICR,
        (iptr & ED_WD_ICR_IR2) ?
          (inb(isa_dev->id_iobase + ED_WD_ICR) |  ED_WD_ICR_IR2) :
          (inb(isa_dev->id_iobase + ED_WD_ICR) & ~ED_WD_ICR_IR2));
      outb(isa_dev->id_iobase + ED_WD_IRR,
        ((iptr << 5) & ED_WD_IRR_IR1) ?
          (inb(isa_dev->id_iobase + ED_WD_IRR) |  ED_WD_IRR_IR1) :
          (inb(isa_dev->id_iobase + ED_WD_IRR) & ~ED_WD_IRR_IR1));
      outb(isa_dev->id_iobase + ED_WD_IRR,
        ((iptr << 5) & ED_WD_IRR_IR0) ?
          (inb(isa_dev->id_iobase + ED_WD_IRR) |  ED_WD_IRR_IR0) :
          (inb(isa_dev->id_iobase + ED_WD_IRR) & ~ED_WD_IRR_IR0));
    }
!...upto here
    /*
     * Enable the interrupt.
     */     
    outb(isa_dev->id_iobase + ED_WD_IRR,
      inb(isa_dev->id_iobase + ED_WD_IRR) | ED_WD_IRR_IEN);
 }

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->dfr 
Responsible-Changed-By: johan 
Responsible-Changed-When: Wed Aug 23 06:44:20 PDT 2000 
Responsible-Changed-Why:  
Over to if_ed maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=9570 
>Unformatted:
