]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
ioctl: io management send, receive args fix
authorSteven Seungcheol Lee <sc108.lee@samsung.com>
Mon, 17 Apr 2023 02:20:23 +0000 (11:20 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 17 Apr 2023 08:32:09 +0000 (10:32 +0200)
TP4146 Flexible Data Placement 2022.11.30 Ratified
Command Dword 10
Bits[31:16] : Management Operation Specific (MOS)
Bits[07:00] : Management Operation (MO)
Signed-off-by: Steven Seungcheol Lee <sc108.lee@samsung.com>
src/nvme/ioctl.c

index 884554de98191043712fd905cb9c03550e7dd287..6f9d724f0ea1f3c629b627c12a550b3b605d50c6 100644 (file)
@@ -1913,7 +1913,7 @@ int nvme_resv_report(struct nvme_resv_report_args *args)
 
 int nvme_io_mgmt_recv(struct nvme_io_mgmt_recv_args *args)
 {
-       __u32 cdw10 = (args->mo & 0xf) | (args->mos & 0xff << 16);
+       __u32 cdw10 = args->mo | (args->mos << 16);
        __u32 cdw11 = (args->data_len >> 2) - 1;
 
        struct nvme_passthru_cmd cmd = {
@@ -1936,7 +1936,7 @@ int nvme_io_mgmt_recv(struct nvme_io_mgmt_recv_args *args)
 
 int nvme_io_mgmt_send(struct nvme_io_mgmt_send_args *args)
 {
-       __u32 cdw10 = (args->mo & 0xf) | ((args->mos & 0xff) << 16);
+       __u32 cdw10 = args->mo | (args->mos << 16);
 
        struct nvme_passthru_cmd cmd = {
                .opcode         = nvme_cmd_io_mgmt_send,