2 * Channel subsystem structures and definitions.
4 * Copyright 2012 IBM Corp.
5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
7 * This work is licensed under the terms of the GNU GPL, version 2 or (at
8 * your option) any later version. See the COPYING file in the top-level
17 /* Channel subsystem constants. */
18 #define MAX_SCHID 65535
20 #define MAX_CSSID 254 /* 255 is reserved */
31 typedef struct SenseId
{
33 uint8_t reserved
; /* always 0x'FF' */
34 uint16_t cu_type
; /* control unit type */
35 uint8_t cu_model
; /* control unit model */
36 uint16_t dev_type
; /* device type */
37 uint8_t dev_model
; /* device model */
38 uint8_t unused
; /* padding byte */
40 CIW ciw
[MAX_CIWS
]; /* variable # of CIWs */
41 } QEMU_PACKED SenseId
;
43 /* Channel measurements, from linux/drivers/s390/cio/cmf.c. */
45 uint16_t ssch_rsch_count
;
46 uint16_t sample_count
;
47 uint32_t device_connect_time
;
48 uint32_t function_pending_time
;
49 uint32_t device_disconnect_time
;
50 uint32_t control_unit_queuing_time
;
51 uint32_t device_active_only_time
;
56 uint32_t ssch_rsch_count
;
57 uint32_t sample_count
;
58 uint32_t device_connect_time
;
59 uint32_t function_pending_time
;
60 uint32_t device_disconnect_time
;
61 uint32_t control_unit_queuing_time
;
62 uint32_t device_active_only_time
;
63 uint32_t device_busy_time
;
64 uint32_t initial_command_response_time
;
69 /* channel-subsystem related things: */
75 uint8_t sense_data
[32];
81 uint8_t ccw_no_data_cnt
;
82 /* transport-provided data: */
83 int (*ccw_cb
) (SubchDev
*, CCW1
);
88 typedef SubchDev
*(*css_subch_cb_func
)(uint8_t m
, uint8_t cssid
, uint8_t ssid
,
90 void subch_device_save(SubchDev
*s
, QEMUFile
*f
);
91 int subch_device_load(SubchDev
*s
, QEMUFile
*f
);
92 int css_create_css_image(uint8_t cssid
, bool default_image
);
93 bool css_devno_used(uint8_t cssid
, uint8_t ssid
, uint16_t devno
);
94 void css_subch_assign(uint8_t cssid
, uint8_t ssid
, uint16_t schid
,
95 uint16_t devno
, SubchDev
*sch
);
96 void css_sch_build_virtual_schib(SubchDev
*sch
, uint8_t chpid
, uint8_t type
);
97 uint16_t css_build_subchannel_id(SubchDev
*sch
);
99 void css_reset_sch(SubchDev
*sch
);
100 void css_queue_crw(uint8_t rsc
, uint8_t erc
, int chain
, uint16_t rsid
);
101 void css_generate_sch_crws(uint8_t cssid
, uint8_t ssid
, uint16_t schid
,
102 int hotplugged
, int add
);
103 void css_generate_chp_crws(uint8_t cssid
, uint8_t chpid
);
104 void css_adapter_interrupt(uint8_t isc
);
106 #define CSS_IO_ADAPTER_VIRTIO 1
107 int css_register_io_adapter(uint8_t type
, uint8_t isc
, bool swap
,
108 bool maskable
, uint32_t *id
);