diff options
author | David Gibson | 2017-06-06 09:42:26 +0200 |
---|---|---|
committer | David Gibson | 2017-06-08 06:38:26 +0200 |
commit | cd74d27e42f25e574195b0d3046acb33fd65b078 (patch) | |
tree | 3e74adbc85c00ee07b1512a04ce66d0d1917fe13 /include/hw/ppc/spapr_drc.h | |
parent | spapr: Clean up RTAS set-indicator (diff) | |
download | qemu-cd74d27e42f25e574195b0d3046acb33fd65b078.tar.gz qemu-cd74d27e42f25e574195b0d3046acb33fd65b078.tar.xz qemu-cd74d27e42f25e574195b0d3046acb33fd65b078.zip |
spapr: Clean up handling of DR-indicator
There are 3 types of "indicator" associated with hotplug in the PAPR spec
the "allocation state", "isolation state" and "DR-indicator". The first
two are intimately tied to the various state transitions associated with
hotplug. The DR-indicator, however, is different and simpler.
It's basically just a guest controlled variable which can be used by the
guest to flag state or problems associated with a device. The idea is that
the hypervisor can use it to present information back on management
consoles (on some machines with PowerVM it may even control physical LEDs
on the machine case associated with the relevant device).
For that reason, there's only ever likely to be a single update
implementation so the set_indicator_state method isn't useful. Replace it
with a direct function call.
While we're there, make some small associated cleanups:
* PAPR doesn't use the term "indicator state", just "DR-indicator" and
the allocation state and isolation state are also considered "indicators".
Rename things to be less confusing
* Fold set_indicator_state() and rtas_set_indicator_state() into a single
rtas_set_dr_indicator() function.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'include/hw/ppc/spapr_drc.h')
-rw-r--r-- | include/hw/ppc/spapr_drc.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/include/hw/ppc/spapr_drc.h b/include/hw/ppc/spapr_drc.h index f892b94156..70db573e80 100644 --- a/include/hw/ppc/spapr_drc.h +++ b/include/hw/ppc/spapr_drc.h @@ -125,7 +125,7 @@ typedef enum { } sPAPRDRAllocationState; /* - * LED/visual indicator state + * DR-indicator (LED/visual indicator) * * set via set-indicator RTAS calls * as documented by PAPR+ 2.7 13.5.3.4, Table 177, @@ -137,10 +137,10 @@ typedef enum { * action: (currently unused) */ typedef enum { - SPAPR_DR_INDICATOR_STATE_INACTIVE = 0, - SPAPR_DR_INDICATOR_STATE_ACTIVE = 1, - SPAPR_DR_INDICATOR_STATE_IDENTIFY = 2, - SPAPR_DR_INDICATOR_STATE_ACTION = 3, + SPAPR_DR_INDICATOR_INACTIVE = 0, + SPAPR_DR_INDICATOR_ACTIVE = 1, + SPAPR_DR_INDICATOR_IDENTIFY = 2, + SPAPR_DR_INDICATOR_ACTION = 3, } sPAPRDRIndicatorState; /* @@ -186,10 +186,12 @@ typedef struct sPAPRDRConnector { Object *owner; const char *name; + /* DR-indicator */ + uint32_t dr_indicator; + /* sensor/indicator states */ uint32_t isolation_state; uint32_t allocation_state; - uint32_t indicator_state; /* configure-connector state */ void *fdt; @@ -219,8 +221,6 @@ typedef struct sPAPRDRConnectorClass { /* accessors for guest-visible (generally via RTAS) DR state */ uint32_t (*set_isolation_state)(sPAPRDRConnector *drc, sPAPRDRIsolationState state); - uint32_t (*set_indicator_state)(sPAPRDRConnector *drc, - sPAPRDRIndicatorState state); uint32_t (*set_allocation_state)(sPAPRDRConnector *drc, sPAPRDRAllocationState state); const char *(*get_name)(sPAPRDRConnector *drc); |