X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=include%2Flinux%2Fconnector.h;h=3a779ffba60bca25ac850637e85cd6fd8ab14642;hb=424264b7b220e8eee165dc3080ae48692af73dec;hp=10eb56b2940ad8c8b7f6775de247d552a99cc6fe;hpb=a240d9f1d8e6421cb970632b93e71b2f66c2cd70;p=safe%2Fjmp%2Flinux-2.6 diff --git a/include/linux/connector.h b/include/linux/connector.h index 10eb56b..3a779ff 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h @@ -22,10 +22,7 @@ #ifndef __CONNECTOR_H #define __CONNECTOR_H -#include - -#define CN_IDX_CONNECTOR 0xffffffff -#define CN_VAL_CONNECTOR 0xffffffff +#include /* * Process Events connector unique ids -- used for message routing @@ -36,14 +33,22 @@ #define CN_VAL_CIFS 0x1 #define CN_W1_IDX 0x3 /* w1 communication */ #define CN_W1_VAL 0x1 - - -#define CN_NETLINK_USERS 4 +#define CN_IDX_V86D 0x4 +#define CN_VAL_V86D_UVESAFB 0x1 +#define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */ +#define CN_DST_IDX 0x6 +#define CN_DST_VAL 0x1 +#define CN_IDX_DM 0x7 /* Device Mapper */ +#define CN_VAL_DM_USERSPACE_LOG 0x1 +#define CN_IDX_DRBD 0x8 +#define CN_VAL_DRBD 0x1 + +#define CN_NETLINK_USERS 8 /* * Maximum connector's message size. */ -#define CONNECTOR_MAX_MSG_SIZE 1024 +#define CONNECTOR_MAX_MSG_SIZE 16384 /* * idx and val are unique identifiers which @@ -67,30 +72,6 @@ struct cn_msg { __u8 data[0]; }; -/* - * Notify structure - requests notification about - * registering/unregistering idx/val in range [first, first+range]. - */ -struct cn_notify_req { - __u32 first; - __u32 range; -}; - -/* - * Main notification control message - * *_notify_num - number of appropriate cn_notify_req structures after - * this struct. - * group - notification receiver's idx. - * len - total length of the attached data. - */ -struct cn_ctl_msg { - __u32 idx_notify_num; - __u32 val_notify_num; - __u32 group; - __u32 len; - __u8 data[0]; -}; - #ifdef __KERNEL__ #include @@ -107,11 +88,16 @@ struct cn_queue_dev { unsigned char name[CN_CBQ_NAMELEN]; struct workqueue_struct *cn_queue; + /* Sent to kevent to create cn_queue only when needed */ + struct work_struct wq_creation; + /* Tell if the wq_creation job is pending/completed */ + atomic_t wq_requested; + /* Wait for cn_queue to be created */ + wait_queue_head_t wq_created; struct list_head queue_list; spinlock_t queue_lock; - int netlink_groups; struct sock *nls; }; @@ -121,31 +107,21 @@ struct cn_callback_id { }; struct cn_callback_data { - void (*destruct_data) (void *); - void *ddata; - - void *callback_priv; - void (*callback) (void *); + struct sk_buff *skb; + void (*callback) (struct cn_msg *, struct netlink_skb_parms *); void *free; }; struct cn_callback_entry { struct list_head callback_entry; - struct cn_callback *cb; struct work_struct work; struct cn_queue_dev *pdev; struct cn_callback_id id; struct cn_callback_data data; - int seq, group; - struct sock *nls; -}; - -struct cn_ctl_entry { - struct list_head notify_entry; - struct cn_ctl_msg *msg; + u32 seq, group; }; struct cn_dev { @@ -153,18 +129,20 @@ struct cn_dev { u32 seq, groups; struct sock *nls; - void (*input) (struct sock * sk, int len); + void (*input) (struct sk_buff *skb); struct cn_queue_dev *cbdev; }; -int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); +int cn_add_callback(struct cb_id *, char *, void (*callback) (struct cn_msg *, struct netlink_skb_parms *)); void cn_del_callback(struct cb_id *); int cn_netlink_send(struct cn_msg *, u32, gfp_t); -int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); +int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(struct cn_msg *, struct netlink_skb_parms *)); void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); +int queue_cn_work(struct cn_callback_entry *cbq, struct work_struct *work); + struct cn_queue_dev *cn_queue_alloc_dev(char *name, struct sock *); void cn_queue_free_dev(struct cn_queue_dev *dev); @@ -172,7 +150,5 @@ int cn_cb_equal(struct cb_id *, struct cb_id *); void cn_queue_wrapper(struct work_struct *work); -extern int cn_already_initialized; - #endif /* __KERNEL__ */ #endif /* __CONNECTOR_H */