summaryrefslogtreecommitdiff
path: root/cleopatre/devkit/plcdrv/inc/processing.h
diff options
context:
space:
mode:
Diffstat (limited to 'cleopatre/devkit/plcdrv/inc/processing.h')
-rw-r--r--cleopatre/devkit/plcdrv/inc/processing.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/cleopatre/devkit/plcdrv/inc/processing.h b/cleopatre/devkit/plcdrv/inc/processing.h
new file mode 100644
index 0000000000..64f607d46e
--- /dev/null
+++ b/cleopatre/devkit/plcdrv/inc/processing.h
@@ -0,0 +1,112 @@
+#ifndef processing_h
+#define processing_h
+/* Cleopatre project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file processing.h
+ * \brief interfaces for processing layer
+ * \ingroup Cleopatre - PlcDrv
+ *
+ * this file content interfaces and exported macros, variables... For the
+ * processing layer
+ */
+
+#include "common.h"
+
+/** Define HPAV Ethernet type */
+#define ETH_P_HPAV 0x88E1
+/** Define MME fcall type */
+#define HPAV_MME_P_FCALL 0xA006
+/** Define MME sniffer type */
+#define HPAV_MME_P_SNIFFER 0xA02C
+#define HPAV_MME_P_VS_BASE 0xA000
+#define HPAV_MME_P_DRV_BASE 0xB000
+#define HPAV_MME_P_MS_BASE 0x8000
+
+/** processing layer context structure */
+struct processctx {
+ uint8_t board_addr[ETH_ALEN];
+ uint8_t broadcast_addr[ETH_ALEN];
+};
+
+/**
+ * Find the Ethernet MME type.
+ *
+ * \param eth_frame Ethernet frame pointer.
+ * \return HPAV MME type.
+ */
+uint16_t get_eth_mme_type(uint8_t* eth_frame);
+
+/**
+ * Initialize the processing layer.
+ *
+ * \param info initialisation structure.
+ * \param dev network device structure
+ * \return error code.
+ */
+int processing_init(struct init_info *info, struct net_device *dev);
+
+/**
+ * UnInitialize the processing layer.
+ *
+ * \return error code.
+ */
+int processing_uninit(void);
+
+/**
+ * Processing procedure to add a buffer to CESAR.
+ *
+ * \param pointer buffer pointer.
+ * \param type type of the message pointed.
+ * \return error code.
+ */
+int processing_buffer_add(void *pointer, enum buffer_type type);
+
+/**
+ * Processing procedure to release a buffer from CESAR.
+ *
+ * \param pointer buffer pointer.
+ * \return error code.
+ */
+int processing_buffer_free(void *pointer);
+
+/**
+ * Processing procedure for a A->L message.
+ *
+ * \param pointer buffer pointer.
+ * \param length length of the message pointed.
+ * \return status queue.
+ */
+int processing_send(void *pointer, int length, buffer_type_t type);
+
+/**
+ * Processing procedure for a L->A message.
+ *
+ * \param pointer buffer pointer.
+ * \param length length of the message pointed.
+ * \param type type of message.
+ * \return error code.
+ */
+int processing_receive(void *pointer, int length, enum buffer_type type);
+
+/**
+ * Send a debug dump buffer to be filled by leon.
+ *
+ * \param buffer debug dump buffer to be filled.
+ * \return error code.
+ */
+int processing_debug_dump_buffer_send(void *buffer);
+
+/**
+ * Process a debug dump buffer for a leon to arm message.
+ * \param buffer debug dump buffer received
+ * \param length length of debug dump buffer received
+ */
+int processing_debug_dump_buffer_receive(void *buffer, int length);
+
+#endif /* processing_h */