Skip to contentSkip to conversation

fix to usbfs_snoop logging of user defined control urbs

PATCH New Chris Frey 1 participant 1 message Dec 16, 2006 USB

lore
Share & tools
lore

Chris Frey

author
#0 lore raw

PATCH 1/1 fix to usbfs_snoop logging of user defined control urbs

Hi Greg KH,

According to a Linux Journal article, you were the original author of the usbfs_snoop patch, so I'm sending this patch to you.

When sending CONTROL URB's using the usual CONTROL ioctl, logging works fine, but when sending them via SUBMITURB, like VMWare does, the control fields are not logged. This patch fixes that.

I didn't see any major changes to devio.c recently, so this patch should apply cleanly to even the latest kernel. I can resubmit if it doesn't.

Take care,
- Chris

drivers/usb/core/devio.c +5 -1
diff -ru linux-2.6.18.1/drivers/usb/core/devio.c linux-2.6.18.1-cdf/drivers/usb/core/devio.c
@@ -950,7 +950,11 @@
 			kfree(dr);
 			return -EFAULT;
 		}
-		snoop(&ps->dev->dev, "control urb\n");
+		snoop(&ps->dev->dev, "control urb: bRequest=%02x "
+			"bRrequestType=%02x wValue=%04x "
+			"wIndex=%04x wLength=%04x\n",
+			dr->bRequest, dr->bRequestType, dr->wValue,
+			dr->wIndex, dr->wLength);
 		break;
 
 	case USBDEVFS_URB_TYPE_BULK: