[IBAL] crash on IBBUS disabling while mad traffic. [mlnx: 4275]
[mirror/winof/.git] / core / winmad / wm_ioctl.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 _WM_IOCTL_H_\r
33 #define _WM_IOCTL_H_\r
34 \r
35 typedef UINT16 NET16;\r
36 typedef UINT32 NET32;\r
37 typedef UINT64 NET64;\r
38 \r
39 #define WM_IOCTL(f)     CTL_CODE(FILE_DEVICE_INFINIBAND, f, METHOD_BUFFERED,\\r
40                                                          FILE_READ_DATA | FILE_WRITE_DATA)\r
41 \r
42 // input parameter / output parameter\r
43 // IOCTL\r
44 #define WM_IO_FUNCTION_BASE                             0x800\r
45 \r
46 enum {\r
47         WM_IO_FUNCTION_MIN,\r
48         WM_IO_FUNCTION_REGISTER,\r
49         WM_IO_FUNCTION_DEREGISTER,\r
50         WM_IO_FUNCTION_CANCEL,\r
51         WM_IO_FUNCTION_MAX\r
52 };\r
53 \r
54 // WM_IO_REGISTER / UINT64 Id\r
55 #define WM_IOCTL_REGISTER                               WM_IOCTL(WM_IO_FUNCTION_BASE + \\r
56                                                                                                  WM_IO_FUNCTION_REGISTER)\r
57 \r
58 // UINT64 Id / none\r
59 #define WM_IOCTL_DEREGISTER                             WM_IOCTL(WM_IO_FUNCTION_BASE + \\r
60                                                                                                  WM_IO_FUNCTION_DEREGISTER)\r
61 \r
62 // none / none\r
63 #define WM_IOCTL_CANCEL                                 WM_IOCTL(WM_IO_FUNCTION_BASE + \\r
64                                                                                                  WM_IO_FUNCTION_CANCEL)\r
65 \r
66 #define WM_IOCTL_MIN                                    WM_IO_FUNCTION_BASE + WM_IO_FUNCTION_MIN\r
67 #define WM_IOCTL_MAX                                    WM_IO_FUNCTION_BASE + WM_IO_FUNCTION_MAX\r
68 \r
69 typedef struct _WM_IO_REGISTER\r
70 {\r
71         NET64                   Guid;\r
72         NET32                   Qpn;\r
73         UINT8                   Port;\r
74         UINT8                   Class;\r
75         UINT8                   Version;\r
76         UINT8                   Reserved[6];\r
77         UINT8                   Oui[3];\r
78         UINT8                   Methods[16];\r
79 \r
80 }       WM_IO_REGISTER;\r
81 \r
82 typedef struct _WM_IO_MAD_AV\r
83 {\r
84         NET32                   Qpn;\r
85         NET32                   Qkey;\r
86         NET32                   VersionClassFlow;       \r
87         UINT16                  PkeyIndex;\r
88         UINT8                   HopLimit;\r
89         UINT8                   GidIndex;\r
90         UINT8                   Gid[16];\r
91 \r
92         UINT16                  Reserved;\r
93         NET16                   Lid;\r
94         UINT8                   ServiceLevel;\r
95         UINT8                   PathBits;\r
96         UINT8                   StaticRate;\r
97         UINT8                   GrhValid;\r
98 \r
99 }       WM_IO_MAD_AV;\r
100 \r
101 #pragma warning(push)\r
102 #pragma warning(disable: 4200)\r
103 typedef struct _WM_IO_MAD\r
104 {\r
105         UINT64                  Id;\r
106         WM_IO_MAD_AV    Address;\r
107 \r
108         UINT32                  Status;\r
109         UINT32                  Timeout;\r
110         UINT32                  Retries;\r
111         UINT32                  Length;\r
112 \r
113         UINT8                   Data[0];\r
114 \r
115 }       WM_IO_MAD;\r
116 #pragma warning(pop)\r
117 \r
118 #endif // _WM_IOCTL_H_\r