aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2017-01-26 17:33:39 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2017-06-02 11:33:52 +0400
commit7566c6efe75572c63a8841fc09d0a8935b188c2f (patch)
treeae2db83931156b4b8a89ccaea0044d972e481c5d /include
parent8228e353d8906bf43399ca0ef28446c5c48bb686 (diff)
chardev: serial & parallel declaration to own headers
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'include')
-rw-r--r--include/chardev/char-parallel.h20
-rw-r--r--include/chardev/char-serial.h22
-rw-r--r--include/chardev/char.h36
3 files changed, 41 insertions, 37 deletions
diff --git a/include/chardev/char-parallel.h b/include/chardev/char-parallel.h
index 26742f9d5c..3284a1b96b 100644
--- a/include/chardev/char-parallel.h
+++ b/include/chardev/char-parallel.h
@@ -24,9 +24,27 @@
#ifndef CHAR_PARALLEL_H
#define CHAR_PARALLEL_H
-#if defined(__linux__) || defined(__FreeBSD__) || \
+#include "chardev/char.h"
+
+#if defined(__linux__) || defined(__FreeBSD__) || \
defined(__FreeBSD_kernel__) || defined(__DragonFly__)
#define HAVE_CHARDEV_PARPORT 1
#endif
+#define CHR_IOCTL_PP_READ_DATA 3
+#define CHR_IOCTL_PP_WRITE_DATA 4
+#define CHR_IOCTL_PP_READ_CONTROL 5
+#define CHR_IOCTL_PP_WRITE_CONTROL 6
+#define CHR_IOCTL_PP_READ_STATUS 7
+#define CHR_IOCTL_PP_EPP_READ_ADDR 8
+#define CHR_IOCTL_PP_EPP_READ 9
+#define CHR_IOCTL_PP_EPP_WRITE_ADDR 10
+#define CHR_IOCTL_PP_EPP_WRITE 11
+#define CHR_IOCTL_PP_DATA_DIR 12
+
+struct ParallelIOArg {
+ void *buffer;
+ int count;
+};
+
#endif /* CHAR_PARALLEL_H */
diff --git a/include/chardev/char-serial.h b/include/chardev/char-serial.h
index 64a27f63b1..cb2e59e82a 100644
--- a/include/chardev/char-serial.h
+++ b/include/chardev/char-serial.h
@@ -24,6 +24,8 @@
#ifndef CHAR_SERIAL_H
#define CHAR_SERIAL_H
+#include "chardev/char.h"
+
#ifdef _WIN32
#define HAVE_CHARDEV_SERIAL 1
#elif defined(__linux__) || defined(__sun__) || defined(__FreeBSD__) \
@@ -32,4 +34,24 @@
#define HAVE_CHARDEV_SERIAL 1
#endif
+#define CHR_IOCTL_SERIAL_SET_PARAMS 1
+typedef struct {
+ int speed;
+ int parity;
+ int data_bits;
+ int stop_bits;
+} QEMUSerialSetParams;
+
+#define CHR_IOCTL_SERIAL_SET_BREAK 2
+
+#define CHR_IOCTL_SERIAL_SET_TIOCM 13
+#define CHR_IOCTL_SERIAL_GET_TIOCM 14
+
+#define CHR_TIOCM_CTS 0x020
+#define CHR_TIOCM_CAR 0x040
+#define CHR_TIOCM_DSR 0x100
+#define CHR_TIOCM_RI 0x080
+#define CHR_TIOCM_DTR 0x002
+#define CHR_TIOCM_RTS 0x004
+
#endif
diff --git a/include/chardev/char.h b/include/chardev/char.h
index fffc0f40d4..95273e10ae 100644
--- a/include/chardev/char.h
+++ b/include/chardev/char.h
@@ -27,42 +27,6 @@ typedef enum {
#define CHR_READ_BUF_LEN 4096
-#define CHR_IOCTL_SERIAL_SET_PARAMS 1
-typedef struct {
- int speed;
- int parity;
- int data_bits;
- int stop_bits;
-} QEMUSerialSetParams;
-
-#define CHR_IOCTL_SERIAL_SET_BREAK 2
-
-#define CHR_IOCTL_PP_READ_DATA 3
-#define CHR_IOCTL_PP_WRITE_DATA 4
-#define CHR_IOCTL_PP_READ_CONTROL 5
-#define CHR_IOCTL_PP_WRITE_CONTROL 6
-#define CHR_IOCTL_PP_READ_STATUS 7
-#define CHR_IOCTL_PP_EPP_READ_ADDR 8
-#define CHR_IOCTL_PP_EPP_READ 9
-#define CHR_IOCTL_PP_EPP_WRITE_ADDR 10
-#define CHR_IOCTL_PP_EPP_WRITE 11
-#define CHR_IOCTL_PP_DATA_DIR 12
-
-struct ParallelIOArg {
- void *buffer;
- int count;
-};
-
-#define CHR_IOCTL_SERIAL_SET_TIOCM 13
-#define CHR_IOCTL_SERIAL_GET_TIOCM 14
-
-#define CHR_TIOCM_CTS 0x020
-#define CHR_TIOCM_CAR 0x040
-#define CHR_TIOCM_DSR 0x100
-#define CHR_TIOCM_RI 0x080
-#define CHR_TIOCM_DTR 0x002
-#define CHR_TIOCM_RTS 0x004
-
typedef void IOEventHandler(void *opaque, int event);
typedef enum {