1/*
2 * Copyright 2008-2012 Freescale Semiconductor Inc.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *     * Redistributions of source code must retain the above copyright
7 *       notice, this list of conditions and the following disclaimer.
8 *     * Redistributions in binary form must reproduce the above copyright
9 *       notice, this list of conditions and the following disclaimer in the
10 *       documentation and/or other materials provided with the distribution.
11 *     * Neither the name of Freescale Semiconductor nor the
12 *       names of its contributors may be used to endorse or promote products
13 *       derived from this software without specific prior written permission.
14 *
15 *
16 * ALTERNATIVELY, this software may be distributed under the terms of the
17 * GNU General Public License ("GPL") as published by the Free Software
18 * Foundation, either version 2 of that License or (at your option) any
19 * later version.
20 *
21 * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY
22 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY
25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33
34/******************************************************************************
35 @File          fm_replic.h
36
37 @Description   FM frame replicator
38*//***************************************************************************/
39#ifndef __FM_REPLIC_H
40#define __FM_REPLIC_H
41
42#include "std_ext.h"
43#include "error_ext.h"
44
45
46#define FRM_REPLIC_SOURCE_TD_OPCODE           0x75
47#define NEXT_FRM_REPLIC_ADDR_SHIFT            4
48#define NEXT_FRM_REPLIC_MEMBER_INDEX_SHIFT    16
49#define FRM_REPLIC_FR_BIT                     0x08000000
50#define FRM_REPLIC_NL_BIT                     0x10000000
51#define FRM_REPLIC_INVALID_MEMBER_INDEX       0xffff
52#define FRM_REPLIC_FIRST_MEMBER_INDEX         0
53
54#define FRM_REPLIC_MIDDLE_MEMBER_INDEX        1
55#define FRM_REPLIC_LAST_MEMBER_INDEX          2
56
57#define SOURCE_TD_ITSELF_OPTION               0x01
58#define SOURCE_TD_COPY_OPTION                 0x02
59#define SOURCE_TD_ITSELF_AND_COPY_OPTION      SOURCE_TD_ITSELF_OPTION | SOURCE_TD_COPY_OPTION
60#define SOURCE_TD_NONE                        0x04
61
62/*typedef enum e_SourceTdOption
63{
64    e_SOURCE_TD_NONE = 0,
65    e_SOURCE_TD_ITSELF_OPTION = 1,
66    e_SOURCE_TD_COPY_OPTION = 2,
67    e_SOURCE_TD_ITSELF_AND_COPY_OPTION = e_SOURCE_TD_ITSELF_OPTION | e_SOURCE_TD_COPY_OPTION
68} e_SourceTdOption;
69*/
70
71typedef struct
72{
73    volatile uint32_t type;
74    volatile uint32_t frGroupPointer;
75    volatile uint32_t operationCode;
76    volatile uint32_t reserved;
77} t_FrmReplicGroupSourceAd;
78
79typedef struct t_FmPcdFrmReplicMember
80{
81    void                        *p_MemberAd;    /**< pointer to the member AD */
82    void                        *p_StatisticsAd;/**< pointer to the statistics AD of the member */
83    t_Handle                    h_Manip;        /**< manip handle - need for free routines */
84    t_List                      node;
85} t_FmPcdFrmReplicMember;
86
87typedef struct t_FmPcdFrmReplicGroup
88{
89    t_Handle                    h_FmPcd;
90
91    uint8_t                     maxNumOfEntries;/**< maximal number of members in the group */
92    uint8_t                     numOfEntries;   /**< actual number of members in the group */
93    uint16_t                    owners;         /**< how many keys share this frame replicator group */
94    void                        *p_SourceTd;     /**< pointer to the frame replicator source table descriptor */
95    t_List                      membersList;    /**< the members list - should reflect the order of the members as in the hw linked list*/
96    t_List                      availableMembersList;/**< list of all the available members in the group */
97    t_FmPcdLock                 *p_Lock;
98} t_FmPcdFrmReplicGroup;
99
100
101#endif /* __FM_REPLIC_H */
102