Hi,
I am using smsc9118 nic driver for my pxa270,wince 5.0 device.i am
writing an application to set a wake up pattern for arp and code is as
follows.The problem is that i am not able to get the correct
masksize,patternoffset,patternsize,..etc in the ethernet driver.i am
always getting the error.
A device attached to the system is not functioning.
ERROR_GEN_FAILURE .One thing i noted is that while loading my ethernet
driver it is getting some pattern and coming to
OID_PNP_ADD_WAKE_UP_PATTERN.
can you please help me .


void ByteMask(DWORD,BYTE*);
UCHAR SetBuffer[sizeof(NDISUIO_SET_OID)+sizeof(DWORD)];

typedef struct _WAKEUP_FRAME
{
NDIS_PM_PACKET_PATTERN PmPattern;
BYTE Byte_mask[6];
DWORD dwPattern[24];
}WAKEUP_FRAME;
WAKEUP_FRAME WakeFrame= { {0x0,0x0,0x6,0x1E,0x15,0x0},
{0,2,03,0,0,0},
{0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x08,0x06,0x0,0x00,0x00,0x00,0x00,0x00,0x00,0x01}

pSetOid = (PNDISUIO_SET_OID)&SetBuffer[0];
pSetOid->Oid = OID_PNP_ADD_WAKE_UP_PATTERN; //
Custom OID;
pSetOid->ptcDeviceName = DeviceName; // You dont need this
once you

*((ULONG *)(pSetOid->Data)) = (ULONG)&WakeFrame;

RETAILMSG(1,(TEXT("Wake Frame Adress=%X \r\n"),&WakeFrame));

hNdis = CreateFile(NDISUIO_DEVICE_NAME, GENERIC_READ | GENERIC_WRITE,
FILE_SHARE_READ | FILE_SHARE_WRITE,
NULL, OPEN_ALWAYS, 0, NULL);

bResult = DeviceIoControl (hNdis,
IOCTL_NDISUIO_SET_OID_VALUE,
(LPVOID) pSetOid,
sizeof(NDISUIO_SET_OID) + sizeof(WAKEUP_FRAME),
NULL,
0,
&dwBytesReturned,
NULL);
dwErr=GetLastError();
if (bResult == FALSE)
{
RETAILMSG(1,(TEXT("Failed to set Wake up Frame for ARP, Error Code=%X
\r\n"),dwErr));
}