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

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

?? interrup.c

?? s3c2440 WINCE 5.00 官方bsp
?? 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


volatile S3C2440A_IOPORT_REG * 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一区二区三区免费野_久草精品视频
久久精品一区二区三区不卡牛牛 | 亚洲码国产岛国毛片在线| 国产精品美女一区二区三区 | 欧美色偷偷大香| 欧美一级一区二区| 国产亚洲一区二区三区| 曰韩精品一区二区| 精品在线你懂的| 97久久超碰国产精品电影| 欧美老女人第四色| 国产精品午夜在线| 日韩国产欧美在线播放| 成人夜色视频网站在线观看| 在线观看日韩精品| 久久久久久久久免费| 亚洲一区中文在线| 国产成人午夜片在线观看高清观看| 色一情一乱一乱一91av| 久久蜜桃av一区二区天堂| 一区二区三区在线观看视频| 狠狠色2019综合网| 欧美性猛交一区二区三区精品 | a级高清视频欧美日韩| 3d成人h动漫网站入口| 国产精品日韩精品欧美在线| 青青草成人在线观看| a亚洲天堂av| 精品国产区一区| 亚洲国产精品久久久久婷婷884 | 亚洲欧美一区二区三区久本道91| 久久精品国产精品亚洲综合| 色94色欧美sute亚洲线路二| 国产欧美日韩另类一区| 免费不卡在线视频| 欧美性大战久久久久久久蜜臀| 国产视频911| 久久精品国产第一区二区三区| 欧美在线一二三四区| 中文av一区二区| 国产一区二区精品久久| 666欧美在线视频| 亚洲一区电影777| 97精品久久久午夜一区二区三区| 久久久影院官网| 麻豆91小视频| 91.com在线观看| 亚洲国产精品一区二区www在线| 99精品视频一区二区三区| 久久夜色精品国产欧美乱极品| 午夜av电影一区| 在线观看视频一区二区| 中文字幕在线不卡国产视频| 国产成人自拍在线| 欧美精品一区在线观看| 久久精品免费观看| 制服丝袜激情欧洲亚洲| 午夜私人影院久久久久| 欧美图片一区二区三区| 亚洲最色的网站| 日本韩国欧美一区二区三区| 亚洲欧美日韩中文字幕一区二区三区| 国产成人午夜精品影院观看视频| 精品国产99国产精品| 日韩av网站免费在线| 5566中文字幕一区二区电影| 亚洲国产日产av| 精品视频在线免费观看| 亚洲一二三四在线观看| 欧美午夜精品电影| 亚洲h在线观看| 欧美久久久一区| 免费在线看成人av| 91精品国产一区二区人妖| 青椒成人免费视频| 日韩欧美另类在线| 国产在线麻豆精品观看| 国产网红主播福利一区二区| 成人午夜私人影院| 国产精品久久久久久久久免费相片| 成人动漫精品一区二区| 亚洲视频香蕉人妖| 欧美视频在线一区二区三区 | 日韩欧美国产综合一区| 免费美女久久99| 久久男人中文字幕资源站| 国产一区二区三区视频在线播放| 久久精品免费在线观看| 粉嫩av一区二区三区粉嫩 | 欧美午夜理伦三级在线观看| 亚洲一区视频在线| 欧美一区二区美女| 国产丶欧美丶日本不卡视频| 中文字幕一区二区三区视频| 欧美在线|欧美| 日韩综合小视频| 久久午夜羞羞影院免费观看| 成人av片在线观看| 亚洲午夜久久久久久久久久久| 88在线观看91蜜桃国自产| 久久草av在线| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲精品高清视频在线观看| 精品视频在线免费看| 美女性感视频久久| 欧美激情在线看| 在线中文字幕不卡| 麻豆视频一区二区| 国产精品久久久久影院| 欧美日韩精品一区二区三区| 久久国产免费看| 亚洲欧洲美洲综合色网| 91.com视频| 成人免费视频一区| 亚洲国产另类av| 国产亚洲短视频| 在线观看亚洲一区| 国产一区二区0| 亚洲精品国产第一综合99久久| 日韩一级片在线播放| 99热精品一区二区| 美女视频黄频大全不卡视频在线播放| 久久一区二区三区四区| 欧洲一区在线观看| 国产一区二区精品久久| 亚洲夂夂婷婷色拍ww47| 久久午夜色播影院免费高清 | 日本成人在线视频网站| 国产精品国产三级国产普通话99| 91精品国产乱| 91在线免费播放| 国产老妇另类xxxxx| 亚洲国产日韩在线一区模特| 国产偷v国产偷v亚洲高清| 欧美日韩国产欧美日美国产精品| 国产精品中文有码| 日韩电影免费在线观看网站| 国产精品色婷婷| 欧美成人欧美edvon| 国产传媒日韩欧美成人| 欧美一区二区三区视频免费 | 精品国产乱码久久久久久蜜臀| 日韩欧美资源站| 中文字幕在线播放不卡一区| 裸体一区二区三区| 91久久精品午夜一区二区| 一区二区三区在线视频播放| 色综合久久66| 国产精品久久久久四虎| 亚洲h动漫在线| 91视频免费观看| 亚洲精品乱码久久久久久久久| 成人中文字幕合集| 国产欧美一区二区三区鸳鸯浴| 亚洲已满18点击进入久久| 国产成人精品一区二 | 日本成人在线不卡视频| 97久久精品人人爽人人爽蜜臀 | 欧美久久婷婷综合色| 国产精品女同互慰在线看| 久久9热精品视频| 欧美成人精精品一区二区频| 亚洲综合小说图片| 91精品国产综合久久精品麻豆| 日本一区二区三区在线观看| 亚洲午夜精品17c| 国产91综合网| 日韩一卡二卡三卡国产欧美| 亚洲欧美自拍偷拍色图| 国内精品免费**视频| 91黄色免费观看| 日韩精品电影在线| 亚洲婷婷综合久久一本伊一区| 国产福利一区二区三区| 久久在线免费观看| 337p亚洲精品色噜噜噜| 欧美专区在线观看一区| 色综合亚洲欧洲| 成人亚洲一区二区一| 国产毛片精品视频| 九色综合国产一区二区三区| 国内精品久久久久影院一蜜桃| 欧美aaa在线| 日韩一区精品字幕| 午夜精品久久久| 日韩中文字幕1| 午夜精品免费在线| 亚洲宅男天堂在线观看无病毒| 1024亚洲合集| 日韩一区二区三区电影| 欧美人与z0zoxxxx视频| 91视频你懂的| 色伊人久久综合中文字幕| 91免费国产视频网站| 99久久99久久久精品齐齐| 成人听书哪个软件好| 国产1区2区3区精品美女| 国产成人av电影在线| 成人性色生活片| 成人性视频免费网站| 在线视频国内一区二区|