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:
Daniel Verkamp 2016-02-09 09:31:09 -07:00
parent 8332f9e47e
commit 7672976a6a
3 changed files with 12 additions and 11 deletions

View File

@ -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.

View File

@ -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 */

View File

@ -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)},