Browse Source

[uhci] Use meaningful device names in debug messages

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 years ago
parent
commit
bb6d7bebe9
2 changed files with 21 additions and 15 deletions
  1. 19
    15
      src/drivers/usb/uhci.c
  2. 2
    0
      src/drivers/usb/uhci.h

+ 19
- 15
src/drivers/usb/uhci.c View File

117
 		mdelay ( 1 );
117
 		mdelay ( 1 );
118
 	}
118
 	}
119
 
119
 
120
-	DBGC ( uhci, "UHCI %p timed out waiting for stop\n", uhci );
120
+	DBGC ( uhci, "UHCI %s timed out waiting for stop\n", uhci->name );
121
 	return -ETIMEDOUT;
121
 	return -ETIMEDOUT;
122
 }
122
 }
123
 
123
 
155
 		mdelay ( 1 );
155
 		mdelay ( 1 );
156
 	}
156
 	}
157
 
157
 
158
-	DBGC ( uhci, "UHCI %p timed out waiting for reset\n", uhci );
158
+	DBGC ( uhci, "UHCI %s timed out waiting for reset\n", uhci->name );
159
 	return -ETIMEDOUT;
159
 	return -ETIMEDOUT;
160
 }
160
 }
161
 
161
 
541
 	 * safely run concurrently with hardware execution of the
541
 	 * safely run concurrently with hardware execution of the
542
 	 * schedule.
542
 	 * schedule.
543
 	 */
543
 	 */
544
-	DBGCP ( uhci, "UHCI %p periodic schedule: ", uhci );
544
+	DBGCP ( uhci, "UHCI %s periodic schedule: ", uhci->name );
545
 	link = end = uhci_link_qh ( uhci->head );
545
 	link = end = uhci_link_qh ( uhci->head );
