blob: 1c6a7f85a5819d5354acb38f91820be5767d789c [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
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020032struct chsc_response_struct {
33 __u16 length;
34 __u16 code;
35 __u32 parms;
Sebastian Ott4dcc2a42012-10-05 10:43:31 +020036 __u8 data[CHSC_SIZE - 2 * sizeof(__u16) - sizeof(__u32)];
Cornelia Huck9d92a7e2008-07-14 09:59:05 +020037} __attribute__ ((packed));
38
39struct chsc_chp_cd {
40 struct chp_id chpid;
41 int m;
42 int fmt;
43 struct chsc_response_struct cpcb;
44};
45
46struct chsc_cu_cd {
47 __u16 cun;
48 __u8 cssid;
49 int m;
50 int fmt;
51 struct chsc_response_struct cucb;
52};
53
54struct chsc_sch_cud {
55 struct subchannel_id schid;
56 int fmt;
57 struct chsc_response_struct scub;
58};
59
60struct conf_id {
61 int m;
62 __u8 cssid;
63 __u8 ssid;
64};
65
66struct chsc_conf_info {
67 struct conf_id id;
68 int fmt;
69 struct chsc_response_struct scid;
70};
71
72struct ccl_parm_chpid {
73 int m;
74 struct chp_id chp;
75};
76
77struct ccl_parm_cssids {
78 __u8 f_cssid;
79 __u8 l_cssid;
80};
81
82struct 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
98struct 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
109struct 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
Cornelia Huck9d92a7e2008-07-14 09:59:05 +0200130#endif