2 * Copyright (c) 2009 Intel Corporation. All rights reserved.
\r
4 * This software is available to you under the OpenIB.org BSD license
\r
7 * Redistribution and use in source and binary forms, with or
\r
8 * without modification, are permitted provided that the following
\r
9 * conditions are met:
\r
11 * - Redistributions of source code must retain the above
\r
12 * copyright notice, this list of conditions and the following
\r
15 * - Redistributions in binary form must reproduce the above
\r
16 * copyright notice, this list of conditions and the following
\r
17 * disclaimer in the documentation and/or other materials
\r
18 * provided with the distribution.
\r
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
\r
21 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
\r
22 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
\r
23 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
\r
24 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
\r
25 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
26 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
\r
35 #include <initguid.h>
\r
37 #include "nd_base.h"
\r
38 #include "nd_adapter.h"
\r
40 class CNDCompletionQueue : public INDCompletionQueue, public CNDBase
\r
44 STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
\r
45 STDMETHODIMP_(ULONG) AddRef();
\r
46 STDMETHODIMP_(ULONG) Release();
\r
48 // INDOverlapped methods
\r
49 STDMETHODIMP CancelOverlappedRequests();
\r
50 STDMETHODIMP GetOverlappedResult(OVERLAPPED *pOverlapped,
\r
51 SIZE_T *pNumberOfBytesTransferred, BOOL bWait);
\r
53 // INDCompletionQueue methods
\r
54 STDMETHODIMP Resize(SIZE_T nEntries);
\r
55 STDMETHODIMP Notify(DWORD Type, OVERLAPPED* pOverlapped);
\r
56 STDMETHODIMP_(SIZE_T) GetResults(ND_RESULT* pResults[], SIZE_T nResults);
\r
58 CNDCompletionQueue(CNDAdapter *pAdapter);
\r
59 ~CNDCompletionQueue();
\r
60 void Delete() {delete this;}
\r
62 CreateInstance(CNDAdapter *pAdapter, SIZE_T nEntries, INDCompletionQueue** ppCq)
\r
65 CNDCompletionQueue *cq;
\r
67 cq = new CNDCompletionQueue(pAdapter);
\r
73 hr = cq->Init(nEntries);
\r
88 IWVCompletionQueue *m_pWvCq;
\r
91 CNDAdapter *m_pAdapter;
\r
92 STDMETHODIMP Init(SIZE_T nEntries);
\r
93 STDMETHODIMP_(HRESULT) ConvertStatus(WV_WC_STATUS Status);
\r