nvme_ioctl.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Definitions for the NVM Express ioctl interface
  3. * Copyright (c) 2011-2014, Intel Corporation.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms and conditions of the GNU General Public License,
  7. * version 2, as published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  12. * more details.
  13. */
  14. #ifndef _LINUX_NVME_IOCTL_H
  15. #define _LINUX_NVME_IOCTL_H
  16. #include <linux/types.h>
  17. struct nvme_user_io {
  18. __u8 opcode;
  19. __u8 flags;
  20. __u16 control;
  21. __u16 nblocks;
  22. __u16 rsvd;
  23. __u64 metadata;
  24. __u64 addr;
  25. __u64 slba;
  26. __u32 dsmgmt;
  27. __u32 reftag;
  28. __u16 apptag;
  29. __u16 appmask;
  30. };
  31. struct nvme_passthru_cmd {
  32. __u8 opcode;
  33. __u8 flags;
  34. __u16 rsvd1;
  35. __u32 nsid;
  36. __u32 cdw2;
  37. __u32 cdw3;
  38. __u64 metadata;
  39. __u64 addr;
  40. __u32 metadata_len;
  41. __u32 data_len;
  42. __u32 cdw10;
  43. __u32 cdw11;
  44. __u32 cdw12;
  45. __u32 cdw13;
  46. __u32 cdw14;
  47. __u32 cdw15;
  48. __u32 timeout_ms;
  49. __u32 result;
  50. };
  51. #define nvme_admin_cmd nvme_passthru_cmd
  52. #define NVME_IOCTL_ID _IO('N', 0x40)
  53. #define NVME_IOCTL_ADMIN_CMD _IOWR('N', 0x41, struct nvme_admin_cmd)
  54. #define NVME_IOCTL_SUBMIT_IO _IOW('N', 0x42, struct nvme_user_io)
  55. #define NVME_IOCTL_IO_CMD _IOWR('N', 0x43, struct nvme_passthru_cmd)
  56. #define NVME_IOCTL_RESET _IO('N', 0x44)
  57. #define NVME_IOCTL_SUBSYS_RESET _IO('N', 0x45)
  58. #endif /* _LINUX_NVME_IOCTL_H */