/*************************************************************** ** ** Broadcom Corp. Confidential ** Copyright 2003-2008 Broadcom Corp. All Rights Reserved. ** ** THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED ** SOFTWARE LICENSE AGREEMENT BETWEEN THE USER AND BROADCOM. ** YOU HAVE NO RIGHT TO USE OR EXPLOIT THIS MATERIAL EXCEPT ** SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. ** ** File: si_main.c ** Description: The main entry point of SI processing. This file ** contains the functions to create the thread for ** SI flow mornitoring and managing, as well as the ** functional entry point for processing SI tables. ** ** Created: 03/08/2001 ** ** REVISION: ** ** $Log: $ ** ** ****************************************************************/ #include "si.h" #include "si_os.h" #include "si_dbg.h" #include "si_util.h" #include "si_list.h" #include "si_aeit.h" #include "si_aett.h" #include "si_mgt.h" #include "si_vct.h" #include "si_lvct.h" #include "si_nit.h" #include "si_rrt.h" #include "si_svct.h" #include "si_ntt.h" #include "si_ea.h" #include "pod.h" #include "pod_os.h" #include "pod_list.h" #include "pod_ext_chan.h" //pthread_t si_mon; POD_THREAD_INFO si_mon; static int SI_MGR_Thread(void); /* Init all the SI elements. */ void SI_Init(void) { #ifdef SI_DEBUG SI_Dbg_Set_Debug_Level(E_SI_DBG_MSG); #else SI_Dbg_Set_Debug_Level(E_SI_WRN_MSG); #endif SI_LVCT_Init(); SI_MGT_Init(); SI_NIT_Init(); SI_NTT_Init(); SI_RRT_Init(); SI_STT_Init(); SI_SVCT_Init(); SI_EA_Init(); } /* create SI flow managing thread. */ void SI_Create(void) { /* create flow manager thread. */ //pthread_create(&si_mon, NULL, (void*)SI_MGR_Thread, (void *)0); POD_Create_Thread( &(si_mon), (void*)SI_MGR_Thread, (void *)0); POD_Detach_Thread(&(si_mon)); } /* SI flow manager thread. */ static int SI_MGR_Thread(void) { //pthread_exit(0); POD_thread_exit; } /* SI data processing entry point. */ void SI_Process_Data(unsigned char *data, unsigned long len, unsigned char *free_data) { unsigned char *ptr = data; unsigned short section_len; SI_DBG_PRINT(E_SI_DBG_MSG,("SI Process: data len %x\n", len)); while (((unsigned long)(ptr - data)) < len) { SI_DBG_PRINT(E_SI_DBG_MSG,("SI Process: table id %x\n", *ptr)); switch (*ptr) { case SI_NIT_TABLE_ID: SI_NIT_parse(ptr); break; case SI_NTT_TABLE_ID: SI_NTT_parse(ptr); break; case SI_SVCT_TABLE_ID: SI_SVCT_parse(ptr); break; case SI_STT_TABLE_ID: SI_STT_parse(ptr); break; case SI_MGT_TABLE_ID: SI_MGT_parse(ptr); break; case SI_LVCT_TABLE_ID: SI_LVCT_Parse(ptr); break; case SI_RRT_TABLE_ID: SI_RRT_parse(ptr); break; case SI_AEIT_TABLE_ID: SI_AEIT_Parse(ptr); break; case SI_AETT_TABLE_ID: SI_AETT_Parse(ptr); break; case SI_EA_TABLE_ID: SI_EA_Parse(ptr); break; default: break; } ptr++; section_len = ((((unsigned short)*ptr++)<<8)&0x0f00); section_len |= (((unsigned short)*ptr++)&0x00ff); SI_DBG_PRINT(E_SI_DBG_MSG,("SI Process: section len %x\n", section_len)); ptr += section_len; } if (((unsigned long)(ptr - data)) != len) { SI_DBG_PRINT(E_SI_ERR_MSG,("Ext SI Process: data length error!!!\n")); } SI_free(free_data); }