smbfs: add bdi backing to mount session
[safe/jmp/linux-2.6] / include / linux / connector.h
index 10eb56b..3a779ff 100644 (file)
 #ifndef __CONNECTOR_H
 #define __CONNECTOR_H
 
-#include <asm/types.h>
-
-#define CN_IDX_CONNECTOR               0xffffffff
-#define CN_VAL_CONNECTOR               0xffffffff
+#include <linux/types.h>
 
 /*
  * Process Events connector unique ids -- used for message routing
 #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 <asm/atomic.h>
@@ -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 */