#ifndef common_ipmbox_protocol_h #define common_ipmbox_protocol_h /* Cesar project {{{ * * Copyright (C) 2012 Spidcom * * <<>> * * }}} */ /** * \file common/ipmbox/protocol.h * \brief IPMbox protocol defines */ #include "queue.h" #include "msg.h" /** * Protocol version. * It must be changed when protocol is modified and is not compatible with * previous version. It is stored on a 32 bits. */ #define IPMBOX_PROTOCOL_VERSION 43 /** * Queues sizes in words. * On the TX side (A2L MBX & DATA, L2A EMPTY BUF): * - L2A_EMPTY_BUF >= A2L_MBX / MSG_MBX_WORDS + A2L_DATA / MSG_DATA_WORDS * On the RX side (L2A MBX & DATA, A2L EMPTY BUF): * - L2A_DATA / MSG_DATA_WORDS = A2L_EMPTY_BUF * - L2A_MBX / MSG_MBX_WORDS = A2L_EMPTY_BUF (but this is a worst case, in * real life things are not that bad, we take the risk) */ #define IPMBOX_PROTOCOL_QUEUE_SIZE_A2L_MBX (32 * IPMBOX_MSG_MBX_WORDS) #define IPMBOX_PROTOCOL_QUEUE_SIZE_A2L_DATA (256 * IPMBOX_MSG_DATA_WORDS) #define IPMBOX_PROTOCOL_QUEUE_SIZE_L2A_EMPTY_BUF (256 + 32) #define IPMBOX_PROTOCOL_QUEUE_SIZE_L2A_MBX (32 * IPMBOX_MSG_MBX_WORDS) #define IPMBOX_PROTOCOL_QUEUE_SIZE_L2A_DATA (256 * IPMBOX_MSG_DATA_WORDS) #define IPMBOX_PROTOCOL_QUEUE_SIZE_A2L_EMPTY_BUF (256) /** * Initialisation of IPMbox structure. */ typedef struct ipmbox_protocol_init_t { /** Version. */ u32 version; /** Pointer to shared memory. */ volatile ipmbox_queue_ptr_t *shared_mem; /** Table of queues size. */ u32 queue_size[IPMBOX_QUEUE_TYPE_NB][IPMBOX_QUEUE_DIRECTION_NB]; } ipmbox_protocol_init_t; #endif /* common_ipmbox_protocol_h */