On Mon, Jan 07, 2002 at 06:00:55PM +0800, Dattaram Porob wrote:
> When is the probe handler of the usb device actually called. Suppose that before my 
>usb driver is loaded in memory, the usb device is already attached. Will the probe 
>function be called after i register my device using usb_register in my usb driver. Or 
>is it that the probe function is only called when a new device is attached after i 
>load my driver.?

When you register a new driver, probe() is called for all existing
interfaces that are not currently bound to a driver.  Thus, probe() is the
only interface a driver needs to make sure it can grab all applicable
devices.

> Secondly for sending a URB the usb_submit_urb function is used with the data, to be 
>sent with request, as a pointer in transfer_buffer. When should memory be allocated 
>and freed for this transfer_buffer. Can it be freed just after usb_submit_urb 
>returns??Or do we have to wait till the completion handler is called??

The memory must be DMA-capable.  That usually means allocating it with
kmalloc().  You _must_not_ free the memory until _after_ the completion
handler is called.  The memory pool you pass is the actual memory that the
data will be transferred to/from.

Matt

-- 
Matthew Dharm                              Home: [EMAIL PROTECTED] 
Maintainer, Linux USB Mass Storage Driver

We've made a business out of making money from annoying and stupid people.
I think you fall under that category.
                                        -- Chief
User Friendly, 7/11/1998

Attachment: msg03792/pgp00000.pgp
Description: PGP signature

Reply via email to