VMD driver public interface. More...
Macros | |
#define | MAX_VMD_TARGET 24 |
Enumerations | |
enum | spdk_vmd_led_state { SPDK_VMD_LED_STATE_OFF , SPDK_VMD_LED_STATE_IDENTIFY , SPDK_VMD_LED_STATE_FAULT , SPDK_VMD_LED_STATE_REBUILD , SPDK_VMD_LED_STATE_UNKNOWN } |
State of the LEDs. | |
Functions | |
int | spdk_vmd_init (void) |
Enumerate VMD devices and hook them into the spdk pci subsystem. | |
void | spdk_vmd_fini (void) |
Release any resources allocated by the VMD library via spdk_vmd_init(). | |
int | spdk_vmd_pci_device_list (struct spdk_pci_addr vmd_addr, struct spdk_pci_device *nvme_list) |
Returns a list of nvme devices found on the given vmd pci BDF. | |
int | spdk_vmd_set_led_state (struct spdk_pci_device *pci_device, enum spdk_vmd_led_state state) |
Sets the state of the LED on specified PCI device. | |
int | spdk_vmd_get_led_state (struct spdk_pci_device *pci_device, enum spdk_vmd_led_state *state) |
Retrieves the state of the LED on specified PCI device. | |
int | spdk_vmd_hotplug_monitor (void) |
Checks for hotplug/hotremove events of the devices behind the VMD. | |
int | spdk_vmd_remove_device (const struct spdk_pci_addr *addr) |
Removes a given device from the PCI subsystem simulating a hot-remove. | |
int | spdk_vmd_rescan (void) |
Forces a rescan of the devices behind the VMD. | |
VMD driver public interface.
int spdk_vmd_get_led_state | ( | struct spdk_pci_device * | pci_device, |
enum spdk_vmd_led_state * | state ) |
Retrieves the state of the LED on specified PCI device.
The device needs to be behind VMD.
pci_device | PCI device |
state | current LED state |
int spdk_vmd_hotplug_monitor | ( | void | ) |
Checks for hotplug/hotremove events of the devices behind the VMD.
Needs to be called periodically to detect them.
int spdk_vmd_init | ( | void | ) |
Enumerate VMD devices and hook them into the spdk pci subsystem.
int spdk_vmd_pci_device_list | ( | struct spdk_pci_addr | vmd_addr, |
struct spdk_pci_device * | nvme_list ) |
Returns a list of nvme devices found on the given vmd pci BDF.
vmd_addr | pci BDF of the vmd device to return end device list |
nvme_list | buffer of exactly MAX_VMD_TARGET to return spdk_pci_device array. |
int spdk_vmd_remove_device | ( | const struct spdk_pci_addr * | addr | ) |
Removes a given device from the PCI subsystem simulating a hot-remove.
If the device is being actively used by another module, the actual detach might be deferred.
addr | Address of a PCI device to remove. |
int spdk_vmd_rescan | ( | void | ) |
Forces a rescan of the devices behind the VMD.
If a device was previously removed through spdk_vmd_remove_device() this will cause it to be reattached.
int spdk_vmd_set_led_state | ( | struct spdk_pci_device * | pci_device, |
enum spdk_vmd_led_state | state ) |
Sets the state of the LED on specified PCI device.
The device needs to be behind VMD.
pci_device | PCI device |
state | LED state to set |