Some Questions
M. Warner Losh
imp at bsdimp.com
Wed Oct 19 20:43:01 PDT 2005
In message: <20051020020357.C0CE31CE304 at ws1-6.us4.outblaze.com>
"Yong Ma" <mayong at mail.com> writes:
: John Baldwin wrote:
:
: > Do any processes have /dev/mypci0 open when you try to kldunload? You
: > probably should maintain a count of open clients and if it is > 0, return
: > EBUSY in my_pcidetach().
: >
: I have met another question(seems I have so many to ask!):
: I have to translate the function pci_resource_start() in the original Linux driver,and I use following method:
: (reference:http://lists.freebsd.org/pipermail/freebsd-hackers/2005-April/011724.html)
:
: 183 int rid = 0x10;
: 184 res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
: 185 printf("resource alloc successfully!\n");
: 186 sc->bst = rman_get_btag(res);
: 187 sc->bsh = rman_get_handle(res); // to pci_resource_start()
:
:
: An error occurred when I make it:
:
: test.c: In function `mypci_attach':
: test.c:186: warning: implicit declaration of function `rman_get_btag'
: test.c:186: warning: nested extern declaration of `rman_get_btag'
: test.c:187: warning: implicit declaration of function `rman_get_handle'
: test.c:187: warning: nested extern declaration of `rman_get_handle'
Try rman_get_bustag and rman_get_bushandle instead.
Warner
More information about the freebsd-drivers
mailing list