static int app_tag_read_proc(char* page, char** start, off_t off, int count, int* eof, void *data)
{
    int len = 0;
    u32 charge_flag;
	u32 recovery_flag;  

	recovery_flag = get_recovery_flag();
    charge_flag = get_charge_flag();
    
    len = snprintf(page, PAGE_SIZE,
					"recovery_flag:\n%d\n"
					"charge_flag:\n%d\n",
					recovery_flag,
					charge_flag);
    return proc_calc_metrics(page, start, off, count, eof, len);
}
static int app_version_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
	// char *ker_ver = "HUAWEI_KERNEL_VERSION";
	char *ker_ver = HUAWEI_KERNEL_VERSION;
	char *lcd_name = NULL;
	char * touch_info = NULL;
	char *wifi_device_name = NULL;
	char audio_property[AUDIO_PROPERTY_LEN] = {0};
	/*print sensor info into app_info*/
	/*< DTS2012032003522 zengxiangguang 20120320 begin */
	/* Array **_**_id must be large enough to hold both id and sub id */
	/* 'cause the following code would call strcat function to connect */
	/* sub id to array **_**_id[] */
	char s_board_id[BOARD_ID_LEN + BOARD_ID_SUB_VER_LEN] = {0};
    char sub_ver[BOARD_ID_SUB_VER_LEN] = {0};
	char hw_version_id[HW_VERSION + HW_VERSION_SUB_VER] = {0};
	char hw_version_sub_ver[HW_VERSION_SUB_VER] = {0};	
	/* DTS2012032003522 zengxiangguang 20120320 end >*/
	char *compass_gs_name = NULL;
	char *sensors_list_name = NULL;
    set_s_board_hw_version(s_board_id,hw_version_id);
    sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
   sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
    strcat(s_board_id, sub_ver);
    strcat(hw_version_id, hw_version_sub_ver);
    set_s_board_hw_version_special(hw_version_id,hw_version_sub_ver,s_board_id,sub_ver);
	compass_gs_name=get_compass_gs_position_name();
	sensors_list_name = get_sensors_list_name();
	lcd_name = get_lcd_panel_name();
	wifi_device_name = get_wifi_device_name();
	get_audio_property(audio_property);
	touch_info = get_touch_info();
	if (touch_info == NULL)
	{
		touch_info = "Unknow touch";
	}
	
#ifdef CONFIG_HUAWEI_POWER_DOWN_CHARGE
    charge_flag = get_charge_flag();
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"charge_flag:\n%d\n"
	"compass_gs_position:\n%s\n"
	"sensors_list:\n%s\n"
	"hw_version:\n%s\n"
    "wifi_chip:\n%s\n"
	"audio_property:\n%s\n"
	"touch_info:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id,charge_flag, compass_gs_name,sensors_list_name, hw_version_id,wifi_device_name,audio_property, touch_info);
#else
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"compass_gs_position:\n%s\n"
	"sensors_list:\n%s\n"
	"hw_version:\n%s\n"
	"audio_property:\n%s\n"
	"touch_info:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, compass_gs_name,sensors_list_name, hw_version_id,audio_property, touch_info);
#endif
	
	return proc_calc_metrics(page, start, off, count, eof, len);
}
/*write the position of compass into the file of "/proc/app_info" */
static int app_version_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
	char *ker_ver = HUAWEI_KERNEL_VERSION;
	char *lcd_name = NULL;
	char s_board_id[BOARD_ID_LEN] = {0};
	char sub_ver[SUB_VER_LEN] = {0};
	char hw_version_id[HW_VERSION] = {0};
	char hw_version_sub_ver[HW_VERSION_SUB_VER] = {0};	
	char *compass_gs_name = NULL;
	char *wifi_name = NULL;

	switch(machine_arch_type)
	{
		case MACH_TYPE_MSM7X27_U8510:
			strcpy(s_board_id, "MSM7X27_U8510");
			break;

		case MACH_TYPE_MSM7X27_U8510_1:
			strcpy(s_board_id, "MSM7X27_U8510_1");
			break;
			
		case MACH_TYPE_MSM7X27_M650:
			strcpy(s_board_id, "MSM7X27_M650");
			break;

		case MACH_TYPE_MSM7X27_C8800:
			strcpy(s_board_id, "MSM7X27_C8800");
			break;

        case MACH_TYPE_MSM7X27_U8650:
			strcpy(s_board_id, "MSM7X27_U8650");
			break;
		
		case MACH_TYPE_MSM7X27_M865:
			strcpy(s_board_id, "MSM7X27_M865");
			break;
		case MACH_TYPE_MSM7X27_C8650:
			strcpy(s_board_id, "MSM7X27_C8650");
			break;

		default:
			strcpy(s_board_id, "ERROR");
			break;
	}

    sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
    strcat(s_board_id, sub_ver);
  
    strcat(hw_version_id, hw_version_sub_ver);
   
	lcd_name = get_lcd_panel_name();
	
	compass_gs_name=get_compass_gs_position_name();

	wifi_name = get_wifi_device_name();
	
