Some Questions

Yong Ma mayong at mail.com
Wed Oct 19 19:04:01 PDT 2005


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'

and

[root] #kldload -v ./test.ko
kldload: can't load ./test.ko: No such file or directory
(but the test.ko was just there!)
Delete the last two lines and it will be complied and loaded successfully,but I have to keep these two lines.I don't know what to do,tell me please!
btw:I had #include <sys/rman.h> in the file.

Thanks and best regards
Yong






-- 
___________________________________________________
Play 100s of games for FREE! http://games.mail.com/



More information about the freebsd-drivers mailing list