NDIS miniport is running, but not connected

My miniport driver is running, but the adapter sees no wireless AP’s to connect to. Here is the output of !ndiskd.miniport for two wireless adapters on my machine. the first, “D-Link DWA-652 XtremeN Notebook Adapter” is not my miniport and is shown merely as a reference. I don’t know why my adapter isn’t able to see or connect to any wireless AP’s.

MINIPORT

D-Link DWA-652 XtremeN Notebook Adapter

Ndis Handle 867440e0
Ndis API Version v6.20
Adapter Context 8541e020
Miniport Driver 880e33a0 - athr.sys v1.9
Ndis Verifier [No flags set]

Media Type 802.3
Physical Medium Native802.11
Device Path ??\PCI#VEN_168C&DEV_0023&SUBSYS_3A6E1186&REV_01#5&14d40c2a&0&0000F0#{ad498944-762f-11d0-8dcb-00c04fc3358c}{3188FA12-04E6-4279-8096-0FEEACA4F0B3}
Device Object 86744028
MAC Address 00-1c-f0-5c-7c-13

STATE

Miniport Running
Device PnP Started
Datapath Normal
Interface Up
Media Connected
Power D0
References 0n14
User Handles 0
Total Resets 0
Pending OID None
Flags 2c452208
BUS_MASTER, SG_DMA, DEFAULT_PORT_ACTIVATED, SUPPORTS_MEDIA_SENSE,
DOES_NOT_DO_LOOPBACK, MEDIA_CONNECTED
PnPFlags 00210021
PM_SUPPORTED, DEVICE_POWER_ENABLED, RECEIVED_START, HARDWARE_DEVICE

BINDINGS

Filter List Filter Filter Driver Context _
WFP LightWeight Filter-0000
866cf888 86633118 864f72f8
QoS Packet Scheduler-0000
8670c008 866338e0 866b4aa0
Native WiFi Filter Driver-0000
8670e5c8 87933af0 880a36a8
Virtual WiFi Filter Driver-0000
853aad08 8662caf8 85431448

Open List Open Protocol Context _
TEEFER2 8672e2e8 869a59e0 88064bd8

MORE INFORMATION

Driver handlers Task offloads
Power management PM protocol offloads
Pending OIDs Timers
Pending NBLs Receive Side Throttling
Wake-on-LAN (WoL) Packet filter
Receive queues Receive filtering
NDIS ports NIC switch
0: kd> !ndiskd.miniport 867c10e0

MINIPORT

My Miniport Tx/Rx

Ndis Handle 867c10e0
Ndis API Version v6.20
Adapter Context 86c3d020
Miniport Driver 8687b0a8 - MyMiniport.sys v1.0
Ndis Verifier [No flags set]

Media Type 802.3
Physical Medium Native802.11
Device Path ??\PCI#VEN_168C&DEV_002B&SUBSYS_34A1168C&REV_01#6&c8f6441&0&000800E0#{ad498944-762f-11d0-8dcb-00c04fc3358c}{C25D62EF-0180-4361-B986-854E7514B1A5}
Device Object 867c1028
MAC Address 00-06-80-00-9f-e2

STATE

Miniport Running
Device PnP Started
Datapath 00000002 DIVERTED_BECAUSE_MEDIA_DISCONNECTED
NBL Status NDIS_STATUS_MEDIA_DISCONNECTED
Operational status DOWN
Operational flags 00000002 DOWN_NOT_CONNECTED
Admin status ADMIN_UP
Media MediaDisconnected
Miniport media Connected
Power D0
References 0n18
User Handles 0
Total Resets 0
Pending OID None
Flags 0c452208
BUS_MASTER, SG_DMA, DEFAULT_PORT_ACTIVATED, SUPPORTS_MEDIA_SENSE,
DOES_NOT_DO_LOOPBACK, NOT_MEDIA_CONNECTED
PnPFlags 00210021
PM_SUPPORTED, DEVICE_POWER_ENABLED, RECEIVED_START, HARDWARE_DEVICE

BINDINGS

Filter List Filter Filter Driver Context _
WFP LightWeight Filter-0000
87ff95f0 86633118 88003430
QoS Packet Scheduler-0000
865c37f8 866338e0 865c3488
Native WiFi Filter Driver-0000
87ff55f0 87933af0 8804a010
Virtual WiFi Filter Driver-0000
869b90d0 8662caf8 87273448

