Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later WITH Linux-syscall-note */
0002 /*
0003  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
0004  */
0005 
0006 /*
0007  * Oracle DAX driver API definitions
0008  */
0009 
0010 #ifndef _ORADAX_H
0011 #define _ORADAX_H
0012 
0013 #include <linux/types.h>
0014 
0015 #define CCB_KILL 0
0016 #define CCB_INFO 1
0017 #define CCB_DEQUEUE 2
0018 
0019 struct dax_command {
0020     __u16 command;      /* CCB_KILL/INFO/DEQUEUE */
0021     __u16 ca_offset;    /* offset into mmapped completion area */
0022 };
0023 
0024 struct ccb_kill_result {
0025     __u16 action;       /* action taken to kill ccb */
0026 };
0027 
0028 struct ccb_info_result {
0029     __u16 state;        /* state of enqueued ccb */
0030     __u16 inst_num;     /* dax instance number of enqueued ccb */
0031     __u16 q_num;        /* queue number of enqueued ccb */
0032     __u16 q_pos;        /* ccb position in queue */
0033 };
0034 
0035 struct ccb_exec_result {
0036     __u64   status_data;    /* additional status data (e.g. bad VA) */
0037     __u32   status;     /* one of DAX_SUBMIT_* */
0038 };
0039 
0040 union ccb_result {
0041     struct ccb_exec_result exec;
0042     struct ccb_info_result info;
0043     struct ccb_kill_result kill;
0044 };
0045 
0046 #define DAX_MMAP_LEN        (16 * 1024)
0047 #define DAX_MAX_CCBS        15
0048 #define DAX_CCB_BUF_MAXLEN  (DAX_MAX_CCBS * 64)
0049 #define DAX_NAME        "oradax"
0050 
0051 /* CCB_EXEC status */
0052 #define DAX_SUBMIT_OK           0
0053 #define DAX_SUBMIT_ERR_RETRY        1
0054 #define DAX_SUBMIT_ERR_WOULDBLOCK   2
0055 #define DAX_SUBMIT_ERR_BUSY     3
0056 #define DAX_SUBMIT_ERR_THR_INIT     4
0057 #define DAX_SUBMIT_ERR_ARG_INVAL    5
0058 #define DAX_SUBMIT_ERR_CCB_INVAL    6
0059 #define DAX_SUBMIT_ERR_NO_CA_AVAIL  7
0060 #define DAX_SUBMIT_ERR_CCB_ARR_MMU_MISS 8
0061 #define DAX_SUBMIT_ERR_NOMAP        9
0062 #define DAX_SUBMIT_ERR_NOACCESS     10
0063 #define DAX_SUBMIT_ERR_TOOMANY      11
0064 #define DAX_SUBMIT_ERR_UNAVAIL      12
0065 #define DAX_SUBMIT_ERR_INTERNAL     13
0066 
0067 /* CCB_INFO states - must match HV_CCB_STATE_* definitions */
0068 #define DAX_CCB_COMPLETED   0
0069 #define DAX_CCB_ENQUEUED    1
0070 #define DAX_CCB_INPROGRESS  2
0071 #define DAX_CCB_NOTFOUND    3
0072 
0073 /* CCB_KILL actions - must match HV_CCB_KILL_* definitions */
0074 #define DAX_KILL_COMPLETED  0
0075 #define DAX_KILL_DEQUEUED   1
0076 #define DAX_KILL_KILLED     2
0077 #define DAX_KILL_NOTFOUND   3
0078 
0079 #endif /* _ORADAX_H */