#ifdef CONFIG_HUAWEI_KERNEL	
    memset(str_flash_nand_id,0,PROC_MANUFACTURER_STR_LEN);
    get_flash_id(str_flash_nand_id,PROC_MANUFACTURER_STR_LEN);
#endif	
    /* write the power down charge flag to the file /proc/app_info,
     * so we can read the flag in recovery mode to decide we enter  
     * the recovery mode or power down charge movie
     */
    #ifdef CONFIG_HUAWEI_POWER_DOWN_CHARGE    
    charge_flag = get_charge_flag();
    
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"hw_version:\n%s\n"
	"charge_flag:\n%d\n"
	"compass_gs_position:\n%s\n"
	"wifi_name:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, hw_version_id, charge_flag,compass_gs_name,wifi_name);
    #else
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"hw_version:\n%s\n"
	"compass_gs_position:\n%s\n"
	"wifi_name:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, hw_version_id,compass_gs_name,wifi_name);
    #endif
	
	return proc_calc_metrics(page, start, off, count, eof, len);
}
Exemple #4
0
static int app_version_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
	// char *ker_ver = "HUAWEI_KERNEL_VERSION";
	char *ker_ver = HUAWEI_KERNEL_VERSION;
	char *lcd_name = NULL;
	char * touch_info = NULL;
	char *wifi_device_name = NULL;
    char *bt_device_name = NULL;
	char audio_property[AUDIO_PROPERTY_LEN] = {0};
	char s_board_id[BOARD_ID_LEN + BOARD_ID_SUB_VER_LEN] = {0};
    char sub_ver[BOARD_ID_SUB_VER_LEN] = {0};
	char hw_version_id[HW_VERSION + HW_VERSION_SUB_VER] = {0};
	char hw_version_sub_ver[HW_VERSION_SUB_VER] = {0};	
	char *compass_gs_name = NULL;
	char *sensors_list_name = NULL;
    set_s_board_hw_version(s_board_id,hw_version_id);
    sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
   sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
    strcat(s_board_id, sub_ver);
    strcat(hw_version_id, hw_version_sub_ver);
    set_s_board_hw_version_special(hw_version_id,hw_version_sub_ver,s_board_id,sub_ver);
	compass_gs_name=get_compass_gs_position_name();
	sensors_list_name = get_sensors_list_name();
	lcd_name = get_lcd_panel_name();
	wifi_device_name = get_wifi_device_name();
	bt_device_name = get_bt_device_name();
	get_audio_property(audio_property);
	touch_info = get_touch_info();
	if (touch_info == NULL)
	{
		touch_info = "Unknow touch";
	}
	
#ifdef CONFIG_HUAWEI_POWER_DOWN_CHARGE
    charge_flag = get_charge_flag();
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"charge_flag:\n%d\n"
	"compass_gs_position:\n%s\n"
	"sensors_list:\n%s\n"
	"hw_version:\n%s\n"
    "wifi_chip:\n%s\n"
    "bt_chip:\n%s\n"
	"audio_property:\n%s\n"
	"touch_info:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id,charge_flag, compass_gs_name,sensors_list_name, hw_version_id,wifi_device_name,bt_device_name,audio_property, touch_info);
#else
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"compass_gs_position:\n%s\n"
	"sensors_list:\n%s\n"
	"hw_version:\n%s\n"
	"audio_property:\n%s\n"
	"touch_info:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, compass_gs_name,sensors_list_name, hw_version_id,audio_property, touch_info);