Open List Open Protocol Context _
RSPNDR 880baaa8 87fe7658 880ba008
NDISUIO 880b5aa8 8806a4d8 88016670
TCPIP6 88086aa8 861e12a0 87fb84f0
TCPIP 88085aa8 861d7570 86504d00
LLTDIO 88084aa8 87f66008 88005620

MORE INFORMATION

Driver handlers Task offloads
Power management PM protocol offloads
Pending OIDs Timers
Pending NBLs Receive Side Throttling
Wake-on-LAN (WoL) Packet filter
Receive queues Receive filtering
NDIS ports NIC switch
0: kd> !ndiskd.help DIVERTED_BECAUSE_MEDIA_DISCONNECTED 1

FLAG

DIVERTED_BECAUSE_MEDIA_DISCONNECTED

DESCRIPTION

The miniport cannot send data at this time because its media is
disconnected. NDIS will intercept transmitted packets and immediately
return them with an unsuccessful status code.

SEE ALSO

DIVERTED_BECAUSE_MINIPORT_RESETTING, DIVERTED_BECAUSE_PM_STOPPED

Normally, I run my miniport by itself. I ran the D-Link merely to show results from a successfull miniport that is connected to a wireless AP.

Any thoughts as to what I am overlooking?
Thanks,
Paul

Well the OS gets its list of wireless APs from your driver. So if it can’t see any, then what is your miniport telling the OS when you receive OID_DOT11_ENUM_BSS_LIST?

Here’s how I’d debug this, if I didn’t have sources to your driver. You might be able to take an easier route since you probably have your own source code :slight_smile:

  1. Close taskmanager and any other programs that spam your NIC with lots of noisy OID_GEN_STATISTICS.
  2. Set a breakpoint on your miniport’s OID request handler.
  3. Open the little network list flyout icon by the clock (we call it the VANUI…)
  4. The moment that you click on the tray icon, you should see a breakpoint in kd for your OID handler. !ndiskd.oid will tell you that you’re getting OID_DOT11_ENUM_BSS_LIST. (Or actually, it’ll probably say “Unknown value 0x0e010179” – sorry about that; I neglected to program in all the dot11 OIDs in time for the last ndiskd release). If it’s some other OID, hit ‘g’ and keep going till you get the right one.
  5. Set a breakpoint on ndis!NdisMOidRequestComplete.
  6. Hit ‘gu’ to see your miniport complete that OID, then (if the NdisMOidRequestComplete breakpoint didn’t hit) run “!ndiskd.help @eax” to see what status it completed the OID with:
    6a. If the code is NDIS_STATUS_BUFFER_OVERFLOW, then you need to repeat step 4-5, since the app is retrying with a bigger buffer. This is typical.
    6b. If the code is NDIS_STATUS_PENDING, then the completion is happening at ndis!NdisMOidRequestComplete. You need to check its status code there.
    6c. If the code is some other fatal error code, then that’s why your driver isn’t returning a list of APs to the OS. Fix it.
  7. Now that the OID is completed successfully, !ndiskd.oid will helpfully dump out the first part of the buffer for you. Manually pick through it to make sure it’s valid. Its format is documented here:
    http://msdn.microsoft.com/en-us/library/ff569360(VS.85).aspx
    http://msdn.microsoft.com/en-us/library/ff547670(v=VS.85).aspx
    http://msdn.microsoft.com/en-us/library/ff547665(v=VS.85).aspx
    You should see all the expected APs in it.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@praxiseng.com
Sent: Monday, March 07, 2011 8:42 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] NDIS miniport is running, but not connected

My miniport driver is running, but the adapter sees no wireless AP’s to connect to. Here is the output of !ndiskd.miniport for two wireless adapters on my machine. the first, “D-Link DWA-652 XtremeN Notebook Adapter” is not my miniport and is shown merely as a reference. I don’t know why my adapter isn’t able to see or connect to any wireless AP’s.

MINIPORT

D-Link DWA-652 XtremeN Notebook Adapter

Ndis Handle 867440e0
Ndis API Version v6.20
Adapter Context 8541e020
Miniport Driver 880e33a0 - athr.sys v1.9
Ndis Verifier [No flags set]

Media Type 802.3
Physical Medium Native802.11
Device Path ??\PCI#VEN_168C&DEV_0023&SUBSYS_3A6E1186&REV_01#5&14d40c2a&0&0000F0#{ad498944-762f-11d0-8dcb-00c04fc3358c}{3188FA12-04E6-4279-8096-0FEEACA4F0B3}
Device Object 86744028
MAC Address 00-1c-f0-5c-7c-13

STATE

