Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 22 Mar 2009 04:19:36 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r190238 - head/sys/dev/usb
Message-ID:  <200903220419.n2M4JaZo056395@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Sun Mar 22 04:19:36 2009
New Revision: 190238
URL: http://svn.freebsd.org/changeset/base/190238

Log:
  Improve debugging output around ioctls.

Modified:
  head/sys/dev/usb/usb_dev.c

Modified: head/sys/dev/usb/usb_dev.c
==============================================================================
--- head/sys/dev/usb/usb_dev.c	Sun Mar 22 02:33:48 2009	(r190237)
+++ head/sys/dev/usb/usb_dev.c	Sun Mar 22 04:19:36 2009	(r190238)
@@ -821,7 +821,7 @@ usb2_open(struct cdev *dev, int fflags, 
 	struct usb2_cdev_privdata *cpd;
 	int err, ep;
 
-	DPRINTFN(2, "fflags=0x%08x\n", fflags);
+	DPRINTFN(2, "%s fflags=0x%08x\n", dev->si_name, fflags);
 
 	KASSERT(fflags & (FREAD|FWRITE), ("invalid open flags"));
 	if (((fflags & FREAD) && !(pd->mode & FREAD)) ||
@@ -990,6 +990,7 @@ usb2_ioctl_f_sub(struct usb2_fifo *f, u_
 	default:
 		return (ENOIOCTL);
 	}
+	DPRINTFN(3, "cmd 0x%lx = %d\n", cmd, error);
 	return (error);
 }
 
@@ -1004,6 +1005,8 @@ usb2_ioctl(struct cdev *dev, u_long cmd,
 	int fflags;
 	int err;
 
+	DPRINTFN(2, "cmd=0x%lx\n", cmd);
+
 	err = devfs_get_cdevpriv((void **)&cpd);
 	if (err != 0)
 		return (err);
@@ -1019,8 +1022,6 @@ usb2_ioctl(struct cdev *dev, u_long cmd,
 	}
 	fflags = cpd->fflags;
 
-	DPRINTFN(2, "fflags=%u, cmd=0x%lx\n", fflags, cmd);
-
 	f = NULL;			/* set default value */
 	err = ENOIOCTL;			/* set default value */
 
@@ -1035,12 +1036,14 @@ usb2_ioctl(struct cdev *dev, u_long cmd,
 	KASSERT(f != NULL, ("fifo not found"));
 	if (err == ENOIOCTL) {
 		err = (f->methods->f_ioctl) (f, cmd, addr, fflags);
+		DPRINTFN(2, "f_ioctl cmd 0x%lx = %d\n", cmd, err);
 		if (err == ENOIOCTL) {
 			if (usb2_uref_location(cpd)) {
 				err = ENXIO;
 				goto done;
 			}
 			err = (f->methods->f_ioctl_post) (f, cmd, addr, fflags);
+			DPRINTFN(2, "f_ioctl_post cmd 0x%lx = %d\n", cmd, err);
 		}
 	}
 	if (err == ENOIOCTL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903220419.n2M4JaZo056395>