1 /* 2 * ioctl interface for /dev/chsc 3 * 4 * Copyright IBM Corp. 2008, 2012 5 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com> 6 */ 7 8 #ifndef _ASM_CHSC_H 9 #define _ASM_CHSC_H 10 11 #include <linux/types.h> 12 #include <linux/ioctl.h> 13 #include <asm/chpid.h> 14 #include <asm/schid.h> 15 16 #define CHSC_SIZE 0x1000 17 18 struct chsc_async_header { 19 __u16 length; 20 __u16 code; 21 __u32 cmd_dependend; 22 __u32 key : 4; 23 __u32 : 28; 24 struct subchannel_id sid; 25 } __attribute__ ((packed)); 26 27 struct chsc_async_area { 28 struct chsc_async_header header; 29 __u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)]; 30 } __attribute__ ((packed)); 31 32 struct chsc_response_struct { 33 __u16 length; 34 __u16 code; 35 __u32 parms; 36 __u8 data[CHSC_SIZE - 2 * sizeof(__u16) - sizeof(__u32)]; 37 } __attribute__ ((packed)); 38 39 struct chsc_chp_cd { 40 struct chp_id chpid; 41 int m; 42 int fmt; 43 struct chsc_response_struct cpcb; 44 }; 45 46 struct chsc_cu_cd { 47 __u16 cun; 48 __u8 cssid; 49 int m; 50 int fmt; 51 struct chsc_response_struct cucb; 52 }; 53 54 struct chsc_sch_cud { 55 struct subchannel_id schid; 56 int fmt; 57 struct chsc_response_struct scub; 58 }; 59 60 struct conf_id { 61 int m; 62 __u8 cssid; 63 __u8 ssid; 64 }; 65 66 struct chsc_conf_info { 67 struct conf_id id; 68 int fmt; 69 struct chsc_response_struct scid; 70 }; 71 72 struct ccl_parm_chpid { 73 int m; 74 struct chp_id chp; 75 }; 76 77 struct ccl_parm_cssids { 78 __u8 f_cssid; 79 __u8 l_cssid; 80 }; 81 82 struct chsc_comp_list { 83 struct { 84 enum { 85 CCL_CU_ON_CHP = 1, 86 CCL_CHP_TYPE_CAP = 2, 87 CCL_CSS_IMG = 4, 88 CCL_CSS_IMG_CONF_CHAR = 5, 89 CCL_IOP_CHP = 6, 90 } ctype; 91 int fmt; 92 struct ccl_parm_chpid chpid; 93 struct ccl_parm_cssids cssids; 94 } req; 95 struct chsc_response_struct sccl; 96 }; 97 98 struct chsc_dcal { 99 struct { 100 enum { 101 DCAL_CSS_IID_PN = 4, 102 } atype; 103 __u32 list_parm[2]; 104 int fmt; 105 } req; 106 struct chsc_response_struct sdcal; 107 }; 108 109 struct chsc_cpd_info { 110 struct chp_id chpid; 111 int m; 112 int fmt; 113 int rfmt; 114 int c; 115 struct chsc_response_struct chpdb; 116 }; 117 118 #define CHSC_IOCTL_MAGIC 'c' 119 120 #define CHSC_START _IOWR(CHSC_IOCTL_MAGIC, 0x81, struct chsc_async_area) 121 #define CHSC_INFO_CHANNEL_PATH _IOWR(CHSC_IOCTL_MAGIC, 0x82, \ 122 struct chsc_chp_cd) 123 #define CHSC_INFO_CU _IOWR(CHSC_IOCTL_MAGIC, 0x83, struct chsc_cu_cd) 124 #define CHSC_INFO_SCH_CU _IOWR(CHSC_IOCTL_MAGIC, 0x84, struct chsc_sch_cud) 125 #define CHSC_INFO_CI _IOWR(CHSC_IOCTL_MAGIC, 0x85, struct chsc_conf_info) 126 #define CHSC_INFO_CCL _IOWR(CHSC_IOCTL_MAGIC, 0x86, struct chsc_comp_list) 127 #define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info) 128 #define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal) 129 130 #endif 131