Re: usb hcd questions
Alan Stern <[email protected]>
| Newsgroups | gmane.linux.usb.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 24 Oct 2007, jidong xiao wrote:
> 1.I noticed there is a new root-hub polling mechanism,what is it?And
> what is the old one?
The old polling mechanism calls the HCD's hub_status_data routine only
when a status URB is pending. The new polling mechanism calls the
HCD's hub_status_data routine whenever requested to do, regardless of
whether or not a status URB is pending.
> 2.struct usb_hcd has an element of unsigned poll_pending, what does
> this variable mean?
It means the HCD's hub_status_data routine has said a root-hub status
change occurred, but no status URB was submitted so the status change
couldn't be sent upward to the hub driver. When the next status URB is
submitted, it will complete almost immediately with the new status
information.
> In particular, this method sets poll_pending:
>
> void usb_hcd_poll_rh_status(struct usb_hcd *hcd){
> ...
> if (length > 0)
> usb_hcd_giveback_urb (hcd, urb);
> else
> hcd->poll_pending = 1;
> }
>
> Why for length<=0, we need to set hcd->poll_pending to 1?
The code above is old. Still, the idea is what I wrote above. If
length <= 0 then there is no status URB currently queued.
hcd->poll_pending has to be set so that when the next status URB is
submitted it can get the status-change information quickly. If we
didn't do this then the URB might not complete for a long time, since
root-hub status changes are often interrupt-driven and there might not
be any status interrupts for a while.
Alan Stern
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel