Lines Matching refs:pt

399 	struct nvme_pt_command	pt;  in nsactive()  local
422 memset(&pt, 0, sizeof(pt)); in nsactive()
423 pt.cmd.opc = NVME_OPC_IDENTIFY; in nsactive()
424 pt.cmd.nsid = htole32(0); in nsactive()
425 pt.cmd.cdw10 = htole32(0x02); in nsactive()
426 pt.buf = list; in nsactive()
427 pt.len = sizeof(list); in nsactive()
428 pt.is_read = 1; in nsactive()
429 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) in nsactive()
431 if (nvme_completion_is_error(&pt.cpl)) in nsactive()
444 struct nvme_pt_command pt; in nsallocated() local
467 memset(&pt, 0, sizeof(pt)); in nsallocated()
468 pt.cmd.opc = NVME_OPC_IDENTIFY; in nsallocated()
469 pt.cmd.nsid = htole32(0); in nsallocated()
470 pt.cmd.cdw10 = htole32(0x10); in nsallocated()
471 pt.buf = list; in nsallocated()
472 pt.len = sizeof(list); in nsallocated()
473 pt.is_read = 1; in nsallocated()
474 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) in nsallocated()
476 if (nvme_completion_is_error(&pt.cpl)) in nsallocated()
489 struct nvme_pt_command pt; in nscontrollers() local
512 memset(&pt, 0, sizeof(pt)); in nscontrollers()
513 pt.cmd.opc = NVME_OPC_IDENTIFY; in nscontrollers()
514 pt.cmd.cdw10 = htole32(0x13); in nscontrollers()
515 pt.buf = clist; in nscontrollers()
516 pt.len = sizeof(clist); in nscontrollers()
517 pt.is_read = 1; in nscontrollers()
518 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) in nscontrollers()
520 if (nvme_completion_is_error(&pt.cpl)) in nscontrollers()
541 struct nvme_pt_command pt; in nscreate() local
612 memset(&pt, 0, sizeof(pt)); in nscreate()
613 pt.cmd.opc = NVME_OPC_NAMESPACE_MANAGEMENT; in nscreate()
614 pt.cmd.cdw10 = htole32(0); /* create */ in nscreate()
615 pt.buf = &nsdata; in nscreate()
616 pt.len = sizeof(struct nvme_namespace_data); in nscreate()
617 pt.is_read = 0; /* passthrough writes data to ctrlr */ in nscreate()
618 if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0) in nscreate()
621 if (nvme_completion_is_error(&pt.cpl)) { in nscreate()
623 get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); in nscreate()
625 printf("namespace %d created\n", pt.cpl.cdw0); in nscreate()
632 struct nvme_pt_command pt; in nsdelete() local
662 memset(&pt, 0, sizeof(pt)); in nsdelete()
663 pt.cmd.opc = NVME_OPC_NAMESPACE_MANAGEMENT; in nsdelete()
664 pt.cmd.cdw10 = htole32(1); /* delete */ in nsdelete()
665 pt.buf = buf; in nsdelete()
666 pt.len = sizeof(buf); in nsdelete()
667 pt.is_read = 1; in nsdelete()
668 pt.cmd.nsid = nsid; in nsdelete()
670 if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0) in nsdelete()
673 if (nvme_completion_is_error(&pt.cpl)) { in nsdelete()
675 get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); in nsdelete()
699 struct nvme_pt_command pt; in nsattach() local
729 memset(&pt, 0, sizeof(pt)); in nsattach()
730 pt.cmd.opc = NVME_OPC_IDENTIFY; in nsattach()
731 pt.cmd.cdw10 = htole32(0x13); in nsattach()
732 pt.buf = clist; in nsattach()
733 pt.len = sizeof(clist); in nsattach()
734 pt.is_read = 1; in nsattach()
735 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) in nsattach()
737 if (nvme_completion_is_error(&pt.cpl)) in nsattach()
748 memset(&pt, 0, sizeof(pt)); in nsattach()
749 pt.cmd.opc = NVME_OPC_NAMESPACE_ATTACHMENT; in nsattach()
750 pt.cmd.cdw10 = htole32(0); /* attach */ in nsattach()
751 pt.cmd.nsid = nsid; in nsattach()
752 pt.buf = &clist; in nsattach()
753 pt.len = sizeof(clist); in nsattach()
755 if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0) in nsattach()
758 if (nvme_completion_is_error(&pt.cpl)) { in nsattach()
760 get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); in nsattach()
769 struct nvme_pt_command pt; in nsdetach() local
799 memset(&pt, 0, sizeof(pt)); in nsdetach()
800 pt.cmd.opc = NVME_OPC_IDENTIFY; in nsdetach()
801 pt.cmd.nsid = htole32(nsid); in nsdetach()
802 pt.cmd.cdw10 = htole32(0x12); in nsdetach()
803 pt.buf = clist; in nsdetach()
804 pt.len = sizeof(clist); in nsdetach()
805 pt.is_read = 1; in nsdetach()
806 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) in nsdetach()
808 if (nvme_completion_is_error(&pt.cpl)) in nsdetach()
825 memset(&pt, 0, sizeof(pt)); in nsdetach()
826 pt.cmd.opc = NVME_OPC_NAMESPACE_ATTACHMENT; in nsdetach()
827 pt.cmd.cdw10 = htole32(1); /* detach */ in nsdetach()
828 pt.cmd.nsid = nsid; in nsdetach()
829 pt.buf = &clist; in nsdetach()
830 pt.len = sizeof(clist); in nsdetach()
832 if ((result = ioctl(fd, NVME_PASSTHROUGH_CMD, &pt)) < 0) in nsdetach()
835 if (nvme_completion_is_error(&pt.cpl)) { in nsdetach()
837 get_res_str(NVMEV(NVME_STATUS_SC, pt.cpl.status))); in nsdetach()
846 struct nvme_pt_command pt; in nsattached() local
874 memset(&pt, 0, sizeof(pt)); in nsattached()
875 pt.cmd.opc = NVME_OPC_IDENTIFY; in nsattached()
876 pt.cmd.nsid = htole32(nsid); in nsattached()
877 pt.cmd.cdw10 = htole32(0x12); in nsattached()
878 pt.buf = clist; in nsattached()
879 pt.len = sizeof(clist); in nsattached()
880 pt.is_read = 1; in nsattached()
881 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) in nsattached()
883 if (nvme_completion_is_error(&pt.cpl)) in nsattached()
897 struct nvme_pt_command pt; in nsidentify() local
927 memset(&pt, 0, sizeof(pt)); in nsidentify()
928 pt.cmd.opc = NVME_OPC_IDENTIFY; in nsidentify()
929 pt.cmd.nsid = htole32(nsid); in nsidentify()
930 pt.cmd.cdw10 = htole32(0x11); in nsidentify()
931 pt.buf = &nsdata; in nsidentify()
932 pt.len = sizeof(nsdata); in nsidentify()
933 pt.is_read = 1; in nsidentify()
935 if (ioctl(fd, NVME_PASSTHROUGH_CMD, &pt) < 0) in nsidentify()
938 if (nvme_completion_is_error(&pt.cpl)) in nsidentify()