Hi guys,

It works nicer now... the IDENTIFY code will now happily tell FreeBSD the
device is at 0x378, IRQ 7. The code I used for this is:

static void
dl_identify (driver_t* driver,device_t parent) {
    device_t t;

    printf ("DL: IDENTIFY\n");
    t = BUS_ADD_CHILD (parent, 0, "dl", 0);
    bus_set_resource (t, SYS_RES_IOPORT, 0, 0x378, 3);
    bus_set_resource (t, SYS_RES_IRQ, 0, 7, 1);
}

static int
dl_probe (device_t dev) {
    struct dl_softc* sc = device_get_softc (dev);
     int rid = 0;

    sc->ioaddr = bus_get_resource_start (dev, SYS_RES_IOPORT, 0);

    sc->iobase = bus_alloc_resource (dev, SYS_RES_IOPORT, &rid, 0ul, ~0ul, 3,
RF_ACTIVE);
     /* [error check code] */

      sc->ioaddr = rman_get_start (sc->iobase);

       /* [probe stuff] */
       return 0;
}

static int
dl_attach (device_t dev) {
    int rid;
    struct dl_softc* sc = device_getr_softc(dev);
    void *ih; 

    printf ("dl0: grab IRQ\n");
    sc->irqbase = bus_alloc_resource (dev, SYS_RES_IRQ, &rid, 0ul, ~0ul, 1,
RF_ACTIVE);
    /* [ error check ] */

     printf ("dl0: set IRQ handkler\n");
    if (bus_setup_intr (dev, sc->irqbase, INTR_TYPE_NET, dl_intr, (void*)sc,
&ih)) {
    /* [error check] */
}

    printf ("dl0: DONE!\n");
}   


But upon loading, it *CRASHES* (!) FreeBSD after the dl0: DONE thing...

HELP!

Anyone know how I can fix this? Sorry for all those messages lately, but I
really want this to work!

Thanks!
--Rink


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

Reply via email to