Date: Wed, 19 Oct 2005 21:41:49 -0600 (MDT) From: "M. Warner Losh" <imp@bsdimp.com> To: mayong@mail.com Cc: freebsd-drivers@freebsd.org Subject: Re: Some Questions Message-ID: <20051019.214149.104032722.imp@bsdimp.com> In-Reply-To: <20051020020357.C0CE31CE304@ws1-6.us4.outblaze.com> References: <20051020020357.C0CE31CE304@ws1-6.us4.outblaze.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message: <20051020020357.C0CE31CE304@ws1-6.us4.outblaze.com> "Yong Ma" <mayong@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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051019.214149.104032722.imp>