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 /* transport-provided data: */
82 int (*ccw_cb
) (SubchDev
*, CCW1
);
87 typedef SubchDev
*(*css_subch_cb_func
)(uint8_t m
, uint8_t cssid
, uint8_t ssid
,
89 int css_create_css_image(uint8_t cssid
, bool default_image
);
90 bool css_devno_used(uint8_t cssid
, uint8_t ssid
, uint16_t devno
);
91 void css_subch_assign(uint8_t cssid
, uint8_t ssid
, uint16_t schid
,
92 uint16_t devno
, SubchDev
*sch
);
93 void css_sch_build_virtual_schib(SubchDev
*sch
, uint8_t chpid
, uint8_t type
);
94 uint16_t css_build_subchannel_id(SubchDev
*sch
);
96 void css_reset_sch(SubchDev
*sch
);
97 void css_queue_crw(uint8_t rsc
, uint8_t erc
, int chain
, uint16_t rsid
);
98 void css_generate_sch_crws(uint8_t cssid
, uint8_t ssid
, uint16_t schid
,
99 int hotplugged
, int add
);
100 void css_generate_chp_crws(uint8_t cssid
, uint8_t chpid
);
101 void css_adapter_interrupt(uint8_t isc
);