blob: 65dc694725a85d29ba5d15781afff89fd717c59e [file] [log] [blame]
Cornelia Huck9d92a7e2008-07-14 09:59:05 +02001/*
2 * ioctl interface for /dev/chsc
3 *
Sebastian Ott4dcc2a42012-10-05 10:43:31 +02004 * Copyright IBM Corp. 2008, 2012
Cornelia Huck9d92a7e2008-07-14 09:59:05 +02005 * Author(s): Cornelia Huck <cornelia.huck@de.ibm.com>
6 */
7
8#ifndef _ASM_CHSC_H
9#define _ASM_CHSC_H
10
Heiko Carstens0680ba02009-01-09 12:14:52 +010011#include <linux/types.h>
Sebastian Ott4dcc2a42012-10-05 10:43:31 +020012#include <linux/ioctl.h>
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020013#include <asm/chpid.h>
14#include <asm/schid.h>
15
Sebastian Ott4dcc2a42012-10-05 10:43:31 +020016#define CHSC_SIZE 0x1000
17
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020018struct 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
27struct chsc_async_area {
28 struct chsc_async_header header;
Sebastian Ott4dcc2a42012-10-05 10:43:31 +020029 __u8 data[CHSC_SIZE - sizeof(struct chsc_async_header)];
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020030} __attribute__ ((packed));
31
Michael Holzheu64150ad2013-06-06 09:44:28 +020032struct chsc_header {
33 __u16 length;
34 __u16 code;
35} __attribute__ ((packed));
36
37struct chsc_sync_area {
38 struct chsc_header header;
39 __u8 data[CHSC_SIZE - sizeof(struct chsc_header)];
40} __attribute__ ((packed));
41
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020042struct chsc_response_struct {
43 __u16 length;
44 __u16 code;
45 __u32 parms;
Sebastian Ott4dcc2a42012-10-05 10:43:31 +020046 __u8 data[CHSC_SIZE - 2 * sizeof(__u16) - sizeof(__u32)];
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020047} __attribute__ ((packed));
48
49struct chsc_chp_cd {
50 struct chp_id chpid;
51 int m;
52 int fmt;
53 struct chsc_response_struct cpcb;
54};
55
56struct chsc_cu_cd {
57 __u16 cun;
58 __u8 cssid;
59 int m;
60 int fmt;
61 struct chsc_response_struct cucb;
62};
63
64struct chsc_sch_cud {
65 struct subchannel_id schid;
66 int fmt;
67 struct chsc_response_struct scub;
68};
69
70struct conf_id {
71 int m;
72 __u8 cssid;
73 __u8 ssid;
74};
75
76struct chsc_conf_info {
77 struct conf_id id;
78 int fmt;
79 struct chsc_response_struct scid;
80};
81
82struct ccl_parm_chpid {
83 int m;
84 struct chp_id chp;
85};
86
87struct ccl_parm_cssids {
88 __u8 f_cssid;
89 __u8 l_cssid;
90};
91
92struct chsc_comp_list {
93 struct {
94 enum {
95 CCL_CU_ON_CHP = 1,
96 CCL_CHP_TYPE_CAP = 2,
97 CCL_CSS_IMG = 4,
98 CCL_CSS_IMG_CONF_CHAR = 5,
99 CCL_IOP_CHP = 6,
100 } ctype;
101 int fmt;
102 struct ccl_parm_chpid chpid;
103 struct ccl_parm_cssids cssids;
104 } req;
105 struct chsc_response_struct sccl;
106};
107
108struct chsc_dcal {
109 struct {
110 enum {
111 DCAL_CSS_IID_PN = 4,
112 } atype;
113 __u32 list_parm[2];
114 int fmt;
115 } req;
116 struct chsc_response_struct sdcal;
117};
118
119struct chsc_cpd_info {
120 struct chp_id chpid;
121 int m;
122 int fmt;
123 int rfmt;
124 int c;
125 struct chsc_response_struct chpdb;
126};
127
128#define CHSC_IOCTL_MAGIC 'c'
129
130#define CHSC_START _IOWR(CHSC_IOCTL_MAGIC, 0x81, struct chsc_async_area)
131#define CHSC_INFO_CHANNEL_PATH _IOWR(CHSC_IOCTL_MAGIC, 0x82, \
132 struct chsc_chp_cd)
133#define CHSC_INFO_CU _IOWR(CHSC_IOCTL_MAGIC, 0x83, struct chsc_cu_cd)
134#define CHSC_INFO_SCH_CU _IOWR(CHSC_IOCTL_MAGIC, 0x84, struct chsc_sch_cud)
135#define CHSC_INFO_CI _IOWR(CHSC_IOCTL_MAGIC, 0x85, struct chsc_conf_info)
136#define CHSC_INFO_CCL _IOWR(CHSC_IOCTL_MAGIC, 0x86, struct chsc_comp_list)
137#define CHSC_INFO_CPD _IOWR(CHSC_IOCTL_MAGIC, 0x87, struct chsc_cpd_info)
138#define CHSC_INFO_DCAL _IOWR(CHSC_IOCTL_MAGIC, 0x88, struct chsc_dcal)
Michael Holzheu64150ad2013-06-06 09:44:28 +0200139#define CHSC_START_SYNC _IOWR(CHSC_IOCTL_MAGIC, 0x89, struct chsc_sync_area)
Michael Holzheue9a8f322013-06-06 09:50:21 +0200140#define CHSC_ON_CLOSE_SET _IOWR(CHSC_IOCTL_MAGIC, 0x8a, struct chsc_async_area)
141#define CHSC_ON_CLOSE_REMOVE _IO(CHSC_IOCTL_MAGIC, 0x8b)
Cornelia Huck9d92a7e2008-07-14 09:59:05 +0200142
Cornelia Huck9d92a7e2008-07-14 09:59:05 +0200143#endif