svn commit: r240697 - head/sys/dev/nvme

John Baldwin jhb at freebsd.org
Wed Sep 19 18:00:11 UTC 2012


On Wednesday, September 19, 2012 12:21:24 pm Jim Harris wrote:
> Author: jimharris
> Date: Wed Sep 19 16:21:23 2012
> New Revision: 240697
> URL: http://svn.freebsd.org/changeset/base/240697
> 
> Log:
>   Report nvme(4) as a generic driver for NVMe devices if PCI class, subclass
>   and programming interface codes match.

You need to set a description in the generic case.  I would suggest doing 
something like:

	while (ep->type && ep->type != type)
		++ep;

	if (ep->desc) {
		device_set_desc(device, ep->desc);
		return (BUS_PROBE_DEFAULT);
	}

#ifdef PCIS_STORAGE_NVM
	if (pci_get_class(device) == PCIC_STORAGE &&
		...) {
		device_set_desc(device, "blah blah");
		return (BUS_PROBE_GENERIC);
	}
#endif

	return (ENXIO);

I think that might be a bit clearer to the reader.

-- 
John Baldwin


More information about the svn-src-all mailing list