blob: 5a1735c4f79eaedf8e99b62cdc558f27698f52c6 [file] [log] [blame]
Christopher Ferris38062f92014-07-09 15:33:25 -07001/****************************************************************************
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>
Tao Baod7db5942015-01-28 10:07:51 -080022#define __mic_align(a,x) (((a) + (x) - 1) & ~((x) - 1))
Christopher Ferris38062f92014-07-09 15:33:25 -070023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24struct mic_device_desc {
Tao Baod7db5942015-01-28 10:07:51 -080025 __s8 type;
26 __u8 num_vq;
27 __u8 feature_len;
Christopher Ferris38062f92014-07-09 15:33:25 -070028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080029 __u8 config_len;
30 __u8 status;
31 __le64 config[0];
32} __attribute__((aligned(8)));
Christopher Ferris38062f92014-07-09 15:33:25 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34struct mic_device_ctrl {
Tao Baod7db5942015-01-28 10:07:51 -080035 __le64 vdev;
36 __u8 config_change;
37 __u8 vdev_reset;
Christopher Ferris38062f92014-07-09 15:33:25 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039 __u8 guest_ack;
40 __u8 host_ack;
41 __u8 used_address_updated;
42 __s8 c2h_vdev_db;
Christopher Ferris38062f92014-07-09 15:33:25 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080044 __s8 h2c_vdev_db;
45} __attribute__((aligned(8)));
Christopher Ferris38062f92014-07-09 15:33:25 -070046struct mic_bootparam {
Tao Baod7db5942015-01-28 10:07:51 -080047 __le32 magic;
Christopher Ferris38062f92014-07-09 15:33:25 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 __s8 c2h_shutdown_db;
50 __s8 h2c_shutdown_db;
51 __s8 h2c_config_db;
52 __u8 shutdown_status;
Christopher Ferris38062f92014-07-09 15:33:25 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 __u8 shutdown_card;
55} __attribute__((aligned(8)));
Christopher Ferris38062f92014-07-09 15:33:25 -070056struct mic_device_page {
Tao Baod7db5942015-01-28 10:07:51 -080057 struct mic_bootparam bootparam;
Christopher Ferris38062f92014-07-09 15:33:25 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059 struct mic_device_desc desc[0];
Christopher Ferris38062f92014-07-09 15:33:25 -070060};
61struct mic_vqconfig {
Tao Baod7db5942015-01-28 10:07:51 -080062 __le64 address;
Christopher Ferris38062f92014-07-09 15:33:25 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 __le64 used_address;
65 __le16 num;
66} __attribute__((aligned(8)));
Christopher Ferris38062f92014-07-09 15:33:25 -070067#define MIC_VIRTIO_RING_ALIGN 4096
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define MIC_MAX_VRINGS 4
70#define MIC_VRING_ENTRIES 128
71#define MIC_MAX_VRING_ENTRIES 128
72#define MIC_MAX_DESC_BLK_SIZE 256
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74struct _mic_vring_info {
Tao Baod7db5942015-01-28 10:07:51 -080075 __u16 avail_idx;
76 __le32 magic;
Christopher Ferris38062f92014-07-09 15:33:25 -070077};
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79struct mic_vring {
Tao Baod7db5942015-01-28 10:07:51 -080080 struct vring vr;
81 struct _mic_vring_info * info;
82 void * va;
Christopher Ferris38062f92014-07-09 15:33:25 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080084 int len;
Christopher Ferris38062f92014-07-09 15:33:25 -070085};
86#define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8)
87#ifndef INTEL_MIC_CARD
88/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89#endif
90#define MIC_DP_SIZE 4096
91#define MIC_MAGIC 0xc0ffee00
92enum mic_states {
93/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080094 MIC_OFFLINE = 0,
95 MIC_ONLINE,
96 MIC_SHUTTING_DOWN,
97 MIC_RESET_FAILED,
Christopher Ferris38062f92014-07-09 15:33:25 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 MIC_SUSPENDING,
100 MIC_SUSPENDED,
101 MIC_LAST
Christopher Ferris38062f92014-07-09 15:33:25 -0700102};
103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104enum mic_status {
Tao Baod7db5942015-01-28 10:07:51 -0800105 MIC_NOP = 0,
106 MIC_CRASHED,
107 MIC_HALTED,
Christopher Ferris38062f92014-07-09 15:33:25 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 MIC_POWER_OFF,
110 MIC_RESTART,
111 MIC_STATUS_LAST
Christopher Ferris38062f92014-07-09 15:33:25 -0700112};
113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114#endif