| /***************************************************************************** |
| * 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) 2016 |
| * |
| * 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). |
| * |
| *****************************************************************************/ |
| /************************************************************* |
| * |
| * This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc. |
| * |
| * Any unauthorized use inconsistent with the terms of such license is strictly prohibited. |
| * |
| * Copyright (c) 2007-2010 VIA Telecom, Inc. All rights reserved. |
| * |
| *************************************************************/ |
| |
| #ifndef _DSCPDEFS_H_ |
| #define _DSCPDEFS_H_ |
| /***************************************************************************** |
| * |
| * FILE NAME : dscpdefs.h |
| * |
| * DESCRIPTION : |
| * |
| * Contains the typdefs for dscp protocol entity. |
| * |
| * |
| *****************************************************************************/ |
| #include "do_dsaapi.h" |
| #include "do_rcpapi.h" |
| #include "do_scpapi.h" |
| #include "do_slcapi.h" |
| #include "slc_nvram.h" |
| |
| /*------------------------------------------------------------------------ |
| * global definitons |
| *------------------------------------------------------------------------*/ |
| |
| /************* Default Session Configuration Protocol **********/ |
| /*-------------OTA messages handled by DSCP-------------------*/ |
| typedef enum { |
| DSCP_CONFIGURATION_COMPLETE_OTAMESSAGE = 0x00, |
| DSCP_CONFIGURATION_START_OTAMESSAGE, |
| DSCP_SOFT_CONFIGURATION_COMPLETE_OTAMESSAGE, |
| DSCP_LOCK_CONFIGURATION_OTAMESSAGE, |
| DSCP_LOCK_CONFIGURATION_ACK_OTAMESSAGE, |
| DSCP_UNLOCK_CONFIGURATION_OTAMESSAGE, |
| DSCP_UNLOCK_CONFIGURATION_ACK_OTAMESSAGE, |
| DSCP_DELETE_PERSONALITY_OTAMESSAGE, |
| DSCP_DELETE_PERSONALITY_ACK_OTAMESSAGE, |
| |
| DSCP_CONFIGURATION_REQUEST_OTAMESSAGE = 0x50, |
| DSCP_CONFIGURATION_REPONSE_OTAMESSAGE, |
| |
| DSCP_ATTRIBUTE_UPDATE_REQUEST_OTAMESSAGE = 0x52, |
| DSCP_ATTRIBUTE_UPDATE_ACCEPT_OTAMESSAGE, |
| DSCP_ATTRIBUTE_UPDATE_REJECT_OTAMESSAGE |
| } |
| DScpOTAMsgsT; |
| |
| /* DSCP SM state */ |
| typedef enum { |
| DSCP_INACTIVE, |
| DSCP_OPEN, |
| DSCP_AT_INITIATED, |
| DSCP_AN_INITIATED, |
| DSCP_NUM_STATE |
| } DScpStateT; |
| |
| /* GAUP AttributeUpdateAccept transmision control */ |
| typedef enum { |
| GAUP_DONE, |
| GAUP_SENDINGACCEPT, /* trans 3 times */ |
| GAUP_SENDINGACCEPT1, |
| GAUP_SENDINGACCEPT2 |
| } DScpGAUPStepT; |
| |
| /* OTA message field width */ |
| #define DSCP_SCC_PERSONALITY_INDEX_STORE_WIDTH 4 |
| #define DSCP_SCC_CONTINUE_WIDTH 1 |
| #define DSCP_SCC_COMMIT_WIDTH 1 |
| #define DSCP_SCC_SC_TOKEN_WIDTH 16 |
| |
| #define DSCP_DP_PERSONALITY_COUNT_WIDTH 4 |
| #define DSCP_DP_PERSONALITY_INDEX_WIDTH 4 |
| |
| #define DSCP_CC_SC_TOKEN_WIDTH_IN_OCTET 2 |
| |
| #define DSCP_ATTR_REC_LENGTH_WIDTH_IN_OCTET 1 |
| #define DSCP_ATTR_ID_WIDTH_IN_OCTET 2 |
| #define DSCP_ATTR_VALUE_ID_WIDTH_IN_OCTET 1 |
| #define DSCP_SIMPLE_ATTR_VALUE_WIDTH_IN_OCTET 2 |
| |
| /*-------------------------------------------------------------*/ |
| /* DSCP attributes and public data definition: table 7.4.7.1-1 */ |
| enum { |
| CONFIG_UNLOCK = 0x00, |
| CONFIG_LOCK |
| }; |
| typedef kal_uint8 DScpConfigurationStatusT; |
| |
| enum { |
| CONNECTION_CLOSED = 0x00, |
| CONNECTION_OPEN |
| }; |
| typedef kal_uint8 DScpConnectionStateT; |
| |
| enum { |
| NO_GAUP_SCTOKEN = 0x00, |
| SUPPORT_GAUP_SCTOKEN |
| }; |
| |
| enum { |
| NO_CONFIG_LOCK = 0x00, |
| SUPPORT_CONFIG_LOCK |
| }; |
| |
| /* 7.4.7.2.1 */ |
| typedef struct { |
| kal_uint8 RestorePriorSession; /* 0: not restore the session. Otherwise restore */ |
| kal_uint8 ANAccepted; |
| kal_uint16 SessionConfigurationToken; |
| kal_uint8 Uati[16]; |
| kal_uint8 SecurityPacketLength; |
| kal_uint8 SecurityPacket[SECURITY_PACKET_LENGTH]; |
| }DScpPriorSessionInfoT; |
| |
| |
| #define PROTTYPE_SIZE (NUM_PROTOCOL_TYPE * sizeof(kal_uint16)) |
| |
| typedef struct { |
| /* internal data */ |
| DScpConnectionStateT ConnectionState; |
| |
| /* public data */ |
| DScpConfigurationStatusT ConfigurationLock; |
| kal_uint16 SessionConfigurationToken; |
| kal_uint8 PersonalityIndex; |
| |
| /* InUse attributes */ |
| #if defined(__GNUC__) |
| ATTRIB_ALIGNED(2) |
| #endif |
| DScpAttributesDataT InUseAttrs; |
| |
| /* PriorSession */ |
| DScpPriorSessionInfoT PriorSessionInfo; |
| |
| }DScpSessionStateInfoT; |
| |
| /*-------------------sample of other SCP protocol--------------------*/ |
| |
| /* here define the attributes and public data of other SCP subtype */ |
| |
| /* XSCP attributes */ |
| typedef struct { |
| kal_uint16 ProtocolType[NUM_PROTOCOL_TYPE]; /* must be first */ |
| |
| /* other attributes */ |
| } XScpAttributesDataT; |
| |
| /* sample subtype */ |
| typedef struct { |
| /* internal data */ |
| DScpConnectionStateT ConnectionState; |
| |
| /* public data */ |
| DScpConfigurationStatusT ConfigurationLock; |
| kal_uint16 SessionConfigurationToken; |
| kal_uint8 PersonalityIndex; |
| |
| /* InUse attributes */ |
| XScpAttributesDataT InUseAttrs; |
| |
| DScpPriorSessionInfoT PriorSessionInfo; |
| |
| } XScpSessionStateInfoT; |
| |
| |
| |
| /*------------------------------------------------------------------------ |
| * global functions |
| *------------------------------------------------------------------------*/ |
| void DScpInit(void); |
| void DScpReconfigCnfWaitTimerHandler(void); |
| void DScpANInitStWaitReqTimerHandler(void); |
| void DScpGaupTimerHandler(void); |
| void DScpSendOpenConnectionCmd(void); |
| #if 0 |
| /* under construction !*/ |
| #endif |
| /*------------------------------------------------------------------------ |
| * global variable |
| *------------------------------------------------------------------------*/ |
| extern const SCPConfigInterfaceT DScpConfigInterface; |
| |
| |
| #endif /* _DSCPDEFS_H_ */ |
| |