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