blob: 97036bddc024373484a20f608276c1f7536465c8 [file] [log] [blame]
/*****************************************************************************
* Copyright Statement:
* --------------------
* This software is protected by Copyright and the information contained
* herein is confidential. The software may not be copied and the information
* contained herein may not be used or disclosed except with the written
* permission of MediaTek Inc. (C) 2005
*
* BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
* THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
* RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
* AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
* NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
* SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
* SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
* THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
* NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
* SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
*
* BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
* LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
* AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
* OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
* MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
*
* THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
* WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
* LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
* RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
* THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
*
*****************************************************************************/
/*****************************************************************************
*
* Filename:
* ---------
* mml1_rf_container.h
*
* Project:
* --------
* MT6295
*
* Description:
* ------------
* MMRF container definition
*
* Author:
* -------
* -------
*
*============================================================================
* HISTORY
* Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*----------------------------------------------------------------------------
*----------------------------------------------------------------------------
* Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
*============================================================================
****************************************************************************/
#ifndef __MML1_RF_CONTAINER_H__
#define __MML1_RF_CONTAINER_H__
#include "kal_general_types.h"
#include "mmrf_common_cid.h"
#include "mml1_rf_hal_general_def.h"
#define MMRFD_CONTAINER_SEQ_SIZE 32
#define MMRFHAL_CW_ADDR_MASK (0x3FF00000)
#define MMRFHAL_CW_ADDR_LSB (20)
#define MMRFHAL_GET_CW_ADDRESS(data) ((data&MMRFHAL_CW_ADDR_MASK)>>MMRFHAL_CW_ADDR_LSB)
#define MMRFHAL_CONTAINER_SIZE sizeof(MMRFD_SEQ_CONTAINER_INTF_CONTAINER_T)
#define MMRFHAL_SEQ_NODE_SIZE sizeof(MMRFD_SEQ_CONTAINER_INTF_SEQ_NODE_T)
/* SEQ Container interface error codes */
typedef enum
{
MMRFD_SEQ_CONTAINER_INTF_ERR_NONE, /* No Error */
MMRFD_SEQ_CONTAINER_INTF_ERR_BUFF_OVERFLOW, /* Buffer overflow */
MMRFD_SEQ_CONTAINER_INTF_ERR_INVALID_INPUTS, /* Input(s) Errors */
MMRFD_SEQ_CONTAINER_INTF_ERR_SEQ_LIST_UNINITIALIZED, /* SEQ list not initialized */
MMRFD_SEQ_CONTAINER_INTF_ERR_MEM_ALLOC_FAILED, /* Memory allocation failed */
MMRFD_SEQ_CONTAINER_INTF_ERR_BSI_ALLOCATION_FAIL, /* BSI allocation failed */
MMRFD_SEQ_CONTAINER_INTF_ERR_ENUM_TYPE_MAX
} MMRFD_SEQ_CONTAINER_INTF_ERR_E;
/* Seq Trigger Types */
typedef enum
{
MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIGGER_NONE,
MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIGGER_IMM_W,
MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIGGER_IMM_R,
MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIGGER_SCH_W,
MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIGGER_SCH_R,
} MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIG_E;
/* ========== Structure Prototypes ========== */
typedef struct
{
MMRFD_SEQ_CONTAINER_INTF_ERR_E allocate_result; /* Allocation result */
MMRFD_DEVICE_DRIVER_RF_INTF_CMD_E cmd; /* Command to the device */
MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIG_E seq_trig_type; /* trigger type for the node */
kal_uint32 event_id;
kal_uint32 data_start_idx;
kal_uint32 data_end_idx;
kal_uint32 imm_read_result;
} MMRFD_SEQ_CONTAINER_ALLOCATE_RESULT_T;
typedef struct
{
kal_uint32 cw_data[MMRFD_CONTAINER_SEQ_SIZE]; /* address + data */
} MMRFD_SEQ_CONTAINER_INTF_DATA_ENTRY_T;
typedef struct
{
kal_uint32 sch_read_set; /* for sch read */
MMRF_DEVICE_DRIVER_LORX_INFO_T lorx_en_info; /* for lorx enable */
MMRF_DEVICE_DRIVER_PRACH_CANCEL_EN_E wcdma_prach_cancel_en; /* for wcdma PRACH cancel */
} MMRFD_SEQ_CONTAINER_ALLOCATE_INFO_T;
typedef struct _node
{
kal_uint32 is_occupied; /* is resource occupied */
kal_int32 seq_offset_time; /* SEQ node offset time */
MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIG_E seq_trig_type; /* SEQ list trigger type */
MMRFD_DEVICE_PORT_E port; /* Port associated to this node */
kal_uint32 alloc_size; /* Allocated size for this node */
kal_uint32 curr_size; /* Current size of this node */
MMRFD_SEQ_CONTAINER_INTF_DATA_ENTRY_T seq; /* Contents of this list entry */
MMRFD_SEQ_CONTAINER_ALLOCATE_INFO_T allocate_info; /* Allocation info for the sequence node */
MMRFD_SEQ_CONTAINER_ALLOCATE_RESULT_T allocate_result_info; /* Allocation result for the sequence node */
struct _node* prev_p; /* Pointer to prev list entry */
struct _node* next_p; /* Pointer to next list entry */
} MMRFD_SEQ_CONTAINER_INTF_SEQ_NODE_T;
typedef struct
{
kal_uint32 seq_bias_time; /* SEQ list bias time */
kal_uint32 seq_size_max; /* Max size of SEQ list */
kal_uint32 seq_curr_size; /* Current size of SEQ list */
MMRFD_SEQ_CONTAINER_INTF_SEQ_NODE_T* seq_list_head_p;/* Pointer to start of SEQ list */
MMRFD_SEQ_CONTAINER_INTF_SEQ_NODE_T* seq_list_tail_p;/* Pointer to tail of SEQ list */
} MMRFD_SEQ_CONTAINER_INTF_SEQ_LIST_T;
typedef struct
{
kal_uint32 is_occupied; /* is resource occupied */
MMRFD_SEQ_CONTAINER_INTF_SEQ_LIST_T seq_lists[MMRFD_DEVICE_TRANSPORT_CNT]; /* Array of pointers to all sequence lists */
} MMRFD_SEQ_CONTAINER_INTF_CONTAINER_T;
typedef struct
{
//kal_uint8 curr_size; /* Current size of this node */
//kal_uint16 node[5]; /* reserve 5 for debug*/
kal_uint32 time_stamp; /* frc time stamp */
} MMRFD_SEQ_CONTAINER_DEBUG_APPEND_INFO_T;
typedef struct
{
kal_uint8 curr_size; /* Current size of this node */
kal_uint16 node[5]; /* reserve 5 for debug*/
kal_uint32 time_stamp; /* frc time stamp */
} MMRFD_SEQ_CONTAINER_DEBUG_DELETE_INFO_T;
typedef struct
{
MMRFD_SEQ_CONTAINER_DEBUG_APPEND_INFO_T mmrf_container_append;
MMRFD_SEQ_CONTAINER_DEBUG_DELETE_INFO_T mmrf_container_delete;
} MMRFD_SEQ_CONTAINER_DEBUG_T;
MMRFD_SEQ_CONTAINER_INTF_ERR_E
MMRFD_Seq_Container_Intf_Delete_Seq( MMRFD_SEQ_CONTAINER_INTF_SEQ_NODE_T** seq );
MMRFD_SEQ_CONTAINER_INTF_ERR_E
MMRFD_Seq_Container_Intf_Create_Seq( MMRFD_SEQ_CONTAINER_INTF_SEQ_NODE_T** seq );
MMRFD_SEQ_CONTAINER_INTF_ERR_E
MMRFD_Seq_Container_Intf_Update_Seq( MMRFD_SEQ_CONTAINER_INTF_SEQ_NODE_T* seq,
MMRFD_DEVICE_PORT_E port,
MMRFD_SEQ_CONTAINER_INTF_SEQ_TRIG_E seq_trig_type,
kal_int32 seq_offset_time);
MMRFD_SEQ_CONTAINER_INTF_ERR_E
MMRFD_Seq_Container_Intf_Append_Seq( MMRFD_SEQ_CONTAINER_INTF_SEQ_NODE_T* seq_node,
MMRFD_SEQ_CONTAINER_INTF_CONTAINER_T* container,
MMRFD_DEVICE_TRANSPORT_E proto );
#endif