亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? le1veapp.c

?? Zalink50114----TDMoIP芯片驅(qū)動源碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* le1veApp.c - LE1VE card application resoure file
*
* Copyright     2004-2007 ZTE, Inc.
* author:       ZhengQishan
* date:         2004.02
*
* modification history
*------------------------------
*
*/
#include "zl5011x.h"
#include "zl5011xRdWr.h"
#include "zl5011xDpr.h"
#include "zl5011xInterrupts.h"
#include "zl5011xApi.h"
#include "zl5011xInit.h"
#include "zl5011xTdm.h"
#include "zl5011xLan.h"
#include "zl5011xMisc.h"
#include "zl5011xPacket.h"
#include "zl5011xError.h"
#include "le1veLib.h"
#include "le1veApp.h"

zl5011xParamsS *le1ve_Zl5011xParams[MAX_IF_CARD_NUM] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};


LOCAL zlStatusE initLe1veCard(zl5011xSysInitS *sysInit);
#if 0
LOCAL void populateHeader(Uint32T context, UINT8 *macAddress, Uint8T *header, Uint8T *headerLength, zl5011xProtocolTypeE *protocol);
#endif
/*-----------------------------
* zl5011xModuleInit  - init Zl5011X data structure
*
*Argument: void
*
*Return: zlStatusE - the status of init
*/
zlStatusE zl5011xModuleInit(int slot)
{
    int loop;
    zl5011xCreateDeviceS        createDevice;
    zl5011xSysInitS             sysInit;
    zl5011xWanConfigureSyncS    wanConfigureSync;
    zl5011xLanConfigureS        lanConfigure;
    zl5011xLanQueueConfigureS   lanQueueConfigure;
    zlStatusE                   result = ZL5011X_OK;
    UINT8                       *pMacAddress;
    zl5011xParamsS  			*pZl5011xParams;

    if (slot > 8 || slot < 1)
    {
        printf("Error slot number !\n");
        return(ZL5011X_ERROR_SLOT_NUM);
    }
    if (le1ve_Zl5011xParams[slot - 1] != NULL)
    {
        printf("slot %d zl5011xModuleInit have been called!\n", slot);
        return(ZL5011X_DEVICE_HAVE_BEEN_INIT);
    }

    /* create the device structure and OS objects */
    result = zl5011xCreateDeviceStructInit(&createDevice);

    if (result == ZL5011X_OK)
    {
        createDevice.baseAddress = IF_CARD_CPU_REG_BASE(slot);
        result = zl5011xCreateDevice(&pZl5011xParams, &createDevice);
        if (result != ZL5011X_OK)
        {
             printf("Init (slot %d) Zl50114 failed!\n", slot );
             return(result);
        }
        le1ve_Zl5011xParams[slot - 1] = pZl5011xParams;
        le1ve_Zl5011xParams[slot - 1]->slotNum = slot;
    }

    /* get ready to initialise the device. Default the structure entries to default
       values and then set up any required values */
    if (result == ZL5011X_OK)
    {
        result = zl5011xSysInitStructInit(pZl5011xParams, &sysInit);
        /*指定所用芯片類型,新添加*/
        sysInit.init.deviceType = ZL_DEVICE_ZL50114;

        /*TDM接口的時鐘由硬件決定*/
        sysInit.wanInit.ifType = ZL5011X_WAN_HMVIP_8M;  /*ZL5011X_WAN_STBUS_2M_X2_CLOCK;*/

        /*2倍默認值大小*/
        sysInit.wanInit.txQueueMaxNumberOfGranules = 10000;
        #if 0 /*默認2.048M 恢復時鐘涉及*/
         /*add by shf 2005.7.13 */
        if( b_physIfType(slot) == CARD_TMD_OVER_IP_4_1_T1)
        {
            sysInit.wanInit.liuFreq= ZL5011X_WAN_LIU_FREQ_1_544M;
        }
        /*end*/
        #endif

        /*LE1VE 有8Mbyte 的extern memory*/
        sysInit.configureMemory.extMemChipSize= ZL5011X_EXT_MEM_SIZE_4MB;

        /*顆粒的多少主要取決于內(nèi)存的多少,?	每一個顆粒由于64字節(jié)的數(shù)據(jù)區(qū)和16字節(jié)的描述區(qū)組成。
          顆粒的大小暫定為20000*/
        /*sysInit.configureMemory.numberGranules= 40000;讓芯片自己選擇*/
    }
    /*用sysInit參數(shù)初始化Le1ve單板*/
    if (result == ZL5011X_OK)
    {
        result = initLe1veCard(&sysInit);
    }

    /* Initialise the device */
    if (result == ZL5011X_OK)
    {
        printf("ZL50114 Device Initialise\n");
        result = zl5011xSysInit(pZl5011xParams, &sysInit);
    }

    /* setup the TDM interface - in this example sync clocks */
    if (result == ZL5011X_OK)
    {
        result = zl5011xWanConfigureSyncStructInit(pZl5011xParams, &wanConfigureSync);

        if (result == ZL5011X_OK)
        { 
     
        /*add by shf 2005.7.13 */
            if( b_physIfType(slot) == CARD_TMD_OVER_IP_4_1)
            {
            wanConfigureSync.primaryRef.refFreq = ZL5011X_WAN_REF_FREQ_2_048M;
            wanConfigureSync.secondaryRef.refFreq = ZL5011X_WAN_REF_FREQ_2_048M;
	     }
	     else
	     {
	     		wanConfigureSync.primaryRef.refFreq = ZL5011X_WAN_REF_FREQ_1_544M;
                wanConfigureSync.secondaryRef.refFreq = ZL5011X_WAN_REF_FREQ_1_544M;
	     }  
         #if 0
      /*end*/
    
            wanConfigureSync.dpllConnection = ZL5011X_DPLL_SLAVE_CONNECTION;/*ZL5011X_DPLL_MASTER_CONNECTION;*/
            wanConfigureSync.dpllMasterOutputEnable = ZL5011X_FALSE;  /*ZL5011X_TRUE;*/
            wanConfigureSync.framePulsePolarity = ZL5011X_NEGATIVE ;  /*ZL5011X_POSITIVE;*/
            wanConfigureSync.framePulseWidth = ZL5011X_WAN_FRAME_2_BITS_CENTRED;/*ZL5011X_WAN_FRAME_FULL_BIT_CENTRED;*/
      #endif
      #if 0
      /*slave or master*/
         wanConfigureSync.dpllConnection = ZL5011X_DPLL_MASTER_CONNECTION;         /* enableDPLL, drive TDM_CLKo and TDM_FRMo outputs */
      
         wanConfigureSync.dpllMasterOutputEnable = ZL5011X_TRUE;                        /* enable the PLL_PRI and PLL_SEC outputs */

         wanConfigureSync.primaryRef.source = ZL5011X_WAN_STREAM_REF;                /* Take CLKi0 (connected to CLKo0) as DPLL reference input */
         wanConfigureSync.primaryRef.stream = (Uint8T)0x00; 
         wanConfigureSync.primaryRef.refFreq = ZL5011X_WAN_REF_FREQ_2_048M;
         
         wanConfigureSync.secondaryRef.source = ZL5011X_WAN_STREAM_REF;                /*secondary input, for backup only. */
         wanConfigureSync.secondaryRef.stream = (Uint8T)0x01; 
         wanConfigureSync.secondaryRef.refFreq = ZL5011X_WAN_REF_FREQ_2_048M; 
         wanConfigureSync.refPriority = ZL5011X_DPLL_PRIMARY_PRIORITY; 
         wanConfigureSync.refPolarity = ZL5011X_POSITIVE;
               
     #endif 
            /* For default values for structure wanConfigureSync, see the  function
            zl5011xWanConfigureSyncStructInit() in file zl5011xTdm.c */
            result = zl5011xWanConfigureSync(pZl5011xParams, &wanConfigureSync);

            /*ZL50114 */
            #if 0
            zl5011xTifReverseBitOrder(pZl5011xParams, ZL5011X_TRUE);
            #endif
        }
    }

    /* Configure the LAN interface - Packet Tx, Packet Rx and MAC */
    if (result == ZL5011X_OK)
    {
        pMacAddress = pZl5011xParams->macAddress[0];
        Ros_GetMacBase(b_FetchSerial(),pMacAddress);

        pMacAddress = pZl5011xParams->macAddress[1];
        Ros_GetMacBase(b_FetchSerial(),pMacAddress);

        /*兩以太接口的MAC地址不一樣*/
        pZl5011xParams->macAddress[1][ZL5011X_MAC_SIZE - 1]  += 0x40;
        result = zl5011xLanConfigureStructInit(pZl5011xParams, &lanConfigure);

        lanConfigure.macType = ZL5011X_MAC_TYPE_MII;  /* alternatively ZL5011X_MAC_TYPE_GMII */
    }

    if (result == ZL5011X_OK)
    {
        result = zl5011xLanQueueConfigureStructInit(pZl5011xParams, &lanQueueConfigure);
    }

    /* set up 2 LAN ports */
    for (loop = 0; loop < 2; loop++)
    {
        lanQueueConfigure.portNum = loop;

        if (result == ZL5011X_OK)
        {
            /* set up the LAN queues */
            result = zl5011xLanQueueConfigure(pZl5011xParams, &lanQueueConfigure);
        }

        if (result == ZL5011X_OK)
        {
            /* set up the LAN ports. Set the low byte of the MAC address to be the
            port number itself. That is port 1 becomes xx:xx:xx:xx:xx:01 */
            lanConfigure.portNum = loop;
            
            /* set the ethernet MAC address */
            bcopy (pZl5011xParams->macAddress[loop], lanConfigure.macAddress, ZL5011X_MAC_SIZE);

            result = zl5011xLanConfigure(pZl5011xParams, &lanConfigure);
        }
    }
#if 0    
    if (firstTime == OK)
    {
        /* Interrupts are required for the differential mode of operation. So, must
        initialise the interrupts before CET */
        if (result == ZL5011X_OK)
        {
            result = zl5011xIsrInitialiseStructInit(pZl5011xParams, &isrInit);

            isrInit.apiPhysIntr = 0;
            isrInit.appPhysIntr = 0;

            if (result == ZL5011X_OK)
            {
                result = zl5011xIsrInitialise(pZl5011xParams, &isrInit);
            }
        }
        firstTime = ERROR;
    }

    /* The interrupt is now initialised, so add the device to the list to be serviced */
    if (result == ZL5011X_OK)
    {
        result = zl5011xIsrAddDeviceStructInit(pZl5011xParams, &isrAddDevice);

        if (result == ZL5011X_OK)
        {
            result = zl5011xIsrAddDevice(pZl5011xParams, &isrAddDevice);
        }
    }
#endif

    return(result);
}


