Пример #1
0
static PRESULT rs232upg_item_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT ret = PROC_PASS;
	VACTION unact;
	UINT8 bID;

	bID = OSD_GetObjID(pObj);

	switch(event)
	{
		case EVN_UNKNOWN_ACTION:
			unact = (VACTION)(param1>>16);
			if(unact == VACT_ENTER && bID == START_ID)
			{
				system_state = SYS_STATE_UPGRAGE_HOST;

				OSD_SetAttr(&rs232upg_item_con1, C_ATTR_INACTIVE);
				OSD_SetAttr(&rs232upg_item_con2, C_ATTR_INACTIVE);
				OSD_DrawObject( (POBJECT_HEAD)&rs232upg_item_con1, C_UPDATE_ALL);
				OSD_DrawObject( (POBJECT_HEAD)&rs232upg_item_con2, C_UPDATE_ALL);

				ClearUpgFlag();
			
				if(OSD_GetMultiselSel(&rs232upg_sel_upgrade_type) == 0)
				{
               				p2p_enable_upgrade_bootloader(TRUE);
					if(InitBlockList() != SUCCESS)
						return PROC_LEAVE;											
					SetUpgFlag(0, 0, 1);
				}
				else
				{					
					p2p_enable_upgrade_bootloader(FALSE);
					if(InitBlockList() != SUCCESS)
						return PROC_LEAVE;
					//-a by wangyang del seecode upgrade 
					if(OSD_GetMultiselSel(&rs232upg_sel_upgrade_type) == 1)
						SetUpgFlag(Index2Id(OSD_GetMultiselSel(&rs232upg_sel_upgrade_type)), 0xFFFFFFFF, 1);
					else
						SetUpgFlag(Index2Id(OSD_GetMultiselSel(&rs232upg_sel_upgrade_type)+1), 0xFFFFFFFF, 1);
				//	SetUpgFlag(Index2Id(OSD_GetMultiselSel(&rs232upg_sel_upgrade_type)), 0xFFFFFFFF, 1);
				}
				
				//start transfer
				win_rs232upg_start();
			
				OSD_SetAttr(&rs232upg_item_con1, C_ATTR_ACTIVE);
				OSD_SetAttr(&rs232upg_item_con2, C_ATTR_ACTIVE);
				OSD_DrawObject( (POBJECT_HEAD)&rs232upg_item_con1, C_UPDATE_ALL);
				OSD_TrackObject( (POBJECT_HEAD)&rs232upg_item_con2, C_UPDATE_ALL);

				system_state = SYS_STATE_NORMAL;
			}
			break;
	}

	return ret;
}
Пример #2
0
void NandInit(void)
{
    gNandSizeInitDone = 0;
    NandSetupSize();
    InitBlockList();
}
Пример #3
0
static void win_rs232upg_load_chunk_info()
{
	CHUNK_HEADER blk_header;
	UINT32 id,mask;
	UINT8 chunk_number;
	UINT8 i;
	char strTmp[30];
	char strTmp1[30];
	char strTmp2[30];
	char strTmp3[30];
	char strTmp4[30];
	char strTmp5[30];
	char strTmp6[30];
	char strTmp7[30];
	char strTmp8[30];
#if (defined HDCP_IN_FLASH ||defined DIVX_CERT_ENABLE)
	UINT32 Block_id = 0, HDCP_key_ID = 0,divx_key_ID = 0,ciplus_key_ID = 0;
	UINT8 hdcp_chunk_index = 0;
   	UINT8 cipluskey_chunk_index = 0;
    
	BOOL has_hdcp_chunk = FALSE;
    	BOOL has_cipluskey_chunk = FALSE;
	UINT8 divx_chunk_index = 0;
	BOOL has_divx_chunk = FALSE;	
	UINT32 special_type =0;

#endif
//-a by wangyang del seecode upgrade {{
	UINT32 seecode_key_ID = 0;
	UINT8 seecode_chunk_index = 0;
    	BOOL has_seecodekey_chunk = FALSE;
//-a by wangyang del seecode upgrade }}

	chunk_number = sto_chunk_count(0,0);

	if(chunk_number == 0)
		return;

	if(InitBlockList() != SUCCESS)
		return;

	if(rs232upg_upgtype_chars != NULL)
		FREE(rs232upg_upgtype_chars);
	rs232upg_upgtype_chars = (UINT16**)MALLOC(sizeof(UINT16*)*chunk_number);
	if(rs232upg_upgtype_chars == NULL)
		ASSERT(0);
	for(i=0; i<chunk_number; i++)
	{
		rs232upg_upgtype_chars[i] = (UINT16*)MALLOC(16*sizeof(UINT16));
		if(rs232upg_upgtype_chars[i] == NULL)
			ASSERT(0);
	}
	
	
//	STRCPY(rs232upg_upgtype_chars[0],"allcode");
	{
			UINT16 *unistr=NULL;
         		unistr=OSD_GetUnicodeString(RS_TOTAL_FLASH);
            		ComUniStrCopyChar(rs232upg_upgtype_chars[0],(UINT16 *)unistr);
			//ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_TOTAL_FLASH),strTmp);
			//STRCPY(rs232upg_upgtype_chars[0],strTmp);
        }
	
	for(i=1; i<chunk_number; i++)
	{
		id = mask = 0;
		sto_chunk_goto(&id,mask,i + 1);
		sto_get_chunk_header(id, &blk_header);

#if (defined HDCP_IN_FLASH ||defined DIVX_CERT_ENABLE || defined CI_PLUS_SUPPORT )
         special_type = 0;
#ifdef HDCP_IN_FLASH
		HDCP_key_ID = HDCPKEY_CHUNK_ID;
		if(((UINT32)blk_header.id) == HDCP_key_ID)
		{
			hdcp_chunk_index = i;
			has_hdcp_chunk = TRUE;
			special_type = 1;
		}
#endif
#ifdef DIVX_CERT_ENABLE
		divx_key_ID = DIVX_CHUCK_ID;
		if(((UINT32)blk_header.id) == divx_key_ID)
		{
			divx_chunk_index = i;
			has_divx_chunk = TRUE;
			special_type = 1;
		}
#endif
#ifdef CI_PLUS_SUPPORT
        ciplus_key_ID = CIPLUSKEY_CHUNK_ID;
        if(((UINT32)blk_header.id) == ciplus_key_ID)
        {
            cipluskey_chunk_index = i;
            has_cipluskey_chunk = TRUE;
            special_type = 1;
        }
#endif
//-a by wangyang del seecode upgrade {{
	seecode_key_ID =SEECODE_CHUNK_ID
        if(((UINT32)blk_header.id) == ciplus_key_ID)
        {
            seecode_chunk_index = i;
            has_seecodekey_chunk = TRUE;
            special_type = 1;
        }
//-a by wangyang del seecode upgrade }}
		if(special_type != 1)
			{
			STRCPY(rs232upg_upgtype_chars[i], blk_header.name);
//-a by wangyang del seecode upgrade {{
		if(i==1)
		{
			ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_FIRMWARE),strTmp1);
			STRCPY(rs232upg_upgtype_chars[i], strTmp1);
		}
		else if (i == 2)
		{
			ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_SEECODE),strTmp2);
			STRCPY(rs232upg_upgtype_chars[i],strTmp2);
		}
		else if (i == 3)
		{
			ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_LOGO),strTmp3);
			STRCPY(rs232upg_upgtype_chars[i], strTmp3);
		}
		else if (i == 4)
		{
			ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_CCCAM_PRIO),strTmp4);
			STRCPY(rs232upg_upgtype_chars[i], strTmp4);
		}
		else if (i == 5)
		{
			ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_CCCAM_NEWCAM),strTmp5);
			STRCPY(rs232upg_upgtype_chars[i], strTmp5);
		}
		else if (i == 6)
		{
			ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_DEFAULT_DATA),strTmp6);
			STRCPY(rs232upg_upgtype_chars[i], strTmp6);
		}
		else if (i == 7)
		{
			ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_USER_DATA),strTmp7);
			STRCPY(rs232upg_upgtype_chars[i], strTmp7);
		}
