Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Oct 2005 21:03:57 -0500
From:      "Yong Ma" <mayong@mail.com>
To:        "John Baldwin" <jhb@freebsd.org>
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: Some Questions
Message-ID:  <20051020020357.C0CE31CE304@ws1-6.us4.outblaze.com>

next in thread | raw e-mail | index | archive | help
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=
=20
> 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 origina=
l Linux driver,and I use following method:
(reference:http://lists.freebsd.org/pipermail/freebsd-hackers/2005-April/01=
1724.html)
=20=20
183    int  rid =3D 0x10;
184    res =3D bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE);
185    printf("resource alloc successfully!\n");
186    sc->bst =3D rman_get_btag(res);
187    sc->bsh =3D 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,b=
ut 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






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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051020020357.C0CE31CE304>