iucv: introduce loadable iucv interface
authorFrank Blaschka <frank.blaschka@de.ibm.com>
Mon, 8 Aug 2011 01:33:49 +0000 (01:33 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 13 Aug 2011 08:10:15 +0000 (01:10 -0700)
This patch adds a symbol to dynamically load iucv functions.

Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/iucv/iucv.h
net/iucv/iucv.c

index 1121baa9f695828aa444de2b41f50b7cf0260f99..0894ced31957cf64f992e4676fdd402056e2a39b 100644 (file)
@@ -120,7 +120,7 @@ struct iucv_message {
        u32 reply_size;
        u8  rmmsg[8];
        u8  flags;
-};
+} __packed;
 
 /*
  * struct iucv_handler
@@ -459,3 +459,37 @@ int __iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
 int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
                          u8 flags, u32 srccls, void *buffer, size_t size,
                          void *answer, size_t asize, size_t *residual);
+
+struct iucv_interface {
+       int (*message_receive)(struct iucv_path *path, struct iucv_message *msg,
+               u8 flags, void *buffer, size_t size, size_t *residual);
+       int (*__message_receive)(struct iucv_path *path,
+               struct iucv_message *msg, u8 flags, void *buffer, size_t size,
+               size_t *residual);
+       int (*message_reply)(struct iucv_path *path, struct iucv_message *msg,
+               u8 flags, void *reply, size_t size);
+       int (*message_reject)(struct iucv_path *path, struct iucv_message *msg);
+       int (*message_send)(struct iucv_path *path, struct iucv_message *msg,
+               u8 flags, u32 srccls, void *buffer, size_t size);
+       int (*__message_send)(struct iucv_path *path, struct iucv_message *msg,
+               u8 flags, u32 srccls, void *buffer, size_t size);
+       int (*message_send2way)(struct iucv_path *path,
+               struct iucv_message *msg, u8 flags, u32 srccls, void *buffer,
+               size_t size, void *answer, size_t asize, size_t *residual);
+       int (*message_purge)(struct iucv_path *path, struct iucv_message *msg,
+               u32 srccls);
+       int (*path_accept)(struct iucv_path *path, struct iucv_handler *handler,
+               u8 userdata[16], void *private);
+       int (*path_connect)(struct iucv_path *path,
+               struct iucv_handler *handler,
+               u8 userid[8], u8 system[8], u8 userdata[16], void *private);
+       int (*path_quiesce)(struct iucv_path *path, u8 userdata[16]);
+       int (*path_resume)(struct iucv_path *path, u8 userdata[16]);
+       int (*path_sever)(struct iucv_path *path, u8 userdata[16]);
+       int (*iucv_register)(struct iucv_handler *handler, int smp);
+       void (*iucv_unregister)(struct iucv_handler *handler, int smp);
+       struct bus_type *bus;
+       struct device *root;
+};
+
+extern struct iucv_interface iucv_if;
index 075a3808aa4005cdbea5aca59430a1e7970c0cad..403be43b793d737a73cf68a3eee8222fb996c535 100644 (file)
@@ -1974,6 +1974,27 @@ out:
        return rc;
 }
 
+struct iucv_interface iucv_if = {
+       .message_receive = iucv_message_receive,
+       .__message_receive = __iucv_message_receive,
+       .message_reply = iucv_message_reply,
+       .message_reject = iucv_message_reject,
+       .message_send = iucv_message_send,
+       .__message_send = __iucv_message_send,
+       .message_send2way = iucv_message_send2way,
+       .message_purge = iucv_message_purge,
+       .path_accept = iucv_path_accept,
+       .path_connect = iucv_path_connect,
+       .path_quiesce = iucv_path_quiesce,
+       .path_resume = iucv_path_resume,
+       .path_sever = iucv_path_sever,
+       .iucv_register = iucv_register,
+       .iucv_unregister = iucv_unregister,
+       .bus = NULL,
+       .root = NULL,
+};
+EXPORT_SYMBOL(iucv_if);
+
 /**
  * iucv_init
  *
@@ -2038,6 +2059,8 @@ static int __init iucv_init(void)
        rc = bus_register(&iucv_bus);
        if (rc)
                goto out_reboot;
+       iucv_if.root = iucv_root;
+       iucv_if.bus = &iucv_bus;
        return 0;
 
 out_reboot: