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

📄 aal2rx.h

📁 摩托罗拉Motolola公司网络处理器C3的示范代码.实现了ATM的AAL2层交换功能.想了解网络处理器的可以
💻 H
字号:
/* *  aal2Rx.h * *  This file contains the data structure definition which are *  specific only to the AAL2 Rx CPRC. These definitions will be *  used by Initialization, Handler and forwarder. *//* *  Copyright (c) 2000, 2001, 2002 C-Port Corporation, a Motorola Company  *  All Rights Reserved * *  The information contained in this file is C-Port Corporation confidential and proprietary. *  Any reproduction, use or disclosure, in whole or in part, of this *  program, including any attempt to obtain a human-readable version of this *  program, without the express, prior written consent of C-Port *  Corporation or Motorola Incorporated is strictly prohibited. */#ifndef AAL2RX_H#define AAL2RX_H#define STF_SIZE                             1#define CPS_PDU_SIZE                        48#define CPS_PDU_PAYLOAD_SIZE                47#define CPS_PCK_HDR_SIZE                     3#define AAL2_RX_HDLR_THREAD_STACK_SIZE     512#define AAL2_RX_FWDR_THREAD_STACK_SIZE     512#define NUM_CPS_DESCRIPTORS                  4#define NUM_TLU_REQ_SLOTS                    4#define AAL2_RX_VC_TABLE_SIZE              512#define NOT_ALLOCATED               0xFFFFFFFF#define NUM_VCCBS                            2/* Virtual Circuit Context Block - definitions */typedef enum _vccbLock{    NO_LOCK,    LOCKED} VCCB_LOCK;typedef struct _vccb {    int8u       *partialPayload; /* Storage for partial payload */    int8u       *cellPayload;    /* Storage for Cell payload */    int16u      ingressVcIndex;  /* Ingress VC index */    VCCB_LOCK   lockFlag;        /* Flag for locking VCCB */} VCCB;/****************************************************       Definitions for AAL2 Rx VC index table****************************************************/typedef struct _aal2RxVcTable {    BsBufHandle   bufHandlePtr;  /* SDRAM Buffer handle */    int8u         offset;        /* No. of bytes in SDRAM buffer */    int8u         cid;           /* Channel ID  */    int16u        li       : 6;  /* Length Indicator */    int16u        uui      : 5;  /* User-to-User Indication */    //int16u        pad      : 2;  /* Padding bits */    int16u        sn       : 1;  /* Next expected sequence no. */    int16u        hdrLen   : 2;  /* No. of header bits */} AAL2RxVcTable;/***************************************************** * Definition of AAL2 Rx CONTEXT.  * This structure will contain all the global variables  * required for functioning of AAL2 Rx module. ****************************************************** */typedef struct {    QsMessage        cpsDescriptor[NUM_CPS_DESCRIPTORS];  /* Queue descriptors for CPS packets */    AAL2RxVcTable    aal2RxVcTable[AAL2_RX_VC_TABLE_SIZE]; /*AAL2 Rx VC index table */    int32u           aal2ConnectionId;                    /* AAL2 Rx TLU lookup index */     TsTableId        tableId;                             /* AAL2 Rx CP Table Id */    TsEntry          entry[NUM_TLU_REQ_SLOTS];            /* Table entry response structure */    TsKey            key;                                 /* Table data retrieving */    VCCB             vccb[NUM_VCCBS];                     /* AAL2 VC connection Block */    Aal2CpsDesc      *cpsDescArray[NUM_CPS_DESCRIPTORS];  /* Pointers to CPS packet queue descriptors */} AAL2_RX_CONTEXT;/*****************************************************    Macros for getting and setting bit fields in AAL2 Rx VC index table*****************************************************//* Get the buffer offset from the AAL2 Rx VC index table entry */#define AAL2_RX_GetBufOffset(dtEntry) (((AAL2RxVcTable *)dtEntry)->offset)/* Get the expected SN from the AAL2 Rx VC index table entry */#define AAL2_RX_getSeqNo(dtEntry) (((AAL2RxVcTable *)dtEntry)->sn)/* Get the UUI from the AAL2 Rx VC index table entry */#define AAL2_RX_getUUI(dtEntry) (((AAL2RxVcTable *)dtEntry)->uui)/* Get the buffer offset from the AAL2 Rx VC index table entry */#define AAL2_RX_getLI(dtEntry)  (((AAL2RxVcTable *)dtEntry)->li)/* Set the Buffer offset bit in the AAL2 Rx VC index table entry */#define AAL2_RX_setBufOffset(dtEntry, newval) (((AAL2RxVcTable *)dtEntry)->offset = newval)/* Set the Sequence number bit in the AAL2 Rx VC index table entry */#define AAL2_RX_setSeqNo(dtEntry, curSeqNo) (((AAL2RxVcTable *)dtEntry)->sn = (curSeqNo ^ 1))/* Set the value of UUI in the AAL2 Rx VC index table */#define AAL2_RX_setUUI(dtEntry, newval) (((AAL2RxVcTable *)dtEntry)->Uui = newval)/* The value of LI in the AAL2 Rx VC index table entry */#define AAL2_RX_setLI(dtEntry, newval) (((AAL2RxVcTable *)dtEntry)->li = newval)#define composeAal2ConnectionId(vcIndex, cid) (((vcIndex) << 8) | (cid))#endif /* AAL2RX_H */

⌨️ 快捷键说明

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