char device driver and bus ? - Linux

This is a discussion on char device driver and bus ? - Linux ; hi all, as we known, linux kernel device driver have three layers: bus, device and dirver. but when a char device register, i will added to: chrdevs[MAX_PROBE_HASH] and it seems dont blong to any bus. does it means that the ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: char device driver and bus ?

  1. char device driver and bus ?

    hi all, as we known, linux kernel device driver have three layers:
    bus, device and dirver.
    but when a char device register, i will added to:
    chrdevs[MAX_PROBE_HASH] and it seems dont blong to any bus.
    does it means that the kernel only use the array
    chrdevs[MAX_PROBE_HASH] to manager the driver and device?
    for example, a usb driver and usb device will mach by ID, but when a
    serial driver and serial device will mach by what ?

    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


  2. Re: char device driver and bus ?

    On 2007-07-13, freegnu@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

+ Reply to Thread