#endif
+void kni_net_rx(struct kni_dev *kni);
+void kni_net_init(struct net_device *dev);
+void kni_net_config_lo_mode(char *lo_str);
+void kni_net_poll_resp(struct kni_dev *kni);
+void kni_set_ethtool_ops(struct net_device *netdev);
+
+int ixgbe_kni_probe(struct pci_dev *pdev, struct net_device **lad_dev);
+void ixgbe_kni_remove(struct pci_dev *pdev);
+int igb_kni_probe(struct pci_dev *pdev, struct net_device **lad_dev);
+void igb_kni_remove(struct pci_dev *pdev);
+
#ifdef RTE_KNI_VHOST_DEBUG_RX
#define KNI_DBG_RX(args...) printk(KERN_DEBUG "KNI RX: " args)
#else
#define KNI_MAX_DEVICES 32
-extern void kni_net_rx(struct kni_dev *kni);
-extern void kni_net_init(struct net_device *dev);
-extern void kni_net_config_lo_mode(char *lo_str);
-extern void kni_net_poll_resp(struct kni_dev *kni);
-extern void kni_set_ethtool_ops(struct net_device *netdev);
-
-extern int ixgbe_kni_probe(struct pci_dev *pdev, struct net_device **lad_dev);
-extern void ixgbe_kni_remove(struct pci_dev *pdev);
-extern struct pci_device_id ixgbe_pci_tbl[];
-extern int igb_kni_probe(struct pci_dev *pdev, struct net_device **lad_dev);
-extern void igb_kni_remove(struct pci_dev *pdev);
-extern struct pci_device_id igb_pci_tbl[];
+extern const struct pci_device_id ixgbe_pci_tbl[];
+extern const struct pci_device_id igb_pci_tbl[];
static int kni_open(struct inode *inode, struct file *file);
static int kni_release(struct inode *inode, struct file *file);
#include <linux/sched.h>
#include <linux/if_tun.h>
#include <linux/version.h>
+#include <linux/file.h>
#include "compat.h"
#include "kni_dev.h"
#define RX_BURST_SZ 4
-extern void put_unused_fd(unsigned int fd);
-
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
-extern struct file*
-sock_alloc_file(struct socket *sock,
- int flags, const char *dname);
-
-extern int get_unused_fd_flags(unsigned flags);
-
-extern void fd_install(unsigned int fd, struct file *file);
-
static int kni_sock_map_fd(struct socket *sock)
{
struct file *file;