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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? interrup.c

?? 使用網絡驅動器接口標準開發的ne2000網卡的NT驅動.
?? C
?? 第 1 頁 / 共 4 頁
字號:
            if (!FrameAlign && ((*NextPacket < Adapter->NicPageStart) ||
                (*NextPacket > Adapter->NicPageStop))) {

                IF_LOUD( DbgPrint ("Packet address invalid in HeaderValidation\n"); )

                FrameAlign = TRUE;

            }

        }

        //
        // FrameAlignment - if first time through, shift packetheader right 1 or 2 bytes.
        // If second time through, shift it back to where it was and let it through.
        // This compensates for a known bug in the 8390D chip.
        //
        if (FrameAlign){

            switch (FrameAlignCount){

            case 0:

                BeginPacketHeader++;
                PacketLoc++;
                if (!Adapter->EightBitSlot){

                    BeginPacketHeader++;
                    PacketLoc++;

                }
                break;

            case 1:

                BeginPacketHeader--;
                PacketLoc--;
                if (!Adapter->EightBitSlot){
                    BeginPacketHeader--;
                    PacketLoc--;
                }
                break;

            }

            FrameAlignCount++;

        }

    } while ( (FrameAlignCount < 2) && FrameAlign );

    //
    // Now grab the packet header information
    //
    Adapter->PacketHeader[0] = *BeginPacketHeader;
    BeginPacketHeader++;
    Adapter->PacketHeader[1] = *BeginPacketHeader;
    BeginPacketHeader++;
    Adapter->PacketHeader[2] = *BeginPacketHeader;
    BeginPacketHeader++;
    Adapter->PacketHeader[3] = *BeginPacketHeader;

    //
    // Packet length is in bytes 3 and 4 of the header.
    //
    Adapter->PacketHeaderLoc = PacketLoc;
    PacketLen = (Adapter->PacketHeader[2]) + ((Adapter->PacketHeader[3])*256) - 4;

    //
    // Sanity check the packet
    //
    if ((PacketLen > 1514) || (PacketLen < 60)){

        if ((Adapter->PacketHeader[1] < Adapter->NicPageStart) ||
            (Adapter->PacketHeader[1] > Adapter->NicPageStop)) {

            //
            // Return TRUE here since IndicatePacket will notice the error
            // and handle it correctly.
            //
            return(TRUE);

        }

        return(FALSE);

    }

    return(TRUE);
}


INDICATE_STATUS
Ne2000IndicatePacket(
    IN PNE2000_ADAPTER Adapter
    )

/*++

Routine Description:

    Indicates the first packet on the card to the protocols.

    NOTE: For MP, non-x86 architectures, this assumes that the packet has been
    read from the card and into Adapter->PacketHeader and Adapter->Lookahead.

    NOTE: For UP x86 systems this assumes that the packet header has been
    read into Adapter->PacketHeader and the minimal lookahead stored in
    Adapter->Lookahead

Arguments:

    Adapter - pointer to the adapter block.

Return Value:

    CARD_BAD if the card should be reset;
    INDICATE_OK otherwise.

--*/

