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