diff options
| author | James Simmons <jsimmons@maxwell.earthlink.net> | 2003-04-11 09:57:40 -0700 |
|---|---|---|
| committer | James Simmons <jsimmons@maxwell.earthlink.net> | 2003-04-11 09:57:40 -0700 |
| commit | 662af946628afabef63c32513a507f8bed9a91b4 (patch) | |
| tree | 5f676bda0ff42fb45209012cd17df698b3d773ab /include/linux | |
| parent | 0caf41865c7a8f6ba07af9965d6d5f580025e7e2 (diff) | |
| parent | 21347414286dfc62520a100b1affa2040c16c198 (diff) | |
Merge maxwell.earthlink.net:/usr/src/linus-2.5
into maxwell.earthlink.net:/usr/src/fbdev-2.5
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/i2c-dev.h | 6 | ||||
| -rw-r--r-- | include/linux/i2c.h | 13 | ||||
| -rw-r--r-- | include/linux/if_bridge.h | 2 | ||||
| -rw-r--r-- | include/linux/igmp.h | 98 | ||||
| -rw-r--r-- | include/linux/in.h | 26 | ||||
| -rw-r--r-- | include/linux/inetdevice.h | 10 | ||||
| -rw-r--r-- | include/linux/kobject.h | 22 |
7 files changed, 167 insertions, 10 deletions
diff --git a/include/linux/i2c-dev.h b/include/linux/i2c-dev.h index 3803c36293a8..dd2e43c66905 100644 --- a/include/linux/i2c-dev.h +++ b/include/linux/i2c-dev.h @@ -31,16 +31,16 @@ /* This is the structure as used in the I2C_SMBUS ioctl call */ struct i2c_smbus_ioctl_data { - char read_write; + __u8 read_write; __u8 command; - int size; + __u32 size; union i2c_smbus_data *data; }; /* This is the structure as used in the I2C_RDWR ioctl call */ struct i2c_rdwr_ioctl_data { struct i2c_msg *msgs; /* pointers to i2c_msgs */ - int nmsgs; /* number of i2c_msgs */ + __u32 nmsgs; /* number of i2c_msgs */ }; #endif /* _LINUX_I2C_DEV_H */ diff --git a/include/linux/i2c.h b/include/linux/i2c.h index bc10de846363..12befd6bd7e0 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h @@ -182,6 +182,13 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) return dev_set_drvdata (&dev->dev, data); } +#define I2C_DEVNAME(str) .dev = { .name = str } + +static inline char *i2c_clientname(struct i2c_client *c) +{ + return c->dev.name; +} + /* * The following structs are for those who like to implement new bus drivers: * i2c_algorithm is the interface to a class of hardware solutions which can @@ -360,15 +367,15 @@ extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); */ struct i2c_msg { __u16 addr; /* slave address */ - unsigned short flags; + __u16 flags; #define I2C_M_TEN 0x10 /* we have a ten bit chip address */ #define I2C_M_RD 0x01 #define I2C_M_NOSTART 0x4000 #define I2C_M_REV_DIR_ADDR 0x2000 #define I2C_M_IGNORE_NAK 0x1000 #define I2C_M_NO_RD_ACK 0x0800 - short len; /* msg length */ - char *buf; /* pointer to msg data */ + __u16 len; /* msg length */ + __u8 *buf; /* pointer to msg data */ }; /* To determine what functionality is present */ diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 77b3c632f118..099368acb7ed 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h @@ -101,7 +101,7 @@ struct __fdb_entry struct net_bridge; struct net_bridge_port; -extern int (*br_ioctl_hook)(unsigned long arg); +extern void brioctl_set(int (*ioctl_hook)(unsigned long)); extern int (*br_handle_frame_hook)(struct sk_buff *skb); extern int (*br_should_route_hook)(struct sk_buff **pskb); diff --git a/include/linux/igmp.h b/include/linux/igmp.h index fd28c22a5036..2cc2472d2eb2 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h @@ -32,13 +32,60 @@ struct igmphdr __u32 group; }; +/* V3 group record types [grec_type] */ +#define IGMPV3_MODE_IS_INCLUDE 1 +#define IGMPV3_MODE_IS_EXCLUDE 2 +#define IGMPV3_CHANGE_TO_INCLUDE 3 +#define IGMPV3_CHANGE_TO_EXCLUDE 4 +#define IGMPV3_ALLOW_NEW_SOURCES 5 +#define IGMPV3_BLOCK_OLD_SOURCES 6 + +struct igmpv3_grec { + __u8 grec_type; + __u8 grec_auxwords; + __u16 grec_nsrcs; + __u32 grec_mca; + __u32 grec_src[0]; +}; + +struct igmpv3_report { + __u8 type; + __u8 resv1; + __u16 csum; + __u16 resv2; + __u16 ngrec; + struct igmpv3_grec grec[0]; +}; + +struct igmpv3_query { + __u8 type; + __u8 code; + __u16 csum; + __u32 group; +#if defined(__LITTLE_ENDIAN_BITFIELD) + __u8 qrv:3, + suppress:1, + resv:4; +#elif defined(__BIG_ENDIAN_BITFIELD) + __u8 resv:4, + suppress:1, + qrv:3; +#else +#error "Please fix <asm/byteorder.h>" +#endif + __u8 qqic; + __u16 nsrcs; + __u32 srcs[0]; +}; + #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ #define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ #define IGMP_DVMRP 0x13 /* DVMRP routing */ #define IGMP_PIM 0x14 /* PIM routing */ #define IGMP_TRACE 0x15 -#define IGMP_HOST_NEW_MEMBERSHIP_REPORT 0x16 /* New version of 0x11 */ +#define IGMPV2_HOST_MEMBERSHIP_REPORT 0x16 /* V2 version of 0x11 */ #define IGMP_HOST_LEAVE_MESSAGE 0x17 +#define IGMPV3_HOST_MEMBERSHIP_REPORT 0x22 /* V3 version of 0x11 */ #define IGMP_MTRACE_RESP 0x1e #define IGMP_MTRACE 0x1f @@ -68,6 +115,7 @@ struct igmphdr #define IGMP_ALL_HOSTS htonl(0xE0000001L) #define IGMP_ALL_ROUTER htonl(0xE0000002L) +#define IGMPV3_ALL_MCR htonl(0xE0000016L) #define IGMP_LOCAL_GROUP htonl(0xE0000000L) #define IGMP_LOCAL_GROUP_MASK htonl(0xFFFFFF00L) @@ -79,6 +127,18 @@ struct igmphdr #include <linux/skbuff.h> #include <linux/in.h> +struct ip_sf_socklist +{ + unsigned int sl_max; + unsigned int sl_count; + __u32 sl_addr[0]; +}; + +#define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \ + (count) * sizeof(__u32)) + +#define IP_SFBLOCK 10 /* allocate this many at once */ + /* ip_mc_socklist is real list now. Speed is not argument; this list never used in fast path code */ @@ -88,12 +148,28 @@ struct ip_mc_socklist struct ip_mc_socklist *next; int count; struct ip_mreqn multi; + unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ + struct ip_sf_socklist *sflist; +}; + +struct ip_sf_list +{ + struct ip_sf_list *sf_next; + __u32 sf_inaddr; + unsigned long sf_count[2]; /* include/exclude counts */ + unsigned char sf_gsresp; /* include in g & s response? */ + unsigned char sf_oldin; /* change state */ + unsigned char sf_crcount; /* retrans. left to send */ }; struct ip_mc_list { struct in_device *interface; unsigned long multiaddr; + struct ip_sf_list *sources; + struct ip_sf_list *tomb; + unsigned int sfmode; + unsigned long sfcount[2]; struct ip_mc_list *next; struct timer_list timer; int users; @@ -103,13 +179,31 @@ struct ip_mc_list char reporter; char unsolicit_count; char loaded; + unsigned char gsquery; /* check source marks? */ + unsigned char crcount; }; -extern int ip_check_mc(struct in_device *dev, u32 mc_addr); +/* V3 exponential field decoding */ +#define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) +#define IGMPV3_EXP(thresh, nbmant, nbexp, value) \ + ((value) < (thresh) ? (value) : \ + ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \ + (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp)))) + +#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) +#define IGMPV3_MRC(value) IGMPV3_EXP(0x8000, 12, 3, value) + +extern int ip_check_mc(struct in_device *dev, u32 mc_addr, u32 src_addr, u16 proto); extern int igmp_rcv(struct sk_buff *); extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); extern void ip_mc_drop_socket(struct sock *sk); +extern int ip_mc_source(int add, int omode, struct sock *sk, + struct ip_mreq_source *mreqs); +extern int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf); +extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, + struct ip_msfilter *optval, int *optlen); +extern int ip_mc_sf_allow(struct sock *sk, u32 local, u32 rmt, int dif); extern void ip_mr_init(void); extern void ip_mc_init_dev(struct in_device *); extern void ip_mc_destroy_dev(struct in_device *); diff --git a/include/linux/in.h b/include/linux/in.h index 24814adc8643..bd2ec6c01f4f 100644 --- a/include/linux/in.h +++ b/include/linux/in.h @@ -85,6 +85,14 @@ struct in_addr { #define IP_MULTICAST_LOOP 34 #define IP_ADD_MEMBERSHIP 35 #define IP_DROP_MEMBERSHIP 36 +#define IP_UNBLOCK_SOURCE 37 +#define IP_BLOCK_SOURCE 38 +#define IP_ADD_SOURCE_MEMBERSHIP 39 +#define IP_DROP_SOURCE_MEMBERSHIP 40 +#define IP_MSFILTER 41 + +#define MCAST_EXCLUDE 0 +#define MCAST_INCLUDE 1 /* These need to appear somewhere around here */ #define IP_DEFAULT_MULTICAST_TTL 1 @@ -105,6 +113,24 @@ struct ip_mreqn int imr_ifindex; /* Interface index */ }; +struct ip_mreq_source { + __u32 imr_multiaddr; + __u32 imr_interface; + __u32 imr_sourceaddr; +}; + +struct ip_msfilter { + __u32 imsf_multiaddr; + __u32 imsf_interface; + __u32 imsf_fmode; + __u32 imsf_numsrc; + __u32 imsf_slist[1]; +}; + +#define IP_MSFILTER_SIZE(numsrc) \ + (sizeof(struct ip_msfilter) - sizeof(__u32) \ + + (numsrc) * sizeof(__u32)) + struct in_pktinfo { int ipi_ifindex; diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index c88a595b6177..18913dfaddb1 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -34,7 +34,17 @@ struct in_device int dead; struct in_ifaddr *ifa_list; /* IP ifaddr chain */ struct ip_mc_list *mc_list; /* IP multicast filter chain */ + rwlock_t mc_lock; /* for mc_tomb */ + struct ip_mc_list *mc_tomb; unsigned long mr_v1_seen; + unsigned long mr_v2_seen; + unsigned long mr_maxdelay; + unsigned char mr_qrv; + unsigned char mr_gq_running; + unsigned char mr_ifc_count; + struct timer_list mr_gq_timer; /* general query timer */ + struct timer_list mr_ifc_timer; /* interface change timer */ + struct neigh_parms *arp_parms; struct ipv4_devconf cnf; }; diff --git a/include/linux/kobject.h b/include/linux/kobject.h index e9cfa0dc3d24..8c84e7bce42e 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h @@ -57,12 +57,24 @@ struct kobj_type { * of object; multiple ksets can belong to one subsystem. All * ksets of a subsystem share the subsystem's lock. * + * Each kset can support hotplugging; if it does, it will be given + * the opportunity to filter out specific kobjects from being + * reported, as well as to add its own "data" elements to the + * environment being passed to the hotplug helper. */ +struct kset_hotplug_ops { + int (*filter)(struct kset *kset, struct kobject *kobj); + 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); +}; + struct kset { struct subsystem * subsys; struct kobj_type * ktype; struct list_head list; struct kobject kobj; + struct kset_hotplug_ops * hotplug_ops; }; @@ -86,6 +98,13 @@ static inline void kset_put(struct kset * k) kobject_put(&k->kobj); } +static inline struct kobj_type * get_ktype(struct kobject * k) +{ + if (k->kset && k->kset->ktype) + return k->kset->ktype; + else + return k->ktype; +} extern struct kobject * kset_find_obj(struct kset *, const char *); @@ -95,11 +114,12 @@ struct subsystem { struct rw_semaphore rwsem; }; -#define decl_subsys(_name,_type) \ +#define decl_subsys(_name,_type,_hotplug_ops) \ struct subsystem _name##_subsys = { \ .kset = { \ .kobj = { .name = __stringify(_name) }, \ .ktype = _type, \ + .hotplug_ops =_hotplug_ops, \ } \ } |
