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

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

?? interrup.c

?? 使用網(wǎng)絡驅(qū)動器接口標準開發(fā)的ne2000網(wǎng)卡的NT驅(qū)動.
?? 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一区二区三区免费野_久草精品视频
亚洲成人综合视频| 亚洲成人第一页| 欧美日韩一级黄| 九色综合狠狠综合久久| 亚洲日本va在线观看| 精品国产乱码久久久久久1区2区 | 91在线视频网址| 亚洲www啪成人一区二区麻豆| 久久久久国产免费免费 | 国产欧美一区在线| 色婷婷久久久综合中文字幕| 久久99精品久久久久| 亚洲国产精品久久久男人的天堂 | 亚洲精品成人天堂一二三| 精品日韩在线一区| 欧美日韩激情一区二区三区| 99精品视频中文字幕| 国产福利不卡视频| 蜜桃视频一区二区| 日韩一区精品视频| 亚洲一区日韩精品中文字幕| 亚洲三级在线看| 国产精品色在线观看| 国产午夜久久久久| 久久色视频免费观看| 日韩一本二本av| 欧美精品第一页| 欧美日韩另类国产亚洲欧美一级| 国产综合成人久久大片91| 蜜桃视频免费观看一区| 日本欧美肥老太交大片| 午夜久久久久久久久| 洋洋av久久久久久久一区| 亚洲免费观看高清完整版在线观看| 欧美激情一区二区在线| 国产清纯白嫩初高生在线观看91 | 亚洲一区二区在线免费看| 亚洲日本电影在线| 亚洲精品视频在线观看网站| 一区免费观看视频| 一区二区在线观看免费视频播放| 国产精品国产成人国产三级| 中文字幕日韩欧美一区二区三区| 久久久精品tv| 欧美极品美女视频| 亚洲欧美在线观看| 洋洋成人永久网站入口| 亚洲图片欧美综合| 五月综合激情日本mⅴ| 日韩精品一级中文字幕精品视频免费观看| 午夜久久福利影院| 美国欧美日韩国产在线播放| 国产一区二区不卡在线| 成人av集中营| 一本久久a久久免费精品不卡| 色av成人天堂桃色av| 欧美色爱综合网| 日韩欧美一卡二卡| 亚洲国产精品高清| 亚洲黄色片在线观看| 婷婷中文字幕综合| 国产精品一级黄| 日本高清不卡在线观看| 91精品国产综合久久久蜜臀图片| 日韩欧美电影一二三| 欧美国产1区2区| 亚洲精品免费电影| 日本欧美一区二区在线观看| 国产一区二区三区精品视频| 99久免费精品视频在线观看| 欧美美女视频在线观看| 26uuu精品一区二区三区四区在线| 欧美国产乱子伦| 婷婷开心激情综合| 国产成人精品免费视频网站| 91社区在线播放| 欧美一区二区精品在线| 中文字幕 久热精品 视频在线| 亚洲一区二区三区四区中文字幕| 喷水一区二区三区| 成人av免费观看| 777xxx欧美| 日韩久久一区二区| 另类专区欧美蜜桃臀第一页| 不卡av在线免费观看| 91精品麻豆日日躁夜夜躁| 中文字幕第一区第二区| 亚洲国产毛片aaaaa无费看| 国产乱对白刺激视频不卡| 欧美在线你懂得| 久久精品人人做人人综合| 亚洲va国产va欧美va观看| 国产成a人亚洲精品| 欧美精品在欧美一区二区少妇| 国产人伦精品一区二区| 丝袜美腿成人在线| 91美女在线观看| 久久久久国产一区二区三区四区| 亚洲国产成人高清精品| 成人性生交大片免费看中文 | 捆绑调教美女网站视频一区| 色吧成人激情小说| 久久综合999| 喷水一区二区三区| 在线一区二区视频| 国产日韩欧美高清在线| 久久狠狠亚洲综合| 51久久夜色精品国产麻豆| 中文字幕一区二区日韩精品绯色| 另类小说一区二区三区| 欧美日韩精品一区二区三区蜜桃| 亚洲欧美视频在线观看| 国产福利一区二区三区视频| 日韩三级精品电影久久久 | 中文成人综合网| 久久国产精品第一页| 欧美剧在线免费观看网站| 一区二区三区在线视频观看| 成人av电影观看| 国产欧美日韩三级| 岛国精品一区二区| 国产精品私人影院| 国产毛片精品视频| 久久久久久久久免费| 国模冰冰炮一区二区| 久久综合色鬼综合色| 美女网站色91| 欧美成人一区二区三区在线观看| 免费日本视频一区| 91精品欧美一区二区三区综合在| 亚洲成va人在线观看| 欧美丝袜丝nylons| 婷婷激情综合网| 666欧美在线视频| 蜜臀av一区二区| 日韩欧美国产不卡| 国产在线播精品第三| 国产嫩草影院久久久久| 成人黄色综合网站| 国产精品国模大尺度视频| 91无套直看片红桃| 亚洲自拍偷拍网站| 欧美高清视频www夜色资源网| 亚洲18影院在线观看| 日韩欧美中文一区二区| 国产精品一区二区久久不卡| 国产日产精品一区| 91影院在线观看| 亚洲成人你懂的| 日韩欧美aaaaaa| 国产精品1区2区| 最新中文字幕一区二区三区| 日本韩国欧美一区二区三区| 亚洲成人第一页| 精品精品国产高清a毛片牛牛| 黄色日韩三级电影| 国产欧美日韩卡一| 欧洲亚洲国产日韩| 老司机精品视频在线| 国产嫩草影院久久久久| 一本色道久久加勒比精品| 首页亚洲欧美制服丝腿| 精品久久久久一区| 成人av在线电影| 午夜婷婷国产麻豆精品| 26uuu色噜噜精品一区二区| www.视频一区| 亚洲国产综合视频在线观看| 精品国产电影一区二区| 9色porny自拍视频一区二区| 亚洲一区二区三区小说| 亚洲精品一区二区三区影院| 99久久久久免费精品国产| 日本伊人色综合网| 亚洲国产精品av| 欧美日韩色综合| 国产999精品久久| 亚洲国产精品自拍| 久久精品一区二区三区四区| 91麻豆国产自产在线观看| 美女爽到高潮91| 亚洲久草在线视频| 精品国产成人系列| 欧美性受极品xxxx喷水| 国产伦精品一区二区三区在线观看 | av福利精品导航| 久久99国产精品久久99果冻传媒| 中文字幕亚洲一区二区va在线| 91精品国产综合久久精品图片| 成人午夜精品一区二区三区| 日韩国产欧美视频| 亚洲天堂福利av| 精品久久五月天| 欧洲国内综合视频| 成人免费黄色大片| 另类小说图片综合网| 亚洲国产一区二区三区| 欧美国产精品一区二区| 精品国产乱码久久久久久免费| 欧美性xxxxxxxx|