summaryrefslogtreecommitdiffstats
path: root/doc/opal-api/opal-pci-set-power-state-121.rst
blob: 54c1a33ac2ff106badfc6554e769e0c831631045 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
OPAL_PCI_SET_POWER_STATE
========================

Set PCI slot power state

Parameters
----------

``uint64_t async_token``
  Token of asynchronous message to be sent
  on completion of OPAL_PCI_SLOT_POWER_{OFF, ON}. It is
  ignored when @data is OPAL_PCI_SLOT_{OFFLINE, ONLINE}.

``uint64_t id``
  PCI slot ID

``uint64_t data``
  memory buffer pointer for the power state which
  can be one of OPAL_PCI_SLOT_POWER_{OFF, ON, OFFLINE, ONLINE}.

Calling
-------

Set PCI slot's power state. The power state is stored in buffer pointed
by @data. The typical use is to hot add or remove adapters behind the
indicated PCI slot (by @id) in PCI hotplug path.

User will receive an asychronous message after calling the API. The message
contains the API completion status: event (Power off or on), device node's
phandle identifying the PCI slot, errcode (e.g. OPAL_SUCCESS). The API returns
OPAL_ASYNC_COMPLETION for the case.

The states OPAL_PCI_SLOT_OFFLINE and OPAL_PCI_SLOT_ONLINE are used for removing
or adding devices behind the slot. The device nodes in the device tree are
removed or added accordingly, without actually changing the slot's power state.
The API call will return OPAL_SUCCESS immediately and no further asynchronous
message will be sent.

Return Codes
------------

OPAL_SUCCESS
  PCI hotplug on the slot is completed successfully

OPAL_ASYNC_COMPLETION
  PCI hotplug needs further message to confirm

OPAL_PARAMETER
  The indicated PCI slot isn't found

OPAL_UNSUPPORTED
  Setting power state not supported on the PCI slot
OpenPOWER on IntegriCloud