//-a by wangyang del seecode upgrade }}
	}

#else
		STRCPY(rs232upg_upgtype_chars[i],blk_header.name);
//-a by wangyang del seecode upgrade {{
	seecode_key_ID =SEECODE_CHUNK_ID;
        if(((UINT32)blk_header.id) == seecode_key_ID)
        {
            seecode_chunk_index = i;
            has_seecodekey_chunk = TRUE;
            //special_type = 1;
        }
		if(i==1)
		{
			UINT16 *unistr=NULL;
         		unistr=OSD_GetUnicodeString(RS_FIRMWARE);
            		ComUniStrCopyChar(rs232upg_upgtype_chars[1],(UINT16 *)unistr);
			//ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_FIRMWARE),strTmp1);
			//STRCPY(rs232upg_upgtype_chars[1], strTmp1);
        	}
		
		else if (i == 2)
		{
	//		ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_SEECODE),strTmp2);
	//		STRCPY(rs232upg_upgtype_chars[i], strTmp2);
		}
		else if (i == 3)
		{
	//		ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_LOGO),strTmp3);
	//		STRCPY(rs232upg_upgtype_chars[i],strTmp3);
		}
		else if (i == 4)
		{
	//		ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_CCCAM_PRIO),strTmp4);
	//		STRCPY(rs232upg_upgtype_chars[i], strTmp4);
		}
		else if (i == 5)
		{
	//		ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_CCCAM_NEWCAM),strTmp5);
	//		STRCPY(rs232upg_upgtype_chars[i], strTmp5);
		}
		else if (i == 6)
		{
		//	ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_DEFAULT_DATA),strTmp6);
		//	STRCPY(rs232upg_upgtype_chars[i], strTmp6);
		}
		else if (i == 9)
		{
		//	ComUniStrToAsc((UINT8 *)OSD_GetUnicodeString(RS_USER_DATA),strTmp7);
		//	STRCPY(rs232upg_upgtype_chars[2],strTmp7);
		}
