aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common/include/linux
diff options
context:
space:
mode:
authorHans Petter Selasky <hselasky@FreeBSD.org>2015-11-03 12:37:55 +0000
committerHans Petter Selasky <hselasky@FreeBSD.org>2015-11-03 12:37:55 +0000
commit8e7baabc9fe7b5d5afe5df8ca9bcf60b5e1a2bc0 (patch)
tree55519160617174e6d3d032a582f568c7f3494047 /sys/compat/linuxkpi/common/include/linux
parent748c9559ee9ef24b40ff700ed500542411f657d5 (diff)
downloadsrc-8e7baabc9fe7b5d5afe5df8ca9bcf60b5e1a2bc0.tar.gz
src-8e7baabc9fe7b5d5afe5df8ca9bcf60b5e1a2bc0.zip
Make all the LinuxKPI include files compile standalone.
Sponsored by: Mellanox Technologies
Notes
Notes: svn path=/head/; revision=290335
Diffstat (limited to 'sys/compat/linuxkpi/common/include/linux')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/bitops.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/cdev.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/clocksource.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/device.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/idr.h6
-rw-r--r--sys/compat/linuxkpi/common/include/linux/if_arp.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/if_vlan.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/interrupt.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/io.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/jhash.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/kobject.h27
-rw-r--r--sys/compat/linuxkpi/common/include/linux/kref.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/module.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/net.h4
-rw-r--r--sys/compat/linuxkpi/common/include/linux/notifier.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/poll.h5
-rw-r--r--sys/compat/linuxkpi/common/include/linux/radix-tree.h2
-rw-r--r--sys/compat/linuxkpi/common/include/linux/rwlock.h1
-rw-r--r--sys/compat/linuxkpi/common/include/linux/sysfs.h8
-rw-r--r--sys/compat/linuxkpi/common/include/linux/usb.h9
20 files changed, 57 insertions, 21 deletions
diff --git a/sys/compat/linuxkpi/common/include/linux/bitops.h b/sys/compat/linuxkpi/common/include/linux/bitops.h
index 8b985a92c475..2f402e86bf78 100644
--- a/sys/compat/linuxkpi/common/include/linux/bitops.h
+++ b/sys/compat/linuxkpi/common/include/linux/bitops.h
@@ -33,6 +33,7 @@
#include <sys/types.h>
#include <sys/systm.h>
+#include <sys/errno.h>
#define BIT(nr) (1UL << (nr))
#ifdef __LP64__
diff --git a/sys/compat/linuxkpi/common/include/linux/cdev.h b/sys/compat/linuxkpi/common/include/linux/cdev.h
index 9d5b3fb0f240..5d8962f46355 100644
--- a/sys/compat/linuxkpi/common/include/linux/cdev.h
+++ b/sys/compat/linuxkpi/common/include/linux/cdev.h
@@ -32,6 +32,7 @@
#define _LINUX_CDEV_H_
#include <linux/kobject.h>
+#include <linux/sysfs.h>
#include <linux/kdev_t.h>
#include <linux/list.h>
diff --git a/sys/compat/linuxkpi/common/include/linux/clocksource.h b/sys/compat/linuxkpi/common/include/linux/clocksource.h
index 7a4835c9bea3..f4d17f188796 100644
--- a/sys/compat/linuxkpi/common/include/linux/clocksource.h
+++ b/sys/compat/linuxkpi/common/include/linux/clocksource.h
@@ -31,6 +31,8 @@
#ifndef _LINUX_CLOCKSOURCE_H
#define _LINUX_CLOCKSOURCE_H
+#include <asm/types.h>
+
/* clocksource cycle base type */
typedef u64 cycle_t;
diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h
index 3459a5c4b68d..02b2064587d5 100644
--- a/sys/compat/linuxkpi/common/include/linux/device.h
+++ b/sys/compat/linuxkpi/common/include/linux/device.h
@@ -33,6 +33,7 @@
#include <linux/types.h>
#include <linux/kobject.h>
+#include <linux/sysfs.h>
#include <linux/list.h>
#include <linux/compiler.h>
#include <linux/types.h>
diff --git a/sys/compat/linuxkpi/common/include/linux/idr.h b/sys/compat/linuxkpi/common/include/linux/idr.h
index 9beec6898838..fc377d40a05d 100644
--- a/sys/compat/linuxkpi/common/include/linux/idr.h
+++ b/sys/compat/linuxkpi/common/include/linux/idr.h
@@ -31,7 +31,11 @@
#ifndef _LINUX_IDR_H_
#define _LINUX_IDR_H_
-#include <sys/kernel.h>
+#include <sys/param.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+
+#include <linux/types.h>
#define IDR_BITS 5
#define IDR_SIZE (1 << IDR_BITS)
diff --git a/sys/compat/linuxkpi/common/include/linux/if_arp.h b/sys/compat/linuxkpi/common/include/linux/if_arp.h
index 6233aac6fa67..9235e2dff9cf 100644
--- a/sys/compat/linuxkpi/common/include/linux/if_arp.h
+++ b/sys/compat/linuxkpi/common/include/linux/if_arp.h
@@ -30,6 +30,8 @@
*/
#ifndef _LINUX_IF_ARP_H_
#define _LINUX_IF_ARP_H_
+#include <sys/param.h>
+#include <sys/types.h>
#include <sys/socket.h>
#include <net/if_arp.h>
#endif /* _LINUX_IF_ARP_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/if_vlan.h b/sys/compat/linuxkpi/common/include/linux/if_vlan.h
index 4a8808fb335c..cd65183250d1 100644
--- a/sys/compat/linuxkpi/common/include/linux/if_vlan.h
+++ b/sys/compat/linuxkpi/common/include/linux/if_vlan.h
@@ -31,6 +31,7 @@
#ifndef _LINUX_IF_VLAN_H_
#define _LINUX_IF_VLAN_H_
+#include <sys/types.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>
diff --git a/sys/compat/linuxkpi/common/include/linux/interrupt.h b/sys/compat/linuxkpi/common/include/linux/interrupt.h
index 4c0ad8087582..d33a3b02bbb7 100644
--- a/sys/compat/linuxkpi/common/include/linux/interrupt.h
+++ b/sys/compat/linuxkpi/common/include/linux/interrupt.h
@@ -61,7 +61,7 @@ _irq_rid(struct device *dev, int irq)
return irq - dev->msix + 1;
}
-static void
+static inline void
_irq_handler(void *ent)
{
struct irq_ent *irqe;
diff --git a/sys/compat/linuxkpi/common/include/linux/io.h b/sys/compat/linuxkpi/common/include/linux/io.h
index 16543ff11573..f3a1e686963a 100644
--- a/sys/compat/linuxkpi/common/include/linux/io.h
+++ b/sys/compat/linuxkpi/common/include/linux/io.h
@@ -33,6 +33,7 @@
#include <machine/vm.h>
#include <sys/endian.h>
+#include <sys/types.h>
static inline uint32_t
__raw_readl(const volatile void *addr)
diff --git a/sys/compat/linuxkpi/common/include/linux/jhash.h b/sys/compat/linuxkpi/common/include/linux/jhash.h
index f31829e846b2..c3904e276778 100644
--- a/sys/compat/linuxkpi/common/include/linux/jhash.h
+++ b/sys/compat/linuxkpi/common/include/linux/jhash.h
@@ -1,6 +1,8 @@
#ifndef _LINUX_JHASH_H_
#define _LINUX_JHASH_H_
+#include <asm/types.h>
+
/* jhash.h: Jenkins hash support.
*
* Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net)
diff --git a/sys/compat/linuxkpi/common/include/linux/kobject.h b/sys/compat/linuxkpi/common/include/linux/kobject.h
index 63fbc56b48bc..0e9480964d3d 100644
--- a/sys/compat/linuxkpi/common/include/linux/kobject.h
+++ b/sys/compat/linuxkpi/common/include/linux/kobject.h
@@ -59,6 +59,20 @@ struct kobject {
extern struct kobject *mm_kobj;
+struct attribute {
+ const char *name;
+ struct module *owner;
+ mode_t mode;
+};
+
+struct kobj_attribute {
+ struct attribute attr;
+ ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
+ char *buf);
+ ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr,
+ const char *buf, size_t count);
+};
+
static inline void
kobject_init(struct kobject *kobj, struct kobj_type *ktype)
{
@@ -155,17 +169,4 @@ int kobject_set_name(struct kobject *kobj, const char *fmt, ...);
int kobject_init_and_add(struct kobject *kobj, struct kobj_type *ktype,
struct kobject *parent, const char *fmt, ...);
-/* sysfs.h calles for 'kobject' which is defined here,
- * so we need to add the include only after the 'kobject' def.
- */
-#include <linux/sysfs.h>
-
-struct kobj_attribute {
- struct attribute attr;
- ssize_t (*show)(struct kobject *kobj, struct kobj_attribute *attr,
- char *buf);
- ssize_t (*store)(struct kobject *kobj, struct kobj_attribute *attr,
- const char *buf, size_t count);
-};
-
#endif /* _LINUX_KOBJECT_H_ */
diff --git a/sys/compat/linuxkpi/common/include/linux/kref.h b/sys/compat/linuxkpi/common/include/linux/kref.h
index de5ddaa4b886..584de8db7f4f 100644
--- a/sys/compat/linuxkpi/common/include/linux/kref.h
+++ b/sys/compat/linuxkpi/common/include/linux/kref.h
@@ -35,6 +35,7 @@
#include <sys/types.h>
#include <sys/refcount.h>
+#include <linux/compiler.h>
#include <asm/atomic.h>
struct kref {
diff --git a/sys/compat/linuxkpi/common/include/linux/module.h b/sys/compat/linuxkpi/common/include/linux/module.h
index 0caa2b00695b..7db9f08c84bc 100644
--- a/sys/compat/linuxkpi/common/include/linux/module.h
+++ b/sys/compat/linuxkpi/common/include/linux/module.h
@@ -38,6 +38,7 @@
#include <linux/list.h>
#include <linux/compiler.h>
#include <linux/kobject.h>
+#include <linux/sysfs.h>
#include <linux/moduleparam.h>
#include <linux/slab.h>
diff --git a/sys/compat/linuxkpi/common/include/linux/net.h b/sys/compat/linuxkpi/common/include/linux/net.h
index 166b7503f273..282a45d2db32 100644
--- a/sys/compat/linuxkpi/common/include/linux/net.h
+++ b/sys/compat/linuxkpi/common/include/linux/net.h
@@ -31,9 +31,13 @@
#ifndef _LINUX_NET_H_
#define _LINUX_NET_H_
+#include <sys/types.h>
+#include <sys/malloc.h>
+#include <sys/proc.h>
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
+#include <sys/errno.h>
static inline int
sock_create_kern(int family, int type, int proto, struct socket **res)
diff --git a/sys/compat/linuxkpi/common/include/linux/notifier.h b/sys/compat/linuxkpi/common/include/linux/notifier.h
index ca750e04a37d..472236853dcf 100644
--- a/sys/compat/linuxkpi/common/include/linux/notifier.h
+++ b/sys/compat/linuxkpi/common/include/linux/notifier.h
@@ -31,6 +31,7 @@
#ifndef _LINUX_NOTIFIER_H_
#define _LINUX_NOTIFIER_H_
+#include <sys/types.h>
#include <sys/eventhandler.h>
/*
diff --git a/sys/compat/linuxkpi/common/include/linux/poll.h b/sys/compat/linuxkpi/common/include/linux/poll.h
index e4f7417caef9..bdcfd293396b 100644
--- a/sys/compat/linuxkpi/common/include/linux/poll.h
+++ b/sys/compat/linuxkpi/common/include/linux/poll.h
@@ -34,11 +34,14 @@
#include <sys/poll.h>
#include <sys/fcntl.h>
+#include <linux/wait.h>
+#include <linux/file.h>
+
typedef struct poll_table_struct {
} poll_table;
static inline void
-poll_wait(struct file *filp, wait_queue_head_t *wait_address, poll_table *p)
+poll_wait(struct linux_file *filp, wait_queue_head_t *wait_address, poll_table *p)
{
selrecord(curthread, &filp->f_selinfo);
}
diff --git a/sys/compat/linuxkpi/common/include/linux/radix-tree.h b/sys/compat/linuxkpi/common/include/linux/radix-tree.h
index 838b81cfdf73..0edf04ee0ca5 100644
--- a/sys/compat/linuxkpi/common/include/linux/radix-tree.h
+++ b/sys/compat/linuxkpi/common/include/linux/radix-tree.h
@@ -31,6 +31,8 @@
#ifndef _LINUX_RADIX_TREE_H_
#define _LINUX_RADIX_TREE_H_
+#include <linux/types.h>
+
#define RADIX_TREE_MAP_SHIFT 6
#define RADIX_TREE_MAP_SIZE (1 << RADIX_TREE_MAP_SHIFT)
#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE - 1)
diff --git a/sys/compat/linuxkpi/common/include/linux/rwlock.h b/sys/compat/linuxkpi/common/include/linux/rwlock.h
index e7c6301f9587..54c53dc94988 100644
--- a/sys/compat/linuxkpi/common/include/linux/rwlock.h
+++ b/sys/compat/linuxkpi/common/include/linux/rwlock.h
@@ -31,6 +31,7 @@
#ifndef _LINUX_RWLOCK_H_
#define _LINUX_RWLOCK_H_
+#include <sys/types.h>
#include <sys/lock.h>
#include <sys/rwlock.h>
diff --git a/sys/compat/linuxkpi/common/include/linux/sysfs.h b/sys/compat/linuxkpi/common/include/linux/sysfs.h
index e565e43699d6..a102d4391ff8 100644
--- a/sys/compat/linuxkpi/common/include/linux/sysfs.h
+++ b/sys/compat/linuxkpi/common/include/linux/sysfs.h
@@ -31,13 +31,11 @@
#ifndef _LINUX_SYSFS_H_
#define _LINUX_SYSFS_H_
+#include <sys/types.h>
#include <sys/sysctl.h>
+#include <sys/errno.h>
-struct attribute {
- const char *name;
- struct module *owner;
- mode_t mode;
-};
+#include <linux/kobject.h>
struct sysfs_ops {
ssize_t (*show)(struct kobject *, struct attribute *, char *);
diff --git a/sys/compat/linuxkpi/common/include/linux/usb.h b/sys/compat/linuxkpi/common/include/linux/usb.h
index 1f00d4b4addc..1954a7014a82 100644
--- a/sys/compat/linuxkpi/common/include/linux/usb.h
+++ b/sys/compat/linuxkpi/common/include/linux/usb.h
@@ -28,6 +28,15 @@
#ifndef _USB_COMPAT_LINUX_H
#define _USB_COMPAT_LINUX_H
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/proc.h>
+#include <sys/condvar.h>
+
+#include <dev/usb/usb.h>
+#include <dev/usb/usbdi.h>
+#include <dev/usb/usbdi_util.h>
+
struct usb_device;
struct usb_interface;
struct usb_driver;