blob: 8715590efd401df8256767c8ee05a07bdc2fe5c9 [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 h2c_config_db;
Christopher Ferris05d08e92016-02-04 13:16:38 -080050 __u8 node_id;
51 __u8 h2c_scif_db;
52 __u8 c2h_scif_db;
Christopher Ferris38062f92014-07-09 15:33:25 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080054 __u64 scif_host_dma_addr;
55 __u64 scif_card_dma_addr;
Tao Baod7db5942015-01-28 10:07:51 -080056} __attribute__((aligned(8)));
Christopher Ferris38062f92014-07-09 15:33:25 -070057struct mic_device_page {
Christopher Ferris38062f92014-07-09 15:33:25 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080059 struct mic_bootparam bootparam;
Tao Baod7db5942015-01-28 10:07:51 -080060 struct mic_device_desc desc[0];
Christopher Ferris38062f92014-07-09 15:33:25 -070061};
62struct mic_vqconfig {
Christopher Ferris38062f92014-07-09 15:33:25 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080064 __le64 address;
Tao Baod7db5942015-01-28 10:07:51 -080065 __le64 used_address;
66 __le16 num;
67} __attribute__((aligned(8)));
Christopher Ferris38062f92014-07-09 15:33:25 -070068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080069#define MIC_VIRTIO_RING_ALIGN 4096
Christopher Ferris38062f92014-07-09 15:33:25 -070070#define MIC_MAX_VRINGS 4
71#define MIC_VRING_ENTRIES 128
72#define MIC_MAX_VRING_ENTRIES 128
Christopher Ferris38062f92014-07-09 15:33:25 -070073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080074#define MIC_MAX_DESC_BLK_SIZE 256
Christopher Ferris38062f92014-07-09 15:33:25 -070075struct _mic_vring_info {
Tao Baod7db5942015-01-28 10:07:51 -080076 __u16 avail_idx;
77 __le32 magic;
Christopher Ferris38062f92014-07-09 15:33:25 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080079};
Christopher Ferris38062f92014-07-09 15:33:25 -070080struct mic_vring {
Tao Baod7db5942015-01-28 10:07:51 -080081 struct vring vr;
82 struct _mic_vring_info * info;
Christopher Ferris38062f92014-07-09 15:33:25 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080084 void * va;
Tao Baod7db5942015-01-28 10:07:51 -080085 int len;
Christopher Ferris38062f92014-07-09 15:33:25 -070086};
87#define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8)
Christopher Ferris38062f92014-07-09 15:33:25 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -080089#ifndef INTEL_MIC_CARD
Christopher Ferris38062f92014-07-09 15:33:25 -070090#endif
91#define MIC_DP_SIZE 4096
92#define MIC_MAGIC 0xc0ffee00
Christopher Ferris05d08e92016-02-04 13:16:38 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070094enum mic_states {
Christopher Ferris05d08e92016-02-04 13:16:38 -080095 MIC_READY = 0,
96 MIC_BOOTING,
Tao Baod7db5942015-01-28 10:07:51 -080097 MIC_ONLINE,
Christopher Ferris05d08e92016-02-04 13:16:38 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 MIC_SHUTTING_DOWN,
Christopher Ferris05d08e92016-02-04 13:16:38 -0800100 MIC_RESETTING,
Tao Baod7db5942015-01-28 10:07:51 -0800101 MIC_RESET_FAILED,
Tao Baod7db5942015-01-28 10:07:51 -0800102 MIC_LAST
Christopher Ferris38062f92014-07-09 15:33:25 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800104};
Christopher Ferris38062f92014-07-09 15:33:25 -0700105enum mic_status {
Tao Baod7db5942015-01-28 10:07:51 -0800106 MIC_NOP = 0,
107 MIC_CRASHED,
Christopher Ferris38062f92014-07-09 15:33:25 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800109 MIC_HALTED,
Tao Baod7db5942015-01-28 10:07:51 -0800110 MIC_POWER_OFF,
111 MIC_RESTART,
112 MIC_STATUS_LAST
Christopher Ferris38062f92014-07-09 15:33:25 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris05d08e92016-02-04 13:16:38 -0800114};
Christopher Ferris38062f92014-07-09 15:33:25 -0700115#endif