Date: Sun, 5 Nov 2000 16:37:57 +0000 From: Rink Springer VII <rink@springer.cx> To: Warner Losh <imp@village.org> Cc: hackers@FreeBSD.ORG Subject: KLD's on ISA: another problem Message-ID: <00110516524700.91928@aurum.springer.cx> In-Reply-To: <200011042344.QAA37170@harmony.village.org> References: <3A044899.9020508@springer.cx> <200011042344.QAA37170@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00110516524700.91928>
