nvme: move class code to pci_ids.h
Move toward collecting PCI IDs, class codes, etc. in pci_ids.h instead of individual device-specific headers. Change-Id: Icff162d48ac663db71d0576ceee16a9bd7a751cd Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
8332f9e47e
commit
7672976a6a
@ -44,15 +44,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* PCI class code for NVMe devices.
|
||||
*
|
||||
* Base class code 01h: mass storage
|
||||
* Subclass code 08h: non-volatile memory
|
||||
* Programming interface 02h: NVM Express
|
||||
*/
|
||||
#define NVME_CLASS_CODE 0x10802
|
||||
|
||||
/**
|
||||
* Use to mark a command to apply to all namespaces, or to retrieve global
|
||||
* log pages.
|
||||
|
@ -38,4 +38,13 @@
|
||||
|
||||
#define SPDK_PCI_VID_INTEL 0x8086
|
||||
|
||||
/**
|
||||
* PCI class code for NVMe devices.
|
||||
*
|
||||
* Base class code 01h: mass storage
|
||||
* Subclass code 08h: non-volatile memory
|
||||
* Programming interface 02h: NVM Express
|
||||
*/
|
||||
#define SPDK_PCI_CLASS_NVME 0x010802
|
||||
|
||||
#endif /* SPDK_PCI_IDS */
|
||||
|
@ -50,6 +50,7 @@
|
||||
#endif
|
||||
|
||||
#include "spdk/pci.h"
|
||||
#include "spdk/pci_ids.h"
|
||||
#include "spdk/nvme_spec.h"
|
||||
|
||||
/**
|
||||
@ -141,7 +142,7 @@ nvme_pci_enum_cb(void *enum_ctx, struct spdk_pci_device *pci_dev)
|
||||
{
|
||||
struct nvme_pci_enum_ctx *ctx = enum_ctx;
|
||||
|
||||
if (spdk_pci_device_get_class(pci_dev) != NVME_CLASS_CODE) {
|
||||
if (spdk_pci_device_get_class(pci_dev) != SPDK_PCI_CLASS_NVME) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -195,7 +196,7 @@ nvme_pcicfg_unmap_bar(void *devhandle, uint32_t bar, void *addr)
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: once DPDK supports matching class code instead of device ID, switch to NVME_CLASS_CODE
|
||||
* TODO: once DPDK supports matching class code instead of device ID, switch to SPDK_PCI_CLASS_NVME
|
||||
*/
|
||||
static struct rte_pci_id nvme_pci_driver_id[] = {
|
||||
{RTE_PCI_DEVICE(0x8086, 0x0953)},
|
||||
|
Loading…
Reference in New Issue
Block a user