Jan Glauber | 779e6e1 | 2008-07-17 17:16:48 +0200 | [diff] [blame^] | 1 | /* |
| 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 |
| 64 | #define QDIO_DBF_SETUP_PAGES 4 |
| 65 | #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 |
| 71 | #define QDIO_DBF_TRACE_PAGES 16 |
| 72 | #define QDIO_DBF_SETUP_LEVEL 6 |
| 73 | #define QDIO_DBF_TRACE_LEVEL 4 |
| 74 | #else /* !CONFIG_QDIO_DEBUG */ |
| 75 | #define QDIO_DBF_TRACE_PAGES 4 |
| 76 | #define QDIO_DBF_SETUP_LEVEL 2 |
| 77 | #define QDIO_DBF_TRACE_LEVEL 2 |
| 78 | #endif /* CONFIG_QDIO_DEBUG */ |
| 79 | |
| 80 | extern debug_info_t *qdio_dbf_setup; |
| 81 | extern debug_info_t *qdio_dbf_trace; |
| 82 | |
| 83 | void qdio_allocate_do_dbf(struct qdio_initialize *init_data); |
| 84 | void debug_print_bstat(struct qdio_q *q); |
| 85 | void qdio_setup_debug_entries(struct qdio_irq *irq_ptr, |
| 86 | struct ccw_device *cdev); |
| 87 | void qdio_shutdown_debug_entries(struct qdio_irq *irq_ptr, |
| 88 | struct ccw_device *cdev); |
| 89 | int qdio_debug_init(void); |
| 90 | void qdio_debug_exit(void); |
| 91 | #endif |