Implementation Tips and Requirements for IrDA Miniport Drivers
This topic discusses tips and requirements for implementing an IrDA miniport driver. When implementing an IrDA miniport driver, the following items should be observed:
An IrDA miniport driver should use NDIS timers and related functions (for example, NdisMInitializeTimer and NdisMSetTimer) rather than the NdisStallExecution function to implement the wait time required to honor a remote station's minimum turnaround time. NDIS timers should be used because NdisStallExecution freezes the entire operating system for the specified interval. If an IrDA miniport driver calls NdisStallExecution to perform the wait, the impact on the overall performance of the operating system could be significant considering that the largest minimum turnaround time is 10 milliseconds.
An IrDA miniport driver's MiniportSendPackets function must exhibit the following behavior:
- Not expect serialized calls from NDIS. NDIS can call MiniportSendPackets several times before even one packet completes.
- Release any hold on the packet array, which is passed in the PacketArray parameter, before returning. NDIS assumes that MiniportSendPackets consumed all necessary data from the packet array; therefore NDIS can fill the packet array with new data even before the miniport driver completes the transmission of data that was previously in the packet array.
Before an IrDA miniport driver can reuse packets that it indicated to the IrDA protocol driver using the NdisMIndicateReceivePacket function, the miniport driver must wait for NDIS to call the miniport driver's MiniportReturnPacket function to return those packets. The protocol driver can hold packets for an indefinite period. Therefore, a miniport driver must not restart DMA after it indicates packets that are resident in its receive DMA buffer because those packets can become corrupted before the protocol driver returns them. However, a miniport driver can restart DMA if it uses a different DMA buffer.
An IrDA miniport driver must not bypass NDIS and implement DMA through direct I/O. That is, the miniport driver should not call non-NDIS functions to implement DMA. The IrDA device related to a miniport driver that calls non-NDIS functions could be disqualified from inclusion in the Windows Marketplace Tested Products List.
To ensure proper installation of an infrared device, the device's device ID should be unique to hardware on that device, so that Plug and Play can configure the device's controller and transceiver type without user intervention. During installation, a MIR, FIR, or VFIR device should not specify itself using a generic SIR device ID. Doing so causes Plug and Play to install that device as a SIR device, which uses the irsir.sys driver. The user is then required to change the device's driver from Control Panel to achieve the appropriate functionality.