mic_common.h revision 05d08e9716b5974d6ed08973f44930804890b902
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 __MIC_COMMON_H_
20#define __MIC_COMMON_H_
21#include <linux/virtio_ring.h>
22#define __mic_align(a,x) (((a) + (x) - 1) & ~((x) - 1))
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24struct mic_device_desc {
25  __s8 type;
26  __u8 num_vq;
27  __u8 feature_len;
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29  __u8 config_len;
30  __u8 status;
31  __le64 config[0];
32} __attribute__((aligned(8)));
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34struct mic_device_ctrl {
35  __le64 vdev;
36  __u8 config_change;
37  __u8 vdev_reset;
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39  __u8 guest_ack;
40  __u8 host_ack;
41  __u8 used_address_updated;
42  __s8 c2h_vdev_db;
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  __s8 h2c_vdev_db;
45} __attribute__((aligned(8)));
46struct mic_bootparam {
47  __le32 magic;
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49  __s8 h2c_config_db;
50  __u8 node_id;
51  __u8 h2c_scif_db;
52  __u8 c2h_scif_db;
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54  __u64 scif_host_dma_addr;
55  __u64 scif_card_dma_addr;
56} __attribute__((aligned(8)));
57struct mic_device_page {
58/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59  struct mic_bootparam bootparam;
60  struct mic_device_desc desc[0];
61};
62struct mic_vqconfig {
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  __le64 address;
65  __le64 used_address;
66  __le16 num;
67} __attribute__((aligned(8)));
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define MIC_VIRTIO_RING_ALIGN 4096
70#define MIC_MAX_VRINGS 4
71#define MIC_VRING_ENTRIES 128
72#define MIC_MAX_VRING_ENTRIES 128
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74#define MIC_MAX_DESC_BLK_SIZE 256
75struct _mic_vring_info {
76  __u16 avail_idx;
77  __le32 magic;
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79};
80struct mic_vring {
81  struct vring vr;
82  struct _mic_vring_info * info;
83/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84  void * va;
85  int len;
86};
87#define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8)
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89#ifndef INTEL_MIC_CARD
90#endif
91#define MIC_DP_SIZE 4096
92#define MIC_MAGIC 0xc0ffee00
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94enum mic_states {
95  MIC_READY = 0,
96  MIC_BOOTING,
97  MIC_ONLINE,
98/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99  MIC_SHUTTING_DOWN,
100  MIC_RESETTING,
101  MIC_RESET_FAILED,
102  MIC_LAST
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104};
105enum mic_status {
106  MIC_NOP = 0,
107  MIC_CRASHED,
108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109  MIC_HALTED,
110  MIC_POWER_OFF,
111  MIC_RESTART,
112  MIC_STATUS_LAST
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114};
115#endif
116