📄 iucv.h
字号:
/* * drivers/s390/net/iucv.h * IUCV base support. * * S390 version * Copyright (C) 2000 IBM Corporation * Author(s):Alan Altmark (Alan_Altmark@us.ibm.com) * Xenia Tkatschow (xenia@us.ibm.com) * * * Functionality: * To explore any of the IUCV functions, one must first register * their program using iucv_register_program(). Once your program has * successfully completed a register, it can exploit the other functions. * For furthur reference on all IUCV functionality, refer to the * CP Programming Services book, also available on the web * thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 * * Definition of Return Codes * -All positive return codes including zero are reflected back * from CP except for iucv_register_program. The definition of each * return code can be found in CP Programming Services book. * Also available on the web thru www.ibm.com/s390/vm/pubs, manual # SC24-5760 * - Return Code of: * (-EINVAL) Invalid value * (-ENOMEM) storage allocation failed * pgmask defined in iucv_register_program will be set depending on input * paramters. * */#include <linux/types.h>#include <asm/debug.h>/** * Debug Facility stuff */#define IUCV_DBF_SETUP_NAME "iucv_setup"#define IUCV_DBF_SETUP_LEN 32#define IUCV_DBF_SETUP_PAGES 2#define IUCV_DBF_SETUP_NR_AREAS 1#define IUCV_DBF_SETUP_LEVEL 3#define IUCV_DBF_DATA_NAME "iucv_data"#define IUCV_DBF_DATA_LEN 128#define IUCV_DBF_DATA_PAGES 2#define IUCV_DBF_DATA_NR_AREAS 1#define IUCV_DBF_DATA_LEVEL 2#define IUCV_DBF_TRACE_NAME "iucv_trace"#define IUCV_DBF_TRACE_LEN 16#define IUCV_DBF_TRACE_PAGES 4#define IUCV_DBF_TRACE_NR_AREAS 1#define IUCV_DBF_TRACE_LEVEL 3#define IUCV_DBF_TEXT(name,level,text) \ do { \ debug_text_event(iucv_dbf_##name,level,text); \ } while (0)#define IUCV_DBF_HEX(name,level,addr,len) \ do { \ debug_event(iucv_dbf_##name,level,(void*)(addr),len); \ } while (0)DECLARE_PER_CPU(char[256], iucv_dbf_txt_buf);#define IUCV_DBF_TEXT_(name,level,text...) \ do { \ char* iucv_dbf_txt_buf = get_cpu_var(iucv_dbf_txt_buf); \ sprintf(iucv_dbf_txt_buf, text); \ debug_text_event(iucv_dbf_##name,level,iucv_dbf_txt_buf); \ put_cpu_var(iucv_dbf_txt_buf); \ } while (0)#define IUCV_DBF_SPRINTF(name,level,text...) \ do { \ debug_sprintf_event(iucv_dbf_trace, level, ##text ); \ debug_sprintf_event(iucv_dbf_trace, level, text ); \ } while (0)/** * some more debug stuff */#define IUCV_HEXDUMP16(importance,header,ptr) \PRINT_##importance(header "%02x %02x %02x %02x %02x %02x %02x %02x " \ "%02x %02x %02x %02x %02x %02x %02x %02x\n", \ *(((char*)ptr)),*(((char*)ptr)+1),*(((char*)ptr)+2), \ *(((char*)ptr)+3),*(((char*)ptr)+4),*(((char*)ptr)+5), \ *(((char*)ptr)+6),*(((char*)ptr)+7),*(((char*)ptr)+8), \ *(((char*)ptr)+9),*(((char*)ptr)+10),*(((char*)ptr)+11), \ *(((char*)ptr)+12),*(((char*)ptr)+13), \ *(((char*)ptr)+14),*(((char*)ptr)+15)); \PRINT_##importance(header "%02x %02x %02x %02x %02x %02x %02x %02x " \ "%02x %02x %02x %02x %02x %02x %02x %02x\n", \ *(((char*)ptr)+16),*(((char*)ptr)+17), \ *(((char*)ptr)+18),*(((char*)ptr)+19), \ *(((char*)ptr)+20),*(((char*)ptr)+21), \ *(((char*)ptr)+22),*(((char*)ptr)+23), \ *(((char*)ptr)+24),*(((char*)ptr)+25), \ *(((char*)ptr)+26),*(((char*)ptr)+27), \ *(((char*)ptr)+28),*(((char*)ptr)+29), \ *(((char*)ptr)+30),*(((char*)ptr)+31));static inline voidiucv_hex_dump(unsigned char *buf, size_t len){ size_t i; for (i = 0; i < len; i++) { if (i && !(i % 16)) printk("\n"); printk("%02x ", *(buf + i)); } printk("\n");}/** * end of debug stuff */#define uchar unsigned char#define ushort unsigned short#define ulong unsigned long#define iucv_handle_t void */* flags1: * All flags are defined in the field IPFLAGS1 of each function * and can be found in CP Programming Services. * IPLOCAL - Indicates the connect can only be satisfied on the * local system * IPPRTY - Indicates a priority message * IPQUSCE - Indicates you do not want to receive messages on a * path until an iucv_resume is issued * IPRMDATA - Indicates that the message is in the parameter list */#define IPLOCAL 0x01#define IPPRTY 0x20#define IPQUSCE 0x40#define IPRMDATA 0x80/* flags1_out: * All flags are defined in the output field of IPFLAGS1 for each function * and can be found in CP Programming Services. * IPNORPY - Specifies this is a one-way message and no reply is expected. * IPPRTY - Indicates a priority message is permitted. Defined in flags1. */#define IPNORPY 0x10#define Nonpriority_MessagePendingInterruptsFlag 0x80#define Priority_MessagePendingInterruptsFlag 0x40#define Nonpriority_MessageCompletionInterruptsFlag 0x20#define Priority_MessageCompletionInterruptsFlag 0x10#define IUCVControlInterruptsFlag 0x08#define AllInterrupts 0xf8/* * Mapping of external interrupt buffers should be used with the corresponding * interrupt types. * Names: iucv_ConnectionPending -> connection pending * iucv_ConnectionComplete -> connection complete * iucv_ConnectionSevered -> connection severed * iucv_ConnectionQuiesced -> connection quiesced * iucv_ConnectionResumed -> connection resumed * iucv_MessagePending -> message pending * iucv_MessageComplete -> message complete */typedef struct { u16 ippathid; uchar ipflags1; uchar iptype; u16 ipmsglim; u16 res1; uchar ipvmid[8]; uchar ipuser[16]; u32 res3; uchar ippollfg; uchar res4[3];} iucv_ConnectionPending;typedef struct { u16 ippathid; uchar ipflags1; uchar iptype; u16 ipmsglim; u16 res1; uchar res2[8]; uchar ipuser[16]; u32 res3; uchar ippollfg; uchar res4[3];} iucv_ConnectionComplete;typedef struct { u16 ippathid; uchar res1; uchar iptype; u32 res2; uchar res3[8]; uchar ipuser[16]; u32 res4; uchar ippollfg; uchar res5[3];} iucv_ConnectionSevered;typedef struct { u16 ippathid; uchar res1; uchar iptype; u32 res2; uchar res3[8]; uchar ipuser[16]; u32 res4; uchar ippollfg; uchar res5[3];} iucv_ConnectionQuiesced;typedef struct { u16 ippathid; uchar res1; uchar iptype; u32 res2; uchar res3[8]; uchar ipuser[16]; u32 res4; uchar ippollfg; uchar res5[3];} iucv_ConnectionResumed;typedef struct { u16 ippathid; uchar ipflags1; uchar iptype; u32 ipmsgid; u32 iptrgcls; union u2 { u32 iprmmsg1_u32; uchar iprmmsg1[4]; } ln1msg1; union u1 { u32 ipbfln1f; uchar iprmmsg2[4]; } ln1msg2; u32 res1[3]; u32 ipbfln2f; uchar ippollfg; uchar res2[3];} iucv_MessagePending;typedef struct { u16 ippathid; uchar ipflags1; uchar iptype; u32 ipmsgid; u32 ipaudit; uchar iprmmsg[8]; u32 ipsrccls; u32 ipmsgtag; u32 res; u32 ipbfln2f; uchar ippollfg; uchar res2[3];} iucv_MessageComplete;/* * iucv_interrupt_ops_t: Is a vector of functions that handle * IUCV interrupts. * Parameter list: * eib - is a pointer to a 40-byte area described * with one of the structures above. * pgm_data - this data is strictly for the * interrupt handler that is passed by * the application. This may be an address * or token. */typedef struct { void (*ConnectionPending) (iucv_ConnectionPending * eib, void *pgm_data); void (*ConnectionComplete) (iucv_ConnectionComplete * eib, void *pgm_data); void (*ConnectionSevered) (iucv_ConnectionSevered * eib, void *pgm_data); void (*ConnectionQuiesced) (iucv_ConnectionQuiesced * eib, void *pgm_data); void (*ConnectionResumed) (iucv_ConnectionResumed * eib, void *pgm_data);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -