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

Section Filter Manager: caching functions. More...

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

Go to the source code of this file.

Macros

#define TABLE_BITS   6
 
#define TABLE_SIZE   (1 << TABLE_BITS)
 
#define NUM_FILTERS   64
 
#define NUM_NODES   128
 
#define INVALID_VERSION   0xFF
 
#define STALE_VERSION   0xFE
 
#define STALE_BIT   0x80
 
#define REPORTING   0x40
 
#define ALLOCSIZE(s)   ((s >> 1) & 7) + 1
 

Typedefs

typedef struct s_NodeBlock * H_NodeBlock
 
typedef struct s_FiltBlock * H_FiltBlock
 
typedef struct s_CacheNode S_CacheNode
 
typedef struct s_CacheFilter S_CacheFilter
 
typedef struct s_CacheTable S_CacheTable
 
typedef struct s_NodeBlock S_NodeBlock
 
typedef struct s_FiltBlock S_FiltBlock
 
typedef struct s_SfmCache S_SfmCache
 

Functions

H_SfmCache SFMCacheCreate (H_SfmInstance sfm)
 
void SFMCacheDestroy (H_SfmInstance sfm, void **pBufMtx)
 
void SFM_CacheClear (H_SfmInstance sfm)
 Clear all SFM cached section data. More...
 
H_CacheTable SFMCacheGetTable (H_SfmCache cache)
 
H_CacheFilter SFMCacheRetrieveFilter (H_SfmInstance sfm, H_CacheTable ctable, U16BIT teid, U8BIT vers)
 Search cache for section data. More...
 
void SFMCacheAddBlock (H_SfmInstance sfm, U8BIT size1, U8BIT bknum, void **phBuffer)
 Allocates space in cache for section data If allocation is made, *phBuffer has holds cache location. If section already allocated, or insufficient space, then *phBuffer is NULL. More...
 
U8BIT * SFM_CacheBuffer (H_SfmInstance sfm, void *hBuffer)
 Get section data buffer pointer in SFM's cache for the handle. This should only be called after SFM_RequireSection returned with SFM_UPDATE_CACHE. This may be called from 'interrupt' environment. The returned pointer may be used by client to copy section data into SFM's cache buffer. More...
 
void SFM_CacheReleaseBuffer (H_SfmInstance sfm, U8BIT *pSection, void *hBuffer)
 Release Cache buffer allocated by SFM_CacheBuffer. More...
 
BOOLEAN SFMCacheValidHandle (H_SfmInstance sfm, void *ptr)
 
void SFMCacheProcessSection (H_SfmInstance sfm, U8BIT *pSection, H_CacheFilter cfilter)
 Tells SFM Cache to update DSM-CC with cached buffer (reported to F_CacheMatch callback funtion. This also allows SFM cache to clean up completed buffers. More...
 
void SFMCacheSearch (H_SfmInstance sfm, H_CacheTable ctable, S_TableExt tex, U16BIT dsmref, E_SFM_STATUS status)
 Search cache for section data. More...
 

Detailed Description

Section Filter Manager: caching functions.

Date
19th October 2013
Author
Adam Sturtridge

Definition in file sfm_cache.c.

Function Documentation

U8BIT* SFM_CacheBuffer ( H_SfmInstance  sfm,
void *  hBuffer 
)

Get section data buffer pointer in SFM's cache for the handle. This should only be called after SFM_RequireSection returned with SFM_UPDATE_CACHE. This may be called from 'interrupt' environment. The returned pointer may be used by client to copy section data into SFM's cache buffer.

Parameters
H_SfmInstancesfm SFM instance handle.
void*hBuffer Section buffer handle returned by SFM_RequireSection
Returns
U8BIT* Pointer to buffer to store section data

Definition at line 702 of file sfm_cache.c.

void SFM_CacheClear ( H_SfmInstance  sfm)

Clear all SFM cached section data.

Clear all SFM cached section data. Not required to be called, if setup had sectionBuffCacheSize set to ZERO. Otherwise, this MUST be called on a transport stream change and optionally called at other times - e.g on a service change.

Parameters
H_SfmInstancesfm SFM instance handle.
Returns
void.

Definition at line 541 of file sfm_cache.c.

void SFM_CacheReleaseBuffer ( H_SfmInstance  sfm,
U8BIT *  pSection,
void *  hBuffer 
)

Release Cache buffer allocated by SFM_CacheBuffer.

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

Definition at line 725 of file sfm_cache.c.

void SFMCacheAddBlock ( H_SfmInstance  sfm,
U8BIT  size1,
U8BIT  bknum,
void **  phBuffer 
)

Allocates space in cache for section data If allocation is made, *phBuffer has holds cache location. If section already allocated, or insufficient space, then *phBuffer is NULL.

Parameters
H_SfmInstancesfm SFM instance handle.
H_CacheTablectable Cache table handle
void**phBuffer Pointer to SFM section buffer handle
Returns
void.

Definition at line 638 of file sfm_cache.c.

void SFMCacheProcessSection ( H_SfmInstance  sfm,
U8BIT *  pSection,
H_CacheFilter  cfilter 
)

Tells SFM Cache to update DSM-CC with cached buffer (reported to F_CacheMatch callback funtion. This also allows SFM cache to clean up completed buffers.

Parameters
H_SfmInstancesfm SFM instance handle.
U8BIT*pSection Pointer to whole section data buffer
H_CacheFiltercfilter Hande given to F_CacheMatch
Returns
void.

Definition at line 790 of file sfm_cache.c.

H_CacheFilter SFMCacheRetrieveFilter ( H_SfmInstance  sfm,
H_CacheTable  ctable,
U16BIT  teid,
U8BIT  vers 
)

Search cache for section data.

Parameters
H_SfmCachecache SFM cache handle.
H_CacheTablectable Cache table handle
U16BITteid Table Extension ID
Returns
H_CacheFilter

Definition at line 581 of file sfm_cache.c.

void SFMCacheSearch ( H_SfmInstance  sfm,
H_CacheTable  ctable,
S_TableExt  tex,
U16BIT  dsmref,
E_SFM_STATUS  status 
)

Search cache for section data.

Parameters
H_SfmInstancesfm SFM instance handle.
H_CacheTablectable Cache table handle
S_TableExttex Table Extension ID and mask
Returns
void.

Definition at line 822 of file sfm_cache.c.

BOOLEAN SFMCacheValidHandle ( H_SfmInstance  sfm,
void *  ptr 
)
Parameters
H_SfmInstancesfm SFM instance handle.
void*hCache Handle to cache buffer given to the F_CacheMatch callback function
Returns
BOOLEAN

Definition at line 757 of file sfm_cache.c.