blob: a9091e529183cdda0b0bda1b2d794341a0e237a2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
/*
* Intel MIC Platform Software Stack (MPSS)
*
* Copyright(c) 2013 Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License, version 2, as
* published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* The full GNU General Public License is included in this distribution in
* the file called "COPYING".
*
* Intel MIC driver.
*
*/
#ifndef __MIC_COMMON_H_
#define __MIC_COMMON_H_
#include <linux/types.h>
/**
* struct mic_bootparam: Virtio device independent information in device page
*
* @magic: A magic value used by the card to ensure it can see the host
* @c2h_shutdown_db: Card to Host shutdown doorbell set by host
* @h2c_shutdown_db: Host to Card shutdown doorbell set by card
* @h2c_config_db: Host to Card Virtio config doorbell set by card
* @shutdown_status: Card shutdown status set by card
* @shutdown_card: Set to 1 by the host when a card shutdown is initiated
*/
struct mic_bootparam {
__u32 magic;
__s8 c2h_shutdown_db;
__s8 h2c_shutdown_db;
__s8 h2c_config_db;
__u8 shutdown_status;
__u8 shutdown_card;
} __aligned(8);
/* Device page size */
#define MIC_DP_SIZE 4096
#define MIC_MAGIC 0xc0ffee00
/**
* enum mic_states - MIC states.
*/
enum mic_states {
MIC_OFFLINE = 0,
MIC_ONLINE,
MIC_SHUTTING_DOWN,
MIC_RESET_FAILED,
MIC_LAST
};
/**
* enum mic_status - MIC status reported by card after
* a host or card initiated shutdown or a card crash.
*/
enum mic_status {
MIC_NOP = 0,
MIC_CRASHED,
MIC_HALTED,
MIC_POWER_OFF,
MIC_RESTART,
MIC_STATUS_LAST
};
#endif
|