mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-30 08:19:09 +00:00
1bce7cd885
Add the NVME_IOCTL_ID, NVME_IOCTL_ADMIN_CMD, and NVME_IOCTL_IO_CMD Linux compatible ioctls. These may be run on either an I/O (ns) dev or a nvme (admin) dev. Linux allows both on either device, and programs use this and aren't careful about having the right device open. Emulate this feature, and implement these ioctls. The data is passed in into the kernel in host byte order (not converted to le). Results are returned in host order. The timeout field is ignore, and the metadata and metadata_len fields must be zero. The addr field can be null, even when the data_len is non zero (FreeBSD's ioctl interface prohibits this, Linux's just ignores the inconsistency). Only the cdw10 is returned from the command: the status is not returned in 'result' field. XXX need to verify that this is what Linux does on an error signaled from the drive. No external include file is yet available for this: most programs that call this interface either use a linux-specific path <linux/nvme.h> or have their own private copy of the data. It's unclear the best thing to do. Also, create a /dev/nvmeXnY as an alias for /dev/nvmeXnsY. These changes allow a native build of nvme-cli to work for everything that doesn't depend on sysfs entries in /sys, calls that use metadata, send / receive drive data and sed functionality not in our nvme driver. Sponsored by: Netflix Co-Authored-by: Chuck Tuffli <chuck@freebsd.org> Reviewed by: chuck Differential Revision: https://reviews.freebsd.org/D45415 |
||
---|---|---|
.. | ||
nvme_ahci.c | ||
nvme_ctrlr_cmd.c | ||
nvme_ctrlr.c | ||
nvme_linux.h | ||
nvme_ns_cmd.c | ||
nvme_ns.c | ||
nvme_pci.c | ||
nvme_private.h | ||
nvme_qpair.c | ||
nvme_sim.c | ||
nvme_sysctl.c | ||
nvme_test.c | ||
nvme_util.c | ||
nvme.c | ||
nvme.h |