xref: /openbmc/linux/include/net/iucv/iucv.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
22356f4cbSMartin Schwidefsky /*
32356f4cbSMartin Schwidefsky  *  drivers/s390/net/iucv.h
42356f4cbSMartin Schwidefsky  *    IUCV base support.
52356f4cbSMartin Schwidefsky  *
62356f4cbSMartin Schwidefsky  *  S390 version
72356f4cbSMartin Schwidefsky  *    Copyright 2000, 2006 IBM Corporation
82356f4cbSMartin Schwidefsky  *    Author(s):Alan Altmark (Alan_Altmark@us.ibm.com)
92356f4cbSMartin Schwidefsky  *		Xenia Tkatschow (xenia@us.ibm.com)
102356f4cbSMartin Schwidefsky  *    Rewritten for af_iucv:
112356f4cbSMartin Schwidefsky  *	Martin Schwidefsky <schwidefsky@de.ibm.com>
122356f4cbSMartin Schwidefsky  *
132356f4cbSMartin Schwidefsky  *
142356f4cbSMartin Schwidefsky  * Functionality:
152356f4cbSMartin Schwidefsky  * To explore any of the IUCV functions, one must first register their
162356f4cbSMartin Schwidefsky  * program using iucv_register(). Once your program has successfully
172356f4cbSMartin Schwidefsky  * completed a register, it can exploit the other functions.
182356f4cbSMartin Schwidefsky  * For furthur reference on all IUCV functionality, refer to the
192356f4cbSMartin Schwidefsky  * CP Programming Services book, also available on the web thru
2004b090d5SMartin Schwidefsky  * www.vm.ibm.com/pubs, manual # SC24-6084
212356f4cbSMartin Schwidefsky  *
222356f4cbSMartin Schwidefsky  * Definition of Return Codes
232356f4cbSMartin Schwidefsky  * - All positive return codes including zero are reflected back
242356f4cbSMartin Schwidefsky  *   from CP. The definition of each return code can be found in
252356f4cbSMartin Schwidefsky  *   CP Programming Services book.
262356f4cbSMartin Schwidefsky  * - Return Code of:
272356f4cbSMartin Schwidefsky  *   -EINVAL: Invalid value
282356f4cbSMartin Schwidefsky  *   -ENOMEM: storage allocation failed
292356f4cbSMartin Schwidefsky  */
302356f4cbSMartin Schwidefsky 
312356f4cbSMartin Schwidefsky #include <linux/types.h>
325a0e3ad6STejun Heo #include <linux/slab.h>
332356f4cbSMartin Schwidefsky #include <asm/debug.h>
342356f4cbSMartin Schwidefsky 
352356f4cbSMartin Schwidefsky /*
362356f4cbSMartin Schwidefsky  * IUCV option flags usable by device drivers:
372356f4cbSMartin Schwidefsky  *
382356f4cbSMartin Schwidefsky  * IUCV_IPRMDATA  Indicates that your program can handle a message in the
392356f4cbSMartin Schwidefsky  *		  parameter list / a message is sent in the parameter list.
402356f4cbSMartin Schwidefsky  *		  Used for iucv_path_accept, iucv_path_connect,
412356f4cbSMartin Schwidefsky  *		  iucv_message_reply, iucv_message_send, iucv_message_send2way.
422356f4cbSMartin Schwidefsky  * IUCV_IPQUSCE	  Indicates that you do not want to receive messages on this
432356f4cbSMartin Schwidefsky  *		  path until an iucv_path_resume is issued.
442356f4cbSMartin Schwidefsky  *		  Used for iucv_path_accept, iucv_path_connect.
452356f4cbSMartin Schwidefsky  * IUCV_IPBUFLST  Indicates that an address list is used for the message data.
462356f4cbSMartin Schwidefsky  *		  Used for iucv_message_receive, iucv_message_send,
472356f4cbSMartin Schwidefsky  *		  iucv_message_send2way.
482356f4cbSMartin Schwidefsky  * IUCV_IPPRTY	  Specifies that you want to send priority messages.
492356f4cbSMartin Schwidefsky  *		  Used for iucv_path_accept, iucv_path_connect,
502356f4cbSMartin Schwidefsky  *		  iucv_message_reply, iucv_message_send, iucv_message_send2way.
512356f4cbSMartin Schwidefsky  * IUCV_IPSYNC	  Indicates a synchronous send request.
522356f4cbSMartin Schwidefsky  *		  Used for iucv_message_send, iucv_message_send2way.
532356f4cbSMartin Schwidefsky  * IUCV_IPANSLST  Indicates that an address list is used for the reply data.
542356f4cbSMartin Schwidefsky  *		  Used for iucv_message_reply, iucv_message_send2way.
552356f4cbSMartin Schwidefsky  * IUCV_IPLOCAL	  Specifies that the communication partner has to be on the
562356f4cbSMartin Schwidefsky  *		  local system. If local is specified no target class can be
572356f4cbSMartin Schwidefsky  *		  specified.
582356f4cbSMartin Schwidefsky  *		  Used for iucv_path_connect.
592356f4cbSMartin Schwidefsky  *
602356f4cbSMartin Schwidefsky  * All flags are defined in the input field IPFLAGS1 of each function
612356f4cbSMartin Schwidefsky  * and can be found in CP Programming Services.
622356f4cbSMartin Schwidefsky  */
632356f4cbSMartin Schwidefsky #define IUCV_IPRMDATA	0x80
642356f4cbSMartin Schwidefsky #define IUCV_IPQUSCE	0x40
652356f4cbSMartin Schwidefsky #define IUCV_IPBUFLST	0x40
662356f4cbSMartin Schwidefsky #define IUCV_IPPRTY	0x20
672356f4cbSMartin Schwidefsky #define IUCV_IPANSLST	0x08
682356f4cbSMartin Schwidefsky #define IUCV_IPSYNC	0x04
692356f4cbSMartin Schwidefsky #define IUCV_IPLOCAL	0x01
702356f4cbSMartin Schwidefsky 
712356f4cbSMartin Schwidefsky /*
722356f4cbSMartin Schwidefsky  * iucv_array : Defines buffer array.
732356f4cbSMartin Schwidefsky  * Inside the array may be 31- bit addresses and 31-bit lengths.
742356f4cbSMartin Schwidefsky  * Use a pointer to an iucv_array as the buffer, reply or answer
752356f4cbSMartin Schwidefsky  * parameter on iucv_message_send, iucv_message_send2way, iucv_message_receive
762356f4cbSMartin Schwidefsky  * and iucv_message_reply if IUCV_IPBUFLST or IUCV_IPANSLST are used.
772356f4cbSMartin Schwidefsky  */
782356f4cbSMartin Schwidefsky struct iucv_array {
792356f4cbSMartin Schwidefsky 	u32 address;
802356f4cbSMartin Schwidefsky 	u32 length;
812356f4cbSMartin Schwidefsky } __attribute__ ((aligned (8)));
822356f4cbSMartin Schwidefsky 
832356f4cbSMartin Schwidefsky extern struct bus_type iucv_bus;
842356f4cbSMartin Schwidefsky extern struct device *iucv_root;
852356f4cbSMartin Schwidefsky 
862356f4cbSMartin Schwidefsky /*
872356f4cbSMartin Schwidefsky  * struct iucv_path
882356f4cbSMartin Schwidefsky  * pathid: 16 bit path identification
892356f4cbSMartin Schwidefsky  * msglim: 16 bit message limit
902356f4cbSMartin Schwidefsky  * flags: properties of the path: IPRMDATA, IPQUSCE, IPPRTY
912356f4cbSMartin Schwidefsky  * handler:  address of iucv handler structure
922356f4cbSMartin Schwidefsky  * private: private information of the handler associated with the path
932356f4cbSMartin Schwidefsky  * list: list_head for the iucv_handler path list.
942356f4cbSMartin Schwidefsky  */
952356f4cbSMartin Schwidefsky struct iucv_path {
962356f4cbSMartin Schwidefsky 	u16 pathid;
972356f4cbSMartin Schwidefsky 	u16 msglim;
982356f4cbSMartin Schwidefsky 	u8  flags;
992356f4cbSMartin Schwidefsky 	void *private;
1002356f4cbSMartin Schwidefsky 	struct iucv_handler *handler;
1012356f4cbSMartin Schwidefsky 	struct list_head list;
1022356f4cbSMartin Schwidefsky };
1032356f4cbSMartin Schwidefsky 
1042356f4cbSMartin Schwidefsky /*
1052356f4cbSMartin Schwidefsky  * struct iucv_message
1062356f4cbSMartin Schwidefsky  * id: 32 bit message id
1072356f4cbSMartin Schwidefsky  * audit: 32 bit error information of purged or replied messages
1082356f4cbSMartin Schwidefsky  * class: 32 bit target class of a message (source class for replies)
1092356f4cbSMartin Schwidefsky  * tag: 32 bit tag to be associated with the message
1102356f4cbSMartin Schwidefsky  * length: 32 bit length of the message / reply
1112356f4cbSMartin Schwidefsky  * reply_size: 32 bit maximum allowed length of the reply
1122356f4cbSMartin Schwidefsky  * rmmsg: 8 byte inline message
1132356f4cbSMartin Schwidefsky  * flags: message properties (IUCV_IPPRTY)
1142356f4cbSMartin Schwidefsky  */
1152356f4cbSMartin Schwidefsky struct iucv_message {
1162356f4cbSMartin Schwidefsky 	u32 id;
1172356f4cbSMartin Schwidefsky 	u32 audit;
1182356f4cbSMartin Schwidefsky 	u32 class;
1192356f4cbSMartin Schwidefsky 	u32 tag;
1202356f4cbSMartin Schwidefsky 	u32 length;
1212356f4cbSMartin Schwidefsky 	u32 reply_size;
1222356f4cbSMartin Schwidefsky 	u8  rmmsg[8];
1232356f4cbSMartin Schwidefsky 	u8  flags;
12496d042a6SFrank Blaschka } __packed;
1252356f4cbSMartin Schwidefsky 
1262356f4cbSMartin Schwidefsky /*
1272356f4cbSMartin Schwidefsky  * struct iucv_handler
1282356f4cbSMartin Schwidefsky  *
1292356f4cbSMartin Schwidefsky  * A vector of functions that handle IUCV interrupts. Each functions gets
1302356f4cbSMartin Schwidefsky  * a parameter area as defined by the CP Programming Services and private
1312356f4cbSMartin Schwidefsky  * pointer that is provided by the user of the interface.
1322356f4cbSMartin Schwidefsky  */
1332356f4cbSMartin Schwidefsky struct iucv_handler {
1342356f4cbSMartin Schwidefsky 	 /*
1352356f4cbSMartin Schwidefsky 	  * The path_pending function is called after an iucv interrupt
1362356f4cbSMartin Schwidefsky 	  * type 0x01 has been received. The base code allocates a path
1372356f4cbSMartin Schwidefsky 	  * structure and "asks" the handler if this path belongs to the
1382356f4cbSMartin Schwidefsky 	  * handler. To accept the path the path_pending function needs
1392356f4cbSMartin Schwidefsky 	  * to call iucv_path_accept and return 0. If the callback returns
1402356f4cbSMartin Schwidefsky 	  * a value != 0 the iucv base code will continue with the next
1412356f4cbSMartin Schwidefsky 	  * handler. The order in which the path_pending functions are
1422356f4cbSMartin Schwidefsky 	  * called is the order of the registration of the iucv handlers
1432356f4cbSMartin Schwidefsky 	  * to the base code.
1442356f4cbSMartin Schwidefsky 	  */
14591e60eb6SUrsula Braun 	int  (*path_pending)(struct iucv_path *, u8 *ipvmid, u8 *ipuser);
1462356f4cbSMartin Schwidefsky 	/*
1472356f4cbSMartin Schwidefsky 	 * The path_complete function is called after an iucv interrupt
1482356f4cbSMartin Schwidefsky 	 * type 0x02 has been received for a path that has been established
1492356f4cbSMartin Schwidefsky 	 * for this handler with iucv_path_connect and got accepted by the
1502356f4cbSMartin Schwidefsky 	 * peer with iucv_path_accept.
1512356f4cbSMartin Schwidefsky 	 */
15291e60eb6SUrsula Braun 	void (*path_complete)(struct iucv_path *, u8 *ipuser);
1532356f4cbSMartin Schwidefsky 	 /*
1542356f4cbSMartin Schwidefsky 	  * The path_severed function is called after an iucv interrupt
1552356f4cbSMartin Schwidefsky 	  * type 0x03 has been received. The communication peer shutdown
1562356f4cbSMartin Schwidefsky 	  * his end of the communication path. The path still exists and
1572356f4cbSMartin Schwidefsky 	  * remaining messages can be received until a iucv_path_sever
1582356f4cbSMartin Schwidefsky 	  * shuts down the other end of the path as well.
1592356f4cbSMartin Schwidefsky 	  */
16091e60eb6SUrsula Braun 	void (*path_severed)(struct iucv_path *, u8 *ipuser);
1612356f4cbSMartin Schwidefsky 	/*
1622356f4cbSMartin Schwidefsky 	 * The path_quiesced function is called after an icuv interrupt
1632356f4cbSMartin Schwidefsky 	 * type 0x04 has been received. The communication peer has quiesced
1642356f4cbSMartin Schwidefsky 	 * the path. Delivery of messages is stopped until iucv_path_resume
1652356f4cbSMartin Schwidefsky 	 * has been called.
1662356f4cbSMartin Schwidefsky 	 */
16791e60eb6SUrsula Braun 	void (*path_quiesced)(struct iucv_path *, u8 *ipuser);
1682356f4cbSMartin Schwidefsky 	/*
1692356f4cbSMartin Schwidefsky 	 * The path_resumed function is called after an icuv interrupt
1702356f4cbSMartin Schwidefsky 	 * type 0x05 has been received. The communication peer has resumed
1712356f4cbSMartin Schwidefsky 	 * the path.
1722356f4cbSMartin Schwidefsky 	 */
17391e60eb6SUrsula Braun 	void (*path_resumed)(struct iucv_path *, u8 *ipuser);
1742356f4cbSMartin Schwidefsky 	/*
1752356f4cbSMartin Schwidefsky 	 * The message_pending function is called after an icuv interrupt
1762356f4cbSMartin Schwidefsky 	 * type 0x06 or type 0x07 has been received. A new message is
17725985edcSLucas De Marchi 	 * available and can be received with iucv_message_receive.
1782356f4cbSMartin Schwidefsky 	 */
1792356f4cbSMartin Schwidefsky 	void (*message_pending)(struct iucv_path *, struct iucv_message *);
1802356f4cbSMartin Schwidefsky 	/*
1812356f4cbSMartin Schwidefsky 	 * The message_complete function is called after an icuv interrupt
1822356f4cbSMartin Schwidefsky 	 * type 0x08 or type 0x09 has been received. A message send with
1832356f4cbSMartin Schwidefsky 	 * iucv_message_send2way has been replied to. The reply can be
1842356f4cbSMartin Schwidefsky 	 * received with iucv_message_receive.
1852356f4cbSMartin Schwidefsky 	 */
1862356f4cbSMartin Schwidefsky 	void (*message_complete)(struct iucv_path *, struct iucv_message *);
1872356f4cbSMartin Schwidefsky 
1882356f4cbSMartin Schwidefsky 	struct list_head list;
1892356f4cbSMartin Schwidefsky 	struct list_head paths;
1902356f4cbSMartin Schwidefsky };
1912356f4cbSMartin Schwidefsky 
1922356f4cbSMartin Schwidefsky /**
1932356f4cbSMartin Schwidefsky  * iucv_register:
1942356f4cbSMartin Schwidefsky  * @handler: address of iucv handler structure
1952356f4cbSMartin Schwidefsky  * @smp: != 0 indicates that the handler can deal with out of order messages
1962356f4cbSMartin Schwidefsky  *
1972356f4cbSMartin Schwidefsky  * Registers a driver with IUCV.
1982356f4cbSMartin Schwidefsky  *
1992356f4cbSMartin Schwidefsky  * Returns 0 on success, -ENOMEM if the memory allocation for the pathid
2002356f4cbSMartin Schwidefsky  * table failed, or -EIO if IUCV_DECLARE_BUFFER failed on all cpus.
2012356f4cbSMartin Schwidefsky  */
2022356f4cbSMartin Schwidefsky int iucv_register(struct iucv_handler *handler, int smp);
2032356f4cbSMartin Schwidefsky 
2042356f4cbSMartin Schwidefsky /**
2052356f4cbSMartin Schwidefsky  * iucv_unregister
2062356f4cbSMartin Schwidefsky  * @handler:  address of iucv handler structure
2072356f4cbSMartin Schwidefsky  * @smp: != 0 indicates that the handler can deal with out of order messages
2082356f4cbSMartin Schwidefsky  *
2092356f4cbSMartin Schwidefsky  * Unregister driver from IUCV.
2102356f4cbSMartin Schwidefsky  */
2112356f4cbSMartin Schwidefsky void iucv_unregister(struct iucv_handler *handle, int smp);
2122356f4cbSMartin Schwidefsky 
2132356f4cbSMartin Schwidefsky /**
2142356f4cbSMartin Schwidefsky  * iucv_path_alloc
2152356f4cbSMartin Schwidefsky  * @msglim: initial message limit
2162356f4cbSMartin Schwidefsky  * @flags: initial flags
2172356f4cbSMartin Schwidefsky  * @gfp: kmalloc allocation flag
2182356f4cbSMartin Schwidefsky  *
2192356f4cbSMartin Schwidefsky  * Allocate a new path structure for use with iucv_connect.
2202356f4cbSMartin Schwidefsky  *
2212356f4cbSMartin Schwidefsky  * Returns NULL if the memory allocation failed or a pointer to the
2222356f4cbSMartin Schwidefsky  * path structure.
2232356f4cbSMartin Schwidefsky  */
iucv_path_alloc(u16 msglim,u8 flags,gfp_t gfp)2242356f4cbSMartin Schwidefsky static inline struct iucv_path *iucv_path_alloc(u16 msglim, u8 flags, gfp_t gfp)
2252356f4cbSMartin Schwidefsky {
2262356f4cbSMartin Schwidefsky 	struct iucv_path *path;
2272356f4cbSMartin Schwidefsky 
2282356f4cbSMartin Schwidefsky 	path = kzalloc(sizeof(struct iucv_path), gfp);
2292356f4cbSMartin Schwidefsky 	if (path) {
2302356f4cbSMartin Schwidefsky 		path->msglim = msglim;
2312356f4cbSMartin Schwidefsky 		path->flags = flags;
2322356f4cbSMartin Schwidefsky 	}
2332356f4cbSMartin Schwidefsky 	return path;
2342356f4cbSMartin Schwidefsky }
2352356f4cbSMartin Schwidefsky 
2362356f4cbSMartin Schwidefsky /**
2372356f4cbSMartin Schwidefsky  * iucv_path_free
2382356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
2392356f4cbSMartin Schwidefsky  *
2402356f4cbSMartin Schwidefsky  * Frees a path structure.
2412356f4cbSMartin Schwidefsky  */
iucv_path_free(struct iucv_path * path)2422356f4cbSMartin Schwidefsky static inline void iucv_path_free(struct iucv_path *path)
2432356f4cbSMartin Schwidefsky {
2442356f4cbSMartin Schwidefsky 	kfree(path);
2452356f4cbSMartin Schwidefsky }
2462356f4cbSMartin Schwidefsky 
2472356f4cbSMartin Schwidefsky /**
2482356f4cbSMartin Schwidefsky  * iucv_path_accept
2492356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
2502356f4cbSMartin Schwidefsky  * @handler: address of iucv handler structure
2512356f4cbSMartin Schwidefsky  * @userdata: 16 bytes of data reflected to the communication partner
2522356f4cbSMartin Schwidefsky  * @private: private data passed to interrupt handlers for this path
2532356f4cbSMartin Schwidefsky  *
2542356f4cbSMartin Schwidefsky  * This function is issued after the user received a connection pending
2552356f4cbSMartin Schwidefsky  * external interrupt and now wishes to complete the IUCV communication path.
2562356f4cbSMartin Schwidefsky  *
2572356f4cbSMartin Schwidefsky  * Returns the result of the CP IUCV call.
2582356f4cbSMartin Schwidefsky  */
2592356f4cbSMartin Schwidefsky int iucv_path_accept(struct iucv_path *path, struct iucv_handler *handler,
26091e60eb6SUrsula Braun 		     u8 *userdata, void *private);
2612356f4cbSMartin Schwidefsky 
2622356f4cbSMartin Schwidefsky /**
2632356f4cbSMartin Schwidefsky  * iucv_path_connect
2642356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
2652356f4cbSMartin Schwidefsky  * @handler: address of iucv handler structure
2662356f4cbSMartin Schwidefsky  * @userid: 8-byte user identification
2672356f4cbSMartin Schwidefsky  * @system: 8-byte target system identification
2682356f4cbSMartin Schwidefsky  * @userdata: 16 bytes of data reflected to the communication partner
2692356f4cbSMartin Schwidefsky  * @private: private data passed to interrupt handlers for this path
2702356f4cbSMartin Schwidefsky  *
2712356f4cbSMartin Schwidefsky  * This function establishes an IUCV path. Although the connect may complete
2722356f4cbSMartin Schwidefsky  * successfully, you are not able to use the path until you receive an IUCV
2732356f4cbSMartin Schwidefsky  * Connection Complete external interrupt.
2742356f4cbSMartin Schwidefsky  *
2752356f4cbSMartin Schwidefsky  * Returns the result of the CP IUCV call.
2762356f4cbSMartin Schwidefsky  */
2772356f4cbSMartin Schwidefsky int iucv_path_connect(struct iucv_path *path, struct iucv_handler *handler,
27891e60eb6SUrsula Braun 		      u8 *userid, u8 *system, u8 *userdata,
2792356f4cbSMartin Schwidefsky 		      void *private);
2802356f4cbSMartin Schwidefsky 
2812356f4cbSMartin Schwidefsky /**
2822356f4cbSMartin Schwidefsky  * iucv_path_quiesce:
2832356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
2842356f4cbSMartin Schwidefsky  * @userdata: 16 bytes of data reflected to the communication partner
2852356f4cbSMartin Schwidefsky  *
2862356f4cbSMartin Schwidefsky  * This function temporarily suspends incoming messages on an IUCV path.
2872356f4cbSMartin Schwidefsky  * You can later reactivate the path by invoking the iucv_resume function.
2882356f4cbSMartin Schwidefsky  *
2892356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
2902356f4cbSMartin Schwidefsky  */
29191e60eb6SUrsula Braun int iucv_path_quiesce(struct iucv_path *path, u8 *userdata);
2922356f4cbSMartin Schwidefsky 
2932356f4cbSMartin Schwidefsky /**
2942356f4cbSMartin Schwidefsky  * iucv_path_resume:
2952356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
2962356f4cbSMartin Schwidefsky  * @userdata: 16 bytes of data reflected to the communication partner
2972356f4cbSMartin Schwidefsky  *
2982356f4cbSMartin Schwidefsky  * This function resumes incoming messages on an IUCV path that has
2992356f4cbSMartin Schwidefsky  * been stopped with iucv_path_quiesce.
3002356f4cbSMartin Schwidefsky  *
3012356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
3022356f4cbSMartin Schwidefsky  */
30391e60eb6SUrsula Braun int iucv_path_resume(struct iucv_path *path, u8 *userdata);
3042356f4cbSMartin Schwidefsky 
3052356f4cbSMartin Schwidefsky /**
3062356f4cbSMartin Schwidefsky  * iucv_path_sever
3072356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
3082356f4cbSMartin Schwidefsky  * @userdata: 16 bytes of data reflected to the communication partner
3092356f4cbSMartin Schwidefsky  *
3102356f4cbSMartin Schwidefsky  * This function terminates an IUCV path.
3112356f4cbSMartin Schwidefsky  *
3122356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
3132356f4cbSMartin Schwidefsky  */
31491e60eb6SUrsula Braun int iucv_path_sever(struct iucv_path *path, u8 *userdata);
3152356f4cbSMartin Schwidefsky 
3162356f4cbSMartin Schwidefsky /**
3172356f4cbSMartin Schwidefsky  * iucv_message_purge
3182356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
3192356f4cbSMartin Schwidefsky  * @msg: address of iucv msg structure
3202356f4cbSMartin Schwidefsky  * @srccls: source class of message
3212356f4cbSMartin Schwidefsky  *
3222356f4cbSMartin Schwidefsky  * Cancels a message you have sent.
3232356f4cbSMartin Schwidefsky  *
3242356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
3252356f4cbSMartin Schwidefsky  */
3262356f4cbSMartin Schwidefsky int iucv_message_purge(struct iucv_path *path, struct iucv_message *msg,
3272356f4cbSMartin Schwidefsky 		       u32 srccls);
3282356f4cbSMartin Schwidefsky 
3292356f4cbSMartin Schwidefsky /**
3302356f4cbSMartin Schwidefsky  * iucv_message_receive
3312356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
3322356f4cbSMartin Schwidefsky  * @msg: address of iucv msg structure
3332356f4cbSMartin Schwidefsky  * @flags: flags that affect how the message is received (IUCV_IPBUFLST)
3342356f4cbSMartin Schwidefsky  * @buffer: address of data buffer or address of struct iucv_array
3352356f4cbSMartin Schwidefsky  * @size: length of data buffer
3362356f4cbSMartin Schwidefsky  * @residual:
3372356f4cbSMartin Schwidefsky  *
3382356f4cbSMartin Schwidefsky  * This function receives messages that are being sent to you over
3392356f4cbSMartin Schwidefsky  * established paths. This function will deal with RMDATA messages
3402356f4cbSMartin Schwidefsky  * embedded in struct iucv_message as well.
3412356f4cbSMartin Schwidefsky  *
34291d5d45eSHendrik Brueckner  * Locking:	local_bh_enable/local_bh_disable
34391d5d45eSHendrik Brueckner  *
3442356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
3452356f4cbSMartin Schwidefsky  */
3462356f4cbSMartin Schwidefsky int iucv_message_receive(struct iucv_path *path, struct iucv_message *msg,
3472356f4cbSMartin Schwidefsky 			 u8 flags, void *buffer, size_t size, size_t *residual);
3482356f4cbSMartin Schwidefsky 
3492356f4cbSMartin Schwidefsky /**
35091d5d45eSHendrik Brueckner  * __iucv_message_receive
35191d5d45eSHendrik Brueckner  * @path: address of iucv path structure
35291d5d45eSHendrik Brueckner  * @msg: address of iucv msg structure
35391d5d45eSHendrik Brueckner  * @flags: flags that affect how the message is received (IUCV_IPBUFLST)
35491d5d45eSHendrik Brueckner  * @buffer: address of data buffer or address of struct iucv_array
35591d5d45eSHendrik Brueckner  * @size: length of data buffer
35691d5d45eSHendrik Brueckner  * @residual:
35791d5d45eSHendrik Brueckner  *
35891d5d45eSHendrik Brueckner  * This function receives messages that are being sent to you over
35991d5d45eSHendrik Brueckner  * established paths. This function will deal with RMDATA messages
36091d5d45eSHendrik Brueckner  * embedded in struct iucv_message as well.
36191d5d45eSHendrik Brueckner  *
36291d5d45eSHendrik Brueckner  * Locking:	no locking.
36391d5d45eSHendrik Brueckner  *
36491d5d45eSHendrik Brueckner  * Returns the result from the CP IUCV call.
36591d5d45eSHendrik Brueckner  */
36691d5d45eSHendrik Brueckner int __iucv_message_receive(struct iucv_path *path, struct iucv_message *msg,
36791d5d45eSHendrik Brueckner 			   u8 flags, void *buffer, size_t size,
36891d5d45eSHendrik Brueckner 			   size_t *residual);
36991d5d45eSHendrik Brueckner 
37091d5d45eSHendrik Brueckner /**
3712356f4cbSMartin Schwidefsky  * iucv_message_reject
3722356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
3732356f4cbSMartin Schwidefsky  * @msg: address of iucv msg structure
3742356f4cbSMartin Schwidefsky  *
3752356f4cbSMartin Schwidefsky  * The reject function refuses a specified message. Between the time you
3762356f4cbSMartin Schwidefsky  * are notified of a message and the time that you complete the message,
3772356f4cbSMartin Schwidefsky  * the message may be rejected.
3782356f4cbSMartin Schwidefsky  *
3792356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
3802356f4cbSMartin Schwidefsky  */
3812356f4cbSMartin Schwidefsky int iucv_message_reject(struct iucv_path *path, struct iucv_message *msg);
3822356f4cbSMartin Schwidefsky 
3832356f4cbSMartin Schwidefsky /**
3842356f4cbSMartin Schwidefsky  * iucv_message_reply
3852356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
3862356f4cbSMartin Schwidefsky  * @msg: address of iucv msg structure
3872356f4cbSMartin Schwidefsky  * @flags: how the reply is sent (IUCV_IPRMDATA, IUCV_IPPRTY, IUCV_IPBUFLST)
3882356f4cbSMartin Schwidefsky  * @reply: address of data buffer or address of struct iucv_array
3892356f4cbSMartin Schwidefsky  * @size: length of reply data buffer
3902356f4cbSMartin Schwidefsky  *
3912356f4cbSMartin Schwidefsky  * This function responds to the two-way messages that you receive. You
3922356f4cbSMartin Schwidefsky  * must identify completely the message to which you wish to reply. ie,
3932356f4cbSMartin Schwidefsky  * pathid, msgid, and trgcls. Prmmsg signifies the data is moved into
3942356f4cbSMartin Schwidefsky  * the parameter list.
3952356f4cbSMartin Schwidefsky  *
3962356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
3972356f4cbSMartin Schwidefsky  */
3982356f4cbSMartin Schwidefsky int iucv_message_reply(struct iucv_path *path, struct iucv_message *msg,
3992356f4cbSMartin Schwidefsky 		       u8 flags, void *reply, size_t size);
4002356f4cbSMartin Schwidefsky 
4012356f4cbSMartin Schwidefsky /**
4022356f4cbSMartin Schwidefsky  * iucv_message_send
4032356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
4042356f4cbSMartin Schwidefsky  * @msg: address of iucv msg structure
4052356f4cbSMartin Schwidefsky  * @flags: how the message is sent (IUCV_IPRMDATA, IUCV_IPPRTY, IUCV_IPBUFLST)
4062356f4cbSMartin Schwidefsky  * @srccls: source class of message
4072356f4cbSMartin Schwidefsky  * @buffer: address of data buffer or address of struct iucv_array
4082356f4cbSMartin Schwidefsky  * @size: length of send buffer
4092356f4cbSMartin Schwidefsky  *
4102356f4cbSMartin Schwidefsky  * This function transmits data to another application. Data to be
4112356f4cbSMartin Schwidefsky  * transmitted is in a buffer and this is a one-way message and the
4122356f4cbSMartin Schwidefsky  * receiver will not reply to the message.
4132356f4cbSMartin Schwidefsky  *
41491d5d45eSHendrik Brueckner  * Locking:	local_bh_enable/local_bh_disable
41591d5d45eSHendrik Brueckner  *
4162356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
4172356f4cbSMartin Schwidefsky  */
4182356f4cbSMartin Schwidefsky int iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
4192356f4cbSMartin Schwidefsky 		      u8 flags, u32 srccls, void *buffer, size_t size);
4202356f4cbSMartin Schwidefsky 
4212356f4cbSMartin Schwidefsky /**
42291d5d45eSHendrik Brueckner  * __iucv_message_send
42391d5d45eSHendrik Brueckner  * @path: address of iucv path structure
42491d5d45eSHendrik Brueckner  * @msg: address of iucv msg structure
42591d5d45eSHendrik Brueckner  * @flags: how the message is sent (IUCV_IPRMDATA, IUCV_IPPRTY, IUCV_IPBUFLST)
42691d5d45eSHendrik Brueckner  * @srccls: source class of message
42791d5d45eSHendrik Brueckner  * @buffer: address of data buffer or address of struct iucv_array
42891d5d45eSHendrik Brueckner  * @size: length of send buffer
42991d5d45eSHendrik Brueckner  *
43091d5d45eSHendrik Brueckner  * This function transmits data to another application. Data to be
43191d5d45eSHendrik Brueckner  * transmitted is in a buffer and this is a one-way message and the
43291d5d45eSHendrik Brueckner  * receiver will not reply to the message.
43391d5d45eSHendrik Brueckner  *
43491d5d45eSHendrik Brueckner  * Locking:	no locking.
43591d5d45eSHendrik Brueckner  *
43691d5d45eSHendrik Brueckner  * Returns the result from the CP IUCV call.
43791d5d45eSHendrik Brueckner  */
43891d5d45eSHendrik Brueckner int __iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
43991d5d45eSHendrik Brueckner 			u8 flags, u32 srccls, void *buffer, size_t size);
44091d5d45eSHendrik Brueckner 
44191d5d45eSHendrik Brueckner /**
4422356f4cbSMartin Schwidefsky  * iucv_message_send2way
4432356f4cbSMartin Schwidefsky  * @path: address of iucv path structure
4442356f4cbSMartin Schwidefsky  * @msg: address of iucv msg structure
4452356f4cbSMartin Schwidefsky  * @flags: how the message is sent and the reply is received
4462356f4cbSMartin Schwidefsky  *	   (IUCV_IPRMDATA, IUCV_IPBUFLST, IUCV_IPPRTY, IUCV_ANSLST)
4472356f4cbSMartin Schwidefsky  * @srccls: source class of message
4482356f4cbSMartin Schwidefsky  * @buffer: address of data buffer or address of struct iucv_array
4492356f4cbSMartin Schwidefsky  * @size: length of send buffer
4502356f4cbSMartin Schwidefsky  * @ansbuf: address of answer buffer or address of struct iucv_array
4512356f4cbSMartin Schwidefsky  * @asize: size of reply buffer
4522356f4cbSMartin Schwidefsky  *
4532356f4cbSMartin Schwidefsky  * This function transmits data to another application. Data to be
4542356f4cbSMartin Schwidefsky  * transmitted is in a buffer. The receiver of the send is expected to
4552356f4cbSMartin Schwidefsky  * reply to the message and a buffer is provided into which IUCV moves
4562356f4cbSMartin Schwidefsky  * the reply to this message.
4572356f4cbSMartin Schwidefsky  *
4582356f4cbSMartin Schwidefsky  * Returns the result from the CP IUCV call.
4592356f4cbSMartin Schwidefsky  */
4602356f4cbSMartin Schwidefsky int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
4612356f4cbSMartin Schwidefsky 			  u8 flags, u32 srccls, void *buffer, size_t size,
4622356f4cbSMartin Schwidefsky 			  void *answer, size_t asize, size_t *residual);
46396d042a6SFrank Blaschka 
46496d042a6SFrank Blaschka struct iucv_interface {
46596d042a6SFrank Blaschka 	int (*message_receive)(struct iucv_path *path, struct iucv_message *msg,
46696d042a6SFrank Blaschka 		u8 flags, void *buffer, size_t size, size_t *residual);
46796d042a6SFrank Blaschka 	int (*__message_receive)(struct iucv_path *path,
46896d042a6SFrank Blaschka 		struct iucv_message *msg, u8 flags, void *buffer, size_t size,
46996d042a6SFrank Blaschka 		size_t *residual);
47096d042a6SFrank Blaschka 	int (*message_reply)(struct iucv_path *path, struct iucv_message *msg,
47196d042a6SFrank Blaschka 		u8 flags, void *reply, size_t size);
47296d042a6SFrank Blaschka 	int (*message_reject)(struct iucv_path *path, struct iucv_message *msg);
47396d042a6SFrank Blaschka 	int (*message_send)(struct iucv_path *path, struct iucv_message *msg,
47496d042a6SFrank Blaschka 		u8 flags, u32 srccls, void *buffer, size_t size);
47596d042a6SFrank Blaschka 	int (*__message_send)(struct iucv_path *path, struct iucv_message *msg,
47696d042a6SFrank Blaschka 		u8 flags, u32 srccls, void *buffer, size_t size);
47796d042a6SFrank Blaschka 	int (*message_send2way)(struct iucv_path *path,
47896d042a6SFrank Blaschka 		struct iucv_message *msg, u8 flags, u32 srccls, void *buffer,
47996d042a6SFrank Blaschka 		size_t size, void *answer, size_t asize, size_t *residual);
48096d042a6SFrank Blaschka 	int (*message_purge)(struct iucv_path *path, struct iucv_message *msg,
48196d042a6SFrank Blaschka 		u32 srccls);
48296d042a6SFrank Blaschka 	int (*path_accept)(struct iucv_path *path, struct iucv_handler *handler,
48396d042a6SFrank Blaschka 		u8 userdata[16], void *private);
48496d042a6SFrank Blaschka 	int (*path_connect)(struct iucv_path *path,
48596d042a6SFrank Blaschka 		struct iucv_handler *handler,
48696d042a6SFrank Blaschka 		u8 userid[8], u8 system[8], u8 userdata[16], void *private);
48796d042a6SFrank Blaschka 	int (*path_quiesce)(struct iucv_path *path, u8 userdata[16]);
48896d042a6SFrank Blaschka 	int (*path_resume)(struct iucv_path *path, u8 userdata[16]);
48996d042a6SFrank Blaschka 	int (*path_sever)(struct iucv_path *path, u8 userdata[16]);
49096d042a6SFrank Blaschka 	int (*iucv_register)(struct iucv_handler *handler, int smp);
49196d042a6SFrank Blaschka 	void (*iucv_unregister)(struct iucv_handler *handler, int smp);
49296d042a6SFrank Blaschka 	struct bus_type *bus;
49396d042a6SFrank Blaschka 	struct device *root;
49496d042a6SFrank Blaschka };
49596d042a6SFrank Blaschka 
49696d042a6SFrank Blaschka extern struct iucv_interface iucv_if;
497