This source file includes following definitions.
- kcs_bmc_priv
1
2
3
4
5
6 #ifndef __KCS_BMC_H__
7 #define __KCS_BMC_H__
8
9 #include <linux/miscdevice.h>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33 enum kcs_phases {
34 KCS_PHASE_IDLE,
35
36 KCS_PHASE_WRITE_START,
37 KCS_PHASE_WRITE_DATA,
38 KCS_PHASE_WRITE_END_CMD,
39 KCS_PHASE_WRITE_DONE,
40
41 KCS_PHASE_WAIT_READ,
42 KCS_PHASE_READ,
43
44 KCS_PHASE_ABORT_ERROR1,
45 KCS_PHASE_ABORT_ERROR2,
46 KCS_PHASE_ERROR
47 };
48
49
50 enum kcs_errors {
51 KCS_NO_ERROR = 0x00,
52 KCS_ABORTED_BY_COMMAND = 0x01,
53 KCS_ILLEGAL_CONTROL_CODE = 0x02,
54 KCS_LENGTH_ERROR = 0x06,
55 KCS_UNSPECIFIED_ERROR = 0xFF
56 };
57
58
59
60
61
62
63 struct kcs_ioreg {
64 u32 idr;
65 u32 odr;
66 u32 str;
67 };
68
69 struct kcs_bmc {
70 spinlock_t lock;
71
72 u32 channel;
73 int running;
74
75
76 struct kcs_ioreg ioreg;
77 u8 (*io_inputb)(struct kcs_bmc *kcs_bmc, u32 reg);
78 void (*io_outputb)(struct kcs_bmc *kcs_bmc, u32 reg, u8 b);
79
80 enum kcs_phases phase;
81 enum kcs_errors error;
82
83 wait_queue_head_t queue;
84 bool data_in_avail;
85 int data_in_idx;
86 u8 *data_in;
87
88 int data_out_idx;
89 int data_out_len;
90 u8 *data_out;
91
92 struct mutex mutex;
93 u8 *kbuffer;
94
95 struct miscdevice miscdev;
96
97 unsigned long priv[];
98 };
99
100 static inline void *kcs_bmc_priv(struct kcs_bmc *kcs_bmc)
101 {
102 return kcs_bmc->priv;
103 }
104
105 int kcs_bmc_handle_event(struct kcs_bmc *kcs_bmc);
106 struct kcs_bmc *kcs_bmc_alloc(struct device *dev, int sizeof_priv,
107 u32 channel);
108 #endif