presence_change is called from the pci-bus when an device is added or removed from the bus. is_present is set to 1 when the device is added, and 0 when it is removed.
inject_power_fault can be used to simulate a power fault on the downport. It is never called automatically.
press_attention_button can be called to simulate the attention button being pressed. The switch can respond to this by e.g. raising an interrupt and setting appropriate status bits. It is never called automatically.
set_mrl_state is similar to attention_button_press but controls the Manually operated Retention Latch. Set locked to 1 to simulate it being locked/closed, and 0 to simulate it being unlocked/opened.
Finally, get_mrl_state returns the state of the Manually operated Retention Latch.
SIM_INTERFACE(pci_express_hotplug) { /* This is sent when a device is added or removed from the bus. */ void (*presence_change)(conf_object_t *dst, conf_object_t *NOTNULL src, int is_present); void (*inject_power_fault)(conf_object_t *obj); void (*press_attention_button)(conf_object_t *obj); void (*set_mrl_state)(conf_object_t *obj, int locked); int (*get_mrl_state)(conf_object_t *obj); }; #define PCI_EXPRESS_HOTPLUG_INTERFACE "pci_express_hotplug"