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

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

?? ne2000end.c

?? VxWorks BSP 下s3C44b0的源代碼
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
    packetLen = packetSize;

    /* copy separated frame to a temporary buffer */
    ne2000DataIn (pDrvCtrl,
		  ((UINT)pDrvCtrl->nextPacket << 8) + sizeof (NE2000_HEADER),
		  packetLen,
		  pData);

doneGet:
    pDrvCtrl->nextPacket = h.next;
    SYS_OUT_CHAR (pDrvCtrl, ENE_BOUND,
		  (pDrvCtrl->nextPacket != NE2000_PSTART ?
		   pDrvCtrl->nextPacket - 1 : NE2000_PSTOP - 1));

    return (packetLen);
    }


/******************************************************************************
*
* ne2000PollRecv - routine to receive a packet in polled mode.
*
* This routine is called by a user to try and get a packet from the
* device.
*/

LOCAL STATUS ne2000PollRecv
    (
    void*	pCookie,	/* device ptr */
    M_BLK_ID	pMblk
    )
    {
    int len;
    NE2000END_DEVICE* pDrvCtrl = (NE2000END_DEVICE *) pCookie;

    /* If no packet is available return immediately */
    pDrvCtrl->current = ne2000GetCurr (pDrvCtrl);
    if (pDrvCtrl->nextPacket == pDrvCtrl->current)
        return ((STATUS) (EAGAIN));

    /* Upper layer provides the buffer, make sure it's big enough. */
    if ((pMblk->mBlkHdr.mLen < NE2000_BUFSIZ)
	|| !(pMblk->mBlkHdr.mFlags & M_EXT))
	{
        return ((STATUS) (EAGAIN));
	}

    ENDLOGMSG (("ne2000PollRecv: enter: imask=%02x\n",
		pDrvCtrl->imask, 0, 0, 0, 0, 0));

    len = ne2000PacketGet (pDrvCtrl, pMblk->mBlkHdr.mData + pDrvCtrl->offset);
    if (len <= 0)
        return ((STATUS) (EAGAIN));
    pMblk->mBlkHdr.mFlags |= M_PKTHDR;
    pMblk->mBlkHdr.mLen   = len;
    pMblk->mBlkPktHdr.len = len;
    /* Adjust mData to match n23000PacketGet() above */
    pMblk->mBlkHdr.mData += pDrvCtrl->offset;

    ENDLOGMSG (("ne2000PollRecv: done: imask=%02x\n",
		pDrvCtrl->imask, 0, 0, 0, 0, 0));
    return (OK);
    }

/*******************************************************************************
*
* ne2000PollSend - routine to send a packet in polled mode.
*
* This routine is called by a user to try and send a packet on the
* device.
*/

static STATUS ne2000PollSend
    (
    void*	pCookie,	/* device ptr */
    M_BLK_ID	pMblk
    )
    {
    char *	pBuf;
    UCHAR	cmdStat;
    int		len;
    NE2000END_DEVICE* pDrvCtrl = (NE2000END_DEVICE *) pCookie;

    ENDLOGMSG (("ne2000PollSend: enter: imask=%x flags=%x\n",
		pDrvCtrl->imask, pDrvCtrl->flags, 0, 0, 0, 0));

    SYS_IN_CHAR (pDrvCtrl, ENE_CMD, &cmdStat);
    while (cmdStat & CMD_TXP)
	SYS_IN_CHAR (pDrvCtrl, ENE_DATA, &cmdStat);

    /* Get the next TXD */

    pBuf = pDrvCtrl->packetBuf;
    len = netMblkToBufCopy (pMblk, pBuf, NULL);
    len = max (len, ETHERSMALL);

    /* Transfer to the device */

    ne2000DataOut (pDrvCtrl, pDrvCtrl->packetBuf, len, (NE2000_TSTART << 8));

    /* Flush the write pipe */

    CACHE_PIPE_FLUSH ();

    /* kick Transmitter */

    SYS_OUT_CHAR (pDrvCtrl, ENE_TSTART, NE2000_TSTART);
    SYS_OUT_CHAR (pDrvCtrl, ENE_TCNTH, len >> 8);
    SYS_OUT_CHAR (pDrvCtrl, ENE_TCNTL, len & 0xff);
    SYS_OUT_CHAR (pDrvCtrl, ENE_CMD, CMD_TXP | CMD_START);

    /* update statistics */

    END_ERR_ADD (&pDrvCtrl->endObj, MIB2_OUT_UCAST, +1);

    /* Flush the write pipe */

    CACHE_PIPE_FLUSH ();

    /* Spin until the packet has been sent */

    SYS_IN_CHAR (pDrvCtrl, ENE_CMD, &cmdStat);
    while (cmdStat & CMD_TXP)
	SYS_IN_CHAR (pDrvCtrl, ENE_CMD, &cmdStat);

    ENDLOGMSG (("ne2000PollSend: done: imask=%x flags=%x\n",
		pDrvCtrl->imask, pDrvCtrl->flags, 0, 0, 0, 0));

    return (OK);
    }

