iucv.h 37 KB

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