DSMCC  15.3.1
source/dsfm/src/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"

Data Structures

struct  s_CacheNode
struct  s_CacheFilter
struct  s_CacheTable
struct  s_NodeBlock
struct  s_FiltBlock
struct  s_SfmCache

Defines

#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_NodeBlockH_NodeBlock
typedef struct s_FiltBlockH_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.
H_CacheTable SFMCacheGetTable (H_SfmCache cache)
H_CacheFilter SFMCacheRetrieveFilter (H_SfmInstance sfm, H_CacheTable ctable, U16BIT teid, U8BIT vers)
 Search cache for section data.
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.
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.
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.
void SFMCacheSearch (H_SfmInstance sfm, H_CacheTable ctable, S_TableExt tex, U16BIT dsmref, E_SFM_STATUS status)
 Search cache for section data.

Detailed Description

Section Filter Manager: caching functions.

Date:
19th October 2013
Author:
Adam Sturtridge

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

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.
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.
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.
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
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.
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
 All Data Structures Files Functions Typedefs