Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hiomapd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
BangBMC Firmware
hiomapd
Commits
618a69ce
Commit
618a69ce
authored
Aug 31, 2019
by
Jonathan Currier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a unix socket transport interface
parent
6b8622a1
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
667 additions
and
3 deletions
+667
-3
Makefile.am
Makefile.am
+10
-1
configure.ac
configure.ac
+7
-0
control_unix.c
control_unix.c
+549
-0
include/hiomapd-socket.h
include/hiomapd-socket.h
+100
-0
mboxd.h
mboxd.h
+0
-1
protocol.c
protocol.c
+1
-1
No files found.
Makefile.am
View file @
618a69ce
...
...
@@ -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)
...
...
configure.ac
View file @
618a69ce
...
...
@@ -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])
[
...
...
control_unix.c
0 → 100644
View file @
618a69ce
This diff is collapsed.
Click to expand it.
include/hiomapd-socket.h
0 → 100644
View file @
618a69ce
#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
mboxd.h
View file @
618a69ce
...
...
@@ -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)
...
...
protocol.c
View file @
618a69ce
...
...
@@ -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
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment