Re: Need testers for aha driver change

1999-09-05 Thread Adam Wight

 aha0 at port 0x130-0x133,0x130-0x133 irq 10 drq 6 on isa0
   ^^^
This looks a bit wierd.

I get the same thing without your patch--I believe it showed up some time
between July 5th and 9th:

aha0 at port 0x330-0x333,0x330-0x333 irq 11 drq 5 on isa0
aha0: AHA-142C FW Rev. B.0 (ID=44) SCSI Host Adapter, SCSI ID 7, 16 CCBs

-adam




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Need testers for aha driver change

1999-09-04 Thread Doug Rabson

On Fri, 3 Sep 1999, Chris D. Faulhaber wrote:

 Doug Rabson wrote:
 
  I have just taken a pass through the aha_isa driver to convert it to
  newbus and to make it use the new pnp system. Unfortunately I don't own
  the hardware so I need testers, preferably with both non-pnp and pnp
  cards. The code does compile but I have not tested it at all. Here is
  the patch:
 
 Seems to work here.  I have a: (set up to be non-PnP)
 
 aha0 at port 0x130-0x133,0x130-0x133 irq 10 drq 6 on isa0
   ^^^
This looks a bit wierd.

I'll try to figure out what could cause that but in the mean time, could I
possibly get you to test with PnP enabled. If you could also send me the
output from pnpinfo when you have it enabled, that would be much
appreciated, thanks.

--
Doug Rabson Mail:  [EMAIL PROTECTED]
Nonlinear Systems Ltd.  Phone: +44 181 442 9037




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Need testers for aha driver change

1999-09-04 Thread Warner Losh

In message [EMAIL PROTECTED] Doug Rabson 
writes:
: I have just taken a pass through the aha_isa driver to convert it to
: newbus and to make it use the new pnp system. Unfortunately I don't own
: the hardware so I need testers, preferably both with non-pnp and pnp
: cards. The code does compile but I have not tested it at all. Here is the
: patch:

I'll give it a spin on my 1542{B,C,CF and CP} cards.  This patch looks
much better than the conversion I started a while ago...

Warner


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Need testers for aha driver change

1999-09-04 Thread Warner Losh

In message [EMAIL PROTECTED] Doug Rabson 
writes:
: + aha = aha_alloc(device_get_unit(dev),
: + I386_BUS_SPACE_IO, ioport);

Shouldn't we be getting the bus_space_tag and bus_space_handle from
the port_res resource?

Warner


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: Need testers for aha driver change

1999-09-04 Thread Doug Rabson

On Sat, 4 Sep 1999, Warner Losh wrote:

 In message [EMAIL PROTECTED] Doug 
Rabson writes:
 : +   aha = aha_alloc(device_get_unit(dev),
 : +   I386_BUS_SPACE_IO, ioport);
 
 Shouldn't we be getting the bus_space_tag and bus_space_handle from
 the port_res resource?

Yes we should. I just forgot to change that bit.

--
Doug Rabson Mail:  [EMAIL PROTECTED]
Nonlinear Systems Ltd.  Phone: +44 181 442 9037




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Need testers for aha driver change

1999-09-03 Thread Doug Rabson

I have just taken a pass through the aha_isa driver to convert it to
newbus and to make it use the new pnp system. Unfortunately I don't own
the hardware so I need testers, preferably both with non-pnp and pnp
cards. The code does compile but I have not tested it at all. Here is the
patch:

Index: aha_isa.c
===
RCS file: /home/ncvs/src/sys/i386/isa/aha_isa.c,v
retrieving revision 1.11
diff -u -r1.11 aha_isa.c
--- aha_isa.c   1999/09/02 04:37:07 1.11
+++ aha_isa.c   1999/09/03 20:47:55
@@ -31,34 +31,28 @@
  * $FreeBSD: src/sys/i386/isa/aha_isa.c,v 1.11 1999/09/02 04:37:07 peter Exp $
  */
 
-/* #include "pnp.h" */
-#define NPNP 0
-
 #include sys/param.h
 #include sys/systm.h
 #include sys/kernel.h
 
 #include machine/bus_pio.h
 #include machine/bus.h
