[opensm] removed opensm\user\include\ib_types.h, even though it was not used, it...
[mirror/winof/.git] / core / winverbs / kernel / wv_device.h
1 /*\r
2  * Copyright (c) 2008 Intel Corporation. All rights reserved.\r
3  *\r
4  * This software is available to you under the OpenIB.org BSD license\r
5  * below:\r
6  *\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
10  *\r
11  *      - Redistributions of source code must retain the above\r
12  *        copyright notice, this list of conditions and the following\r
13  *        disclaimer.\r
14  *\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
19  *\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 AWV\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
27  * SOFTWARE.\r
28  */\r
29 \r
30 #pragma once\r
31 \r
32 #ifndef _WV_DEVICE_H_\r
33 #define _WV_DEVICE_H_\r
34 \r
35 #include <ntddk.h>\r
36 #include <wdm.h>\r
37 #include <iba\ib_types.h>\r
38 #include <iba\ib_ci.h>\r
39 \r
40 #include "wv_driver.h"\r
41 #include "wv_provider.h"\r
42 \r
43 typedef struct _WV_PORT\r
44 {\r
45         WDFQUEUE                        Queue;\r
46         UINT32                          Flags;\r
47 \r
48 }       WV_PORT;\r
49 \r
50 typedef struct _WV_DEVICE\r
51 {\r
52         WV_PROVIDER                     *pProvider;\r
53         WV_RDMA_DEVICE          *pDevice;\r
54         ci_interface_t          *pVerbs;\r
55         LIST_ENTRY                      Entry;\r
56         ib_ca_handle_t          hVerbsDevice;\r
57         ci_event_handler_t      EventHandler;\r
58 \r
59         LIST_ENTRY                      PdList;\r
60         LIST_ENTRY                      CqList;\r
61 \r
62         KEVENT                          Event;\r
63         LONG                            Ref;\r
64         WV_PORT                         *pPorts;\r
65         UINT8                           PortCount;\r
66 \r
67 }       WV_DEVICE;\r
68 \r
69 struct _WV_DEVICE *WvDeviceAcquire(WV_PROVIDER *pProvider, UINT64 Id);\r
70 void WvDeviceRelease(WV_DEVICE *pDevice);\r
71 void WvDeviceGet(WV_DEVICE *pDevice);\r
72 void WvDevicePut(WV_DEVICE *pDevice);\r
73 \r
74 void WvDeviceOpen(WV_PROVIDER *pProvider, WDFREQUEST Request);\r
75 void WvDeviceClose(WV_PROVIDER *pProvider, WDFREQUEST Request);\r
76 void WvDeviceFree(WV_DEVICE *pDevice);\r
77 void WvDeviceRemoveHandler(WV_DEVICE *pDevice);\r
78 \r
79 void WvDeviceQuery(WV_PROVIDER *pProvider, WDFREQUEST Request);\r
80 void WvDevicePortQuery(WV_PROVIDER *pProvider, WDFREQUEST Request);\r
81 void WvDeviceGidQuery(WV_PROVIDER *pProvider, WDFREQUEST Request);\r
82 void WvDevicePkeyQuery(WV_PROVIDER *pProvider, WDFREQUEST Request);\r
83 \r
84 void WvDeviceNotify(WV_PROVIDER *pProvider, WDFREQUEST Request);\r
85 void WvDeviceCancel(WV_PROVIDER *pProvider, WDFREQUEST Request);\r
86 \r
87 #endif // __WV_DEVICE_H_\r