summaryrefslogtreecommitdiff
path: root/cesar/hal/hle/ipmbox.h
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/hal/hle/ipmbox.h')
-rw-r--r--cesar/hal/hle/ipmbox.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/cesar/hal/hle/ipmbox.h b/cesar/hal/hle/ipmbox.h
new file mode 100644
index 0000000000..077a778a8e
--- /dev/null
+++ b/cesar/hal/hle/ipmbox.h
@@ -0,0 +1,62 @@
+#ifndef hal_hle_ipmbox_h
+#define hal_hle_ipmbox_h
+/* Cesar project {{{
+ *
+ * Copyright (C) 2007 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file hal/hle/ipmbox.h
+ * \brief HAL HLE public interface.
+ * \ingroup hal_hle
+ */
+#include "hal/hle/forward.h" // for 'ipmbox_t'
+
+/**
+ * RX DSR callback function.
+ * \param user_data user data
+ * \param first_msg pointer to the first received message header
+ * \param length total length (in word) of received messages
+ */
+typedef void (*ipmbox_rx_cb_t) (void *user_data, u32 *first_msg, uint length);
+
+BEGIN_DECLS
+
+/**
+ * Initialise the HAL HLE.
+ * \param user_data user data passed to any callback
+ * \param rx_cb RX DSR callback, callback used when an Ethernet packet is received
+ * \return the newly created context
+ */
+ipmbox_t *
+ipmbox_init (void *user_data, ipmbox_rx_cb_t rx_cb);
+
+/**
+ * Activate ipmbox interruptions.
+ * \param ctx ipmbox context
+ * \param activation indicates if interruptions are activated or deactivated
+ */
+void
+ipmbox_activate (ipmbox_t *ctx, bool activation);
+
+/**
+ * Uninitialise the HAL HLE.
+ * \param ctx ipmbox context
+ */
+void
+ipmbox_uninit (ipmbox_t *ctx);
+
+/**
+ * Transmit an Ethernet packet.
+ * \param ctx ipmbox context
+ * \param first_msg pointer to the first received message header
+ * \param length total length (in word) of messages to transmit
+ */
+void
+ipmbox_tx (ipmbox_t *ctx, u32 *first_msg, uint length);
+
+END_DECLS
+
+#endif /* hal_hle_ipmbox_h */