blob: 44a2f913720174ba4f3b103c17609aaa3e2d87ed [file] [log] [blame]
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +11001/*
2 * Copyright 2016 IBM
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 *
16 */
17
18#ifndef MBOXD_MSG_H
19#define MBOXD_MSG_H
20
21#define NO_BMC_EVENT false
22#define SET_BMC_EVENT true
23
24struct mbox_msg {
25 uint8_t command;
26 uint8_t seq;
27 uint8_t args[MBOX_ARGS_BYTES];
28 uint8_t response;
29};
30
31union mbox_regs {
32 char raw[MBOX_REG_BYTES];
33 struct mbox_msg msg;
34};
35
36int set_bmc_events(struct mbox_context *context, uint8_t bmc_event,
37 bool write_back);
38int clr_bmc_events(struct mbox_context *context, uint8_t bmc_event,
39 bool write_back);
40int dispatch_mbox(struct mbox_context *context);
41int init_mbox_dev(struct mbox_context *context);
42void free_mbox_dev(struct mbox_context *context);
43
44#endif /* MBOXD_MSG_H */