|
@@ -1976,6 +1976,26 @@ void free_usb_bus ( struct usb_bus *bus ) {
|
1976
|
1976
|
free ( bus );
|
1977
|
1977
|
}
|
1978
|
1978
|
|
|
1979
|
+/**
|
|
1980
|
+ * Find USB bus by device location
|
|
1981
|
+ *
|
|
1982
|
+ * @v bus_type Bus type
|
|
1983
|
+ * @v location Bus location
|
|
1984
|
+ * @ret bus USB bus, or NULL
|
|
1985
|
+ */
|
|
1986
|
+struct usb_bus * find_usb_bus_by_location ( unsigned int bus_type,
|
|
1987
|
+ unsigned int location ) {
|
|
1988
|
+ struct usb_bus *bus;
|
|
1989
|
+
|
|
1990
|
+ for_each_usb_bus ( bus ) {
|
|
1991
|
+ if ( ( bus->dev->desc.bus_type == bus_type ) &&
|
|
1992
|
+ ( bus->dev->desc.location == location ) )
|
|
1993
|
+ return bus;
|
|
1994
|
+ }
|
|
1995
|
+
|
|
1996
|
+ return NULL;
|
|
1997
|
+}
|
|
1998
|
+
|
1979
|
1999
|
/******************************************************************************
|
1980
|
2000
|
*
|
1981
|
2001
|
* USB address assignment
|