⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 phb_handler_startup.c

📁 最新MTK手机软件源码
💻 C
📖 第 1 页 / 共 5 页
字号:
                {
                    case PHB_TYPE_1_FILE:
                        fileType = 1;
                        break;
                    case PHB_TYPE_2_FILE:
                        fileType = 2;
                        break;
                    case PHB_TYPE_3_FILE:
                        fileType = 3;
                        break;
                    case PHB_ADN_DO:
                        do_type = DATA_DESC_ADN;
                        if (control_block->data[pos + 1] == 3)  /* add length + 1 */
                        {
                            phb_ptr->adn_sfi = control_block->data[pos + 4];
                        }
                        break;
                    case PHB_EXT1_DO:
                        do_type = DATA_DESC_EXT1;
                        break;
                #ifdef __PHB_USIM_SUPPORT__
                    case PHB_IAP_DO:
                        do_type = DATA_DESC_IAP;
                        break;
                    case PHB_SNE_DO:
                        do_type = DATA_DESC_SNE;
                        phb_ptr->sne_type = fileType;
                        if (fileType == 2 && phb_ptr->iap_length < PHB_IAP_MAX_OBJECT)
                        {
                            phb_ptr->iap_sne = phb_ptr->iap_length;
                            phb_ptr->iap_length++;
                        }
                        break;
                    case PHB_ANR_DO:
                        if (anr_num == 0)
                        {
                            do_type = DATA_DESC_ANRA;
                            phb_ptr->anra_type = fileType;
                            if (fileType == 2 && phb_ptr->iap_length < PHB_IAP_MAX_OBJECT)
                            {
                                phb_ptr->iap_anra = phb_ptr->iap_length;
                                phb_ptr->iap_length++;
                            }
                        }
                        else if (anr_num == 1)
                        {
                            do_type = DATA_DESC_ANRB;
                            phb_ptr->anrb_type = fileType;
                            if (fileType == 2 && phb_ptr->iap_length < PHB_IAP_MAX_OBJECT)
                            {
                                phb_ptr->iap_anrb = phb_ptr->iap_length;
                                phb_ptr->iap_length++;
                            }
                        }
                        else if (anr_num == 2)
                        {
                            do_type = DATA_DESC_ANRC;
                            phb_ptr->anrc_type = fileType;
                            if (fileType == 2 && phb_ptr->iap_length < PHB_IAP_MAX_OBJECT)
                            {
                                phb_ptr->iap_anrc = phb_ptr->iap_length;
                                phb_ptr->iap_length++;
                            }
                        }
                        anr_num++;
                        break;
                    case PHB_PBC_DO:
                        do_type = DATA_DESC_PBC;
                        break;
                    case PHB_GRP_DO:
                        do_type = DATA_DESC_GRP;
                        break;
                    case PHB_AAS_DO:
                        do_type = DATA_DESC_AAS;
                        break;
                    case PHB_GAS_DO:
                        do_type = DATA_DESC_GAS;
                        break;
                    case PHB_UID_DO:
                        do_type = DATA_DESC_UID;
                        break;
                    case PHB_EMAIL_DO:
                        /* if (phb_ptr->email_support_type == 0) */
                        phb_ptr->email_type = fileType;
                        do_type = DATA_DESC_EMAIL;
                        if (fileType == 2 && phb_ptr->iap_length < PHB_IAP_MAX_OBJECT)
                        {
                            phb_ptr->iap_email = phb_ptr->iap_length;
                            phb_ptr->iap_length++;
                        }
                        break;
                    case PHB_CCP1_DO:
                        break;
                #endif /* __PHB_USIM_SUPPORT__ */
                    default:
                        do_type = 0xFF;
                        break;
                }
                switch (control_block->data[pos])
                {
                    case PHB_TYPE_1_FILE:
                    case PHB_TYPE_2_FILE:
                    case PHB_TYPE_3_FILE:
                        pos = pos + 2;
                        break;
                    default:
                        if (do_type != 0xFF)
                        {
                            /* set path */
                            phb_ptr->path[do_type][0] = control_block->data[pos + 2];
                            phb_ptr->path[do_type][1] = control_block->data[pos + 3];
                            phb_ptr->data_desc[do_type].is_support = KAL_TRUE;
                        }
                        pos = pos + control_block->data[pos + 1] + 2;   /* add length + 1 tag + 1 size */
                        break;
                }
            }
        }
    #ifdef __PHB_USIM_SUPPORT__
        else if (control_block->actual_count == 1)  /* second pbr */
        {
            anr_num = 0;
            while (pos < phb_ptr->data_desc[DATA_DESC_PBR].record_size)
            {
                switch (control_block->data[pos])
                {
                    case PHB_TYPE_1_FILE:
                        fileType = 1;
                        break;
                    case PHB_TYPE_2_FILE:
                        fileType = 2;
                        break;
                    case PHB_TYPE_3_FILE:
                        fileType = 3;
                        break;
                    case PHB_ADN_DO:
                        do_type = DATA_DESC_ADN1;
                        if (control_block->data[pos + 1] == 3)  /* add length + 1 */
                        {
                            phb_ptr->adn1_sfi = control_block->data[pos + 4];
                        }
                        break;
                    case PHB_IAP_DO:
                        do_type = DATA_DESC_IAP1;
                        break;
                    case PHB_SNE_DO:
                        do_type = DATA_DESC_SNE1;
                        break;
                    case PHB_ANR_DO:
                        if (anr_num == 0)
                        {
                            do_type = DATA_DESC_ANRA1;
                        }
                        else if (anr_num == 1)
                        {
                            do_type = DATA_DESC_ANRB1;
                        }
                        else if (anr_num == 2)
                        {
                            do_type = DATA_DESC_ANRC1;
                        }
                        anr_num++;
                        break;
                    case PHB_PBC_DO:

                        break;
                    case PHB_GRP_DO:

                        break;
                    case PHB_AAS_DO:

                        break;
                    case PHB_GAS_DO:

                        break;
                    case PHB_UID_DO:

                        break;
                    case PHB_EMAIL_DO:
                        /* if (phb_ptr->email_support_type == 0) */

                        break;
                    case PHB_CCP1_DO:
                        fileType = 1;
                        break;

                }
                switch (control_block->data[pos])
                {
                    case PHB_TYPE_1_FILE:
                    case PHB_TYPE_2_FILE:
                        pos = pos + 2;
                        break;
                    case PHB_TYPE_3_FILE:
                        pos = pos + 2 + control_block->data[pos + 1];   /* skip all type 3 content */
                        break;
                    default:
                        pos = pos + control_block->data[pos + 1] + 1;
                        break;
                }
            }

        }

        if (++control_block->actual_count < control_block->total)
        {
            ++control_block->record_index;
            phb_issue_IO_read(control_block);
        }
        else
    #endif /* __PHB_USIM_SUPPORT__ */
        {
            /* phb_startup_handler */
            (*control_block->controller) (NULL, control_block);
        }
    }
}   /* end of phb_build_ecc_index function */
#endif /* _USIM_SUPPORT__ */


