summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2018-08-09 13:57:46 +0930
committerAndrew Jeffery <andrew@aj.id.au>2018-09-12 15:05:51 +0930
commitf21c81c7190e47bd0d5753a5ea3531bcb57c74de (patch)
tree3340062ac81a7d8122958e62572fe79eee244cfd
parent8eab21516a6c4395c6f4f4d630e00c04f6ece6cf (diff)
downloadphosphor-mboxbridge-f21c81c7190e47bd0d5753a5ea3531bcb57c74de.tar.gz
phosphor-mboxbridge-f21c81c7190e47bd0d5753a5ea3531bcb57c74de.zip
transport: mbox: Drop handler functions from header
Change-Id: If9dbb4e3ac849abc8651285f95025a9b53a35753 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
-rw-r--r--protocol.c9
-rw-r--r--transport_mbox.c22
-rw-r--r--transport_mbox.h22
3 files changed, 18 insertions, 35 deletions
diff --git a/protocol.c b/protocol.c
index 2bd91ab..c66f2df 100644
--- a/protocol.c
+++ b/protocol.c
@@ -90,9 +90,14 @@ int protocol_v1_create_window(struct mbox_context *context,
/* Close the current window if there is one */
if (context->current) {
- /* There is an implicit flush if it was a write window */
+ /* There is an implicit flush if it was a write window
+ *
+ * protocol_v2_create_window() calls
+ * protocol_v1_create_window(), so use indirect call to
+ * write_flush() to make sure we pick the right one.
+ */
if (context->current_is_write) {
- rc = mbox_handle_flush_window(context, NULL, NULL);
+ rc = context->protocol->flush(context, NULL);
if (rc < 0) {
MSG_ERR("Couldn't Flush Write Window\n");
return rc;
diff --git a/transport_mbox.c b/transport_mbox.c
index b0e0c04..fcc4430 100644
--- a/transport_mbox.c
+++ b/transport_mbox.c
@@ -172,7 +172,7 @@ int clr_bmc_events(struct mbox_context *context, uint8_t bmc_event,
* Reset the LPC mapping to point back at the flash, or memory in case we're
* using a virtual pnor.
*/
-int mbox_handle_reset(struct mbox_context *context,
+static int mbox_handle_reset(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
return context->protocol->reset(context);
@@ -200,7 +200,7 @@ int mbox_handle_reset(struct mbox_context *context,
* RESP[3:4]: Default write window size (number of blocks)
* RESP[5]: Block size (as shift)
*/
-int mbox_handle_mbox_info(struct mbox_context *context,
+static int mbox_handle_mbox_info(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
uint8_t mbox_api_version = req->msg.args[0];
@@ -237,7 +237,7 @@ int mbox_handle_mbox_info(struct mbox_context *context,
* RESP[0:1]: Flash Size (number of blocks)
* RESP[2:3]: Erase Size (number of blocks)
*/
-int mbox_handle_flash_info(struct mbox_context *context,
+static int mbox_handle_flash_info(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
struct protocol_get_flash_info io;
@@ -287,7 +287,7 @@ static inline uint16_t get_lpc_addr_shifted(struct mbox_context *context)
return lpc_addr >> context->block_size_shift;
}
-int mbox_handle_create_window(struct mbox_context *context, bool ro,
+static int mbox_handle_create_window(struct mbox_context *context, bool ro,
union mbox_regs *req, struct mbox_msg *resp)
{
struct protocol_create_window io;
@@ -329,7 +329,7 @@ int mbox_handle_create_window(struct mbox_context *context, bool ro,
* RESP[0:1]: LPC bus address for host to access this window (number of blocks)
* RESP[2:3]: Actual window size that the host can access (number of blocks)
*/
-int mbox_handle_read_window(struct mbox_context *context,
+static int mbox_handle_read_window(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
return mbox_handle_create_window(context, true, req, resp);
@@ -354,7 +354,7 @@ int mbox_handle_read_window(struct mbox_context *context,
* RESP[0:1]: LPC bus address for host to access this window (number of blocks)
* RESP[2:3]: Actual window size that was mapped/host can access (n.o. blocks)
*/
-int mbox_handle_write_window(struct mbox_context *context,
+static int mbox_handle_write_window(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
return mbox_handle_create_window(context, false, req, resp);
@@ -376,7 +376,7 @@ int mbox_handle_write_window(struct mbox_context *context,
* ARGS[0:1]: Where within window to start (number of blocks)
* ARGS[2:3]: Number to mark dirty (number of blocks)
*/
-int mbox_handle_dirty_window(struct mbox_context *context,
+static int mbox_handle_dirty_window(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
struct protocol_mark_dirty io;
@@ -405,7 +405,7 @@ int mbox_handle_dirty_window(struct mbox_context *context,
* ARGS[0:1]: Where within window to start (number of blocks)
* ARGS[2:3]: Number to erase (number of blocks)
*/
-int mbox_handle_erase_window(struct mbox_context *context,
+static int mbox_handle_erase_window(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
struct protocol_erase io;
@@ -438,7 +438,7 @@ int mbox_handle_erase_window(struct mbox_context *context,
* V2:
* NONE
*/
-int mbox_handle_flush_window(struct mbox_context *context,
+static int mbox_handle_flush_window(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
struct protocol_flush io = { 0 };
@@ -462,7 +462,7 @@ int mbox_handle_flush_window(struct mbox_context *context,
* V2:
* ARGS[0]: FLAGS
*/
-int mbox_handle_close_window(struct mbox_context *context,
+static int mbox_handle_close_window(struct mbox_context *context,
union mbox_regs *req, struct mbox_msg *resp)
{
struct protocol_close io = { 0 };
@@ -480,7 +480,7 @@ int mbox_handle_close_window(struct mbox_context *context,
*
* ARGS[0]: Bitmap of bits to ack (by clearing)
*/
-int mbox_handle_ack(struct mbox_context *context, union mbox_regs *req,
+static int mbox_handle_ack(struct mbox_context *context, union mbox_regs *req,
struct mbox_msg *resp)
{
struct protocol_ack io;
diff --git a/transport_mbox.h b/transport_mbox.h
index d911b7b..aebf3bd 100644
--- a/transport_mbox.h
+++ b/transport_mbox.h
@@ -21,26 +21,4 @@ int dispatch_mbox(struct mbox_context *context);
int init_mbox_dev(struct mbox_context *context);
void free_mbox_dev(struct mbox_context *context);
-/* Command handlers */
-int mbox_handle_reset(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_mbox_info(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_flash_info(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_read_window(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_close_window(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_write_window(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_dirty_window(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_flush_window(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-int mbox_handle_ack(struct mbox_context *context, union mbox_regs *req,
- struct mbox_msg *resp);
-int mbox_handle_erase_window(struct mbox_context *context,
- union mbox_regs *req, struct mbox_msg *resp);
-
#endif /* MBOXD_MSG_H */
OpenPOWER on IntegriCloud