int mtk_thermal_get_extra_info(
    int *no_extra_attr,
    char ***attr_names, 
    int **attr_values, 
    char ***attr_units)
{
#if defined(CONFIG_ARCH_MT6589) || defined(CONFIG_ARCH_MT6582)  
    int size, i=0;
    
    if (no_extra_attr)
        *no_extra_attr = NO_EXTRA_THERMAL_ATTR;

    //******************
    // Modem Index
    //******************
    {
        struct md_info *p_info;
        mtk_mdm_get_md_info(&p_info, &size);
        if (size <= NO_EXTRA_THERMAL_ATTR-1)
        {
            for (i=0; i<size; i++) 
            {
                extra_attr_names[i] = p_info[i].attribute;
                extra_attr_values[i] = p_info[i].value;
                extra_attr_units[i] = p_info[i].unit;
            }
        }
    }

    //******************
    // Wifi Index
    //******************
    /* Get Wi-Fi Tx throughput */
    extra_attr_names[i] = "WiFi_TP";
    extra_attr_values[i] = get_sys_wifi_throughput("/proc/wmt_tm/tx_thro", 3);
    extra_attr_units[i] = "Kbps";

    if (attr_names)
        *attr_names = extra_attr_names;

    if (attr_values)
        *attr_values = extra_attr_values;

    if (attr_units)
        *attr_units = extra_attr_units;

    return 0;

#else
    return -1;
#endif 
    
}
示例#2
0
int mtk_thermal_get_extra_info(
    int *no_extra_attr,
    char ***attr_names,
    int **attr_values,
    char ***attr_units)
{

    int size, i=0;

    if (no_extra_attr)
        *no_extra_attr = NO_EXTRA_THERMAL_ATTR;

    //******************
    // Modem Index
    //******************
    THRML_LOG("[mtk_thermal_get_gpu_info] mtk_mdm_get_md_info\n");
    {
        struct md_info *p_info;
        mtk_mdm_get_md_info(&p_info, &size);
        THRML_LOG("[mtk_thermal_get_gpu_info] mtk_mdm_get_md_info size %d\n", size);
        if (size <= NO_EXTRA_THERMAL_ATTR-1)
        {
            for (i=0; i<size; i++)
            {
                extra_attr_names[i] = p_info[i].attribute;
                extra_attr_values[i] = p_info[i].value;
                extra_attr_units[i] = p_info[i].unit;
            }
        }
    }

    //******************
    // Wifi Index
    //******************
    /* Get Wi-Fi Tx throughput */
    THRML_LOG("[mtk_thermal_get_gpu_info] get_sys_wifi_throughput\n");
    extra_attr_names[i] = "WiFi_TP";
    extra_attr_values[i] = get_sys_wifi_throughput("/proc/wmt_tm/tx_thro", 3);
    extra_attr_units[i] = "Kbps";

    if (attr_names)
        *attr_names = extra_attr_names;

    if (attr_values)
        *attr_values = extra_attr_values;

    if (attr_units)
        *attr_units = extra_attr_units;

    return 0;

}