/*******************************************************************************
*
* ne2000PollStart - start polled mode operations
*
* RETURNS: OK or ERROR.
*/

LOCAL STATUS ne2000PollStart
    (
    NE2000END_DEVICE* pDrvCtrl
    )
    {
    int oldLevel;

    oldLevel = intLock ();
    ENDLOGMSG (("ne2000PollStart: imask=%x flags=%x\n",
		pDrvCtrl->imask, pDrvCtrl->flags, 0, 0, 0, 0));
    pDrvCtrl->flags |= END_POLLING;
    pDrvCtrl->imask = 0;
    SYS_OUT_CHAR (pDrvCtrl, ENE_INTMASK, pDrvCtrl->imask);
    intUnlock (oldLevel);

    return (OK);
    }

/*******************************************************************************
*
* ne2000PollStop - stop polled mode operations
*
* This function terminates polled mode operation.  The device returns to
* interrupt mode.
*
* The device interrupts are enabled, the current mode flag is switched
* to indicate interrupt mode and the device is then reconfigured for
* interrupt operation.
*
* RETURNS: OK or ERROR.
*/

LOCAL STATUS ne2000PollStop
    (
    NE2000END_DEVICE* pDrvCtrl
    )
    {
    int oldLevel;

    oldLevel = intLock ();
    pDrvCtrl->flags &= ~END_POLLING;
    pDrvCtrl->imask = NE2000_ALL_INTS;
    /* leave recv int disabled if in receive loop. */
    if (pDrvCtrl->flags & END_RECV_HANDLING_FLAG)
	pDrvCtrl->imask &= ~IM_PRXE;
    SYS_OUT_CHAR (pDrvCtrl, ENE_INTMASK, pDrvCtrl->imask);

    ENDLOGMSG (("ne2000PollStop: imask=%x flags=%x\n",
		pDrvCtrl->imask, pDrvCtrl->flags, 0, 0, 0, 0));
    intUnlock (oldLevel);
    return (OK);
    }

