rjw | 6c1fd8f | 2022-11-30 14:33:01 +0800 | [diff] [blame] | 1 | /***************************************************************************** |
| 2 | * Copyright Statement: |
| 3 | * -------------------- |
| 4 | * This software is protected by Copyright and the information contained |
| 5 | * herein is confidential. The software may not be copied and the information |
| 6 | * contained herein may not be used or disclosed except with the written |
| 7 | * permission of MediaTek Inc. (C) 2016 |
| 8 | * |
| 9 | * BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES |
| 10 | * THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE") |
| 11 | * RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON |
| 12 | * AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES, |
| 13 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF |
| 14 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT. |
| 15 | * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE |
| 16 | * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR |
| 17 | * SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH |
| 18 | * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO |
| 19 | * NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S |
| 20 | * SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM. |
| 21 | * |
| 22 | * BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE |
| 23 | * LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE, |
| 24 | * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE, |
| 25 | * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO |
| 26 | * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. |
| 27 | * |
| 28 | * THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE |
| 29 | * WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF |
| 30 | * LAWS PRINCIPLES. ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND |
| 31 | * RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER |
| 32 | * THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC). |
| 33 | * |
| 34 | *****************************************************************************/ |
| 35 | /************************************************************* |
| 36 | * |
| 37 | * This Software is the property of VIA Telecom, Inc. and may only be used pursuant to a license from VIA Telecom, Inc. |
| 38 | * |
| 39 | * Any unauthorized use inconsistent with the terms of such license is strictly prohibited. |
| 40 | * |
| 41 | * Copyright (c) 2006-2010 VIA Telecom, Inc. All rights reserved. |
| 42 | * |
| 43 | *************************************************************/ |
| 44 | #ifndef _PAR_H_ |
| 45 | #define _PAR_H_ |
| 46 | /***************************************************************************** |
| 47 | * |
| 48 | * FILE NAME : par.h |
| 49 | * |
| 50 | * DESCRIPTION : This file contains function prototypes and other definitions |
| 51 | * for the Reverse Packet Application |
| 52 | * |
| 53 | * HISTORY : |
| 54 | * See Log at end of file |
| 55 | * |
| 56 | *****************************************************************************/ |
| 57 | |
| 58 | /*---------------------------------------------------------------------------- |
| 59 | * Include Files |
| 60 | ----------------------------------------------------------------------------*/ |
| 61 | #include "ParRlpList.h" |
| 62 | #include "do_fcpapi.h" |
| 63 | #include "do_dsaapi.h" |
| 64 | #include "do_Qos.h" |
| 65 | #ifdef CBP7_EHRPD |
| 66 | //#include "../fcp/paflist.h" |
| 67 | #endif |
| 68 | |
| 69 | #include "slc_nvram.h" |
| 70 | |
| 71 | /*---------------------------------------------------------------------------- |
| 72 | Defines And Macros |
| 73 | ----------------------------------------------------------------------------*/ |
| 74 | #define RLP_DPA_HEADER_BITS 22 |
| 75 | |
| 76 | |
| 77 | #define MAX_LOCATION_LEN 128 |
| 78 | #define MAX_STORAGEBLOB_LEN 128 |
| 79 | #define MAX_NAK_REC_NUM 20 /* Max NakRequests # in Nak msg */ |
| 80 | /*---------------------------------------------------------------------------- |
| 81 | structure definitions |
| 82 | ----------------------------------------------------------------------------*/ |
| 83 | /* Enum definitions */ |
| 84 | typedef enum |
| 85 | { |
| 86 | RCP_PAR_SUBTYPE_ERR, |
| 87 | RCP_PAR_STRNUM_ERR, |
| 88 | RCP_PAR_TXLIST_ERR, |
| 89 | RCP_PAR_RETXLIST_ERR, |
| 90 | RCP_PAR_PHYMISSLIST_ERR, |
| 91 | RCP_PAR_MSGDEC_ERR, |
| 92 | RCP_PAR_APPNOTINIT_ERR, |
| 93 | RCP_PAR_TXLIST_FULL_ERR, |
| 94 | RCP_PAR_MSGID_ERR, |
| 95 | RCP_PAR_OTAMSGID_ERR, |
| 96 | RCP_PAR_GAUP_ATTR_ERR, |
| 97 | RCP_PAR_NAK_NOT_SUPPORT_ERR, |
| 98 | RCP_PAR_GRANT_SIZE_NOT_ENOUGH_ERR, |
| 99 | RCP_PAR_MAX_ERR_ID |
| 100 | }PARErrorT; |
| 101 | |
| 102 | |
| 103 | |
| 104 | typedef struct |
| 105 | { |
| 106 | kal_uint8 nAppType; |
| 107 | kal_uint16 nProtocolType; |
| 108 | ParFlowCtrlStateT stFlowCtrl; |
| 109 | #ifdef CBP7_EHRPD |
| 110 | ParRspStateT stRsp; |
| 111 | #endif |
| 112 | }ParAppInstanceT; |
| 113 | |
| 114 | typedef struct |
| 115 | { |
| 116 | kal_uint16 nProtocolType; |
| 117 | kal_uint8 nAppType; |
| 118 | }ParStreamConfigInfoT; |
| 119 | |
| 120 | typedef enum |
| 121 | { |
| 122 | PAR_Invalid = 0x0, |
| 123 | PAR_Default = 0x1, |
| 124 | PAR_MultiFlow |
| 125 | } PARAppTypeT; |
| 126 | |
| 127 | typedef enum |
| 128 | { |
| 129 | RESET_TX_INDICATION_MSG, |
| 130 | RESET_MSG = RESET_TX_INDICATION_MSG, |
| 131 | RESET_RX_INDICATION_MSG, |
| 132 | RESET_ACK_MSG = RESET_RX_INDICATION_MSG, |
| 133 | NAK_MSG, |
| 134 | LOCATION_REQUEST_MSG, |
| 135 | LOCATION_NOTIFICATION_MSG, |
| 136 | LOCATION_ASSIGNMENT_MSG, |
| 137 | LOCATION_COMPLETE_MSG, |
| 138 | XON_REQUEST_MSG, |
| 139 | XON_RESPONSE_MSG, |
| 140 | XOFF_REQUEST_MSG, |
| 141 | XOFF_RESPONSE_MSG, |
| 142 | DATA_READY_MSG, |
| 143 | DATA_READY_ACK_MSG, |
| 144 | RESET_TX_INDICATION_ACK_MSG = 0x0d, |
| 145 | RESET_TX_COMPLETE_MSG, |
| 146 | RESET_RX_COMPLETE_MSG, |
| 147 | |
| 148 | STORAGEBLOB_REQ_MSG, |
| 149 | STORAGEBLOB_NOTIFICATION_MSG, |
| 150 | STORAGEBLOB_ASSIGNMENT_MSG, |
| 151 | STORAGEBLOB_COMPLETE_MSG, |
| 152 | |
| 153 | DATA_OVER_SIGNALING_MSG = 0x14, |
| 154 | DATA_OVER_SIGNALING_ACK_MSG, |
| 155 | RESERVATION_ON_REQ_MSG=0x16, |
| 156 | RESERVATION_OFF_REQ_MSG, |
| 157 | RESERVATION_ACCEPT_MSG, |
| 158 | RESERVATION_REJECT_MSG, |
| 159 | REV_RESERVATION_ON_MSG, |
| 160 | REV_RESERVATION_OFF_MSG, |
| 161 | FWD_RESERVATION_OFF_MSG = 0x22, |
| 162 | FWD_RESERVATION_ON_MSG, |
| 163 | FWD_RESERVATION_ACK_MSG, |
| 164 | CONFIGURATION_REQUEST_MSG = 0x50, |
| 165 | CONFIGURATION_RESPONSE_MSG, |
| 166 | ATTRIBUTE_UPDATE_REQ_MSG = 0x52, |
| 167 | ATTRIBUTE_UPDATE_ACCEPT_MSG, |
| 168 | ATTRIBUTE_UPDATE_REJECT_MSG |
| 169 | }PAROtaMsgIdT; |
| 170 | |
| 171 | typedef enum |
| 172 | { |
| 173 | RLP_NULL_ST, |
| 174 | RLP_DATA_ST, |
| 175 | RLP_RESET_INIT_ST, |
| 176 | RLP_RESET_RSP_ST, |
| 177 | RLP_MAX_ST |
| 178 | } ParRlpStateT; |
| 179 | |
| 180 | typedef enum |
| 181 | { |
| 182 | RLP_NONE, |
| 183 | RLP_TXQ, |
| 184 | RLP_RETXQ |
| 185 | }RlpTxQTypeT; |
| 186 | |
| 187 | typedef struct |
| 188 | { |
| 189 | kal_uint32 FirstErased; |
| 190 | kal_uint16 WindowLen; |
| 191 | } ParRlpNakReqT; |
| 192 | typedef struct |
| 193 | { |
| 194 | kal_uint8 RLPFlow; |
| 195 | #ifdef CBP7_EHRPD |
| 196 | ParRspRouteT RspRoute; |
| 197 | #endif |
| 198 | kal_uint8 SequenceLength; |
| 199 | kal_uint8 NakRequests; |
| 200 | ParRlpNakReqT Request[MAX_NAK_REC_NUM]; |
| 201 | #ifdef CBP7_EHRPD |
| 202 | kal_uint8 VR; |
| 203 | #endif |
| 204 | }ParRlpNakMsgT; |
| 205 | |
| 206 | typedef struct |
| 207 | { |
| 208 | kal_uint32 TimerId; |
| 209 | }ParTExpireMsgT; |
| 210 | /************************************************************/ |
| 211 | /* structure for RLP */ |
| 212 | |
| 213 | typedef struct |
| 214 | { |
| 215 | /* kal_bool bBufFull;*/ |
| 216 | RlpTxQTypeT BufType; /*Type of buffer the last packet sent from*/ |
| 217 | kal_uint16 BytesTx; |
| 218 | kal_uint16 BytesRetx; |
| 219 | #ifdef CBP7_EHRPD |
| 220 | PAR_LIST_STR TxReseqQ; /*If the DataUnit is packet for a Packet stream, need this for retx */ |
| 221 | #endif |
| 222 | }ParRlpTxInfoT; |
| 223 | |
| 224 | |
| 225 | typedef struct ParRlpInstance_Struct |
| 226 | { |
| 227 | kal_uint8 AppType; |
| 228 | kal_uint8 RLPId; |
| 229 | kal_uint8 RLPFlowId; |
| 230 | kal_uint8 RLPIDLen; /*In Bits*/ |
| 231 | kal_uint8 SEQLen; /* In Bits*/ |
| 232 | kal_uint8 RLPHdrLen; /*In Bytes */ |
| 233 | kal_uint8 Priority; |
| 234 | ParRlpStateT RlpState; |
| 235 | kal_uint32 vs; |
| 236 | kal_uint32 range; |
| 237 | BestPktInfoT bestPktInfo; |
| 238 | ParRlpTxListT TxList; |
| 239 | ParRlpRetxListT RetxList; |
| 240 | ParRlpTxInfoT TxInfo; |
| 241 | kal_uint8 MacFlowId; |
| 242 | kal_bool FlushTimerExpired; |
| 243 | #ifdef CBP7_EHRPD |
| 244 | kal_uint32 maxVS; |
| 245 | ParRspRouteT curRoute; |
| 246 | kal_uint16 (*ParRlpSendDataFromTxQ)(struct ParRlpInstance_Struct *pInst, DatapktlistGT* pPktList, kal_uint16 nBytesAvail); |
| 247 | kal_uint16 (*ParRlpSendDataFromRetxQ)(struct ParRlpInstance_Struct *pInst, DatapktlistGT* pPktList, kal_uint16 nBytesAvail); |
| 248 | PAR_LIST_STR TxReseqQ; /*If the DataUnit is packet for a Packet stream, need this for retx */ |
| 249 | #endif |
| 250 | }ParRlpInstanceT; |
| 251 | |
| 252 | |
| 253 | /*************************************************************************************/ |
| 254 | /* structure for Location Update Protocol */ |
| 255 | typedef struct |
| 256 | { |
| 257 | kal_uint8 LocationType; |
| 258 | kal_uint8 LocationLen; |
| 259 | kal_uint8 LocationValue[MAX_LOCATION_LEN]; |
| 260 | } ParLocationDataRecT; |
| 261 | |
| 262 | typedef struct |
| 263 | { |
| 264 | kal_uint16 StorageBLOBType; |
| 265 | kal_uint8 StorageBLOBLen; |
| 266 | kal_uint8 StorageBLOBValue[MAX_STORAGEBLOB_LEN]; |
| 267 | } ParStorageBLOBDataRecT; |
| 268 | |
| 269 | typedef struct |
| 270 | { |
| 271 | kal_bool bLocValueStored; |
| 272 | kal_uint8 LocTransId; |
| 273 | kal_bool bStorageBlobStored; |
| 274 | kal_uint8 BlobTransId; |
| 275 | ParLocationDataRecT LocationData; |
| 276 | ParStorageBLOBDataRecT StorageBlob; |
| 277 | /*kal_bool bConnSetup;*/ |
| 278 | }ParLocUpdInfoT; |
| 279 | /*************************************************************************************/ |
| 280 | /* structure for Attribute */ |
| 281 | typedef struct |
| 282 | { |
| 283 | AppSubTypeT parSubType; |
| 284 | /* kal_uint16 ProtocolType;*/ |
| 285 | |
| 286 | /*Default Packet Application Attributes*/ |
| 287 | kal_uint8 RANHandoff; |
| 288 | |
| 289 | /*Multi-Flow Packet Application Attributes*/ |
| 290 | kal_uint8 MaxAbortTimer; /*in units of 100ms*/ |
| 291 | kal_bool RevFlowNakEnabled; |
| 292 | kal_bool FlowPhysicalLayerNakEnabledRev; |
| 293 | kal_uint8 RevFlowHighLayerProtocol; |
| 294 | /* kal_uint8 ReservationIdleStateRev[MAX_NUM_RESERVATIONS]; |
| 295 | kal_uint8 ReservationIdleStateFwd[MAX_NUM_RESERVATIONS];*/ |
| 296 | kal_uint16 FlowTransmitAbortTimerRev; |
| 297 | kal_bool FlowDataOverSignalingAllowedRev; |
| 298 | FlowIdentificationAttribT attribRevFlowIdentification; |
| 299 | FlowTimersAttribT attribRevFlowTimer; |
| 300 | kal_uint16 FlowAbortTimerRevInFrame; |
| 301 | /* FlowReservationAttribT attribRevFlowReservation; |
| 302 | FlowReservationAttribT attribFwdFlowReservation;*/ |
| 303 | |
| 304 | MaxRLPFlowsAttribT attribRevmaxRLPFlows; |
| 305 | /* MaxReservationsAttribT attribRevMaxResv;*/ |
| 306 | SupportHLProtocolT SupportedHLProtocol; |
| 307 | #ifdef CBP7_EHRPD |
| 308 | |
| 309 | /*Enhanced Multi-Flow Packet Application attributes */ |
| 310 | kal_bool PPPFreeAuthenticationSupport; |
| 311 | kal_bool TwoRouteSupported; |
| 312 | kal_bool ATNakDelaySupported; |
| 313 | kal_uint8 attribRevFlowProtocolPDU; |
| 314 | kal_uint8 attribRevFlowDataUnit; |
| 315 | kal_uint8 attribRevRouteProtocolPDU; |
| 316 | RevFlowProtocolParametersAttribT attribRevFlowProtocolParameters; |
| 317 | RevRouteProtocolParametersAttribT attribRevRouteProtocolParameters; |
| 318 | #endif |
| 319 | }ParAccessConfigDataT; |
| 320 | |
| 321 | |
| 322 | typedef struct |
| 323 | { |
| 324 | kal_uint8 AttrToBeNegotiated; |
| 325 | kal_uint8 CfgReqTranId; |
| 326 | } ParAttrNegotiationInfoT; |
| 327 | |
| 328 | /*---------------------------------------------------------------------------- |
| 329 | API Functions |
| 330 | ----------------------------------------------------------------------------*/ |
| 331 | void ParMsgHandler(kal_uint32 MsgId, kal_uint32 MsgSize, void* pMsg); |
| 332 | void ProcessParDsaFwdMsg(DsaFwdMsgT *MsgDataP); |
| 333 | void ParInit(void); |
| 334 | void ParInitAppInstWithStreamConfigInfo(StreamConfigAttribT *pConfigData); |
| 335 | void ParRlpPhyMissRetxQUpdate(void); |
| 336 | void ParAppFlowCtrlStateSet(ParAppInstanceT *pAppInst, ParFlowCtrlStateT state); |
| 337 | kal_bool ParSendDSARMsg(DsaRevMsgT* pMailMsg); |
| 338 | void ParSendFwdAttribute(PafRcpSessionConfigMsgT* pCfgData); |
| 339 | void ParAccessCommit(void); |
| 340 | void ParServiceCommit(void); |
| 341 | void ParInitStructures(kal_uint16 SubType, kal_bool InUse); |
| 342 | void ParHandleReservationLabelCmd(ParRlpReservationOnOffMsgT* pMsg); |
| 343 | void ParHandleSnKKQoSRequestCmd(ParSnKKQosReqMsgT* pMsg); |
| 344 | void ParSendReservationOnReq(kal_uint8 Count, ReservationInfoT* pResv); |
| 345 | void ParSendReservationOffReq(kal_uint8 Count, ReservationInfoT* pResv); |
| 346 | void ProcessParLupUnsolicitedCfgMsg(LUPUnsolicitedCfgMsgT* MsgDataP); |
| 347 | ParRlpInstanceT *GetRlpInstByAppStream(ParHlpDataTxMsgT *pMsg, PARAppStreamT AppStream); |
| 348 | |
| 349 | |
| 350 | /***************************************************************************** |
| 351 | * End of File |
| 352 | *****************************************************************************/ |
| 353 | #endif |
| 354 | |
| 355 | |