| 1 | /*************************************************************** |
|---|
| 2 | ** |
|---|
| 3 | ** Broadcom Corp. Confidential |
|---|
| 4 | ** Copyright 2003-2008 Broadcom Corp. All Rights Reserved. |
|---|
| 5 | ** |
|---|
| 6 | ** THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED |
|---|
| 7 | ** SOFTWARE LICENSE AGREEMENT BETWEEN THE USER AND BROADCOM. |
|---|
| 8 | ** YOU HAVE NO RIGHT TO USE OR EXPLOIT THIS MATERIAL EXCEPT |
|---|
| 9 | ** SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 10 | ** |
|---|
| 11 | ** File: si_lvct.h |
|---|
| 12 | ** Description: defines and headers for function that parses the |
|---|
| 13 | ** L-VCT table sections and keeps track of all the |
|---|
| 14 | ** virtual channel link lists. |
|---|
| 15 | ** |
|---|
| 16 | ** Created: 03/08/2001 |
|---|
| 17 | ** |
|---|
| 18 | ** REVISION: |
|---|
| 19 | ** |
|---|
| 20 | ** $Log: $ |
|---|
| 21 | ** |
|---|
| 22 | ** |
|---|
| 23 | ****************************************************************/ |
|---|
| 24 | |
|---|
| 25 | #ifndef SI_LVCT_H |
|---|
| 26 | #define SI_LVCT_H |
|---|
| 27 | |
|---|
| 28 | #define LVCT_ACCESS_CONTROLED_MASK 0x10 |
|---|
| 29 | #define LVCT_HIDDEN_MASK 0x08 |
|---|
| 30 | #define LVCT_PATH_SELECT_MASK 0x04 |
|---|
| 31 | #define LVCT_OUT_OF_BAND_MASK 0x02 |
|---|
| 32 | #define LVCT_HIDE_GUIDE_MASK 0x01 |
|---|
| 33 | |
|---|
| 34 | #define LVCT_SHORT_NAME_LENGTH 7 |
|---|
| 35 | |
|---|
| 36 | typedef enum |
|---|
| 37 | { |
|---|
| 38 | LVCT_MM_ANALOG = 0x1, /* Analog TV. */ |
|---|
| 39 | LVCT_MM_SCTE1 = 0x2, /* SCTE mode 1 typically QAM-64. */ |
|---|
| 40 | LVCT_MM_SCTE2 = 0x3, /* SCTE mode 2 typically QAM-256. */ |
|---|
| 41 | LVCT_MM_8_VSB = 0x4, /* ATSC 8 VSB. */ |
|---|
| 42 | LVCT_MM_16_VSB = 0x5, /* ATSC 16 VSB. */ |
|---|
| 43 | } LVCT_MOD_MODE; /* modulation mode. */ |
|---|
| 44 | |
|---|
| 45 | /* time shifted service structure, carried in time shifted descriptor. */ |
|---|
| 46 | typedef struct |
|---|
| 47 | { |
|---|
| 48 | unsigned short time_shift; /* time shift in seconds. */ |
|---|
| 49 | VirtChanNumMode vcn_mode; /* virtual channel number scheme. 0 onpart, 1 twopart. */ |
|---|
| 50 | unsigned short channum1; /* for one part mode, this is the virtual channel number. for two part, this will be the major part. */ |
|---|
| 51 | unsigned short channum2; /* for one part mode, this is not used. for two part, this is the minor part. */ |
|---|
| 52 | } TIME_SHIFT_SERV; |
|---|
| 53 | |
|---|
| 54 | typedef struct _SI_LVCT_CHANNEL |
|---|
| 55 | { |
|---|
| 56 | VirtChanNumMode vcn_mode; /* virtual channel number scheme. 0 onpart, 1 twopart. */ |
|---|
| 57 | unsigned short channum1; /* for one part mode, this is the virtual channel number. for two part, this will be the major part. */ |
|---|
| 58 | unsigned short channum2; /* for one part mode, this is not used. for two part, this is the minor part. */ |
|---|
| 59 | unsigned short source_ID; /* source_ID corresponding to the channel. */ |
|---|
| 60 | unsigned short short_name[LVCT_SHORT_NAME_LENGTH]; /* 7 unicode characters. */ |
|---|
| 61 | unsigned short tsid; /* transport stream id for this channel. */ |
|---|
| 62 | unsigned long carrier_freq; /* in Hz. */ |
|---|
| 63 | unsigned char mod_mode; |
|---|
| 64 | unsigned short program_num; /* program number for digital channel. 0xffff for analog channel. 0 for inactive channel. */ |
|---|
| 65 | unsigned char serv_type; /* service type. */ |
|---|
| 66 | unsigned char chanbits; /* includes masks for access_controled, hidden, path_select, out_of_band, hide_guide. */ |
|---|
| 67 | unsigned char ext_name_len; /* extended channel name text length, carried by extended channel name descriptor if any. */ |
|---|
| 68 | char * ext_name; /* extended channel name text, carried by extended channel name descriptor if any. */ |
|---|
| 69 | unsigned char num_of_ts_serv; /* number of time shifted services. */ |
|---|
| 70 | TIME_SHIFT_SERV * time_shifted; /* time shifted service structure. */ |
|---|
| 71 | SI_LST_D_ENTRY(_SI_LVCT_CHANNEL) chan_link; |
|---|
| 72 | } SI_LVCT_CHANNEL; |
|---|
| 73 | |
|---|
| 74 | SI_LST_D_HEAD(lvct_channel_list, _SI_LVCT_CHANNEL); |
|---|
| 75 | |
|---|
| 76 | /* For the following, refer to table 5.26 of ANSI/SCTE65 2002 (DVS234) */ |
|---|
| 77 | /* for table header. */ |
|---|
| 78 | #define LVCT_TABLE_ID_BYTE_INDX 0 |
|---|
| 79 | #define LVCT_TABLE_ID_BYTE_NUM 1 |
|---|
| 80 | #define LVCT_TABLE_ID_SHIFT 0 |
|---|
| 81 | #define LVCT_TABLE_ID_MASK 0xff |
|---|
| 82 | |
|---|
| 83 | #define LVCT_SECTION_LENGTH_BYTE_INDX 1 |
|---|
| 84 | #define LVCT_SECTION_LENGTH_BYTE_NUM 2 |
|---|
| 85 | #define LVCT_SECTION_LENGTH_SHIFT 0 |
|---|
| 86 | #define LVCT_SECTION_LENGTH_MASK 0x0fff |
|---|
| 87 | |
|---|
| 88 | #define LVCT_VERSION_NUMBER_BYTE_INDX 5 |
|---|
| 89 | #define LVCT_VERSION_NUMBER_BYTE_NUM 1 |
|---|
| 90 | #define LVCT_VERSION_NUMBER_SHIFT 1 |
|---|
| 91 | #define LVCT_VERSION_NUMBER_MASK 0x1f |
|---|
| 92 | |
|---|
| 93 | #define LVCT_CURRENT_NEXT_INDICATOR_BYTE_INDX 5 |
|---|
| 94 | #define LVCT_CURRENT_NEXT_INDICATOR_BYTE_NUM 1 |
|---|
| 95 | #define LVCT_CURRENT_NEXT_INDICATOR_SHIFT 0 |
|---|
| 96 | #define LVCT_CURRENT_NEXT_INDICATOR_MASK 0x01 |
|---|
| 97 | |
|---|
| 98 | #define LVCT_SECTION_NUMBER_BYTE_INDX 6 |
|---|
| 99 | #define LVCT_SECTION_NUMBER_BYTE_NUM 1 |
|---|
| 100 | #define LVCT_SECTION_NUMBER_SHIFT 0 |
|---|
| 101 | #define LVCT_SECTION_NUMBER_MASK 0xff |
|---|
| 102 | |
|---|
| 103 | #define LVCT_LAST_SECTION_NUMBER_BYTE_INDX 7 |
|---|
| 104 | #define LVCT_LAST_SECTION_NUMBER_BYTE_NUM 1 |
|---|
| 105 | #define LVCT_LAST_SECTION_NUMBER_SHIFT 0 |
|---|
| 106 | #define LVCT_LAST_SECTION_NUMBER_MASK 0xff |
|---|
| 107 | |
|---|
| 108 | #define LVCT_PROTOCOL_VERSION_BYTE_INDX 8 |
|---|
| 109 | #define LVCT_PROTOCOL_VERSION_BYTE_NUM 1 |
|---|
| 110 | #define LVCT_PROTOCOL_VERSION_SHIFT 0 |
|---|
| 111 | #define LVCT_PROTOCOL_VERSION_MASK 0xff |
|---|
| 112 | |
|---|
| 113 | #define LVCT_NUM_CHANNELS_BYTE_INDX 9 |
|---|
| 114 | #define LVCT_NUM_CHANNELS_BYTE_NUM 1 |
|---|
| 115 | #define LVCT_NUM_CHANNELS_SHIFT 0 |
|---|
| 116 | #define LVCT_NUM_CHANNELS_MASK 0xff |
|---|
| 117 | |
|---|
| 118 | /* for inside channel loop. relative offset after the short name only. */ |
|---|
| 119 | #define LVCT_MAJOR_NUMBER_BYTE_INDX 0 |
|---|
| 120 | #define LVCT_MAJOR_NUMBER_BYTE_NUM 2 |
|---|
| 121 | #define LVCT_MAJOR_NUMBER_SHIFT 2 |
|---|
| 122 | #define LVCT_MAJOR_NUMBER_MASK 0x3ff |
|---|
| 123 | |
|---|
| 124 | #define LVCT_MINOR_NUMBER_BYTE_INDX 1 |
|---|
| 125 | #define LVCT_MINOR_NUMBER_BYTE_NUM 2 |
|---|
| 126 | #define LVCT_MINOR_NUMBER_SHIFT 0 |
|---|
| 127 | #define LVCT_MINOR_NUMBER_MASK 0x3ff |
|---|
| 128 | |
|---|
| 129 | #define LVCT_MODULATION_MODE_BYTE_INDX 3 |
|---|
| 130 | #define LVCT_MODULATION_MODE_BYTE_NUM 1 |
|---|
| 131 | #define LVCT_MODULATION_MODE_SHIFT 0 |
|---|
| 132 | #define LVCT_MODULATION_MODE_MASK 0xff |
|---|
| 133 | |
|---|
| 134 | #define LVCT_CARRIER_FREQUENCY_BYTE_INDX 4 |
|---|
| 135 | #define LVCT_CARRIER_FREQUENCY_BYTE_NUM 4 |
|---|
| 136 | #define LVCT_CARRIER_FREQUENCY_SHIFT 0 |
|---|
| 137 | #define LVCT_CARRIER_FREQUENCY_MASK 0xffffffff |
|---|
| 138 | |
|---|
| 139 | #define LVCT_CHANNEL_TSID_BYTE_INDX 8 |
|---|
| 140 | #define LVCT_CHANNEL_TSID_BYTE_NUM 2 |
|---|
| 141 | #define LVCT_CHANNEL_TSID_SHIFT 0 |
|---|
| 142 | #define LVCT_CHANNEL_TSID_MASK 0xffff |
|---|
| 143 | |
|---|
| 144 | #define LVCT_PROGRAM_NUMBER_BYTE_INDX 10 |
|---|
| 145 | #define LVCT_PROGRAM_NUMBER_BYTE_NUM 2 |
|---|
| 146 | #define LVCT_PROGRAM_NUMBER_SHIFT 0 |
|---|
| 147 | #define LVCT_PROGRAM_NUMBER_MASK 0xffff |
|---|
| 148 | |
|---|
| 149 | #define LVCT_CHANNEL_BITS_BYTE_INDX 12 |
|---|
| 150 | #define LVCT_CHANNEL_BITS_BYTE_NUM 1 |
|---|
| 151 | #define LVCT_CHANNEL_BITS_SHIFT 1 |
|---|
| 152 | #define LVCT_CHANNEL_BITS_MASK 0x1f |
|---|
| 153 | |
|---|
| 154 | #define LVCT_SERVICE_TYPE_BYTE_INDX 13 |
|---|
| 155 | #define LVCT_SERVICE_TYPE_BYTE_NUM 1 |
|---|
| 156 | #define LVCT_SERVICE_TYPE_SHIFT 0 |
|---|
| 157 | #define LVCT_SERVICE_TYPE_MASK 0x3f |
|---|
| 158 | |
|---|
| 159 | #define LVCT_SOURCE_ID_BYTE_INDX 14 |
|---|
| 160 | #define LVCT_SOURCE_ID_BYTE_NUM 2 |
|---|
| 161 | #define LVCT_SOURCE_ID_SHIFT 0 |
|---|
| 162 | #define LVCT_SOURCE_ID_MASK 0xffff |
|---|
| 163 | |
|---|
| 164 | #define LVCT_DESC_LENGTH_BYTE_INDX 16 |
|---|
| 165 | #define LVCT_DESC_LENGTH_BYTE_NUM 2 |
|---|
| 166 | #define LVCT_DESC_LENGTH_SHIFT 0 |
|---|
| 167 | #define LVCT_DESC_LENGTH_MASK 0x3ff |
|---|
| 168 | |
|---|
| 169 | /* after the channel loop. */ |
|---|
| 170 | #define LVCT_ADD_DESC_LENGTH_BYTE_INDX 0 |
|---|
| 171 | #define LVCT_ADD_DESC_LENGTH_BYTE_NUM 2 |
|---|
| 172 | #define LVCT_ADD_DESC_LENGTH_SHIFT 0 |
|---|
| 173 | #define LVCT_ADD_DESC_LENGTH_MASK 0x3ff |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | |
|---|
| 177 | #ifdef __cplusplus |
|---|
| 178 | extern "C" { |
|---|
| 179 | #endif |
|---|
| 180 | |
|---|
| 181 | void SI_LVCT_Init(void); |
|---|
| 182 | SI_RET_CODE SI_LVCT_Parse (unsigned char *lvct_table); |
|---|
| 183 | |
|---|
| 184 | #ifdef __cplusplus |
|---|
| 185 | } |
|---|
| 186 | #endif |
|---|
| 187 | |
|---|
| 188 | |
|---|
| 189 | #endif |
|---|