blob: 0be024086eca0d5bfb94b7adec48bc4c9846feeb [file] [log] [blame]
Andrew Jeffery4fe996c2018-02-27 12:16:48 +10301/* SPDX-License-Identifier: Apache-2.0 */
2/* Copyright (C) 2018 IBM Corp. */
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +11003
4#ifndef MBOX_DBUS_H
5#define MBOX_DBUS_H
6
7#define DBUS_NAME "org.openbmc.mboxd"
8#define DOBJ_NAME "/org/openbmc/mboxd"
9
10/* Commands */
11#define DBUS_C_PING 0x00
12#define DBUS_C_DAEMON_STATE 0x01
13#define DBUS_C_RESET 0x02
14#define DBUS_C_SUSPEND 0x03
15#define DBUS_C_RESUME 0x04
16#define DBUS_C_MODIFIED 0x05
17#define DBUS_C_KILL 0x06
18#define DBUS_C_LPC_STATE 0x07
19#define NUM_DBUS_CMDS (DBUS_C_LPC_STATE + 1)
20
21/* Command Args */
22/* Resume */
23#define RESUME_NUM_ARGS 1
24#define RESUME_NOT_MODIFIED 0x00
25#define RESUME_FLASH_MODIFIED 0x01
26
27/* Return Values */
28#define DBUS_SUCCESS 0x00 /* Command Succeded */
29#define E_DBUS_INTERNAL 0x01 /* Internal DBUS Error */
30#define E_DBUS_INVAL 0x02 /* Invalid Command */
31#define E_DBUS_REJECTED 0x03 /* Daemon Rejected Request */
32#define E_DBUS_HARDWARE 0x04 /* BMC Hardware Error */
Suraj Jitindar Singhddf0edb2017-03-28 10:50:40 +110033#define E_DBUS_NO_MEM 0x05 /* Failed Memory Allocation */
Suraj Jitindar Singhe39c9162017-03-28 10:47:43 +110034
35/* Response Args */
36/* Status */
37#define DAEMON_STATE_NUM_ARGS 1
38#define DAEMON_STATE_ACTIVE 0x00 /* Daemon Active */
39#define DAEMON_STATE_SUSPENDED 0x01 /* Daemon Suspended */
40/* LPC State */
41#define LPC_STATE_NUM_ARGS 1
42#define LPC_STATE_INVALID 0x00 /* Invalid State */
43#define LPC_STATE_FLASH 0x01 /* LPC Maps Flash Directly */
44#define LPC_STATE_MEM 0x02 /* LPC Maps Memory */
45
46struct mbox_dbus_msg {
47 uint8_t cmd;
48 size_t num_args;
49 uint8_t *args;
50};
51
52#endif /* MBOX_DBUS_H */