> static void WvCqEventHandler(ib_event_rec_t *pEvent)
> {
>-      pEvent;
>+      WV_COMPLETION_QUEUE *cq = pEvent->context;
>+      WDFREQUEST                      request;
>+      NTSTATUS                        status;
>+
>+      WdfObjectAcquireLock(cq->Queue);
>+      status = WdfIoQueueRetrieveNextRequest(cq->Queue, &request);
>+      WdfObjectReleaseLock(cq->Queue);
>+
>+      if (NT_SUCCESS(status)) {
>+              WdfRequestComplete(request, STATUS_UNEXPECTED_IO_ERROR);
>+      }
> }
>
> static void WvCqHandler(void *Context)
> {
>-       WV_COMPLETION_QUEUE *pCq = Context;
>-       pCq;
>+      WV_COMPLETION_QUEUE *cq = Context;
>+      WDFREQUEST                      request;
>+      NTSTATUS                        status;
>+
>+      WdfObjectAcquireLock(cq->Queue);
>+      status = WdfIoQueueRetrieveNextRequest(cq->Queue, &request);
>+      WdfObjectReleaseLock(cq->Queue);
>+
>+      if (NT_SUCCESS(status)) {
>+              WdfRequestComplete(request, STATUS_SUCCESS);
>+      }
> }

When I added support to cancel requests, I ended up with the two handlers 
calling into a single function.

>+      WDF_IO_QUEUE_CONFIG_INIT(&config, WdfIoQueueDispatchManual);
>+      status = WdfIoQueueCreate(ControlDevice, &config,
>+                                                        
>WDF_NO_OBJECT_ATTRIBUTES, &cq->Queue);
>+      if (!NT_SUCCESS(status)) {
>+              goto err;
>+      }

And this needed to be destroyed when freeing the CQ.

These changes and the fixes were added to the WinVerbs branch.

- Sean

_______________________________________________
ofw mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ofw

Reply via email to