source: svn/trunk/newcon3bcm2_21bu/magnum/portinginterface/xpt/7552/bxpt_sam.h

Last change on this file was 2, checked in by jglee, 11 years ago

first commit

  • Property svn:executable set to *
File size: 8.9 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2003-2011, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bxpt_sam.h $
11 * $brcm_Revision: Hydra_Software_Devel/2 $
12 * $brcm_Date: 12/15/11 2:32p $
13 *
14 * Module Description: Portting interface for the Special Address Mode PSI
15 * filters.
16 *
17 * Revision History:
18 *
19 * $brcm_Log: /magnum/portinginterface/xpt/base2/bxpt_sam.h $
20 *
21 * Hydra_Software_Devel/2   12/15/11 2:32p gmullen
22 * SW7425-1952: Merged changes to mainline
23 *
24 * Hydra_Software_Devel/SW7425-1952/1   12/14/11 4:14p gmullen
25 * SW7425-1952: Updated SAM API to use buffer index rather than PID
26 * channel number
27 *
28 * Hydra_Software_Devel/1   10/25/10 2:09p gmullen
29 * SW7425-15: Moved srcs to base2 folder
30 *
31 * Hydra_Software_Devel/1   10/8/10 2:58p gmullen
32 * SW7425-15: Added header files
33 *
34 * Hydra_Software_Devel/1   5/13/05 1:27p gmullen
35 * PR15309: First draft of XPT PI.
36 *
37 *
38 ***************************************************************************/
39 
40#ifndef BXPT_SAM_H
41#define BXPT_SAM_H
42
43#include "bxpt.h"
44
45#ifdef __cplusplus
46extern "C"{
47#endif
48
49/*=************************ Module Overview ********************************
50Overview:
51
52This module is the porting interface for the Special Addressing Mode of the
53PSI filters.
54
55Note that on some architectures, not all PID channels support SAM filtering.
56For the 7038, only the first 32 PID channels can use the SAM filters.
57
58If SAM filtering is done in conjunction with normal PSI section filtering,
59the sections must pass BOTH types of filtering in order to be accepted (and
60therefore routed to the DRAM buffers for host access).
61***************************************************************************/
62
63/***************************************************************************
64Summary:
65Used to define the sizes of the various SAM addreses, in bytes.
66****************************************************************************/
67#define BXPT_SAM_40BIT_ADDR_SIZE        ( 5 )
68#define BXPT_M24_ADDR_SIZE                      ( 3 )
69#define BXPT_M16_ADDR_SIZE                      ( 2 )
70
71/***************************************************************************
72Summary:
73Multicast 16 address filters.
74
75Description:
76This structure contains the 4 multicast-16 address filters for each PID
77channel 0-31. These address filters are used in the PSI SAM filter when
78M16En is true for a PID channel.
79
80The address bytes are stored in the arrays MSB first.
81***************************************************************************/
82typedef struct BXPT_SAM_M16Addresses
83{
84        uint8_t Address0[ BXPT_M16_ADDR_SIZE ];
85        uint8_t Address1[ BXPT_M16_ADDR_SIZE ];
86        uint8_t Address2[ BXPT_M16_ADDR_SIZE ];
87        uint8_t Address3[ BXPT_M16_ADDR_SIZE ];
88}
89BXPT_SAM_M16Addresses;
90
91/***************************************************************************
92Summary:
9340-bit address filters, with wildcard configuration.
94
95Description:
96This structure contains the 40 address filter used by the Type 0/1 Network
97address and Type 0/1 M40 address filters. Also included are the wildcard
98configurations.
99
100The address bytes are stored in the arrays MSB first.
101***************************************************************************/
102typedef struct BXPT_SAM_40BitAddr
103{
104        bool WildCardByteMode;          /* Byte mode if true, nibble mode if false. */
105        bool WildCardEnable;            /* Enable wildard use. */
106        uint8_t AddressWildcard;
107        uint8_t Address[ BXPT_SAM_40BIT_ADDR_SIZE ];   
108}
109BXPT_SAM_40BitAddr;
110
111/***************************************************************************
112Summary:
113Special Addressing Mode configuration.
114
115Description:
116Address filters for the Physical, Network, M24, and M40 addresses. These
117values are global to all PID channels that use enable the respective SAM
118filter. The IdRejectHiLimit and IdRejectLowLimit are also global.
119
120The address bytes are stored in the arrays MSB first.
121***************************************************************************/
122typedef struct BXPT_SAMAddresses
123{
124        /* Singlecast or physical address. */
125        uint8_t PhysicalAddr[ BXPT_SAM_40BIT_ADDR_SIZE ];
126
127        /* Type 0 network address. Global for all PID channels that enable it. */
128        BXPT_SAM_40BitAddr Type0NetworkAddr;
129
130        /* Type 1 network address. Global for all PID channels that enable it.  */
131        BXPT_SAM_40BitAddr Type1NetworkAddr;
132
133        /* Type 0 multicast 40 address. Global for all PID channels that enable it.  */
134        BXPT_SAM_40BitAddr Type0M40Addr;
135
136        /* Type 1 multicast 40 address. Global for all PID channels that enable it.  */
137        BXPT_SAM_40BitAddr Type1M40Addr;
138
139        /* Multicast 24 address. Global for all PID channels that enable it. */
140        uint8_t M24Addr[ BXPT_M24_ADDR_SIZE ];   
141
142        /* Defines the upper and lower limits when filtering by Table ID. */
143        uint8_t IdRejectHiLimit;
144        uint8_t IdRejectLowLimit;
145}
146BXPT_SAMAddresses;
147
148/***************************************************************************
149Summary:
150Special Addressing Mode enables.
151
152Description:
153Each PID channel may have one or more of the different SAM filters enabled
154at any one time. For convenience, the enables for each mode are located in
155a common structure, which is passed to the BXPT_SAM_DoFiltering() function.
156***************************************************************************/
157typedef struct BXPT_SAM_Enables
158{
159        bool PhysicalEn;
160        bool NetworkEn;
161        bool M40En;
162        bool M24En;
163        bool M16En;
164        bool IdRejectEn;
165
166        /* Note that the NOT function is applied to ALL of the filters enabled above. */
167        bool SamNotEn;
168}
169BXPT_SAM_Enables;
170
171/***************************************************************************
172Summary:
173Return the multicast-16 address filters.
174
175Description:
176The multicast-16 filters are a set of 4 16-bit address filters. Each message
177buffer that supports SAM filtering has 1 such set. The function returns the
178filter set for the given buffer.
179
180Returns:
181    BERR_SUCCESS                - Data retrieved.
182    BERR_INVALID_PARAMETER      - Bad input parameter
183 
184See Also:
185BXPT_SAM_SetM16Addresss
186****************************************************************************/
187BERR_Code BXPT_SAM_GetM16Addresss(
188        BXPT_Handle hXpt,
189        unsigned int MessageBufferNum,
190        BXPT_SAM_M16Addresses *Addresses
191        );
192
193/***************************************************************************
194Summary:
195Set the multicast-16 address filters.
196
197Description:
198The multicast-16 filters are a set of 4 16-bit address filters. Each message
199buffer that supports SAM filtering has 1 such set. The function loads the
200filter set for the given buffer.
201
202Returns:
203    BERR_SUCCESS                - Filters loaded.
204    BERR_INVALID_PARAMETER      - Bad input parameter
205 
206See Also:
207BXPT_SAM_GetM16Addresss
208****************************************************************************/
209BERR_Code BXPT_SAM_SetM16Addresss(
210        BXPT_Handle hXpt,
211        unsigned int MessageBufferNum,
212        const BXPT_SAM_M16Addresses *Addresses
213        );
214
215/***************************************************************************
216Summary:
217Return the SAM global address filters.
218
219Description:
220The filters for the Physical, Network, M24, and M40 addresses are global, for
221all buffers that enable them. This function returns the current filter
222settings from hardware.
223
224Returns:
225    BERR_SUCCESS                - Filters retrieved from hardware.
226    BERR_INVALID_PARAMETER      - Bad input parameter
227 
228See Also:
229BXPT_SAM_SetAddresses
230****************************************************************************/
231BERR_Code BXPT_SAM_GetAddresses(
232        BXPT_Handle hXpt,
233        BXPT_SAMAddresses *Addresses
234        );
235
236/***************************************************************************
237Summary:
238Set the SAM global address filters.
239
240Description:
241The filters for the Physical, Network, M24, and M40 addresses are global, for
242all buffers that enable them. This function loads the given filter
243settings into hardware.
244
245Returns:
246    BERR_SUCCESS                - Filters loaded.
247    BERR_INVALID_PARAMETER      - Bad input parameter
248 
249See Also:
250BXPT_SAM_SetAddresses
251****************************************************************************/
252BERR_Code BXPT_SAM_SetAddresses(
253        BXPT_Handle hXpt,
254        const BXPT_SAMAddresses *Addresses
255        );
256
257/***************************************************************************
258Summary:
259Enable or disable SAM filtering.
260
261Description:
262SAM filtering can is enabled or disabled on a per-buffer basis. This
263function enables or disables the SAM filters as specified in the Enables
264structure.
265
266Returns:
267    BERR_SUCCESS                - Enable succesful.
268    BERR_INVALID_PARAMETER      - Bad input parameter
269****************************************************************************/
270BERR_Code BXPT_SAM_DoFiltering(
271        BXPT_Handle hXpt,
272        unsigned int MessageBufferNum,
273        BXPT_SAM_Enables *Enables
274        );
275
276#ifdef __cplusplus
277}
278#endif
279
280#endif /* #ifndef BXPT_SAM_H */
281
282/* end of file */
283
284
285
286
287
Note: See TracBrowser for help on using the repository browser.