+#include machine/resource.h
+#include sys/module.h
+#include sys/bus.h
+#include sys/rman.h
+
+#include isa/isareg.h
+#include isa/isavar.h
 
-#include i386/isa/isa_device.h
 #include dev/aha/ahareg.h
 
 #include cam/scsi/scsi_all.h
-
-#if NPNP  0
-#include i386/isa/pnp.h
-#endif
-
-static int aha_isa_probe(struct isa_device *dev);
-static int aha_isa_attach(struct isa_device *dev);
-static void aha_isa_intr(void *unit);
 
-struct isa_driver ahadriver =
-{
-aha_isa_probe,
-aha_isa_attach,
-"aha"
+static struct isa_pnp_id aha_ids[] = {
+   {AHA1542_PNP,   NULL},  /* ADP1542 */
+   {AHA1542_PNPCOMPAT, NULL},  /* PNP00A0 */
+   {0}
 };
 
 /*
@@ -68,26 +62,41 @@
  * autoconf.c
  */
 static int
-aha_isa_probe(dev)
-   struct isa_device *dev;
+aha_isa_probe(device_t dev)
 {
/*
 * find unit and check we have that many defined
 */
+   struct  aha_softc **sc = device_get_softc(dev);
struct  aha_softc *aha;
int port_index;
int max_port_index;
+   int error;
+   u_long  port_start, port_count;
+   struct resource *port_res;
+   int port_rid;
+   int drq;
 
aha = NULL;
 
+   /* Check isapnp ids */
+   if (ISA_PNP_PROBE(device_get_parent(dev), dev, aha_ids) == ENXIO)
+   return (ENXIO);
+
+   error = ISA_GET_RESOURCE(device_get_parent(dev), dev,
+SYS_RES_IOPORT, 0,
+port_start, port_count);
+   if (error != 0)
+   port_start = 0;
+
/*
 * Bound our board search if the user has
 * specified an exact port.
 */
-   aha_find_probe_range(dev-id_iobase, port_index, max_port_index);
+   aha_find_probe_range(port_start, port_index, max_port_index);
 
if (port_index  0)
-   return 0;
+   return ENXIO;
 
/* Attempt to find an adapter */
for (;port_index = max_port_index; port_index++) {
@@ -103,12 +112,21 @@
 */
if (aha_check_probed_iop(ioport) != 0)
continue;
-   dev-id_iobase = ioport;
-   if (haveseen_iobase(dev, AHA_NREGS))
+   error = ISA_SET_RESOURCE(device_get_parent(dev), dev,
+SYS_RES_IOPORT, 0,
+ioport, AHA_NREGS);
+   if (error)
+   return error;
+   
+   port_rid = 0;
+   port_res = bus_alloc_resource(dev, SYS_RES_IOPORT, port_rid,
+ 0, ~0, AHA_NREGS, RF_ACTIVE);
+   if (!port_res)
continue;
 
/* Allocate a softc for use during probing */
-   aha = aha_alloc(dev-id_unit, I386_BUS_SPACE_IO, ioport);
+   aha = aha_alloc(device_get_unit(dev),
+   I386_BUS_SPACE_IO, ioport);
 
if (aha == NULL)
break;
@@ -139,44 +157,90 @@
 
switch (config_data.dma_chan) {
case DMA_CHAN_5:
-   dev-id_drq = 5;
+   drq = 5;
break;
case DMA_CHAN_6:
-   dev-id_drq = 6;
+   drq = 6;
break;
case DMA_CHAN_7:
-   dev-id_drq = 7;
+   drq = 7;
break;
default:
printf("aha_isa_probe: Invalid DMA setting "
"detected for adapter at 0x%x.  "
"Failing probe\n", ioport);
-   return (0);
+   return (ENXIO);
}
-   dev-id_irq = (config_data.irq  9);
-   dev-id_intr = aha_isa_intr;
+   error = ISA_SET_RESOURCE(device_get_parent(dev), dev,
+SYS_RES_DRQ, 0, drq, 1);
+   if (error)
+