{
    //
    // Length of the packet
    //
    UINT PacketLen;

    //
    // Length of the lookahead buffer
    //
    UINT IndicateLen;

    //
    // Variables for checking if the packet header looks valid
    //
    UCHAR PossibleNextPacket1, PossibleNextPacket2;

    //
    // Check if the next packet byte agress with the length, as
    // described on p. A-3 of the Etherlink II Technical Reference.
    // The start of the packet plus the MSB of the length must
    // be equal to the start of the next packet minus one or two.
    // Otherwise the header is considered corrupted, and the
    // card must be reset.
    //

    PossibleNextPacket1 =
                Adapter->NicNextPacket + Adapter->PacketHeader[3] + (UCHAR)1;

    if (PossibleNextPacket1 >= Adapter->NicPageStop) {

        PossibleNextPacket1 -= (Adapter->NicPageStop - Adapter->NicPageStart);

    }

    if (PossibleNextPacket1 != Adapter->PacketHeader[1]) {

        PossibleNextPacket2 = PossibleNextPacket1+(UCHAR)1;

        if (PossibleNextPacket2 == Adapter->NicPageStop) {

            PossibleNextPacket2 = Adapter->NicPageStart;

        }

        if (PossibleNextPacket2 != Adapter->PacketHeader[1]) {

            IF_LOUD( DbgPrint("First CARD_BAD check failed\n"); )
            return SKIPPED;
        }

    }

    //
    // Check that the Next is valid
    //
    if ((Adapter->PacketHeader[1] < Adapter->NicPageStart) ||
        (Adapter->PacketHeader[1] > Adapter->NicPageStop)) {

        IF_LOUD( DbgPrint("Second CARD_BAD check failed\n"); )
        return(SKIPPED);

    }

    //
    // Sanity check the length
    //
    PacketLen = Adapter->PacketHeader[2] + Adapter->PacketHeader[3]*256 - 4;

    if (PacketLen > 1514) {
        IF_LOUD( DbgPrint("Third CARD_BAD check failed\n"); )
        return(SKIPPED);

    }

#if DBG

    IF_NE2000DEBUG( NE2000_DEBUG_WORKAROUND1 ) {
        //
        // Now check for the high order 2 bits being set, as described
        // on page A-2 of the Etherlink II Technical Reference. If either
        // of the two high order bits is set in the receive status byte
        // in the packet header, the packet should be skipped (but
        // the adapter does not need to be reset).
        //

        if (Adapter->PacketHeader[0] & (RSR_DISABLED|RSR_DEFERRING)) {

            IF_LOUD (DbgPrint("H");)

            return SKIPPED;

        }

    }

#endif

    //
    // Lookahead amount to indicate
    //
    IndicateLen = (PacketLen > (Adapter->MaxLookAhead + NE2000_HEADER_SIZE)) ?
                           (Adapter->MaxLookAhead + NE2000_HEADER_SIZE) :
                           PacketLen;

    //
    // Indicate packet
    //

    Adapter->PacketLen = PacketLen;

    if (IndicateLen < NE2000_HEADER_SIZE) {

        //
        // Runt Packet
        //

        NdisMEthIndicateReceive(
                Adapter->MiniportAdapterHandle,
                (NDIS_HANDLE)Adapter,
                (PCHAR)(Adapter->Lookahead),
                IndicateLen,
                NULL,
                0,
                0
                );

    } else {

        NdisMEthIndicateReceive(
                Adapter->MiniportAdapterHandle,
                (NDIS_HANDLE)Adapter,
                (PCHAR)(Adapter->Lookahead),
                NE2000_HEADER_SIZE,
                (PCHAR)(Adapter->Lookahead) + NE2000_HEADER_SIZE,
                IndicateLen - NE2000_HEADER_SIZE,
                PacketLen - NE2000_HEADER_SIZE
                );

    }

    Adapter->IndicateReceiveDone = TRUE;

    return INDICATE_OK;
}


NDIS_STATUS
Ne2000TransferData(
    OUT PNDIS_PACKET Packet,
    OUT PUINT BytesTransferred,
    IN NDIS_HANDLE MiniportAdapterContext,
    IN NDIS_HANDLE MiniportReceiveContext,
    IN UINT ByteOffset,
    IN UINT BytesToTransfer
    )

/*++

Routine Description:

    A protocol calls the Ne2000TransferData request (indirectly via
    NdisTransferData) from within its Receive event handler
    to instruct the driver to copy the contents of the received packet
    a specified packet buffer.

Arguments:

    MiniportAdapterContext - Context registered with the wrapper, really
        a pointer to the adapter.

    MiniportReceiveContext - The context value passed by the driver on its call
    to NdisMEthIndicateReceive.  The driver can use this value to determine
    which packet, on which adapter, is being received.

    ByteOffset - An unsigned integer specifying the offset within the
    received packet at which the copy is to begin.  If the entire packet
    is to be copied, ByteOffset must be zero.

    BytesToTransfer - An unsigned integer specifying the number of bytes
    to copy.  It is legal to transfer zero bytes; this has no effect.  If
    the sum of ByteOffset and BytesToTransfer is greater than the size
    of the received packet, then the remainder of the packet (starting from
    ByteOffset) is transferred, and the trailing portion of the receive
    buffer is not modified.

    Packet - A pointer to a descriptor for the packet storage into which
    the MAC is to copy the received packet.

    BytesTransfered - A pointer to an unsigned integer.  The MAC writes
    the actual number of bytes transferred into this location.  This value
    is not valid if the return status is STATUS_PENDING.

Notes:

  - The MacReceiveContext will be a pointer to the open block for
    the packet.

--*/

