1066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly/* ----------------------------------------------------------------------------- 2066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly * Copyright (c) 2011 Ozmo Inc 3066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly * Released under the GNU General Public License Version 2 (GPLv2). 4066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly * ----------------------------------------------------------------------------- 5066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly */ 6066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#ifndef _OZTRACE_H_ 7066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define _OZTRACE_H_ 8066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#include "ozconfig.h" 9066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly 10066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define TRACE_PREFIX KERN_ALERT "OZWPAN: " 11066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly 12066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#ifdef WANT_TRACE 13066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define oz_trace(...) printk(TRACE_PREFIX __VA_ARGS__) 14066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#ifdef WANT_VERBOSE_TRACE 15066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kellyextern unsigned long trace_flags; 16066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define oz_trace2(_flag, ...) \ 17066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly do { if (trace_flags & _flag) printk(TRACE_PREFIX __VA_ARGS__); \ 18066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly } while (0) 19066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#else 20066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define oz_trace2(...) 21066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#endif /* #ifdef WANT_VERBOSE_TRACE */ 22066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#else 23066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define oz_trace(...) 24066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define oz_trace2(...) 25066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#endif /* #ifdef WANT_TRACE */ 26066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly 27066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define OZ_TRACE_STREAM 0x1 28066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define OZ_TRACE_URB 0x2 29066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define OZ_TRACE_CTRL_DETAIL 0x4 30066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define OZ_TRACE_HUB 0x8 31066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define OZ_TRACE_RX_FRAMES 0x10 32066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#define OZ_TRACE_TX_FRAMES 0x20 33066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly 34066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly#endif /* Sentry */ 35066b2229410f2f58fa91baedd22b4dcf048e28ddChris Kelly 36