blob: 5a4d85b829adf11884f92cac93f9317b7ad4c064 [file] [log] [blame]
Jan Glauber779e6e12008-07-17 17:16:48 +02001/*
2 * drivers/s390/cio/qdio_debug.h
3 *
4 * Copyright IBM Corp. 2008
5 *
6 * Author: Jan Glauber (jang@linux.vnet.ibm.com)
7 */
8#ifndef QDIO_DEBUG_H
9#define QDIO_DEBUG_H
10
11#include <asm/debug.h>
12#include <asm/qdio.h>
13#include "qdio.h"
14
15#define QDIO_DBF_HEX(ex, name, level, addr, len) \
16 do { \
17 if (ex) \
18 debug_exception(qdio_dbf_##name, level, (void *)(addr), len); \
19 else \
20 debug_event(qdio_dbf_##name, level, (void *)(addr), len); \
21 } while (0)
22#define QDIO_DBF_TEXT(ex, name, level, text) \
23 do { \
24 if (ex) \
25 debug_text_exception(qdio_dbf_##name, level, text); \
26 else \
27 debug_text_event(qdio_dbf_##name, level, text); \
28 } while (0)
29
30#define QDIO_DBF_HEX0(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 0, addr, len)
31#define QDIO_DBF_HEX1(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 1, addr, len)
32#define QDIO_DBF_HEX2(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 2, addr, len)
33
34#ifdef CONFIG_QDIO_DEBUG
35#define QDIO_DBF_HEX3(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 3, addr, len)
36#define QDIO_DBF_HEX4(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 4, addr, len)
37#define QDIO_DBF_HEX5(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 5, addr, len)
38#define QDIO_DBF_HEX6(ex, name, addr, len) QDIO_DBF_HEX(ex, name, 6, addr, len)
39#else
40#define QDIO_DBF_HEX3(ex, name, addr, len) do {} while (0)
41#define QDIO_DBF_HEX4(ex, name, addr, len) do {} while (0)
42#define QDIO_DBF_HEX5(ex, name, addr, len) do {} while (0)
43#define QDIO_DBF_HEX6(ex, name, addr, len) do {} while (0)
44#endif /* CONFIG_QDIO_DEBUG */
45
46#define QDIO_DBF_TEXT0(ex, name, text) QDIO_DBF_TEXT(ex, name, 0, text)
47#define QDIO_DBF_TEXT1(ex, name, text) QDIO_DBF_TEXT(ex, name, 1, text)
48#define QDIO_DBF_TEXT2(ex, name, text) QDIO_DBF_TEXT(ex, name, 2, text)
49
50#ifdef CONFIG_QDIO_DEBUG
51#define QDIO_DBF_TEXT3(ex, name, text) QDIO_DBF_TEXT(ex, name, 3, text)
52#define QDIO_DBF_TEXT4(ex, name, text) QDIO_DBF_TEXT(ex, name, 4, text)
53#define QDIO_DBF_TEXT5(ex, name, text) QDIO_DBF_TEXT(ex, name, 5, text)
54#define QDIO_DBF_TEXT6(ex, name, text) QDIO_DBF_TEXT(ex, name, 6, text)
55#else
56#define QDIO_DBF_TEXT3(ex, name, text) do {} while (0)
57#define QDIO_DBF_TEXT4(ex, name, text) do {} while (0)
58#define QDIO_DBF_TEXT5(ex, name, text) do {} while (0)
59#define QDIO_DBF_TEXT6(ex, name, text) do {} while (0)
60#endif /* CONFIG_QDIO_DEBUG */
61
62/* s390dbf views */
63#define QDIO_DBF_SETUP_LEN 8
Jan Glauber58eb27c2008-08-21 19:46:34 +020064#define QDIO_DBF_SETUP_PAGES 8
Jan Glauber779e6e12008-07-17 17:16:48 +020065#define QDIO_DBF_SETUP_NR_AREAS 1
66
67#define QDIO_DBF_TRACE_LEN 8
68#define QDIO_DBF_TRACE_NR_AREAS 2
69
70#ifdef CONFIG_QDIO_DEBUG
Jan Glauber58eb27c2008-08-21 19:46:34 +020071#define QDIO_DBF_TRACE_PAGES 32
Jan Glauber779e6e12008-07-17 17:16:48 +020072#define QDIO_DBF_SETUP_LEVEL 6
73#define QDIO_DBF_TRACE_LEVEL 4
74#else /* !CONFIG_QDIO_DEBUG */
Jan Glauber58eb27c2008-08-21 19:46:34 +020075#define QDIO_DBF_TRACE_PAGES 8
Jan Glauber779e6e12008-07-17 17:16:48 +020076#define QDIO_DBF_SETUP_LEVEL 2
77#define QDIO_DBF_TRACE_LEVEL 2
78#endif /* CONFIG_QDIO_DEBUG */
79
80extern debug_info_t *qdio_dbf_setup;
81extern debug_info_t *qdio_dbf_trace;
82
83void qdio_allocate_do_dbf(struct qdio_initialize *init_data);
84void debug_print_bstat(struct qdio_q *q);
85void qdio_setup_debug_entries(struct qdio_irq *irq_ptr,
86 struct ccw_device *cdev);
87void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr,
88 struct ccw_device *cdev);
89int qdio_debug_init(void);
90void qdio_debug_exit(void);
91#endif