2 * Copyright IBM Corp. 2008
4 * Author: Jan Glauber (jang@linux.vnet.ibm.com)
13 /* that gives us 15 characters in the text event views */
14 #define QDIO_DBF_LEN 16
16 extern debug_info_t
*qdio_dbf_setup
;
17 extern debug_info_t
*qdio_dbf_error
;
19 #define DBF_ERR 3 /* error conditions */
20 #define DBF_WARN 4 /* warning conditions */
21 #define DBF_INFO 6 /* informational */
27 #define DBF_EVENT(text...) \
29 char debug_buffer[QDIO_DBF_LEN]; \
30 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
31 debug_text_event(qdio_dbf_setup, DBF_ERR, debug_buffer); \
34 static inline void DBF_HEX(void *addr
, int len
)
37 debug_event(qdio_dbf_setup
, DBF_ERR
, addr
, len
);
38 len
-= qdio_dbf_setup
->buf_size
;
39 addr
+= qdio_dbf_setup
->buf_size
;
43 #define DBF_ERROR(text...) \
45 char debug_buffer[QDIO_DBF_LEN]; \
46 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
47 debug_text_event(qdio_dbf_error, DBF_ERR, debug_buffer); \
50 static inline void DBF_ERROR_HEX(void *addr
, int len
)
53 debug_event(qdio_dbf_error
, DBF_ERR
, addr
, len
);
54 len
-= qdio_dbf_error
->buf_size
;
55 addr
+= qdio_dbf_error
->buf_size
;
59 #define DBF_DEV_EVENT(level, device, text...) \
61 char debug_buffer[QDIO_DBF_LEN]; \
62 if (debug_level_enabled(device->debug_area, level)) { \
63 snprintf(debug_buffer, QDIO_DBF_LEN, text); \
64 debug_text_event(device->debug_area, level, debug_buffer); \
68 static inline void DBF_DEV_HEX(struct qdio_irq
*dev
, void *addr
,
72 debug_event(dev
->debug_area
, level
, addr
, len
);
73 len
-= dev
->debug_area
->buf_size
;
74 addr
+= dev
->debug_area
->buf_size
;
78 int qdio_allocate_dbf(struct qdio_initialize
*init_data
,
79 struct qdio_irq
*irq_ptr
);
80 void qdio_setup_debug_entries(struct qdio_irq
*irq_ptr
,
81 struct ccw_device
*cdev
);
82 void qdio_shutdown_debug_entries(struct qdio_irq
*irq_ptr
);
83 int qdio_debug_init(void);
84 void qdio_debug_exit(void);