546
 	list_for_each_entry_reverse ( endpoint, &uhci->periodic, schedule ) {
546
 	list_for_each_entry_reverse ( endpoint, &uhci->periodic, schedule ) {
547
 		queue = endpoint->ring.head;
547
 		queue = endpoint->ring.head;
554
 	DBGCP ( uhci, "\n" );
554
 	DBGCP ( uhci, "\n" );
555
 
555
 
556
 	/* Populate periodic frame list */
556
 	/* Populate periodic frame list */
557
-	DBGCP ( uhci, "UHCI %p periodic frame list:", uhci );
557
+	DBGCP ( uhci, "UHCI %s periodic frame list:", uhci->name );
558
 	for ( i = 0 ; i < UHCI_FRAMES ; i++ ) {
558
 	for ( i = 0 ; i < UHCI_FRAMES ; i++ ) {
559
 
559
 
560
 		/* Calculate maximum interval (in microframes) which
560
 		/* Calculate maximum interval (in microframes) which
930
 		 * and report the error to the USB core.
930
 		 * and report the error to the USB core.
931
 		 */
931
 		 */
932
 		if ( desc->status & UHCI_STATUS_STALLED ) {
932
 		if ( desc->status & UHCI_STATUS_STALLED ) {
933
-			DBGC ( uhci, "UHCI %p %s endpoint %02x completion "
934
-			       "%d.%d failed (status %02x)\n", uhci, usb->name,
935
-			       ep->address, index, xfer->cons, desc->status );
933
+			DBGC ( uhci, "UHCI %s %s completion %d.%d failed "
934
+			       "(status %02x)\n", usb->name,
935
+			       usb_endpoint_name ( ep ), index,
936
+			       xfer->cons, desc->status );
936
 			link = UHCI_LINK_TERMINATE;
937
 			link = UHCI_LINK_TERMINATE;
937
 			ring->head->current = cpu_to_le32 ( link );
938
 			ring->head->current = cpu_to_le32 ( link );
938
 			wmb();
939
 			wmb();
1062
 	address = usb_alloc_address ( bus );
1063
 	address = usb_alloc_address ( bus );
1063
 	if ( address < 0 ) {
1064
 	if ( address < 0 ) {
1064
 		rc = address;
1065
 		rc = address;
1065
-		DBGC ( uhci, "UHCI %p %s could not allocate address: %s\n",
1066
-		       uhci, usb->name, strerror ( rc ) );
1066
+		DBGC ( uhci, "UHCI %s could not allocate address: %s\n",
1067
+		       usb->name, strerror ( rc ) );
1067
 		goto err_alloc_address;
1068
 		goto err_alloc_address;
1068
 	}
1069
 	}
1069
 
1070
 
1184
 		mdelay ( 1 );
1185
 		mdelay ( 1 );
1185
 	}
1186
 	}
1186
 
1187
 
1187
-	DBGC ( uhci, "UHCI %p timed out waiting for port %d to enable "
1188
-	       "(status %04x)\n",  uhci, port->address, portsc );
1188
+	DBGC ( uhci, "UHCI %s-%d timed out waiting for port to enable "
1189
+	       "(status %04x)\n",  uhci->name, port->address, portsc );
1189
 	return -ETIMEDOUT;
1190
 	return -ETIMEDOUT;
1190
 }
1191
 }
1191
 
1192
 
1217
  */
1218
  */
1218
 static int uhci_root_speed ( struct usb_hub *hub, struct usb_port *port ) {
1219
 static int uhci_root_speed ( struct usb_hub *hub, struct usb_port *port ) {
1219
 	struct uhci_device *uhci = usb_hub_get_drvdata ( hub );
1220
 	struct uhci_device *uhci = usb_hub_get_drvdata ( hub );
1221
+	struct pci_device pci;
1220
 	uint16_t portsc;
1222
 	uint16_t portsc;
1221
 	unsigned int speed;
1223
 	unsigned int speed;
1222
 
1224
 
1231
 		/* Defer connection detection until companion
1233
 		/* Defer connection detection until companion
1232
 		 * controller has been enumerated.
1234
 		 * controller has been enumerated.
1233
 		 */
1235
 		 */
1234
-		DBGC ( uhci, "UHCI %p port %d deferring connection\n",
1235
-		       uhci, port->address );
1236
+		pci_init ( &pci, uhci->companion );
1237
+		DBGC ( uhci, "UHCI %s-%d deferring for companion " PCI_FMT "\n",
1238
+		       uhci->name, port->address, PCI_ARGS ( &pci ) );
1236
 		speed = USB_SPEED_NONE;
1239
 		speed = USB_SPEED_NONE;
1237
 	} else if ( portsc & UHCI_PORTSC_LS ) {
1240
 	} else if ( portsc & UHCI_PORTSC_LS ) {
1238
 		/* Low-speed device */
1241
 		/* Low-speed device */
1263
 	struct uhci_device *uhci = usb_hub_get_drvdata ( hub );
1266
 	struct uhci_device *uhci = usb_hub_get_drvdata ( hub );
1264
 
1267
 
1265
 	/* Should never be called; this is a root hub */
1268
 	/* Should never be called; this is a root hub */
1266
-	DBGC ( uhci, "UHCI %p port %d nonsensical CLEAR_TT for %s endpoint "
1267
-	       "%02x\n", uhci, port->address, ep->usb->name, ep->address );
1269
+	DBGC ( uhci, "UHCI %s-%d nonsensical CLEAR_TT for %s %s\n", uhci->name,
1270
+	       port->address, ep->usb->name, usb_endpoint_name ( ep ) );
1268
 
1271
 
1269
 	return -ENOTSUP;
1272
 	return -ENOTSUP;
1270
 }
1273
 }
1479
 		rc = -ENOMEM;
1482
 		rc = -ENOMEM;
1480
 		goto err_alloc;
1483
 		goto err_alloc;
1481
 	}
1484
 	}
1485
+	uhci->name = pci->dev.name;
1482
 	INIT_LIST_HEAD ( &uhci->endpoints );
1486
 	INIT_LIST_HEAD ( &uhci->endpoints );
1483
 	INIT_LIST_HEAD ( &uhci->async );
1487
 	INIT_LIST_HEAD ( &uhci->async );
1484
 	INIT_LIST_HEAD ( &uhci->periodic );
1488
 	INIT_LIST_HEAD ( &uhci->periodic );

+ 2
- 0
src/drivers/usb/uhci.h View File

307
 struct uhci_device {
307
 struct uhci_device {
308
 	/** Registers */
308
 	/** Registers */
309
 	unsigned long regs;
309
 	unsigned long regs;
310
+	/** Name */
311
+	const char *name;
310
 
312
 
311
 	/** EHCI companion controller bus:dev.fn address (if any) */
313
 	/** EHCI companion controller bus:dev.fn address (if any) */
312
 	unsigned int companion;
314
 	unsigned int companion;

Loading…
Cancel
Save