1 | /*
|
---|
2 | ** Copyright 2012 by Kvaser AB, Mölndal, Sweden
|
---|
3 | ** http://www.kvaser.com
|
---|
4 | **
|
---|
5 | ** This software is dual licensed under the following two licenses:
|
---|
6 | ** BSD-new and GPLv2. You may use either one. See the included
|
---|
7 | ** COPYING file for details.
|
---|
8 | **
|
---|
9 | ** License: BSD-new
|
---|
10 | ** ===============================================================================
|
---|
11 | ** Redistribution and use in source and binary forms, with or without
|
---|
12 | ** modification, are permitted provided that the following conditions are met:
|
---|
13 | ** * Redistributions of source code must retain the above copyright
|
---|
14 | ** notice, this list of conditions and the following disclaimer.
|
---|
15 | ** * Redistributions in binary form must reproduce the above copyright
|
---|
16 | ** notice, this list of conditions and the following disclaimer in the
|
---|
17 | ** documentation and/or other materials provided with the distribution.
|
---|
18 | ** * Neither the name of the <organization> nor the
|
---|
19 | ** names of its contributors may be used to endorse or promote products
|
---|
20 | ** derived from this software without specific prior written permission.
|
---|
21 | **
|
---|
22 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
---|
23 | ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
---|
24 | ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
25 | ** DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
---|
26 | ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
---|
27 | ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
---|
28 | ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
29 | ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
30 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
---|
31 | ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
32 | **
|
---|
33 | **
|
---|
34 | ** License: GPLv2
|
---|
35 | ** ===============================================================================
|
---|
36 | ** This program is free software; you can redistribute it and/or
|
---|
37 | ** modify it under the terms of the GNU General Public License
|
---|
38 | ** as published by the Free Software Foundation; either version 2
|
---|
39 | ** of the License, or (at your option) any later version.
|
---|
40 | **
|
---|
41 | ** This program is distributed in the hope that it will be useful,
|
---|
42 | ** but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
43 | ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
44 | ** GNU General Public License for more details.
|
---|
45 | **
|
---|
46 | ** You should have received a copy of the GNU General Public License
|
---|
47 | ** along with this program; if not, write to the Free Software
|
---|
48 | ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
---|
49 | **
|
---|
50 | ** ---------------------------------------------------------------------------
|
---|
51 | **/
|
---|
52 |
|
---|
53 | #if !defined(DEBUG_H)
|
---|
54 | #define DEBUG_H
|
---|
55 |
|
---|
56 | //
|
---|
57 | // DEBUG
|
---|
58 | //
|
---|
59 | #if DEBUG
|
---|
60 |
|
---|
61 | # define ZONE_ERR 1
|
---|
62 | # define ZONE_WARN 1
|
---|
63 | # define ZONE_INIT 1
|
---|
64 | # define ZONE_TRACE 1
|
---|
65 |
|
---|
66 | # define ZONE_CAN_INIT 1
|
---|
67 | # define ZONE_CAN_READ 1
|
---|
68 | # define ZONE_CAN_WRITE 1
|
---|
69 | # define ZONE_CAN_IOCTL 1
|
---|
70 |
|
---|
71 | # define ZONE_USB_PARSE 1
|
---|
72 | # define ZONE_USB_INIT 1
|
---|
73 | # define ZONE_USB_CONTROL 1
|
---|
74 | # define ZONE_USB_BULK 1
|
---|
75 |
|
---|
76 | # define ZONE_J1587 1
|
---|
77 | //#define ZONE_USBCLIENT 0
|
---|
78 |
|
---|
79 | # else
|
---|
80 | # define ZONE_ERR 0
|
---|
81 | # define ZONE_WARN 0
|
---|
82 | # define ZONE_INIT 0
|
---|
83 | # define ZONE_TRACE 0
|
---|
84 |
|
---|
85 | # define ZONE_CAN_INIT 0
|
---|
86 | # define ZONE_CAN_READ 0
|
---|
87 | # define ZONE_CAN_WRITE 0
|
---|
88 | # define ZONE_CAN_IOCTL 0
|
---|
89 |
|
---|
90 | # define ZONE_USB_PARSE 0
|
---|
91 | # define ZONE_USB_INIT 0
|
---|
92 | # define ZONE_USB_CONTROL 0
|
---|
93 | # define ZONE_USB_BULK 0
|
---|
94 |
|
---|
95 | # define ZONE_J1587 0
|
---|
96 | # endif
|
---|
97 |
|
---|
98 | # define TXT(t) t
|
---|
99 | # define TXT2(t) t
|
---|
100 | # define DEBUGPRINTHELP(args...) args
|
---|
101 | # define DEBUGOUT(c, arg) if (c) \
|
---|
102 | printk("<" #c ">" DEBUGPRINTHELP arg)
|
---|
103 |
|
---|
104 | # if DEBUG
|
---|
105 | # define CompilerAssert(e) extern char _kvaser_compiler_assert_[(e)?1:-1]
|
---|
106 | # endif
|
---|
107 |
|
---|
108 | //----------------------------------------------------------------------------
|
---|
109 | //# endif
|
---|
110 | #endif
|
---|
111 |
|
---|