Auto merge with /home/aegl/GIT/linus
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
|
||||
|
||||
struct atalk_addr {
|
||||
__u16 s_net;
|
||||
__be16 s_net;
|
||||
__u8 s_node;
|
||||
};
|
||||
|
||||
@@ -33,8 +33,8 @@ struct sockaddr_at {
|
||||
|
||||
struct atalk_netrange {
|
||||
__u8 nr_phase;
|
||||
__u16 nr_firstnet;
|
||||
__u16 nr_lastnet;
|
||||
__be16 nr_firstnet;
|
||||
__be16 nr_lastnet;
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
@@ -70,8 +70,8 @@ struct atalk_iface {
|
||||
struct atalk_sock {
|
||||
/* struct sock has to be the first member of atalk_sock */
|
||||
struct sock sk;
|
||||
unsigned short dest_net;
|
||||
unsigned short src_net;
|
||||
__be16 dest_net;
|
||||
__be16 src_net;
|
||||
unsigned char dest_node;
|
||||
unsigned char src_node;
|
||||
unsigned char dest_port;
|
||||
@@ -95,9 +95,9 @@ struct ddpehdr {
|
||||
deh_hops:4,
|
||||
deh_len:10;
|
||||
#endif
|
||||
__u16 deh_sum;
|
||||
__u16 deh_dnet;
|
||||
__u16 deh_snet;
|
||||
__be16 deh_sum;
|
||||
__be16 deh_dnet;
|
||||
__be16 deh_snet;
|
||||
__u8 deh_dnode;
|
||||
__u8 deh_snode;
|
||||
__u8 deh_dport;
|
||||
@@ -142,24 +142,24 @@ struct ddpshdr {
|
||||
|
||||
/* AppleTalk AARP headers */
|
||||
struct elapaarp {
|
||||
__u16 hw_type;
|
||||
__be16 hw_type;
|
||||
#define AARP_HW_TYPE_ETHERNET 1
|
||||
#define AARP_HW_TYPE_TOKENRING 2
|
||||
__u16 pa_type;
|
||||
__be16 pa_type;
|
||||
__u8 hw_len;
|
||||
__u8 pa_len;
|
||||
#define AARP_PA_ALEN 4
|
||||
__u16 function;
|
||||
__be16 function;
|
||||
#define AARP_REQUEST 1
|
||||
#define AARP_REPLY 2
|
||||
#define AARP_PROBE 3
|
||||
__u8 hw_src[ETH_ALEN] __attribute__ ((packed));
|
||||
__u8 pa_src_zero __attribute__ ((packed));
|
||||
__u16 pa_src_net __attribute__ ((packed));
|
||||
__be16 pa_src_net __attribute__ ((packed));
|
||||
__u8 pa_src_node __attribute__ ((packed));
|
||||
__u8 hw_dst[ETH_ALEN] __attribute__ ((packed));
|
||||
__u8 pa_dst_zero __attribute__ ((packed));
|
||||
__u16 pa_dst_net __attribute__ ((packed));
|
||||
__be16 pa_dst_net __attribute__ ((packed));
|
||||
__u8 pa_dst_node __attribute__ ((packed));
|
||||
};
|
||||
|
||||
|
@@ -14,6 +14,7 @@
|
||||
#include <linux/config.h>
|
||||
#include <linux/ioport.h>
|
||||
#include <linux/kobject.h>
|
||||
#include <linux/klist.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/types.h>
|
||||
#include <linux/module.h>
|
||||
@@ -44,14 +45,15 @@ struct device;
|
||||
struct device_driver;
|
||||
struct class;
|
||||
struct class_device;
|
||||
struct class_simple;
|
||||
|
||||
struct bus_type {
|
||||
char * name;
|
||||
const char * name;
|
||||
|
||||
struct subsystem subsys;
|
||||
struct kset drivers;
|
||||
struct kset devices;
|
||||
struct klist klist_devices;
|
||||
struct klist klist_drivers;
|
||||
|
||||
struct bus_attribute * bus_attrs;
|
||||
struct device_attribute * dev_attrs;
|
||||
@@ -98,17 +100,18 @@ extern int bus_create_file(struct bus_type *, struct bus_attribute *);
|
||||
extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
|
||||
|
||||
struct device_driver {
|
||||
char * name;
|
||||
const char * name;
|
||||
struct bus_type * bus;
|
||||
|
||||
struct completion unloaded;
|
||||
struct kobject kobj;
|
||||
struct list_head devices;
|
||||
struct klist klist_devices;
|
||||
struct klist_node knode_bus;
|
||||
|
||||
struct module * owner;
|
||||
struct module * owner;
|
||||
|
||||
int (*probe) (struct device * dev);
|
||||
int (*remove) (struct device * dev);
|
||||
int (*remove) (struct device * dev);
|
||||
void (*shutdown) (struct device * dev);
|
||||
int (*suspend) (struct device * dev, pm_message_t state, u32 level);
|
||||
int (*resume) (struct device * dev, u32 level);
|
||||
@@ -137,12 +140,16 @@ struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store)
|
||||
extern int driver_create_file(struct device_driver *, struct driver_attribute *);
|
||||
extern void driver_remove_file(struct device_driver *, struct driver_attribute *);
|
||||
|
||||
extern int driver_for_each_device(struct device_driver * drv, struct device * start,
|
||||
void * data, int (*fn)(struct device *, void *));
|
||||
|
||||
|
||||
/*
|
||||
* device classes
|
||||
*/
|
||||
struct class {
|
||||
char * name;
|
||||
const char * name;
|
||||
struct module * owner;
|
||||
|
||||
struct subsystem subsys;
|
||||
struct list_head children;
|
||||
@@ -185,6 +192,7 @@ struct class_device {
|
||||
struct kobject kobj;
|
||||
struct class * class; /* required */
|
||||
dev_t devt; /* dev_t, creates the sysfs "dev" */
|
||||
struct class_device_attribute *devt_attr;
|
||||
struct device * dev; /* not necessary, but nice to have */
|
||||
void * class_data; /* class-specific data */
|
||||
|
||||
@@ -245,26 +253,28 @@ struct class_interface {
|
||||
extern int class_interface_register(struct class_interface *);
|
||||
extern void class_interface_unregister(struct class_interface *);
|
||||
|
||||
/* interface for class simple stuff */
|
||||
extern struct class_simple *class_simple_create(struct module *owner, char *name);
|
||||
extern void class_simple_destroy(struct class_simple *cs);
|
||||
extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...)
|
||||
__attribute__((format(printf,4,5)));
|
||||
extern int class_simple_set_hotplug(struct class_simple *,
|
||||
int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size));
|
||||
extern void class_simple_device_remove(dev_t dev);
|
||||
extern struct class *class_create(struct module *owner, char *name);
|
||||
extern void class_destroy(struct class *cls);
|
||||
extern struct class_device *class_device_create(struct class *cls, dev_t devt,
|
||||
struct device *device, char *fmt, ...)
|
||||
__attribute__((format(printf,4,5)));
|
||||
extern void class_device_destroy(struct class *cls, dev_t devt);
|
||||
|
||||
|
||||
struct device {
|
||||
struct list_head node; /* node in sibling list */
|
||||
struct list_head bus_list; /* node in bus's list */
|
||||
struct list_head driver_list;
|
||||
struct list_head children;
|
||||
struct klist klist_children;
|
||||
struct klist_node knode_parent; /* node in sibling list */
|
||||
struct klist_node knode_driver;
|
||||
struct klist_node knode_bus;
|
||||
struct device * parent;
|
||||
|
||||
struct kobject kobj;
|
||||
char bus_id[BUS_ID_SIZE]; /* position on parent bus */
|
||||
|
||||
struct semaphore sem; /* semaphore to synchronize calls to
|
||||
* its driver.
|
||||
*/
|
||||
|
||||
struct bus_type * bus; /* type of bus device is on */
|
||||
struct device_driver *driver; /* which driver has allocated this
|
||||
device */
|
||||
@@ -288,12 +298,6 @@ struct device {
|
||||
void (*release)(struct device * dev);
|
||||
};
|
||||
|
||||
static inline struct device *
|
||||
list_to_dev(struct list_head *node)
|
||||
{
|
||||
return list_entry(node, struct device, node);
|
||||
}
|
||||
|
||||
static inline void *
|
||||
dev_get_drvdata (struct device *dev)
|
||||
{
|
||||
@@ -321,7 +325,6 @@ extern int device_for_each_child(struct device *, void *,
|
||||
* Manual binding of a device to driver. See drivers/base/bus.c
|
||||
* for information on use.
|
||||
*/
|
||||
extern int driver_probe_device(struct device_driver * drv, struct device * dev);
|
||||
extern void device_bind_driver(struct device * dev);
|
||||
extern void device_release_driver(struct device * dev);
|
||||
extern int device_attach(struct device * dev);
|
||||
@@ -332,8 +335,10 @@ extern void driver_attach(struct device_driver * drv);
|
||||
|
||||
struct device_attribute {
|
||||
struct attribute attr;
|
||||
ssize_t (*show)(struct device * dev, char * buf);
|
||||
ssize_t (*store)(struct device * dev, const char * buf, size_t count);
|
||||
ssize_t (*show)(struct device *dev, struct device_attribute *attr,
|
||||
char *buf);
|
||||
ssize_t (*store)(struct device *dev, struct device_attribute *attr,
|
||||
const char *buf, size_t count);
|
||||
};
|
||||
|
||||
#define DEVICE_ATTR(_name,_mode,_show,_store) \
|
||||
@@ -360,13 +365,12 @@ extern int (*platform_notify_remove)(struct device * dev);
|
||||
*/
|
||||
extern struct device * get_device(struct device * dev);
|
||||
extern void put_device(struct device * dev);
|
||||
extern struct device *device_find(const char *name, struct bus_type *bus);
|
||||
|
||||
|
||||
/* drivers/base/platform.c */
|
||||
|
||||
struct platform_device {
|
||||
char * name;
|
||||
const char * name;
|
||||
u32 id;
|
||||
struct device dev;
|
||||
u32 num_resources;
|
||||
|
@@ -1657,6 +1657,52 @@ static inline void simple_transaction_set(struct file *file, size_t n)
|
||||
ar->size = n;
|
||||
}
|
||||
|
||||
/*
|
||||
* simple attribute files
|
||||
*
|
||||
* These attributes behave similar to those in sysfs:
|
||||
*
|
||||
* Writing to an attribute immediately sets a value, an open file can be
|
||||
* written to multiple times.
|
||||
*
|
||||
* Reading from an attribute creates a buffer from the value that might get
|
||||
* read with multiple read calls. When the attribute has been read
|
||||
* completely, no further read calls are possible until the file is opened
|
||||
* again.
|
||||
*
|
||||
* All attributes contain a text representation of a numeric value
|
||||
* that are accessed with the get() and set() functions.
|
||||
*/
|
||||
#define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt) \
|
||||
static int __fops ## _open(struct inode *inode, struct file *file) \
|
||||
{ \
|
||||
__simple_attr_check_format(__fmt, 0ull); \
|
||||
return simple_attr_open(inode, file, __get, __set, __fmt); \
|
||||
} \
|
||||
static struct file_operations __fops = { \
|
||||
.owner = THIS_MODULE, \
|
||||
.open = __fops ## _open, \
|
||||
.release = simple_attr_close, \
|
||||
.read = simple_attr_read, \
|
||||
.write = simple_attr_write, \
|
||||
};
|
||||
|
||||
static inline void __attribute__((format(printf, 1, 2)))
|
||||
__simple_attr_check_format(const char *fmt, ...)
|
||||
{
|
||||
/* don't do anything, just let the compiler check the arguments; */
|
||||
}
|
||||
|
||||
int simple_attr_open(struct inode *inode, struct file *file,
|
||||
u64 (*get)(void *), void (*set)(void *, u64),
|
||||
const char *fmt);
|
||||
int simple_attr_close(struct inode *inode, struct file *file);
|
||||
ssize_t simple_attr_read(struct file *file, char __user *buf,
|
||||
size_t len, loff_t *ppos);
|
||||
ssize_t simple_attr_write(struct file *file, const char __user *buf,
|
||||
size_t len, loff_t *ppos);
|
||||
|
||||
|
||||
#ifdef CONFIG_SECURITY
|
||||
static inline char *alloc_secdata(void)
|
||||
{
|
||||
|
36
include/linux/i2c-sysfs.h
Normal file
36
include/linux/i2c-sysfs.h
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* i2c-sysfs.h - i2c chip driver sysfs defines
|
||||
*
|
||||
* Copyright (C) 2005 Yani Ioannou <yani.ioannou@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
#ifndef _LINUX_I2C_SYSFS_H
|
||||
#define _LINUX_I2C_SYSFS_H
|
||||
|
||||
struct sensor_device_attribute{
|
||||
struct device_attribute dev_attr;
|
||||
int index;
|
||||
};
|
||||
#define to_sensor_dev_attr(_dev_attr) \
|
||||
container_of(_dev_attr, struct sensor_device_attribute, dev_attr)
|
||||
|
||||
#define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \
|
||||
struct sensor_device_attribute sensor_dev_attr_##_name = { \
|
||||
.dev_attr = __ATTR(_name,_mode,_show,_store), \
|
||||
.index = _index, \
|
||||
}
|
||||
|
||||
#endif /* _LINUX_I2C_SYSFS_H */
|
@@ -1015,7 +1015,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
|
||||
dev->absbit[LONG(axis)] |= BIT(axis);
|
||||
}
|
||||
|
||||
extern struct class_simple *input_class;
|
||||
extern struct class *input_class;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
55
include/linux/klist.h
Normal file
55
include/linux/klist.h
Normal file
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* klist.h - Some generic list helpers, extending struct list_head a bit.
|
||||
*
|
||||
* Implementations are found in lib/klist.c
|
||||
*
|
||||
*
|
||||
* Copyright (C) 2005 Patrick Mochel
|
||||
*
|
||||
* This file is rleased under the GPL v2.
|
||||
*/
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/completion.h>
|
||||
#include <linux/kref.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
|
||||
struct klist {
|
||||
spinlock_t k_lock;
|
||||
struct list_head k_list;
|
||||
};
|
||||
|
||||
|
||||
extern void klist_init(struct klist * k);
|
||||
|
||||
|
||||
struct klist_node {
|
||||
struct klist * n_klist;
|
||||
struct list_head n_node;
|
||||
struct kref n_ref;
|
||||
struct completion n_removed;
|
||||
};
|
||||
|
||||
extern void klist_add_tail(struct klist * k, struct klist_node * n);
|
||||
extern void klist_add_head(struct klist * k, struct klist_node * n);
|
||||
|
||||
extern void klist_del(struct klist_node * n);
|
||||
extern void klist_remove(struct klist_node * n);
|
||||
|
||||
extern int klist_node_attached(struct klist_node * n);
|
||||
|
||||
|
||||
struct klist_iter {
|
||||
struct klist * i_klist;
|
||||
struct list_head * i_head;
|
||||
struct klist_node * i_cur;
|
||||
};
|
||||
|
||||
|
||||
extern void klist_iter_init(struct klist * k, struct klist_iter * i);
|
||||
extern void klist_iter_init_node(struct klist * k, struct klist_iter * i,
|
||||
struct klist_node * n);
|
||||
extern void klist_iter_exit(struct klist_iter * i);
|
||||
extern struct klist_node * klist_next(struct klist_iter * i);
|
||||
|
@@ -33,7 +33,7 @@
|
||||
extern u64 hotplug_seqnum;
|
||||
|
||||
struct kobject {
|
||||
char * k_name;
|
||||
const char * k_name;
|
||||
char name[KOBJ_NAME_LEN];
|
||||
struct kref kref;
|
||||
struct list_head entry;
|
||||
@@ -46,7 +46,7 @@ struct kobject {
|
||||
extern int kobject_set_name(struct kobject *, const char *, ...)
|
||||
__attribute__((format(printf,2,3)));
|
||||
|
||||
static inline char * kobject_name(struct kobject * kobj)
|
||||
static inline const char * kobject_name(const struct kobject * kobj)
|
||||
{
|
||||
return kobj->k_name;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ extern void kobject_cleanup(struct kobject *);
|
||||
extern int kobject_add(struct kobject *);
|
||||
extern void kobject_del(struct kobject *);
|
||||
|
||||
extern int kobject_rename(struct kobject *, char *new_name);
|
||||
extern int kobject_rename(struct kobject *, const char *new_name);
|
||||
|
||||
extern int kobject_register(struct kobject *);
|
||||
extern void kobject_unregister(struct kobject *);
|
||||
@@ -94,7 +94,7 @@ struct kobj_type {
|
||||
*/
|
||||
struct kset_hotplug_ops {
|
||||
int (*filter)(struct kset *kset, struct kobject *kobj);
|
||||
char *(*name)(struct kset *kset, struct kobject *kobj);
|
||||
const char *(*name)(struct kset *kset, struct kobject *kobj);
|
||||
int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp,
|
||||
int num_envp, char *buffer, int buffer_size);
|
||||
};
|
||||
|
@@ -75,12 +75,6 @@ enum nf_ip_hook_priorities {
|
||||
#define SO_ORIGINAL_DST 80
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#ifdef CONFIG_NETFILTER_DEBUG
|
||||
void nf_debug_ip_local_deliver(struct sk_buff *skb);
|
||||
void nf_debug_ip_loopback_xmit(struct sk_buff *newskb);
|
||||
void nf_debug_ip_finish_output2(struct sk_buff *skb);
|
||||
#endif /*CONFIG_NETFILTER_DEBUG*/
|
||||
|
||||
extern int ip_route_me_harder(struct sk_buff **pskb);
|
||||
|
||||
/* Call this before modifying an existing IP packet: ensures it is
|
||||
|
@@ -1,7 +1,6 @@
|
||||
#ifndef _IP_CONNTRACK_CORE_H
|
||||
#define _IP_CONNTRACK_CORE_H
|
||||
#include <linux/netfilter.h>
|
||||
#include <linux/netfilter_ipv4/lockhelp.h>
|
||||
|
||||
/* This header is used to share core functionality between the
|
||||
standalone connection tracking module, and the compatibility layer's use
|
||||
@@ -47,6 +46,6 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb)
|
||||
|
||||
extern struct list_head *ip_conntrack_hash;
|
||||
extern struct list_head ip_conntrack_expect_list;
|
||||
DECLARE_RWLOCK_EXTERN(ip_conntrack_lock);
|
||||
extern rwlock_t ip_conntrack_lock;
|
||||
#endif /* _IP_CONNTRACK_CORE_H */
|
||||
|
||||
|
@@ -50,10 +50,9 @@ struct ip_nat_multi_range_compat
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/list.h>
|
||||
#include <linux/netfilter_ipv4/lockhelp.h>
|
||||
|
||||
/* Protects NAT hash tables, and NAT-private part of conntracks. */
|
||||
DECLARE_RWLOCK_EXTERN(ip_nat_lock);
|
||||
extern rwlock_t ip_nat_lock;
|
||||
|
||||
/* The structure embedded in the conntrack structure. */
|
||||
struct ip_nat_info
|
||||
|
@@ -2,7 +2,6 @@
|
||||
#define _LISTHELP_H
|
||||
#include <linux/config.h>
|
||||
#include <linux/list.h>
|
||||
#include <linux/netfilter_ipv4/lockhelp.h>
|
||||
|
||||
/* Header to do more comprehensive job than linux/list.h; assume list
|
||||
is first entry in structure. */
|
||||
|
@@ -1,129 +0,0 @@
|
||||
#ifndef _LOCKHELP_H
|
||||
#define _LOCKHELP_H
|
||||
#include <linux/config.h>
|
||||
|
||||
#include <linux/spinlock.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/smp.h>
|
||||
|
||||
/* Header to do help in lock debugging. */
|
||||
|
||||
#ifdef CONFIG_NETFILTER_DEBUG
|
||||
struct spinlock_debug
|
||||
{
|
||||
spinlock_t l;
|
||||
atomic_t locked_by;
|
||||
};
|
||||
|
||||
struct rwlock_debug
|
||||
{
|
||||
rwlock_t l;
|
||||
long read_locked_map;
|
||||
long write_locked_map;
|
||||
};
|
||||
|
||||
#define DECLARE_LOCK(l) \
|
||||
struct spinlock_debug l = { SPIN_LOCK_UNLOCKED, ATOMIC_INIT(-1) }
|
||||
#define DECLARE_LOCK_EXTERN(l) \
|
||||
extern struct spinlock_debug l
|
||||
#define DECLARE_RWLOCK(l) \
|
||||
struct rwlock_debug l = { RW_LOCK_UNLOCKED, 0, 0 }
|
||||
#define DECLARE_RWLOCK_EXTERN(l) \
|
||||
extern struct rwlock_debug l
|
||||
|
||||
#define MUST_BE_LOCKED(l) \
|
||||
do { if (atomic_read(&(l)->locked_by) != smp_processor_id()) \
|
||||
printk("ASSERT %s:%u %s unlocked\n", __FILE__, __LINE__, #l); \
|
||||
} while(0)
|
||||
|
||||
#define MUST_BE_UNLOCKED(l) \
|
||||
do { if (atomic_read(&(l)->locked_by) == smp_processor_id()) \
|
||||
printk("ASSERT %s:%u %s locked\n", __FILE__, __LINE__, #l); \
|
||||
} while(0)
|
||||
|
||||
/* Write locked OK as well. */
|
||||
#define MUST_BE_READ_LOCKED(l) \
|
||||
do { if (!((l)->read_locked_map & (1UL << smp_processor_id())) \
|
||||
&& !((l)->write_locked_map & (1UL << smp_processor_id()))) \
|
||||
printk("ASSERT %s:%u %s not readlocked\n", __FILE__, __LINE__, #l); \
|
||||
} while(0)
|
||||
|
||||
#define MUST_BE_WRITE_LOCKED(l) \
|
||||
do { if (!((l)->write_locked_map & (1UL << smp_processor_id()))) \
|
||||
printk("ASSERT %s:%u %s not writelocked\n", __FILE__, __LINE__, #l); \
|
||||
} while(0)
|
||||
|
||||
#define MUST_BE_READ_WRITE_UNLOCKED(l) \
|
||||
do { if ((l)->read_locked_map & (1UL << smp_processor_id())) \
|
||||
printk("ASSERT %s:%u %s readlocked\n", __FILE__, __LINE__, #l); \
|
||||
else if ((l)->write_locked_map & (1UL << smp_processor_id())) \
|
||||
printk("ASSERT %s:%u %s writelocked\n", __FILE__, __LINE__, #l); \
|
||||
} while(0)
|
||||
|
||||
#define LOCK_BH(lk) \
|
||||
do { \
|
||||
MUST_BE_UNLOCKED(lk); \
|
||||
spin_lock_bh(&(lk)->l); \
|
||||
atomic_set(&(lk)->locked_by, smp_processor_id()); \
|
||||
} while(0)
|
||||
|
||||
#define UNLOCK_BH(lk) \
|
||||
do { \
|
||||
MUST_BE_LOCKED(lk); \
|
||||
atomic_set(&(lk)->locked_by, -1); \
|
||||
spin_unlock_bh(&(lk)->l); \
|
||||
} while(0)
|
||||
|
||||
#define READ_LOCK(lk) \
|
||||
do { \
|
||||
MUST_BE_READ_WRITE_UNLOCKED(lk); \
|
||||
read_lock_bh(&(lk)->l); \
|
||||
set_bit(smp_processor_id(), &(lk)->read_locked_map); \
|
||||
} while(0)
|
||||
|
||||
#define WRITE_LOCK(lk) \
|
||||
do { \
|
||||
MUST_BE_READ_WRITE_UNLOCKED(lk); \
|
||||
write_lock_bh(&(lk)->l); \
|
||||
set_bit(smp_processor_id(), &(lk)->write_locked_map); \
|
||||
} while(0)
|
||||
|
||||
#define READ_UNLOCK(lk) \
|
||||
do { \
|
||||
if (!((lk)->read_locked_map & (1UL << smp_processor_id()))) \
|
||||
printk("ASSERT: %s:%u %s not readlocked\n", \
|
||||
__FILE__, __LINE__, #lk); \
|
||||
clear_bit(smp_processor_id(), &(lk)->read_locked_map); \
|
||||
read_unlock_bh(&(lk)->l); \
|
||||
} while(0)
|
||||
|
||||
#define WRITE_UNLOCK(lk) \
|
||||
do { \
|
||||
MUST_BE_WRITE_LOCKED(lk); \
|
||||
clear_bit(smp_processor_id(), &(lk)->write_locked_map); \
|
||||
write_unlock_bh(&(lk)->l); \
|
||||
} while(0)
|
||||
|
||||
#else
|
||||
#define DECLARE_LOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED
|
||||
#define DECLARE_LOCK_EXTERN(l) extern spinlock_t l
|
||||
#define DECLARE_RWLOCK(l) rwlock_t l = RW_LOCK_UNLOCKED
|
||||
#define DECLARE_RWLOCK_EXTERN(l) extern rwlock_t l
|
||||
|
||||
#define MUST_BE_LOCKED(l)
|
||||
#define MUST_BE_UNLOCKED(l)
|
||||
#define MUST_BE_READ_LOCKED(l)
|
||||
#define MUST_BE_WRITE_LOCKED(l)
|
||||
#define MUST_BE_READ_WRITE_UNLOCKED(l)
|
||||
|
||||
#define LOCK_BH(l) spin_lock_bh(l)
|
||||
#define UNLOCK_BH(l) spin_unlock_bh(l)
|
||||
|
||||
#define READ_LOCK(l) read_lock_bh(l)
|
||||
#define WRITE_LOCK(l) write_lock_bh(l)
|
||||
#define READ_UNLOCK(l) read_unlock_bh(l)
|
||||
#define WRITE_UNLOCK(l) write_unlock_bh(l)
|
||||
#endif /*CONFIG_NETFILTER_DEBUG*/
|
||||
|
||||
#endif /* _LOCKHELP_H */
|
@@ -14,6 +14,7 @@
|
||||
#define NETLINK_SELINUX 7 /* SELinux event notifications */
|
||||
#define NETLINK_ARPD 8
|
||||
#define NETLINK_AUDIT 9 /* auditing */
|
||||
#define NETLINK_FIB_LOOKUP 10
|
||||
#define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */
|
||||
#define NETLINK_IP6_FW 13
|
||||
#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
|
||||
@@ -146,7 +147,7 @@ struct netlink_callback
|
||||
int (*dump)(struct sk_buff * skb, struct netlink_callback *cb);
|
||||
int (*done)(struct netlink_callback *cb);
|
||||
int family;
|
||||
long args[4];
|
||||
long args[5];
|
||||
};
|
||||
|
||||
struct netlink_notify
|
||||
|
@@ -27,6 +27,7 @@ struct node {
|
||||
};
|
||||
|
||||
extern int register_node(struct node *, int, struct node *);
|
||||
extern void unregister_node(struct node *node);
|
||||
|
||||
#define to_node(sys_device) container_of(sys_device, struct node, sysdev)
|
||||
|
||||
|
@@ -245,6 +245,7 @@ struct sadb_x_nat_t_port {
|
||||
|
||||
/* Security Association flags */
|
||||
#define SADB_SAFLAGS_PFS 1
|
||||
#define SADB_SAFLAGS_NOPMTUDISC 0x20000000
|
||||
#define SADB_SAFLAGS_DECAP_DSCP 0x40000000
|
||||
#define SADB_SAFLAGS_NOECN 0x80000000
|
||||
|
||||
|
@@ -193,7 +193,6 @@ struct skb_shared_info {
|
||||
* @nfcache: Cache info
|
||||
* @nfct: Associated connection, if any
|
||||
* @nfctinfo: Relationship of this skb to the connection
|
||||
* @nf_debug: Netfilter debugging
|
||||
* @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
|
||||
* @private: Data which is private to the HIPPI implementation
|
||||
* @tc_index: Traffic control index
|
||||
@@ -264,9 +263,6 @@ struct sk_buff {
|
||||
__u32 nfcache;
|
||||
__u32 nfctinfo;
|
||||
struct nf_conntrack *nfct;
|
||||
#ifdef CONFIG_NETFILTER_DEBUG
|
||||
unsigned int nf_debug;
|
||||
#endif
|
||||
#ifdef CONFIG_BRIDGE_NETFILTER
|
||||
struct nf_bridge_info *nf_bridge;
|
||||
#endif
|
||||
@@ -1219,15 +1215,6 @@ static inline void nf_reset(struct sk_buff *skb)
|
||||
{
|
||||
nf_conntrack_put(skb->nfct);
|
||||
skb->nfct = NULL;
|
||||
#ifdef CONFIG_NETFILTER_DEBUG
|
||||
skb->nf_debug = 0;
|
||||
#endif
|
||||
}
|
||||
static inline void nf_reset_debug(struct sk_buff *skb)
|
||||
{
|
||||
#ifdef CONFIG_NETFILTER_DEBUG
|
||||
skb->nf_debug = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef CONFIG_BRIDGE_NETFILTER
|
||||
|
@@ -16,13 +16,13 @@ struct kobject;
|
||||
struct module;
|
||||
|
||||
struct attribute {
|
||||
char * name;
|
||||
const char * name;
|
||||
struct module * owner;
|
||||
mode_t mode;
|
||||
};
|
||||
|
||||
struct attribute_group {
|
||||
char * name;
|
||||
const char * name;
|
||||
struct attribute ** attrs;
|
||||
};
|
||||
|
||||
@@ -73,6 +73,7 @@ struct sysfs_dirent {
|
||||
int s_type;
|
||||
umode_t s_mode;
|
||||
struct dentry * s_dentry;
|
||||
struct iattr * s_iattr;
|
||||
};
|
||||
|
||||
#define SYSFS_ROOT 0x0001
|
||||
@@ -105,11 +106,11 @@ sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode);
|
||||
extern void
|
||||
sysfs_remove_file(struct kobject *, const struct attribute *);
|
||||
|
||||
extern int
|
||||
sysfs_create_link(struct kobject * kobj, struct kobject * target, char * name);
|
||||
extern int
|
||||
sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name);
|
||||
|
||||
extern void
|
||||
sysfs_remove_link(struct kobject *, char * name);
|
||||
sysfs_remove_link(struct kobject *, const char * name);
|
||||
|
||||
int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr);
|
||||
int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
|
||||
@@ -153,12 +154,12 @@ static inline void sysfs_remove_file(struct kobject * k, const struct attribute
|
||||
;
|
||||
}
|
||||
|
||||
static inline int sysfs_create_link(struct kobject * k, struct kobject * t, char * n)
|
||||
static inline int sysfs_create_link(struct kobject * k, struct kobject * t, const char * n)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void sysfs_remove_link(struct kobject * k, char * name)
|
||||
static inline void sysfs_remove_link(struct kobject * k, const char * name)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
@@ -287,15 +287,14 @@ struct usb_bus {
|
||||
|
||||
struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
|
||||
|
||||
struct class_device class_dev; /* class device for this bus */
|
||||
struct class_device *class_dev; /* class device for this bus */
|
||||
struct kref kref; /* handles reference counting this bus */
|
||||
void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */
|
||||
#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
|
||||
struct mon_bus *mon_bus; /* non-null when associated */
|
||||
int monitored; /* non-zero when monitored */
|
||||
#endif
|
||||
};
|
||||
#define to_usb_bus(d) container_of(d, struct usb_bus, class_dev)
|
||||
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
|
@@ -196,6 +196,7 @@ struct xfrm_usersa_info {
|
||||
__u8 flags;
|
||||
#define XFRM_STATE_NOECN 1
|
||||
#define XFRM_STATE_DECAP_DSCP 2
|
||||
#define XFRM_STATE_NOPMTUDISC 4
|
||||
};
|
||||
|
||||
struct xfrm_usersa_id {
|
||||
|
Reference in New Issue
Block a user