oradax.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
  2. /*
  3. * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
  4. */
  5. /*
  6. * Oracle DAX driver API definitions
  7. */
  8. #ifndef _ORADAX_H
  9. #define _ORADAX_H
  10. #include <linux/types.h>
  11. #define CCB_KILL 0
  12. #define CCB_INFO 1
  13. #define CCB_DEQUEUE 2
  14. struct dax_command {
  15. __u16 command; /* CCB_KILL/INFO/DEQUEUE */
  16. __u16 ca_offset; /* offset into mmapped completion area */
  17. };
  18. struct ccb_kill_result {
  19. __u16 action; /* action taken to kill ccb */
  20. };
  21. struct ccb_info_result {
  22. __u16 state; /* state of enqueued ccb */
  23. __u16 inst_num; /* dax instance number of enqueued ccb */
  24. __u16 q_num; /* queue number of enqueued ccb */
  25. __u16 q_pos; /* ccb position in queue */
  26. };
  27. struct ccb_exec_result {
  28. __u64 status_data; /* additional status data (e.g. bad VA) */
  29. __u32 status; /* one of DAX_SUBMIT_* */
  30. };
  31. union ccb_result {
  32. struct ccb_exec_result exec;
  33. struct ccb_info_result info;
  34. struct ccb_kill_result kill;
  35. };
  36. #define DAX_MMAP_LEN (16 * 1024)
  37. #define DAX_MAX_CCBS 15
  38. #define DAX_CCB_BUF_MAXLEN (DAX_MAX_CCBS * 64)
  39. #define DAX_NAME "oradax"
  40. /* CCB_EXEC status */
  41. #define DAX_SUBMIT_OK 0
  42. #define DAX_SUBMIT_ERR_RETRY 1
  43. #define DAX_SUBMIT_ERR_WOULDBLOCK 2
  44. #define DAX_SUBMIT_ERR_BUSY 3
  45. #define DAX_SUBMIT_ERR_THR_INIT 4
  46. #define DAX_SUBMIT_ERR_ARG_INVAL 5
  47. #define DAX_SUBMIT_ERR_CCB_INVAL 6
  48. #define DAX_SUBMIT_ERR_NO_CA_AVAIL 7
  49. #define DAX_SUBMIT_ERR_CCB_ARR_MMU_MISS 8
  50. #define DAX_SUBMIT_ERR_NOMAP 9
  51. #define DAX_SUBMIT_ERR_NOACCESS 10
  52. #define DAX_SUBMIT_ERR_TOOMANY 11
  53. #define DAX_SUBMIT_ERR_UNAVAIL 12
  54. #define DAX_SUBMIT_ERR_INTERNAL 13
  55. /* CCB_INFO states - must match HV_CCB_STATE_* definitions */
  56. #define DAX_CCB_COMPLETED 0
  57. #define DAX_CCB_ENQUEUED 1
  58. #define DAX_CCB_INPROGRESS 2
  59. #define DAX_CCB_NOTFOUND 3
  60. /* CCB_KILL actions - must match HV_CCB_KILL_* definitions */
  61. #define DAX_KILL_COMPLETED 0
  62. #define DAX_KILL_DEQUEUED 1
  63. #define DAX_KILL_KILLED 2
  64. #define DAX_KILL_NOTFOUND 3
  65. #endif /* _ORADAX_H */