Using DMA API in "EvtIoInCallerContext"

Hi Guys,
I have a EvtIoInCallerContext registered to handle certain IOCTLS. In this incaller context, I want to have the request to a point where it is ready to fire. What this really means is that I want to:-

  1. Allocate the transaction object.
  2. Start the transaction.
  3. Call the DMA APIs to get to the point where I have the scatter gather list.
  4. Walk the scatter gather list and create a hardware specific “packet”.
  5. complete the transaction and free the transaction object.
  6. Call the “WdfDeviceEnqueueRequest”.

Everything I have created is in the “RequestContext” associated with the WDF Request. When the request arrives again in the driver, I will just fire the request.
Please note that my driver does not use map buffers and it has the profile WdfDmaProfileScatterGather64Duplex.

Basically, the actual DMA transfer from/to the hardware happens much after I have completed the DMA Transaction.

In Other Words:

I am just using the DMA APIs to get to the point of having the scatter gather list and nothing else.

I am considering this approach because it simplifies my implementation a lot and reduces the locking in the driver.

Please let me know your thoughts. Do you guys see any side effects of this?
Thanks,
Aj-

Doing this in EvtIoInCallerContext is a bad idea and makes no sense at all that I can determine.

Can you please explain further why you need to (or think you want to) do this in the InCallerContext callback? You’re blocking the requesting thread… This is foolish.

Peter

Peter, we learned in his other thread that they have user-mode pointers in their buffers that they need to probe and lock. That has to be done InCallerContext.

But DMA APIs can be done later. I am just evaluating and experimenting everything.

These two threads are inextricably inter-related and need to be one discussion. I’m closing this thread… Let’s move the discussion to the OTHER thread.

Peter