From owner-svn-src-stable@FreeBSD.ORG Thu May 14 21:29:42 2015 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D5A6280; Thu, 14 May 2015 21:29:42 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A9E50161E; Thu, 14 May 2015 21:29:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t4ELTg0Q064026; Thu, 14 May 2015 21:29:42 GMT (envelope-from jimharris@FreeBSD.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t4ELTgsf064025; Thu, 14 May 2015 21:29:42 GMT (envelope-from jimharris@FreeBSD.org) Message-Id: <201505142129.t4ELTgsf064025@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: jimharris set sender to jimharris@FreeBSD.org using -f From: Jim Harris Date: Thu, 14 May 2015 21:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r282925 - stable/10/sys/dev/nvme X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2015 21:29:43 -0000 Author: jimharris Date: Thu May 14 21:29:42 2015 New Revision: 282925 URL: https://svnweb.freebsd.org/changeset/base/282925 Log: MFC r281282: nvme: add device strings for Intel DC series NVMe SSDs Sponsored by: Intel Modified: stable/10/sys/dev/nvme/nvme.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/nvme/nvme.c ============================================================================== --- stable/10/sys/dev/nvme/nvme.c Thu May 14 21:28:46 2015 (r282924) +++ stable/10/sys/dev/nvme/nvme.c Thu May 14 21:29:42 2015 (r282925) @@ -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);