Deleted Added
full compact
1/* $FreeBSD: head/sys/dev/usb/usb_debug.h 190749 2009-04-05 21:24:15Z piso $ */
1/* $FreeBSD: head/sys/dev/usb/usb_debug.h 192502 2009-05-21 01:48:42Z thompsa $ */
2/*-
3 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27/* This file contains various factored out debug macros. */
28
29#ifndef _USB2_DEBUG_H_
30#define _USB2_DEBUG_H_
31
32/* Declare parent SYSCTL USB node. */
33SYSCTL_DECL(_hw_usb2);
33SYSCTL_DECL(_hw_usb);
34
35/* Declare global USB debug variable. */
36extern int usb2_debug;
37
38/* Check if USB debugging is enabled. */
39#ifdef USB_DEBUG_VAR
40#if (USB_DEBUG != 0)
41#define DPRINTFN(n,fmt,...) do { \
42 if ((USB_DEBUG_VAR) >= (n)) { \
43 printf("%s:%u: " fmt, \
44 __FUNCTION__, __LINE__,## __VA_ARGS__); \
45 } \
46} while (0)
47#define DPRINTF(...) DPRINTFN(1, __VA_ARGS__)
48#else
49#define DPRINTF(...) do { } while (0)
50#define DPRINTFN(...) do { } while (0)
51#endif
52#endif
53
54struct usb2_interface;
55struct usb2_device;
56struct usb2_pipe;
57struct usb2_xfer;
58
59void usb2_dump_iface(struct usb2_interface *iface);
60void usb2_dump_device(struct usb2_device *udev);
61void usb2_dump_queue(struct usb2_pipe *pipe);
62void usb2_dump_pipe(struct usb2_pipe *pipe);
63void usb2_dump_xfer(struct usb2_xfer *xfer);
64
65#endif /* _USB2_DEBUG_H_ */