//-a by wangyang del seecode upgrade }}

#endif
	}
//-a by wangyang del seecode upgrade {{

	if(has_seecodekey_chunk == TRUE)
	{
		FREE(rs232upg_upgtype_chars[seecode_chunk_index]);
		for(i=seecode_chunk_index; i<chunk_number;i++)
			rs232upg_upgtype_chars[i] = rs232upg_upgtype_chars[i+1];
		chunk_number--;
  #ifdef HDCP_IN_FLASH
      if( (has_seecodekey_chunk == TRUE) && seecode_chunk_index < hdcp_chunk_index)
            hdcp_chunk_index --;
        if( (has_divx_chunk == TRUE) && seecode_chunk_index < cipluskey_chunk_index)
            cipluskey_chunk_index --;
        if( (has_divx_chunk == TRUE) && seecode_chunk_index < divx_chunk_index)
            divx_chunk_index --;
  #endif
      
	}
//-a by wangyang del seecode upgrade }}

	
#ifdef HDCP_IN_FLASH
	if(has_hdcp_chunk == TRUE)
	{
		FREE(rs232upg_upgtype_chars[hdcp_chunk_index]);
		for(i=hdcp_chunk_index; i<chunk_number;i++)
			rs232upg_upgtype_chars[i] = rs232upg_upgtype_chars[i+1];
		chunk_number--;
        if( (has_cipluskey_chunk == TRUE) && hdcp_chunk_index < cipluskey_chunk_index)
            cipluskey_chunk_index --;
        if( (has_divx_chunk == TRUE) && hdcp_chunk_index < divx_chunk_index)
            divx_chunk_index --;
        
	}
#endif

#ifdef DIVX_CERT_ENABLE
	if(has_divx_chunk == TRUE)
	{
		FREE(rs232upg_upgtype_chars[divx_chunk_index]);
		for(i=divx_chunk_index; i<chunk_number;i++)
			rs232upg_upgtype_chars[i] = rs232upg_upgtype_chars[i+1];
		chunk_number--;
        if( (has_cipluskey_chunk == TRUE) && divx_chunk_index < cipluskey_chunk_index)
            cipluskey_chunk_index --;
	}
#endif

#ifdef CI_PLUS_SUPPORT
        if(has_cipluskey_chunk == TRUE)
        {
            FREE(rs232upg_upgtype_chars[cipluskey_chunk_index]);
            for(i=cipluskey_chunk_index; i<chunk_number;i++)
                rs232upg_upgtype_chars[i] = rs232upg_upgtype_chars[i+1];
            chunk_number--;
        }
#endif

#if (defined HDCP_IN_FLASH ||defined DIVX_CERT_ENABLE || defined CI_PLUS_SUPPORT )
	OSD_SetMultiselSelTable(&rs232upg_sel_upgrade_type,rs232upg_upgtype_chars);
	OSD_SetMultiselCount(&rs232upg_sel_upgrade_type, chunk_number);
#else
	OSD_SetMultiselSelTable(&rs232upg_sel_upgrade_type,rs232upg_upgtype_chars);
	OSD_SetMultiselCount(&rs232upg_sel_upgrade_type, 2);
#endif
	
}