Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Jan 1999 08:03:22 -0800 (PST)
From:      N/A@FreeBSD.ORG
To:        freebsd-gnats-submit@FreeBSD.ORG
Subject:   kern/9570: ed(4) irq config enhancement
Message-ID:  <199901191603.IAA03128@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         9570
>Category:       kern
>Synopsis:       ed(4) irq config enhancement
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>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:
>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:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901191603.IAA03128>