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

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

1.phkim

  1. revision copy newcon3sk r27
  • Property svn:executable set to *
File size: 14.9 KB
Line 
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 *********************************************************
64This module provides the API to control the DirecTV sections of the data
65transport. Many calls are simply DirecTV versions of call in the MPEG portion
66of the API.
67***************************************************************************/
68
69#ifndef BXPT_DIRECTV_H__
70#define BXPT_DIRECTV_H__
71
72#include "bxpt.h"
73
74#ifdef __cplusplus
75extern "C" {
76#endif
77
78/***************************************************************************
79Summary:
80Defines the options regarding the MPT flag.
81****************************************************************************/
82typedef 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}
88BXPT_DirecTvMessageFlags;
89
90/***************************************************************************
91Summary:
92Defines the types of SCID PSI filtering that can be performed.
93****************************************************************************/
94typedef 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}                                                                           
107BXPT_DirecTvMessageType;
108
109/***************************************************************************
110Summary:
111Defines the types of SCID PES filtering that can be performed.
112****************************************************************************/
113typedef enum BXPT_DirecTvRecordType
114{
115        BXPT_DirecTvRecordType_eAudio,
116        BXPT_DirecTvRecordType_eVideo,
117        BXPT_DirecTvRecordType_ePacketSaveAll
118}
119BXPT_DirecTvRecordType;
120
121/***************************************************************************
122Summary:
123Enumerations for the parser band modes.
124****************************************************************************/
125typedef enum BXPT_ParserMode
126{
127        BXPT_ParserMode_eMpeg,
128        BXPT_ParserMode_eDirecTv
129}
130BXPT_ParserMode;
131
132
133/***************************************************************************
134Summary:
135Additional options for DirecTV message filtering.
136****************************************************************************/
137typedef struct BXPT_DirecTvMessageOptions
138{
139    BXPT_DirecTvMessageFlags Flags;
140}
141BXPT_DirecTvMessageOptions;
142
143
144/***************************************************************************
145Summary:
146Data needed to configure a single SCID channel recording.
147****************************************************************************/
148typedef 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} 
162BXPT_ScidChannelRecordSettings;
163                   
164/***************************************************************************
165Summary:
166Enumerations for the PID channel HD filtering modes.
167****************************************************************************/
168typedef 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}
173BXPT_HdFilterMode;
174
175/***************************************************************************
176Summary:
177Set the MPEG or DirectTV mode in a given parser band.
178
179Description:
180Changes a parser band between MPEG and DirecTV mode. Also sets the packet
181length as appropriate.
182
183Returns:
184    BERR_SUCCESS                - Change was successful.
185    BERR_INVALID_PARAMETER      - Bad input parameter
186***************************************************************************/
187BERR_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/***************************************************************************
194Summary:
195Set the limits for the PES stream ID.
196
197Description:
198Set the upper and lower boundary for the stream ID range check performed
199in DIRECTV mode during PES parsing. This configuration effects all parser
200bands that are in DirecTV mode.
201
202Returns:
203    BERR_SUCCESS                - New boundaries have been set.
204    BERR_INVALID_PARAMETER      - Bad input parameter
205
206See Also:
207BXPT_DirecTv_SetStartcodeChecking
208***************************************************************************/
209void 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/***************************************************************************
216Summary:
217Enable or disable startcode checking.
218
219Description:
220PES startcode fields can optionally be checked during PES parsing. Only PES
221packets with startcodes that fall in the range set by
222BXPT_DirecTv_SetPesStreamIdBoundaries() are forwarded to the message buffers.
223
224Returns:
225    BERR_SUCCESS                - Startcode checking enabled.
226    BERR_INVALID_PARAMETER      - Bad input parameter
227
228See Also:
229BXPT_DirecTv_SetPesStreamIdBoundaries
230***************************************************************************/
231void BXPT_DirecTv_SetStartcodeChecking( 
232        BXPT_Handle hXpt,               /* [in] Handle for this transport */
233        bool EnableChecking             /* [in] Enable checking, or not. */
234        );
235
236/***************************************************************************
237Summary:
238Save the MPT flag in front of the reconstructed message.
239
240Description:
241Configure the message filters to put the MPT flag in front of the
242reconstructed message. This configuration effects all parser bands that are
243in DirecTV mode.
244
245Returns:
246        void
247***************************************************************************/
248void BXPT_DirecTv_SaveMptFlag( 
249        BXPT_Handle hXpt,               /* [in] Handle for this transport */
250        bool Enable                     /* [in] Enable or disable flag saving. */
251        );
252
253/***************************************************************************
254Summary:
255Use this API only when you need PID to multiple buffer mapping capabilities.
256Pass Message Buffer Number along with the PidChannelNumber.
257Configure for capturing DirecTV Aux or MPT messages.
258
259Description:
260Associate one or more message filters with a given SCID and parser band.
261This function will enable the SCID channel, but will not install an
262interrupt handler for the message interrupt. The interrupt handler should be
263installed before calling this function.
264
265To select filtering with a CAP address, use MessageType
266BXPT_DirecTvMessageType_eRegular_CapFilterX, where X is the CAP filter to be
267used. The CAP address is loaded into the filter by calling
268BXPT_DirecTv_SetCapPattern ()
269
270The caller must allocate a SCID channel before using the function. It should
271NOT be called if the PID channel is already enabled.
272
273Returns:
274    BERR_SUCCESS                - Message capture is setup.
275    BERR_INVALID_PARAMETER      - Bad input parameter
276
277See Also:
278BXPT_AllocPSIFilter, BXPT_GetFilter, BXPT_SetFilter, BXPT_AddFilterToGroup,
279BXPT_StopDirecTvMessageCapture, BXPT_DirecTv_SetCapPattern
280***************************************************************************/
281BERR_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/***************************************************************************
290Summary:
291Start message capturing with additional configuration options. 
292 
293Description:
294This call performs the same service as BXPT_Mesg_StartDirecTvMessageCapture(),
295except with additional options. See the BXPT_DirecTvMessageOptions struct
296for the additions.
297 
298Returns:
299    BERR_SUCCESS                - Message capture is setup.
300    BERR_INVALID_PARAMETER      - Bad input parameter
301
302See Also:
303BXPT_AllocPSIFilter, BXPT_GetFilter, BXPT_SetFilter, BXPT_AddFilterToGroup,
304BXPT_StopDirecTvMessageCapture, BXPT_DirecTv_SetCapPattern
305***************************************************************************/
306BERR_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/***************************************************************************
316Summary:
317Use this API only when you need PID to multiple buffer mapping capabilities.
318Pass Message Buffer Number along with the PidChannelNumber.
319Stop capturing DirecTV messages.
320
321Description:
322Disable the SCID channel being used to capture DirecTV messages. Flush any data
323still in the chip. If the interrupts for the message buffer are still
324enabled, flushing the data may trigger another interrupt.
325
326NOTE: This function may sleep for up to 200 microseconds, in order to flush
327any remaining data from the hardware's internal buffers.
328
329Returns:
330    BERR_SUCCESS                - Message capture is stopped.
331    BERR_INVALID_PARAMETER      - Bad input parameter
332
333See Also:
334BXPT_StartDirecTvMessageCapture
335***************************************************************************/
336BERR_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/***************************************************************************
343Summary:
344Configure HD filtering for a PID channel.
345
346Description:
347Each PID channel can independently filter DirecTV packets based on their
348SCID and the value of the HD fields. Both the SCID and the HD values must
349match for the packet to be accepted. The filtering is done independently of
350the PSI message filters; using this function will not consume PSI filter
351resources.
352
353Filtering is performed on the HD field based upon the value of the FilterMode
354parameter. Only two values are supported: only AUX are accepted by the filter
355and only non-AUX are accepted.
356
357NOTE:
358Since the channel will drop any packets that don not have the correct SCID
359and the correct HD value, the channel should be used for PSI message capture
360only.
361
362The function should be called AFTER BXPT_ConfigurePidChannel(). Filtering may
363not be configured correctly if the calls are made out of that seqeunce.
364
365Returns:
366    BERR_SUCCESS                - Filter configured.
367    BERR_INVALID_PARAMETER      - Bad input parameter
368
369See Also:
370BXPT_StartPidChannelRecord, BXPT_ConfigurePidChannel
371***************************************************************************/
372BERR_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/***************************************************************************
380Summary:
381Set the CAP filter pattern.
382
383Description:
384Load the CAP filter pattern into the given address filter. The pattern is 32
385bits long.
386
387Returns:
388    BERR_SUCCESS                - Merging enabled or disabled successfully.
389    BERR_INVALID_PARAMETER      - Bad input parameter
390***************************************************************************/
391BERR_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 */
Note: See TracBrowser for help on using the repository browser.