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

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

?? interrup.c

?? 使用網絡驅動器接口標準開發的ne2000網卡的NT驅動.
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*++

Copyright (c) 1990-1998 Microsoft Corporation, All Rights Reserved.

Module Name:

    interrup.c

Abstract:

    This is a part of the driver for the National Semiconductor Novell 2000
    Ethernet controller.  It contains the interrupt-handling routines.
    This driver conforms to the NDIS 3.0 interface.

    The overall structure and much of the code is taken from
    the Lance NDIS driver by Tony Ercolano.

Author:

    Sean Selitrennikoff (seanse) Dec-1991

Environment:

    Kernel Mode - Or whatever is the equivalent on OS/2 and DOS.

Revision History:

    Bob Noradki - Apr 93 - added piggyback interrupt code.
	Jameel Hyder- Dec 94 - Fixed initialization - part of the fixes from JimMcn

--*/

#include "precomp.h"

//
// On debug builds tell the compiler to keep the symbols for
// internal functions, otw throw them out.
//
#if DBG
#define STATIC
#else
#define STATIC static
#endif



INDICATE_STATUS
Ne2000IndicatePacket(
    IN PNE2000_ADAPTER Adapter
    );

VOID
Ne2000DoNextSend(
    PNE2000_ADAPTER Adapter
    );



//
// This is used to pad short packets.
//
static UCHAR BlankBuffer[60] = "                                                            ";



VOID
Ne2000EnableInterrupt(
    IN NDIS_HANDLE MiniportAdapterContext
    )

/*++

Routine Description:

    This routine is used to turn on the interrupt mask.

Arguments:

    Context - The adapter for the NE2000 to start.

Return Value:

    None.

--*/

{
    PNE2000_ADAPTER Adapter = (PNE2000_ADAPTER)(MiniportAdapterContext);

    IF_LOG( Ne2000Log('P'); )

    CardUnblockInterrupts(Adapter);

}

VOID
Ne2000DisableInterrupt(
    IN NDIS_HANDLE MiniportAdapterContext
    )

/*++

Routine Description:

    This routine is used to turn off the interrupt mask.

Arguments:

    Context - The adapter for the NE2000 to start.

Return Value:

    None.

--*/

{
    PNE2000_ADAPTER Adapter = (PNE2000_ADAPTER)(MiniportAdapterContext);

    IF_LOG( Ne2000Log('p'); )

    CardBlockInterrupts(Adapter);

}

VOID
Ne2000Isr(
    OUT PBOOLEAN InterruptRecognized,
    OUT PBOOLEAN QueueDpc,
    IN PVOID Context
    )

/*++

Routine Description:

    This is the interrupt handler which is registered with the operating
    system. If several are pending (i.e. transmit complete and receive),
    handle them all.  Block new interrupts until all pending interrupts
    are handled.

Arguments:

    InterruptRecognized - Boolean value which returns TRUE if the
        ISR recognizes the interrupt as coming from this adapter.

    QueueDpc - TRUE if a DPC should be queued.

    Context - pointer to the adapter object

Return Value:

    None.
--*/

{
    PNE2000_ADAPTER Adapter = ((PNE2000_ADAPTER)Context);

    IF_LOUD( DbgPrint("In Ne2000ISR\n");)

    IF_LOG( Ne2000Log('i'); )

    IF_VERY_LOUD( DbgPrint( "Ne2000InterruptHandler entered\n" );)

    //
    // Force the INT signal from the chip low. When all
    // interrupts are acknowledged interrupts will be unblocked,
    //
    CardBlockInterrupts(Adapter);

    IF_LOG( Ne2000Log('I'); )

    *InterruptRecognized = TRUE;
    *QueueDpc = TRUE;

    return;
}


VOID
Ne2000HandleInterrupt(
    IN NDIS_HANDLE MiniportAdapterContext
    )
