| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2003-2010, 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_directv.h $ |
|---|
| 11 | * $brcm_Revision: Hydra_Software_Devel/2 $ |
|---|
| 12 | * $brcm_Date: 10/27/10 1:30p $ |
|---|
| 13 | * |
|---|
| 14 | * Porting interface code for the DirecTV portion of the data transport core. |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: /magnum/portinginterface/xpt/base2/bxpt_directv.h $ |
|---|
| 19 | * |
|---|
| 20 | * Hydra_Software_Devel/2 10/27/10 1:30p gmullen |
|---|
| 21 | * SW7422-20: Ported to 7422 |
|---|
| 22 | * |
|---|
| 23 | * Hydra_Software_Devel/1 10/25/10 2:09p gmullen |
|---|
| 24 | * SW7425-15: Moved srcs to base2 folder |
|---|
| 25 | * |
|---|
| 26 | * Hydra_Software_Devel/1 10/8/10 2:57p gmullen |
|---|
| 27 | * SW7425-15: Added header files |
|---|
| 28 | * |
|---|
| 29 | * Hydra_Software_Devel/5 7/7/10 10:07a gmullen |
|---|
| 30 | * SW7401-4402: Merged to Hydra_Software_Devel |
|---|
| 31 | * |
|---|
| 32 | * Hydra_Software_Devel/SanJose_CDI_Devel/1 5/12/10 7:20p bhsu |
|---|
| 33 | * SW7401-4402: Added support of DIRECTV_SAVE_FLAGS mode for new type of |
|---|
| 34 | * MPT frame. |
|---|
| 35 | * |
|---|
| 36 | * Hydra_Software_Devel/4 10/19/09 5:16p piyushg |
|---|
| 37 | * SW7400-2559: Add PID2BUFF mapping api's for DirecTv message |
|---|
| 38 | * capture start and stop. |
|---|
| 39 | * |
|---|
| 40 | * Hydra_Software_Devel/3 12/5/06 3:00p gmullen |
|---|
| 41 | * PR26325: Added support for CAP filtering. |
|---|
| 42 | * |
|---|
| 43 | * Hydra_Software_Devel/2 12/5/06 2:04p gmullen |
|---|
| 44 | * PR26278: Allow user to configure byte alignment of data in message |
|---|
| 45 | * buffer. |
|---|
| 46 | * |
|---|
| 47 | * Hydra_Software_Devel/4 8/18/05 9:58a gmullen |
|---|
| 48 | * PR15309: Added more DirecTV support. |
|---|
| 49 | * |
|---|
| 50 | * Hydra_Software_Devel/3 8/12/05 8:57a gmullen |
|---|
| 51 | * PR15309: Added PCR, PCR Offset, DirecTV, RAVE video, and ITB/CDB |
|---|
| 52 | * endianess support. Tested same. |
|---|
| 53 | * |
|---|
| 54 | * Hydra_Software_Devel/2 7/25/05 5:11p gmullen |
|---|
| 55 | * PR15309: Fixed bugs in numerous files |
|---|
| 56 | * |
|---|
| 57 | * Hydra_Software_Devel/1 5/13/05 1:26p gmullen |
|---|
| 58 | * PR15309: First draft of XPT PI. |
|---|
| 59 | * |
|---|
| 60 | * |
|---|
| 61 | ***************************************************************************/ |
|---|
| 62 | |
|---|
| 63 | /*= Module Overview ********************************************************* |
|---|
| 64 | This module provides the API to control the DirecTV sections of the data |
|---|
| 65 | transport. Many calls are simply DirecTV versions of call in the MPEG portion |
|---|
| 66 | of the API. |
|---|
| 67 | ***************************************************************************/ |
|---|
| 68 | |
|---|
| 69 | #ifndef BXPT_DIRECTV_H__ |
|---|
| 70 | #define BXPT_DIRECTV_H__ |
|---|
| 71 | |
|---|
| 72 | #include "bxpt.h" |
|---|
| 73 | |
|---|
| 74 | #ifdef __cplusplus |
|---|
| 75 | extern "C" { |
|---|
| 76 | #endif |
|---|
| 77 | |
|---|
| 78 | /*************************************************************************** |
|---|
| 79 | Summary: |
|---|
| 80 | Defines the options regarding the MPT flag. |
|---|
| 81 | ****************************************************************************/ |
|---|
| 82 | typedef enum BXPT_DirecTvMessageFlags |
|---|
| 83 | { |
|---|
| 84 | BXPT_DirecTvMessageFlags_eSaveNone, /* Don't save any MPT flag */ |
|---|
| 85 | BXPT_DirecTvMessageFlags_eSaveFirst, /* Save 1st MPT flag only, per MPT message */ |
|---|
| 86 | BXPT_DirecTvMessageFlags_eSaveAll /* Save all MPT flags in each transport packet of an MPT message */ |
|---|
| 87 | } |
|---|
| 88 | BXPT_DirecTvMessageFlags; |
|---|
| 89 | |
|---|
| 90 | /*************************************************************************** |
|---|
| 91 | Summary: |
|---|
| 92 | Defines the types of SCID PSI filtering that can be performed. |
|---|
| 93 | ****************************************************************************/ |
|---|
| 94 | typedef enum BXPT_DirecTvMessageType |
|---|
| 95 | { |
|---|
| 96 | BXPT_DirecTvMessageType_eAuxOnlyPackets, |
|---|
| 97 | BXPT_DirecTvMessageType_eMpt, |
|---|
| 98 | BXPT_DirecTvMessageType_eRegular, |
|---|
| 99 | |
|---|
| 100 | /* Regular messages with CAP filtering. */ |
|---|
| 101 | BXPT_DirecTvMessageType_eRegular_CapFilter0, |
|---|
| 102 | BXPT_DirecTvMessageType_eRegular_CapFilter1, |
|---|
| 103 | BXPT_DirecTvMessageType_eRegular_CapFilter2, |
|---|
| 104 | BXPT_DirecTvMessageType_eRegular_CapFilter3, |
|---|
| 105 | BXPT_DirecTvMessageType_eRegular_CapFilter4 |
|---|
| 106 | } |
|---|
| 107 | BXPT_DirecTvMessageType; |
|---|
| 108 | |
|---|
| 109 | /*************************************************************************** |
|---|
| 110 | Summary: |
|---|
| 111 | Defines the types of SCID PES filtering that can be performed. |
|---|
| 112 | ****************************************************************************/ |
|---|
| 113 | typedef enum BXPT_DirecTvRecordType |
|---|
| 114 | { |
|---|
| 115 | BXPT_DirecTvRecordType_eAudio, |
|---|
| 116 | BXPT_DirecTvRecordType_eVideo, |
|---|
| 117 | BXPT_DirecTvRecordType_ePacketSaveAll |
|---|
| 118 | } |
|---|
| 119 | BXPT_DirecTvRecordType; |
|---|
| 120 | |
|---|
| 121 | /*************************************************************************** |
|---|
| 122 | Summary: |
|---|
| 123 | Enumerations for the parser band modes. |
|---|
| 124 | ****************************************************************************/ |
|---|
| 125 | typedef enum BXPT_ParserMode |
|---|
| 126 | { |
|---|
| 127 | BXPT_ParserMode_eMpeg, |
|---|
| 128 | BXPT_ParserMode_eDirecTv |
|---|
| 129 | } |
|---|
| 130 | BXPT_ParserMode; |
|---|
| 131 | |
|---|
| 132 | |
|---|
| 133 | /*************************************************************************** |
|---|
| 134 | Summary: |
|---|
| 135 | Additional options for DirecTV message filtering. |
|---|
| 136 | ****************************************************************************/ |
|---|
| 137 | typedef struct BXPT_DirecTvMessageOptions |
|---|
| 138 | { |
|---|
| 139 | BXPT_DirecTvMessageFlags Flags; |
|---|
| 140 | } |
|---|
| 141 | BXPT_DirecTvMessageOptions; |
|---|
| 142 | |
|---|
| 143 | |
|---|
| 144 | /*************************************************************************** |
|---|
| 145 | Summary: |
|---|
| 146 | Data needed to configure a single SCID channel recording. |
|---|
| 147 | ****************************************************************************/ |
|---|
| 148 | typedef struct BXPT_ScidChannelRecordSettings |
|---|
| 149 | { |
|---|
| 150 | unsigned int Pid; /* Which SCID to record. */ |
|---|
| 151 | unsigned int Band; /* The band the SCID is on. */ |
|---|
| 152 | BXPT_DirecTvRecordType RecordType; /* Type of recording to do. */ |
|---|
| 153 | |
|---|
| 154 | /* |
|---|
| 155 | ** Set to true to have data byte-aligned in the message buffer. If false, |
|---|
| 156 | ** the data is word aligned, with bytes of value 0x55 inserted as padding. |
|---|
| 157 | ** This is done for software compatability with older chips that didn't |
|---|
| 158 | ** support byte-alignment. |
|---|
| 159 | */ |
|---|
| 160 | bool ByteAlign; |
|---|
| 161 | } |
|---|
| 162 | BXPT_ScidChannelRecordSettings; |
|---|
| 163 | |
|---|
| 164 | /*************************************************************************** |
|---|
| 165 | Summary: |
|---|
| 166 | Enumerations for the PID channel HD filtering modes. |
|---|
| 167 | ****************************************************************************/ |
|---|
| 168 | typedef enum BXPT_HdFilterMode |
|---|
| 169 | { |
|---|
| 170 | BXPT_HdFilterMode_eNonAuxOnly = 0, /* only non-AUX packets are considered a match for the pid table entry */ |
|---|
| 171 | BXPT_HdFilterMode_eAuxOnly = 1 /* only AUX packets (HD=0, orig_cf bit=1) are considered a match for this pid table entry */ |
|---|
| 172 | } |
|---|
| 173 | BXPT_HdFilterMode; |
|---|
| 174 | |
|---|
| 175 | /*************************************************************************** |
|---|
| 176 | Summary: |
|---|
| 177 | Set the MPEG or DirectTV mode in a given parser band. |
|---|
| 178 | |
|---|
| 179 | Description: |
|---|
| 180 | Changes a parser band between MPEG and DirecTV mode. Also sets the packet |
|---|
| 181 | length as appropriate. |
|---|
| 182 | |
|---|
| 183 | Returns: |
|---|
| 184 | BERR_SUCCESS - Change was successful. |
|---|
| 185 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 186 | ***************************************************************************/ |
|---|
| 187 | BERR_Code BXPT_DirecTv_SetParserBandMode( |
|---|
| 188 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 189 | unsigned int Band, /* [in] Which parser band */ |
|---|
| 190 | BXPT_ParserMode Mode /* [in] Which mode (packet format) is being used. */ |
|---|
| 191 | ); |
|---|
| 192 | |
|---|
| 193 | /*************************************************************************** |
|---|
| 194 | Summary: |
|---|
| 195 | Set the limits for the PES stream ID. |
|---|
| 196 | |
|---|
| 197 | Description: |
|---|
| 198 | Set the upper and lower boundary for the stream ID range check performed |
|---|
| 199 | in DIRECTV mode during PES parsing. This configuration effects all parser |
|---|
| 200 | bands that are in DirecTV mode. |
|---|
| 201 | |
|---|
| 202 | Returns: |
|---|
| 203 | BERR_SUCCESS - New boundaries have been set. |
|---|
| 204 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 205 | |
|---|
| 206 | See Also: |
|---|
| 207 | BXPT_DirecTv_SetStartcodeChecking |
|---|
| 208 | ***************************************************************************/ |
|---|
| 209 | void BXPT_DirecTv_SetPesStreamIdBoundaries( |
|---|
| 210 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 211 | unsigned int UpperId, /* [in] The upper stream id. */ |
|---|
| 212 | unsigned int LowerId /* [in] The lower stream id. */ |
|---|
| 213 | ); |
|---|
| 214 | |
|---|
| 215 | /*************************************************************************** |
|---|
| 216 | Summary: |
|---|
| 217 | Enable or disable startcode checking. |
|---|
| 218 | |
|---|
| 219 | Description: |
|---|
| 220 | PES startcode fields can optionally be checked during PES parsing. Only PES |
|---|
| 221 | packets with startcodes that fall in the range set by |
|---|
| 222 | BXPT_DirecTv_SetPesStreamIdBoundaries() are forwarded to the message buffers. |
|---|
| 223 | |
|---|
| 224 | Returns: |
|---|
| 225 | BERR_SUCCESS - Startcode checking enabled. |
|---|
| 226 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 227 | |
|---|
| 228 | See Also: |
|---|
| 229 | BXPT_DirecTv_SetPesStreamIdBoundaries |
|---|
| 230 | ***************************************************************************/ |
|---|
| 231 | void BXPT_DirecTv_SetStartcodeChecking( |
|---|
| 232 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 233 | bool EnableChecking /* [in] Enable checking, or not. */ |
|---|
| 234 | ); |
|---|
| 235 | |
|---|
| 236 | /*************************************************************************** |
|---|
| 237 | Summary: |
|---|
| 238 | Save the MPT flag in front of the reconstructed message. |
|---|
| 239 | |
|---|
| 240 | Description: |
|---|
| 241 | Configure the message filters to put the MPT flag in front of the |
|---|
| 242 | reconstructed message. This configuration effects all parser bands that are |
|---|
| 243 | in DirecTV mode. |
|---|
| 244 | |
|---|
| 245 | Returns: |
|---|
| 246 | void |
|---|
| 247 | ***************************************************************************/ |
|---|
| 248 | void BXPT_DirecTv_SaveMptFlag( |
|---|
| 249 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 250 | bool Enable /* [in] Enable or disable flag saving. */ |
|---|
| 251 | ); |
|---|
| 252 | |
|---|
| 253 | /*************************************************************************** |
|---|
| 254 | Summary: |
|---|
| 255 | Use this API only when you need PID to multiple buffer mapping capabilities. |
|---|
| 256 | Pass Message Buffer Number along with the PidChannelNumber. |
|---|
| 257 | Configure for capturing DirecTV Aux or MPT messages. |
|---|
| 258 | |
|---|
| 259 | Description: |
|---|
| 260 | Associate one or more message filters with a given SCID and parser band. |
|---|
| 261 | This function will enable the SCID channel, but will not install an |
|---|
| 262 | interrupt handler for the message interrupt. The interrupt handler should be |
|---|
| 263 | installed before calling this function. |
|---|
| 264 | |
|---|
| 265 | To select filtering with a CAP address, use MessageType |
|---|
| 266 | BXPT_DirecTvMessageType_eRegular_CapFilterX, where X is the CAP filter to be |
|---|
| 267 | used. The CAP address is loaded into the filter by calling |
|---|
| 268 | BXPT_DirecTv_SetCapPattern () |
|---|
| 269 | |
|---|
| 270 | The caller must allocate a SCID channel before using the function. It should |
|---|
| 271 | NOT be called if the PID channel is already enabled. |
|---|
| 272 | |
|---|
| 273 | Returns: |
|---|
| 274 | BERR_SUCCESS - Message capture is setup. |
|---|
| 275 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 276 | |
|---|
| 277 | See Also: |
|---|
| 278 | BXPT_AllocPSIFilter, BXPT_GetFilter, BXPT_SetFilter, BXPT_AddFilterToGroup, |
|---|
| 279 | BXPT_StopDirecTvMessageCapture, BXPT_DirecTv_SetCapPattern |
|---|
| 280 | ***************************************************************************/ |
|---|
| 281 | BERR_Code BXPT_Mesg_StartDirecTvMessageCapture( |
|---|
| 282 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 283 | unsigned int PidChannelNum, /* [in] Which PID channel. */ |
|---|
| 284 | unsigned int MesgBufferNum, /* [in] Which Message Buffer. */ |
|---|
| 285 | BXPT_DirecTvMessageType MessageType, /* [in] What type of DirecTV messages. */ |
|---|
| 286 | const BXPT_PsiMessageSettings *Settings /* [in] PID, band, and filters to use. */ |
|---|
| 287 | ); |
|---|
| 288 | |
|---|
| 289 | /*************************************************************************** |
|---|
| 290 | Summary: |
|---|
| 291 | Start message capturing with additional configuration options. |
|---|
| 292 | |
|---|
| 293 | Description: |
|---|
| 294 | This call performs the same service as BXPT_Mesg_StartDirecTvMessageCapture(), |
|---|
| 295 | except with additional options. See the BXPT_DirecTvMessageOptions struct |
|---|
| 296 | for the additions. |
|---|
| 297 | |
|---|
| 298 | Returns: |
|---|
| 299 | BERR_SUCCESS - Message capture is setup. |
|---|
| 300 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 301 | |
|---|
| 302 | See Also: |
|---|
| 303 | BXPT_AllocPSIFilter, BXPT_GetFilter, BXPT_SetFilter, BXPT_AddFilterToGroup, |
|---|
| 304 | BXPT_StopDirecTvMessageCapture, BXPT_DirecTv_SetCapPattern |
|---|
| 305 | ***************************************************************************/ |
|---|
| 306 | BERR_Code BXPT_Mesg_StartDirecTvMessageCaptureWithOptions( |
|---|
| 307 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 308 | unsigned int PidChannelNum, /* [in] Which PID channel. */ |
|---|
| 309 | unsigned int MesgBufferNum, /* [in] Which Message Buffer. */ |
|---|
| 310 | BXPT_DirecTvMessageType MessageType, /* [in] What type of DirecTV messages. */ |
|---|
| 311 | const BXPT_PsiMessageSettings *Settings, /* [in] PID, band, and filters to use. */ |
|---|
| 312 | const BXPT_DirecTvMessageOptions *Options /* [in] Additional options for message capture */ |
|---|
| 313 | ); |
|---|
| 314 | |
|---|
| 315 | /*************************************************************************** |
|---|
| 316 | Summary: |
|---|
| 317 | Use this API only when you need PID to multiple buffer mapping capabilities. |
|---|
| 318 | Pass Message Buffer Number along with the PidChannelNumber. |
|---|
| 319 | Stop capturing DirecTV messages. |
|---|
| 320 | |
|---|
| 321 | Description: |
|---|
| 322 | Disable the SCID channel being used to capture DirecTV messages. Flush any data |
|---|
| 323 | still in the chip. If the interrupts for the message buffer are still |
|---|
| 324 | enabled, flushing the data may trigger another interrupt. |
|---|
| 325 | |
|---|
| 326 | NOTE: This function may sleep for up to 200 microseconds, in order to flush |
|---|
| 327 | any remaining data from the hardware's internal buffers. |
|---|
| 328 | |
|---|
| 329 | Returns: |
|---|
| 330 | BERR_SUCCESS - Message capture is stopped. |
|---|
| 331 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 332 | |
|---|
| 333 | See Also: |
|---|
| 334 | BXPT_StartDirecTvMessageCapture |
|---|
| 335 | ***************************************************************************/ |
|---|
| 336 | BERR_Code BXPT_Mesg_StopDirecTvMessageCapture( |
|---|
| 337 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 338 | unsigned int ScidChannelNum, /* [in] Which SCID channel. */ |
|---|
| 339 | unsigned int MesgBufferNum /* [in] Which Message Buffer. */ |
|---|
| 340 | ); |
|---|
| 341 | |
|---|
| 342 | /*************************************************************************** |
|---|
| 343 | Summary: |
|---|
| 344 | Configure HD filtering for a PID channel. |
|---|
| 345 | |
|---|
| 346 | Description: |
|---|
| 347 | Each PID channel can independently filter DirecTV packets based on their |
|---|
| 348 | SCID and the value of the HD fields. Both the SCID and the HD values must |
|---|
| 349 | match for the packet to be accepted. The filtering is done independently of |
|---|
| 350 | the PSI message filters; using this function will not consume PSI filter |
|---|
| 351 | resources. |
|---|
| 352 | |
|---|
| 353 | Filtering is performed on the HD field based upon the value of the FilterMode |
|---|
| 354 | parameter. Only two values are supported: only AUX are accepted by the filter |
|---|
| 355 | and only non-AUX are accepted. |
|---|
| 356 | |
|---|
| 357 | NOTE: |
|---|
| 358 | Since the channel will drop any packets that don not have the correct SCID |
|---|
| 359 | and the correct HD value, the channel should be used for PSI message capture |
|---|
| 360 | only. |
|---|
| 361 | |
|---|
| 362 | The function should be called AFTER BXPT_ConfigurePidChannel(). Filtering may |
|---|
| 363 | not be configured correctly if the calls are made out of that seqeunce. |
|---|
| 364 | |
|---|
| 365 | Returns: |
|---|
| 366 | BERR_SUCCESS - Filter configured. |
|---|
| 367 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 368 | |
|---|
| 369 | See Also: |
|---|
| 370 | BXPT_StartPidChannelRecord, BXPT_ConfigurePidChannel |
|---|
| 371 | ***************************************************************************/ |
|---|
| 372 | BERR_Code BXPT_DirecTv_ConfigHdFiltering( |
|---|
| 373 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 374 | unsigned int PidChannelNum, /* [in] Which PID channel. */ |
|---|
| 375 | bool EnableFilter, /* [in] Enable filtering if true, disable if false. */ |
|---|
| 376 | BXPT_HdFilterMode FilterMode /* [in] HD values to filter on. Ignored if EnableFilter == false */ |
|---|
| 377 | ); |
|---|
| 378 | |
|---|
| 379 | /*************************************************************************** |
|---|
| 380 | Summary: |
|---|
| 381 | Set the CAP filter pattern. |
|---|
| 382 | |
|---|
| 383 | Description: |
|---|
| 384 | Load the CAP filter pattern into the given address filter. The pattern is 32 |
|---|
| 385 | bits long. |
|---|
| 386 | |
|---|
| 387 | Returns: |
|---|
| 388 | BERR_SUCCESS - Merging enabled or disabled successfully. |
|---|
| 389 | BERR_INVALID_PARAMETER - Bad input parameter |
|---|
| 390 | ***************************************************************************/ |
|---|
| 391 | BERR_Code BXPT_DirecTv_SetCapPattern( |
|---|
| 392 | BXPT_Handle hXpt, /* [in] Handle for this transport */ |
|---|
| 393 | unsigned AddressFilter, /* [in] Which address filter gets the pattern. */ |
|---|
| 394 | uint32_t Pattern /* [in] The pattern to load. */ |
|---|
| 395 | ); |
|---|
| 396 | |
|---|
| 397 | #ifdef __cplusplus |
|---|
| 398 | } |
|---|
| 399 | #endif |
|---|
| 400 | |
|---|
| 401 | #endif /* #ifndef BXPT_DIRECTV_H__ */ |
|---|
| 402 | |
|---|
| 403 | /* end of file */ |
|---|