/******************************************************************************
*
* ne2000AddrFilterSet - set the address filter for multicast addresses
*
* This routine loops through all of the multicast addresses on the list
* of addresses (added with the endAddrAdd() routine) and sets the
* device's filter appropriately.
*
* NOMANUAL
*/
LOCAL void ne2000AddrFilterSet
    (
    NE2000END_DEVICE *pDrvCtrl
    )
    {
    int i;
    int eAddr;
    u_char enetChar;
    u_char *pCp;
    u_long crc;
    ETHER_MULTI* pCurr;

    ENDLOGMSG (("ne2000AddrFilterSet\n", 0, 0, 0, 0, 0, 0));

    /*
     * There are 8 multicast address registers (MAR0-7) which
     * decode the multicast addresses to be received.  These
     * registers provide filtering of multicast addresses hashed
     * by the CRC hardware logic.  All destination addresses are
     * fed through the CRC hardware logic and when the last bit
     * of the destination address enters the CRC hardware, the
     * 6 MSB's of the CRC generator are latched.  These six bits
     * are then used to index a unique filter bit (FB0-63, 64 since
     * there are eight-8bit registers, and 2^6 = 64) in the multicast
     * address registers.   If the index filter bit is set,
     * the packet is accepted.
     *
     * To configure MAR0-7 to accept a specific multicast address,
     * the above sequence must be also be duplicated in software to
     * determine which filter bit in the multicast registers should
     * be set for a given multicast address.   Several bits can be
     * set to accept several multicast addresses.
     *
     * The standard AUTODIN-II polynomial is used for the 32-bit CRC
     * hash index calculation.  The AUTODIN-II, FDDI, ethernet
     * polynomial for 32 bit CRC is 0x04c11db7, as deemed kosher
     * by the mighty polynomial gods of error awareness.
     *
     * The polynomial is expressed:
     *
     *   ( x^32 + x^26 + x^23 + x^22 + x^16 +
     *     x^12 + x^11 + x^10 + x^8  + x^7  +
     *            x^5  + x^4  + x^2  + x^1  + 1 ) = 0x04c11db7
     *
     * Where x = base 2 (binary) and x^32 is ignored for CRC.
     *
     */

    /* initialize (clear) all filter bits */

    for (i = 0; i < 8; ++i)
	pDrvCtrl->mcastFilter[i] = 0;


    /* set the proper MAR0-7 filter bit(s) for every address */

    for (pCurr = END_MULTI_LST_FIRST (&pDrvCtrl->endObj);
	 pCurr != NULL;
	 pCurr = END_MULTI_LST_NEXT(pCurr))
	{
	pCp = (unsigned char *)&pCurr->addr;

	crc = 0xffffffff;  /* initial CRC seed */

	/* build the CRC for the 6 byte adrs */

	for (eAddr = 0; eAddr < 6; eAddr++)
	    {
	    enetChar = *pCp++;
            crc = ne2000CrcWork (enetChar, crc);
	    }

	/*
	 * We now have the crc for the current address and we are
	 * interested in the 6 most significant bits of the crc
	 * for indexing because that is whats latched by the CRC
	 * hardware logic.
	 *
	 * Which of the eight MAR registers, 0-7, is indexed with
	 * the upper three bits of the six.  Which of the eight bits
	 * to set in that MAR register is indexed by the lower three
	 * bits of the six.
	 */

	/* get six msb */

	crc >>= 26;
	crc &= 0x3f;


	/* high 3 bit index MAR reg, low three bits index reg bit */

	pDrvCtrl->mcastFilter[crc >> 3] |= (1 << (crc & 7));
	}
    }

/*****************************************************************************
*
* ne2000CrcWork - return CRC using a 32 bit polynomial
*
* This is a work routine used by ne2000AddrFilterSet
*
* NOMANUAL
*
*/

LOCAL UINT32 ne2000CrcWork
    (
    UINT8 inChar,
    UINT32 inCrc
    )
    {
    UINT8 work = 0;
    UINT8 wrap;
    int i;

    /*
     * standard CRC algorithm, 8 bit stream.
     */

    for (i = 0; i < 8; i++)
        {
        wrap = (inCrc >> 31);
        inCrc <<= 1;
        work  = ((work << 1) | wrap) ^ inChar;
        if (work & 1)
            {
            inCrc ^= CRC32_POLYNOMIAL;
            }
         work >>= 1;
         inChar >>= 1;
         }
     return (inCrc);
     }


/*****************************************************************************
*
* ne2000MCastAdd - add a multicast address for the device
*
* This routine adds a multicast address to whatever the driver
* is already listening for.  It then resets the address filter.
*/

LOCAL STATUS ne2000MCastAdd
    (
    void*	pCookie,	/* device ptr */
    char*	pAddress
    )
    {
    NE2000END_DEVICE* pDrvCtrl = (NE2000END_DEVICE *) pCookie;

    ENDLOGMSG (("ne2000MCastAdd - %02x:%02x:%02x:%02x:%02x:%02x\n",
		pAddress[0]&0xff, pAddress[1]&0xff, pAddress[2]&0xff,
		pAddress[3]&0xff, pAddress[4]&0xff, pAddress[5]&0xff));

    if (etherMultiAdd (&pDrvCtrl->endObj.multiList, pAddress) == ENETRESET)
	{
	ne2000Config (pDrvCtrl, TRUE);
	}

    return (OK);
    }

/*****************************************************************************
*
* ne2000MCastDel - delete a multicast address for the device
*
* This routine removes a multicast address from whatever the driver
* is listening for.  It then resets the address filter.
*/

