The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.
Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/
I try to understand how I should implement an NDIS 6 miniport driver in respect to dma. It should be a simple driver, not high-performance. As far as i know, I should call NdisMRegisterScatterGatherDma during initialization. My hardware has bus-master dma. I set the ProcessSGListHandler. When a protocol driver sends frames, NDIS provides me the NET_BUFFER_LIST. When I call NdisMAllocateNetBufferSGList, NDIS converts a NET_BUFFER to a SGList. I configure the dma controller with the scatter gather elements for one frame and start the dma transfer to the device. The hardware notifies me via interrupt when the send has completed.
How should I implement the receive? I have a fixed number of rx descriptors in the dma controller, so I assume I should allocate a commonbuffer with size = MAX_SIZE_OF_ETHERNET_FRAME * NUMBER_OF_RX_DESCRIPTORS. How do I allocate this physical contiguous buffer? During initialization I would program the rx dma. The rx dma engine is a fifo. I configure each rx descriptor with the physical address in the common buffer.
The windows driver samples github repo did not contain an example that uses NdisMRegisterScatterGatherDma. In the repo https://github.com/microsoftarchive/msdn-code-gallery-microsoft I found the driver "Native Wi-Fi Miniport Sample Driver", but until now I could not find the way it allocates the rx buffer.
|Upcoming OSR Seminars|
|OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!|
|Internals & Software Drivers||30 Nov 2020||LIVE ONLINE|
|Writing WDF Drivers||7 Dec 2020||LIVE ONLINE|
|Developing Minifilters||Early 2021||LIVE ONLINE|