Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ***   To edit the content of this header, modify the corresponding
     11  ***   source file (e.g. under external/kernel-headers/original/) then
     12  ***   run bionic/libc/kernel/tools/update_all.py
     13  ***
     14  ***   Any manual change here will be lost the next time this script will
     15  ***   be run. You've been warned!
     16  ***
     17  ****************************************************************************
     18  ****************************************************************************/
     19 #ifndef __TARGET_CORE_USER_H
     20 #define __TARGET_CORE_USER_H
     21 #include <linux/types.h>
     22 #include <linux/uio.h>
     23 #define TCMU_VERSION "2.0"
     24 #define TCMU_MAILBOX_VERSION 2
     25 #define ALIGN_SIZE 64
     26 #define TCMU_MAILBOX_FLAG_CAP_OOOC (1 << 0)
     27 struct tcmu_mailbox {
     28   __u16 version;
     29   __u16 flags;
     30   __u32 cmdr_off;
     31   __u32 cmdr_size;
     32   __u32 cmd_head;
     33   __u32 cmd_tail __attribute__((__aligned__(ALIGN_SIZE)));
     34 } __packed;
     35 enum tcmu_opcode {
     36   TCMU_OP_PAD = 0,
     37   TCMU_OP_CMD,
     38 };
     39 struct tcmu_cmd_entry_hdr {
     40   __u32 len_op;
     41   __u16 cmd_id;
     42   __u8 kflags;
     43 #define TCMU_UFLAG_UNKNOWN_OP 0x1
     44   __u8 uflags;
     45 } __packed;
     46 #define TCMU_OP_MASK 0x7
     47 #define TCMU_SENSE_BUFFERSIZE 96
     48 struct tcmu_cmd_entry {
     49   struct tcmu_cmd_entry_hdr hdr;
     50   union {
     51     struct {
     52       __u32 iov_cnt;
     53       __u32 iov_bidi_cnt;
     54       __u32 iov_dif_cnt;
     55       __u64 cdb_off;
     56       __u64 __pad1;
     57       __u64 __pad2;
     58       struct iovec iov[0];
     59     } req;
     60     struct {
     61       __u8 scsi_status;
     62       __u8 __pad1;
     63       __u16 __pad2;
     64       __u32 __pad3;
     65       char sense_buffer[TCMU_SENSE_BUFFERSIZE];
     66     } rsp;
     67   };
     68 } __packed;
     69 #define TCMU_OP_ALIGN_SIZE sizeof(__u64)
     70 enum tcmu_genl_cmd {
     71   TCMU_CMD_UNSPEC,
     72   TCMU_CMD_ADDED_DEVICE,
     73   TCMU_CMD_REMOVED_DEVICE,
     74   TCMU_CMD_RECONFIG_DEVICE,
     75   TCMU_CMD_ADDED_DEVICE_DONE,
     76   TCMU_CMD_REMOVED_DEVICE_DONE,
     77   TCMU_CMD_RECONFIG_DEVICE_DONE,
     78   TCMU_CMD_SET_FEATURES,
     79   __TCMU_CMD_MAX,
     80 };
     81 #define TCMU_CMD_MAX (__TCMU_CMD_MAX - 1)
     82 enum tcmu_genl_attr {
     83   TCMU_ATTR_UNSPEC,
     84   TCMU_ATTR_DEVICE,
     85   TCMU_ATTR_MINOR,
     86   TCMU_ATTR_PAD,
     87   TCMU_ATTR_DEV_CFG,
     88   TCMU_ATTR_DEV_SIZE,
     89   TCMU_ATTR_WRITECACHE,
     90   TCMU_ATTR_CMD_STATUS,
     91   TCMU_ATTR_DEVICE_ID,
     92   TCMU_ATTR_SUPP_KERN_CMD_REPLY,
     93   __TCMU_ATTR_MAX,
     94 };
     95 #define TCMU_ATTR_MAX (__TCMU_ATTR_MAX - 1)
     96 #endif
     97