Alan,
Thanks for your answer!
I have fix this bug, cause i make some mistakes in my disconnect func. ^_^

Regards,
Levis

-----Original Message-----
From: Alan Stern [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 12:17 AM
To: Xu Levis-Q16136
Cc: [EMAIL PROTECTED]
Subject: Re: [linux-usb-devel] A question of usb host driver.


On Mon, 9 Feb 2004, Xu Levis-Q16136 wrote:

> Dear all,
> I'm SW engineer for Linux USB driver(Host and Client). And now
> i have a question of usb host side driver, could you help me analyze it
> and give me some suggestions?
> 
> You know when a device attached to a host, the probe function will be
> called. Now our usb device support 1 configuration and 3 interfaces, and
> my host probe function will be called 3 times when i attached the
> device. Do you know about how to avoid this case?

Why do you want to avoid it?  Just let your probe function be called 3 
times.

>  I add the following
> function call in my probe func., but when i unplug the usb cable, kernel
> panic, hehe. But if i attached a usb device which support 1 interface
> and unplug/plug, no problems, could you tell me what's wrong in my prob
> func. and on how to implement to support mults interfaces in prob func.?

If you get a kernel panic when you unplug the USB cable, that indicates a 
problem may lie in your release routine.  You should check it out as well
as checking your probe routine.

> Thanks!
> 
> usb_driver_claim_interface(&my_driver, usbdev->config->iface + 0, null);
> usb_driver_claim_interface(&mm_driver, usbdev->config->iface + 1, null);
> usb_driver_claim_interface(&my_driver, usbdev->config->iface + 2, null);

It's okay to claim the other two interfaces, but you shouldn't try to 
claim the interface being probed.  That interface will automatically be 
assigned to your driver when the probe function returns.

Alan Stern


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to