138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/****************************************************************************
238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ****************************************************************************
338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***
438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   This header was automatically generated from a Linux kernel header
538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   of the same name, to make information necessary for userspace to
638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   call into the kernel available to libc.  It contains only constants,
738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   structures, and macros generated from the original header, and thus,
838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   contains no copyrightable information.
938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***
1038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   To edit the content of this header, modify the corresponding
1138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   source file (e.g. under external/kernel-headers/original/) then
1238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   run bionic/libc/kernel/tools/update_all.py
1338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***
1438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   Any manual change here will be lost the next time this script will
1538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***   be run. You've been warned!
1638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ***
1738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ****************************************************************************
1838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris ****************************************************************************/
1938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#ifndef __MIC_COMMON_H_
2038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define __MIC_COMMON_H_
2138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#include <linux/virtio_ring.h>
2238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define __mic_align(a, x) (((a) + (x) - 1) & ~((x) - 1))
2338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
2438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct mic_device_desc {
2538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __s8 type;
2638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 num_vq;
2738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 feature_len;
2838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
2938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 config_len;
3038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 status;
3138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __le64 config[0];
3238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris} __attribute__ ((aligned(8)));
3338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
3438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct mic_device_ctrl {
3538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __le64 vdev;
3638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 config_change;
3738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 vdev_reset;
3838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
3938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 guest_ack;
4038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 host_ack;
4138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 used_address_updated;
4238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __s8 c2h_vdev_db;
4338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
4438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __s8 h2c_vdev_db;
4538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris} __attribute__ ((aligned(8)));
4638062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct mic_bootparam {
4738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __le32 magic;
4838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
4938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __s8 c2h_shutdown_db;
5038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __s8 h2c_shutdown_db;
5138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __s8 h2c_config_db;
5238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 shutdown_status;
5338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
5438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u8 shutdown_card;
5538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris} __attribute__ ((aligned(8)));
5638062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct mic_device_page {
5738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris struct mic_bootparam bootparam;
5838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
5938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris struct mic_device_desc desc[0];
6038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
6138062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct mic_vqconfig {
6238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __le64 address;
6338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
6438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __le64 used_address;
6538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __le16 num;
6638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris} __attribute__ ((aligned(8)));
6738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MIC_VIRTIO_RING_ALIGN 4096
6838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
6938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MIC_MAX_VRINGS 4
7038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MIC_VRING_ENTRIES 128
7138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MIC_MAX_VRING_ENTRIES 128
7238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MIC_MAX_DESC_BLK_SIZE 256
7338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
7438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct _mic_vring_info {
7538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __u16 avail_idx;
7638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris __le32 magic;
7738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
7838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
7938062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisstruct mic_vring {
8038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris struct vring vr;
8138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris struct _mic_vring_info *info;
8238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris void *va;
8338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
8438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris int len;
8538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
8638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define mic_aligned_desc_size(d) __mic_align(mic_desc_size(d), 8)
8738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#ifndef INTEL_MIC_CARD
8838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
8938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#endif
9038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MIC_DP_SIZE 4096
9138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#define MIC_MAGIC 0xc0ffee00
9238062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisenum mic_states {
9338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
9438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_OFFLINE = 0,
9538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_ONLINE,
9638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_SHUTTING_DOWN,
9738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_RESET_FAILED,
9838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
9938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_SUSPENDING,
10038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_SUSPENDED,
10138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_LAST
10238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
10338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
10438062f954c637861348dd8078cefb73554e6f12cChristopher Ferrisenum mic_status {
10538062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_NOP = 0,
10638062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_CRASHED,
10738062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_HALTED,
10838062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
10938062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_POWER_OFF,
11038062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_RESTART,
11138062f954c637861348dd8078cefb73554e6f12cChristopher Ferris MIC_STATUS_LAST
11238062f954c637861348dd8078cefb73554e6f12cChristopher Ferris};
11338062f954c637861348dd8078cefb73554e6f12cChristopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
11438062f954c637861348dd8078cefb73554e6f12cChristopher Ferris#endif
115