Windows Wi-Fi Driver Architecture – WDI

WLAN Device Driver Interface (WDI)

WDI 為Windows 10 上新的WLAN Device 的架構,可以參考: WDI Miniport Driver Design Guide

WDI IHV component model

Driver Flow

介紹整體Driver 的流程,以及一些比較重要的Callback function

– Set miniport characteristics <MSFT LINK>
身為miniport 一些必須或是可選擇的特徵
– Set WDI characteristics <MSFT LINK>
身為 WDI miniport 一些必須或是可選擇的特徵
– Register miniport driver handler (NdisMRegisterWdiMiniportDriver)

AllocateAdapterHandler (WDI characteristics)
– Allocate the Adapter context
– Set the miniport registration attributes with NDIS

OpenAdapterHandler (WDI characteristics)
– Initialize the Firmware, Hardware, and Software.
Include Firmware download, register PCIe Interrupt, Chip callback function.

TalTxRxInitializeHandler (WDI characteristics)
– Initialize the Data path handler (NDIS_MINIPORT_WDI_DATA_HANDLERS)
– Allocate NBL pool (NET_BUFFER_LIST_POOL_PARAMETERS, NdisAllocateNetBufferListPool)

OidRequestHandler (miniport characteristics)
– To handle an OID request (Task OID List, and Property OID List)
– OS control WDI Driver through OID
– 主要行為都是透過這個來處理,當Driver 跑起來的時候也會停留在這裡

CloseAdapterHandler (WDI characteristics) / ShutdownHandlerEx (miniport characteristics)
– De-initialize the Firmware, Hardware, and Software or enter surprise remove
– ShutdownHandlerEx only call this with shutdown without fast startup.

FreeAdapterHandler (WDI characteristics)
– Allocate the Adapter context

UnloadHandler (miniport characteristics)
– Deregister miniport driver handler (NdisMDeregisterWdiMiniportDriver)