The device that implements this interface should on the invocation of any of the methods in this interface should do the following:
1. If the applicable Hot-Plug capability has been enabled, set the new value of the corresponding Hot-Plug event in the applicable register. 2. If the value changed from its previous value, set the changed register value for the applicable Hot-Plug event. 3. If the value changed from its previous value, notify software using an interrupt if notifications are enabled for the applicable Hot-Plug event and an interrupt mechanism has been configured by the software (MSI/MSI-X or PCI-compatible INTx Emulation).
The presence_change() method is called by the pcie-downstream-port (if its upstream target implements this interface) when it goes from having no adapter present to having an adapter present and vice versa.
SIM_INTERFACE(pcie_hotplug_events) { void (*presence_change)(conf_object_t *obj, pcie_hotplug_pd_t state); void (*power_fault)(conf_object_t *obj); void (*attention_button_pressed)(conf_object_t *obj); void (*mrl_sensor)(conf_object_t *obj, pcie_hotplug_mrl_t state); void (*data_link_layer)(conf_object_t *obj, bool is_active); }; #define PCIE_HOTPLUG_EVENTS_INTERFACE "pcie_hotplug_events"