bus_alloc_resource() returns NULL, but why?
thefly
thefly at acaro.org
Tue Mar 16 07:02:58 PST 2004
Hi, i'm currently porting QuanCom PWDOG1 Watchdog card to FreeBSD, (you
can find the current code at http://chiakotay.nexlab.it/acaro/pwdog.c).
I defined my softc struct:
struct pwdog1_softc {
bus_space_tag_t bst;
bus_space_handle_t bsh;
struct resource *res;
int rid;
};
In my attach() function i do NewBus initialization:
sc = (struct pwdog1_softc *) device_get_softc(dev);
sc->rid = 0;
sc->res = bus_alloc_resource(dev, SYS_RES_IOPORT, &sc->rid, 0, ~0, 1, RF_ACTIVE);
sc->bst = rman_get_bustag(sc->res);
sc->bsh = rman_get_bushandle(sc->res);
but the problem is that bus_alloc_resource() returns NULL. I don't have
a clue about WHY it should. It's running on: FreeBSD 5.2.1-RELEASE with
GENERIC kernel in a dual pentium 200MMX.
Thanks in advance
--
Claudio "thefly" Martella
thefly at acaro.org
GNU/PG keyid: 0x8EA95625
More information about the freebsd-hackers
mailing list