DSMCC  17.9.0
 All Data Structures Files Functions Typedefs
Macros | Typedefs | Functions
sfm_filter.c File Reference

Section Filter Manasger (SFM): filters. More...

#include <string.h>
#include "sfm_main.h"
#include "sfm_cache.h"
#include "sfm_filter.h"
#include "cldsmcc.h"

Go to the source code of this file.

Macros

#define INVALID_NDX   0xFF
 
#define INVALID_TID   0xFF
 
#define EXACT_MATCH   16
 
#define NEAR_MATCH   15
 
#define PRIORITY_SHIFT   5
 
#define PRI_EXACT_MASK   ((1 << PRIORITY_SHIFT) - 1)
 
#define HASH_SIZE   17
 
#define TOTAL_DSM_LISTS   (HASH_SIZE + 1)
 

Typedefs

typedef struct s_BitCnt S_BitCnt
 
typedef struct s_Table S_Table
 
typedef struct s_DsmResource S_DsmResource
 
typedef struct s_PidTable S_PidTable
 
typedef struct s_DmxSecFilter S_DmxSecFilter
 
typedef struct s_DmxPidFilter S_DmxPidFilter
 

Functions

void ClearTexIdAccounts (S_DsmResource **ppDsmRes)
 
BOOLEAN SFMFilterCreateResources (H_SfmInstance sfm)
 Create Filter resources for Section Filter Manager instance. More...
 
void SFMFilterInitCaching (H_SfmInstance sfm)
 Initialise caching references. More...
 
void SFMFilterDestroyResources (H_SfmInstance sfm)
 Destroy Filter resources for Section Filter Manager instance. More...
 
void * SFM_DsmccFilterAdd (H_SfmInstance sfm, P_SecFilter pFilter, H_DscSFRef dsmSfRef)
 Add DSM-CC section filter. Called by DSM-CC component. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_RequireSection. It assumes that this function is entered on the same task as SFM_DelectionFilter. More...
 
void SFM_DsmccFilterDelete (H_SfmInstance sfm, void *filterHandle, H_DscSFRef dsmSfRef)
 Delete DSM-CC section filter. Called by DSM-CC component, and given in clDsmSysCreate setup. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_RequireSection. More...
 
void SFM_FilterUpdate (H_SfmInstance sfm, H_DmxPidFilter pPF)
 Update SFM PID filter to configure HW for latest requirements. More...
 
void SFM_DsmccFilterPriorityChange (H_SfmInstance sfm, void *filterHandle, H_DscSFRef dsmSfRef, E_SFPriority priority)
 Change DSM-CC section filter priority Called by DSM-CC component, and given in clDsmSysCreate setup. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_RequireSection. This function should be in same tthread as add and remove. More...
 
E_SFM_STATUS SFMFilterRequiresSection (H_SfmInstance sfm, PIDFILT pfid, U16BIT teid, U8BIT tid, U8BIT vers, void **phBuffer)
 This function performs minimal checking of section header data to find out whether SFM requires this section. Number of header bytes required is SECTION_HEADER_LENGTH. It assumes CRC has been checked and is passing valid DSM-CC sections So the first byte of data must be table id 0x3B, 0x3C or 0x3D. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_AddSectionFilter and SFM_DelSectionFilter. It does NOT call any DSM-CC core functions. More...
 
void SFMFilterProcessSection (H_SfmInstance sfm, U8BIT *pSection, H_DsmResource pDsmRes)
 Get DSM-CC filter request and pass section buffer to DSM-CC with it's filter handle This should only be called after calling SFM_FilterRequiresSection with it returning SFM_UPDATE_LOW or SFM_UPDATE_HIGH. More...
 
BOOLEAN SFMFilterValidHandle (H_SfmInstance sfm, void *hBuffer)
 
H_DsmResource SFMFilterDsmResource (H_SfmInstance sfm, U16BIT dsmref)
 

Detailed Description

Section Filter Manasger (SFM): filters.

Date
16-10-2013
Author
Adam Sturtridge

Definition in file sfm_filter.c.

Function Documentation

void* SFM_DsmccFilterAdd ( H_SfmInstance  sfm,
P_SecFilter  pFilter,
H_DscSFRef  dsmSfRef 
)

Add DSM-CC section filter. Called by DSM-CC component. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_RequireSection. It assumes that this function is entered on the same task as SFM_DelectionFilter.

