diff options
| author | Greg Kroah-Hartman <greg@kroah.com> | 2003-05-06 20:56:29 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2003-05-06 20:56:29 -0700 |
| commit | 66731c779fd100e15efacea9a8704d7dd345f0e4 (patch) | |
| tree | 8778bfbdc42880977cc96b5fd06cbb33712a7596 /include | |
| parent | 83c0aee51be739d0189167c8d81e4a0a47a3e5be (diff) | |
| parent | c2769b50d1a63028dfc07d26fc8f2cbeac5227d1 (diff) | |
Merge kroah.com:/home/greg/linux/BK/bleed-2.5
into kroah.com:/home/greg/linux/BK/gregkh-2.5
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/i2c.h | 40 | ||||
| -rw-r--r-- | include/linux/ipx.h | 27 | ||||
| -rw-r--r-- | include/linux/list.h | 13 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_nat_core.h | 14 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_nat_helper.h | 13 | ||||
| -rw-r--r-- | include/linux/netfilter_ipv4/ip_nat_protocol.h | 9 | ||||
| -rw-r--r-- | include/linux/pfkeyv2.h | 4 | ||||
| -rw-r--r-- | include/linux/proc_fs.h | 11 | ||||
| -rw-r--r-- | include/linux/seq_file.h | 1 | ||||
| -rw-r--r-- | include/net/dn_dev.h | 1 | ||||
| -rw-r--r-- | include/net/dn_fib.h | 7 | ||||
| -rw-r--r-- | include/net/dn_route.h | 2 | ||||
| -rw-r--r-- | include/net/ipx.h | 68 |
13 files changed, 128 insertions, 82 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index c506e41b9303..6876a6705bb8 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -39,12 +39,6 @@ /* --- General options ------------------------------------------------ */ -#define I2C_ALGO_MAX 4 /* control memory consumption */ -#define I2C_ADAP_MAX 16 -#define I2C_DRIVER_MAX 16 -#define I2C_CLIENT_MAX 32 -#define I2C_DUMMY_MAX 4 - struct i2c_msg; struct i2c_algorithm; struct i2c_adapter; @@ -131,6 +125,7 @@ struct i2c_driver { * i2c_attach_client. */ int (*attach_adapter)(struct i2c_adapter *); + int (*detach_adapter)(struct i2c_adapter *); /* tells the driver that a client is about to be deleted & gives it * the chance to remove its private data. Also, if the client struct @@ -145,6 +140,7 @@ struct i2c_driver { int (*command)(struct i2c_client *client,unsigned int cmd, void *arg); struct device_driver driver; + struct list_head list; }; #define to_i2c_driver(d) container_of(d, struct i2c_driver, driver) @@ -169,6 +165,7 @@ struct i2c_client { int usage_count; /* How many accesses currently */ /* to the client */ struct device dev; /* the device structure */ + struct list_head list; }; #define to_i2c_client(d) container_of(d, struct i2c_client, dev) @@ -228,6 +225,7 @@ struct i2c_adapter { struct module *owner; unsigned int id;/* == is algo->id | hwdep.struct->id, */ /* for registered values see below */ + unsigned int class; struct i2c_algorithm *algo;/* the algorithm to access the bus */ void *algo_data; @@ -236,12 +234,10 @@ struct i2c_adapter { int (*client_unregister)(struct i2c_client *); /* data fields that are valid for all devices */ - struct semaphore bus; - struct semaphore list; + struct semaphore bus_lock; + struct semaphore clist_lock; unsigned int flags;/* flags specifying div. data */ - struct i2c_client *clients[I2C_CLIENT_MAX]; - int timeout; int retries; struct device dev; /* the adapter device */ @@ -250,6 +246,10 @@ struct i2c_adapter { /* No need to set this when you initialize the adapter */ int inode; #endif /* def CONFIG_PROC_FS */ + + int nr; + struct list_head clients; + struct list_head list; }; #define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) @@ -265,7 +265,11 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) /*flags for the driver struct: */ #define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */ -#define I2C_DF_DUMMY 0x02 /* do not connect any clients */ +#if 0 +/* this flag is gone -- there is a (optional) driver->detach_adapter + * callback now which can be used instead */ +# define I2C_DF_DUMMY 0x02 +#endif /*flags for the client struct: */ #define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */ @@ -275,6 +279,12 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data) #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ /* Must equal I2C_M_TEN below */ +/* i2c adapter classes (bitmask) */ +#define I2C_ADAP_CLASS_SMBUS (1<<0) /* lm_sensors, ... */ +#define I2C_ADAP_CLASS_TV_ANALOG (1<<1) /* bttv + friends */ +#define I2C_ADAP_CLASS_TV_DIGINAL (1<<2) /* dbv cards */ +#define I2C_ADAP_CLASS_DDC (1<<3) /* i2c-matroxfb ? */ + /* i2c_client_address_data is the struct for holding default client * addresses for a driver and for the parameters supplied on the * command line @@ -331,6 +341,11 @@ extern struct i2c_client *i2c_get_client(int driver_id, int adapter_id, extern int i2c_use_client(struct i2c_client *); extern int i2c_release_client(struct i2c_client *); +/* call the i2c_client->command() of all attached clients with + * the given arguments */ +extern void i2c_clients_command(struct i2c_adapter *adap, + unsigned int cmd, void *arg); + /* returns -EBUSY if address has been taken, 0 if not. Note that the only other place at which this is called is within i2c_attach_client; so you can cheat by simply not registering. Not recommended, of course! */ @@ -352,7 +367,8 @@ extern int i2c_control(struct i2c_client *,unsigned int, unsigned long); * or -1 if the adapter was not registered. */ extern int i2c_adapter_id(struct i2c_adapter *adap); - +extern struct i2c_adapter* i2c_get_adapter(int id); +extern void i2c_put_adapter(struct i2c_adapter *adap); /* Return the functionality mask */ diff --git a/include/linux/ipx.h b/include/linux/ipx.h index a6fa09060107..4f29c60964c4 100644 --- a/include/linux/ipx.h +++ b/include/linux/ipx.h @@ -5,8 +5,7 @@ #define IPX_NODE_LEN 6 #define IPX_MTU 576 -struct sockaddr_ipx -{ +struct sockaddr_ipx { sa_family_t sipx_family; __u16 sipx_port; __u32 sipx_network; @@ -16,9 +15,8 @@ struct sockaddr_ipx }; /* - * So we can fit the extra info for SIOCSIFADDR into the address nicely + * So we can fit the extra info for SIOCSIFADDR into the address nicely */ - #define sipx_special sipx_port #define sipx_action sipx_zero #define IPX_DLTITF 0 @@ -56,14 +54,13 @@ struct ipx_config_data { * OLD Route Definition for backward compatibility. */ -struct ipx_route_def -{ - __u32 ipx_network; - __u32 ipx_router_network; +struct ipx_route_def { + __u32 ipx_network; + __u32 ipx_router_network; #define IPX_ROUTE_NO_ROUTER 0 - unsigned char ipx_router_node[IPX_NODE_LEN]; - unsigned char ipx_device[16]; - unsigned short ipx_flags; + unsigned char ipx_router_node[IPX_NODE_LEN]; + unsigned char ipx_device[16]; + unsigned short ipx_flags; #define IPX_RT_SNAP 8 #define IPX_RT_8022 4 #define IPX_RT_BLUEBOOK 2 @@ -71,7 +68,7 @@ struct ipx_route_def }; #define SIOCAIPXITFCRT (SIOCPROTOPRIVATE) -#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE+1) -#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE+2) -#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE+3) -#endif /* def _IPX_H_ */ +#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE + 1) +#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE + 2) +#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE + 3) +#endif /* _IPX_H_ */ diff --git a/include/linux/list.h b/include/linux/list.h index 11b8674c14ff..a6dea8afd99d 100644 --- a/include/linux/list.h +++ b/include/linux/list.h @@ -297,6 +297,19 @@ static inline void list_splice_init(struct list_head *list, prefetch(pos->member.next)) /** + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry + * @pos: the type * to use as a loop counter. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_safe(pos, n, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + +/** * list_for_each_rcu - iterate over an rcu-protected list * @pos: the &struct list_head to use as a loop counter. * @head: the head for your list. diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h index e34e08331052..5f1a0bea8073 100644 --- a/include/linux/netfilter_ipv4/ip_nat_core.h +++ b/include/linux/netfilter_ipv4/ip_nat_core.h @@ -16,10 +16,10 @@ extern unsigned int do_bindings(struct ip_conntrack *ct, extern struct list_head protos; -extern unsigned int icmp_reply_translation(struct sk_buff *skb, - struct ip_conntrack *conntrack, - unsigned int hooknum, - int dir); +extern int icmp_reply_translation(struct sk_buff **pskb, + struct ip_conntrack *conntrack, + unsigned int hooknum, + int dir); extern void replace_in_hashes(struct ip_conntrack *conntrack, struct ip_nat_info *info); @@ -30,4 +30,10 @@ extern void place_in_hashes(struct ip_conntrack *conntrack, extern struct ip_nat_protocol ip_nat_protocol_tcp; extern struct ip_nat_protocol ip_nat_protocol_udp; extern struct ip_nat_protocol ip_nat_protocol_icmp; + +/* Call this before modifying an existing IP packet: ensures it is + modifiable and linear to the point you care about (writable_len). + Returns true or false. */ +extern int skb_ip_make_writable(struct sk_buff **pskb, + unsigned int writable_len); #endif /* _IP_NAT_CORE_H */ diff --git a/include/linux/netfilter_ipv4/ip_nat_helper.h b/include/linux/netfilter_ipv4/ip_nat_helper.h index 8e2996f76fed..633a9c37170d 100644 --- a/include/linux/netfilter_ipv4/ip_nat_helper.h +++ b/include/linux/netfilter_ipv4/ip_nat_helper.h @@ -43,22 +43,23 @@ extern struct list_head helpers; extern int ip_nat_helper_register(struct ip_nat_helper *me); extern void ip_nat_helper_unregister(struct ip_nat_helper *me); + +/* These return true or false. */ extern int ip_nat_mangle_tcp_packet(struct sk_buff **skb, struct ip_conntrack *ct, enum ip_conntrack_info ctinfo, unsigned int match_offset, unsigned int match_len, - char *rep_buffer, + const char *rep_buffer, unsigned int rep_len); extern int ip_nat_mangle_udp_packet(struct sk_buff **skb, struct ip_conntrack *ct, enum ip_conntrack_info ctinfo, unsigned int match_offset, unsigned int match_len, - char *rep_buffer, + const char *rep_buffer, unsigned int rep_len); -extern int ip_nat_seq_adjust(struct sk_buff *skb, - struct ip_conntrack *ct, - enum ip_conntrack_info ctinfo); -extern void ip_nat_delete_sack(struct sk_buff *skb); +extern int ip_nat_seq_adjust(struct sk_buff **pskb, + struct ip_conntrack *ct, + enum ip_conntrack_info ctinfo); #endif diff --git a/include/linux/netfilter_ipv4/ip_nat_protocol.h b/include/linux/netfilter_ipv4/ip_nat_protocol.h index 42e2ebf33997..998ab2bd325c 100644 --- a/include/linux/netfilter_ipv4/ip_nat_protocol.h +++ b/include/linux/netfilter_ipv4/ip_nat_protocol.h @@ -18,10 +18,11 @@ struct ip_nat_protocol unsigned int protonum; /* Do a packet translation according to the ip_nat_proto_manip - * and manip type. */ - void (*manip_pkt)(struct iphdr *iph, size_t len, - const struct ip_conntrack_manip *manip, - enum ip_nat_manip_type maniptype); + * and manip type. Return true if succeeded. */ + int (*manip_pkt)(struct sk_buff **pskb, + unsigned int hdroff, + const struct ip_conntrack_manip *manip, + enum ip_nat_manip_type maniptype); /* Is the manipable part of the tuple between min and max incl? */ int (*in_range)(const struct ip_conntrack_tuple *tuple, diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index b5efb37a1c2f..cf3a2f162239 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h @@ -275,8 +275,8 @@ struct sadb_x_nat_t_port { /* Encryption algorithms */ #define SADB_EALG_NONE 0 -#define SADB_EALG_DESCBC 1 -#define SADB_EALG_3DESCBC 2 +#define SADB_EALG_DESCBC 2 +#define SADB_EALG_3DESCBC 3 #define SADB_X_EALG_CASTCBC 6 #define SADB_X_EALG_BLOWFISHCBC 7 #define SADB_EALG_NULL 11 diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 21616fbf2c6e..9f15eadedb46 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h @@ -163,6 +163,15 @@ static inline struct proc_dir_entry *proc_net_create(const char *name, return create_proc_info_entry(name,mode,proc_net,get_info); } +static inline struct proc_dir_entry *proc_net_fops_create(const char *name, + mode_t mode, struct file_operations *fops) +{ + struct proc_dir_entry *res = create_proc_entry(name, mode, proc_net); + if (res) + res->proc_fops = fops; + return res; +} + static inline void proc_net_remove(const char *name) { remove_proc_entry(name,proc_net); @@ -171,7 +180,7 @@ static inline void proc_net_remove(const char *name) #else #define proc_root_driver NULL - +#define proc_net_fops_create(name,mode,fops) do {} while(0) static inline struct proc_dir_entry *proc_net_create(const char *name, mode_t mode, get_info_t *get_info) {return NULL;} static inline void proc_net_remove(const char *name) {} diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index ab12d2608f53..724d51768098 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -60,5 +60,6 @@ int seq_printf(struct seq_file *, const char *, ...) int single_open(struct file *, int (*)(struct seq_file *, void *), void *); int single_release(struct inode *, struct file *); +int seq_release_private(struct inode *, struct file *); #endif #endif diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index 8154b81831b7..120465fd2ba4 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h @@ -71,7 +71,6 @@ struct dn_dev_parms { #define DN_DEV_MPOINT 4 int state; /* Initial state */ int forwarding; /* 0=EndNode, 1=L1Router, 2=L2Router */ - unsigned short blksize; /* Block Size */ unsigned long t2; /* Default value of t2 */ unsigned long t3; /* Default value of t3 */ int priority; /* Priority to be a router */ diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index e4ad06f3e723..1f2123621555 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h @@ -101,10 +101,6 @@ struct dn_fib_table { int (*lookup)(struct dn_fib_table *t, const struct flowi *fl, struct dn_fib_res *res); int (*flush)(struct dn_fib_table *t); -#ifdef CONFIG_PROC_FS - int (*get_info)(struct dn_fib_table *table, char *buf, - int first, int count); -#endif /* CONFIG_PROC_FS */ int (*dump)(struct dn_fib_table *t, struct sk_buff *skb, struct netlink_callback *cb); unsigned char data[0]; @@ -184,6 +180,9 @@ extern struct dn_fib_table *dn_fib_tables[]; #else /* Endnode */ +#define dn_fib_init() (0) +#define dn_fib_cleanup() (0) + #define dn_fib_lookup(fl, res) (-ESRCH) #define dn_fib_info_put(fi) do { } while(0) #define dn_fib_select_multipath(fl, res) do { } while(0) diff --git a/include/net/dn_route.h b/include/net/dn_route.h index 20be3a87e1b7..d084721db198 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h @@ -74,7 +74,7 @@ struct dn_route { __u16 rt_saddr; __u16 rt_daddr; __u16 rt_gateway; - __u16 __padding; + __u16 rt_local_src; /* Source used for forwarding packets */ __u16 rt_src_map; __u16 rt_dst_map; diff --git a/include/net/ipx.h b/include/net/ipx.h index c3b1e4698438..864359402b31 100644 --- a/include/net/ipx.h +++ b/include/net/ipx.h @@ -12,6 +12,7 @@ #include <linux/netdevice.h> #include <net/datalink.h> #include <linux/ipx.h> +#include <linux/list.h> struct ipx_address { __u32 net; @@ -25,11 +26,11 @@ struct ipx_address { #define IPX_MAX_PPROP_HOPS 8 struct ipxhdr { - __u16 ipx_checksum __attribute__ ((packed)); + __u16 ipx_checksum __attribute__ ((packed)); #define IPX_NO_CHECKSUM 0xFFFF - __u16 ipx_pktsize __attribute__ ((packed)); - __u8 ipx_tctrl; - __u8 ipx_type; + __u16 ipx_pktsize __attribute__ ((packed)); + __u8 ipx_tctrl; + __u8 ipx_type; #define IPX_TYPE_UNKNOWN 0x00 #define IPX_TYPE_RIP 0x01 /* may also be 0 */ #define IPX_TYPE_SAP 0x04 /* may also be 0 */ @@ -47,42 +48,42 @@ static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb) struct ipx_interface { /* IPX address */ - __u32 if_netnum; - unsigned char if_node[IPX_NODE_LEN]; - atomic_t refcnt; + __u32 if_netnum; + unsigned char if_node[IPX_NODE_LEN]; + atomic_t refcnt; /* physical device info */ struct net_device *if_dev; struct datalink_proto *if_dlink; - unsigned short if_dlink_type; + unsigned short if_dlink_type; /* socket support */ - unsigned short if_sknum; - struct sock *if_sklist; - spinlock_t if_sklist_lock; + unsigned short if_sknum; + struct sock *if_sklist; + spinlock_t if_sklist_lock; /* administrative overhead */ - int if_ipx_offset; - unsigned char if_internal; - unsigned char if_primary; + int if_ipx_offset; + unsigned char if_internal; + unsigned char if_primary; - struct ipx_interface *if_next; + struct list_head node; /* node in ipx_interfaces list */ }; struct ipx_route { - __u32 ir_net; + __u32 ir_net; struct ipx_interface *ir_intrfc; - unsigned char ir_routed; - unsigned char ir_router_node[IPX_NODE_LEN]; - struct ipx_route *ir_next; - atomic_t refcnt; + unsigned char ir_routed; + unsigned char ir_router_node[IPX_NODE_LEN]; + struct list_head node; /* node in ipx_routes list */ + atomic_t refcnt; }; #ifdef __KERNEL__ struct ipx_cb { - u8 ipx_tctrl; - u32 ipx_dest_net; - u32 ipx_source_net; + u8 ipx_tctrl; + u32 ipx_dest_net; + u32 ipx_source_net; struct { u32 netnum; int index; @@ -92,14 +93,16 @@ struct ipx_cb { struct ipx_opt { struct ipx_address dest_addr; struct ipx_interface *intrfc; - unsigned short port; + unsigned short port; #ifdef CONFIG_IPX_INTERN - unsigned char node[IPX_NODE_LEN]; + unsigned char node[IPX_NODE_LEN]; #endif - unsigned short type; - /* To handle special ncp connection-handling sockets for mars_nwe, - * the connection number must be stored in the socket. */ - unsigned short ipx_ncp_conn; + unsigned short type; + /* + * To handle special ncp connection-handling sockets for mars_nwe, + * the connection number must be stored in the socket. + */ + unsigned short ipx_ncp_conn; }; #define ipx_sk(__sk) ((struct ipx_opt *)(__sk)->protinfo) @@ -108,10 +111,11 @@ struct ipx_opt { #define IPX_MIN_EPHEMERAL_SOCKET 0x4000 #define IPX_MAX_EPHEMERAL_SOCKET 0x7fff -extern struct ipx_route *ipx_routes; +extern struct list_head ipx_routes; extern rwlock_t ipx_routes_lock; -extern struct ipx_interface *ipx_interfaces; +extern struct list_head ipx_interfaces; +extern struct ipx_interface *ipx_interfaces_head(void); extern spinlock_t ipx_interfaces_lock; extern struct ipx_interface *ipx_primary_net; @@ -121,4 +125,4 @@ extern void ipx_proc_exit(void); extern const char *ipx_frame_name(unsigned short); extern const char *ipx_device_name(struct ipx_interface *intrfc); -#endif /* def _NET_INET_IPX_H_ */ +#endif /* _NET_INET_IPX_H_ */ |