/*++

Routine Description:

    This is the defered processing routine for interrupts.  It
    reads from the Interrupt Status Register any outstanding
    interrupts and handles them.

Arguments:

    MiniportAdapterContext - a handle to the adapter block.

Return Value:

    NONE.

--*/
{
    //
    // The adapter to process
    //
    PNE2000_ADAPTER Adapter = ((PNE2000_ADAPTER)MiniportAdapterContext);

    //
    // The most recent port value read.
    //
    UCHAR InterruptStatus;

    //
    // The interrupt type currently being processed.
    //
    INTERRUPT_TYPE InterruptType;

    IF_LOUD( DbgPrint("==>IntDpc\n");)
    IF_LOG( Ne2000Log('d'); )

    //
    // Get the interrupt bits and save them.
    //
    CardGetInterruptStatus(Adapter, &InterruptStatus);
    Adapter->InterruptStatus |= InterruptStatus;

    if (InterruptStatus != ISR_EMPTY) {

        //
        // Acknowledge the interrupts
        //
        NdisRawWritePortUchar(Adapter->IoPAddr+NIC_INTR_STATUS,
                              InterruptStatus
                             );

    }

    //
    // Return the type of the most important interrupt waiting on the card.
    // Order of importance is COUNTER, OVERFLOW, TRANSMIT,and RECEIVE.
    //
    InterruptType = CARD_GET_INTERRUPT_TYPE(Adapter, Adapter->InterruptStatus);

    //
    // InterruptType is used to dispatch to correct DPC and are then cleared
    //
    while (InterruptType != UNKNOWN) {

        //
        // Handle the interrupts
        //

        switch (InterruptType) {

        case COUNTER:

            //
            // One of the counters' MSB has been set, read in all
            // the values just to be sure (and then exit below).
            //

            IF_LOUD( DbgPrint("DPC got COUNTER\n");)

            SyncCardUpdateCounters((PVOID)Adapter);

            //
            // Clear the COUNTER interrupt bit
            //
            Adapter->InterruptStatus &= ~ISR_COUNTER;

            break;

        case OVERFLOW:

            //
            // Overflow interrupts are handled as part of a receive interrupt,
            // so set a flag and then pretend to be a receive, in case there
            // is no receive already being handled.
            //
            Adapter->BufferOverflow = TRUE;

            IF_LOUD( DbgPrint("Overflow Int\n"); )
            IF_VERY_LOUD( DbgPrint(" overflow interrupt\n"); )

            //
            // Clear the OVERFLOW interrupt bit
            //
            Adapter->InterruptStatus &= ~ISR_OVERFLOW;

        case RECEIVE:

            IF_LOG( Ne2000Log('R'); )
            IF_LOUD( DbgPrint("DPC got RCV\n"); )

            //
            // For receives, call this to handle the receive
            //
            if (Ne2000RcvDpc(Adapter)) {

                //
                // Clear the RECEIVE interrupt bits
                //
                Adapter->InterruptStatus &= ~(ISR_RCV | ISR_RCV_ERR);

            }

            IF_LOG( Ne2000Log('r'); )

            if (!(Adapter->InterruptStatus & (ISR_XMIT | ISR_XMIT_ERR)))
                break;

        case TRANSMIT:

            IF_LOG( Ne2000Log('X'); )

            ASSERT(!Adapter->OverflowRestartXmitDpc);

            //
            // Get the status of the transmit
            //
            SyncCardGetXmitStatus((PVOID)Adapter);

            //
            // We are no longer expecting an interrupts, as
            // we just got it.
            //
            Adapter->TransmitInterruptPending = FALSE;

            IF_LOUD( DbgPrint( "DPC got XMIT\n"); )

            //
            // Handle transmit errors
            //
            if (Adapter->InterruptStatus & ISR_XMIT_ERR) {

                OctogmetusceratorRevisited(Adapter);

            }

            //
            // Handle the transmit
            //
            if (Adapter->InterruptStatus & ISR_XMIT) {

                Ne2000XmitDpc(Adapter);

            }

            //
            // Clear the TRANSMIT interrupt bits
            //
            Adapter->InterruptStatus &= ~(ISR_XMIT | ISR_XMIT_ERR);

            break;

        default:

            IF_LOUD( DbgPrint("unhandled interrupt type: %x\n", InterruptType); )

            break;

        }

        //
        // Get any new interrupts
        //
        CardGetInterruptStatus(Adapter, &InterruptStatus);

        if (InterruptStatus != ISR_EMPTY) {

            //
            // Acknowledge the interrupt
            //
            NdisRawWritePortUchar(Adapter->IoPAddr+NIC_INTR_STATUS,
                                  InterruptStatus
                                 );
        }

        //
        // Save the interrupt reasons
        //
        Adapter->InterruptStatus |= InterruptStatus;

        //
        // Get next interrupt to process
        //
        InterruptType = CARD_GET_INTERRUPT_TYPE(Adapter, Adapter->InterruptStatus);

    }

    IF_LOG( Ne2000Log('D'); )

    IF_LOUD( DbgPrint("<==IntDpc\n"); )

}


BOOLEAN
Ne2000RcvDpc(
    IN PNE2000_ADAPTER Adapter
    )

/*++

Routine Description:

    This is the real interrupt handler for receive/overflow interrupt.

    Called when a receive interrupt is received. It first indicates
    all packets on the card and finally indicates ReceiveComplete().

Arguments:

    Adapter - Pointer to the adapter block.

Return Value:

    TRUE if done with all receives, else FALSE.

--*/

