Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 02 Dec 2005 01:57:36 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        fierykylin@gmail.com
Cc:        jhb@freebsd.org, freebsd-usb@freebsd.org
Subject:   Re: the mechanism of USB hotplug
Message-ID:  <20051202.015736.66169514.imp@bsdimp.com>
In-Reply-To: <87ab37ab0512020030u2dcdc3ecj69fa27ec6840ca3b@mail.gmail.com>
References:  <20051201.231433.32736713.imp@bsdimp.com> <20051202.003353.21274600.imp@bsdimp.com> <87ab37ab0512020030u2dcdc3ecj69fa27ec6840ca3b@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <87ab37ab0512020030u2dcdc3ecj69fa27ec6840ca3b@mail.gmail.com>
            kylin <fierykylin@gmail.com> writes:
: thank u,sir :)
:  i have been  reading ur pccbb code for a long time . really
: elegant.here I think my ignorace is partly because the lack of reading
: to the doc about the generic  device architecture .but frankly ,i
: still haven't fount the newbus-draft :(

Your best best is to look at the source and understand it.  I'll be
the first to admit, however, that better docs would help here.  The
FreeBSD handbook has good info on this topic, even if it is a little
dated.

: mention to pccbb ,i wonder the reason why pccard driver is so
: different from the cardbus and still attach to the same pci carbus
: bridge level .

pccard and cardbus are way different.  The interfaces for talking to
them are different, the configuraiton is different, etc.  CardBus
cards are just PCI cards, with a few rare exceptions.  So rare, in
fact, that no one has brought one to my attention as needing special
handling for CardBus vs PCI.  Since we inheret from the pci bus for
cardbus, that makes cardbus very small.  It should be a little smaller
than it is today, but I've not had the time to do that.

pccard has to do it all on its own, as it is nothing like PCI.  Since
it is basically ISA in a hotplug form factor that also allows other
similar cards (memory only), there are a number of warts in the code.
Since ISA has no notion of hot plug or announcing its resource needs
or device activation, the CIS has to be parsed to get these details
(this predates the isapnp go, but even that doesn't support hotplug).

I suspect that if one were to write a hot-plug PCI bus bridge that it
would mostly work similar to cbb, but with some differences due to API
differences.

The USB stuff, btw, is confusingly located in uhub.c.  There are a
number of bugs in the newbus integration of usb, and various people
have tried to fix it.  In usbland uhub is the bus, not the usb device,
which is confusing at first, and poorly documented.  The usb_port.h
obfuscation also doesn't help.

Warner



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