lkml.org 
[lkml]   [2012]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC]Is usb port number fixed?
On Tue, 24 Apr 2012, Wang YanQing wrote:

> On Mon, Apr 23, 2012 at 11:13:06AM -0400, Alan Stern wrote:
> > The port numbers are determined by the hardware -- each set of wires
> > has its own port number. The numbers have nothing to do with
> > bandwidth.
> Could you figure out the codes in kernel that read out the port number from
> hub, if there is a piece of codes do that things?

In drivers/usb/core/hub.c, look through the hub_events() routine.
There are several function calls similar to this one:

ret = hub_port_status(hub, i,
&portstatus, &portchange);

Here i is the port number. This asks the hub to send back status and
change information for port i. (See also the code for the
hub_port_status() and get_port_status() routines.)

Alan Stern



\
 
 \ /
  Last update: 2012-04-24 16:17    [W:0.055 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site