Re: usb driver binding to the device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Sep 12, 2010 at 01:30:26PM +0530, Bond wrote:
> On Sat, Sep 11, 2010 at 11:31 PM, Josh Cartwright <joshc@xxxxxxxxx> wrote:
> 
> > To 'bind' to a device means that your driver is asserting control of the
> > device.
> 
> You mean  to say the driver is trying to take control of the device.

Yes.  If your driver is bound to a device, it has exclusive control over
it.

> > On the previous slide, a USB device ID table was created that lists the
> > IDs of the devices the driver supports.
> 
> Do you mean to say that it is possible that same driver support
> multiple devices?
> I have no clue of it.

Yes, it is quite common for a driver to control devices with different
IDs.

> > When your driver registers to
> > the USB core (via usb_register()),
> 
> Can you point me which slide in the presentation I gave link is meaning this
> type of thing.

I only briefly looked at the presentation, I'd suspect its in there, but
I'm not going to look for it for you, you can manage that yourself.
 
> > the core code looks at the list of unclaimed devices and your
> > provided ID table and calls your probe() for any matches.
> >
> > Your probe() callback is responsible for returning 0 if it wants to
> > 'bind' to the device, otherwise you return an error.
> >
> Is 0 for success.

Yes.

> I see a structure
> static struct  usb_driver {
> .owner :
> .name :
> .probe :
> .disconnect :
> .id_connect :
> 
> }
> I am not clear as how this structure has mapped to functions.

You're responsible for populating the members of this structure with
your callback functions, and then passing it to usb_register().

> What my understanding of writing a device driver till now from my search on
> Internet is
> 
> reserve a set of major and minor number
> define a file_operations structure associating to function pointers
> we need to define operations corresponding to system calls an application
> can apply

This would be enough for your driver to communicate to userspace, but it
is certainly not enough for your driver to communicate to your device
via usb.

> if I were to take above three points then on the link
> http://www.kroah.com/linux/talks/ols_2005_driver_tutorial/index.html
> which slide is doing that?

Again, you can look through the slides.  Also you should read LDD3, as
it covers alot of your questions.

-- 
                                        -joshc

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux