On 2007-07-13, freegnu RemoveThis @163.com <freegnu RemoveThis @163.com> wrote:
> hi all, as we known, linux kernel device driver have three
> layers: bus, device and dirver.
Really? I've been doing Linux device drivers for 10 years, and
that's news to me. Some sorts of devices have three layers,
some don't. Some are on buses, some aren't.
> but when a char device register, i will added to:
> chrdevs[MAX_PROBE_HASH] and it seems dont blong to any bus.
So?
> does it means that the kernel only use the array
> chrdevs[MAX_PROBE_HASH] to manager the driver and device?
No, it uses other things as well.
> for example, a usb driver and usb device will mach by ID, but
> when a serial driver and serial device will mach by what ?
I don't get your point. Some things are on buses, some aren't.
Some devices have three-layer drivers, some have two, some have
one -- there are probably some that have four or more.
> ok , if a char deveice doesnt blong to any bus, how to
> traversal the char devices? the array of
> chrdevs[MAX_PROBE_HASH] doest EXPORT_SYMBOL
So is that your actual question? How to get a list of all char
devices the kernel knows about?
--
Grant Edwards grante Yow! An air of FRENCH FRIES
at permeates my nostrils!!
visi.com