From c2005bba7796670be964c6872bddd68a69a73026 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 29 Aug 2017 15:46:34 +0000 Subject: [PATCH] Fix a few overlooked spots where the coded uses 16-bit NSIDs. Chuck Tuffli had submitted a more thorough patch that I was unaware of when I did my work and this brings in the bits I missed from that patch. PR: 220267 Submitted by: Chuck Tuffli --- sys/cam/cam_ccb.h | 2 +- sys/dev/nvme/nvme.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/cam/cam_ccb.h b/sys/cam/cam_ccb.h index fae7af453c5e..5e66d0dd96e2 100644 --- a/sys/cam/cam_ccb.h +++ b/sys/cam/cam_ccb.h @@ -631,7 +631,7 @@ struct ccb_pathinq_settings_sas { }; struct ccb_pathinq_settings_nvme { - uint16_t nsid; /* Namespace ID for this path */ + uint32_t nsid; /* Namespace ID for this path */ }; #define PATHINQ_SETTINGS_SIZE 128 diff --git a/sys/dev/nvme/nvme.h b/sys/dev/nvme/nvme.h index 0f0db5ee373d..d4fc131ef643 100644 --- a/sys/dev/nvme/nvme.h +++ b/sys/dev/nvme/nvme.h @@ -1070,7 +1070,7 @@ int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, /* Command building helper functions -- shared with CAM */ static inline -void nvme_ns_flush_cmd(struct nvme_command *cmd, uint16_t nsid) +void nvme_ns_flush_cmd(struct nvme_command *cmd, uint32_t nsid) { cmd->opc = NVME_OPC_FLUSH; @@ -1078,7 +1078,7 @@ void nvme_ns_flush_cmd(struct nvme_command *cmd, uint16_t nsid) } static inline -void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t rwcmd, uint16_t nsid, +void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t rwcmd, uint32_t nsid, uint64_t lba, uint32_t count) { cmd->opc = rwcmd; @@ -1092,21 +1092,21 @@ void nvme_ns_rw_cmd(struct nvme_command *cmd, uint32_t rwcmd, uint16_t nsid, } static inline -void nvme_ns_write_cmd(struct nvme_command *cmd, uint16_t nsid, +void nvme_ns_write_cmd(struct nvme_command *cmd, uint32_t nsid, uint64_t lba, uint32_t count) { nvme_ns_rw_cmd(cmd, NVME_OPC_WRITE, nsid, lba, count); } static inline -void nvme_ns_read_cmd(struct nvme_command *cmd, uint16_t nsid, +void nvme_ns_read_cmd(struct nvme_command *cmd, uint32_t nsid, uint64_t lba, uint32_t count) { nvme_ns_rw_cmd(cmd, NVME_OPC_READ, nsid, lba, count); } static inline -void nvme_ns_trim_cmd(struct nvme_command *cmd, uint16_t nsid, +void nvme_ns_trim_cmd(struct nvme_command *cmd, uint32_t nsid, uint32_t num_ranges) { cmd->opc = NVME_OPC_DATASET_MANAGEMENT;