[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] [PATCH][USB] Fix debug output
Please commit this patch.
Comment:
Fix some debug strings.
Index: ./usb/src.km/hub.c
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/hub.c,v
retrieving revision 1.3
diff -u -8 -r1.3 hub.c
--- ./usb/src.km/hub.c 11 Jun 2013 17:33:26 -0000 1.3
+++ ./usb/src.km/hub.c 2 Jan 2014 10:13:18 -0000
@@ -109,17 +109,17 @@
/*
* Enable power to the ports:
* Here we Power-cycle the ports: aka,
* turning them off and turning on again.
*/
DEBUG(("enabling power on all ports\n"));
for (i = 0; i < dev->maxchild; i++) {
usb_clear_port_feature(dev, i + 1, USB_PORT_FEAT_POWER);
- DEBUG(("port %d returns %lX\n", i + 1, dev->status));
+ DEBUG(("port %ld returns %lx\n", i + 1, dev->status));
}
/* Wait at least 2*bPwrOn2PwrGood for PP to change */
mdelay(pgood_delay);
for (i = 0; i < dev->maxchild; i++) {
ret = usb_get_port_status(dev, i + 1, &portsts);
if (ret < 0) {
Index: ./usb/src.km/usb.c
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/usb.c,v
retrieving revision 1.3
diff -u -8 -r1.3 usb.c
--- ./usb/src.km/usb.c 11 Jun 2013 17:33:27 -0000 1.3
+++ ./usb/src.km/usb.c 2 Jan 2014 10:13:18 -0000
@@ -113,30 +113,30 @@
DEBUG (("%s: ucd low level init failed!", __FILE__));
return -1;
}
/* if lowlevel init is OK, scan the bus for devices
* i.e. search HUBs and configure them
*/
start_index = dev_index;
- DEBUG(("scanning bus %d for devices... ", i));
+ DEBUG(("scanning bus %d for devices... ", a->unit));
dev = usb_alloc_new_device(a);
/*
* device 0 is always present
* (root hub, so let it analyze)
*/
if (dev)
usb_new_device(dev);
if (start_index == dev_index)
DEBUG(("No USB Device found"));
else
- DEBUG(("%d USB Device(s) found",
+ DEBUG(("%ld USB Device(s) found",
dev_index - start_index));
usb_started = 1;
}
DEBUG(("scan end"));
/* if we were not able to find at least one working bus, bail out */
if (!usb_started) {
@@ -339,31 +339,31 @@
b = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_CONTROL) {
/* Control => bidirectional */
dev->epmaxpacketout[b] = ep->wMaxPacketSize;
dev->epmaxpacketin[b] = ep->wMaxPacketSize;
- DEBUG(("##Control EP epmaxpacketout/in[%ld] = %ld",
+ DEBUG(("##Control EP epmaxpacketout/in[%d] = %ld",
b, dev->epmaxpacketin[b]));
} else {
if ((ep->bEndpointAddress & 0x80) == 0) {
/* OUT Endpoint */
if (ep->wMaxPacketSize > dev->epmaxpacketout[b]) {
dev->epmaxpacketout[b] = ep->wMaxPacketSize;
- DEBUG(("##EP epmaxpacketout[%ld] = %ld",
+ DEBUG(("##EP epmaxpacketout[%d] = %ld",
b, dev->epmaxpacketout[b]));
}
} else {
/* IN Endpoint */
if (ep->wMaxPacketSize > dev->epmaxpacketin[b]) {
dev->epmaxpacketin[b] = ep->wMaxPacketSize;
- DEBUG(("##EP epmaxpacketin[%ld] = %ld",
+ DEBUG(("##EP epmaxpacketin[%d] = %ld",
b, dev->epmaxpacketin[b]));
}
} /* if out */
} /* if control */
}
/*
* set the max packed value of all endpoints in the given configuration
@@ -870,17 +870,17 @@
/* returns a pointer of a new device structure or NULL, if
* no device struct is available
*/
struct usb_device *usb_alloc_new_device(void *controller)
{
long i = 0;
- DEBUG(("New Device %d\n", dev_index));
+ DEBUG(("New Device %ld\n", dev_index));
if (dev_index == USB_MAX_DEVICE) {
ALERT(("ERROR, too many USB Devices, max=%d", USB_MAX_DEVICE));
return NULL;
}
/* default Address is 0, real addresses start with 1 */
usb_dev[dev_index].devnum = dev_index + 1;
usb_dev[dev_index].maxchild = 0;
@@ -896,17 +896,17 @@
/*
* Free the newly created device node.
* Called in error cases where configuring a newly attached
* device fails for some reason.
*/
void usb_free_device(void)
{
dev_index--;
- DEBUG(("Freeing device node: %d\n", dev_index));
+ DEBUG(("Freeing device node: %ld\n", dev_index));
memset(&usb_dev[dev_index], 0, sizeof(struct usb_device));
usb_dev[dev_index].devnum = -1;
}
/*
* By the time we get here, the device has gotten a new device ID
* and is in the default state. We need to identify the thing and
Index: ./usb/src.km/udd/storage/usb_storage.c
===================================================================
RCS file: /mint/freemint/sys/usb/src.km/udd/storage/usb_storage.c,v
retrieving revision 1.5
diff -u -8 -r1.5 usb_storage.c
--- ./usb/src.km/udd/storage/usb_storage.c 11 Jun 2013 17:33:31 -0000 1.5
+++ ./usb/src.km/udd/storage/usb_storage.c 2 Jan 2014 10:13:20 -0000
@@ -1593,18 +1593,18 @@
iface->desc.bInterfaceSubClass < US_SC_MIN ||
iface->desc.bInterfaceSubClass > US_SC_MAX) {
/* if it's not a mass storage, we go no further */
return 0;
}
memset(ss, 0, sizeof(struct us_data));
/* At this point, we know we've got a live one */
DEBUG(("USB Mass Storage device detected"));
- DEBUG(("Protocol: %x SubClass: %x", iface->bInterfaceProtocol, /* GALVEZ: DEBUG */
- iface->bInterfaceSubClass ));
+ DEBUG(("Protocol: %x SubClass: %x", iface->desc.bInterfaceProtocol, /* GALVEZ: DEBUG */
+ iface->desc.bInterfaceSubClass ));
/* Initialize the us_data structure with some useful info */
ss->flags = flags;
ss->ifnum = ifnum;
ss->pusb_dev = dev;
ss->attention_done = 0;
/* If the device has subclass and protocol, then use that. Otherwise,
* take data from the specific interface.
*/
@@ -1639,17 +1639,17 @@
return 0;
break;
}
/*
* We are expecting a minimum of 2 endpoints - in and out (bulk).
* An optional interrupt is OK (necessary for CBI protocol).
* We will ignore any others.
*/
- DEBUG(("Number of endpoints: %d", iface->bNumEndpoints));
+ DEBUG(("Number of endpoints: %d", iface->desc.bNumEndpoints));
for (i = 0; i < iface->desc.bNumEndpoints; i++) {
ep_desc = &iface->ep_desc[i];
/* is it an BULK endpoint? */
if ((ep_desc->bmAttributes &
USB_ENDPOINT_XFERTYPE_MASK) == USB_ENDPOINT_XFER_BULK) {
if (ep_desc->bEndpointAddress & USB_DIR_IN)
ss->ep_in = ep_desc->bEndpointAddress &
USB_ENDPOINT_NUMBER_MASK;