{
    //
    // Variables for the number of bytes to copy, how much can be
    // copied at this moment, and the total number of bytes to copy.
    //
    UINT BytesLeft, BytesNow, BytesWanted;

    //
    // Current NDIS_BUFFER to copy into
    //
    PNDIS_BUFFER CurBuffer;

    //
    // Virtual address of the buffer.
    //
    XMIT_BUF NextBufToXmit;
    PUCHAR BufStart;

    //
    // Length and offset into the buffer.
    //
    UINT BufLen, BufOff;

    //
    // The adapter to transfer from.
    //
    PNE2000_ADAPTER Adapter = ((PNE2000_ADAPTER)MiniportReceiveContext);

    IF_LOG( Ne2000Log('t');)

    //
    // Add the packet header onto the offset.
    //
    ByteOffset += NE2000_HEADER_SIZE;

    //
    // See how much data there is to transfer.
    //
    if (ByteOffset+BytesToTransfer > Adapter->PacketLen) {

        if (Adapter->PacketLen < ByteOffset) {

            *BytesTransferred = 0;
            IF_LOG( Ne2000Log('T');)
            return(NDIS_STATUS_FAILURE);
        }

        BytesWanted = Adapter->PacketLen - ByteOffset;

    } else {

        BytesWanted = BytesToTransfer;

    }

    //
    // Set the number of bytes left to transfer
    //
    BytesLeft = BytesWanted;

    {

        //
        // Address on the adapter to copy from
        //
        PUCHAR CurCardLoc;

        //
        // Copy data from the card -- it is not completely stored in the
        // adapter structure.
        //
        // Determine where the copying should start.
        //
        CurCardLoc = Adapter->PacketHeaderLoc + ByteOffset;

        if (CurCardLoc > Adapter->PageStop) {

            CurCardLoc = CurCardLoc - (Adapter->PageStop - Adapter->PageStart);

        }

        //
        // Get location to copy into
        //
        NdisQueryPacket(Packet, NULL, NULL, &CurBuffer, NULL);

        NdisQueryBuffer(CurBuffer, (PVOID *)&BufStart, &BufLen);

        BufOff = 0;

        //
        // Loop, filling each buffer in the packet until there
        // are no more buffers or the data has all been copied.
        //
        while (BytesLeft > 0) {

            //
            // See how much data to read into this buffer.
            //

            if ((BufLen-BufOff) > BytesLeft) {

                BytesNow = BytesLeft;

            } else {

                BytesNow = (BufLen - BufOff);

            }

            //
            // See if the data for this buffer wraps around the end
            // of the receive buffers (if so filling this buffer
            // will use two iterations of the loop).
            //

            if (CurCardLoc + BytesNow > Adapter->PageStop) {

                BytesNow = (UINT)(Adapter->PageStop - CurCardLoc);

            }

            //
            // Copy up the data.
            //

            if (!CardCopyUp(Adapter, BufStart+BufOff, CurCardLoc, BytesNow)) {

                *BytesTransferred = BytesWanted - BytesLeft;

                NdisWriteErrorLogEntry(
                    Adapter->MiniportAdapterHandle,
                    NDIS_ERROR_CODE_HARDWARE_FAILURE,
                    1,
                    0x2
                    );

                return(NDIS_STATUS_FAILURE);

            }

            //
            // Update offsets and counts
            //
            CurCardLoc += BytesNow;
            BytesLeft -= BytesNow;

            //
            // Is the transfer done now?
            //
            if (BytesLeft == 0) {

                break;

            }

            //
            // Wrap around the end of the receive buffers?
            //
            if (CurCardLoc == Adapter->PageStop) {

                CurCardLoc = Adapter->PageStart;

            }

            //
            // Was the end of this packet buffer reached?
            //
            BufOff += BytesNow;

            if (BufOff == BufLen) {

                NdisGetNextBuffer(CurBuffer, &CurBuffer);

                if (CurBuffer == (PNDIS_BUFFER)NULL) {

                    break;

                }

                NdisQueryBuffer(CurBuffer, (PVOID *)&BufStart, &BufLen);

                BufOff = 0;

            }

        }

        *BytesTransferred = BytesWanted - BytesLeft;

        //
        // Did a transmit complete while we were doing what we were doing?
        //
        if (!Adapter->BufferOverflow && Adapter->CurBufXmitting != -1) {

            ULONG Len;
            UINT i;
            UCHAR Status;
            PNDIS_PACKET Packet;
            NDIS_STATUS NdisStatus;

            //
            // Check if it completed
            //
            CardGetInterruptStatus(Adapter, &Status);

            if (Status & ISR_XMIT_ERR) {
                OctogmetusceratorRevisited(Adapter);
                Adapter->InterruptStatus &= ~ISR_XMIT_ERR;
                NdisRawWritePortUchar(Adapter->IoPAddr+NIC_INTR_STATUS, (ISR_XMIT_ERR));
                Status &= ~ISR_XMIT_ERR;

            }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品一区四区| 国产日产欧美一区二区视频| 日韩一区二区电影| 国产精品久久久久四虎| 日韩电影在线观看电影| 91亚洲资源网| 国产亚洲一区字幕| 另类专区欧美蜜桃臀第一页| 欧洲亚洲精品在线| 国产精品久久久久久户外露出| 蜜桃免费网站一区二区三区| 欧美在线短视频| 国产精品国产三级国产aⅴ中文| 精品在线免费视频| 欧美酷刑日本凌虐凌虐| 亚洲色图色小说| 99视频精品全部免费在线| 日韩精品一区二区三区四区视频 | 琪琪一区二区三区| 日本精品一区二区三区高清| 中文字幕日本不卡| 成人福利电影精品一区二区在线观看| 久久新电视剧免费观看| 日韩和欧美的一区| 欧美久久一区二区| 日韩一区二区三区观看| 成人美女视频在线看| 91蜜桃视频在线| 黄色日韩网站视频| 日韩精品成人一区二区三区| 亚洲免费观看在线视频| 色哟哟一区二区三区| 亚洲男人都懂的| 日本电影亚洲天堂一区| 激情五月激情综合网| 亚洲成人手机在线| 欧美日韩国产在线播放网站| 国产精品久久久久久久久久久免费看 | 国产欧美一区二区在线| 婷婷综合五月天| 欧洲精品视频在线观看| 18欧美亚洲精品| 99久久久无码国产精品| 国产精品美女久久久久久久| 国产成人在线观看| 日韩欧美国产系列| 免费观看成人鲁鲁鲁鲁鲁视频| 欧美日韩国产欧美日美国产精品| 亚洲欧美视频一区| 色综合久久久久综合体桃花网| 日韩毛片精品高清免费| 91视视频在线直接观看在线看网页在线看| 欧美国产综合一区二区| 波多野结衣亚洲一区| 国产目拍亚洲精品99久久精品| 福利视频网站一区二区三区| 日韩欧美不卡一区| 久久99精品网久久| 精品国产免费久久| 丁香婷婷综合五月| 亚洲色欲色欲www| 欧美在线你懂得| 一区二区三区日韩欧美| 欧美三级一区二区| 美女精品一区二区| 久久品道一品道久久精品| 国产一区二区女| 中文字幕亚洲成人| 欧美在线你懂的| 蜜乳av一区二区| 欧美激情在线一区二区三区| 91在线高清观看| 亚洲欧洲综合另类| 久久99精品久久久久久国产越南| 91污在线观看| 天堂蜜桃一区二区三区 | 日韩精品影音先锋| 日韩三级精品电影久久久| 国产精品国产自产拍高清av王其| 亚洲综合自拍偷拍| 成人av在线一区二区三区| 2021久久国产精品不只是精品| 欧美一区二区三区不卡| 亚洲第四色夜色| 国产精品久久久久久久蜜臀| 欧美日韩精品欧美日韩精品| aaa欧美大片| 日本亚洲最大的色成网站www| 综合欧美一区二区三区| 69堂国产成人免费视频| 99热国产精品| 美女免费视频一区二区| 亚洲国产一区二区三区青草影视| 欧美精品一区视频| 日韩欧美一二三| 99re热这里只有精品视频| 国产精品欧美一区喷水| 欧美xxx久久| 色94色欧美sute亚洲线路一ni | 欧美日韩在线直播| 免费不卡在线观看| 日韩国产一区二| 亚洲综合免费观看高清完整版| 亚洲欧美电影院| 国产亚洲一区二区在线观看| 精品国产一区二区亚洲人成毛片| 91麻豆免费视频| 色94色欧美sute亚洲13| 国产aⅴ综合色| 成人激情av网| 国产剧情一区在线| 国产成人精品一区二| 久久99热狠狠色一区二区| 精品亚洲欧美一区| 美女视频一区二区| 韩国女主播成人在线| 麻豆久久久久久| 国产乱子伦视频一区二区三区 | 中文字幕五月欧美| 久久精品一区蜜桃臀影院| 国产女人18毛片水真多成人如厕| 精品国产成人系列| 中文字幕欧美日韩一区| 久久综合九色综合欧美就去吻 | 国产精品亚洲一区二区三区在线 | 欧美精品v国产精品v日韩精品| 国产精品青草久久| 91丨九色丨蝌蚪丨老版| www.亚洲色图.com| 国产精品影音先锋| 99re6这里只有精品视频在线观看| 成人黄色在线网站| 91久久精品一区二区三| 欧美综合在线视频| 不卡的av网站| 在线亚洲免费视频| 精品视频1区2区| 日韩写真欧美这视频| 波多野结衣中文字幕一区二区三区 | 色婷婷精品久久二区二区蜜臂av | 天使萌一区二区三区免费观看| 美洲天堂一区二卡三卡四卡视频 | 色综合色狠狠天天综合色| 色综合中文字幕| 欧美日韩午夜精品| 久久精品欧美日韩精品| 中文在线免费一区三区高中清不卡| 一区二区三区视频在线观看| 亚洲成av人片一区二区三区| 国产成人亚洲综合a∨猫咪| 粉嫩av一区二区三区粉嫩 | 91国产精品成人| 69av一区二区三区| 国产精品国产三级国产三级人妇| 亚洲免费高清视频在线| 奇米色一区二区三区四区| 久久精品国产一区二区三 | 一区二区三区 在线观看视频| 日韩成人精品在线观看| 丰满少妇在线播放bd日韩电影| 欧美日韩电影在线播放| 精品国产乱码久久久久久浪潮| 亚洲精品成人悠悠色影视| 日本一区中文字幕| 色国产综合视频| 欧美刺激脚交jootjob| 亚洲免费在线看| 麻豆久久久久久久| 欧美体内she精高潮| 久久综合九色综合97婷婷| 亚欧色一区w666天堂| 粉嫩aⅴ一区二区三区四区| 日韩亚洲欧美在线观看| 亚洲女女做受ⅹxx高潮| 成人精品国产免费网站| 91精品欧美福利在线观看| 亚洲欧美激情插| 国产美女精品一区二区三区| 欧美理论在线播放| 国产精品卡一卡二卡三| 国产精品一区2区| 91超碰这里只有精品国产| 亚洲自拍偷拍图区| 成人精品视频一区| 日韩精品影音先锋| 亚洲观看高清完整版在线观看| 国产**成人网毛片九色| 欧美日韩情趣电影| 国产农村妇女毛片精品久久麻豆| 天天色天天操综合| 欧美日韩精品久久久| 亚洲欧洲国产专区| 99视频国产精品| 国产欧美精品一区二区色综合| 国产成人精品三级| 欧美mv和日韩mv的网站| 韩国v欧美v日本v亚洲v| 91精品蜜臀在线一区尤物| 秋霞成人午夜伦在线观看| 欧美探花视频资源|