summaryrefslogtreecommitdiff
path: root/datapath/vport-internal_dev.h
diff options
context:
space:
mode:
authorJesse Gross <jesse@nicira.com>2010-04-12 15:53:39 -0400
committerJesse Gross <jesse@nicira.com>2010-04-19 09:11:57 -0400
commitf2459fe7d91c4c325dfaa3ed18f56200b63ae27e (patch)
treef1090136b8c9843acbb4c1d987c9480f1d5e7e9c /datapath/vport-internal_dev.h
parent6b8a6c529b2bd8ce03584b132263dca5ac932c1b (diff)
downloadopenvswitch-f2459fe7d91c4c325dfaa3ed18f56200b63ae27e.tar.gz
datapath: Add generic virtual port layer.
Currently the datapath directly accesses devices through their Linux functions. Obviously this doesn't work for virtual devices that are not backed by an actual Linux device. This creates a new virtual port layer which handles all interaction with devices. The existing support for Linux devices was then implemented on top of this layer as two device types. It splits out and renames dp_dev to internal_dev. There were several places where datapath devices had to handled in a special manner and this cleans that up by putting all the special casing in a single location.
Diffstat (limited to 'datapath/vport-internal_dev.h')
-rw-r--r--datapath/vport-internal_dev.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/datapath/vport-internal_dev.h b/datapath/vport-internal_dev.h
new file mode 100644
index 000000000..7c7652099
--- /dev/null
+++ b/datapath/vport-internal_dev.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2009, 2010 Nicira Networks.
+ * Distributed under the terms of the GNU GPL version 2.
+ *
+ * Significant portions of this file may be copied from parts of the Linux
+ * kernel, by Linus Torvalds and others.
+ */
+
+#ifndef VPORT_INTERNAL_DEV_H
+#define VPORT_INTERNAL_DEV_H 1
+
+#include "datapath.h"
+#include "vport.h"
+
+int is_internal_vport(const struct vport *);
+
+int is_internal_dev(const struct net_device *);
+struct vport *internal_dev_get_vport(struct net_device *);
+
+#endif /* vport-internal_dev.h */