LOCAL zlStatusE initLe1veCard(zl5011xSysInitS *sysInit)
{
    zlStatusE result = ZL5011X_OK;

    return (result);
}

#if 0
/*-----------------------------
* le1veCreatContext - create context
*
*Argument:
* UINT32  gPort - global port
* UINT32 timeSlot - 該通道所占的時隙數(shù),每一位表示一個時隙
*
* 說明:LE1VE最多只創(chuàng)建兩個context,而且context創(chuàng)建后,不為其分配通道(時隙)也不會工作,LE1VE的驅(qū)動
* 在初始化時直接先創(chuàng)建兩個context,在使用時再為其動態(tài)分配通道及配置接口屬性。
*
*Return:
* OK or ERROR if something is wrong
*/
zlStatusE le1veCreatRxContext(int slot)
{
    int contextLoop, context, stream, channelLoop;
    zl5011xParamsS                  *pZl5011xParams;
    zl5011xContextCreateS           contextCreate;
    zl5011xContextAddChannelRxS     addChannelRx;
    zl5011xWanRxPayloadConfigS      wanRxPayload;
    zl5011xPacketTxSetHeaderS       packetTxHeader;
    zl5011xContextS                 contextInfo;
    zl5011xWanRxGetPayloadLengthS   payloadLength;
    Uint8T *packetHeader;
    zlStatusE                       result = ZL5011X_OK;

    pZl5011xParams = le1ve_Zl5011xParams[slot - 1];

    /*Create the TDM input contexts (WAN Rx contexts)*/
    for (contextLoop = FIRST_CONTEXT;
        (contextLoop < (FIRST_CONTEXT + NUM_CONTEXTS)) && (result == ZL5011X_OK);
        contextLoop++)
    {

        printf("context %3d: TDM input create\n", contextLoop);

        result = zl5011xContextCreateStructInit(pZl5011xParams, &contextCreate);
        /* For default values for structure contextCreate, see the  function
        zl5011xContextCreateStructInit() in file zl5011xTdm.c */
        if (NULL == (packetHeader = (Uint8T*)malloc(100)))
        	result = ZL5011X_ERROR;
        else
        {
		pZl5011xParams->pPktTxHeader[contextLoop] = packetHeader;
        }

        if (result == ZL5011X_OK)
        {
            contextCreate.context = contextLoop;
            contextCreate.flow = ZL5011X_FLOW_WAN_PE_PKT;
            result = zl5011xContextCreateRx(pZl5011xParams, &contextCreate);
        }
    }

#if 1   /*正式版本中將刪除這段代碼,要求實現(xiàn)通道的動態(tài)增加/刪除*/
	/* Add channels to the TDM input contexts (structured mode only) */
	for (contextLoop = FIRST_CONTEXT;
	(contextLoop < FIRST_CONTEXT + NUM_CONTEXTS) && (result == ZL5011X_OK);
	contextLoop++)
	{
		context = contextLoop;

		for (channelLoop = 1 ; (channelLoop < 32) && (result == ZL5011X_OK); channelLoop++)
		{
			/* simply assign 32 channels to each context. */
			stream = context;
			result = zl5011xContextAddChannelRxStructInit(pZl5011xParams, &addChannelRx);

			/* the structure addChannelRx is used to associate with the context
			stream & channel numbers and some other properties  For default
			values for structure addChannelRx, see the  function
			zl5011xContextAddChannelRxStructInit() in file zl5011xTdm.c */

			if (result == ZL5011X_OK)
			{
				addChannelRx.context = context;
				addChannelRx.tdm.stream = 0;
				addChannelRx.tdm.channel = channelLoop * 4 + stream;

				result = zl5011xContextAddChannelRx(pZl5011xParams, &addChannelRx);
			}
		}
	}
#endif  /*1*/

    /* Setup the packet size for the TDM Input contexts (WAN Rx contexts) */
    for (contextLoop = FIRST_CONTEXT;
        (contextLoop < FIRST_CONTEXT + NUM_CONTEXTS) && (result == ZL5011X_OK);
        contextLoop++)
    {
        context = contextLoop;

        printf("context %3d: TDM input configure payload\n", context);

        result = zl5011xWanRxPayloadConfigStructInit(pZl5011xParams, &wanRxPayload);

        if (result == ZL5011X_OK)
        {
            wanRxPayload.context = context;
            wanRxPayload.numberOfFrames = 8;

            result = zl5011xWanRxPayloadConfig(pZl5011xParams, &wanRxPayload);
        }
    }

    /* Configure the Packet Transmit header */
    for (contextLoop = FIRST_CONTEXT;
        (contextLoop < FIRST_CONTEXT + NUM_CONTEXTS) && (result == ZL5011X_OK);
        contextLoop++)
    {
        printf("context %3d: TDM input setup header\n", contextLoop);

        /* Using a ETHERNET->IPv4->UDP->RTP->PW header */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕中文字幕一区| 久久久久国产精品人| 欧美久久久影院| 2021久久国产精品不只是精品| 日韩精品一区二区三区视频| 久久久久久一二三区| 亚洲一区二区在线免费观看视频| 日本最新不卡在线| 久久99国产精品麻豆| 91久久国产综合久久| 欧美一区二区三区婷婷月色| 亚洲婷婷在线视频| 美国十次了思思久久精品导航| 青青草视频一区| 91偷拍与自偷拍精品| 欧美精品乱码久久久久久按摩| 中文字幕亚洲在| 日本亚洲欧美天堂免费| 国模冰冰炮一区二区| 色屁屁一区二区| 久久综合九色综合97婷婷| 国产精品国产三级国产aⅴ入口| 日韩成人精品视频| 91精彩视频在线| 国产精品成人免费在线| 国产一区二区美女| 欧美久久一二三四区| 亚洲1区2区3区视频| 波多野结衣中文字幕一区二区三区| 精品国产污污免费网站入口| 亚洲亚洲人成综合网络| 91尤物视频在线观看| 久久久国际精品| 日本三级韩国三级欧美三级| 欧美另类久久久品| 一区二区三区在线观看网站| 91欧美激情一区二区三区成人| 久久午夜老司机| 亚洲免费在线播放| 欧美在线免费观看视频| 国产欧美日产一区| 国产成人精品一区二区三区四区| 欧美精品高清视频| 精品电影一区二区三区| 日本aⅴ免费视频一区二区三区| 在线中文字幕一区二区| 一区二区在线观看视频| 不卡的av在线播放| 中文字幕一区二区不卡| 成人精品gif动图一区| 久久久久国产精品厨房| 国产福利精品一区二区| 久久久久久久免费视频了| 久久精品国产久精国产爱| 久久蜜桃av一区精品变态类天堂| 日韩国产在线一| 久久伊人蜜桃av一区二区| 久久国产精品露脸对白| 欧美一区二区在线免费播放| 美女视频一区在线观看| 欧美在线免费播放| 久久av资源网| 久久久一区二区| 久久国产精品免费| 国产午夜一区二区三区| 国产黄色精品视频| 一区二区三区免费观看| 欧美性做爰猛烈叫床潮| 亚洲欧美日韩一区二区 | 亚洲最快最全在线视频| 一本久久精品一区二区| 免费在线观看一区| 精品国产污网站| 日韩经典中文字幕一区| 久久久91精品国产一区二区三区| 国产成人亚洲综合a∨婷婷图片| 亚洲欧美另类久久久精品2019| 色香色香欲天天天影视综合网| 亚洲精品第1页| 91精品婷婷国产综合久久 | 成人午夜免费电影| 自拍偷拍亚洲激情| 在线精品视频免费播放| 精品一区二区三区欧美| 久久久久久**毛片大全| 国产一区二区三区香蕉| 亚洲色图色小说| 欧美亚洲日本一区| 精品制服美女丁香| 日韩一区在线播放| 欧美日韩在线播放| 国产成人在线视频网站| 国产精品传媒视频| 欧美精品v国产精品v日韩精品| 国产一区美女在线| 一区二区三区国产精华| 欧美tk丨vk视频| 在线日韩国产精品| 国产一区二区三区黄视频| 亚洲第一电影网| 国产精品麻豆一区二区| 欧美成人官网二区| 91黄色小视频| 99精品欧美一区二区蜜桃免费| 蜜臀国产一区二区三区在线播放| 亚洲午夜私人影院| 国产午夜久久久久| 在线观看亚洲a| 成人一区二区三区中文字幕| 亚洲成人av免费| 亚洲综合偷拍欧美一区色| 久久精品一区蜜桃臀影院| 日韩一级黄色大片| 色噜噜狠狠色综合欧洲selulu| 国产乱淫av一区二区三区| 婷婷综合五月天| 欧美激情一区二区在线| 337p粉嫩大胆噜噜噜噜噜91av| 欧美性欧美巨大黑白大战| 色综合网站在线| 国产成人精品一区二区三区网站观看| 亚洲素人一区二区| 国产亚洲精品aa| 日韩精品一区国产麻豆| 日韩久久免费av| 欧美一区二区三区婷婷月色| 欧美一卡二卡在线| 欧美精品日韩综合在线| 欧美精品少妇一区二区三区| 91欧美一区二区| 欧美在线免费观看视频| 欧美三级电影在线观看| 成人av免费在线观看| 成人av资源在线观看| 国产精品一区二区三区乱码| 丰满亚洲少妇av| 丰满放荡岳乱妇91ww| 不卡一卡二卡三乱码免费网站| 高清成人在线观看| 91丨九色丨尤物| 一本色道综合亚洲| 欧美色爱综合网| 欧美日韩国产免费| 99久久精品免费看国产免费软件| 一本一道波多野结衣一区二区| 96av麻豆蜜桃一区二区| 色综合久久中文综合久久牛| 色噜噜狠狠一区二区三区果冻| 91国产成人在线| 欧美日韩国产乱码电影| 欧美精品亚洲二区| 国产情人综合久久777777| 国产精品蜜臀在线观看| 亚洲精品老司机| 午夜a成v人精品| 亚洲一线二线三线视频| 视频一区二区三区中文字幕| 日韩精品电影一区亚洲| 粉嫩一区二区三区在线看| 99久久精品国产导航| 5566中文字幕一区二区电影| 日韩三级av在线播放| 国产精品欧美一区二区三区| 亚洲精品一二三区| 精品一区二区免费视频| 成人激情校园春色| 日韩精品中文字幕一区二区三区| 久久精品人人爽人人爽| 久久久午夜精品| 亚洲视频在线观看一区| 亚洲一区二区在线免费观看视频| 国产一区91精品张津瑜| 99热在这里有精品免费| 日韩亚洲欧美在线| 国产精品久久久久影视| 麻豆精品在线看| 不卡一二三区首页| 日韩情涩欧美日韩视频| 亚洲日本中文字幕区| 免费成人av在线播放| 国产91高潮流白浆在线麻豆| 色欧美片视频在线观看| 国产日韩欧美制服另类| 亚洲电影一级黄| 国产成人日日夜夜| www久久精品| 一区二区高清免费观看影视大全| 国产精品一区二区三区乱码| 欧美日韩成人在线| 亚洲欧美国产77777| 国产在线精品一区二区| 欧美日韩aaa| 亚洲人成在线播放网站岛国 | 国产欧美日产一区| 日韩1区2区日韩1区2区| 欧美日韩一区成人| 欧美精品一区二区三区在线播放| 日韩你懂的在线播放| 一区二区三区在线观看欧美 | 亚洲午夜一区二区三区|