在oallib/intr/intr.c里使能了外部中断:
OALIntrStaticTranslate(SYSINTR_ETH, IRQ_EINT15); value = IRQ_EINT15; OALIntrEnableIrqs(1, &value);
注册网卡能成功,注册中断也能成功,代码如下: NdisZeroMemory (&Characteristics, sizeof (Characteristics)); Characteristics.MajorNdisVersion = (UCHAR)SMSC9118_NDIS_MAJOR_VERSION; Characteristics.MinorNdisVersion = (UCHAR)SMSC9118_NDIS_MINOR_VERSION; Characteristics.CheckForHangHandler = Smsc9118CheckForHang; Characteristics.DisableInterruptHandler = smscDisableIntr; Characteristics.EnableInterruptHandler = smscEnableIntr; Characteristics.HaltHandler = Smsc9118Halt; Characteristics.HandleInterruptHandler = Smsc9118HandleInterrupt; Characteristics.InitializeHandler = Smsc9118Initialize; Characteristics.ISRHandler = Smsc9118Isr; Characteristics.QueryInformationHandler = Smsc9118QueryInformation; Characteristics.ReconfigureHandler = NULL; Characteristics.ResetHandler = Smsc9118Reset; Characteristics.SendHandler = NULL; Characteristics.SetInformationHandler = Smsc9118SetInformation; Characteristics.TransferDataHandler = NULL; Characteristics.ReturnPacketHandler = Smsc9118GetReturnedPackets; Characteristics.SendPacketsHandler = Smsc9118SendPackets; Characteristics.AllocateCompleteHandler = NULL; Status = NdisMRegisterMiniport (gSmsc9118MiniportBlock.NdisWrapperHandle, &Characteristics, sizeof (Characteristics)); if (Status == NDIS_STATUS_SUCCESS) { SMSC_TRACE0(DBG_INIT, "NdisMRegisterMiniport OK.\r\n"); } ---------------------------------------- status = NdisMRegisterInterrupt (&(pAdapter->Interrupt), pAdapter->hMiniportAdapterHandle, (UINT)pAdapter->ucInterruptNumber, (UINT)0xf, (BOOLEAN)TRUE, (BOOLEAN)TRUE, NdisInterruptLatched); if (status == NDIS_STATUS_SUCCESS) { SMSC_TRACE0(DBG_INIT," Interrupt Connected\r\n"); }
========================================== 当有中断来时,在common/intr/intr.c里能打印出中断号,但是始终进不了我的中断服务程序,而且,中断一来就被屏蔽了。
请问:可能是什么地方出了问题?
,问题不在代码,在注册表,在注册表里网卡的相应位置增加一个对应的中断号就可以了:
"SysIntr"=dword:23
|