{
    //
    // Use to restart a transmit if a buffer overflow occured
    // during a transmission
    //
    BOOLEAN TransmitInterruptWasPending = FALSE;

    //
    // Status of a received packet.
    //
    INDICATE_STATUS IndicateStatus = INDICATE_OK;

    //
    // Flag to tell when the receive process is complete
    //
    BOOLEAN Done = TRUE;

    IF_LOUD( DbgPrint( "Ne2000RcvDpc entered\n" );)

    //
    // Default to not indicating NdisMEthIndicateReceiveComplete
    //
    Adapter->IndicateReceiveDone = FALSE;

    //
    // At this point, receive interrupts are disabled.
    //
    SyncCardGetCurrent((PVOID)Adapter);

    //
    // Handle a buffer overflow
    //
    if (Adapter->BufferOverflow) {

        SyncCardHandleOverflow(Adapter);

#if DBG
        if (Adapter->OverflowRestartXmitDpc) {

            IF_LOG( Ne2000Log('O');)
            IF_LOUD( DbgPrint ("Adapter->OverflowRestartXmitDpc set:RcvDpc\n"); )

        }
#endif // DBG

    }

    //
    // Loop
    //
    while (TRUE)
    {
        if ((Adapter->InterruptStatus & ISR_RCV_ERR) &&
            !Adapter->BufferOverflow
        )
        {
            IF_LOUD( DbgPrint ("RCV_ERR, IR=%x\n",Adapter->InterruptStatus); )

            //
            // Skip this packet
            //

            SyncCardGetCurrent((PVOID)Adapter);

            Adapter->NicNextPacket = Adapter->Current;

            CardSetBoundary(Adapter);

            break;

        }

        if (Adapter->Current == Adapter->NicNextPacket) {

            //
            // Acknowledge previous packet before the check for new ones,
            // then read in the Current register.
            // The card register Current used to point to
            // the end of the packet just received; read
            // the new value off the card and see if it
            // still does.
            //
            // This will store the value in Adapter->Current and acknowledge
            // the receive interrupt.
            //
            //

            SyncCardGetCurrent((PVOID)Adapter);

            if (Adapter->Current == Adapter->NicNextPacket) {

                //
                // End of Loop -- no more packets
                //

                break;
            }

        }

        //
        // A packet was found on the card, indicate it.
        //

        Adapter->ReceivePacketCount++;

        //
        // Verify packet is not corrupt
        //
        if (Ne2000PacketOK(Adapter)) {

            ULONG PacketLen;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色八戒一区二区三区| 亚洲精品一二三| 久久国产麻豆精品| 日韩亚洲国产中文字幕欧美| 日本91福利区| 欧美大白屁股肥臀xxxxxx| 久久国产免费看| 国产欧美一区二区精品性色超碰| 国产剧情一区在线| 国产精品乱码一区二三区小蝌蚪| 91香蕉视频在线| 午夜影院久久久| 精品成人a区在线观看| 国产91精品免费| 亚洲免费在线视频| 日韩一区二区在线观看视频| 国产一区二区三区久久久 | 日韩一二三四区| 国产精品一二三四五| 亚洲欧美日韩中文播放| 欧美日韩一卡二卡三卡| 国产一区二区福利| 一个色综合网站| 精品国产91洋老外米糕| 99国产精品久久| 日本视频在线一区| 国产精品久久久久一区二区三区| 91激情五月电影| 国产在线视频不卡二| **性色生活片久久毛片| 91精品国产综合久久久久久久久久| 激情五月激情综合网| 一卡二卡三卡日韩欧美| 久久午夜电影网| 欧美日韩国产高清一区二区 | 国产精品污网站| 欧美肥妇毛茸茸| 97超碰欧美中文字幕| 视频一区二区三区中文字幕| 国产精品每日更新在线播放网址| 91精品国产全国免费观看| 99视频国产精品| 激情文学综合网| 天天爽夜夜爽夜夜爽精品视频| 欧美激情一区在线观看| 精品久久久久久久一区二区蜜臀| 一本色道久久综合亚洲aⅴ蜜桃| 韩国女主播成人在线| 亚洲高清免费视频| 国产精品福利一区| 精品日韩成人av| 91麻豆精品国产无毒不卡在线观看| 成人丝袜视频网| 国产精品一区二区在线播放| 青青草国产成人99久久| 亚洲自拍偷拍综合| 综合久久久久久久| 亚洲国产成人午夜在线一区| 欧美成人一区二区三区片免费 | 天天射综合影视| 亚洲综合一区在线| 自拍偷拍亚洲综合| 亚洲国产成人私人影院tom| 2021中文字幕一区亚洲| 精品少妇一区二区三区日产乱码 | 五月婷婷综合网| 一区二区在线观看不卡| 亚洲图片另类小说| 国产精品久久一级| 国产亚洲综合性久久久影院| 久久影院视频免费| 精品国产区一区| 日韩欧美国产麻豆| 日韩午夜在线观看视频| 91精品国产综合久久国产大片| 欧美视频自拍偷拍| 欧美电影在线免费观看| 欧美精品高清视频| 欧美一级欧美一级在线播放| 日韩色在线观看| 日韩午夜av一区| 日韩欧美一区电影| 久久综合精品国产一区二区三区| 欧美xxxxxxxxx| 久久夜色精品国产噜噜av| 精品第一国产综合精品aⅴ| 久久久久久久网| 国产欧美日韩另类一区| 国产精品久久久久永久免费观看| 国产精品久久久久三级| 亚洲男人都懂的| 午夜影视日本亚洲欧洲精品| 麻豆精品国产91久久久久久| 国产又粗又猛又爽又黄91精品| 丰满白嫩尤物一区二区| 91丨porny丨在线| 欧美日韩免费观看一区三区| 欧美一区二区三区男人的天堂| 日韩欧美激情在线| 欧美激情中文字幕一区二区| 亚洲欧美另类小说视频| 午夜欧美2019年伦理| 国内精品国产三级国产a久久| 成人在线视频首页| 日本韩国精品在线| 欧美一级国产精品| 国产精品私房写真福利视频| 亚洲黄一区二区三区| 日本视频中文字幕一区二区三区| 国产精品一区二区视频| 在线一区二区三区四区五区| 91精品国产综合久久久蜜臀图片 | 亚洲精品视频在线看| 奇米四色…亚洲| 成人18视频在线播放| 欧美日韩精品福利| 久久久蜜臀国产一区二区| 亚洲精品写真福利| 狠狠狠色丁香婷婷综合激情| 一本大道久久a久久综合| 日韩欧美一级特黄在线播放| 中文字幕佐山爱一区二区免费| 免费观看在线色综合| 91在线小视频| 欧美精品一区二区精品网| 亚洲欧美综合网| 久久精品国产77777蜜臀| 成人av影院在线| 日韩视频免费直播| 夜夜嗨av一区二区三区网页| 国产精品夜夜嗨| 91精品免费观看| 一区二区三区影院| 国产成人在线视频网站| 欧美一区二区三区影视| 一区二区三区四区av| 成人app网站| 日韩亚洲欧美在线观看| 亚洲高清一区二区三区| 成人av在线播放网站| 精品国产乱码久久久久久蜜臀| 一区二区三区视频在线看| 国产成人免费在线观看| 日韩美一区二区三区| 一区二区三区丝袜| 色综合色狠狠天天综合色| 国产日韩欧美麻豆| 久久精品国产99| 日韩一区二区三区视频在线| 亚洲一区二区三区自拍| 91美女蜜桃在线| 国产精品乱码一区二区三区软件| 国产尤物一区二区在线| 精品欧美乱码久久久久久1区2区| 亚洲成人资源网| 欧美视频三区在线播放| 亚洲综合色噜噜狠狠| 91蜜桃在线观看| 亚洲精品国产a| 色哟哟一区二区| 亚洲激情一二三区| 91理论电影在线观看| 亚洲色大成网站www久久九九| 成人一道本在线| 国产精品美女久久久久久| 成人小视频免费观看| 国产精品久久久久7777按摩| 国产1区2区3区精品美女| 久久久久9999亚洲精品| 国产成人综合在线观看| 国产清纯白嫩初高生在线观看91 | 久久久久久久久久久电影| 国产一区二区三区国产| 久久精品一区二区| 成人深夜在线观看| 国产精品麻豆99久久久久久| 91免费在线视频观看| 亚洲精品va在线观看| 欧美三级电影一区| 三级在线观看一区二区| 日韩精品一区二区三区视频播放 | 亚洲少妇30p| 在线亚洲高清视频| 亚洲成av人片在线观看| 日韩欧美电影一区| 国产大陆a不卡| 亚洲黄色录像片| 欧美人妖巨大在线| 精品一区二区三区蜜桃| 中文久久乱码一区二区| 91九色02白丝porn| 奇米影视7777精品一区二区| 久久久精品国产99久久精品芒果| eeuss鲁片一区二区三区在线观看| 亚洲青青青在线视频| 欧美精品色综合| 国产一区二三区| 亚洲欧美aⅴ...| 91麻豆精品国产自产在线| 国产一区二区三区在线观看精品 |