summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2015-05-14 21:29:42 +0000
committerjimharris <jimharris@FreeBSD.org>2015-05-14 21:29:42 +0000
commit59dfcd2defc8976459cda6f6ef112d9e1db87bfd (patch)
tree13283bebe38e6d0621d52d8fd227364eb3dc0c6e /sys
parentaec45f097e50ea0c6c2a25cad73415fe294b5e4a (diff)
downloadFreeBSD-src-59dfcd2defc8976459cda6f6ef112d9e1db87bfd.zip
FreeBSD-src-59dfcd2defc8976459cda6f6ef112d9e1db87bfd.tar.gz
MFC r281282:
nvme: add device strings for Intel DC series NVMe SSDs Sponsored by: Intel
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/nvme/nvme.c48
1 files changed, 38 insertions, 10 deletions
diff --git a/sys/dev/nvme/nvme.c b/sys/dev/nvme/nvme.c
index 464d851..4a085aa 100644
--- a/sys/dev/nvme/nvme.c
+++ b/sys/dev/nvme/nvme.c
@@ -81,27 +81,55 @@ MODULE_VERSION(nvme, 1);
static struct _pcsid
{
- u_int32_t type;
- const char *desc;
+ uint32_t devid;
+ int match_subdevice;
+ uint16_t subdevice;
+ const char *desc;
} pci_ids[] = {
- { 0x01118086, "NVMe Controller" },
- { CHATHAM_PCI_ID, "Chatham Prototype NVMe Controller" },
- { IDT32_PCI_ID, "IDT NVMe Controller (32 channel)" },
- { IDT8_PCI_ID, "IDT NVMe Controller (8 channel)" },
- { 0x00000000, NULL }
+ { 0x01118086, 0, 0, "NVMe Controller" },
+ { CHATHAM_PCI_ID, 0, 0, "Chatham Prototype NVMe Controller" },
+ { IDT32_PCI_ID, 0, 0, "IDT NVMe Controller (32 channel)" },
+ { IDT8_PCI_ID, 0, 0, "IDT NVMe Controller (8 channel)" },
+ { 0x09538086, 1, 0x3702, "DC P3700 SSD" },
+ { 0x09538086, 1, 0x3703, "DC P3700 SSD [2.5\" SFF]" },
+ { 0x09538086, 1, 0x3704, "DC P3500 SSD [Add-in Card]" },
+ { 0x09538086, 1, 0x3705, "DC P3500 SSD [2.5\" SFF]" },
+ { 0x09538086, 1, 0x3709, "DC P3600 SSD [Add-in Card]" },
+ { 0x09538086, 1, 0x370a, "DC P3600 SSD [2.5\" SFF]" },
+ { 0x00000000, 0, 0, NULL }
};
static int
+nvme_match(uint32_t devid, uint16_t subdevice, struct _pcsid *ep)
+{
+ if (devid != ep->devid)
+ return 0;
+
+ if (!ep->match_subdevice)
+ return 1;
+
+ if (subdevice == ep->subdevice)
+ return 1;
+ else
+ return 0;
+}
+
+static int
nvme_probe (device_t device)
{
struct _pcsid *ep;
- u_int32_t type;
+ uint32_t devid;
+ uint16_t subdevice;
- type = pci_get_devid(device);
+ devid = pci_get_devid(device);
+ subdevice = pci_get_subdevice(device);
ep = pci_ids;
- while (ep->type && ep->type != type)
+ while (ep->devid) {
+ if (nvme_match(devid, subdevice, ep))
+ break;
++ep;
+ }
if (ep->desc) {
device_set_desc(device, ep->desc);
OpenPOWER on IntegriCloud