xref: /openbmc/phosphor-mboxd/mboxd_msg.h (revision 04e8ffda)
1 /*
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 
24 struct mbox_msg {
25 	uint8_t command;
26 	uint8_t seq;
27 	uint8_t args[MBOX_ARGS_BYTES];
28 	uint8_t response;
29 };
30 
31 union mbox_regs {
32 	char raw[MBOX_REG_BYTES];
33 	struct mbox_msg msg;
34 };
35 
36 int set_bmc_events(struct mbox_context *context, uint8_t bmc_event,
37 		   bool write_back);
38 int clr_bmc_events(struct mbox_context *context, uint8_t bmc_event,
39 		   bool write_back);
40 int dispatch_mbox(struct mbox_context *context);
41 int init_mbox_dev(struct mbox_context *context);
42 void free_mbox_dev(struct mbox_context *context);
43 
44 #endif /* MBOXD_MSG_H */
45