Add DSM-CC section filter. Called by DSM-CC component, and given in clDsmSysCreate setup. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_RequireSection.

Parameters
H_SfmInstancesfm SFM instance handle.
P_SecFilterpFilter Pointer to DSM-CC filter details
H_DscSFRefdsmSfRef DSM-CC SF reference handle
Returns
void* SFM Filter handle

Definition at line 959 of file sfm_filter.c.

void SFM_DsmccFilterDelete ( H_SfmInstance  sfm,
void *  filterHandle,
H_DscSFRef  dsmSfRef 
)

Delete DSM-CC section filter. Called by DSM-CC component, and given in clDsmSysCreate setup. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_RequireSection.

Parameters
H_SfmInstancesfm SFM instance handle.
void*filterHandle SFM Filter handle
H_DscSFRefdsmSfRef DSM-CC reference handle
Returns

Definition at line 1026 of file sfm_filter.c.

void SFM_DsmccFilterPriorityChange ( H_SfmInstance  sfm,
void *  filterHandle,
H_DscSFRef  dsmSfRef,
E_SFPriority  priority 
)

Change DSM-CC section filter priority Called by DSM-CC component, and given in clDsmSysCreate setup. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_RequireSection. This function should be in same tthread as add and remove.

Change DSM-CC section filter priority Called by DSM-CC component, and given in clDsmSysCreate setup. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_RequireSection.

Parameters
H_SfmInstancesfm SFM instance handle.
void*filterHandle SFM Filter handle
H_DscSFRefdsmSfRef DSM-CC SF reference handle
E_SFPrioritypriority New filter priority
Returns
void

Definition at line 1128 of file sfm_filter.c.

void SFM_FilterUpdate ( H_SfmInstance  sfm,
H_DmxPidFilter  pPF 
)

Update SFM PID filter to configure HW for latest requirements.

Parameters
H_SfmInstancesfm SFM instance handle.
H_DmxPidFilterpPF Handle to SFM pid filter
Returns
void.

Definition at line 1075 of file sfm_filter.c.

BOOLEAN SFMFilterCreateResources ( H_SfmInstance  sfm)

Create Filter resources for Section Filter Manager instance.

Parameters
H_SfmInstancesfm SFM instance handle.
Returns
BOOLEAN TRUE if success

Definition at line 829 of file sfm_filter.c.

void SFMFilterDestroyResources ( H_SfmInstance  sfm)

Destroy Filter resources for Section Filter Manager instance.

Parameters
H_SfmInstancesfm SFM instance handle.
Returns
void

Definition at line 929 of file sfm_filter.c.

void SFMFilterInitCaching ( H_SfmInstance  sfm)

Initialise caching references.

Parameters
H_SfmInstancesfm SFM instance handle.
Returns
void

Definition at line 904 of file sfm_filter.c.

void SFMFilterProcessSection ( H_SfmInstance  sfm,
U8BIT *  pSection,
H_DsmResource  pDsmRes 
)

Get DSM-CC filter request and pass section buffer to DSM-CC with it's filter handle This should only be called after calling SFM_FilterRequiresSection with it returning SFM_UPDATE_LOW or SFM_UPDATE_HIGH.

Parameters
H_SfmInstancesfm SFM instance handle.
U8BIT*pSection Pointer to whole section data buffer
void*hBuffer SFM section handle returned by SFM_FilterRequiresSection
Returns
void.

Definition at line 1274 of file sfm_filter.c.

E_SFM_STATUS SFMFilterRequiresSection ( H_SfmInstance  sfm,
PIDFILT  pfid,
U16BIT  teid,
U8BIT  tid,
U8BIT  vers,
void **  phBuffer 
)

This function performs minimal checking of section header data to find out whether SFM requires this section. Number of header bytes required is SECTION_HEADER_LENGTH. It assumes CRC has been checked and is passing valid DSM-CC sections So the first byte of data must be table id 0x3B, 0x3C or 0x3D. Note for multi-tasking: this function uses mutex locking to protect shared data with SFM_AddSectionFilter and SFM_DelSectionFilter. It does NOT call any DSM-CC core functions.

Parameters
H_SfmInstancesfm SFM instance handle.
PIDFILTpfid PID filter with incoming section
U8BIT*pHeader Pointer to section header (min 8 bytes)
void**phBuffer Pointer to SFM section buffer handle
Returns
E_SFM_STATUS - status of required update

Definition at line 1165 of file sfm_filter.c.