LOCAL STATUS ne2000MCastDel
    (
    void*	pCookie,	/* device ptr */
    char*	pAddress
    )
    {
    NE2000END_DEVICE* pDrvCtrl = (NE2000END_DEVICE *) pCookie;

    ENDLOGMSG (("ne2000MCastDel - %02x:%02x:%02x:%02x:%02x:%02x\n",
		pAddress[0]&0xff, pAddress[1]&0xff, pAddress[2]&0xff,
		pAddress[3]&0xff, pAddress[4]&0xff, pAddress[5]&0xff));

    if (etherMultiDel (&pDrvCtrl->endObj.multiList,
		       (char *)pAddress) == ENETRESET)
	{
	ne2000Config (pDrvCtrl, TRUE);
	}

    return (OK);
    }

/*****************************************************************************
*
* ne2000MCastGet - get the multicast address list for the device
*
* This routine gets the multicast list of whatever the driver
* is already listening for.
*/

LOCAL STATUS ne2000MCastGet
    (
    void*		pCookie,	/* device ptr */
    MULTI_TABLE*	pTable
    )
    {
    int error;
    NE2000END_DEVICE* pDrvCtrl = (NE2000END_DEVICE *) pCookie;

    ENDLOGMSG (("ne2000MCastGet\n", 0, 0, 0, 0, 0, 0));
    error = etherMultiGet (&pDrvCtrl->endObj.multiList, pTable);

    return (error);
    }

/******************************************************************************
*
* ne2000Stop - stop the device
*
* This function calls BSP functions to disconnect interrupts and stop
* the device from operating in interrupt mode.
*
* RETURNS: OK or ERROR
*/

