Commit 618a69ce authored by Jonathan Currier's avatar Jonathan Currier

Add a unix socket transport interface

parent 6b8622a1
......@@ -17,6 +17,11 @@ mboxd_SOURCES = \
mboxd_LINK = $(LINK)
if ENABLE_UNIX_SOCKET_TRANSPORT
mboxd_SOURCES += \
control_unix.c
endif
if HAVE_MBOX_TRANSPORT
mboxd_SOURCES += \
transport_mbox.c
......@@ -32,6 +37,8 @@ endif
mboxd_LDFLAGS = $(LIBSYSTEMD_LIBS)
mboxd_CFLAGS = $(LIBSYSTEMD_CFLAGS)
include_HEADERS = $(srcdir)/include/hiomapd-socket.h
# MTD Backing storage
include mtd/Makefile.am.include
......@@ -59,7 +66,9 @@ check_PROGRAMS =
XFAIL_TESTS =
AM_LIBS = $(CODE_COVERAGE_LIBS)
AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) -UNDEBUG
AM_CPPFLAGS = $(CODE_COVERAGE_CPPFLAGS) -UNDEBUG -I$(srcdir)/include
AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
......
......@@ -45,6 +45,13 @@ AS_IF([test "x$enable_oe_sdk" == "xyes"],
AC_SUBST([OESDK_TESTCASE_FLAGS], [$testcase_flags])
)
AC_ARG_ENABLE([unix-socket-transport],
AS_HELP_STRING([--enable-unix-socket-transport], [Turn on unix socket control interface]))
AS_IF([test "x$enable_unix_socket_transport" == "xyes"],
AM_CONDITIONAL(ENABLE_UNIX_SOCKET_TRANSPORT, true),
AM_CONDITIONAL(ENABLE_UNIX_SOCKET_TRANSPORT, false))
AC_ARG_ENABLE([virtual-pnor],
AS_HELP_STRING([--enable-virtual-pnor], [Turn on virtual pnor])
[
......
This diff is collapsed.
#ifndef HIOMAPD_SOCKET_H
#define HIOMAPD_SOCKET_H
#include <stdint.h>
/* hiomapd unix socket cmd->husc
* hiomapd unix socket transport->hust
* some of these are redundant or won't ever
* be implemented, but they are hear to mark was the only interface
* provided*/
enum {
husc_invalid = 0,
/* This is an invalid message, it is only used on responses */
husx_response = 1,
/* control functions */
husc_ping,
husc_reset,
husc_kill,
husc_markflashmodified,
husc_suspend,
husc_resume,
husc_setbackend,
husc_daemonstate,
husc_lpcstate,
/* transport functions */
hust_reset,
hust_getinfo,
hust_getflashinfo,
hust_createreadwindow,
hust_createwritewindow,
hust_closewindow,
hust_markdirty,
hust_flush,
hust_ack,
hust_erase,
/*v3 options? */
hust_getflashname,
hust_lock,
/* Properties...
* It may be simpler to just emita properties byte
* over the socket interface
*/
hust_flashcontrollost,
hust_daemonready,
hust_protocolreset,
hust_windowreset,
/* end of list marker */
husx_api_limit
};
/*
* Each request type will use a different number of args.
* argument usage and placement is request defined.
*
*/
struct unix_hiomapd_request {
uint32_t request;
uint32_t args[7];
};
/* request info blocks */
/* arguments who's type is smaller than uint32_t will be truncated down to size
* so for example: a uin16_t in argument zero would only use the bottom 16 bit,
* the next argument will be in arg1.
* also note: these are all native endian encoded.
*
* responses: the first response argument is the status byte,
* the second is the number of additional arguments (extranious?)
*/
/* hust_createreadwindow
*
* Takes two arguments:
* arg[0]: window offset (uint16_t)
* arg[1]: window size (uint16_t)
*
* TODO: how exactly does hiomapd use these values.
* It looks like they are in units of 'page size'
*
*/
/* hust_createwritewindow
*
* Takes two arguments:
* arg[0]: window offset (uint16_t)
* arg[1]: window size (uint16_t)
*
* TODO: how exactly does hiomapd use these values.
* It looks like they are in units of 'page size'
*
*/
/* hust_ack
*
* Take on argument:
* arg[0]: flags
*
*/
#endif
......@@ -44,7 +44,6 @@ enum api_version {
BMC_EVENT_FLASH_CTRL_LOST | \
BMC_EVENT_DAEMON_READY)
#define MAPS_FLASH (1 << 0)
#define MAPS_MEM (1 << 1)
#define STATE_SUSPENDED (1 << 7)
......
......@@ -62,7 +62,7 @@ int protocol_events_set(struct mbox_context *context, uint8_t bmc_event)
context->bmc_events |= bmc_event;
return (context->transport) ?
context->transport->set_events(context, bmc_event, mask) :
context->transport->ops->set_events(context, bmc_event, mask) :
(mbox_log(LOG_ERR, "Called %s, but transport not assigned", __func__), -1);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment