VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / drivers / s390 / net / iucv.h
1 /*
2  *  drivers/s390/net/iucv.h
3  *    IUCV base support.
4  *
5  *  S390 version
6  *    Copyright (C) 2000 IBM Corporation
7  *    Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) 
8  *              Xenia Tkatschow (xenia@us.ibm.com)
9  *
10  *
11  * Functionality:
12  * To explore any of the IUCV functions, one must first register
13  * their program using iucv_register_program(). Once your program has
14  * successfully completed a register, it can exploit the other functions.
15  * For furthur reference on all IUCV functionality, refer to the
16  * CP Programming Services book, also available on the web
17  * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760
18  *
19  *      Definition of Return Codes                                    
20  *      -All positive return codes including zero are reflected back  
21  *       from CP except for iucv_register_program. The definition of each 
22  *       return code can be found in CP Programming Services book.    
23  *       Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760          
24  *      - Return Code of:         
25  *             (-EINVAL) Invalid value       
26  *             (-ENOMEM) storage allocation failed              
27  *      pgmask defined in iucv_register_program will be set depending on input
28  *      paramters. 
29  *      
30  */
31
32 #include <linux/types.h>
33 #include <asm/debug.h>
34
35 /**
36  * Debug Facility stuff
37  */
38 #define IUCV_DBF_SETUP_NAME "iucv_setup"
39 #define IUCV_DBF_SETUP_LEN 32
40 #define IUCV_DBF_SETUP_INDEX 1
41 #define IUCV_DBF_SETUP_NR_AREAS 1
42 #define IUCV_DBF_SETUP_LEVEL 3
43
44 #define IUCV_DBF_DATA_NAME "iucv_data"
45 #define IUCV_DBF_DATA_LEN 128
46 #define IUCV_DBF_DATA_INDEX 1
47 #define IUCV_DBF_DATA_NR_AREAS 1
48 #define IUCV_DBF_DATA_LEVEL 2
49
50 #define IUCV_DBF_TRACE_NAME "iucv_trace"
51 #define IUCV_DBF_TRACE_LEN 16
52 #define IUCV_DBF_TRACE_INDEX 2
53 #define IUCV_DBF_TRACE_NR_AREAS 1
54 #define IUCV_DBF_TRACE_LEVEL 3
55
56 #define IUCV_DBF_TEXT(name,level,text) \
57         do { \
58                 debug_text_event(iucv_dbf_##name,level,text); \
59         } while (0)
60
61 #define IUCV_DBF_HEX(name,level,addr,len) \
62         do { \
63                 debug_event(iucv_dbf_##name,level,(void*)(addr),len); \
64         } while (0)
65
66 extern DEFINE_PER_CPU(char[256], iucv_dbf_txt_buf);
67
68 #define IUCV_DBF_TEXT_(name,level,text...)                              \
69         do {                                                            \
70                 char* iucv_dbf_txt_buf = get_cpu_var(iucv_dbf_txt_buf); \
71                 sprintf(iucv_dbf_txt_buf, text);                        \
72                 debug_text_event(iucv_dbf_##name,level,iucv_dbf_txt_buf); \
73                 put_cpu_var(iucv_dbf_txt_buf);                          \
74         } while (0)
75
76 #define IUCV_DBF_SPRINTF(name,level,text...) \
77         do { \
78                 debug_sprintf_event(iucv_dbf_trace, level, ##text ); \
79                 debug_sprintf_event(iucv_dbf_trace, level, text ); \
80         } while (0)
81
82 /**
83  * some more debug stuff
84  */
85 #define IUCV_HEXDUMP16(importance,header,ptr) \
86 PRINT_##importance(header "%02x %02x %02x %02x  %02x %02x %02x %02x  " \
87                    "%02x %02x %02x %02x  %02x %02x %02x %02x\n", \
88                    *(((char*)ptr)),*(((char*)ptr)+1),*(((char*)ptr)+2), \
89                    *(((char*)ptr)+3),*(((char*)ptr)+4),*(((char*)ptr)+5), \
90                    *(((char*)ptr)+6),*(((char*)ptr)+7),*(((char*)ptr)+8), \
91                    *(((char*)ptr)+9),*(((char*)ptr)+10),*(((char*)ptr)+11), \
92                    *(((char*)ptr)+12),*(((char*)ptr)+13), \
93                    *(((char*)ptr)+14),*(((char*)ptr)+15)); \
94 PRINT_##importance(header "%02x %02x %02x %02x  %02x %02x %02x %02x  " \
95                    "%02x %02x %02x %02x  %02x %02x %02x %02x\n", \
96                    *(((char*)ptr)+16),*(((char*)ptr)+17), \
97                    *(((char*)ptr)+18),*(((char*)ptr)+19), \
98                    *(((char*)ptr)+20),*(((char*)ptr)+21), \
99                    *(((char*)ptr)+22),*(((char*)ptr)+23), \
100                    *(((char*)ptr)+24),*(((char*)ptr)+25), \
101                    *(((char*)ptr)+26),*(((char*)ptr)+27), \
102                    *(((char*)ptr)+28),*(((char*)ptr)+29), \
103                    *(((char*)ptr)+30),*(((char*)ptr)+31));
104
105 static inline void
106 iucv_hex_dump(unsigned char *buf, size_t len)
107 {
108         size_t i;
109
110         for (i = 0; i < len; i++) {
111                 if (i && !(i % 16))
112                         printk("\n");
113                 printk("%02x ", *(buf + i));
114         }
115         printk("\n");
116 }
117 /**
118  * end of debug stuff
119  */
120
121 #define uchar  unsigned char
122 #define ushort unsigned short
123 #define ulong  unsigned long
124 #define iucv_handle_t void *
125
126 /* flags1:
127  * All flags are defined in the field IPFLAGS1 of each function   
128  * and can be found in CP Programming Services.                  
129  * IPLOCAL  - Indicates the connect can only be satisfied on the 
130  *            local system                                       
131  * IPPRTY   - Indicates a priority message                       
132  * IPQUSCE  - Indicates you do not want to receive messages on a 
133  *            path until an iucv_resume is issued                
134  * IPRMDATA - Indicates that the message is in the parameter list
135  */
136 #define IPLOCAL         0x01
137 #define IPPRTY          0x20
138 #define IPQUSCE         0x40
139 #define IPRMDATA        0x80
140
141 /* flags1_out:
142  * All flags are defined in the output field of IPFLAGS1 for each function
143  * and can be found in CP Programming Services.
144  * IPNORPY - Specifies this is a one-way message and no reply is expected.
145  * IPPRTY   - Indicates a priority message is permitted. Defined in flags1.
146  */
147 #define IPNORPY         0x10
148
149 #define Nonpriority_MessagePendingInterruptsFlag         0x80
150 #define Priority_MessagePendingInterruptsFlag            0x40
151 #define Nonpriority_MessageCompletionInterruptsFlag      0x20
152 #define Priority_MessageCompletionInterruptsFlag         0x10
153 #define IUCVControlInterruptsFlag                        0x08
154 #define AllInterrupts                                    0xf8
155 /*
156  * Mapping of external interrupt buffers should be used with the corresponding
157  * interrupt types.                  
158  * Names: iucv_ConnectionPending    ->  connection pending 
159  *        iucv_ConnectionComplete   ->  connection complete
160  *        iucv_ConnectionSevered    ->  connection severed 
161  *        iucv_ConnectionQuiesced   ->  connection quiesced 
162  *        iucv_ConnectionResumed    ->  connection resumed 
163  *        iucv_MessagePending       ->  message pending    
164  *        iucv_MessageComplete      ->  message complete   
165  */
166 typedef struct {
167         u16 ippathid;
168         uchar ipflags1;
169         uchar iptype;
170         u16 ipmsglim;
171         u16 res1;
172         uchar ipvmid[8];
173         uchar ipuser[16];
174         u32 res3;
175         uchar ippollfg;
176         uchar res4[3];
177 } iucv_ConnectionPending;
178
179 typedef struct {
180         u16 ippathid;
181         uchar ipflags1;
182         uchar iptype;
183         u16 ipmsglim;
184         u16 res1;
185         uchar res2[8];
186         uchar ipuser[16];
187         u32 res3;
188         uchar ippollfg;
189         uchar res4[3];
190 } iucv_ConnectionComplete;
191
192 typedef struct {
193         u16 ippathid;
194         uchar res1;
195         uchar iptype;
196         u32 res2;
197         uchar res3[8];
198         uchar ipuser[16];
199         u32 res4;
200         uchar ippollfg;
201         uchar res5[3];
202 } iucv_ConnectionSevered;
203
204 typedef struct {
205         u16 ippathid;
206         uchar res1;
207         uchar iptype;
208         u32 res2;
209         uchar res3[8];
210         uchar ipuser[16];
211         u32 res4;
212         uchar ippollfg;
213         uchar res5[3];
214 } iucv_ConnectionQuiesced;
215
216 typedef struct {
217         u16 ippathid;
218         uchar res1;
219         uchar iptype;
220         u32 res2;
221         uchar res3[8];
222         uchar ipuser[16];
223         u32 res4;
224         uchar ippollfg;
225         uchar res5[3];
226 } iucv_ConnectionResumed;
227
228 typedef struct {
229         u16 ippathid;
230         uchar ipflags1;
231         uchar iptype;
232         u32 ipmsgid;
233         u32 iptrgcls;
234         uchar iprmmsg1[4];
235         union u1 {
236                 u32 ipbfln1f;
237                 uchar iprmmsg2[4];
238         } ln1msg2;
239         u32 res1[3];
240         u32 ipbfln2f;
241         uchar ippollfg;
242         uchar res2[3];
243 } iucv_MessagePending;
244
245 typedef struct {
246         u16 ippathid;
247         uchar ipflags1;
248         uchar iptype;
249         u32 ipmsgid;
250         u32 ipaudit;
251         uchar iprmmsg[8];
252         u32 ipsrccls;
253         u32 ipmsgtag;
254         u32 res;
255         u32 ipbfln2f;
256         uchar ippollfg;
257         uchar res2[3];
258 } iucv_MessageComplete;
259
260 /* 
261  * iucv_interrupt_ops_t: Is a vector of functions that handle 
262  * IUCV interrupts.                                          
263  * Parameter list:                                           
264  *         eib - is a pointer to a 40-byte area described    
265  *               with one of the structures above.           
266  *         pgm_data - this data is strictly for the          
267  *                    interrupt handler that is passed by    
268  *                    the application. This may be an address 
269  *                    or token.                              
270 */
271 typedef struct {
272         void (*ConnectionPending) (iucv_ConnectionPending * eib,
273                                    void *pgm_data);
274         void (*ConnectionComplete) (iucv_ConnectionComplete * eib,
275                                     void *pgm_data);
276         void (*ConnectionSevered) (iucv_ConnectionSevered * eib,
277                                    void *pgm_data);
278         void (*ConnectionQuiesced) (iucv_ConnectionQuiesced * eib,
279                                     void *pgm_data);
280         void (*ConnectionResumed) (iucv_ConnectionResumed * eib,
281                                    void *pgm_data);
282         void (*MessagePending) (iucv_MessagePending * eib, void *pgm_data);
283         void (*MessageComplete) (iucv_MessageComplete * eib, void *pgm_data);
284 } iucv_interrupt_ops_t;
285
286 /*
287  *iucv_array_t : Defines buffer array.                      
288  * Inside the array may be 31- bit addresses and 31-bit lengths. 
289 */
290 typedef struct {
291         u32 address;
292         u32 length;
293 } iucv_array_t __attribute__ ((aligned (8)));
294
295 extern struct bus_type iucv_bus;
296 extern struct device *iucv_root;
297
298 /*   -prototypes-    */
299 /*                                                                
300  * Name: iucv_register_program                                    
301  * Purpose: Registers an application with IUCV                    
302  * Input: prmname - user identification                           
303  *        userid  - machine identification
304  *        pgmmask - indicates which bits in the prmname and userid combined will be
305  *                  used to determine who is given control
306  *        ops     - address of vector of interrupt handlers       
307  *        pgm_data- application data passed to interrupt handlers 
308  * Output: NA                                                     
309  * Return: address of handler                                     
310  *         (0) - Error occurred, registration not completed.
311  * NOTE: Exact cause of failure will be recorded in syslog.                        
312 */
313 iucv_handle_t iucv_register_program (uchar pgmname[16],
314                                      uchar userid[8],
315                                      uchar pgmmask[24],
316                                      iucv_interrupt_ops_t * ops,
317                                      void *pgm_data);
318
319 /*                                                
320  * Name: iucv_unregister_program                  
321  * Purpose: Unregister application with IUCV      
322  * Input: address of handler                      
323  * Output: NA                                     
324  * Return: (0) - Normal return                    
325  *         (-EINVAL) - Internal error, wild pointer     
326 */
327 int iucv_unregister_program (iucv_handle_t handle);
328
329 /*
330  * Name: iucv_accept
331  * Purpose: This function is issued after the user receives a Connection Pending external
332  *          interrupt and now wishes to complete the IUCV communication path.
333  * Input:  pathid - u16 , Path identification number   
334  *         msglim_reqstd - u16, The number of outstanding messages requested.
335  *         user_data - uchar[16], Data specified by the iucv_connect function.
336  *         flags1 - int, Contains options for this path.
337  *           -IPPRTY   - 0x20- Specifies if you want to send priority message.
338  *           -IPRMDATA - 0x80, Specifies whether your program can handle a message
339  *              in  the parameter list.
340  *           -IPQUSCE  - 0x40, Specifies whether you want to quiesce the path being
341  *              established.
342  *         handle - iucv_handle_t, Address of handler.
343  *         pgm_data - void *, Application data passed to interrupt handlers.
344  *         flags1_out - int * Contains information about the path
345  *           - IPPRTY - 0x20, Indicates you may send priority messages.
346  *         msglim - *u16, Number of outstanding messages.
347  * Output: return code from CP IUCV call.
348 */
349
350 int iucv_accept (u16 pathid,
351                  u16 msglim_reqstd,
352                  uchar user_data[16],
353                  int flags1,
354                  iucv_handle_t handle,
355                  void *pgm_data, int *flags1_out, u16 * msglim);
356
357 /*
358  * Name: iucv_connect                                         
359  * Purpose: This function establishes an IUCV path. Although the connect may complete
360  *          successfully, you are not able to use the path until you receive an IUCV 
361  *          Connection Complete external interrupt.            
362  * Input: pathid - u16 *, Path identification number          
363  *        msglim_reqstd - u16, Number of outstanding messages requested       
364  *        user_data - uchar[16], 16-byte user data                    
365  *        userid - uchar[8], User identification
366  *        system_name - uchar[8], 8-byte identifying the system name 
367  *        flags1 - int, Contains options for this path.
368  *          -IPPRTY -   0x20, Specifies if you want to send priority message.
369  *          -IPRMDATA - 0x80, Specifies whether your program can handle a message
370  *               in  the parameter list.
371  *          -IPQUSCE -  0x40, Specifies whether you want to quiesce the path being       
372  *              established.
373  *          -IPLOCAL -  0X01, Allows an application to force the partner to be on 
374  *              the local system. If local is specified then target class cannot be
375  *              specified.                       
376  *        flags1_out - int * Contains information about the path
377  *           - IPPRTY - 0x20, Indicates you may send priority messages.
378  *        msglim - * u16, Number of outstanding messages
379  *        handle - iucv_handle_t, Address of handler                         
380  *        pgm_data - void *, Application data passed to interrupt handlers              
381  * Output: return code from CP IUCV call
382  *         rc - return code from iucv_declare_buffer
383  *         -EINVAL - Invalid handle passed by application 
384  *         -EINVAL - Pathid address is NULL 
385  *         add_pathid_result - Return code from internal function add_pathid         
386 */
387 int
388     iucv_connect (u16 * pathid,
389                   u16 msglim_reqstd,
390                   uchar user_data[16],
391                   uchar userid[8],
392                   uchar system_name[8],
393                   int flags1,
394                   int *flags1_out,
395                   u16 * msglim, iucv_handle_t handle, void *pgm_data);
396
397 /*                                                                     
398  * Name: iucv_purge                                                    
399  * Purpose: This function cancels a message that you have sent.        
400  * Input: pathid - Path identification number.                          
401  *        msgid - Specifies the message ID of the message to be purged.
402  *        srccls - Specifies the source message class.                  
403  * Output: audit - Contains information about asynchronous error       
404  *                 that may have affected the normal completion        
405  *                 of this message.                                    
406  * Return: Return code from CP IUCV call.                           
407 */
408 int iucv_purge (u16 pathid, u32 msgid, u32 srccls, __u32 *audit);
409 /*
410  * Name: iucv_query_maxconn
411  * Purpose: This function determines the maximum number of communication paths you
412  *          may establish.
413  * Return:  maxconn - ulong, Maximum number of connection the virtual machine may
414  *          establish.
415 */
416 ulong iucv_query_maxconn (void);
417
418 /*
419  * Name: iucv_query_bufsize
420  * Purpose: This function determines how large an external interrupt
421  *          buffer IUCV requires to store information.
422  * Return:  bufsize - ulong, Size of external interrupt buffer.
423  */
424 ulong iucv_query_bufsize (void);
425
426 /*                                                                     
427  * Name: iucv_quiesce                                                  
428  * Purpose: This function temporarily suspends incoming messages on an 
429  *          IUCV path. You can later reactivate the path by invoking   
430  *          the iucv_resume function.                                  
431  * Input: pathid - Path identification number                          
432  *        user_data  - 16-bytes of user data                           
433  * Output: NA                                                          
434  * Return: Return code from CP IUCV call.                           
435 */
436 int iucv_quiesce (u16 pathid, uchar user_data[16]);
437
438 /*                                                                     
439  * Name: iucv_receive                                                  
440  * Purpose: This function receives messages that are being sent to you 
441  *          over established paths. Data will be returned in buffer for length of
442  *          buflen.
443  * Input: 
444  *       pathid - Path identification number.                          
445  *       buffer - Address of buffer to receive.                        
446  *       buflen - Length of buffer to receive.                         
447  *       msgid - Specifies the message ID.          
448  *       trgcls - Specifies target class.                       
449  * Output: 
450  *       flags1_out: int *, Contains information about this path.
451  *         IPNORPY - 0x10 Specifies this is a one-way message and no reply is
452  *         expected.      
453  *         IPPRTY  - 0x20 Specifies if you want to send priority message.       
454  *         IPRMDATA - 0x80 specifies the data is contained in the parameter list
455  *       residual_buffer - address of buffer updated by the number
456  *                         of bytes you have received.
457  *       residual_length -      
458  *              Contains one of the following values, if the receive buffer is:
459  *               The same length as the message, this field is zero.
460  *               Longer than the message, this field contains the number of
461  *                bytes remaining in the buffer.
462  *               Shorter than the message, this field contains the residual
463  *                count (that is, the number of bytes remaining in the
464  *                message that does not fit into the buffer. In this
465  *                case b2f0_result = 5.
466  * Return: Return code from CP IUCV call.                           
467  *         (-EINVAL) - buffer address is pointing to NULL                   
468 */
469 int iucv_receive (u16 pathid,
470                   u32 msgid,
471                   u32 trgcls,
472                   void *buffer,
473                   ulong buflen,
474                   int *flags1_out,
475                   ulong * residual_buffer, ulong * residual_length);
476
477  /*                                                                     
478   * Name: iucv_receive_array                                            
479   * Purpose: This function receives messages that are being sent to you 
480   *          over established paths. Data will be returned in first buffer for
481   *          length of first buffer.
482   * Input: pathid - Path identification number.                          
483   *        msgid - specifies the message ID.
484   *        trgcls - Specifies target class.
485   *        buffer - Address of array of buffers.                         
486   *        buflen - Total length of buffers.                             
487   * Output:
488   *        flags1_out: int *, Contains information about this path.
489   *          IPNORPY - 0x10 Specifies this is a one-way message and no reply is
490   *          expected.
491   *          IPPRTY  - 0x20 Specifies if you want to send priority message.
492   *          IPRMDATA - 0x80 specifies the data is contained in the parameter list
493   *       residual_buffer - address points to the current list entry IUCV
494   *                         is working on.
495   *       residual_length -
496   *              Contains one of the following values, if the receive buffer is:
497   *               The same length as the message, this field is zero.
498   *               Longer than the message, this field contains the number of
499   *                bytes remaining in the buffer.
500   *               Shorter than the message, this field contains the residual
501   *                count (that is, the number of bytes remaining in the
502   *                message that does not fit into the buffer. In this
503   *                case b2f0_result = 5.
504   * Return: Return code from CP IUCV call.                           
505   *         (-EINVAL) - Buffer address is NULL.       
506   */
507 int iucv_receive_array (u16 pathid,
508                         u32 msgid,
509                         u32 trgcls,
510                         iucv_array_t * buffer,
511                         ulong buflen,
512                         int *flags1_out,
513                         ulong * residual_buffer, ulong * residual_length);
514
515 /*                                                                       
516  * Name: iucv_reject                                                     
517  * Purpose: The reject function refuses a specified message. Between the 
518  *          time you are notified of a message and the time that you     
519  *          complete the message, the message may be rejected.           
520  * Input: pathid - Path identification number.                            
521  *        msgid - Specifies the message ID.                   
522  *        trgcls - Specifies target class.                                
523  * Output: NA                                                            
524  * Return: Return code from CP IUCV call.                             
525 */
526 int iucv_reject (u16 pathid, u32 msgid, u32 trgcls);
527
528 /*                                                                     
529  * Name: iucv_reply                                                    
530  * Purpose: This function responds to the two-way messages that you    
531  *          receive. You must identify completely the message to       
532  *          which you wish to reply. ie, pathid, msgid, and trgcls.    
533  * Input: pathid - Path identification number.                          
534  *        msgid - Specifies the message ID.                
535  *        trgcls - Specifies target class.                              
536  *        flags1 - Option for path.
537  *          IPPRTY- 0x20, Specifies if you want to send priority message.        
538  *        buffer - Address of reply buffer.                             
539  *        buflen - Length of reply buffer.                              
540  * Output: residual_buffer - Address of buffer updated by the number 
541  *                    of bytes you have moved.              
542  *         residual_length - Contains one of the following values:
543  *              If the answer buffer is the same length as the reply, this field
544  *               contains zero.
545  *              If the answer buffer is longer than the reply, this field contains
546  *               the number of bytes remaining in the buffer.  
547  *              If the answer buffer is shorter than the reply, this field contains
548  *               a residual count (that is, the number of bytes remianing in the
549  *               reply that does not fit into the buffer. In this
550  *               case b2f0_result = 5.
551  * Return: Return code from CP IUCV call.                           
552  *         (-EINVAL) - Buffer address is NULL.                               
553 */
554 int iucv_reply (u16 pathid,
555                 u32 msgid,
556                 u32 trgcls,
557                 int flags1,
558                 void *buffer, ulong buflen, ulong * residual_buffer,
559                 ulong * residual_length);
560
561 /*                                                                       
562  * Name: iucv_reply_array                                                
563  * Purpose: This function responds to the two-way messages that you      
564  *          receive. You must identify completely the message to         
565  *          which you wish to reply. ie, pathid, msgid, and trgcls.      
566  *          The array identifies a list of addresses and lengths of      
567  *          discontiguous buffers that contains the reply data.          
568  * Input: pathid - Path identification number                            
569  *        msgid - Specifies the message ID. 
570  *        trgcls - Specifies target class.                                
571  *        flags1 - Option for path.
572  *          IPPRTY- 0x20, Specifies if you want to send priority message.
573  *        buffer - Address of array of reply buffers.                     
574  *        buflen - Total length of reply buffers.                         
575  * Output: residual_buffer - Address of buffer which IUCV is currently working on.
576  *         residual_length - Contains one of the following values:
577  *              If the answer buffer is the same length as the reply, this field
578  *               contains zero.
579  *              If the answer buffer is longer than the reply, this field contains
580  *               the number of bytes remaining in the buffer.
581  *              If the answer buffer is shorter than the reply, this field contains
582  *               a residual count (that is, the number of bytes remianing in the
583  *               reply that does not fit into the buffer. In this
584  *               case b2f0_result = 5.
585  * Return: Return code from CP IUCV call.                             
586  *         (-EINVAL) - Buffer address is NULL.              
587 */
588 int iucv_reply_array (u16 pathid,
589                       u32 msgid,
590                       u32 trgcls,
591                       int flags1,
592                       iucv_array_t * buffer,
593                       ulong buflen, ulong * residual_address,
594                       ulong * residual_length);
595
596 /*                                                                  
597  * Name: iucv_reply_prmmsg                                          
598  * Purpose: This function responds to the two-way messages that you 
599  *          receive. You must identify completely the message to    
600  *          which you wish to reply. ie, pathid, msgid, and trgcls. 
601  *          Prmmsg signifies the data is moved into the             
602  *          parameter list.                                         
603  * Input: pathid - Path identification number.                       
604  *        msgid - Specifies the message ID.              
605  *        trgcls - Specifies target class.                           
606  *        flags1 - Option for path.
607  *          IPPRTY- 0x20 Specifies if you want to send priority message.
608  *        prmmsg - 8-bytes of data to be placed into the parameter.  
609  *                 list.                                            
610  * Output: NA                                                       
611  * Return: Return code from CP IUCV call.                        
612 */
613 int iucv_reply_prmmsg (u16 pathid,
614                        u32 msgid, u32 trgcls, int flags1, uchar prmmsg[8]);
615
616 /*                                                                     
617  * Name: iucv_resume                                                   
618  * Purpose: This function restores communications over a quiesced path 
619  * Input: pathid - Path identification number.                          
620  *        user_data  - 16-bytes of user data.                           
621  * Output: NA                                                          
622  * Return: Return code from CP IUCV call.                           
623 */
624 int iucv_resume (u16 pathid, uchar user_data[16]);
625
626 /*                                                                   
627  * Name: iucv_send                                                   
628  * Purpose: This function transmits data to another application.     
629  *          Data to be transmitted is in a buffer and this is a      
630  *          one-way message and the receiver will not reply to the   
631  *          message.                                                 
632  * Input: pathid - Path identification number.                        
633  *        trgcls - Specifies target class.                            
634  *        srccls - Specifies the source message class.                
635  *        msgtag - Specifies a tag to be associated with the message. 
636  *        flags1 - Option for path.
637  *          IPPRTY- 0x20 Specifies if you want to send priority message.
638  *        buffer - Address of send buffer.                            
639  *        buflen - Length of send buffer.                             
640  * Output: msgid - Specifies the message ID.                         
641  * Return: Return code from CP IUCV call.                         
642  *         (-EINVAL) - Buffer address is NULL.                             
643 */
644 int iucv_send (u16 pathid,
645                u32 * msgid,
646                u32 trgcls,
647                u32 srccls, u32 msgtag, int flags1, void *buffer, ulong buflen);
648
649 /*                                                                   
650  * Name: iucv_send_array                                             
651  * Purpose: This function transmits data to another application.     
652  *          The contents of buffer is the address of the array of    
653  *          addresses and lengths of discontiguous buffers that hold 
654  *          the message text. This is a one-way message and the      
655  *          receiver will not reply to the message.                  
656  * Input: pathid - Path identification number.                        
657  *        trgcls - Specifies target class.                            
658  *        srccls - Specifies the source message class.                
659  *        msgtag - Specifies a tag to be associated witht the message.
660  *        flags1 - Option for path.
661  *          IPPRTY- specifies if you want to send priority message. 
662  *        buffer - Address of array of send buffers.                  
663  *        buflen - Total length of send buffers.                      
664  * Output: msgid - Specifies the message ID.                         
665  * Return: Return code from CP IUCV call.                         
666  *         (-EINVAL) - Buffer address is NULL.                             
667 */
668 int iucv_send_array (u16 pathid,
669                      u32 * msgid,
670                      u32 trgcls,
671                      u32 srccls,
672                      u32 msgtag,
673                      int flags1, iucv_array_t * buffer, ulong buflen);
674
675 /*                                                                     
676  * Name: iucv_send_prmmsg                                              
677  * Purpose: This function transmits data to another application.       
678  *          Prmmsg specifies that the 8-bytes of data are to be moved  
679  *          into the parameter list. This is a one-way message and the 
680  *          receiver will not reply to the message.                    
681  * Input: pathid - Path identification number.                          
682  *        trgcls - Specifies target class.                              
683  *        srccls - Specifies the source message class.                  
684  *        msgtag - Specifies a tag to be associated with the message.   
685  *        flags1 - Option for path.
686  *          IPPRTY- 0x20 specifies if you want to send priority message.
687  *        prmmsg - 8-bytes of data to be placed into parameter list.    
688  * Output: msgid - Specifies the message ID.                           
689  * Return: Return code from CP IUCV call.                           
690 */
691 int iucv_send_prmmsg (u16 pathid,
692                       u32 * msgid,
693                       u32 trgcls,
694                       u32 srccls, u32 msgtag, int flags1, uchar prmmsg[8]);
695
696 /*                                                                
697  * Name: iucv_send2way                                            
698  * Purpose: This function transmits data to another application.  
699  *          Data to be transmitted is in a buffer. The receiver   
700  *          of the send is expected to reply to the message and   
701  *          a buffer is provided into which IUCV moves the reply  
702  *          to this message.                                      
703  * Input: pathid - Path identification number.                     
704  *        trgcls - Specifies target class.                         
705  *        srccls - Specifies the source message class.             
706  *        msgtag - Specifies a tag associated with the message.    
707  *        flags1 - Option for path.
708  *          IPPRTY- 0x20 Specifies if you want to send priority message.
709  *        buffer - Address of send buffer.                         
710  *        buflen - Length of send buffer.                          
711  *        ansbuf - Address of buffer into which IUCV moves the reply of 
712  *                 this message.        
713  *        anslen - Address of length of buffer.          
714  * Output: msgid - Specifies the message ID.                      
715  * Return: Return code from CP IUCV call.                      
716  *         (-EINVAL) - Buffer or ansbuf address is NULL.    
717 */
718 int iucv_send2way (u16 pathid,
719                    u32 * msgid,
720                    u32 trgcls,
721                    u32 srccls,
722                    u32 msgtag,
723                    int flags1,
724                    void *buffer, ulong buflen, void *ansbuf, ulong anslen);
725
726 /*                                                                    
727  * Name: iucv_send2way_array                                          
728  * Purpose: This function transmits data to another application.      
729  *          The contents of buffer is the address of the array of     
730  *          addresses and lengths of discontiguous buffers that hold  
731  *          the message text. The receiver of the send is expected to 
732  *          reply to the message and a buffer is provided into which  
733  *          IUCV moves the reply to this message.                     
734  * Input: pathid - Path identification number.                         
735  *        trgcls - Specifies target class.                             
736  *        srccls - Specifies the source message class.                 
737  *        msgtag - Specifies a tag to be associated with the message.   
738  *        flags1 - Option for path.
739  *          IPPRTY- 0x20 Specifies if you want to send priority message.
740  *        buffer - Sddress of array of send buffers.                   
741  *        buflen - Total length of send buffers.                       
742  *        ansbuf - Address of array of buffer into which IUCV moves the reply            
743  *                 of this message.                         
744  *        anslen - Address of length reply buffers.              
745  * Output: msgid - Specifies the message ID.                          
746  * Return: Return code from CP IUCV call.                          
747  *         (-EINVAL) - Buffer address is NULL.                              
748 */
749 int iucv_send2way_array (u16 pathid,
750                          u32 * msgid,
751                          u32 trgcls,
752                          u32 srccls,
753                          u32 msgtag,
754                          int flags1,
755                          iucv_array_t * buffer,
756                          ulong buflen, iucv_array_t * ansbuf, ulong anslen);
757
758 /*                                                                     
759  * Name: iucv_send2way_prmmsg                                          
760  * Purpose: This function transmits data to another application.       
761  *          Prmmsg specifies that the 8-bytes of data are to be moved  
762  *          into the parameter list. This is a two-way message and the 
763  *          receiver of the message is expected to reply. A buffer     
764  *          is provided into which IUCV moves the reply to this        
765  *          message.                                                   
766  * Input: pathid - Rath identification number.                          
767  *        trgcls - Specifies target class.                              
768  *        srccls - Specifies the source message class.                  
769  *        msgtag - Specifies a tag to be associated with the message.   
770  *        flags1 - Option for path.
771  *          IPPRTY- 0x20 Specifies if you want to send priority message.
772  *        prmmsg - 8-bytes of data to be placed in parameter list.      
773  *        ansbuf - Address of buffer into which IUCV moves the reply of    
774  *                 this message.
775  *        anslen - Address of length of buffer.               
776  * Output: msgid - Specifies the message ID.                           
777  * Return: Return code from CP IUCV call.                           
778  *         (-EINVAL) - Buffer address is NULL.         
779 */
780 int iucv_send2way_prmmsg (u16 pathid,
781                           u32 * msgid,
782                           u32 trgcls,
783                           u32 srccls,
784                           u32 msgtag,
785                           ulong flags1,
786                           uchar prmmsg[8], void *ansbuf, ulong anslen);
787
788 /*                                                                      
789  * Name: iucv_send2way_prmmsg_array                                     
790  * Purpose: This function transmits data to another application.        
791  *          Prmmsg specifies that the 8-bytes of data are to be moved   
792  *          into the parameter list. This is a two-way message and the  
793  *          receiver of the message is expected to reply. A buffer      
794  *          is provided into which IUCV moves the reply to this         
795  *          message. The contents of ansbuf is the address of the       
796  *          array of addresses and lengths of discontiguous buffers     
797  *          that contain the reply.                                     
798  * Input: pathid - Path identification number.                           
799  *        trgcls - Specifies target class.                               
800  *        srccls - Specifies the source message class.                   
801  *        msgtag - Specifies a tag to be associated with the message.    
802  *        flags1 - Option for path.
803  *          IPPRTY- 0x20 specifies if you want to send priority message.
804  *        prmmsg - 8-bytes of data to be placed into the parameter list. 
805  *        ansbuf - Address of array of buffer into which IUCV moves the reply
806  *                 of this message.  
807  *        anslen - Address of length of reply buffers.                
808  * Output: msgid - Specifies the message ID.      
809  * Return: Return code from CP IUCV call.      
810  *         (-EINVAL) - Ansbuf address is NULL.          
811 */
812 int iucv_send2way_prmmsg_array (u16 pathid,
813                                 u32 * msgid,
814                                 u32 trgcls,
815                                 u32 srccls,
816                                 u32 msgtag,
817                                 int flags1,
818                                 uchar prmmsg[8],
819                                 iucv_array_t * ansbuf, ulong anslen);
820
821 /*                                                                   
822  * Name: iucv_setmask                                                
823  * Purpose: This function enables or disables the following IUCV     
824  *          external interruptions: Nonpriority and priority message 
825  *          interrupts, nonpriority and priority reply interrupts.   
826  * Input: SetMaskFlag - options for interrupts
827  *           0x80 - Nonpriority_MessagePendingInterruptsFlag         
828  *           0x40 - Priority_MessagePendingInterruptsFlag            
829  *           0x20 - Nonpriority_MessageCompletionInterruptsFlag      
830  *           0x10 - Priority_MessageCompletionInterruptsFlag         
831  *           0x08 - IUCVControlInterruptsFlag
832  * Output: NA                                                        
833  * Return: Return code from CP IUCV call.                         
834 */
835 int iucv_setmask (int SetMaskFlag);
836
837 /*                                                  
838  * Name: iucv_sever                                 
839  * Purpose: This function terminates an IUCV path.  
840  * Input: pathid - Path identification number.       
841  *        user_data - 16-bytes of user data.         
842  * Output: NA       
843  * Return: Return code from CP IUCV call.                                
844  *         (-EINVAL) - Interal error, wild pointer.       
845 */
846 int iucv_sever (u16 pathid, uchar user_data[16]);