summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/drivers/bus/usb.c17
-rw-r--r--src/include/ipxe/usb.h18
2 files changed, 17 insertions, 18 deletions
diff --git a/src/drivers/bus/usb.c b/src/drivers/bus/usb.c
index 70a86c913..428ae26c1 100644
--- a/src/drivers/bus/usb.c
+++ b/src/drivers/bus/usb.c
@@ -2278,23 +2278,6 @@ unsigned int usb_route_string ( struct usb_device *usb ) {
}
/**
- * Get USB depth
- *
- * @v usb USB device
- * @ret depth Hub depth
- */
-unsigned int usb_depth ( struct usb_device *usb ) {
- struct usb_device *parent;
- unsigned int depth;
-
- /* Navigate up to root hub, constructing depth as we go */
- for ( depth = 0 ; ( parent = usb->port->hub->usb ) ; usb = parent )
- depth++;
-
- return depth;
-}
-
-/**
* Get USB root hub port
*
* @v usb USB device
diff --git a/src/include/ipxe/usb.h b/src/include/ipxe/usb.h
index f41f4c355..911247ede 100644
--- a/src/include/ipxe/usb.h
+++ b/src/include/ipxe/usb.h
@@ -1239,6 +1239,23 @@ usb_set_interface ( struct usb_device *usb, unsigned int interface,
NULL, 0 );
}
+/**
+ * Get USB depth
+ *
+ * @v usb USB device
+ * @ret depth Hub depth
+ */
+static inline unsigned int usb_depth ( struct usb_device *usb ) {
+ struct usb_device *parent;
+ unsigned int depth;
+
+ /* Navigate up to root hub, constructing depth as we go */
+ for ( depth = 0 ; ( parent = usb->port->hub->usb ) ; usb = parent )
+ depth++;
+
+ return depth;
+}
+
extern struct list_head usb_buses;
extern struct usb_interface_descriptor *
@@ -1274,7 +1291,6 @@ extern struct usb_bus * find_usb_bus_by_location ( unsigned int bus_type,
extern int usb_alloc_address ( struct usb_bus *bus );
extern void usb_free_address ( struct usb_bus *bus, unsigned int address );
extern unsigned int usb_route_string ( struct usb_device *usb );
-extern unsigned int usb_depth ( struct usb_device *usb );
extern struct usb_port * usb_root_hub_port ( struct usb_device *usb );
extern struct usb_port * usb_transaction_translator ( struct usb_device *usb );