1 #include "MsTypes.h"
2 #include "utopia.h"
3 #ifdef MSOS_TYPE_LINUX_KERNEL
4 #include <linux/string.h>
5 #else
6 #include <stdio.h>
7 #include <string.h>
8 #endif
9 #include "drvDSCMB_v2.h"
10 #include "dscmb_private.h"
11
12 #include "utopia_dapi.h"
13 #include "drvDSCMB.h"
14 #include "MsOS.h"
15 #include "ULog.h"
16 // MACRO definition
17 #define DBG_EN 0
18
19 #define DSCMB_ASSERT_RETURN(x, y) if(!(x)) {ULOGE("DSCMB", "Assert Fail : %s, %d\n", __FUNCTION__, __LINE__); return y;}
20
21 #if DBG_EN
22 #define DSCMB_PRINT(x) ULOGD("DSCMB", x);
23
24 #else
25 #define DSCMB_PRINT(x)
26
27 #endif
28 //
29 // ========== Global definition ==========
30 void* pModuleDscmb = NULL;
31
32 #if DBG_EN
33 static const char *aCmdStr[E_MDRV_CMD_DSCMB_MAX] = { "E_MDRV_CMD_DSCMB_Init\n",
34 "E_MDRV_CMD_DSCMB_Exit\n",
35 "E_MDRV_CMD_DSCMB_SetPowerState\n",
36 "E_MDRV_CMD_DSCMB_FltAlloc\n",
37 "E_MDRV_CMD_DSCMB_FltFree\n",
38 "E_MDRV_CMD_DSCMB_FltConnectFltId\n",
39 "E_MDRV_CMD_DSCMB_FltDisconnectFltId\n",
40 "E_MDRV_CMD_DSCMB_FltDisconnectPid\n",
41 "E_MDRV_CMD_DSCMB_FltDscmb\n",
42 "E_MDRV_CMD_DSCMB_FltTypeSet\n",
43 "E_MDRV_CMD_DSCMB_FltKeySet\n",
44 "E_MDRV_CMD_DSCMB_FltKeyReset\n",
45 "E_MDRV_CMD_DSCMB_FltIVSet\n",
46 "E_MDRV_CMD_DSCMB_HDCP2_SetRiv\n",
47 "E_MDRV_CMD_DSCMB_Multi2_SetRound\n",
48 "E_MDRV_CMD_DSCMB_Multi2_SetSysKey\n",
49 "E_MDRV_CMD_DSCMB_PidFlt_ScmbStatus\n",
50 "E_MDRV_CMD_DSCMB_PidFlt_PVR_RecCtrl\n",
51 "E_MDRV_CMD_DSCMB_PidFlt_SetDefaultCAVid\n",
52 "E_MDRV_CMD_DSCMB_PidFlt_EngSetAlgo\n",
53 "E_MDRV_CMD_DSCMB_PidFlt_EngSetKey\n",
54 "E_MDRV_CMD_DSCMB_PidFlt_EngResetKey\n",
55 "E_MDRV_CMD_DSCMB_PidFlt_EngSetIV\n",
56 "E_MDRV_CMD_DSCMB_PidFlt_EngSetSwitch\n",
57 "E_MDRV_CMD_DSCMB_PidFlt_EngSetFSCB\n",
58 "E_MDRV_CMD_DSCMB_PidFlt_KLadder_AtomicExec\n",
59 "E_MDRV_CMD_DSCMB_PidFlt_KLadder_ETSI\n",
60 "E_MDRV_CMD_DSCMB_PidFlt_QueryCap\n",
61 "E_MDRV_CMD_DSCMB_PidFlt_SetDBGLevel\n",
62 "E_MDRV_CMD_DSCMB_PidFlt_GetLibVer\n",
63 "E_MDRV_CMD_DSCMB_PidFlt_GetConnectStatus\n"};
64
65 #endif
66
67 // variable export to driver layer
68 MS_U32* _u32FreeSlot;
69 stDscmbTspMap (*DscmbTspMap)[MAX_NUM];
70
DSCMBStr(MS_U32 u32PowerState,void * pModule)71 MS_U32 DSCMBStr(MS_U32 u32PowerState, void* pModule)
72 {
73 return MDrv_DSCMB2_SetPowerState(u32PowerState);
74 }
75
DSCMBRegisterToUtopia(void)76 void DSCMBRegisterToUtopia(void)
77 {
78 DSCMB_RESOURCE_PRIVATE * pResPri = NULL;
79
80 // 1. deal with module
81 UtopiaModuleCreate(MODULE_DSCMB, 8, &pModuleDscmb);
82 UtopiaModuleRegister(pModuleDscmb);
83 UtopiaModuleSetupFunctionPtr(pModuleDscmb, (FUtopiaOpen)DSCMBOpen, (FUtopiaClose)DSCMBClose, (FUtopiaIOctl)DSCMBIoctl);
84
85 #ifdef CONFIG_UTOPIA_PROC_DBG_SUPPORT
86 UtopiaModuleRegisterMdbNode("dscmb", (FUtopiaMdbIoctl)DSCMBMdbIoctl);
87 #endif
88
89 #if defined(MSOS_TYPE_LINUX_KERNEL)
90 UtopiaModuleSetupSTRFunctionPtr(pModuleDscmb, (FUtopiaSTR)DSCMBStr);
91 #endif
92 // 2. deal with resource
93 void* psResource = NULL;
94 UtopiaModuleAddResourceStart(pModuleDscmb, E_DSCMB_RESOURCE);
95 UtopiaResourceCreate("DSCMB", sizeof(DSCMB_RESOURCE_PRIVATE), &psResource);
96 UtopiaResourceRegister(pModuleDscmb, psResource, E_DSCMB_RESOURCE);
97
98 UtopiaModuleAddResourceEnd(pModuleDscmb, E_DSCMB_RESOURCE);
99
100 if(UtopiaResourceObtain(pModuleDscmb, E_DSCMB_RESOURCE, &psResource) != 0)
101 {
102 ULOGE("DSCMB", "Dscmb - UtopiaResourceObtain fail\n");
103 return;
104 }
105
106 UtopiaResourceGetPrivate(psResource, (void**)&pResPri);
107
108 if(pResPri->u32Magic != MAGIC_NUM)
109 {
110 // not regiser yet
111 pResPri->u32Magic = MAGIC_NUM;
112 pResPri->bInited_Drv = FALSE;
113 }
114
115 UtopiaResourceRelease(psResource);
116
117 /*
118 UtopiaStartResourceAdd(pUtopiaModule, E_DSCMB_POOL_ID_ENG0);
119 psResource = (UTOPIA_RESOURCE*)UtopiaResourceCreate("DSCMB_ENG0", sizeof(DSCMB_RESOURCE_PRIVATE));
120 UtopiaResourceRegister(pUtopiaModule, psResource, E_DSCMB_POOL_ID_ENG0);
121
122 psResource = NULL;
123 UtopiaStartResourceAdd(pUtopiaModule, E_DSCMB_POOL_ID_ENG1);
124 psResource = (UTOPIA_RESOURCE*)UtopiaResourceCreate("DSCMB_ENG1", sizeof(DSCMB_RESOURCE_PRIVATE));
125 UtopiaResourceRegister(pUtopiaModule, psResource, E_DSCMB_POOL_ID_ENG1);
126
127 psResource = NULL;
128 UtopiaStartResourceAdd(pUtopiaModule, E_DSCMB_POOL_ID_ENG2);
129 psResource = (UTOPIA_RESOURCE*)UtopiaResourceCreate("DSCMB_ENG2", sizeof(DSCMB_RESOURCE_PRIVATE));
130 UtopiaResourceRegister(pUtopiaModule, psResource, E_DSCMB_POOL_ID_ENG2);
131 */
132 }
133
134 #ifdef CONFIG_UTOPIA_PROC_DBG_SUPPORT
DSCMBMdbIoctl(MS_U32 cmd,const void * const pArgs)135 MS_U32 DSCMBMdbIoctl(MS_U32 cmd, const void* const pArgs)
136 {
137 MDBCMD_CMDLINE_PARAMETER *paraCmdLine;
138 MDBCMD_GETINFO_PARAMETER *paraGetInfo;
139 void* pstRes = NULL;
140 DSCMB_RESOURCE_PRIVATE * pstResPri = NULL;
141 stDscmbTspMap* pMap;
142 switch(cmd)
143 {
144 case MDBCMD_CMDLINE:
145 paraCmdLine = (MDBCMD_CMDLINE_PARAMETER *)pArgs;
146 paraCmdLine->result = MDBRESULT_SUCCESS_FIN;
147 break;
148 case MDBCMD_GETINFO:
149 paraGetInfo = (MDBCMD_GETINFO_PARAMETER *)pArgs;
150 if(UtopiaResourceObtain(pModuleDscmb, E_DSCMB_RESOURCE, &pstRes) != 0)
151 {
152 MdbPrint(paraGetInfo->u64ReqHdl, "ERROR : DSCMB - UtopiaResourceObtain fail\n");
153 paraCmdLine->result = MDBRESULT_SUCCESS_FIN;
154 return 0;
155 }
156
157 UtopiaResourceGetPrivate(pstRes, (void**)&pstResPri);
158 DscmbTspMap = pstResPri->DscmbTspMap;
159 if(FALSE == pstResPri->bInited_Drv)
160 {
161 MdbPrint(paraGetInfo->u64ReqHdl,"ERROR : DSCMB not initialize yet\n");
162 }
163 else
164 {
165 int u32Eng = 0;
166 int u32DscmbId = 0;
167 int u32Cnt = 0;
168 MdbPrint(paraGetInfo->u64ReqHdl,"---------MStar Demux KeySet Info---------\n");
169 MdbPrint(paraGetInfo->u64ReqHdl,"DSCMB ID\t# of Keys\tCAVID\tTSID\t Connected Demux ID\n");
170 for(u32Eng = 0; u32Eng < ENG_NUM; u32Eng++)
171 {
172 pMap = &DscmbTspMap[u32Eng][u32DscmbId];
173 if(pMap->bUsed == FALSE)
174 continue;
175
176 for(u32DscmbId = 0; u32DscmbId < MAX_KEY; u32DscmbId++)
177 {
178 MdbPrint(paraGetInfo->u64ReqHdl,"%d\t0xF\t0\t", (u32Eng * ENG_NUM) + u32DscmbId);
179 for(u32Cnt = 0; u32Cnt < pMap->u32PidFltIdNum; u32Cnt++)
180 {
181 MdbPrint(paraGetInfo->u64ReqHdl,"%d, ", pMap->u32PidFltId[u32Cnt]);
182 }
183 MdbPrint(paraGetInfo->u64ReqHdl,"\n");
184 }
185 }
186
187 }
188 paraGetInfo->result = MDBRESULT_SUCCESS_FIN;
189 break;
190 default:
191 break;
192 }
193 return 0;
194 }
195 #endif
196
DSCMBOpen(void ** ppInstance,MS_U32 u32ModuleVersion,void * pAttribute)197 MS_U32 DSCMBOpen(void** ppInstance, MS_U32 u32ModuleVersion, void* pAttribute)
198 {
199 //UTOPIA_TRACE(MS_UTOPIA_DB_LEVEL_TRACE,ULOGD("DSCMB", "enter %s %d\n",__FUNCTION__,__LINE__));
200 UtopiaInstanceCreate(sizeof(DSCMB_INSTANT_PRIVATE), ppInstance);
201
202 DSCMB_INSTANT_PRIVATE* psDscmbInstPri = NULL;
203 UtopiaInstanceGetPrivate(*ppInstance, (void**)&psDscmbInstPri);
204 memset(&psDscmbInstPri->pInitVector, 0x0, DSCMB_IV_LENGTH);
205 memset(&psDscmbInstPri->pCipherKey, 0x0, DSCMB_KEY_LENGTH);
206
207 //MDrv_DSCMB_Init();
208 //UTOPIA_TRACE(MS_UTOPIA_DB_LEVEL_TRACE,ULOGD("DSCMB", "leave %s %d\n",__FUNCTION__,__LINE__));
209
210 return UTOPIA_STATUS_SUCCESS;
211 }
212
DSCMBIoctl(void * pInstance,MS_U32 u32Cmd,void * pu32Args)213 MS_U32 DSCMBIoctl(void* pInstance, MS_U32 u32Cmd, void* pu32Args)
214 {
215 void* pstRes = NULL;
216 MS_U32 u32Ret = UTOPIA_STATUS_FAIL;
217 DSCMB_RESOURCE_PRIVATE * pstResPri = NULL;
218 DSCMB_INSTANT_PRIVATE *pstInstPri = NULL;
219 //UTOPIA_TRACE(MS_UTOPIA_DB_LEVEL_TRACE,ULOGD("DSCMB", "enter %s %d\n",__FUNCTION__,__LINE__));
220
221 DSCMB_ASSERT_RETURN((pInstance != NULL), UTOPIA_STATUS_PARAMETER_ERROR);
222
223 DSCMB_ASSERT_RETURN((u32Cmd < E_MDRV_CMD_DSCMB_MAX), UTOPIA_STATUS_NOT_SUPPORTED);
224
225 DSCMB_PRINT(aCmdStr[u32Cmd]);
226
227 //DSCMB_INSTANT_PRIVATE* psDscmbInstPri = (DSCMB_INSTANT_PRIVATE*)UtopiaInstantGetPrivate(pInstant);
228
229 //UtopiaResourceObtainToInstant(pInstant, E_DSCMB_RESOURCE);
230 if(UtopiaResourceObtain(pModuleDscmb, E_DSCMB_RESOURCE, &pstRes) != 0)
231 {
232 ULOGE("DSCMB", "Dscmb - UtopiaResourceObtain fail\n");
233 return UTOPIA_STATUS_FAIL;
234 }
235
236 UtopiaResourceGetPrivate(pstRes, (void**)&pstResPri);
237
238 if((FALSE == pstResPri->bInited_Drv) &&
239 (u32Cmd != E_MDRV_CMD_DSCMB_Init) &&
240 (u32Cmd != E_MDRV_CMD_DSCMB_QueryCap))
241 {
242 ULOGE("DSCMB", "Dscmb has not been initialized.\n");
243 UtopiaResourceRelease(pstRes);
244 return UTOPIA_STATUS_FAIL;
245 }
246
247 _u32FreeSlot = pstResPri->u32FreeSlot;
248 DscmbTspMap = pstResPri->DscmbTspMap;
249
250 switch(u32Cmd)
251 {
252 case E_MDRV_CMD_DSCMB_Init:
253 if(pstResPri->bInited_Drv == FALSE)
254 {
255 if(TRUE == _MDrv_DSCMB_Init())
256 {
257 pstResPri->bInited_Drv = TRUE;
258 }
259 }
260 u32Ret = UTOPIA_STATUS_SUCCESS;
261 break;
262 case E_MDRV_CMD_DSCMB_Exit:
263 if(pstResPri->bInited_Drv == TRUE)
264 {
265 if(TRUE == _MDrv_DSCMB_Exit())
266 {
267 pstResPri->bInited_Drv = FALSE;
268 }
269 }
270 u32Ret = UTOPIA_STATUS_SUCCESS;
271 break;
272
273 case E_MDRV_CMD_DSCMB_QueryCap:
274 {
275 DSCMB_QUERYCAP * psQuery = (DSCMB_QUERYCAP *)pu32Args;
276 if(TRUE == _MDrv_DSCMB2_GetCap(
277 psQuery->u32EngId,
278 psQuery->eQueryType,
279 psQuery->pInput,
280 psQuery->pOutput))
281 {
282 u32Ret = UTOPIA_STATUS_SUCCESS;
283 }
284
285 break;
286 }
287
288 case E_MDRV_CMD_DSCMB_OptConfig:
289 {
290 DSCMB_OPTCONFIG * psOpt = (DSCMB_OPTCONFIG *)pu32Args;
291 if(TRUE == _MDrv_DSCMB2_OptConfig(
292 psOpt->u32EngId,
293 psOpt->eOpt,
294 psOpt->pInput,
295 psOpt->pOutput,
296 psOpt->bSet))
297 {
298 u32Ret = UTOPIA_STATUS_SUCCESS;
299 }
300
301 break;
302 }
303
304 case E_MDRV_CMD_DSCMB_FltAlloc:
305 {
306 //MS_U32 u32Flt = 0;
307 DSCMB_FLTALLOC* pFltAlloc = (DSCMB_FLTALLOC *)pu32Args;
308 //u32EngId = (MS_U32)psDscmbInstPri->ePoolId;
309
310 pFltAlloc->u32DscmbId = _MDrv_DSCMB2_FltAlloc_Ex(pFltAlloc->u32EngId,
311 pFltAlloc->eFltType);
312 if(pFltAlloc->u32DscmbId != DRV_DSCMB_FLT_NULL)
313 {
314 u32Ret = UTOPIA_STATUS_SUCCESS;
315 }
316 }
317 break;
318
319 case E_MDRV_CMD_DSCMB_FltConnectFltId:
320 {
321 DSCMB_CONNECTFLT * pConnectFlt = (DSCMB_CONNECTFLT *)pu32Args;
322 if(TRUE == _MDrv_DSCMB2_FltConnectFltId(pConnectFlt->u32EngId,
323 pConnectFlt->u32DscmbId,
324 pConnectFlt->u32DmxFltId))
325 {
326 u32Ret = UTOPIA_STATUS_SUCCESS;
327 }
328 }
329 break;
330 case E_MDRV_CMD_DSCMB_FltDisconnectFltId:
331 {
332 DSCMB_DISCONNECTFLT * pDisconnectFlt = (DSCMB_DISCONNECTFLT *)pu32Args;
333 if(TRUE == _MDrv_DSCMB2_FltDisconnectFltId(pDisconnectFlt->u32EngId,
334 pDisconnectFlt->u32DscmbId,
335 pDisconnectFlt->u32DmxFltId))
336 {
337 u32Ret = UTOPIA_STATUS_SUCCESS;
338 }
339 }
340 break;
341 #if !(defined(MSOS_TYPE_NUTTX) || defined(MSOS_TYPE_OPTEE))
342 case E_MDRV_CMD_DSCMB_FltConnectPid:
343 {
344 DSCMB_CONNECTPID * pstConnectPid = (DSCMB_CONNECTPID *)pu32Args;
345 if(TRUE == _MDrv_DSCMB2_FltConnectPid(
346 pstConnectPid->u32EngId,
347 pstConnectPid->u32DscmbId,
348 pstConnectPid->u32Pid))
349 {
350 u32Ret = UTOPIA_STATUS_SUCCESS;
351 }
352 }
353 break;
354
355 case E_MDRV_CMD_DSCMB_FltDisconnectPid:
356 {
357 DSCMB_DISCONNECTPID * pstDisconnectPid = (DSCMB_DISCONNECTPID *)pu32Args;
358 if(TRUE == _MDrv_DSCMB2_FltDisconnectPid(pstDisconnectPid->u32EngId,
359 pstDisconnectPid->u32DscmbId,
360 pstDisconnectPid->u32Pid))
361 {
362 u32Ret = UTOPIA_STATUS_SUCCESS;
363 }
364 }
365 break;
366 #endif
367 case E_MDRV_CMD_DSCMB_FltDscmb:
368 {
369 DSCMB_FLTDSCMB * pstFltDscmb = (DSCMB_FLTDSCMB *)pu32Args;
370
371 if(TRUE == _MDrv_DSCMB2_FltDscmb(pstFltDscmb->u32EngId,
372 pstFltDscmb->u32DscmbId,
373 pstFltDscmb->bDscmb))
374 {
375 u32Ret = UTOPIA_STATUS_SUCCESS;
376 }
377 }
378 break;
379
380 case E_MDRV_CMD_DSCMB_FltFree:
381 {
382 //u32EngId = (MS_U32)psDscmbInstPri->ePoolId;
383 DSCMB_FLTFREE * pFltFree = (DSCMB_FLTFREE *)pu32Args;
384 if(TRUE == _MDrv_DSCMB2_FltFree(pFltFree->u32EngId,
385 pFltFree->u32DscmbId))
386 {
387 u32Ret = UTOPIA_STATUS_SUCCESS;
388 }
389 }
390 break;
391
392 case E_MDRV_CMD_DSCMB_FltIVSet:
393 {
394 UtopiaInstanceGetPrivate(pInstance, (void**)&pstInstPri);
395 DSCMB_FLTIVSET * pstFltIVSet = (DSCMB_FLTIVSET *)pu32Args;
396
397 if(TRUE == _MDrv_DSCMB2_FltIVSet(pstFltIVSet->u32EngId,
398 pstFltIVSet->u32DscmbId,
399 pstFltIVSet->eKeyType,
400 pstFltIVSet->pu8IV))
401 {
402 u32Ret = UTOPIA_STATUS_SUCCESS;
403 }
404 ///@@ FIXME : IV belong to each DSCMB id, not to one engine
405 memcpy(pstInstPri->pInitVector, pstFltIVSet->pu8IV, DSCMB_IV_LENGTH);
406 pstInstPri->eKeyType = pstFltIVSet->eKeyType;
407 }
408 break;
409
410 case E_MDRV_CMD_DSCMB_FltKeyReset:
411 {
412 DSCMB_FLTKEYRESET * pstFltKeyReset = (DSCMB_FLTKEYRESET *)pu32Args;
413 if(TRUE == _MDrv_DSCMB2_FltKeyReset(pstFltKeyReset->u32EngId,
414 pstFltKeyReset->u32DscmbId,
415 pstFltKeyReset->eKeyType))
416 {
417 u32Ret = UTOPIA_STATUS_SUCCESS;
418 }
419 }
420 break;
421
422 case E_MDRV_CMD_DSCMB_FltKeySet:
423 {
424 UtopiaInstanceGetPrivate(pInstance, (void**)&pstInstPri);
425 DSCMB_FLTKEYSET * pstFltKeySet = (DSCMB_FLTKEYSET *)pu32Args;
426
427 if(TRUE == _MDrv_DSCMB2_FltKeySet(pstFltKeySet->u32EngId,
428 pstFltKeySet->u32DscmbId,
429 pstFltKeySet->eKeyType,
430 pstFltKeySet->pu8Key))
431 {
432 ///@@ FIXME : Key belong to each DSCMB id, not to one engine
433 memcpy(pstInstPri->pCipherKey, pstFltKeySet->pu8Key, DSCMB_KEY_LENGTH);
434 pstInstPri->eKeyType = pstFltKeySet->eKeyType;
435 u32Ret = UTOPIA_STATUS_SUCCESS;
436 }
437 }
438 break;
439
440 case E_MDRV_CMD_DSCMB_FltTypeSet:
441 {
442 UtopiaInstanceGetPrivate(pInstance, (void**)&pstInstPri);
443 DSCMB_TYPESET *pstTypeSet = (DSCMB_TYPESET *)pu32Args;
444 if(TRUE == _MDrv_DSCMB2_FltTypeSet(pstTypeSet->u32EngId,
445 pstTypeSet->u32DscmbId,
446 pstTypeSet->eType))
447 {
448 pstInstPri->eType = pstTypeSet->eType;
449 u32Ret = UTOPIA_STATUS_SUCCESS;
450 }
451 }
452 break;
453
454 case E_MDRV_CMD_DSCMB_HDCP2_SetRiv:
455 {
456 DSCMB_HDCP2_SETRIV * pstSetRiv = (DSCMB_HDCP2_SETRIV *)pu32Args;
457 if(TRUE == _MDrv_DSCMB2_HDCP2_SetRIV(pstSetRiv->u32EngId,
458 pstSetRiv->pu8Riv))
459 {
460 u32Ret = UTOPIA_STATUS_SUCCESS;
461 }
462 }
463 break;
464
465 case E_MDRV_CMD_DSCMB_Multi2_SetRound:
466 {
467 DSCMB_MULTI2_SETROUND * pstSetRnd = (DSCMB_MULTI2_SETROUND *)pu32Args;
468 if(TRUE == _MDrv_DSCMB2_Multi2_SetRound(pstSetRnd->u32EngId,
469 pstSetRnd->u32Round))
470 {
471 u32Ret = UTOPIA_STATUS_SUCCESS;
472 }
473 }
474 break;
475
476 case E_MDRV_CMD_DSCMB_Multi2_SetSysKey:
477 {
478 DSCMB_MULTI2_SETSYSKEY * psSetSysKey = (DSCMB_MULTI2_SETSYSKEY *)pu32Args;
479 if(TRUE == _MDrv_DSCMB2_Multi2_SetSystemKey(psSetSysKey->u32EngId,
480 (MS_U8*)psSetSysKey->pu8SysKey))
481 {
482 u32Ret = UTOPIA_STATUS_SUCCESS;
483 }
484 }
485 break;
486
487 case E_MDRV_CMD_DSCMB_PidFlt_ScmbStatus:
488 {
489 DSCMB_DSCMBSTATUS * pDscmbStatus = (DSCMB_DSCMBSTATUS *)pu32Args;
490 if(TRUE == _MDrv_DSCMB2_PidFlt_ScmbStatus(pDscmbStatus->u32EngId,
491 pDscmbStatus->u32DmxFltId,
492 pDscmbStatus->pScmbLevel))
493 {
494 u32Ret = UTOPIA_STATUS_SUCCESS;
495 }
496 }
497 break;
498
499 case E_MDRV_CMD_DSCMB_SetPowerState:
500 {
501 EN_POWER_MODE * pPowereMode = (EN_POWER_MODE *)pu32Args;
502 if(TRUE == _MDrv_DSCMB2_SetPowerState(*pPowereMode))
503 {
504 u32Ret = UTOPIA_STATUS_SUCCESS;
505 }
506 }
507 break;
508
509 default:
510 ULOGE("DSCMB", "Unsupport dscmb command 0x%x\n", (int)u32Cmd);
511 break;
512 };
513
514 UtopiaResourceRelease(pstRes);
515 //UTOPIA_TRACE(MS_UTOPIA_DB_LEVEL_TRACE,ULOGD("DSCMB", "leave %s %d\n",__FUNCTION__,__LINE__));
516 return u32Ret;
517 }
518
DSCMBClose(void * pInstance)519 MS_U32 DSCMBClose(void* pInstance)
520 {
521 //UTOPIA_TRACE(MS_UTOPIA_DB_LEVEL_TRACE,ULOGD("DSCMB", "enter %s %d\n",__FUNCTION__,__LINE__));
522 //UTOPIA_TRACE(MS_UTOPIA_DB_LEVEL_TRACE,ULOGD("DSCMB", "leave %s %d\n",__FUNCTION__,__LINE__));
523 UtopiaInstanceDelete(pInstance);
524 return UTOPIA_STATUS_SUCCESS;
525 }
526
527
528
529