Miniport Running
Device PnP Started
Datapath Normal
Interface Up
Media Connected
Power D0
References 0n14
User Handles 0
Total Resets 0
Pending OID None
Flags 2c452208
BUS_MASTER, SG_DMA, DEFAULT_PORT_ACTIVATED, SUPPORTS_MEDIA_SENSE,
DOES_NOT_DO_LOOPBACK, MEDIA_CONNECTED
PnPFlags 00210021
PM_SUPPORTED, DEVICE_POWER_ENABLED, RECEIVED_START, HARDWARE_DEVICE

BINDINGS

Filter List Filter Filter Driver Context _
WFP LightWeight Filter-0000
866cf888 86633118 864f72f8
QoS Packet Scheduler-0000
8670c008 866338e0 866b4aa0
Native WiFi Filter Driver-0000
8670e5c8 87933af0 880a36a8
Virtual WiFi Filter Driver-0000
853aad08 8662caf8 85431448

Open List Open Protocol Context _
TEEFER2 8672e2e8 869a59e0 88064bd8

MORE INFORMATION

Driver handlers Task offloads
Power management PM protocol offloads
Pending OIDs Timers
Pending NBLs Receive Side Throttling
Wake-on-LAN (WoL) Packet filter
Receive queues Receive filtering
NDIS ports NIC switch
0: kd> !ndiskd.miniport 867c10e0

MINIPORT

My Miniport Tx/Rx

Ndis Handle 867c10e0
Ndis API Version v6.20
Adapter Context 86c3d020
Miniport Driver 8687b0a8 - MyMiniport.sys v1.0
Ndis Verifier [No flags set]

Media Type 802.3
Physical Medium Native802.11
Device Path ??\PCI#VEN_168C&DEV_002B&SUBSYS_34A1168C&REV_01#6&c8f6441&0&000800E0#{ad498944-762f-11d0-8dcb-00c04fc3358c}{C25D62EF-0180-4361-B986-854E7514B1A5}
Device Object 867c1028
MAC Address 00-06-80-00-9f-e2

STATE

Miniport Running
Device PnP Started
Datapath 00000002 DIVERTED_BECAUSE_MEDIA_DISCONNECTED
NBL Status NDIS_STATUS_MEDIA_DISCONNECTED
Operational status DOWN
Operational flags 00000002 DOWN_NOT_CONNECTED
Admin status ADMIN_UP
Media MediaDisconnected
Miniport media Connected
Power D0
References 0n18
User Handles 0
Total Resets 0
Pending OID None
Flags 0c452208
BUS_MASTER, SG_DMA, DEFAULT_PORT_ACTIVATED, SUPPORTS_MEDIA_SENSE,
DOES_NOT_DO_LOOPBACK, NOT_MEDIA_CONNECTED
PnPFlags 00210021
PM_SUPPORTED, DEVICE_POWER_ENABLED, RECEIVED_START, HARDWARE_DEVICE

BINDINGS

Filter List Filter Filter Driver Context _
WFP LightWeight Filter-0000
87ff95f0 86633118 88003430
QoS Packet Scheduler-0000
865c37f8 866338e0 865c3488
Native WiFi Filter Driver-0000
87ff55f0 87933af0 8804a010
Virtual WiFi Filter Driver-0000
869b90d0 8662caf8 87273448

Open List Open Protocol Context _
RSPNDR 880baaa8 87fe7658 880ba008
NDISUIO 880b5aa8 8806a4d8 88016670
TCPIP6 88086aa8 861e12a0 87fb84f0
TCPIP 88085aa8 861d7570 86504d00
LLTDIO 88084aa8 87f66008 88005620

MORE INFORMATION

Driver handlers Task offloads
Power management PM protocol offloads
Pending OIDs Timers
Pending NBLs Receive Side Throttling
Wake-on-LAN (WoL) Packet filter
Receive queues Receive filtering
NDIS ports NIC switch
0: kd> !ndiskd.help DIVERTED_BECAUSE_MEDIA_DISCONNECTED 1

FLAG

DIVERTED_BECAUSE_MEDIA_DISCONNECTED

DESCRIPTION

The miniport cannot send data at this time because its media is
disconnected. NDIS will intercept transmitted packets and immediately
return them with an unsuccessful status code.

SEE ALSO

DIVERTED_BECAUSE_MINIPORT_RESETTING, DIVERTED_BECAUSE_PM_STOPPED

Normally, I run my miniport by itself. I ran the D-Link merely to show results from a successfull miniport that is connected to a wireless AP.

Any thoughts as to what I am overlooking?
Thanks,
Paul


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer