1 /* SPDX-License-Identifier: GPL-2.0 */
3 * interface to the SCLP-read/write driver
5 * Copyright IBM Corporation 1999, 2009
7 * Author(s): Martin Peschke <mpeschke@de.ibm.com>
8 * Martin Schwidefsky <schwidefsky@de.ibm.com>
14 #include <linux/list.h>
22 } __attribute__((packed
));
33 u16 general_msg_flags
;
35 u8 originating_system_name
[8];
37 } __attribute__((packed
));
44 } __attribute__((packed
));
47 struct mdb_header header
;
50 } __attribute__((packed
));
53 struct evbuf_header header
;
55 } __attribute__((packed
));
57 /* The number of empty mto buffers that can be contained in a single sccb. */
58 #define NR_EMPTY_MSG_PER_SCCB ((PAGE_SIZE - sizeof(struct sclp_buffer) - \
59 sizeof(struct sccb_header)) / sizeof(struct msg_buf))
62 * data structure for information about list of SCCBs (only for writing),
63 * will be located at the end of a SCCBs page
66 struct list_head list
; /* list_head for sccb_info chain */
67 struct sclp_req request
;
69 struct msg_buf
*current_msg
;
73 /* output format settings */
74 unsigned short columns
;
76 /* statistics about this buffer */
77 unsigned int char_sum
; /* # chars in sccb */
78 unsigned int messages
; /* # messages in sccb */
79 /* Callback that is called after reaching final status. */
80 void (*callback
)(struct sclp_buffer
*, int);
83 int sclp_rw_init(void);
84 struct sclp_buffer
*sclp_make_buffer(void *, unsigned short, unsigned short);
85 void *sclp_unmake_buffer(struct sclp_buffer
*);
86 int sclp_buffer_space(struct sclp_buffer
*);
87 int sclp_write(struct sclp_buffer
*buffer
, const unsigned char *, int);
88 int sclp_emit_buffer(struct sclp_buffer
*,void (*)(struct sclp_buffer
*,int));
89 void sclp_set_columns(struct sclp_buffer
*, unsigned short);
90 void sclp_set_htab(struct sclp_buffer
*, unsigned short);
91 int sclp_chars_in_buffer(struct sclp_buffer
*);
93 #ifdef CONFIG_SCLP_CONSOLE
94 void sclp_console_pm_event(enum sclp_pm_event sclp_pm_event
);
96 static inline void sclp_console_pm_event(enum sclp_pm_event sclp_pm_event
) { }
99 #endif /* __SCLP_RW_H__ */