nvme.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /* stub to deal with renamed/neutered nvme.h header */
  2. #include <linux/types.h>
  3. #include <linux/nvme_ioctl.h>
  4. struct nvme_id_power_state {
  5. __le16 max_power; /* centiwatts */
  6. __u8 rsvd2;
  7. __u8 flags;
  8. __le32 entry_lat; /* microseconds */
  9. __le32 exit_lat; /* microseconds */
  10. __u8 read_tput;
  11. __u8 read_lat;
  12. __u8 write_tput;
  13. __u8 write_lat;
  14. __le16 idle_power;
  15. __u8 idle_scale;
  16. __u8 rsvd19;
  17. __le16 active_power;
  18. __u8 active_work_scale;
  19. __u8 rsvd23[9];
  20. };
  21. enum {
  22. NVME_PS_FLAGS_MAX_POWER_SCALE = 1 << 0,
  23. NVME_PS_FLAGS_NON_OP_STATE = 1 << 1,
  24. };
  25. struct nvme_id_ctrl {
  26. __le16 vid;
  27. __le16 ssvid;
  28. char sn[20];
  29. char mn[40];
  30. char fr[8];
  31. __u8 rab;
  32. __u8 ieee[3];
  33. __u8 mic;
  34. __u8 mdts;
  35. __le16 cntlid;
  36. __le32 ver;
  37. __u8 rsvd84[172];
  38. __le16 oacs;
  39. __u8 acl;
  40. __u8 aerl;
  41. __u8 frmw;
  42. __u8 lpa;
  43. __u8 elpe;
  44. __u8 npss;
  45. __u8 avscc;
  46. __u8 apsta;
  47. __le16 wctemp;
  48. __le16 cctemp;
  49. __u8 rsvd270[242];
  50. __u8 sqes;
  51. __u8 cqes;
  52. __u8 rsvd514[2];
  53. __le32 nn;
  54. __le16 oncs;
  55. __le16 fuses;
  56. __u8 fna;
  57. __u8 vwc;
  58. __le16 awun;
  59. __le16 awupf;
  60. __u8 nvscc;
  61. __u8 rsvd531;
  62. __le16 acwu;
  63. __u8 rsvd534[2];
  64. __le32 sgls;
  65. __u8 rsvd540[1508];
  66. struct nvme_id_power_state psd[32];
  67. __u8 vs[1024];
  68. };
  69. enum nvme_admin_opcode {
  70. nvme_admin_delete_sq = 0x00,
  71. nvme_admin_create_sq = 0x01,
  72. nvme_admin_get_log_page = 0x02,
  73. nvme_admin_delete_cq = 0x04,
  74. nvme_admin_create_cq = 0x05,
  75. nvme_admin_identify = 0x06,
  76. nvme_admin_abort_cmd = 0x08,
  77. nvme_admin_set_features = 0x09,
  78. nvme_admin_get_features = 0x0a,
  79. nvme_admin_async_event = 0x0c,
  80. nvme_admin_activate_fw = 0x10,
  81. nvme_admin_download_fw = 0x11,
  82. nvme_admin_format_nvm = 0x80,
  83. nvme_admin_security_send = 0x81,
  84. nvme_admin_security_recv = 0x82,
  85. };