#ifdef __PHB_USIM_SUPPORT__
/*****************************************************************************
 * FUNCTION
 *  phb_get_next_process_index
 * DESCRIPTION
 *  This is phb_get_next_adn function of PHB module.
 * PARAMETERS
 *  record_index        [IN]        
 *  type                [IN]        
 *  kal_uint16(?)       [IN]        The record index
 * RETURNS
 *  void
 *****************************************************************************/
kal_uint16 phb_get_next_process_index(kal_uint16 record_index, phb_type_enum type)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (type == PHB_ANR && phb_ptr->anra_type == 2)
    {
        return (kal_uint16) record_index;
    }
    else if (type == PHB_EMAIL && phb_ptr->email_type == 2)
    {
        return (kal_uint16) record_index;
    }
    else if (record_index != (kal_uint16) PHB_INVALID_VALUE)
    {
        kal_uint16 i;

        for (i = record_index; i < phb_ptr->data_desc[DATA_DESC_ADN].record_num; i++)
        {
            free_status_enum free_status;

            free_status = phb_data_desc_is_free(DATA_DESC_ADN, i);
         /**
         * This case results from:
         * 1. Non supported EF.
         * 2. Attempt written record index excceds max supported capacity.
         */

            if (free_status == RECORD_INVALID)
            {
                return (kal_uint16) PHB_INVALID_VALUE;
            }

            if (free_status == RECORD_OCCUPIED)
            {
                return i;
            }
        }
    }
    return (kal_uint16) PHB_INVALID_VALUE;
}


/*****************************************************************************
 * FUNCTION
 *  phb_build_anr_index
 * DESCRIPTION
 *  This is build_index function of PHB module.
 * PARAMETERS
 *  ilm_ptr             [IN]        The primitives
 *  control_block       [?]         
 * RETURNS
 *  void
 *****************************************************************************/
static void phb_build_anr_index(ilm_struct *ilm_ptr, control_block_type *control_block)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    kal_uint16 next_record_index;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (ilm_ptr == NULL)
    {
        next_record_index = phb_get_next_process_index(control_block->record_index, PHB_ANR);
        if (next_record_index == (kal_uint16) PHB_INVALID_VALUE)        /* no other ADN */
        {
            (*control_block->controller) (NULL, control_block);
        }
        else
        {
            control_block->actual_count += (next_record_index - control_block->record_index);
            control_block->record_index = next_record_index;
            phb_issue_IO_read(control_block);
        }
    }
    else
    {
        phb_entry_struct *phb_entry = (phb_entry_struct*) control_block->data;

        /* For valid record, control_block.data must not NULL */
        if (phb_entry != NULL)
        {
        #if defined(__MMI_FMI__)
            /* Send out indication for each anr entries and wait response to read next. */
            l4cphb_startup_read_anr_ind_struct *l4cphb_startup_read_anr_ind =
                (l4cphb_startup_read_anr_ind_struct*) construct_local_para(

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -