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

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

?? interrup.c

?? windows ce 50 drive program
?? C
字號:
/*++
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
Copyright (c) 1995-1998  Microsoft Corporation

Module Name:

    interrupt.c

Abstract:

    This is a part of the driver for the Cirrus Logic CS8900
    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.

--*/

#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

extern volatile IOPreg *v_pIOPRegs;
extern unsigned long *EthCommand;
//
// This is used to pad short packets.
//
static UCHAR BlankBuffer[60] = "                                                            ";

void CS8900ReceiveEvent(PCS8900_ADAPTER Adapter, unsigned short RxEvent)
{
#if	WINCEDEBUG
	unsigned short i;
#endif
	unsigned short Length, Type;
	unsigned short *pBuffer;
	unsigned short *pBufferLimit;
	unsigned char  *cptr;
	WORD PacketOper;
	
	DEBUGMSG(0, (TEXT("++CS8900ReceiveEvent\r\n")));

	// Verify that it is an RxOK event
	if (!(RxEvent & RX_EVENT_RX_OK))
	{
		DEBUGMSG(1, (TEXT("CS8900ReceiveEvent: Receive Currupted Packet!\r\n")));
		return;
	}

	readIoPort(IO_RX_TX_DATA_0);				// Discard RxStatus
	Length = readIoPort(IO_RX_TX_DATA_0);

	pBuffer = (unsigned short *)Adapter->Lookahead;
	pBufferLimit = (unsigned short *)Adapter->Lookahead + (Length + 1) / 2;
	while (pBuffer < pBufferLimit)
	{
		*pBuffer = readIoPort(IO_RX_TX_DATA_0);
		pBuffer++;
	}

	pBuffer = (unsigned short *)Adapter->Lookahead;
	Type = pBuffer[6];
	PacketOper = pBuffer[10];

	if (Type == 0x0608)
	{
		if (PacketOper == 0x0100)
			DEBUGMSG(1, (TEXT("[CS8900] Receive ARP Request Packet\r\n")));
		else if (PacketOper == 0x0200)
			DEBUGMSG(1, (TEXT("[CS8900] Receive ARP Response Packet\r\n")));
		else if (PacketOper == 0x0300)
			DEBUGMSG(1, (TEXT("[CS8900] Receive RARP Request Packet\r\n")));
		else if (PacketOper == 0x0400)
			DEBUGMSG(1, (TEXT("[CS8900] Receive RARP Response Packet\r\n")));
		else
			DEBUGMSG(1, (TEXT("[CS8900] Receive Unknown ARP Packet\r\n")));
	}
	else if (Type == 0x0008)
		DEBUGMSG(1, (TEXT("[CS8900] Receive IP Packet\r\n")));

	cptr = (unsigned char *)Adapter->Lookahead;

#if	WINCEDEBUG
	DEBUGMSG(1, (TEXT("type = %x, length = %x\r\n"), Type, Length));
	for (i=0; i<Length; i++)
		DEBUGMSG(1, (TEXT("%x "), *cptr++));
	DEBUGMSG(1, (TEXT("\r\n")));
#endif

	cptr = (unsigned char *)Adapter->Lookahead;

	NdisMEthIndicateReceive(
		Adapter->MiniportAdapterHandle,
		(NDIS_HANDLE)Adapter,
		(PCHAR)(Adapter->Lookahead),
		CS8900_HEADER_SIZE,
		(PCHAR)(cptr)+CS8900_HEADER_SIZE,
		Length - CS8900_HEADER_SIZE,
		Length - CS8900_HEADER_SIZE);

	NdisMEthIndicateReceiveComplete(Adapter->MiniportAdapterHandle);

	return;
}

#if 0

VOID
CS8900EnableInterrupt(
    IN NDIS_HANDLE MiniportAdapterContext
    )

/*++

Routine Description:

    This routine is used to turn on the interrupt mask.

Arguments:

    Context - The adapter for the CS8900 to start.

Return Value:

    None.

--*/

{
    PCS8900_ADAPTER Adapter = (PCS8900_ADAPTER)(MiniportAdapterContext);

    DEBUGMSG(1, (TEXT("CS8900EnableInterrupt is called!!!\r\n")));

	v_pIOPRegs->rEINTMASK &= ~(1<<9);	// EINT9
}



VOID
CS8900DisableInterrupt(
    IN NDIS_HANDLE MiniportAdapterContext
    )