LOCAL STATUS ne2000Stop
    (
    void *pCookie
    )
    {
    STATUS result = OK;
    NE2000END_DEVICE* pDrvCtrl;

    pDrvCtrl = (NE2000END_DEVICE *) pCookie;

    /* mark the interface -- down */

    END_FLAGS_CLR (&pDrvCtrl->endObj, IFF_UP | IFF_RUNNING);

    /* Disable device interrupts */

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品成人一区二区三区夜夜夜| 日韩av在线发布| 国产精品国产a级| 日本一区二区三区在线不卡| 久久久久久9999| 国产日韩精品一区二区浪潮av | 久久亚洲欧美国产精品乐播| 日韩欧美自拍偷拍| 欧美大白屁股肥臀xxxxxx| 日韩一区二区三| 日韩精品一区二区三区四区| 欧美xxxx老人做受| 26uuu久久综合| 久久久三级国产网站| 国产精品无码永久免费888| 国产精品黄色在线观看| 亚洲精品你懂的| 一区二区三区国产精品| 亚洲成a人片综合在线| 免费av成人在线| 国产美女一区二区| www.性欧美| 欧美性色综合网| 91精品久久久久久蜜臀| 久久亚洲精品国产精品紫薇| 国产精品视频看| 亚洲已满18点击进入久久| 日韩av一区二| 国产一区二区电影| 不卡免费追剧大全电视剧网站| 色香色香欲天天天影视综合网| 欧美在线制服丝袜| 日韩欧美你懂的| 国产精品久久久久久久蜜臀| 夜夜精品视频一区二区| 美女看a上一区| 成人综合婷婷国产精品久久免费| 91日韩一区二区三区| 欧美日韩高清影院| 国产欧美精品一区二区色综合朱莉 | 91精品国产综合久久精品麻豆 | 亚洲精品高清在线| 免费观看成人av| 99久久免费精品| 91精品国产福利| 国产欧美日韩精品一区| 午夜日韩在线电影| 国产伦精一区二区三区| 欧美三级视频在线观看| 国产午夜精品久久久久久久| 一区二区三区在线视频观看| 久久99久久精品| 欧洲av在线精品| 欧美精品一区二区三| 亚洲精品日日夜夜| 极品销魂美女一区二区三区| 色综合天天综合| 欧美成人一级视频| 一区二区三区 在线观看视频| 精品一区二区三区在线播放| 91香蕉视频mp4| 久久久久久免费| 亚洲成av人片在www色猫咪| 丁香婷婷综合色啪| 91精品国产一区二区三区蜜臀 | 久久精品国产精品亚洲精品| 91免费版在线| 久久免费看少妇高潮| 日本欧美大码aⅴ在线播放| 日本韩国欧美在线| 欧美激情一区二区在线| 精品一区二区三区免费| 91福利在线导航| 亚洲欧美综合网| 国产成人精品免费网站| 日韩欧美123| 午夜国产精品一区| 91黄色免费观看| 中文字幕一区二区三区不卡| 国产精品一区二区在线播放 | 午夜久久久久久电影| 91老师片黄在线观看| 久久精品视频一区| 精久久久久久久久久久| 欧美日韩高清一区二区三区| 亚洲免费大片在线观看| jiyouzz国产精品久久| 国产视频在线观看一区二区三区| 蜜臀a∨国产成人精品| 欧美性生活影院| 夜夜爽夜夜爽精品视频| 色av综合在线| 中文字幕一区二区视频| 99久久精品国产麻豆演员表| 亚洲国产精品成人久久综合一区| 久久99精品久久久久| 日韩欧美国产麻豆| 免费av成人在线| 欧美一区二区三区免费大片 | 欧美日韩成人在线| 五月婷婷色综合| 欧美中文字幕一区| 一区二区三区日韩精品| 一本大道av伊人久久综合| 日韩一区在线免费观看| 91亚洲精品一区二区乱码| 中文字幕在线观看一区| 91麻豆精品视频| 亚洲综合偷拍欧美一区色| 欧美主播一区二区三区| 亚洲国产精品自拍| 欧美理论电影在线| 免费久久99精品国产| 精品久久人人做人人爰| 国产福利91精品一区| 中文字幕五月欧美| 91精品91久久久中77777| 亚洲国产精品自拍| 欧美一区二区女人| 狠狠色综合日日| 日本一区二区动态图| 99亚偷拍自图区亚洲| 一区二区在线观看免费 | 一区二区激情小说| 欧美日韩dvd在线观看| 日韩电影在线观看网站| 精品国产乱码久久久久久夜甘婷婷| 国产乱一区二区| 亚洲天堂av一区| 欧美日韩国产一级片| 韩国av一区二区三区四区| 国产精品免费视频一区| 色哟哟国产精品| 免费观看91视频大全| 久久久综合视频| 91视频免费播放| 日本色综合中文字幕| 国产欧美日韩精品一区| 欧美在线观看视频一区二区三区 | 欧美乱妇20p| 韩国v欧美v日本v亚洲v| 亚洲日本欧美天堂| 欧美一级日韩不卡播放免费| 国产伦精品一区二区三区免费迷 | 99久久婷婷国产综合精品| 午夜精品福利一区二区三区av | 日本v片在线高清不卡在线观看| 久久蜜桃一区二区| 在线看国产日韩| 国产中文一区二区三区| 一区二区在线观看免费视频播放| 日韩一区二区三区免费观看| 成人福利视频网站| 免费成人美女在线观看.| 国产精品视频麻豆| 日韩一级二级三级精品视频| av一区二区不卡| 青青草国产精品97视觉盛宴| 中文字幕精品一区| 欧美一二三区精品| 91小视频免费观看| 国产美女视频91| 三级在线观看一区二区| 国产精品国产三级国产aⅴ入口| 7777精品伊人久久久大香线蕉经典版下载 | 亚洲二区在线观看| 国产女人18毛片水真多成人如厕| 欧美日韩国产在线观看| av不卡在线播放| 久久成人18免费观看| 亚洲午夜久久久久久久久电影网| 久久久亚洲精华液精华液精华液| 欧美日韩情趣电影| 91首页免费视频| 豆国产96在线|亚洲| 久久精品国产精品青草| 亚洲韩国精品一区| 中文字幕一区二区5566日韩| 精品国产三级a在线观看| 欧美日韩免费在线视频| 99久久99精品久久久久久| 国产一区二区三区四| 蜜桃一区二区三区四区| 亚洲午夜久久久久久久久电影网 | 亚洲大型综合色站| 亚洲欧美aⅴ...| 国产精品久久福利| 久久久精品人体av艺术| 欧美不卡在线视频| 91精品国产综合久久蜜臀| 欧美系列日韩一区| 91老司机福利 在线| 成人黄色在线视频| 国产精品99久久久久| 国内精品久久久久影院薰衣草 | 欧美日韩成人综合天天影院| 在线视频你懂得一区| 色爱区综合激月婷婷| 色综合久久综合网97色综合| 99国产精品国产精品毛片|