| 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 |
|---|
| 46 | extern "C"{ |
|---|
| 47 | #endif |
|---|
| 48 | |
|---|
| 49 | /*=************************ Module Overview ******************************** |
|---|
| 50 | Overview: |
|---|
| 51 | |
|---|
| 52 | This module is the porting interface for the Special Addressing Mode of the |
|---|
| 53 | PSI filters. |
|---|
| 54 | |
|---|
| 55 | Note that on some architectures, not all PID channels support SAM filtering. |
|---|
| 56 | For the 7038, only the first 32 PID channels can use the SAM filters. |
|---|
| 57 | |
|---|
| 58 | If SAM filtering is done in conjunction with normal PSI section filtering, |
|---|
| 59 | the sections must pass BOTH types of filtering in order to be accepted (and |
|---|
| 60 | therefore routed to the DRAM buffers for host access). |
|---|
| 61 | ***************************************************************************/ |
|---|
| 62 | |
|---|
| 63 | /*************************************************************************** |
|---|
| 64 | Summary: |
|---|
| 65 | Used 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 | /*************************************************************************** |
|---|
| 72 | Summary: |
|---|
| 73 | Multicast 16 address filters. |
|---|
| 74 | |
|---|
| 75 | Description: |
|---|
| 76 | This structure contains the 4 multicast-16 address filters for each PID |
|---|
| 77 | channel 0-31. These address filters are used in the PSI SAM filter when |
|---|
| 78 | M16En is true for a PID channel. |
|---|
| 79 | |
|---|
| 80 | The address bytes are stored in the arrays MSB first. |
|---|
| 81 | ***************************************************************************/ |
|---|
| 82 | typedef 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 | } |
|---|
| 89 | BXPT_SAM_M16Addresses; |
|---|
| 90 | |
|---|
| 91 | /*************************************************************************** |
|---|
| 92 | Summary: |
|---|
| 93 | 40-bit address filters, with wildcard configuration. |
|---|
| 94 | |
|---|
| 95 | Description: |
|---|
| 96 | This structure contains the 40 address filter used by the Type 0/1 Network |
|---|
| 97 | address and Type 0/1 M40 address filters. Also included are the wildcard |
|---|
| 98 | configurations. |
|---|
| 99 | |
|---|
| 100 | The address bytes are stored in the arrays MSB first. |
|---|
| 101 | ***************************************************************************/ |
|---|
| 102 | typedef 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 | } |
|---|
| 109 | BXPT_SAM_40BitAddr; |
|---|
| 110 | |
|---|
| 111 | /*************************************************************************** |
|---|
| 112 | Summary: |
|---|
| 113 | Special Addressing Mode configuration. |
|---|
| 114 | |
|---|
| 115 | Description: |
|---|
| 116 | Address filters for the Physical, Network, M24, and M40 addresses. These |
|---|
| 117 | values are global to all PID channels that use enable the respective SAM |
|---|
| 118 | filter. The IdRejectHiLimit and IdRejectLowLimit are also global. |
|---|
| 119 | |
|---|
| 120 | The address bytes are stored in the arrays MSB first. |
|---|
| 121 | ***************************************************************************/ |
|---|
| 122 | typedef 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 | } |
|---|
| 146 | BXPT_SAMAddresses; |
|---|
| 147 | |
|---|
| 148 | /*************************************************************************** |
|---|
| 149 | Summary: |
|---|
| 150 | Special Addressing Mode enables. |
|---|
| 151 | |
|---|
| 152 | Description: |
|---|
| 153 | Each PID channel may have one or more of the different SAM filters enabled |
|---|
| 154 | at any one time. For convenience, the enables for each mode are located in |
|---|
| 155 | a common structure, which is passed to the BXPT_SAM_DoFiltering() function. |
|---|
| 156 | ***************************************************************************/ |
|---|
| 157 | typedef 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 | } |
|---|
| 169 | BXPT_SAM_Enables; |
|---|
| 170 | |
|---|
| 171 | /*************************************************************************** |
|---|
| 172 | Summary: |
|---|
| 173 | Return the multicast-16 address filters. |
|---|
| 174 | |
|---|
| 175 | Description: |
|---|
| 176 | The multicast-16 filters are a set of 4 16-bit address filters. Each message |
|---|
| 177 | buffer that supports SAM filtering has 1 such set. The function returns the |
|---|
| 178 | filter set for the given buffer. |
|---|
| 179 | |
|---|
| 180 | Returns: |
|---|
| 181 | BERR_SUCCESS - Data retrieved. |
|---|
| 182 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 183 | |
|---|
| 184 | See Also: |
|---|
| 185 | BXPT_SAM_SetM16Addresss |
|---|
| 186 | ****************************************************************************/ |
|---|
| 187 | BERR_Code BXPT_SAM_GetM16Addresss( |
|---|
| 188 | BXPT_Handle hXpt, |
|---|
| 189 | unsigned int MessageBufferNum, |
|---|
| 190 | BXPT_SAM_M16Addresses *Addresses |
|---|
| 191 | ); |
|---|
| 192 | |
|---|
| 193 | /*************************************************************************** |
|---|
| 194 | Summary: |
|---|
| 195 | Set the multicast-16 address filters. |
|---|
| 196 | |
|---|
| 197 | Description: |
|---|
| 198 | The multicast-16 filters are a set of 4 16-bit address filters. Each message |
|---|
| 199 | buffer that supports SAM filtering has 1 such set. The function loads the |
|---|
| 200 | filter set for the given buffer. |
|---|
| 201 | |
|---|
| 202 | Returns: |
|---|
| 203 | BERR_SUCCESS - Filters loaded. |
|---|
| 204 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 205 | |
|---|
| 206 | See Also: |
|---|
| 207 | BXPT_SAM_GetM16Addresss |
|---|
| 208 | ****************************************************************************/ |
|---|
| 209 | BERR_Code BXPT_SAM_SetM16Addresss( |
|---|
| 210 | BXPT_Handle hXpt, |
|---|
| 211 | unsigned int MessageBufferNum, |
|---|
| 212 | const BXPT_SAM_M16Addresses *Addresses |
|---|
| 213 | ); |
|---|
| 214 | |
|---|
| 215 | /*************************************************************************** |
|---|
| 216 | Summary: |
|---|
| 217 | Return the SAM global address filters. |
|---|
| 218 | |
|---|
| 219 | Description: |
|---|
| 220 | The filters for the Physical, Network, M24, and M40 addresses are global, for |
|---|
| 221 | all buffers that enable them. This function returns the current filter |
|---|
| 222 | settings from hardware. |
|---|
| 223 | |
|---|
| 224 | Returns: |
|---|
| 225 | BERR_SUCCESS - Filters retrieved from hardware. |
|---|
| 226 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 227 | |
|---|
| 228 | See Also: |
|---|
| 229 | BXPT_SAM_SetAddresses |
|---|
| 230 | ****************************************************************************/ |
|---|
| 231 | BERR_Code BXPT_SAM_GetAddresses( |
|---|
| 232 | BXPT_Handle hXpt, |
|---|
| 233 | BXPT_SAMAddresses *Addresses |
|---|
| 234 | ); |
|---|
| 235 | |
|---|
| 236 | /*************************************************************************** |
|---|
| 237 | Summary: |
|---|
| 238 | Set the SAM global address filters. |
|---|
| 239 | |
|---|
| 240 | Description: |
|---|
| 241 | The filters for the Physical, Network, M24, and M40 addresses are global, for |
|---|
| 242 | all buffers that enable them. This function loads the given filter |
|---|
| 243 | settings into hardware. |
|---|
| 244 | |
|---|
| 245 | Returns: |
|---|
| 246 | BERR_SUCCESS - Filters loaded. |
|---|
| 247 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 248 | |
|---|
| 249 | See Also: |
|---|
| 250 | BXPT_SAM_SetAddresses |
|---|
| 251 | ****************************************************************************/ |
|---|
| 252 | BERR_Code BXPT_SAM_SetAddresses( |
|---|
| 253 | BXPT_Handle hXpt, |
|---|
| 254 | const BXPT_SAMAddresses *Addresses |
|---|
| 255 | ); |
|---|
| 256 | |
|---|
| 257 | /*************************************************************************** |
|---|
| 258 | Summary: |
|---|
| 259 | Enable or disable SAM filtering. |
|---|
| 260 | |
|---|
| 261 | Description: |
|---|
| 262 | SAM filtering can is enabled or disabled on a per-buffer basis. This |
|---|
| 263 | function enables or disables the SAM filters as specified in the Enables |
|---|
| 264 | structure. |
|---|
| 265 | |
|---|
| 266 | Returns: |
|---|
| 267 | BERR_SUCCESS - Enable succesful. |
|---|
| 268 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 269 | ****************************************************************************/ |
|---|
| 270 | BERR_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 | |
|---|