Update primary code license to Apache 2.0.
[cascardo/ovs.git] / datapath / dp_dev.h
1 /*
2  * Copyright (c) 2009 Nicira Networks.
3  * Distributed under the terms of the GNU GPL version 2.
4  *
5  * Significant portions of this file may be copied from parts of the Linux
6  * kernel, by Linus Torvalds and others.
7  */
8
9 #ifndef DP_DEV_H
10 #define DP_DEV_H 1
11
12 struct dp_dev {
13         struct datapath *dp;
14         int port_no;
15
16         struct net_device *dev;
17         struct net_device_stats stats;
18         struct sk_buff_head xmit_queue;
19         struct work_struct xmit_work;
20
21         struct list_head list;
22 };
23
24 static inline struct dp_dev *dp_dev_priv(struct net_device *netdev)
25 {
26         return netdev_priv(netdev);
27 }
28
29 struct net_device *dp_dev_create(struct datapath *, const char *, int port_no);
30 void dp_dev_destroy(struct net_device *);
31 int dp_dev_recv(struct net_device *, struct sk_buff *);
32 int is_dp_dev(struct net_device *);
33 struct datapath *dp_dev_get_dp(struct net_device *);
34
35 #endif /* dp_dev.h */