I have an NDIS 6 miniport driver I am getting to work under Windows 7. The code is based on the WDK sample C:\WinDDK\7600.16385.1\src\network\ndis\athwifi\driver.
There is also a NDIS protocol driver that is based on the WDK sample C:\WinDDK\7600.16385.1\src\network\ndis\ndisprot\60\sys.
There is a test program to exercise the two drivers. When I put the miniport driver into promiscuous mode I do the following in the test program:
send an IOCtl (IOCTL_NPD_SET_OID_VALUE) with an OID (OID_ATH_MONITOR_MODE) that tells the miniport driver to switch to promiscuous mode. The buffer looks like this,
OID_ATH_MONITOR_MODE
0 // default port
enable/disable
when the above IOCtl completes with STATUS_SUCCESS, I send an IOCtl (IOCTL_NPD_SET_OID_VALUE) with an OID (OID_GEN_CURRENT_PACKET_FILTER) that sets PacketFilter to NDIS_PACKET_TYPE_ALL_LOCAL. The buffer looks like this,
OID_GEN_CURRENT_PACKET_FILTER
0 // default port
NDIS_PACKET_TYPE_ALL_LOCAL
when the first IOCtl completes with STATUS_SUCCESS, I send an IOCtl (IOCTL_NPD_SET_OID_VALUE) with an OID (OID_ATH_CHANNEL) that sets the frequency to the requested frequency. The buffer looks like this,
OID_ATH_PRAXIS_CHANNEL
0 // default port
_frequency
_chanFlags
I also manually disconnect the NIC from any wireless access point. I will programmatically do this soon. Note, PacketFilter is automatically set to 0x20001 when I disconnect. I am not doing this. I assume the worker thread is doing this for NDIS. All three IOCtls return STATUS_SUCCESS after returning STATUS_PENDING.
Here is my problem. Packets are detected and rejected in my miniport receive filter (identical to the sample filter) as PacketFilter is still set to 0x20001. Am I taking the right approach to getting packets to make their way up the stack to the test program? My IOCtl to set PacketFilter succeeded, yet was never detected in any of my miniport code. When the request came down from my test program to the protocl driver, I stepped into NDIS far enough to see the request get queued. It then returned STATUS_PENDING then a STATUS_SUCCESS, but my miniport never received the request.
Basically, in an NDIS 6 miniport running under Win 7 how do I get packets to go up the stack to my protocol driver. Once it has them, the rest should be easy.
This looks like my last hurdle, but it has me stumped.
Thanks,
Paul