mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-14 00:43:36 +00:00
s390x/css: Add a callback for when subchannel gets disabled
We need a possibility to run code when a subchannel gets disabled. This patch adds the necessary infrastructure. Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
6e7cd94462
commit
62ac4a52e2
@ -588,6 +588,7 @@ int css_do_msch(SubchDev *sch, const SCHIB *orig_schib)
|
|||||||
{
|
{
|
||||||
SCSW *s = &sch->curr_status.scsw;
|
SCSW *s = &sch->curr_status.scsw;
|
||||||
PMCW *p = &sch->curr_status.pmcw;
|
PMCW *p = &sch->curr_status.pmcw;
|
||||||
|
uint16_t oldflags;
|
||||||
int ret;
|
int ret;
|
||||||
SCHIB schib;
|
SCHIB schib;
|
||||||
|
|
||||||
@ -610,6 +611,7 @@ int css_do_msch(SubchDev *sch, const SCHIB *orig_schib)
|
|||||||
copy_schib_from_guest(&schib, orig_schib);
|
copy_schib_from_guest(&schib, orig_schib);
|
||||||
/* Only update the program-modifiable fields. */
|
/* Only update the program-modifiable fields. */
|
||||||
p->intparm = schib.pmcw.intparm;
|
p->intparm = schib.pmcw.intparm;
|
||||||
|
oldflags = p->flags;
|
||||||
p->flags &= ~(PMCW_FLAGS_MASK_ISC | PMCW_FLAGS_MASK_ENA |
|
p->flags &= ~(PMCW_FLAGS_MASK_ISC | PMCW_FLAGS_MASK_ENA |
|
||||||
PMCW_FLAGS_MASK_LM | PMCW_FLAGS_MASK_MME |
|
PMCW_FLAGS_MASK_LM | PMCW_FLAGS_MASK_MME |
|
||||||
PMCW_FLAGS_MASK_MP);
|
PMCW_FLAGS_MASK_MP);
|
||||||
@ -625,6 +627,12 @@ int css_do_msch(SubchDev *sch, const SCHIB *orig_schib)
|
|||||||
(PMCW_CHARS_MASK_MBFC | PMCW_CHARS_MASK_CSENSE);
|
(PMCW_CHARS_MASK_MBFC | PMCW_CHARS_MASK_CSENSE);
|
||||||
sch->curr_status.mba = schib.mba;
|
sch->curr_status.mba = schib.mba;
|
||||||
|
|
||||||
|
/* Has the channel been disabled? */
|
||||||
|
if (sch->disable_cb && (oldflags & PMCW_FLAGS_MASK_ENA) != 0
|
||||||
|
&& (p->flags & PMCW_FLAGS_MASK_ENA) == 0) {
|
||||||
|
sch->disable_cb(sch);
|
||||||
|
}
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
@ -1498,6 +1506,10 @@ void css_reset_sch(SubchDev *sch)
|
|||||||
{
|
{
|
||||||
PMCW *p = &sch->curr_status.pmcw;
|
PMCW *p = &sch->curr_status.pmcw;
|
||||||
|
|
||||||
|
if ((p->flags & PMCW_FLAGS_MASK_ENA) != 0 && sch->disable_cb) {
|
||||||
|
sch->disable_cb(sch);
|
||||||
|
}
|
||||||
|
|
||||||
p->intparm = 0;
|
p->intparm = 0;
|
||||||
p->flags &= ~(PMCW_FLAGS_MASK_ISC | PMCW_FLAGS_MASK_ENA |
|
p->flags &= ~(PMCW_FLAGS_MASK_ISC | PMCW_FLAGS_MASK_ENA |
|
||||||
PMCW_FLAGS_MASK_LM | PMCW_FLAGS_MASK_MME |
|
PMCW_FLAGS_MASK_LM | PMCW_FLAGS_MASK_MME |
|
||||||
|
@ -81,6 +81,7 @@ struct SubchDev {
|
|||||||
uint8_t ccw_no_data_cnt;
|
uint8_t ccw_no_data_cnt;
|
||||||
/* transport-provided data: */
|
/* transport-provided data: */
|
||||||
int (*ccw_cb) (SubchDev *, CCW1);
|
int (*ccw_cb) (SubchDev *, CCW1);
|
||||||
|
void (*disable_cb)(SubchDev *);
|
||||||
SenseId id;
|
SenseId id;
|
||||||
void *driver_data;
|
void *driver_data;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user