Re: what is the init entrance for pci bus scan in FREEbsd?

2005-06-06 Thread kylin
sir :
it is a great pleasure to get ur reply .thank you very much for your words

below is my appinion , i will report with the advance of my work

On 6/6/05, M. Warner Losh [EMAIL PROTECTED] wrote:
 I'm not sure I understand what you are getting at here.  First, devd
 already provides 95% of the infrastructure to do things when devices
 are added to the system.
sorry ,i ignore it!! it is really a lite tool:) ,but it seems that
/dev/devctl does not present the function to write to the devctl,then
I think it is impossible to  give order to disable or enable the pci
slots without making changes.
static struct cdevsw dev_cdevsw = {
.d_version =D_VERSION,
.d_flags =  D_NEEDGIANT,
.d_open =   devopen,
.d_close =  devclose,
.d_read =   devread,
.d_ioctl =  devioctl,
.d_poll =   devpoll,
.d_name =   devctl,
.d_maj =CDEV_MAJOR,
};

 i need the function to cooperated with the hardware to detect the
present of  card ,and  enumerate the bus , and add it to the bus ,
then it is devd that should come into play( like the sbin/hotplug in
linux?):)
 Second, you assume that linux's way of doing things is how FreeBSD
 does things.  This isn't the case. FreeBSD scans the bus at pci bus
 attach time and adds chilren nodes that it finds.  In the Cardbus
 case, it will add nodes as the card bus bridge tells us of children,
 and then probe/attaches them. 
i mean the enumeration  way . and the trickes to talk with the hotplug bridge.
BTW pci_init()  is the start point for PCI enumeration in linux. The
way to add the device to the lists

  Finally, you should send me your work for review.  I've been keen on
 expanding pci bus support for a long time and would be happy to review
 such changes.

 BTW, Which chipsets and hotplugging methods do you support?
i will begin with the fake way here ,then give support to pciexpress
native hotplug .there is common register interface for pci e hotplug
first ,i will not change the source ,just add a module.


-- 
we who r about to die,salute u!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: what is the init entrance for pci bus scan in FREEbsd?

2005-06-06 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
kylin [EMAIL PROTECTED] writes:
: On 6/6/05, M. Warner Losh [EMAIL PROTECTED] wrote:
:  I'm not sure I understand what you are getting at here.  First, devd
:  already provides 95% of the infrastructure to do things when devices
:  are added to the system.
: sorry ,i ignore it!! it is really a lite tool:) ,but it seems that
: /dev/devctl does not present the function to write to the devctl,then
: I think it is impossible to  give order to disable or enable the pci
: slots without making changes.

OK.  You need a daemon to respond to the state diagram of the pci hot
plug interaction model.

: then it is devd that should come into play( like the sbin/hotplug in
: linux?):)

Yes.  devd predates hotplug in Linux, but not by much (they both were
worked on in parallel).

:  Second, you assume that linux's way of doing things is how FreeBSD
:  does things.  This isn't the case. FreeBSD scans the bus at pci bus
:  attach time and adds chilren nodes that it finds.  In the Cardbus
:  case, it will add nodes as the card bus bridge tells us of children,
:  and then probe/attaches them. 
: i mean the enumeration  way . and the trickes to talk with the hotplug bridge.
: BTW pci_init()  is the start point for PCI enumeration in linux. The
: way to add the device to the lists

You'll need to look at how cardbus handles this.

:   Finally, you should send me your work for review.  I've been keen on
:  expanding pci bus support for a long time and would be happy to review
:  such changes.
: 
:  BTW, Which chipsets and hotplugging methods do you support?
: i will begin with the fake way here ,then give support to pciexpress
: native hotplug .there is common register interface for pci e hotplug
: first ,i will not change the source ,just add a module.

I think you should make it be a full-fledged driver, rather than an
add-on on the side.  You'll not be able to solve the resource problems
otherwise.

Warner
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: what is the init entrance for pci bus scan in FREEbsd?

2005-06-05 Thread M. Warner Losh
In message: [EMAIL PROTECTED]
kylin [EMAIL PROTECTED] writes:
: Now i am coding a fake pcihotplug module in Freebsd 5.3 release,
: it contains two parts ,the userplace using a ioctl way to communicate
: with an cdev in /dev, and the kernel module which
: mainly operates on the Devclasses ,devlist and driverlist but
: still in the enable function,i have to rescan the pci bus. BUT, i can
: not find the pci bus scan code in the freebsd,i guess it was just an
: entry of the startup table which is made by compiler,
: still some one told me to follow the pci_init() way in LINUX ,but , i
: find it too hard in the OO structure bus arch of Freebsd .so
: WHERE can i get some code to follow in order to finish my pci rescan 
function? 

I'm not sure I understand what you are getting at here.  First, devd
already provides 95% of the infrastructure to do things when devices
are added to the system.

Second, you assume that linux's way of doing things is how FreeBSD
does things.  This isn't the case. FreeBSD scans the bus at pci bus
attach time and adds chilren nodes that it finds.  In the Cardbus
case, it will add nodes as the card bus bridge tells us of children,
and then probe/attaches them.  If you are implementing support for
bridges that announce new children, you should start by looking into
the pci bridge driver code (this will be in src/sys/dev/pci/pci_pci.c)
and add the approrpiate hooks there.  Next, you should look at the
following routines in cardbus (located in src/sys/dev/cardbus and
dev/pccbb): cbb_insert will call CARD_ATTACH_CARD on cbdev.  The
CARD_ATTACH_CARD method is implemented in cardbus.c's
cardbus_attach_card.  There it will probe all the slots on the bus.
It might be better to abstract the guts of this function, and move it
down into sys/dev/pci/pci.c if other bridges could use the same
functionality.

Finally, you should send me your work for review.  I've been keen on
expanding pci bus support for a long time and would be happy to review
such changes.

BTW, Which chipsets and hotplugging methods do you support?

Warner
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


what is the init entrance for pci bus scan in FREEbsd?

2005-06-01 Thread kylin
Now i am coding a fake pcihotplug module in Freebsd 5.3 release,
it contains two parts ,the userplace using a ioctl way to communicate
with an cdev in /dev, and the kernel module which
mainly operates on the Devclasses ,devlist and driverlist but
still in the enable function,i have to rescan the pci bus. BUT, i can
not find the pci bus scan code in the freebsd,i guess it was just an
entry of the startup table which is made by compiler,
still some one told me to follow the pci_init() way in LINUX ,but , i
find it too hard in the OO structure bus arch of Freebsd .so
WHERE can i get some code to follow in order to finish my pci rescan function? 

-- 
we who r about to die,salute u!
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]