2 * Copyright (c) 2014 VMware, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at:
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * XXX: OVS_USE_NL_INTERFACE is being used to keep the legacy DPIF interface
19 * alive while we transition over to the netlink based interface.
20 * OVS_USE_NL_INTERFACE = 0 => legacy inteface to use with dpif-windows.c
21 * OVS_USE_NL_INTERFACE = 1 => netlink inteface to use with ported dpif-linux.c
23 #if defined OVS_USE_NL_INTERFACE && OVS_USE_NL_INTERFACE == 0
29 #define __DATAPATH_H_ 1
31 typedef struct _OVS_DEVICE_EXTENSION {
32 INT numberOpenInstance;
34 } OVS_DEVICE_EXTENSION, *POVS_DEVICE_EXTENSION;
38 * Private context for each handle on the device.
40 typedef struct _OVS_OPEN_INSTANCE {
42 PFILE_OBJECT fileObject;
48 * On platforms that support netlink natively, there's generally some form of
49 * serialization between concurrent calls to netlink sockets. However, OVS
50 * userspace guarantees that a given netlink handle is not concurrently used.
51 * Despite this, we do want to have some basic checks in the kernel to make
52 * sure that things don't break if there are concurrent calls.
54 * This is generally not an issue since kernel data structure access should
55 * be sychronized anyway. Only reason to have this safeguared is to protect
56 * the state in "state-aware" read calls which rely on previous state. This
57 * restriction might go away as the userspace code gets implemented.
60 } OVS_OPEN_INSTANCE, *POVS_OPEN_INSTANCE;
62 NDIS_STATUS OvsCreateDeviceObject(NDIS_HANDLE ovsExtDriverHandle);
63 VOID OvsDeleteDeviceObject();
65 POVS_OPEN_INSTANCE OvsGetOpenInstance(PFILE_OBJECT fileObject,
68 NTSTATUS OvsCompleteIrpRequest(PIRP irp, ULONG_PTR infoPtr, NTSTATUS status);
71 * Structure of any message passed between userspace and kernel.
73 typedef struct _OVS_MESSAGE {
76 struct ovs_header ovsHdr;
77 /* Variable length nl_attrs follow. */
78 } OVS_MESSAGE, *POVS_MESSAGE;
80 #endif /* __DATAPATH_H_ */
82 #endif /* OVS_USE_NL_INTERFACE */