Wi-Fi Direct Miniport Initialization and Configuration
Important The Native 802.11 Wireless LAN interface is deprecated in Windows 10 and later. Please use the WLAN Device Driver Interface (WDI) instead. For more information about WDI, see WLAN Universal Windows driver model.
Wi-Fi Direct functionality is enabled by Windows through additional NDIS ports and operation modes. NDIS ports are used to represent each of the 802.11 MAC entities that the miniport driver supports. When Windows initializes the miniport driver, the first (default) port is implicitly created by Windows to correspond to the default 802.11 MAC entity that is created by the miniport driver. During the lifetime of the miniport driver new ports may be created by Windows, depending on the Virtual WiFi capability reported by the miniport driver in DOT11_VWIFI_ATTRIBUTES. As shown in the diagram below, there are at least two new NDIS ports that the miniport driver must support to enable Wi-Fi Direct functionality:
The Wi-Fi Direct Device port is used by Windows to perform Wi-Fi Direct Device functionality such as device discovery, Group Owner Negotiation, and so on. Windows programs the Wi-Fi Direct Role to behave as a Wi-Fi Direct Client or Group Owner to join or host a Wi-Fi Direct group. Miniport drivers may create additional Wi-Fi Direct Role ports that can support multiple Client or Group Owner roles. Three new operation modes are introduced to program a port in the appropriate role. The mode DOT11_OPERATION_MODE_WFD_DEVICE is programmed only on the Wi-Fi Direct Device port. The modes DOT11_OPERATION_MODE_WFD_CLIENT and DOT11_OPERATION_MODE_WFD_GROUP_OWNER would be programmed on each of the Wi-Fi Direct Role ports. All Wi-Fi Direct Role ports must support being in Wi-Fi Direct Client or Group Owner mode.
The rest of this documentation describes the expected behavior of a miniport driver that supports Wi-Fi Direct functionality.
Miniport Initialization During MiniportInitialize, similar to Windows 7, the miniport driver must initialize the default 802.11 MAC entity. It must also report its Wi-Fi Direct and Virtual WiFi capabilities using the NdisMSetMiniportAttributes function.
Port creation and Deletion NDIS PORTs are created and deleted using the OID_DOT11_CREATE_MAC and OID_DOT11_DELETE_MAC OIDs. The maximum number of ports created and the role of the active ports is limited by the number of 802.11 MAC entities and capabilities supported by the miniport driver. For a miniport driver capable of supporting Wi-Fi Direct, there are at least 4 NDIS PORTs that can be created:
- Default Port (Port 0) for ExtSTA Operation Mode. This is existing Vista/Windows 7 behavior.
- One port for ExtAP Operation Mode. This is existing Windows 7 behavior.
- One port for Wi-Fi Direct Device Functionality. This port will be used for all Wi-Fi Direct functionality that happens before a Wi-Fi Direct Group Session has started. An example operation is Group Owner Negotiation.
- One or more ports for Wi-Fi Direct GO or Client Functionality. These ports will be used for Wi-Fi Direct Group Session. The number of Wi-Fi Direct GO or Client ports created may be limited by Windows.
An additional Virtual Station (VSTA) port may be created for miniport drivers supporting that capability. The following are the guarantees provided by Windows for order of creation and deletion of ports:
- The default port (Port 0) must be present before any other ports are created.
- The Wi-Fi Direct Device functionality port must be present before any Wi-Fi Direct GO or Client functionality ports are created.
Any other ports are created (and deleted) as needed. The miniport driver must not make an assumption on the port number assignment or order of creation for any other ports.
When a Wi-Fi Direct port is created, it should start in the DOT11_OPERATION_MODE_EXTENSIBLE_STATION operation mode. Windows may then configure it to one of the Wi-Fi Direct operation modes. The set and order in which the Wi-Fi Direct OIDs are submitted to the port are not guaranteed. Each of the Wi-Fi Direct OIDs is addressed to the specific NDIS_PORT it is sent to and should only modify the configuration of that port.
Miniport Halting On MiniportHaltEx, the miniport must reset and delete all MAC entities when the miniport driver is halted. This should include freeing up all the ports registered with NDIS.