#endif
	
	return proc_calc_metrics(page, start, off, count, eof, len);
}
Exemple #5
0
/* < DTS2011042703449  liujinggang 20110427 begin */
static int app_version_read_proc(char *page, char **start, off_t off,
				 int count, int *eof, void *data)
{
	int len;
    /* <BU5D10533 duangan 2010-5-26 begin */
	// char *ker_ver = "HUAWEI_KERNEL_VERSION";
	char *ker_ver = HUAWEI_KERNEL_VERSION;
    /* BU5D10533 duangan 2010-5-26 end> */
	char *lcd_name = NULL;
	char s_board_id[BOARD_ID_LEN] = {0};
    char sub_ver[10] = {0};
	/* < DTS2011082201029 liwei 20110819 begin */
	char hw_version_id[HW_VERSION] = {0};
	char hw_version_sub_ver[HW_VERSION_SUB_VER] = {0};	
	/* DTS2011082201029 liwei 20110819 end > */
	char *compass_gs_name = NULL;
    
	switch(machine_arch_type)
	{
		case MACH_TYPE_MSM7X25_U8100:
			strcpy(s_board_id, "MSM7X25_U8100");
			break;
		case MACH_TYPE_MSM7X25_U8105:
			strcpy(s_board_id, "MSM7X25_U8105");
			break;
		case MACH_TYPE_MSM7X25_U8107:
			strcpy(s_board_id, "MSM7X25_U8107");
			break;
		case MACH_TYPE_MSM7X25_U8109:
			strcpy(s_board_id, "MSM7X25_U8109");
			break;
		case MACH_TYPE_MSM7X25_U8110:
			strcpy(s_board_id, "MSM7X25_U8110");
			break;
		case MACH_TYPE_MSM7X25_U8120:
			strcpy(s_board_id, "MSM7X25_U8120");
			break;
		case MACH_TYPE_MSM7X25_U7610:
			strcpy(s_board_id, "MSM7X25_U7610");
			break;
		case MACH_TYPE_MSM7X25_U8500:
			strcpy(s_board_id, "MSM7X25_U8500");
			break;
		case MACH_TYPE_MSM7X25_U8300:
			strcpy(s_board_id, "MSM7X25_U8300");
			break;
		/*U8150_EU and U8150_JP*/
		case MACH_TYPE_MSM7X25_U8150:
			strcpy(s_board_id, "MSM7X25_U8150");
			break;
		case MACH_TYPE_MSM7X25_C8500:
			strcpy(s_board_id, "MSM7X25_C8500");
			break;
	    case MACH_TYPE_MSM7X25_C8600:
			strcpy(s_board_id, "MSM7X25_C8600");
			break;
        case MACH_TYPE_MSM7X30_U8800:
			strcpy(s_board_id, "MSM7X30_U8800");
			break;
        /*< DTS2010092400487  lijianzhao 20100924 begin */       
        case MACH_TYPE_MSM7X30_U8820:
/*< DTS2011010505694  muyongquan 20110218 begin */     
      		 	if (socinfo_get_msm_cpu()==MSM_CPU_8X55)
			strcpy(s_board_id, "MSM8255_U8820");
			if(socinfo_get_msm_cpu()==MSM_CPU_7X30)
/* DTS2011010505694  muyongquan 220110218 end >*/    
			strcpy(s_board_id, "MSM7x30_U8820");
			break;
        /* DTS2010092400487  lijianzhao 20100924 end >*/
        /*< DTS2011030802106 renxigang 20100308 begin */     
        /*< DTS2010112702297 wangquanli 201001125 begin */
        case MACH_TYPE_MSM7X30_U8800_51:
			strcpy(s_board_id, "MSM7X30_U8800-51");
			break;
        /* DTS2010112702297 wangquanli 201001125 end >*/
        /* DTS2011030802106 renxigang 20100308 end >*/
        /*< DTS2011030802106 renxigang 20100308 begin */
        /*< DTS2011030202729  liliang 20110302  begin */		
        case MACH_TYPE_MSM8255_U8800_PRO:
			strcpy(s_board_id, "MSM8255_U8800-PRO");
			break;
        /* DTS2011030202729  liliang 20110302 end >*/
        /* DTS2011030802106 renxigang 20100308 end >*/
		/* < DTS2011082201029 liwei 20110819 begin */
        /* <DTS2011041501614 duangan 2011-4-18 begin */
        case MACH_TYPE_MSM8255_U8860:
            strcpy(s_board_id, "MSM8255_U8860");
            strcpy(hw_version_id, "HD2U886M ");
	        sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
            break;
        /* DTS2011041501614 duangan 2011-4-18 end> */
		/* <DTS2011050700551 zhangbo 20110505 begin */
        case MACH_TYPE_MSM8255_C8860:
            strcpy(s_board_id, "MSM8255_C8860");
            strcpy(hw_version_id, "HC1C886M ");
	        sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
            break;
        /* DTS2011050700551 zhangbo 20110505 end> */
        /* <DTS2011062600102 sunhonghui 20110626 begin */
        case MACH_TYPE_MSM8255_U8860LP:
            strcpy(s_board_id, "MSM8255_U8860LP");
            strcpy(hw_version_id, "HD2U886M ");
	        sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
            break;
        /* DTS2011062600102 sunhonghui 20110626 end> */
		/*<DTS2011091502092 liyuping 20110915 begin */		
		/* <DTS2011110206054 liyuping 20111108 begin */	
		/* change HW_VERSION number */
        case MACH_TYPE_MSM8255_U8860_51:
            strcpy(s_board_id, "MSM8255_U8860-51");
            strcpy(hw_version_id, "HD2U886M01 ");
	        sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
            break;
		/* DTS2011110206054 liyuping 20111108 end> */
		/* DTS2011091502092 liyuping 20110915 end> */
		/* <DTS2011071600361 liyuping 20110716 begin */
		case MACH_TYPE_MSM8255_U8860_92:
            strcpy(s_board_id, "MSM8255_U8860-92");
            strcpy(hw_version_id, "HD4U886M ");
	        sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
            break;
		/* DTS2011071600361 liyuping 20110716 end> */
		/* < DTS2011082302564 liwei 20110823 begin */
		case MACH_TYPE_MSM8255_U8680:
            strcpy(s_board_id, "MSM8255_U8680");
            strcpy(hw_version_id, "HD1U868M ");
	        sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
            break;
		/* DTS2011082302564 liwei 20110823 end > */
		/* < DTS2011102401822 liwei 20111024 begin */
		case MACH_TYPE_MSM8255_U8667:
		    strcpy(s_board_id, "MSM8255_U8667");
            strcpy(hw_version_id, "HD1U866M ");
	        sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
            break;
		/* DTS2011102401822 liwei 20111024 end > */
		/* DTS2011082201029 liwei 20110819 end > */
		/* <DTS2011091200073 zhangbo 20110912 begin */
        case MACH_TYPE_MSM8255_U8730:
            strcpy(s_board_id, "MSM8255_U8730");
            strcpy(hw_version_id, "HD1U873M ");
	        sprintf(hw_version_sub_ver, "VER.%c", 'A'+(char)get_hw_sub_board_id());
            break;
    /* DTS2011091200073 zhangbo 20110912 end> */
		default:
			strcpy(s_board_id, "ERROR");
			break;
	}
    if(MACH_TYPE_MSM7X25_U8120 == machine_arch_type)
    {
        sprintf(sub_ver, ".Ver%c", 'B');
    }
    /*U8150_EU==U8150_Ver.A and U8150_JP==U8150_Ver.B*/
    else if(MACH_TYPE_MSM7X25_U8150 == machine_arch_type)
    {
        /*if sub_board_id is equal to 0(VerA), the product is U8150_EU.*/
        if(HW_VER_SUB_VA == get_hw_sub_board_id())
        {
            sprintf(sub_ver, "_EU.%c", 'A'+(char)get_hw_sub_board_id());
        }
        /*if sub_board_id is equal to 1(VerB), the product is U8150_Japan.*/
        else if(HW_VER_SUB_VB == get_hw_sub_board_id())
        {
            sprintf(sub_ver, "_JP.%c", 'A'+(char)get_hw_sub_board_id());
        }
        else
        {
            sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
        }
    }
	/* < DTS2011052400629 caomingxing 20110524 begin */
	else if(MACH_TYPE_MSM7X30_U8800_51 == machine_arch_type)
    {
        if(HW_VER_SUB_VD == get_hw_sub_board_id())
        {
            sprintf(sub_ver, ".Ver%c", 'C');
        }
        else
        {
            sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
        }
    }
	/* DTS2011052400629 caomingxing 20110524 end > */
    else
    {
        sprintf(sub_ver, ".Ver%c", 'A'+(char)get_hw_sub_board_id());
    }
    strcat(s_board_id, sub_ver);
    /* < DTS2011082201029 liwei 20110819 begin */
    strcat(hw_version_id, hw_version_sub_ver);
	/* DTS2011082201029 liwei 20110819 end > */

/* < BU5D10365 liujinggang 20100521 begin*/
	lcd_name = get_lcd_panel_name();
/* BU5D10365 liujinggang 20100521 end > */
	compass_gs_name=get_compass_gs_position_name();
	
/* <DTS2010071502918 shenjinming 20101008 begin */
#ifdef CONFIG_HUAWEI_POWER_DOWN_CHARGE
    charge_flag = get_charge_flag();
    /* < DTS2011082201029 liwei 20110819 begin */
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"charge_flag:\n%d\n"
	"compass_gs_position:\n%s\n"
	"hw_version:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id,charge_flag, compass_gs_name, hw_version_id);
#else
	len = snprintf(page, PAGE_SIZE, "APPSBOOT:\n"
	"%s\n"
	"KERNEL_VER:\n"
	"%s\n"
	 "FLASH_ID:\n"
	"%s\n"
	"board_id:\n%s\n"
	"lcd_id:\n%s\n"
	"cam_id:\n%d\n"
	"ts_id:\n%d\n"
	"compass_gs_position:\n%s\n"
	"hw_version:\n%s\n",
	appsboot_version, ker_ver, str_flash_nand_id, s_board_id, lcd_name, camera_id, ts_id, compass_gs_name, hw_version_id);
	/* DTS2011082201029 liwei 20110819 end > */
#endif
/* DTS2010071502918 shenjinming 20101008 end> */ 	
	
	return proc_calc_metrics(page, start, off, count, eof, len);
}