diff options
author | Yi Min Zhao <zyimin@linux.vnet.ibm.com> | 2016-01-27 16:05:26 +0800 |
---|---|---|
committer | Cornelia Huck <cornelia.huck@de.ibm.com> | 2016-03-01 12:15:28 +0100 |
commit | a28d8391e323ef586c44e9313826097f884eebc6 (patch) | |
tree | 16f83d31f7a36d0cc7ed380d03781d786bad04c9 /hw/s390x/css.h | |
parent | 99abd0d6f75109b58dbd662134d8d013999e1e8f (diff) |
s390x/css: introduce indicator refcounting interfaces
Currently, virtio-ccw uses its own interfaces to keep indicators mapped
just once even if the same address has been registered multiple times.
These interfaces fit the PCI use case as well. Therefore, move them to
css and make them generic interfaces.
Signed-off-by: Yi Min Zhao <zyimin@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Diffstat (limited to 'hw/s390x/css.h')
-rw-r--r-- | hw/s390x/css.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/s390x/css.h b/hw/s390x/css.h index a47937dee5..a320eea59c 100644 --- a/hw/s390x/css.h +++ b/hw/s390x/css.h @@ -12,6 +12,8 @@ #ifndef CSS_H #define CSS_H +#include "hw/s390x/adapter.h" +#include "hw/s390x/s390_flic.h" #include "ioinst.h" /* Channel subsystem constants. */ @@ -86,6 +88,18 @@ struct SubchDev { void *driver_data; }; +typedef struct IndAddr { + hwaddr addr; + uint64_t map; + unsigned long refcnt; + int len; + QTAILQ_ENTRY(IndAddr) sibling; +} IndAddr; + +IndAddr *get_indicator(hwaddr ind_addr, int len); +void release_indicator(AdapterInfo *adapter, IndAddr *indicator); +int map_indicator(AdapterInfo *adapter, IndAddr *indicator); + typedef SubchDev *(*css_subch_cb_func)(uint8_t m, uint8_t cssid, uint8_t ssid, uint16_t schid); void subch_device_save(SubchDev *s, QEMUFile *f); |