aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/ozwpan/ozevent.h
diff options
context:
space:
mode:
authorChris Kelly <ckelly@ozmodevices.com>2012-02-20 21:12:27 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-02-24 09:26:52 -0800
commit56ff32fe1cf24d624ca4a68a409753fb3fd593f6 (patch)
tree0f5957cb5bf884966ee11f51b272b236355f6813 /drivers/staging/ozwpan/ozevent.h
parent23af8c2a088fe5ae142103fb32fa03755cda694c (diff)
staging: ozwpan: Added event logging support
The event logging subsystem allows internal events in the driver to be logged. This facilitates testing the correct operation of the driver. This subsystem is optional and can be switched out at compile time. Signed-off-by: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ozwpan/ozevent.h')
-rw-r--r--drivers/staging/ozwpan/ozevent.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/staging/ozwpan/ozevent.h b/drivers/staging/ozwpan/ozevent.h
new file mode 100644
index 00000000000..f033d014c6f
--- /dev/null
+++ b/drivers/staging/ozwpan/ozevent.h
@@ -0,0 +1,31 @@
+/* -----------------------------------------------------------------------------
+ * Copyright (c) 2011 Ozmo Inc
+ * Released under the GNU General Public License Version 2 (GPLv2).
+ * -----------------------------------------------------------------------------
+ */
+#ifndef _OZEVENT_H
+#define _OZEVENT_H
+#include "ozconfig.h"
+#include "ozeventdef.h"
+
+#ifdef WANT_EVENT_TRACE
+extern unsigned long g_evt_mask;
+void oz_event_init(void);
+void oz_event_term(void);
+void oz_event_log2(u8 evt, u8 ctx1, u16 ctx2, void *ctx3, unsigned ctx4);
+#define oz_event_log(__evt, __ctx1, __ctx2, __ctx3, __ctx4) \
+ do { \
+ if ((1<<(__evt)) & g_evt_mask) \
+ oz_event_log2(__evt, __ctx1, __ctx2, __ctx3, __ctx4); \
+ } while (0)
+int oz_events_copy(struct oz_evtlist __user *lst);
+void oz_events_clear(void);
+#else
+#define oz_event_init()
+#define oz_event_term()
+#define oz_event_log(__evt, __ctx1, __ctx2, __ctx3, __ctx4)
+#define oz_events_copy(__lst)
+#define oz_events_clear()
+#endif /* WANT_EVENT_TRACE */
+
+#endif /* _OZEVENT_H */