/*++

Routine Description:

    This routine is used to turn off the interrupt mask.

Arguments:

    Context - The adapter for the CS8900 to start.

Return Value:

    None.

--*/

{
    PCS8900_ADAPTER Adapter = (PCS8900_ADAPTER)(MiniportAdapterContext);

    DEBUGMSG(1, (TEXT("CS8900DisableInterrupt is called!!!\r\n")));

	v_pIOPRegs->rEINTMASK |= (1<<9);		// EINT9
}

#endif 

VOID
CS8900Isr(
    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.
--*/

{
#undef NODPC
#ifdef NODPC
	unsigned short Event;
#endif
    PCS8900_ADAPTER Adapter = ((PCS8900_ADAPTER)Context);

    *InterruptRecognized = TRUE;
#ifdef NODPC
	*QueueDpc = FALSE;
#else
	*QueueDpc = TRUE;
#endif

#ifdef NODPC
	Event = CS8900ReadRegister(PKTPG_ISQ);

	DEBUGMSG(1, (TEXT("++CS8900Isr event=%x\r\n"), Event));

	while (Event != 0)
	{
		switch (Event & REG_NUM_MASK)
		{
			case REG_NUM_RX_EVENT:
				DEBUGMSG(1, (TEXT("RX\r\n")));
				CS8900ReceiveEvent(Adapter, Event);
				break;

			case REG_NUM_TX_EVENT:
				DEBUGMSG(1, (TEXT("TX\r\n")));
				break;

			case REG_NUM_BUF_EVENT:
				DEBUGMSG(1, (TEXT("BUF\r\n")));
				break;
				
			case REG_NUM_RX_MISS:
				DEBUGMSG(1, (TEXT("CS8900Isr:RX_MISS!\r\n")));
				break;			
				
			case REG_NUM_TX_COL:
				break;
		}
		
		Event = CS8900ReadRegister(PKTPG_ISQ);

		DEBUGMSG(1, (TEXT("event=%x\r\n"), Event));
	}
#endif
    DEBUGMSG(1, (TEXT("CS8900Isr is called!!!\r\n")));
}


VOID
CS8900HandleInterrupt(
    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
    //
    PCS8900_ADAPTER Adapter = ((PCS8900_ADAPTER)MiniportAdapterContext);

	unsigned short Event;

	Event = CS8900ReadRegister(PKTPG_ISQ);

	DEBUGMSG(1, (TEXT("++CS8900HandleInterrupt event=%x\r\n"), Event));

	while (Event != 0)
	{
		switch (Event & REG_NUM_MASK)
		{
			case REG_NUM_RX_EVENT:
				DEBUGMSG(1, (TEXT("RX\r\n")));
				CS8900ReceiveEvent(Adapter, Event);
				break;

			case REG_NUM_TX_EVENT:
				DEBUGMSG(1, (TEXT("TX\r\n")));
				break;

			case REG_NUM_BUF_EVENT:
				DEBUGMSG(1, (TEXT("BUF\r\n")));
				break;
				
			case REG_NUM_RX_MISS:
				DEBUGMSG(1, (TEXT("CS8900HandleInterrupt:RX_MISS!\r\n")));
				break;			
				
			case REG_NUM_TX_COL:
				break;
		}
		
		Event = CS8900ReadRegister(PKTPG_ISQ);

		DEBUGMSG(1, (TEXT("event=%x\r\n"), Event));
	}

	DEBUGMSG(1, (TEXT("--CS8900HandleInterrupt\r\n")));
}


NDIS_STATUS
CS8900TransferData(
    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 CS8900TransferData 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.

--*/

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

	DEBUGMSG(1, (TEXT("+CS8900:CS8900TransferData\r\n")));
	while(1);

    return(NDIS_STATUS_SUCCESS);
}


NDIS_STATUS
CS8900Send(
    IN NDIS_HANDLE MiniportAdapterContext,
    IN PNDIS_PACKET Packet,
    IN UINT Flags
    )

/*++

Routine Description:


    The CS8900Send request instructs a driver to transmit a packet through
    the adapter onto the medium.

Arguments:

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

    Packet - A pointer to a descriptor for the packet that is to be
    transmitted.

    SendFlags - Optional send flags

Notes:

    This miniport driver will always accept a send.  This is because
    the CS8900 has limited send resources and the driver needs packets
    to copy to the adapter immediately after a transmit completes in
    order to keep the adapter as busy as possible.

    This is not required for other adapters, as they have enough
    resources to keep the transmitter busy until the wrapper submits
    the next packet.

--*/

{
	ULONG	Len;
	PUCHAR	CurBufAddress;
	UCHAR	TotalPacket[2048];

	PNDIS_BUFFER CurBuffer;
	
	UINT	i;
	UINT	Count = 0;
	UINT	CurBufLen;
	UINT	PacketLength;
	USHORT	BusStatus;

	PCS8900_ADAPTER Adapter = (PCS8900_ADAPTER)(MiniportAdapterContext);

	DEBUGMSG(1, (TEXT("CS8900Send\r\n")));	

	NdisQueryPacket(
		Packet,
		NULL,
		NULL,
		NULL,
		&Len
		);

	NdisQueryPacket(Packet, NULL, NULL, &CurBuffer, &PacketLength);
	NdisQueryBuffer(CurBuffer, (PVOID *)&CurBufAddress, &CurBufLen);

	for (i = 0; i < CurBufLen; i++)
		TotalPacket[Count++] = CurBufAddress[i];

	NdisGetNextBuffer(CurBuffer, &CurBuffer);
	while (CurBuffer && (CurBufLen != 0))
	{
		NdisQueryBuffer(CurBuffer, (PVOID *)&CurBufAddress, &CurBufLen);

		for (i = 0; i < CurBufLen; i++)
		{
			TotalPacket[Count++] = CurBufAddress[i];
		}

		NdisGetNextBuffer(CurBuffer, &CurBuffer);
	}

	// Request that a transmit be started
	BusStatus = CS8900RequestTransmit(PacketLength);
		
	// If there was an error with the transmit bid
	if (BusStatus & BUS_ST_TX_BID_ERR)
	{
		DEBUGMSG(1, (TEXT("##### BUS_ST_TX_BID_ERR #####\r\n")));
	}
	else if (BusStatus & BUS_ST_RDY4TXNOW)
	{
		// The chip is ready for transmission now
		// Copy the message to the chip to start the transmit
		CS8900CopyTxFrame((PCHAR)TotalPacket, PacketLength);
		return(NDIS_STATUS_SUCCESS);
	}
	return(NDIS_STATUS_FAILURE);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91麻豆文化传媒在线观看| 不卡视频在线看| 91精品福利视频| 亚洲人亚洲人成电影网站色| 99久久国产综合色|国产精品| 国产精品美女久久久久aⅴ| 欧美日韩国产三级| 日本最新不卡在线| 久久久精品黄色| 成人激情电影免费在线观看| 成人欧美一区二区三区| 91福利在线看| 秋霞午夜av一区二区三区| 精品福利av导航| 大陆成人av片| 亚洲一卡二卡三卡四卡无卡久久 | 精品粉嫩aⅴ一区二区三区四区| 青青草成人在线观看| 久久先锋资源网| 色综合久久综合| 看电影不卡的网站| 中文字幕在线一区二区三区| 欧美视频一区二区三区四区| 韩国欧美国产1区| 中文字幕综合网| 欧美精品三级在线观看| 国产69精品一区二区亚洲孕妇 | 亚洲免费观看高清在线观看| 欧美精品tushy高清| 大陆成人av片| 日本成人在线视频网站| 亚洲人成人一区二区在线观看 | 精品国产凹凸成av人网站| 成人sese在线| 日韩成人精品在线观看| 亚洲婷婷在线视频| 日韩欧美一级二级| 欧美最猛性xxxxx直播| 黄色日韩网站视频| 亚洲国产中文字幕| 国产精品无圣光一区二区| 欧美片网站yy| 94-欧美-setu| 国产成人激情av| 日本va欧美va精品发布| 亚洲日韩欧美一区二区在线| 精品国内二区三区| 777色狠狠一区二区三区| 97久久精品人人做人人爽| 久久国产乱子精品免费女| 亚洲高清不卡在线| 中文字幕在线一区二区三区| 精品成人一区二区| 欧美一级精品在线| 欧美猛男超大videosgay| av毛片久久久久**hd| 国产在线精品国自产拍免费| 视频在线观看91| 亚洲午夜一区二区| 亚洲精品日日夜夜| 中文字幕日韩欧美一区二区三区| 欧美精品一区二区三区在线播放| 6080国产精品一区二区| 欧美中文字幕不卡| 日本道精品一区二区三区 | 在线日韩一区二区| 成人黄页毛片网站| 大尺度一区二区| 丰满白嫩尤物一区二区| 韩国女主播一区二区三区| 精品制服美女久久| 久久精品国产在热久久| 蜜臀av国产精品久久久久| 天堂久久一区二区三区| 亚洲午夜久久久久久久久久久 | 中文一区二区完整视频在线观看| 精品国产成人系列| 久久午夜老司机| 久久色.com| 国产午夜精品理论片a级大结局 | 一区二区成人在线| 亚洲一区二区三区四区五区黄| 亚洲精品伦理在线| 午夜免费久久看| 三级欧美在线一区| 精品写真视频在线观看 | 日本午夜精品视频在线观看| 视频一区欧美日韩| 另类调教123区| 国产米奇在线777精品观看| 国产91在线观看丝袜| 91免费视频网| 欧美亚洲综合网| 日韩小视频在线观看专区| 欧美xxxxx牲另类人与| 中文字幕不卡三区| 亚洲一区二区三区视频在线| 青青草成人在线观看| 高清在线观看日韩| 日本伦理一区二区| 欧美大尺度电影在线| 国产精品视频九色porn| 一区二区三区视频在线观看| 美腿丝袜亚洲综合| www.亚洲精品| 欧美一区二区成人| 国产精品久久久久久妇女6080| 一区二区三区中文字幕精品精品 | 日韩久久一区二区| 香蕉加勒比综合久久| 国产一区二区美女诱惑| 色综合天天综合网国产成人综合天 | 欧美妇女性影城| 国产色综合一区| 亚洲综合偷拍欧美一区色| 久久国产人妖系列| 91欧美激情一区二区三区成人| 欧美日韩在线播放三区四区| 久久综合给合久久狠狠狠97色69| 国产精品美女久久久久久| 亚洲高清一区二区三区| 国内成人精品2018免费看| av欧美精品.com| 国产一区中文字幕| 91网址在线看| 国产欧美一区在线| 精品在线视频一区| 色综合天天综合色综合av| 日韩亚洲欧美在线观看| 亚洲综合网站在线观看| 成人在线视频首页| 91精品国产欧美一区二区成人 | 91成人在线精品| www国产成人免费观看视频 深夜成人网| 欧美不卡一区二区三区| 亚洲国产精品ⅴa在线观看| 日韩专区一卡二卡| 99久久伊人久久99| 欧美xxxx在线观看| 一区二区在线看| 国产精品99精品久久免费| 91麻豆精品91久久久久同性| 亚洲欧美国产三级| 国产成人亚洲精品青草天美| 日韩三区在线观看| 亚洲福利视频导航| 亚洲免费观看在线观看| 亚洲欧洲日本在线| 久久99国产精品免费| 一本一道波多野结衣一区二区| 精品国产乱码久久久久久图片| 99久久久国产精品| 久久人人97超碰com| 中文字幕欧美一区| av午夜精品一区二区三区| 亚洲精品国产精品乱码不99| 日本韩国精品在线| 日韩高清在线电影| 欧美v日韩v国产v| 国产一区二区三区免费播放 | 国产精品国产三级国产aⅴ入口 | 欧美激情在线一区二区| 91偷拍与自偷拍精品| 亚洲一区二区av在线| 精品国产一二三区| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 99re亚洲国产精品| 久久亚洲精品小早川怜子| 91精品国产欧美一区二区18| 日本精品一区二区三区高清 | 久久精工是国产品牌吗| 日韩美女视频一区二区| 最新欧美精品一区二区三区| 国产日韩欧美一区二区三区乱码 | 国产成人在线观看| 国产精品久久久久久久久久免费看 | 久久精品水蜜桃av综合天堂| 99re热视频这里只精品| 天堂av在线一区| 国产三级精品视频| 欧美三级在线视频| 国内成人精品2018免费看| 中文字幕字幕中文在线中不卡视频| 欧美日韩国产片| 成人在线综合网| 日韩高清一区在线| 国产精品电影一区二区三区| 欧美日韩精品免费观看视频| 国产精品羞羞答答xxdd| 亚洲成人三级小说| 中文字幕av在线一区二区三区| 69成人精品免费视频| caoporn国产精品| 日本午夜一区二区| 亚洲精品网站在线观看| 久久久久久久久久久久电影 | 国产精品丝袜一区| 欧美哺乳videos| 欧美艳星brazzers| av中文字幕不卡|