Hi to all,
I've developed my own PCI driver for our own PCI board (Motor
Controller), this board is plugged into an Advantech VIA Eden CEPC
Board with our own WinCE 4.2 image. The image is standalone and boots
with biosloader (with no KITL transport included, only TCP/IP
transport and Manual Server).
Now we are developing the application (with eVC++ 4.0 SP2) that uses
the driver to manage the PCI board, we are debugging the app conecting
with the target through TCP/IP transport and Manual Server (Using a
telnet session to execute the command line).
We have the following problem: sometimes, when I call the IOCTL that
installs the ISR for my PCI driver, the TCP/IP conection is lost.
Using PCIENUM utility I saw that the problem only happens when the IRQ
allocated for my PCI board is the same as the one used by the ethernet
board.
So, my question is: Is the problen happening due to a wrong ISR
instalation? Or a wrong call to LoadIntChainHandler?(Following is my
driver source code por IRQ allocation).
///////////////// SNIP
//////////////////////////////////////////////////////
DDKISRINFO IsrInfo;
GIISR_INFO DataIsr
HANDLE hIsr;
HANDLE hevent;
HANDLE hthread;
IsrInfo.cbSize = sizeof(IsrInfo);
DDKReg_GetIsrInfo(hRegEntry, &IsrInfo);
hIsr = LoadIntChainHandler(IsrInfo.szIsrDll,IsrInfo.szIsrHandler,(BYTE)IsrInfo.dwIrq);
DataIsr.SysIntr = IsrInfo.dwSysintr;
// Stuff loading GIISR the rest of information in DataIsr....
KernelLibIoControl(hIsr, IOCTL_GIISR_INFO, &DataIsr, sizeof(DataIsr),
NULL, 0, &kioreturned);
hevent = CreateEvent(NULL, FALSE, FALSE, NULL);
InterruptDisable(DataIsr.SysIntr);
InterruptInitialize(DataIsr.SysIntr, hevent, NULL, NULL);
hthread = CreateThread(NULL,0,Driver_IST,&hevent,0,NULL);
CeSetThreadPriority(DevData.hThread, 0);
////// IST Sorce Code: ////////
DWORD WINAPI Driver_IST(LPVOID lpArg)
{
HANDLE phev;
DWORD intreg;
phev = *(HANDLE *)lpArg;
while(!Global_Abort)
{
WaitForSingleObject(phev, INFINITE);
if(!Global_Abort)
{
SetEvent(ThDevData->hAppEvent);
InterruptDone(ThDevData->DatosIsr.SysIntr);
}
}
return 0;
}
//////////////// END SNIP
//////////////////////////////////////////////
Any suggestion will be appreciated.
Thanks in advance for your help.
Best Regards,
Juan.