Commit Graph

9 Commits

Author SHA1 Message Date
Warner Losh
93289cfcd2 Create a AHCI attachment for nvme.
Intel has created RST and many laptops from vendors like Lenovo and Asus. It's a
mechanism for creating multiple boot devices under windows. It effectively hides
the nvme drive inside of the ahci controller. The details are supposed to be a
trade secret. However, there's a reverse engineered Linux driver, and this
implements similar operations to allow nvme drives to attach. The ahci driver
attaches nvme children that proxy the remapped resources to the child. nvme_ahci
is just like nvme_pci, except it doesn't do the PCI specific things. That's
moved into ahci where appropriate.

When the nvme drive is remapped, MSI-x interrupts aren't forwarded (the linux
driver doesn't know how to use this either). INTx interrupts are used
instead. This is suboptimal, but usually sufficient for the laptops these parts
are in.

This is based loosely on https://www.spinics.net/lists/linux-ide/msg53364.html
submitted, but not accepted by, Linux. It was written by Dan Williams. These
changes were written from scratch by Olivier Houchard.

Submitted by: cognet@ (Olivier Houchard)
2019-08-21 22:18:01 +00:00
Warner Losh
f182f928db Separate the pci attachment from the rest of nvme
Nvme drives can be attached in a number of different ways. Separate out the PCI
attachment so that we can have other attachment types, like ahci and various
types of NVMeoF.

Submitted by: cognet@
2019-08-21 22:17:55 +00:00
Warner Losh
d1c9349f76 Belatedly add opt_nvme.h to fix building nvme.ko outside of a kernel
build.

Sponsored by: Netflix
2017-11-14 05:05:21 +00:00
Warner Losh
be650b3469 Add nvme_sim.c since that's not runtime switchable.
Sponsored by: Netflix
2017-08-28 23:54:16 +00:00
Enji Cooper
193d9e768b sys/modules: normalize .CURDIR-relative paths to SRCTOP
This simplifies make output/logic

Tested with:	`cd sys/modules; make ALL_MODULES=` on amd64
MFC after:	1 month
Sponsored by:	Dell EMC Isilon
2017-03-04 10:10:17 +00:00
Enji Cooper
ee13e70e4f Fix "make depend" with nvme.ko: add opt_cam.h to SRCS
MFC after:	1 week
X-MFC with:	r301778
Sponsored by:	Dell EMC Isilon
2017-03-04 08:46:57 +00:00
Jim Harris
38441bd9a9 Add message when nvd disks are attached and detached.
As part of this commit, add an nvme_strvis() function which borrows
heavily from cam_strvis().  This will allow stripping of
leading/trailing whitespace and also handle unprintable characters
in model/serial numbers.  This function goes into a new nvme_util.c
file which is used by both the driver and nvmecontrol.

Sponsored by:	Intel
Reviewed by:	carl
MFC after:	3 days
2013-07-19 21:40:57 +00:00
Jim Harris
ca269f32ef Move the busdma mapping functions to nvme_qpair.c.
This removes nvme_uio.c completely.

Sponsored by:	Intel
2013-04-12 17:48:45 +00:00
Jim Harris
978b27047d Add nvme(4) and nvd(4) Makefiles to the tree.
Noticed by:	pluknet
Pointy-hat to:  jimharris
2012-09-17 19:58:02 +00:00