1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491 */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG. */
5 /* This program is free software: you can redistribute it and/or modify */
6 /* it under the terms of the GNU General Public License as published by */
7 /* the Free Software Foundation, either version 2 of the License, or */
8 /* (at your option) any later version. */
10 /* This program is distributed in the hope that it will be useful, */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
13 /* GNU General Public License for more details. */
15 /* You should have received a copy of the GNU General Public License */
16 /* along with this program. If not, see <http://www.gnu.org/licenses/>. */
18 /* You may also obtain this software under a propriety license from Microchip. */
19 /* Please contact Microchip for further information. */
20 /*------------------------------------------------------------------------------------------------*/
24 * \brief Internal header file of LLD Message Pool
26 * \cond UCS_INTERNAL_DOC
34 /*------------------------------------------------------------------------------------------------*/
36 /*------------------------------------------------------------------------------------------------*/
37 #include "ucs_rules.h"
39 #include "ucs_lld_pb.h"
40 #include "ucs_message.h"
47 /*------------------------------------------------------------------------------------------------*/
49 /*------------------------------------------------------------------------------------------------*/
50 /*! \brief Number of LLD Tx handles dedicated to each FIFO */
51 #define LLDP_NUM_HANDLES 5U
53 /*------------------------------------------------------------------------------------------------*/
55 /*------------------------------------------------------------------------------------------------*/
56 /*! \brief Internal LLD Tx message */
57 typedef struct Lld_IntTxMsg_
59 Ucs_Lld_TxMsg_t lld_msg; /*!< \brief Contains the public LLD Tx message
60 * \details This attribute needs to be the first one in this structure
62 CDlNode node; /*!< \brief Node required for queuing */
63 CMessage *msg_ptr; /*!< \brief Reference to the associated common message object, or
64 * \c NULL if the object is a command */
65 void *owner_ptr; /*!< \brief Points to the FIFO which owns the message object
66 * or NULL if the object is a command */
70 /*! \brief Internal LLD Rx message */
71 typedef struct Lld_IntRxMsg_
73 Ucs_Lld_RxMsg_t lld_msg; /*!< \brief Contains the public LLD Rx message
74 * \details This attribute needs to be the first one in this structure
76 CMessage *msg_ptr; /*!< \brief Reference to the associated common message object*/
80 /*! \brief The class CLldPool*/
81 typedef struct CLldPool_
83 CDlList list; /*!< \brief Points to the first available message in Tx pool */
84 Lld_IntTxMsg_t messages[LLDP_NUM_HANDLES];/*!< \brief Available messages in Tx pool */
88 /*------------------------------------------------------------------------------------------------*/
89 /* Function prototypes */
90 /*------------------------------------------------------------------------------------------------*/
91 extern void Lldp_Ctor(CLldPool *self, void *owner_ptr, void *ucs_user_ptr);
92 extern void Lldp_ReturnTxToPool(CLldPool *self, Lld_IntTxMsg_t *msg_ptr);
93 extern Lld_IntTxMsg_t* Lldp_GetTxFromPool(CLldPool *self);
100 #endif /* UCS_LLDPOOL_H */
107 /*------------------------------------------------------------------------------------------------*/
109 /*------------------------------------------------------------------------------------------------*/