1ff20b0a3SYang Chen /* 2ff20b0a3SYang Chen * Emulated ccw-attached 3270 definitions 3ff20b0a3SYang Chen * 4ff20b0a3SYang Chen * Copyright 2017 IBM Corp. 5ff20b0a3SYang Chen * Author(s): Yang Chen <bjcyang@linux.vnet.ibm.com> 6ff20b0a3SYang Chen * Jing Liu <liujbjl@linux.vnet.ibm.com> 7ff20b0a3SYang Chen * 8ff20b0a3SYang Chen * This work is licensed under the terms of the GNU GPL, version 2 or (at 9ff20b0a3SYang Chen * your option) any later version. See the COPYING file in the top-level 10ff20b0a3SYang Chen * directory. 11ff20b0a3SYang Chen */ 12ff20b0a3SYang Chen 13ff20b0a3SYang Chen #ifndef HW_S390X_3270_CCW_H 14ff20b0a3SYang Chen #define HW_S390X_3270_CCW_H 15ff20b0a3SYang Chen 16ff20b0a3SYang Chen #include "hw/sysbus.h" 17ff20b0a3SYang Chen #include "hw/s390x/css.h" 18ff20b0a3SYang Chen #include "hw/s390x/ccw-device.h" 19db1015e9SEduardo Habkost #include "qom/object.h" 20ff20b0a3SYang Chen 21ff20b0a3SYang Chen #define EMULATED_CCW_3270_CU_TYPE 0x3270 22ff20b0a3SYang Chen #define EMULATED_CCW_3270_CHPID_TYPE 0x1a 23ff20b0a3SYang Chen 24ff20b0a3SYang Chen #define TYPE_EMULATED_CCW_3270 "emulated-ccw-3270" 252dc95b4cSJing Liu 262dc95b4cSJing Liu /* Local Channel Commands */ 272dc95b4cSJing Liu #define TC_WRITE 0x01 /* Write */ 282dc95b4cSJing Liu #define TC_RDBUF 0x02 /* Read buffer */ 292dc95b4cSJing Liu #define TC_EWRITE 0x05 /* Erase write */ 302dc95b4cSJing Liu #define TC_READMOD 0x06 /* Read modified */ 312dc95b4cSJing Liu #define TC_EWRITEA 0x0d /* Erase write alternate */ 322dc95b4cSJing Liu #define TC_WRITESF 0x11 /* Write structured field */ 332dc95b4cSJing Liu 34*a489d195SEduardo Habkost OBJECT_DECLARE_TYPE(EmulatedCcw3270Device, EmulatedCcw3270Class, EMULATED_CCW_3270) 35ff20b0a3SYang Chen 36db1015e9SEduardo Habkost struct EmulatedCcw3270Device { 37ff20b0a3SYang Chen CcwDevice parent_obj; 38db1015e9SEduardo Habkost }; 39ff20b0a3SYang Chen 40db1015e9SEduardo Habkost struct EmulatedCcw3270Class { 41ff20b0a3SYang Chen CCWDeviceClass parent_class; 42ff20b0a3SYang Chen 43ff20b0a3SYang Chen void (*init)(EmulatedCcw3270Device *, Error **); 441baa2eb0SHalil Pasic int (*read_payload_3270)(EmulatedCcw3270Device *); 451baa2eb0SHalil Pasic int (*write_payload_3270)(EmulatedCcw3270Device *, uint8_t); 46db1015e9SEduardo Habkost }; 47ff20b0a3SYang Chen 48ff20b0a3SYang Chen #endif 49