summaryrefslogtreecommitdiff
path: root/include/hw
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2016-04-01 13:42:04 +0200
committerCornelia Huck <cornelia.huck@de.ibm.com>2016-06-14 13:34:50 +0200
commit06e686eaab344b1d38125e49abeb31a416428201 (patch)
tree1e90fe3dfbe9956b46698b8dc4ae56984454785f /include/hw
parentc1755b14fade16f02d3e10a487a03741a2f317ce (diff)
downloadqemu-06e686eaab344b1d38125e49abeb31a416428201.tar.gz
s390x/css: introduce property type for device ids
Let's introduce a CssDevId to handle device ids of the xx.x.xxxx type used for channel devices. This has some benefits: - We can use them in virtio-ccw and split the validity checks for a channel device id in general from the constraint checking within the virtio-ccw scope. - We can reuse the device id type for future non-virtio channel devices. While we're at it, improve the validity checks and disallow e.g. trailing characters. Suggested-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> Acked-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Dong Jia Shi <bjsdjshi@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'include/hw')
-rw-r--r--include/hw/s390x/css.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/hw/s390x/css.h b/include/hw/s390x/css.h
index 98b2e2cc79..38f4d77779 100644
--- a/include/hw/s390x/css.h
+++ b/include/hw/s390x/css.h
@@ -151,5 +151,22 @@ int css_do_rsch(SubchDev *sch);
int css_do_rchp(uint8_t cssid, uint8_t chpid);
bool css_present(uint8_t cssid);
#endif
+/*
+ * Identify a device within the channel subsystem.
+ * Note that this can be used to identify either the subchannel or
+ * the attached I/O device, as there's always one I/O device per
+ * subchannel.
+ */
+typedef struct CssDevId {
+ uint8_t cssid;
+ uint8_t ssid;
+ uint16_t devid;
+ bool valid;
+} CssDevId;
+
+extern PropertyInfo css_devid_propinfo;
+
+#define DEFINE_PROP_CSS_DEV_ID(_n, _s, _f) \
+ DEFINE_PROP(_n, _s, _f, css_devid_propinfo, CssDevId)
#endif