doc: whitespace changes in licenses
[dpdk.git] / lib / librte_eal / linuxapp / kni / kni_dev.h
1 /*-
2  * GPL LICENSE SUMMARY
3  * 
4  *   Copyright(c) 2010-2013 Intel Corporation. All rights reserved.
5  * 
6  *   This program is free software; you can redistribute it and/or modify
7  *   it under the terms of version 2 of the GNU General Public License as
8  *   published by the Free Software Foundation.
9  * 
10  *   This program is distributed in the hope that it will be useful, but
11  *   WITHOUT ANY WARRANTY; without even the implied warranty of
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  *   General Public License for more details.
14  * 
15  *   You should have received a copy of the GNU General Public License
16  *   along with this program; if not, write to the Free Software
17  *   Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18  *   The full GNU General Public License is included in this distribution
19  *   in the file called LICENSE.GPL.
20  * 
21  *   Contact Information:
22  *   Intel Corporation
23  */
24
25 #ifndef _KNI_DEV_H_
26 #define _KNI_DEV_H_
27
28 #include <linux/if.h>
29 #include <linux/wait.h>
30 #include <linux/sched.h>
31 #include <linux/netdevice.h>
32 #include <linux/spinlock.h>
33 #include <linux/list.h>
34
35 #define KNI_KTHREAD_RESCHEDULE_INTERVAL 10 /* us */
36
37 /**
38  * A structure describing the private information for a kni device.
39  */
40 struct kni_dev {
41         /* kni list */
42         struct list_head list;
43
44         struct net_device_stats stats;
45         int status;
46         int port_id;
47
48         /* wait queue for req/resp */
49         wait_queue_head_t wq;
50         struct mutex sync_lock;
51
52         /* PCI device id */
53         uint16_t device_id;
54
55         /* kni device */
56         struct net_device *net_dev;
57         struct net_device *lad_dev;
58         struct pci_dev *pci_dev;
59
60         /* queue for packets to be sent out */
61         void *tx_q;
62
63         /* queue for the packets received */
64         void *rx_q;
65
66         /* queue for the allocated mbufs those can be used to save sk buffs */
67         void *alloc_q;
68
69         /* free queue for the mbufs to be freed */
70         void *free_q;
71
72         /* request queue */
73         void *req_q;
74
75         /* response queue */
76         void *resp_q;
77
78         void * sync_kva;
79         void *sync_va;
80
81         void *mbuf_kva;
82         void *mbuf_va;
83
84         /* mbuf size */
85         unsigned mbuf_size;
86
87         /* synchro for request processing */
88         unsigned long synchro;
89 };
90
91 #define DEBUG_KNI
92
93 #define KNI_ERR(args...) printk(KERN_DEBUG "KNI: Error: " args)
94 #define KNI_PRINT(args...) printk(KERN_DEBUG "KNI: " args)
95 #ifdef DEBUG_KNI
96         #define KNI_DBG(args...) printk(KERN_DEBUG "KNI: " args)
97 #else
98         #define KNI_DBG(args...)
99 #endif
100
101 #endif