atminit.c

来自「摩托罗拉Motolola公司网络处理器C3的示范代码.实现了ATM的AAL2层交」· C语言 代码 · 共 65 行

C
65
字号
/* *  atmInit.c * *  Initialization of the ATM cell switch *//* *  Copyright (c) 1998,1999,2000,2001,2002 C-Port Corporation *  All Rights Reserved * *  The information contained in this file is 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 is strictly prohibited. */#include <dcpBufferSvcs.h>#include <dcpTableSvcs.h>#include <dcpPduSvcs.h>#include "rcSdpAtmApiIf.h"#include "atmStatus.h"#include "atmPrivate.h"/* *  atmInitialize() - public function that initializes atmCellSwitch application. */voidatmInitialize(void){    /* Initialize receive and transmit side threads */    int32u scope;    for (scope = 0; scope < MAX_SCOPES; scope++) {        BsBufHandle bufHandle;        MergeSpc*   mergeSpc;        PduHandle   pduHandle = pduHandleForScopeNumber(scope);        /*         *  Prime each payload receive data scope with a buffer handle.         *  This is necessary because the receive algorithm is optimized         *  with the assumption that there is always a buffer handle         *  in the receive data scope ready to capture incoming payload.         */        while (bsError(bufHandle = bsBufferAllocate(poolId)));        pduRxBufHandleSet(pduHandle, bufHandle);        pduRxPayloadSet(pduHandle, 0);        pduRxFree(pduHandle);        /*         *  Prime each payload transmit data scope with a buffer handle.         *  This is necessary because the transmit algorithm is optimized         *  with the assumption that there is always a buffer handle         *  in the transmit data scope that must be freed.         */        while (bsError(bufHandle = bsBufferAllocate(poolId)));        pduTxBufHandleSet(pduHandle, bufHandle);        mergeSpc = (MergeSpc*)pduTxHeaderGet(pduHandle);        mergeSpc->atmMergeSpc.payloadLength = -48;    }}

⌨️ 快捷键说明

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